Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 113 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
113
Dung lượng
1,79 MB
Nội dung
Chapter Transport Layer A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers) They’re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs They obviously represent a lot of work on our part In return for use, we only ask the following: If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we’d like people to use our book!) If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material Thanks and enjoy! JFK/KWR All material copyright 1996-2006 J.F Kurose and K.W Ross, All Rights Reserved Computer Networking: A Top Down Approach Featuring the Internet, 3rd edition Jim Kurose, Keith Ross Addison-Wesley, July 2004 Transport Layer 3-1 Chapter 3: Transport Layer Our goals: Ì understand principles behind transport layer services: r r r r multiplexing/demultipl exing reliable data transfer flow control congestion control Ì learn about transport layer protocols in the Internet: r r r UDP: connectionless transport TCP: connection-oriented transport TCP congestion control Transport Layer 3-2 Chapter outline Ì 3.1 Transport- layer services Ì 3.2 Multiplexing and demultiplexing Ì 3.3 Connectionless transport: UDP Ì 3.4 Principles of reliable data transfer Ì 3.5 Connection- oriented transport: TCP r r r r segment structure reliable data transfer flow control connection management Ì 3.6 Principles of congestion control Ì 3.7 TCP congestion control Transport Layer 3-3 Transport services and protocols Ì provide logical network data link physical network data link physical ca gi lo le nd -e nd network data link physical a tr network data link physical network data link physical rt po ns communication between app processes running on different hosts Ì transport protocols run in end systems r send side: breaks app messages into segments, passes to network layer r rcv side: reassembles segments into messages, passes to app layer Ì more than one transport protocol available to apps r Internet: TCP and UDP application transport network data link physical application transport network data link physical Transport Layer 3-4 Transport vs network layer Ì network layer: logical communication between hosts Ì transport layer: logical communication between processes r relies on, enhances, network layer services Household analogy: 12 kids sending letters to 12 kids Ì processes = kids Ì app messages = letters in envelopes Ì hosts = houses Ì transport protocol = Ann and Bill Ì network-layer protocol = postal service Transport Layer 3-5 Internet transport-layer protocols Ì reliable, in-order delivery (TCP) r no-frills extension of “best-effort” IP Ì services not network data link physical network data link physical rt po ns r network data link physical a tr unordered delivery: UDP nd -e nd Ì unreliable, network data link physical le r congestion control flow control connection setup network data link physical ca gi lo r application transport network data link physical application transport network data link physical available: r r delay guarantees bandwidth guarantees Transport Layer 3-6 Chapter outline Ì 3.1 Transport- layer services Ì 3.2 Multiplexing and demultiplexing Ì 3.3 Connectionless transport: UDP Ì 3.4 Principles of reliable data transfer Ì 3.5 Connection- oriented transport: TCP r r r r segment structure reliable data transfer flow control connection management Ì 3.6 Principles of congestion control Ì 3.7 TCP congestion control Transport Layer 3-7 Multiplexing/demultiplexing Multiplexing at send host: gathering data from multiple sockets, enveloping data with header (later used for demultiplexing) Demultiplexing at rcv host: delivering received segments to correct socket = socket application transport network link = process P3 P1 P1 application transport network P2 P4 application transport network link link physical host physical host physical host Transport Layer 3-8 How demultiplexing works Ì host receives IP datagrams each datagram has source IP address, destination IP address r each datagram carries transport-layer segment r each segment has source, destination port number Ì host uses IP addresses & port numbers to direct segment to appropriate socket r 32 bits source port # dest port # other header fields application data (message) TCP/UDP segment format Transport Layer 3-9 Connectionless demultiplexing Ì Create sockets with port numbers: DatagramSocket mySocket1 = new DatagramSocket(12534); DatagramSocket mySocket2 = new DatagramSocket(12535); Ì UDP socket identified by (dest two-tuple: IP address, dest port number) Ì When host receives UDP segment: r r checks destination port number in segment directs UDP segment to socket with that port number Ì IP datagrams with different source IP addresses and/or source port numbers directed to same socket Transport Layer 3- TCP Futures: TCP over “long, fat pipes” Ì Example: 1500 byte segments, 100ms RTT, want 10 Gbps throughput Ì Requires window size W = 83,333 inflight segments Ì Throughput in terms of loss rate: 1.22 ⋅ MSS RTT L Ì ➜ L = 2·10-10 Wow Ì New versions of TCP for high-speed needed! Transport Layer 3- TCP Fairness Fairness goal: if K TCP sessions share same bottleneck link of bandwidth R, each should have average rate of R/K TCP connection TCP connection bottleneck router capacity R Transport Layer 3- Why is TCP fair? Two competing sessions: Ì Additive increase gives slope of 1, as throughout Connection throughput increases Ì multiplicative decrease decreases throughput equal bandwidth share proportionally R loss: decrease window by factor of congestion avoidance: additive increase loss: decrease window by factor of congestion avoidance: additive increase Connection throughput R Transport Layer 3- Fairness (more) Fairness and UDP Ì Multimedia apps often not use TCP r not want rate throttled by congestion control Ì Instead use UDP: r pump audio/video at constant rate, tolerate packet loss Ì Research area: TCP friendly Fairness and parallel TCP connections Ì nothing prevents app from opening parallel connections between hosts Ì Web browsers this Ì Example: link of rate R supporting cnctions; r r new app asks for TCP, gets rate R/10 new app asks for 11 TCPs, gets R/2 ! Transport Layer 3- Delay modeling Notation, assumptions: Q: How long does it take to receive an object from a Web server after sending a request? Ignoring congestion, delay is influenced by: Ì TCP connection Ì Assume one link between client and server of rate R Ì S: MSS (bits) Ì O: object size (bits) Ì no retransmissions (no loss, no corruption) Window size: Ì First assume: fixed congestion window, W segments Ì Then dynamic window, modeling slow start establishment Ì data transmission delay Ì slow start Transport Layer 3- Fixed congestion window (1) First case: WS/R > RTT + S/R: ACK for first segment in window returns before window’s worth of data sent delay = 2RTT + O/R Transport Layer 3- Fixed congestion window (2) Second case: Ì WS/R < RTT + S/R: wait for ACK after sending window’s worth of data sent delay = 2RTT + O/R + (K-1)[S/R + RTT - WS/R] Transport Layer 3- TCP Delay Modeling: Slow Start (1) Now suppose window grows according to slow start Will show that the delay for one P object is: O S S Latency = RTT + + P RTT + − ( − 1) R R R where P is the number of times TCP idles at server: P = min{Q, K − 1} - where Q is the number of times the server idles if the object were of infinite size - and K is the number of windows that cover the object Transport Layer 3- TCP Delay Modeling: Slow Start (2) Delay components: • RTT for connection estab and request • O/R to transmit object • time server idles due to slow start in itia te T C P c o n n e c tio n re q u e s t o b je c t f ir s t w in d o w = S /R RTT s e c o n d w in d o w = S /R Server idles: P = min{K-1,Q} times Example: • O/S = 15 segments • K = windows •Q=2 • P = min{K-1,Q} = Server idles P=2 times t h ir d w in d o w = S /R fo u r th w in d o w = S /R c o m p le te t r a n s m is s io n o b je c t d e liv e r e d tim e a t c lie n t tim e a t s e rv e r Transport Layer 3- TCP Delay Modeling (3) S + RTT = time from when server starts to send segment R until server receives acknowledgement 2k −1 S = time to transmit the kth window R in it ia t e T C P c o n n e c tio n re q u e s t o b je c t + S S + RTT − k −1 = idle time after the kth window R R f ir s t w in d o w = S /R RTT s e c o n d w in d o w = S /R t h ir d w in d o w = S /R P O delay = + RTT + ∑ idleTime p R p =1 P O S S = + RTT + ∑ [ + RTT − k −1 ] R R k =1 R O S S = + RTT + P[ RTT + ] − (2 P − 1) R R R f o u r t h w in d o w = S /R c o m p le t e tr a n s m is s io n o b je c t d e liv e r e d tim e a t c lie n t tim e a t s e rv e r Transport Layer 3- TCP Delay Modeling (4) Recall K = number of windows that cover object How we calculate K ? K = min{k : S + 21 S + + k −1 S ≥ O} = min{k : + 21 + + k −1 ≥ O / S } O = min{k : − ≥ } S O = min{k : k ≥ log ( + 1)} S O = log ( + 1) S k Calculation of Q, number of idles for infinite-size object, is similar (see HW) Transport Layer 3- HTTP Modeling Assume Web page consists of: r base HTML page (of size O bits) r M images (each of size O bits) Ì Non-persistent HTTP: r M+1 TCP connections in series r Response time = (M+1)O/R + (M+1)2RTT + sum of idle times Ì Persistent HTTP: r RTT to request and receive base HTML file r RTT to request and receive M images r Response time = (M+1)O/R + 3RTT + sum of idle times Ì Non-persistent HTTP with X parallel connections r Suppose M/X integer r TCP connection for base file r M/X sets of parallel connections for images r Response time = (M+1)O/R + (M/X + 1)2RTT + sum of idle times Ì Transport Layer 3- HTTP Response time (in seconds) RTT = 100 msec, O = Kbytes, M=10 and X=5 20 18 16 14 12 10 non-persistent persistent parallel nonpersistent 28 100 10 Kbps Kbps Mbps Mbps For low bandwidth, connection & response time dominated by transmission time Persistent connections only give minor improvement over parallel connections Transport Layer 3- HTTP Response time (in seconds) RTT =1 sec, O = Kbytes, M=10 and X=5 70 60 50 non-persistent 40 persistent 30 20 parallel nonpersistent 10 28 Kbps 100 10 Kbps Mbps Mbps For larger RTT, response time dominated by TCP establishment & slow start delays Persistent connections now give important improvement: particularly in high delay•bandwidth networks Transport Layer 3- Chapter 3: Summary Ì principles behind transport layer services: r multiplexing, demultiplexing r reliable data transfer r flow control r congestion control Ì instantiation and implementation in the Internet r UDP r TCP Next: Ì leaving the network “edge” (application, transport layers) Ì into the network “core” Transport Layer 3- ... application transport network data link physical available: r r delay guarantees bandwidth guarantees Transport Layer 3- 6 Chapter outline Ì 3. 1 Transport- layer services Ì 3. 2 Multiplexing and... than one transport protocol available to apps r Internet: TCP and UDP application transport network data link physical application transport network data link physical Transport Layer 3- 4 Transport. .. udt_send(sndpkt) start_timer Transport Layer 3- rdt3.0 in action Transport Layer 3- rdt3.0 in action Transport Layer 3- Performance of rdt3.0 Ì rdt3.0 works, but performance stinks Ì example: Gbps link,