Computer Communication Networks Midterm Review ICEN/ICSI 416 – Fall 2017 Prof. Dola Saha 1
Instructions Put your name and student id on each sheet of paper! Ø The exam is closed book. You cannot use any computer or phone during Ø the exam. You can use calculator, but not one from your phone or laptop. You have 60 minutes to complete the exam. Be a smart exam taker - if Ø you get stuck on one problem go on to another problem. The total number of points for each question is given in parenthesis. Ø There are 100 points total. Show all your work. Partial credit is possible for an answer, but only if Ø you show the intermediate steps in obtaining the answer. If you make a mistake, it will also help the instructor show you where you made a mistake. 2
What is included? Ø Foundation Ø Application Layer Ø Transport Layer 3
Packet Switching vs Circuit Switching C R = 100 Mb/s A D R = 1.5 Mb/s B E queue of packets waiting for output link Ø Advantages Ø Disadvantages 4
Internet Protocol Stack Ø application: supporting network applications § FTP, SMTP, HTTP application Ø transport: process-process data transfer § TCP, UDP transport Ø network: routing of datagrams from source network to destination § IP, routing protocols link Ø link: data transfer between neighboring physical network elements § Ethernet, 802.11 (WiFi) Ø physical: bits “on the wire” / “over the air” 5
Encapsulation message M application segment transport H t H t M network datagram H n H n H t M link frame H l H n H t M physical source link physical switch destination network H n H t M application M link H l H n H t M H n H t M transport H t M physical network H n H t M link H l H n H t M router physical 6
Socket Ø What is a socket? § The point where a local application process attaches to the network § An interface between an application and the network § An application creates the socket Ø The interface defines operations for § Creating a socket § Attaching a socket to the network § Sending and receiving messages through the socket § Closing the socket 7
Socket programming Two socket types for two transport services: § UDP: unreliable datagram § TCP: reliable, byte stream-oriented § Server side: o DO NOT specify IP Address o By not specifying an IP Address, the application program is willing to accept connections on any of local hosts IP Addresses 8
Performance Ø Bandwidth § Width of the frequency band § Number of bits per second that can be transmitted over a communication link § 1 Mbps: 1 x 10 6 bits/second = 1x2 20 bits/sec Ø Delay § Time elapsed for a packet to travel from a sender to receiver § seconds 9
Four Sources of Packet Delay transmission A propagation B nodal queueing processing d nodal = d proc + d queue + d trans + d prop d queue : queueing delay d proc : nodal processing § time waiting at output link for § check bit errors transmission § determine output link § depends on congestion level of § typically < msec router 10
Four Sources of Packet Delay transmission A propagation B nodal queueing processing d nodal = d proc + d queue + d trans + d prop d prop : propagation delay: d trans : transmission delay: § d : length of physical link § L : packet length (bits) § s : propagation speed in medium (~2x10 8 § R : link bandwidth (bps) m/sec) § d trans = L/R § d prop = d / s d trans and d prop very different 11
Round Trip Time (RTT) Ø Time: § From packet starting to leave a node § To response came back to the same node ß ACK 12
Performance Ø Latency = Propagation + processing + transmit + queue Ø Propagation = distance/speed of light Ø Transmit = size/bandwidth Ø Processing = depends on the node (hardware + software), but fairly constant Ø Queue = congestion in the node à changes with time Ø One bit transmission => propagation is important Ø Large bytes transmission => bandwidth is important 13
Delay X Bandwidth We think the channel between a pair of processes as a hollow pipe Ø Latency (delay) length of the pipe and bandwidth the width of the pipe Ø Delay of 50 ms and bandwidth of 45 Mbps Ø 50 x 10 -3 seconds x 45 x 10 6 bits/second § 2.25 x 10 6 bits = 280 KB data. § Significance Ø § This represents the maximum amount of data the sender can send before it would be possible to receive a response Network as a pipe 14
Persistent and non-persistent HTTP persistent HTTP: non-persistent HTTP issues: Ø server leaves connection Ø requires 2 RTTs per object open after sending response Ø OS overhead for each TCP Ø subsequent HTTP messages connection between same client/server Ø browsers often open sent over open connection parallel TCP connections to Ø client sends requests as fetch referenced objects soon as it encounters a referenced object Ø as little as one RTT for all the referenced objects 15
Digital Audio (1) Ø ADC (Analog-to-Digital Converter) produces digital audio from a microphone § Telephone: 8000 8-bit samples/second (64 Kbps); computer audio is usually better quality (e.g., 16 bit) ADC Digital audio Continuous audio (sampled, 4-bit quantized) (sine wave) 16
Digital Video (3) Ø Step 1: Pixels are mapped to luminance (brightness)/chrominance (YCbCr) color space § Luma signal (Y), Chroma signal: 2 components (Cb and Cr) § Chrominance is sub-sampled, the eye is less sensitive to chrominance 8-bit luminance 8-bit chrominances for Input 24-bit RGB pixels pixels every 4 pixels 17
Streaming Stored Media (5) Ø Interleaving spreads nearby media samples over different transmissions to reduce the impact of loss Packet stream Media samples Loss reduces temporal resolution; doesn’t leave a gap 18
DNS name resolution example root DNS server host at cis.poly.edu wants IP Ø address for gaia.cs.umass.edu 2 3 TLD DNS server 4 iterated query: 5 § contacted server replies local DNS server with name of server to dns.poly.edu contact 6 7 § “I don’t know this name, but 1 8 ask this server” authoritative DNS server dns.cs.umass.edu requesting host cis.poly.edu gaia.cs.umass.edu 19
Infrastructure Services Name Resolution Ø Name resolution in practice, where the numbers 1–10 show the sequence of steps in the process. 20
BitTorrent: requesting, sending file chunks requesting chunks: sending chunks: tit-for-tat § at any given time, different peers § Alice sends chunks to those four peers have different subsets of file currently sending her chunks at chunks highest rate • other peers are choked by Alice § periodically, Alice asks each peer (do not receive chunks from her) for list of chunks that they have • re-evaluate top 4 every 10 secs § Alice requests missing chunks from peers, rarest first § every 30 secs: randomly select another peer, starts sending chunks • “ optimistically unchoke ” this peer • newly chosen peer may join top 4 21
BitTorrent: tit-for-tat (1) Alice “ optimistically unchokes ” Bob (2) Alice becomes one of Bob ’ s top-four providers; Bob reciprocates (3) Bob becomes one of Alice’s top-four providers higher upload rate: find better trading partners, get file faster ! 22
BitTorrent: another aspect Peers in a BitTorrent swarm download from other peers that may not yet have the complete file 23
UDP: User Datagram Protocol [RFC 768] Ø “ no frills, ” “ bare bones ” Ø UDP use: Internet transport § streaming multimedia apps (loss tolerant, rate sensitive) protocol § DNS Ø “ best effort ” service, UDP § SNMP segments may be: Ø reliable transfer over • lost UDP: • delivered out-of-order to app § add reliability at application Ø connectionless: layer • no handshaking between UDP § application-specific error sender, receiver recovery! • each UDP segment handled independently of others 24
UDP: segment header length, in bytes of UDP 32 bits segment, including header source port # dest port # checksum length why is there a UDP? no connection establishment § application (which can add delay) data simple: no connection state at § (payload) sender, receiver small header size § no congestion control: UDP can § UDP segment format blast away as fast as desired 25
rdt3.0: stop-and-wait operation sender receiver first packet bit transmitted, t = 0 last packet bit transmitted, t = L / R first packet bit arrives RTT last packet bit arrives, send ACK ACK arrives, send next packet, t = RTT + L / R L / R . 008 U sender = = 0.00027 = 30.008 RTT + L / R 26
Pipelined protocols pipelining: sender allows multiple, “in-flight”, yet-to-be- acknowledged pkts • range of sequence numbers must be increased • buffering at sender and/or receiver § two generic forms of pipelined protocols: go-Back-N, selective repeat 27
Pipelining: increased utilization sender receiver first packet bit transmitted, t = 0 last bit transmitted, t = L / R first packet bit arrives RTT last packet bit arrives, send ACK last bit of 2 nd packet arrives, send ACK last bit of 3 rd packet arrives, send ACK ACK arrives, send next packet, t = RTT + L / R 3-packet pipelining increases utilization by a factor of 3! 3L / R . 0024 U sender = = 0.00081 = 30.008 RTT + L / R 28
Recommend
More recommend