Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

Introduction Slides adapted from Larry Peterson and B. Farouzan Outline Applications and Features Statistical Multiplexing Inter-Process Communication Network Architecture Performance Metrics Implementation Issues Reading: Chapter 1 MU CS 4850/7850...

Introduction Slides adapted from Larry Peterson and B. Farouzan Outline Applications and Features Statistical Multiplexing Inter-Process Communication Network Architecture Performance Metrics Implementation Issues Reading: Chapter 1 MU CS 4850/7850 1 What’s a Network: Key Features Providing certain services – transport goods, mail, information or data Shared resources – used by many users, often concurrently Basic building blocks – nodes (active entities): process and transfer goods/data – links (passive medium): passive “carrier” of goods/data Typically “multi-hop” – two “end points” cannot directly reach each other – need other nodes/entities to relay MU CS 4850/7850 2 What’s a Network: “Nuts and Bolts” View network edge: millions of end-system router workstation devices: – pc’s workstations, servers server mobile – PDA’s, phones, toasters local net running network apps network core: routers, switches forwarding data – packets: packet switching regional net – calls: circuit switching communication links – fiber, copper, radio, … – Point-to-point or multiple access company net MU CS 4850/7850 3 Switched Networks A network can be defined recursively as... – two or more nodes – two or more networks connected by a link, or connected by a node MU CS 4850/7850 4 Brief History of the Internet 70’s: started as a research project, 56 kbps, < 100 computers 80-83: ARPANET and MILNET split, 85-86: NSF builds NSFNET as backbone, links 6 Supercomputer centers, 1.5 Mbps, 10,000 computers 87-90: link regional networks, NSI (NASA), ESNet(DOE), DARTnet, TWBNet (DARPA), 100,000 computers 90-92: NSFNET moves to 45 Mbps, 16 mid-level networks 94: NSF backbone dismantled, multiple private backbones Today: backbones run at >10 Gbps, >600 millions computers in >190 countries MU CS 4850/7850 5 Spring 2016 CMP_SC 4850/7850 6 The Internet today Peering point Peering point Strategies Circuit switching: carry bit streams – original telephone network Packet switching: store-and-forward messages – Internet MU CS 4850/7850 7 Addressing, Routing, and Forwarding Address: byte-string that identifies a node – usually unique – What other properties? Types of addresses – unicast: node-specific – broadcast: all nodes on the network – multicast: some subset of nodes on the network Routing: process to determine which path a packet will take through a network to reach its destination Forwarding: Operation to send an incoming packet to the correct switch/router output MU CS 4850/7850 8 Multiplexing Synchronous Time-Division Multiplexing (STDM) Frequency-Division Multiplexing (FDM) – E.g., TV channels L1 R1 L2 R2 Switch 1 Switch 2 L3 R3 MU CS 4850/7850 9 Statistical Multiplexing Used in Internet On-demand time-division Schedule link on a per-packet basis Packets from different sources interleaved on link Buffer packets that are contending for the link Buffer (queue) overflow is called congestion MU CS 4850/7850 10 Inter-Process Communication Turn host-to-host connectivity into process-to-process communication (to support common services). Fill gap between what applications expect and what the underlying technology provides. Host Host Application Channel Host Application Host Host MU CS 4850/7850 11 IPC Abstractions Request/Reply Stream-Based – distributed file systems – video: sequence of frames 1/4 NTSC = 352x240 pixels – digital libraries (web) (352 x 240 x 24)/8=247.5KB 30 fps = 7500KBps = 60Mbps – video applications on-demand video video conferencing – More demanding MU CS 4850/7850 12 What Goes Wrong in the Network? Bit-level errors (electrical interference) Packet-level errors (congestion) Link and node failures Packets are delayed Packets are delivered out-of-order Duplicate packets are delivered MU CS 4850/7850 13 Layering Architecture Use abstractions to hide complexity Abstraction naturally lead to layering Alternative abstractions at each layer Application programs Request/reply Message stream channel channel Host-to-host connectivity Hardware MU CS 4850/7850 14 Protocols Building blocks of a network architecture – protocols define format, order of msgs sent and received among network entities, and actions taken on msg transmission, receipt Each protocol object has two different interfaces – service interface: operations on this protocol (e.g., how to get a message) – peer-to-peer interface: messages exchanged with peer (e.g., definition of message format) Term “protocol” is overloaded – specification of peer-to-peer interface – module that implements this interface MU CS 4850/7850 15 Interfaces Host 1 Host 2 Service High-level interface High-level object object Protocol Peer-to-peer Protocol interface MU CS 4850/7850 16 Spring 2016 CMP_SC 4850/7850 17 TCP/IP protocol suite Application: supporting network Application Application Layer 5 applications FTP, SMTP, HTTP Transport: process-process data Transport Transport Layer 4 transfer TCP, UDP Internet Network Layer 3 Network: host-host data transfer IP, Routing protocols Data link: data transfer between neighboring network elements PPP, Ethernet Hardware Devices Physical Layer 1 Physical: bits “on the wire” Spring 2016 CMP_SC 4850/7850 18 ISO/OSI model vs. TCP/IP e.g., FTP, SMTP, HTTP (UDP, TCP) (IP, Routing Protocols) (PPP, Ethernet, etc) Spring 2016 CMP_SC 4850/7850 19 Communication through Internet Switch 1 Switch 2 Switch 3 Spring 2016 CMP_SC 4850/7850 20 Identical objects between layers in TCP/IP Identical objects (messages) Identical objects (segment or user datagram) Identical objects (datagram) Identical objects (datagram) Identical objects (frame) Identical objects (frame) Identical objects (bits) Identical objects (bits) Spring 2016 CMP_SC 4850/7850 21 Encapsulation (Header/Body) Spring 2016 CMP_SC 4850/7850 22 ISO/OSI model vs. TCP/IP e.g., FTP, SMTP, HTTP (UDP, TCP) (IP, Routing Protocols) (PPP, Ethernet, etc) Internet Architecture Defined by Internet Engineering Task Force (IETF) Hourglass Design Application vs Application Protocol (FTP, HTTP) FTP HTTP NV TFTP Transport Layer TCP UDP Internet Layer IP NET1 NET2 NETn MU CS 4850/7850 23 Implications of Hourglass A single Internet layer module: Allows all networks to interoperate – all networks technologies that support IP can exchange packets Allows all applications to function on all networks – all applications that can run on IP can use any network Simultaneous developments above and below IP MU CS 4850/7850 24 Network Performance How long does it take to transmit a data block – Latency – over single link – over a network of routers/switches connected by links Latency depends on – Initial time to set up communication (setup time) – time it takes to put data block on a link (transmit time) – length of links and link speed (propagation delay) – delay in a router (queuing delay) – Latency = setup time + transmit time + propagation delay + queuing delay Overall network performance – Throughput = Size-Of-Data-Block / Latency – Effective Bandwidth Performance Metrics Transmit time – Time it takes to put data block on a link – Determined by link bandwidth – Bandwidth data transmitted per time unit e.g., 10 Mbps (Mega-bit-per-second) notation – KB = 210 bytes = 1024 bytes; MB = 220 bytes = 1048576 bytes – Mbps = 106 bits per second – Transmit Time = Data Size / Bandwidth Propagation Delay – Determined by length of links and link speed – Propagation Delay= Distance / c c = transmission speed c = 2.0 x 108 m/s in fiber; c = 2.3 x 108 m/s in cable MU CS 4850/7850 26 Data Size: Size Bits Bits in Decimal 1 KB (KiB) 8 x 210 8,192 1 MB (MiB) 8 x 220 8,388,608 1 GB (GiB) 8 x 230 8,589,934,592 Bandwidth: BW bps bps in Decimal 1 Kbps 103 1,000 1 Mbps 106 1,000,000 1 Gbps 109 1,000,000,000 Network Performance Packet-switched networks – Network can only handle fixed-sized data packets Need to chop data block up into packets and send packets one-by-one Latency: total time between sending the first data bit to having received the last data bit – In some networks, after sending a packet, sender waits for a response from the receiver that that packet was received, before sending the next packet Need to wait RTT (Round Trip Time) between sending packets – RTT = 2 x one-way time (time for data packet + time for response) For example, if need to send 10 packets – Need 9 RTT to send first 9 packets, then 0.5 RTT for last packet to be received -> 9.5 RTT delay Exercise Calculate the total time required to transfer a 1.5 MB file, assuming an RTT of 80 ms, a packet size of 1 KB, and an initial 2xRTT of “hand- shaking” before data is sent. The bandwidth is 10 Mbps and data packets can be sent continuously. Assume transfer is completed when last bit of the last packet arrives. Sol: – [Setup Time] = 2RTT (handshake) = 0.080s x 2 = 0.160s – [Transmit Time] = 1.5 MB / 10 Mbps = 1.5 x 220 x 8 /10,000,000s = 12,582,912/10,000,000s = 1.258s – [Propagation] = RTT/2 (last packet) = 0.080s/2 = 0.04s – Total Latency = 0.160s (setup) + 1.258s (transmit) + 0.04s (propagation) = 1.458s What is the effective bandwidth (or throughput)? – 12,582,912 bits [file size in bits]/1.458s [total time] = 8.63 Mbps MU CS 4850/7850 29 Exercise Same as before, but after finishing sending each data packet, must wait one RTT before sending the next. – How does this change the calculation? – Increase in Total Latency -> decrease of Effective Bandwidth – # of packets=1.5MB/1KB = 1.5 x 220 / 210 =1536 – Increase of Total Latency by 1535 x 0.080s = 122.8s – Total Latency = 1.458s + 122.8s = 124.258s Effective Bandwidth – 12,582,912 bits /124.258 s = 101,264.4 bps = 101.26 Kbps 8.63 Mbps (previous example) MU CS 4850/7850 30 Exercise The link allows infinitely fast transmit, but limits bandwidth such that only 20 packets can be sent per RTT. – How does this change the problem? – No Transmit time. Only RTT to account for in the calculation – 1536 packets / 20 packets => 77 batches – 2 RTT(handshaking) + 76 RTT (for the first 76 batches) + 0.5 RTT (last batch) = 78.5 RTT – 78.5 x 0.08s = 6.28s Effective Bandwidth – (1.5 x (220) x 8)/6.28 bps = 2,003,648.408 bps = 2.003 Mbps MU CS 4850/7850 31 Exercise Consider a point-to-point link 50 km in length. At what bandwidth would propagation delay (at a speed of 2×108 m/s) equal transmit delay for 100-byte packets? What about 512- byte packets? Answer: – 100-byte packets: 3.2 Mbps – 512-byte packets: 16.384 Mbps MU CS 4850/7850 32 Network Performance Revisited A S1 B Calculate the total time required to transfer a 1.5 MB file from host A to host B through switch S1. The delay on link A -> S1 is 25ms and the delay on link S1 -> B is 15ms. A packet size of 1 KB is used, and an initial 2xRTT of “hand-shaking” before data is sent occurs (RTT does not include switch delay). The bandwidth is 10 Mbps on each link. S1 has a processing time of 10ms before sending out a packet (i.e., packet encoding). Assume host A sends packets continuously and transfer is completed when last packet arrives at B. MU CS4850/7850 33 Network Performance Revisited 10 ms A 25 ms 10 Mbps S1 15 ms 10 Mbps B Latency = Setup Time + Propagation + Transmit (A->S1) + Transmit (S1->B) + Switch Processing Time RTT = 2 x (25ms + 15ms) = 80ms Setup Time 2xRTT Handshaking = 2 x 80ms= 160ms = 0.16s Propagation = RTT /2 = 40ms = 0.04s MU CS4850/7850 34 Network Performance Revisited 10 ms A 25 ms 10 Mbps S1 15 ms 10 Mbps B Latency = Setup Time + Propagation + Transmit (A->S1) + Transmit (S1->B) + Switch Processing Time Transmit A -> S1 = file size /BW = 1.5 MB / 10 Mbps = 8x 1.5x 220 /10,000,000 s =1.258s Transmit S1-> B = packet size/ BW = 1 KB / 10 Mbps = 8x 210 /10,000,000 s = 0.8192 ms Switch Processing Time Switch = 10 ms 1 Packet Buffer Proc. time MU CS4850/7850 35 Network Performance Revisited 10 ms A 25 ms 10 Mbps S1 15 ms 10 Mbps B Latency = Setup Time + Propagation + Transmit (A->S1) + Transmit (S1->B) + Switch Processing Time Latency = 0.16s + 0.04s+ 1.258s + 0.8192 ms + 0.01 s = 1.469s Throughput = file size/latency = 8 x 1.5 x 220 b/ 1.469s = 8,565,631 bps = 8.566 Mbps MU CS4850/7850 36 Delay x Bandwidth Product Amount of data “in flight” or “in the pipe” Usually relative to RTT Example: 100ms x 45Mbps ≈ 560KB Delay Bandwidth MU CS 4850/7850 37 Bandwidth versus Latency Relative importance – 1-byte message: Latency dominates Bandwidth 1ms vs 100ms dominates 1Mbps vs 100Mbps – 25MB message: Bandwidth dominates Latency 1Mbps vs 100Mbps dominates 1ms vs 100ms Infinite bandwidth – RTT (measured using a small size packet) dominates Throughput = TransferSize / TransferTime – Also called effective bandwidth TransferTime = RTT + TransferSize/Bandwidth MU CS 4850/7850 38 Other Metrics Application’s bandwidth need – VBR (variable bit rate) vs CBR (constant bit rate) Delay jitter – Buffering Reliability, packet loss rate Efficiency/overhead of implementation MU CS 4850/7850 39 Implementing Network Software Socket API Creating a socket int socket(int domain, int type, int protocol) domain = PF_INET, PF_UNIX type = SOCK_STREAM, SOCK_DGRAM, SOCK_RAW Active Open (on client) int connect(int socket, struct sockaddr *addr, int addr_len) MU CS 4850/7850 40 Sockets (cont) Passive Open (on server) int bind(int socket, struct sockaddr *addr, int addr_len) int listen(int socket, int backlog) int accept(int socket, struct sockaddr *addr, int addr_len) Sending/Receiving Messages int send(int socket, char *msg, int mlen, int flags) int recv(int socket, char *buf, int blen, int flags) MU CS 4850/7850 41 Example: Simple Socket Program (Client Side) sin.sin_addr.s_addr = SERVER_IP_ADDRESS; sin.sin_port=htons(SERVER_PORT); … s=socket(PF_INET, SOCK_STREAM, 0); connect(s, (struct sockaddr *)&sin, sizeof(sin)); send(s, buf, sizeof(buf),0); close(s); MU CS 4850/7850 42 Example: Simple Socket Program (Server Side) sin.sin_addr.s_addr = INADDR_ANY; sin.sin_port=htons(SERVER_PORT); … s=socket(PF_INET, SOCK_STREAM, 0); bind(s, (struct sockaddr *)&sin, sizeof(sin)); listen(s, MAX_PENDING); while(1){ new_s=accept(s, (struct sockaddr *)&sin, &len); while (len=recv(new_s, buf, sizeof(buf),0)) fputs(buf, stdout); close(new_s); } MU CS 4850/7850 43 Introduction Summary: Applications and Features Statistical Multiplexing Inter-Process Communication Network Architecture Performance Metrics Implementation Issues MU CS 4850/7850 44

Use Quizgecko on...
Browser
Browser