Download presentation
Presentation is loading. Please wait.
Published byJustina Harvey Modified over 9 years ago
1
By N.Gopinath AP/CSE Unit: III Introduction to Transport layer
2
TCP Overview
3
End to end issues
4
Segment format
5
Connection establishment
7
TCP sliding window
9
Stream control Transmission Protocol
10
Simple demultiplexor
11
TCP Congestion Control Determines the network capacity Adjust the number of packets that can have safely in transit Acks to pace the transmission of packets TCP is self clocking Avoids congestion Maxwindow=MIN(CongestionWindow,AdvertisedWindow) EffectiveWindow=MaxWindow-(LastByteSent-LastByteAcked)
12
Caused By the shortage of buffer space. slow links. slow processors Possible solutions – End-to-end versus link-by-link control – Rate-Based versus Credit-Based control – The rate-based traffic-flow technique constantly – Integrated congestion control Integrated congestion control
13
Principles of Congestion Control Congestion: informally: “too many sources sending too much data too fast for network to handle” different from flow control! manifestations: – lost packets (buffer overflow at routers) – long delays (queueing in router buffers) a top-10 problem!
14
Scenario 1: Queuing Delays two senders, two receivers one router, infinite buffers no retransmission large delays when congested maximum achievable throughput unlimited shared output link buffers Host A in : original data Host B out
15
Scenario 2: Retransmits one router, finite buffers sender retransmission of lost packet finite shared output link buffers Host A in : original data Host B out ' in : original data, plus retransmitted data
16
Scenario 3: Congestion Near Receiver four senders multihop paths timeout/retransmit in Q: what happens as and increase ? in finite shared output link buffers Host A in : original data Host B out ' in : original data, plus retransmitted data
17
Approaches towards congestion control End-end congestion control: no explicit feedback from network congestion inferred from end- system observed loss, delay approach taken by TCP Network-assisted congestion control: routers provide feedback to end systems – single bit indicating congestion (SNA, DECbit, TCP/IP ECN, ATM) – explicit rate sender should send at Two broad approaches towards congestion control:
18
TCP Congestion Control end-end control (no network assistance) sender limits transmission: LastByteSent-LastByteAcked CongWin Roughly, CongWin is dynamic, function of perceived network congestion How does sender perceive congestion? loss event = timeout or 3 duplicate acks TCP sender reduces rate ( CongWin ) after loss event three mechanisms: – AIMD – slow start – conservative after timeout events rate = CongWin RTT Bytes/sec
19
TCP AIMD multiplicative decrease: cut CongWin in half after loss event additive increase: increase CongWin by 1 MSS every RTT in the absence of loss events: probing Long-lived TCP connection
20
TCP Slow Start When connection begins, CongWin = 1 MSS – Example: MSS = 500 bytes & RTT = 200 msec – initial rate = 20 kbps available bandwidth may be >> MSS/RTT – desirable to quickly ramp up to respectable rate When connection begins, increase rate exponentially fast until first loss event
21
TCP Slow Start (more) When connection begins, increase rate exponentially until first loss event: – double CongWin every RTT – done by incrementing CongWin for every ACK received Summary: initial rate is slow but ramps up exponentially fast Host A one segment RTT Host B time two segments four segments
22
Refinement (more) Q: When should the exponential increase switch to linear? A: When CongWin gets to 1/2 of its value before timeout. Implementation: Variable Threshold At loss event, Threshold is set to 1/2 of CongWin just before loss event
23
TCP sender congestion control EventStateTCP Sender ActionCommentary ACK receipt for previously unacked data Slow Start (SS) CongWin = CongWin + MSS, If (CongWin > Threshold) set state to “ Congestion Avoidance ” Resulting in a doubling of CongWin every RTT ACK receipt for previously unacked data Congestio n Avoidance (CA) CongWin = CongWin+MSS * (MSS/CongWin) Additive increase, resulting in increase of CongWin by 1 MSS every RTT Loss event detected by triple duplicate ACK SS or CAThreshold = CongWin/2, CongWin = Threshold, Set state to “ Congestion Avoidance ” Fast recovery, implementing multiplicative decrease. CongWin will not drop below 1 MSS. TimeoutSS or CAThreshold = CongWin/2, CongWin = 1 MSS, Set state to “ Slow Start ” Enter slow start Duplicate ACK SS or CAIncrement duplicate ACK count for segment being acked CongWin and Threshold not changed
24
Congestion Avoidance Mechanisms Helps to avoid congestion Additional functionality into the router to assist in anticipation of congestion to control congestion once it happens to repeatedly increase load in an effort to find the point at w hich congestion occurs, and then back off
25
Mechanisms router-centric: DECbit and RED Gateways host-centric: TCP Vegas
26
DECbit
27
DECbit Add binary congestion bit to each packet header Router – monitors average queue length over last busy+idle cycle – set congestion bit if average queue length greater than 1 w hen packet arrives – attempts to balance throughput against delay
28
DECbit End Hosts destination echos bit back to source source records how many packets resulted in set bit if less than 50% of last window's worth had bit set, then increase C ongestionWindow by 1 packet if 50% or more of last window's worth had bit set, then decrease C ongestionWindow by 0.875 times
29
29 UDP—User Datagram Protocol An unreliable, connectionless transport layer protocol UDP format. See pictureSee picture Two additional functions beyond IP: – Demultiplexing: deliver to different upper layer entities such as DNS, RTP, SNMP based on the destination port # in the header. i.e., UDP can support multiple applications in the same end systems. – (Optionally) check the integrity of entire UDP. (recall IP only checks the integrity of IP header.) If source does not want to compute checksum, fill checksum with all 0s. If compute checksum and the checksum happens to be 0s, then fill all 1s. UDP checksum computation is similar to IP checksum, with two more: – Add extra 0s to entire datagram if not multiple of 16 bits. – Add pseudoheader to the beginning of datagram. UDP pseudoheaderUDP pseudoheader
30
30 Source Port Destination Port UDP Length UDP Checksum Data 0 16 31 Figure 8.16 UDP datagram Back to UDP—User Datagram Protocol
31
31 0 0 0 0 0 0 0 0 Protocol = 17 UDP Length Source IP Address Destination IP Address 0 8 16 31 Figure 8.17 UDP pseudoheader 1.Pseudoheader is to ensure that the datagram has indeed reached the correct destination host and port. 2. The padding of 0s and pseudoheader is only for the computation of checksum and not be transmitted. Back to UDP—User Datagram Protocol
32
Thank u
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.