Advanced Computer Networks: Lecture 32. This lecture will cover the following: TCP flow control issues; TCP bit allocation limitations; protection against wrap around; adaptive retransmission algorithm; Karn/Partridge algorithm; Jacobson/Karels algorithm;...
Trang 1CS716 Advanced Computer Networks
By Dr. Amir Qayyum
Trang 2Lecture No. 32
Trang 3• Problem: app. delivers tiny pieces of data to TCP
– e.g. telnet in character mode
– Each piece sent as segment, returned as ACK
– Very inefficient
• Solutions
– Delay transmission to accumulate more data
– Nagle’s algorithm
• Send first piece
• Accumulate data until first piece ACK’d
• Send accumulated data and restart accumulation
• Not ideal for some traffic, e.g. mouse motion
Trang 4• Problem: slow application reads data in tiny pieces
– Receiver advertises tiny window
– Sender fills tiny window
– Known as silly window syndrome
• Solution: due to Clark
– Advertise window opening only when MSS or ½ of buffer is available
– Sender delays sending until window is MSS or ½ of receiver’s buffer (estimated)
– Overridden by using PUSH
Trang 5• Send buffer size: MaxSendBuffer
• Receive buffer size: MaxRcvBuffer
• Receiving side
– LastByteRcvd LastByteRead < = MaxRcvBuffer
– AdvertisedWindow = MaxRcvBuffer
(NextByteExpected NextByteRead)
• Sending side
– LastByteSent LastByteAcked < = AdvertisedWindow – EffectiveWindow = AdvertisedWindow (LastByteSent
LastByteAcked)
– LastByteWritten LastByteAcked < = MaxSendBuffer
– block sender if (LastByteWritten LastByteAcked) + y >
MaxSenderBuffer
• Always send ACK in response to arriving data segment
• Persist when AdvertisedWindow = 0
Trang 6• Sequence numbers vs packet lifetime
– Assumed that IP packets live less than 60s
– Can we send 232 (4G) bytes in 60 seconds ?
– Only need a data rate of 573 Mbps!
– Less than an STS12 line (less than Gigabit Ethernet)
• Advertised window vs delaybandwidth
– Only 16 bits (64kB) for advertised window
– For crosscountry RTT of 100 milliseconds,
adequate for a mere 5.24 Mbps!
Trang 7• 32bit SequenceNum
Bandwidth Time Until Wrap Around T1 (1.5 Mbps) 6.4 hours
Ethernet (10 Mbps) 57 minutes T3 (45 Mbps) 13 minutes FDDI (100 Mbps) 6 minutes STS3 (155 Mbps) 4 minutes STS12 (622 Mbps) 55 seconds STS24 (1.2 Gbps) 28 seconds
Trang 8• 16bit AdvertisedWindow
Bandwidth Delay x Bandwidth Product T1 (1.5 Mbps) 18KB
Ethernet (10 Mbps) 122KB T3 (45 Mbps) 549KB FDDI (100 Mbps) 1.2MB STS3 (155 Mbps) 1.8MB STS12 (622 Mbps) 7.4MB
Trang 9• Original algorithm used only RTT estimate
• Theory: measure RTT for each
segment + its ACK
– Estimate RTT
– Timeout is 2 × RTT to allow for
variations
Trang 10• Practice
– Use exponential moving average ( = 0.8
to 0.9)
– Estimate = × estimate + (1 )
measurement
Measured
RTT depends on
Trang 11• Problem: it did not handle variations well
• Ambiguity for retransmitted packets: was ACK in
response to first, second, etc. transmission ?
Measured
RTT
time
transmission retransmission RTT ? ? ?
Trang 12Adaptive Retransmission (Original Algorithm)
• Measure SampleRTT for each segment/ACK
pair
• Compute weighted average of RTT
– EstRTT = × EstRTT + × SampleRTT
– where + = 1
between 0.8 and 0.9 between 0.1 and 0.2
• Set timeout based on EstRTT
– TimeOut = 2 × EstRTT
Trang 13• Still did not handle variations well
• Did not solve network congestion problems as desired
Sender Receiver
ion
ACK
Sender Receiver
ion
ACK
Trang 14• Estimate variance of RTT
– Calculate mean interpacket RTT deviation as
an approximation of variance
(Diff = RTT_estimate – measurement)
– RTT_estimate =
measurement
– Using another exponential moving average
– Deviation =
x |RTT_estimate measurement| + (1 ) β β deviation
Trang 15• Use variance estimate as component of RTT estimate
– next_RTT (timeout) =
RTT_estimate + 4 × deviation
• Protects against high jitter
• Algorithm only as good as clock
granularity(500ms on Unix)
• Accurate timeout mechanism important to
congestion control