1.72k likes | 1.93k Views
Special Topics on Wireless Ad-hoc Networks. Lecture 6: Wireless Internet, TCP on Wireless Network. University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani. Covered topics. How to build a global wireless network? Some considerations Mobility Transport layer
E N D
Special Topicson Wireless Ad-hoc Networks Lecture 6: Wireless Internet, TCP on Wireless Network University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Computer Network
Covered topics • How to build a global wireless network? • Some considerations • Mobility • Transport layer • References • Chapter 4 of the book • Alex C. Snoeren and Hari Balakrishnan, “An End-to-End Approach to Host Mobility” • Hari Balakrishnan, Venkata N. Padmanabhan, Srinivasan Seshan and Randy H. Katz, “A Comparison of Mechanisms for Improving TCP Performance over Wireless Links” Computer Network
Outline • Layer 3 consideration: Host Mobility • TCP basics • Layer 4 consideration: • Impact of transmission errors on TCP performance • Timeout • Approaches to improve TCP performance • Approaches to improve application performance Computer Network
TCP-level mobility support • Use dynamic DNS for initial name lookup • If name changes during a connect, use TCP migrate option • If name changes between DNS lookup and TCP connection, then do another DNS lookup Computer Network
TCP-level advantages and disadvantages • No tunneling • No need to modify IP layer • Possibly more input from applications • Requires secure dynamic DNS • Scalability issue not entirely dismissable • What if both endpoints are mobile? • Need to modify multiple transport layers • More transport-level changes required than IP-level additions • Security issues more severe (1st paragraph of Section 5 is false) • Requires application-level changes for DNS retries Computer Network
Overall TCP-level questions • Are IP address changes a routing responsibility or an application responsibility? • Is this really end-to-end? • With dynamic DNS requirements, application-level changes, and TCP changes, why not just do DNS retry every time a connection fails? Computer Network
fast handoffs • Three components: • Detection time • Link layer handoffs • Layer 3 handoffs • The third one can be reduced. • Pre-registration handoff: while attached to the old one • Post-registration handoff: continue to use the old FA Computer Network
Outline • Layer 3 consideration: Host Mobility • TCP basics • Layer 4 consideration: • Impact of transmission errors on TCP performance • Timeout • Approaches to improve TCP performance • Approaches to improve application performance Computer Network
TCP Basics • Reliable ordered delivery • End-to-end semantics • Acknowledgements sent to TCP sender confirm delivery of data received by TCP receiver • Ack for data sent only after data has reached receiver • TCP window flow control is “self-clocking” • New data sent when old data is ack’d • Helps maintain “equilibrium” • Implements congestion avoidance and control Computer Network
Window Based Flow Control • TCP sender sets retransmission timer for only one packet. If ack for the timed packet is not received the packet is assumed to be lost • RTO dynamically calculated • Congestion window size bounds the amount of data that can be sent per round-trip time • Throughput <= W / RTT Computer Network
Retransmission Timeout (RTO) • RTO = mean + 4 mean deviation • Standard deviation s : s = average of (sample – mean) • Mean deviation d = average of |sample – mean| • Mean deviation easier to calculate than standard deviation • Mean deviation is more conservative: d >= s • Large variations in the RTT increase the deviation, leading to larger RTO 2 2 Computer Network
Timeout Granularity • RTT is measured as a discrete variable, in multiples of a “tick” • 1 tick = 500 ms in many implementations • smaller tick sizes in more recent implementations (e.g., Solaris) • RTO is at least 2 clock ticks • Double RTO on each timeout (Exponential backoff) Computer Network
12 8 11 10 9 7 Fast Retransmit Mechanism • Timeouts can take too long • Fast retransmit in case of packet loss • How to identify packet loss? Duplicated Acks. • Dupacks may be generated due to • packet loss, or • out-of-order packet delivery • Assumes packet loss in case of three consecutive dupacks 3 dupacks are generated if a packet is delivered at least 3 places beyond its in-sequence location Fast retransmit useful only if lower layers deliver packets “almost ordered” ---- otherwise, unnecessary fast retransmit Computer Network
Congestion Avoidance and Control Slow Start • initially, congestion window size cwnd = 1 MSS (maximum segment size) • increment window size by 1 MSS on each new ack • slow start phase ends when window size reaches the slow-start threshold • cwnd grows exponentially with time during slow start Computer Network
Congestion avoidance Slow start threshold Slow start Congestion Avoidance • On each new ack, increase cwnd by 1/cwnd packets • cwnd increases linearly with time during congestion avoidance Example assumes that acks are not delayed Computer Network
Congestion Control • TCP assume packet loss is due to congestion • On packet loss, reduces the congestion window and consequently amount of data sent per RTT • throughput may decrease Computer Network
Congestion Control -- Timeout • On a timeout, the congestion window is reduced to the initial value of 1 MSS • The slow start threshold is set to half the window size before packet loss • more precisely, ssthresh = maximum of min(cwnd,receiver’s advertised window)/2 and 2 MSS • Slow start is initiated Computer Network
After timeout cwnd = 20 ssthresh = 10 ssthresh = 8 Computer Network
Fast recovery • Fast retransmit occurs when multiple (>= 3) dupacks come back • Fast recovery follows fast retransmit • Different from timeout : slow start follows timeout • timeout occurs when no more packets are getting across • fast retransmit occurs when a packet is lost, but latter packets get through • ack clock is still there when fast retransmit occurs • no need to slow start Computer Network
Fast Recovery • ssthresh = min(cwnd, receiver’s advertised window)/2 (at least 2 MSS) • retransmit the missing segment (fast retransmit) • cwnd = ssthresh + number of dupacks • when a new ack comes: cwnd = ssthreh • enter congestion avoidance Congestion window cut into half Computer Network
After fast recovery Receiver’s advertized window After fast retransmit and fast recovery window size is reduced in half. Computer Network
Fast Recovery Fast recovery can result in a timeout with multiple losses per RTT • TCP New-Reno • stay in fast recovery until all packet losses in window are recovered • can recover 1 packet loss per RTT without causing a timeout • Selective Acknowledgements (SACK)[mathis96rfc2018] • provides information about out-of-order packets received by receiver • can recover multiple packet losses per RTT Computer Network
Outline • Host Mobility • TCP basics • Impact of transmission errors on TCP performance • Approaches to improve TCP performance • Classification • Discussion of selected approaches Computer Network
Random Errors • If number of errors is small, they may be corrected by an error correcting code • Excessive bit errors result in a packet being discarded, • Dups Acks cause Fast retransmit which results in • retransmission of lost packet • reduction in congestion window • Reducing congestion window in response to errors is unnecessary • Reduction in congestion window reduces the throughput Computer Network
Congestion Response to Errors • On a CDMA channel, errors occur due to interference from other user, and noise • Interference due to other users is an indication of congestion. If such interference causes transmission errors, it is appropriate to reduce congestion window • If noise causes errors, it is not appropriate to reduce window • When a channel is in a bad state for a long duration, it might be better to let TCP backoff, so that it does not unnecessarily attempt retransmissions while the channel remains in the bad state. Computer Network
Burst Errors May Cause Timeouts • If a wireless link remains unavailable for extended duration, • a window worth of data may be lost • Timeout might occur • Timeout results in slow start • Slow start reduces congestion window to 1 MSS, which reduces throughput • Unfortunately, TCP cannot distinguish between packet losses due to congestion and transmission errors Computer Network
Outline • Host Mobility • TCP basics • Impact of transmission errors on TCP performance • Approaches to improve TCP performance Computer Network
Improving TCP How to improve performance? • Hide error losses from the sender • Not reduce congestion window • Let sender determine cause of packet loss • if it is due to errors, it will not reduce congestion window. where modifications are needed? • At the sender node • At the receiver node • At intermediate node(s) • Combinations of the above Computer Network
Ideal Behavior • Ideal TCP behavior: TCP sender should retransmit a packet lost due to transmission errors, without taking any congestion control actions • Ideal TCP typically not realizable • Ideal network behavior: Transmission errors should be hidden from the sender -- the errors should be recovered transparently and efficiently • Proposed schemes attempt to approximate one of the above two ideals Computer Network
Various Schemes • Link level mechanisms • Split connection approach • TCP-Aware link layer • TCP-Unaware approximation of TCP-aware link layer • Explicit notification • Receiver-based discrimination • Sender-based discrimination Computer Network
Link Layer Mechanisms • Forward Error Correction (FEC) • FEC incurs overhead even when errors do not occur • Adaptive FEC schemes can reduce the overhead by choosing appropriate FEC dynamically • Link level retransmission in case of error in the link layer. • unlike FEC overhead • FEC to correct a small number of errors • link level retransmission when FEC capability is exceeded Computer Network
application application application transport transport transport network network network rxmt link link link physical physical physical wireless Link Level Retransmissions Link layer state TCP connection Computer Network
Link Level RetransmissionsIssues • How many times to retransmit at the link level before giving up? • Finite bound -- semi-reliable link layer • No bound -- reliable link layer • What triggers link level retransmissions? • Link layer timeout mechanism • Link level acks (negative acks, dupacks, …) • Other mechanisms (e.g., Snoop, as discussed later) • How much time is required for a link layer retransmission? • Small fraction of end-to-end TCP RTT • Large fraction/multiple of end-to-end TCP RTT Computer Network
Link Level RetransmissionsIssues • Should the link layer deliver packets as they arrive, or deliver them in-order? • Link layer may need to buffer packets and reorder if necessary so as to deliver packets in-order Computer Network
Link Level RetransmissionsIssues • Retransmissions can cause head-of-the-line blocking • Receiver 1 may be in a bad state, retransmissions to receiver 1 are lost, and also block a packet from being sent to receiver 2 Receiver 1 Receiver 2 Base station Computer Network
Link Level RetransmissionsIssues • Retransmissions can cause congestion losses • Retransmit a packet at the front of the queue reduces the available bandwidth, potentially making the queue at base station longer • If the queue gets full, packets may be lost, indicating congestion to the sender • Is this desirable or not ? Receiver 1 Receiver 2 Base station Computer Network
Link Level Retransmissions • The sender’s Retransmission Timeout (RTO) is a function of measured RTT (round-trip times) • Link level retransmits increase RTT, therefore, RTO • If errors not frequent, RTO will not account for RTT variations due to link level retransmissions • When errors occur, the sender may timeout & retransmit before link level retransmission is successful • Sender and link layer both retransmit • Duplicate retransmissions (interference) waste wireless bandwidth • Timeouts also result in reduced congestion window Computer Network
RTO Variations Wireless Packet loss RTT sample RTO Computer Network
A More Accurate Picture • With large RTO granularity, interference is unlikely, if time required for link-level retransmission is small compared to TCP RTO • Standard TCP RTO granularity is often large • Minimum RTO (2*granularity) is large enough to allow a small number of link level retransmissions, if link level RTT is relatively small • Interference due to timeout not a significant issue when wireless RTT small, and RTO granularity large. Computer Network
A More Accurate Picture • Frequent errors increase RTO significantly on slow wireless links • RTT on slow links large, retransmissions result in large variance, pushing RTO up • Likelihood of interference between link layer and TCP retransmissions smaller • But congestion response will be delayed due to larger RTO • When wireless losses do cause timeout, much time wasted Computer Network
A More Accurate Picture • Timeout interval may actually be larger than RTO • Retransmission timer reset on an ack • If the ack’d packet and next packet were transmitted in a burst, next packet gets an additional RTT before the timer will go off data ack 1 2 Timeout = RTO Reset, Timeout = RTO Effectively, Timeout = RTT of packet 1 + RTO Computer Network
Large TCP Retransmission Timeout Intervals • Good for reducing interference with link level retransmits • Bad for recovery from congestion losses • Need a timeout mechanism that responds appropriately for both types of losses • Open problem Computer Network
Link Level Retransmissions • Selective repeat protocols can deliver packets out of order • Significantly out-of-order delivery can trigger TCP fast retransmit • Redundant retransmission from TCP sender • Reduction in congestion window • Example: Receipt of packets 3,4,5 triggers dupacks Lost packet Retransmitted packet 6 2 5 4 3 2 1 Computer Network
Link Level RetransmissionsIn-order delivery • To avoid unnecessary fast retransmit, link layer using retransmission should attempt to deliver packets “almost in-order” 6 5 4 3 2 2 1 6 5 2 4 3 2 1 Computer Network
Link Level RetransmissionsIn-order delivery • Not all connections benefit from retransmissions or ordered delivery • audio • Need to be able to specify requirements on a per-packet basis • Should the packet be retransmitted? How many times? • Enforce in-order delivery? • Need a standard mechanism to specify the requirements • open issue (IETF PILC working group) Computer Network
Adaptive Link Layer Strategies Adaptive protocols attempt to dynamically choose: • FEC code • retransmission limit • frame size Computer Network
20 ms 1 ms 10 Mbps 2 Mbps Link Layer Retransmissions 2 Mbps wireless duplex link with 1 ms delay Exponential error model No congestion losses Computer Network
Link Layer Schemes:Summary When is a reliable link layer beneficial to TCP performance? • if it provides almost in-order delivery • TCP retransmission timeout large enough to tolerate additional delays due to link level retransmits Also • Hide wireless losses from TCP sender • Link layer modifications needed at both ends of wireless link • TCP need not be modified Computer Network
Split Connection Approach • TCP connection is broken into two connections: the wired and wireless parts • if wireless link is not last on route, then more than two TCP connections may be needed • FH - BS connection : standard TCP • BS - MH connection : selective repeat protocol on top of UDP • FH-MH = FH-BS + BS-MH FH BS MH Fixed Host Base Station Mobile Host Computer Network
application application application rxmt transport transport transport network network network link link link physical physical physical wireless Split Connection Approach • Split connection results in independent flow control for the two parts Per-TCP connection state TCP connection TCP connection Computer Network