Computer Communication Networks Final Review ICEN/ICSI 416 – Fall 2016 Prof. Dola Saha 1
What is included? Ø Foundation Ø Application Layer Ø Transport Layer Ø Network Layer Ø Link Layer Ø Physical Layer Ø Network Security Ø The material covered by Prof. Hany Elgala will NOT be included in the midterm. 2
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 3
Packet-switching: store-and-forward L bits per packet 1 3 2 source destination R bps R bps takes L / R seconds to transmit (push one-hop numerical example: out) L -bit packet into link at R bps § L = 7.5 Mbits store and forward: entire packet must § R = 1.5 Mbps arrive at router before it can be § one-hop transmission delay = transmitted on next link 5 sec v end-end delay = 2 L / R (assuming zero propagation delay) more on delay shortly … 4
Packet Switching: queueing delay, loss C R = 100 Mb/s A D R = 1.5 Mb/s B E queue of packets waiting for output link queuing and loss: v If arrival rate (in bits) to link exceeds transmission rate of link for a period of time: § packets will queue, wait to be transmitted on link § packets can be dropped (lost) if memory (buffer) fills up 5
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” 6
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 H n H t network M M application 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 7
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 8
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 9
Round Trip Time (RTT) Ø Time: § From packet starting to leave a node § To response came back to the same node ß ACK 10
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 11
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 1 8 § “I don’t know this name, but ask this server” authoritative DNS server dns.cs.umass.edu requesting host cis.poly.edu gaia.cs.umass.edu 12
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 13
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 ! 14
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 UDP: • lost § add reliability at application • delivered out-of-order to app layer Ø connectionless: § application-specific error • no handshaking between UDP recovery! sender, receiver • each UDP segment handled independently of others 15
TCP: Overview RFCs: 793,1122,1323, 2018, 2581 § full duplex data: § point-to-point: • bi-directional data flow in same • one sender, one receiver connection § reliable, in-order byte • MSS: maximum segment size steam: § connection-oriented: • no “message boundaries” • handshaking (exchange of § pipelined: control msgs) inits sender, • TCP congestion and flow receiver state before data control set window size exchange § flow controlled: • sender will not overwhelm receiver 16
TCP segment structure 32 bits URG: urgent data counting source port # dest port # (generally not used) by bytes sequence number of data ACK: ACK # (not segments!) acknowledgement number valid head not U A P R S F receive window PSH: push data now len used # bytes (generally not used) checksum Urg data pointer rcvr willing to accept options (variable length) RST, SYN, FIN: connection estab (setup, teardown commands) application data Internet (variable length) checksum (as in UDP) 17
TCP seq. numbers, ACKs outgoing segment from sender sequence numbers: source port # dest port # • byte stream “number” of first sequence number acknowledgement number byte in segment’s data rwnd checksum urg pointer acknowledgements: window size N • seq # of next byte expected from other side • cumulative ACK sender sequence number space Q: how receiver handles out-of- sent sent, not-yet usable not ACKed ACKed but not usable order segments (“in-flight”) yet sent • A: TCP spec doesn’t say, - up to incoming segment to sender implementor source port # dest port # sequence number acknowledgement number A rwnd checksum urg pointer 18
TCP round trip time, timeout Q: how to set TCP timeout Q: how to estimate RTT? value? SampleRTT : measured time § from segment transmission until § longer than RTT ACK receipt • but RTT varies • ignore retransmissions § too short: premature SampleRTT will vary, want § timeout, unnecessary estimated RTT “smoother” retransmissions • average several recent § too long: slow reaction to measurements, not just current segment loss SampleRTT 19
TCP round trip time, timeout EstimatedRTT = (1- α )*EstimatedRTT + α *SampleRTT § exponential weighted moving average § influence of past sample decreases exponentially fast RTT: gaia.cs.umass.edu to fantasia.eurecom.fr § typical value: α = 0.125 350 RTT: gaia.cs.umass.edu to fantasia.eurecom.fr 300 RTT (milliseconds) 250 RTT (milliseconds) 200 sampleRTT 150 EstimatedRTT 100 1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106 time (seconds) time (seconnds) Timeout = 2*EstimatedRTT SampleRTT Estimated RTT 20
Jacobson/Karels Algorithm § timeout interval: EstimatedRTT plus “safety margin” • large variation in EstimatedRTT -> larger safety margin estimate SampleRTT deviation from EstimatedRTT: § RFC 6298 § Measure of variability DevRTT = (1- β )*DevRTT + β *(|SampleRTT-EstimatedRTT| ) (typically, β = 0.25) TimeoutInterval = EstimatedRTT + 4*DevRTT estimated RTT “safety margin” 21
TCP Flow Control Ø LastByteRcvd − LastByteRead ≤ MaxRcvBuffer Ø AdvertisedWindow = MaxRcvBuffer − ((NextByteExpected − 1) − LastByteRead) Ø LastByteSent − LastByteAcked ≤ AdvertisedWindow Ø EffectiveWindow = AdvertisedWindow − (LastByteSent − LastByteAcked) Ø LastByteWritten − LastByteAcked ≤ MaxSendBuffer Ø If the sending process tries to write y bytes to TCP, but (LastByteWritten − LastByteAcked) + y > MaxSendBuffer then TCP blocks the sending process and does not allow it to generate more data. 22
TCP 3-way handshake client state server state LISTEN LISTEN choose init seq num, x send TCP SYN msg SYNSENT SYNbit=1, Seq=x choose init seq num, y send TCP SYNACK SYN RCVD msg, acking SYN SYNbit=1, Seq=y ACKbit=1; ACKnum=x+1 received SYNACK(x) indicates server is live; ESTAB send ACK for SYNACK; this segment may contain ACKbit=1, ACKnum=y+1 client-to-server data received ACK(y) indicates client is live ESTAB 23
Recommend
More recommend