TCP Overview
End to end issues
Segment format
Connection establishment
TCP sliding window
Stream control Transmission Protocol
Simple demultiplexor
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)
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
Principles of Congestion Control 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!
Scenario 1: Queuing Delays unlimited shared output link buffers Host A lin : original data Host B lout two senders, two receivers one router, infinite buffers no retransmission large delays when congested maximum achievable throughput
Scenario 2: Retransmits one router, finite buffers sender retransmission of lost packet Host A lout lin : original data l'in : original data, plus retransmitted data Host B finite shared output link buffers
Scenario 3: Congestion Near Receiver four senders multihop paths timeout/retransmit l in Q: what happens as and increase ? l in Host A lout lin : original data l'in : original data, plus retransmitted data finite shared output link buffers Host B
Approaches towards congestion control Two broad 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
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
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
TCP Slow Start When connection begins, increase rate exponentially fast until first loss event 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
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 Host B one segment RTT two segments four segments time
Refinement (more) Implementation: Variable Threshold 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
TCP sender congestion control Event State TCP Sender Action Commentary 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 Congestion 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 CA Threshold = CongWin/2, CongWin = Threshold, Set state to “Congestion Avoidance” Fast recovery, implementing multiplicative decrease. CongWin will not drop below 1 MSS. Timeout CongWin = 1 MSS, Set state to “Slow Start” Enter slow start Duplicate ACK Increment duplicate ACK count for segment being acked CongWin and Threshold not changed
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 which congestion occurs, and then back off
Mechanisms router-centric: DECbit and RED Gateways host-centric: TCP Vegas
DECbit
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 when packet arrives attempts to balance throughput against delay
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 CongestionWindow by 1 packet if 50% or more of last window's worth had bit set, then decrease CongestionWindow by 0.875 times
UDP—User Datagram Protocol An unreliable, connectionless transport layer protocol UDP format. See 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 pseudoheader
Back to UDP—User Datagram Protocol UDP datagram 0 16 31 Source Port Destination Port UDP Length UDP Checksum Data Back to UDP—User Datagram Protocol Figure 8.16
Back to UDP—User Datagram Protocol UDP pseudoheader 0 8 16 31 Source IP Address Destination IP Address 0 0 0 0 0 0 0 0 Protocol = 17 UDP Length 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. Figure 8.17
Thank u