Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 106 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
106
Dung lượng
1,87 MB
Nội dung
Zo ne C om Chapter Transport Layer nh Vi en A note on the use of these ppt slides: Si 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 Computer Networking: A Top Down Approach 4th edition Jim Kurose, Keith Ross Addison-Wesley, July 2007 Thanks and enjoy! JFK/KWR All material copyright 1996-2007 J.F Kurose and K.W Ross, All Rights Reserved SinhVienZone.com Transport Layer https://fb.com/sinhvienzonevn 3-1 C Zo nh Vi en multiplexing/demultipl exing reliable data transfer flow control congestion control layer protocols in the Internet: UDP: connectionless transport TCP: connection-oriented transport TCP congestion control Si learn about transport ne Our goals: understand principles behind transport layer services: om Chapter 3: Transport Layer SinhVienZone.com Transport Layer https://fb.com/sinhvienzonevn 3-2 .C transport: TCP Si nh Vi en Zo services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented ne 3.1 Transport-layer om Chapter outline SinhVienZone.com segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control Transport Layer https://fb.com/sinhvienzonevn 3-3 Transport services and protocols C nh Vi en Zo between app processes running on different hosts transport protocols run in end systems send side: breaks app messages into segments, passes to network layer rcv side: reassembles segments into messages, passes to app layer more than one transport protocol available to apps Internet: TCP and UDP om logical communication ne provide application transport network data link physical Si application transport network data link physical SinhVienZone.com Transport Layer https://fb.com/sinhvienzonevn 3-4 network layer: logical transport layer: logical SinhVienZone.com 12 kids sending letters to 12 kids ne Zo relies on, enhances, network layer services Si nh Vi en communication between processes Household analogy: C communication between hosts om Transport vs network layer processes = kids app messages = letters in envelopes hosts = houses transport protocol = Ann and Bill network-layer protocol = postal service Transport Layer https://fb.com/sinhvienzonevn 3-5 Internet transport-layer protocols reliable, in-order om application transport network data link physical nh Vi en unreliable, unordered ne congestion control flow control connection setup Zo C delivery (TCP) delivery: UDP no-frills extension of “best-effort” IP network data link physical network data link physical network data link physicalnetwork network data link physical data link physical Si services not available: delay guarantees bandwidth guarantees SinhVienZone.com network data link physical application transport network data link physical Transport Layer https://fb.com/sinhvienzonevn 3-6 .C transport: TCP Si nh Vi en Zo services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented ne 3.1 Transport-layer om Chapter outline SinhVienZone.com segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control Transport Layer https://fb.com/sinhvienzonevn 3-7 Multiplexing/demultiplexing Multiplexing at send host: gathering data from multiple sockets, enveloping data with header (later used for demultiplexing) om Demultiplexing at rcv host: application P3 transport ne application P2 P4 network Si network physical host SinhVienZone.com application transport transport network link P1 P1 Zo = process nh Vi en = socket C delivering received segments to correct socket link link physical physical host host Transport Layer https://fb.com/sinhvienzonevn 3-8 How demultiplexing works each datagram has source IP address, destination IP address each datagram carries transport-layer segment each segment has source, destination port number host uses IP addresses & port numbers to direct segment to appropriate socket om host receives IP datagrams 32 bits source port # dest port # other header fields application data (message) Si nh Vi en Zo ne C TCP/UDP segment format SinhVienZone.com Transport Layer https://fb.com/sinhvienzonevn 3-9 Connectionless demultiplexing segment: nh Vi en Zo ne DatagramSocket mySocket1 = new DatagramSocket(12534); DatagramSocket mySocket2 = new DatagramSocket(12535); om numbers: When host receives UDP C Create sockets with port UDP socket identified by two-tuple: Si (dest IP address, dest port number) SinhVienZone.com 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 https://fb.com/sinhvienzonevn 3-10 .C transport: TCP Si nh Vi en Zo services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented ne 3.1 Transport-layer om Chapter outline SinhVienZone.com segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control Transport Layer https://fb.com/sinhvienzonevn 3-92 TCP congestion control: additive increase, multiplicative decrease om Approach: increase transmission rate (window size), probing for usable bandwidth, until loss occurs additive increase: increase CongWin by MSS every RTT until loss detected multiplicative decrease: cut CongWin in half after loss congestion window size Si Saw tooth behavior: probing for bandwidth nh Vi en Zo ne C SinhVienZone.com congestion window 24 Kbytes 16 Kbytes Kbytes time time Transport Layer https://fb.com/sinhvienzonevn 3-93 .C How does sender perceive congestion? loss event = timeout or duplicate acks TCP sender reduces rate (CongWin) after loss event three mechanisms: ne sender limits transmission: LastByteSent-LastByteAcked CongWin om TCP Congestion Control: details Zo Roughly, CongWin Bytes/sec RTT nh Vi en rate = CongWin is dynamic, function Si of perceived network congestion SinhVienZone.com AIMD slow start conservative after timeout events Transport Layer https://fb.com/sinhvienzonevn 3-94 Example: MSS = 500 bytes & RTT = 200 msec initial rate = 20 kbps Zo increase rate exponentially fast until first loss event C CongWin = MSS When connection begins, ne When connection begins, om TCP Slow Start nh Vi en available bandwidth may be >> MSS/RTT desirable to quickly ramp up to respectable rate Si SinhVienZone.com Transport Layer https://fb.com/sinhvienzonevn 3-95 om TCP Slow Start (more) When connection C RTT ne double CongWin every RTT done by incrementing CongWin for every ACK received nh Vi en Host B Zo begins, increase rate exponentially until first loss event: Host A Si Summary: initial rate is slow but ramps up exponentially fast SinhVienZone.com time Transport Layer https://fb.com/sinhvienzonevn 3-96 om Refinement: inferring loss CongWin is cut in half window then grows linearly But after timeout event: CongWin instead set to MSS; window then grows exponentially to a threshold, then grows linearly Philosophy: dup ACKs indicates network capable of delivering some segments timeout indicates a “more alarming” congestion scenario Si nh Vi en Zo ne C After dup ACKs: SinhVienZone.com Transport Layer https://fb.com/sinhvienzonevn 3-97 .C ne Zo nh Vi en Q: When should the exponential increase switch to linear? A: When CongWin gets to 1/2 of its value before timeout om Refinement Implementation: Variable Threshold Si At loss event, Threshold is set to 1/2 of CongWin just before loss event SinhVienZone.com Transport Layer https://fb.com/sinhvienzonevn 3-98 om Summary: TCP Congestion Control C When CongWin is below Threshold, sender in ne slow-start phase, window grows exponentially Zo When CongWin is above Threshold, sender is in nh Vi en congestion-avoidance phase, window grows linearly When a triple duplicate ACK occurs, Threshold Si set to CongWin/2 and CongWin set to Threshold When timeout occurs, Threshold set to CongWin/2 and CongWin is set to MSS SinhVienZone.com Transport Layer https://fb.com/sinhvienzonevn 3-99 State Event TCP Sender Action om TCP sender congestion control Commentary ACK receipt for previously unacked data CongWin = CongWin + MSS, If (CongWin > Threshold) set state to “Congestion Avoidance” Congestion Avoidance (CA) ACK receipt for previously unacked data CongWin = CongWin+MSS * (MSS/CongWin) SS or CA Loss event detected by triple duplicate ACK Threshold = CongWin/2, CongWin = Threshold, Set state to “Congestion Avoidance” Fast recovery, implementing multiplicative decrease CongWin will not drop below MSS SS or CA Timeout Threshold = CongWin/2, CongWin = MSS, Set state to “Slow Start” Enter slow start SS or CA Duplicate ACK Increment duplicate ACK count for segment being acked CongWin and Threshold not changed ne Zo nh Vi en Si SinhVienZone.com Resulting in a doubling of CongWin every RTT C Slow Start (SS) Additive increase, resulting in increase of CongWin by MSS every RTT Transport Layer 3-100 https://fb.com/sinhvienzonevn om TCP throughput What‟s the average throughout of TCP as a Ignore slow start ne C function of window size and RTT? Zo Let W be the window size when loss occurs nh Vi en When window is W, throughput is W/RTT Just after loss, window drops to W/2, Si throughput to W/2RTT Average throughout: 75 W/RTT SinhVienZone.com Transport Layer 3-101 https://fb.com/sinhvienzonevn om TCP Futures: TCP over “long, fat pipes” Example: 1500 byte segments, 100ms RTT, want 10 nh Vi en Zo ne C Gbps throughput Requires window size W = 83,333 in-flight segments Throughput in terms of loss rate: 22 RTT L Wow Si ➜ L = 2·10-10 MSS New versions of TCP for high-speed SinhVienZone.com Transport Layer 3-102 https://fb.com/sinhvienzonevn TCP Fairness Zo ne C om Fairness goal: if K TCP sessions share same bottleneck link of bandwidth R, each should have average rate of R/K nh Vi en TCP connection Si TCP connection SinhVienZone.com bottleneck router capacity R Transport Layer 3-103 https://fb.com/sinhvienzonevn Why is TCP fair? om Two competing sessions: C Additive increase gives slope of 1, as throughout increases ne multiplicative decrease decreases throughput proportionally equal bandwidth share nh Vi en Zo R Si loss: decrease window by factor of congestion avoidance: additive increase loss: decrease window by factor of congestion avoidance: additive increase Connection throughput R SinhVienZone.com Transport Layer 3-104 https://fb.com/sinhvienzonevn Fairness (more) om C not want rate throttled by congestion control Zo Fairness and parallel TCP connections nothing prevents app from opening parallel connections between hosts Web browsers this Example: link of rate R supporting connections; ne Fairness and UDP Multimedia apps often not use TCP nh Vi en Instead use UDP: pump audio/video at constant rate, tolerate packet loss friendly Si Research area: TCP SinhVienZone.com new app asks for TCP, gets rate R/10 new app asks for 11 TCPs, gets R/2 ! Transport Layer 3-105 https://fb.com/sinhvienzonevn Chapter 3: Summary Si nh Vi en Zo C ne layer services: multiplexing, demultiplexing reliable data transfer flow control congestion control instantiation and implementation in the Internet UDP TCP om principles behind transport SinhVienZone.com Next: leaving the network “edge” (application, transport layers) into the network “core” Transport Layer 3-106 https://fb.com/sinhvienzonevn ... SinhVienZone.com Transport Layer https://fb.com/sinhvienzonevn 3- 2 .C transport: TCP Si nh Vi en Zo services 3. 2 Multiplexing and demultiplexing 3. 3 Connectionless transport: UDP 3. 4 Principles... transport network data link physical Transport Layer https://fb.com/sinhvienzonevn 3- 6 .C transport: TCP Si nh Vi en Zo services 3. 2 Multiplexing and demultiplexing 3. 3 Connectionless transport: ... SinhVienZone.com Transport Layer https://fb.com/sinhvienzonevn 3- 19 .C transport: TCP Si nh Vi en Zo services 3. 2 Multiplexing and demultiplexing 3. 3 Connectionless transport: UDP 3. 4 Principles