340 likes | 496 Views
Improving TCP performance over wireless networks Hari Balakrishnan et al. Introduction. TCP tunes well for traditional wired networks. TCP assumes dropped packets means congestion in the network which is not necessarily true in wireless networks
E N D
Improving TCP performance over wireless networksHari Balakrishnan et al.
Introduction • TCP tunes well for traditional wired networks. • TCP assumes dropped packets means congestion in the network which is not necessarily true in wireless networks • Wireless networks with high bit-errors violate this assumption made by TCP. • Solution? • “Snoop” protocol: Improves TCP performance over the wireless networks.
Characteristics of Wireless Links • Limited and varied Bandwidth • High Latencies, High bit errors • Temporary disconnections • User Mobility
Introduction to TCP • TCP provides reliability by • Breaking application data into segments and passing it to IP • Maintains a timer waiting for the other end to acknowledge reception of the segment • When the TCP at the other end receives data it sends ack • TCP maintains checksum on its header and data to detect error. If it detects an error, the packet is discarded • Receiving TCP resequences data if necessary, passing the data to the application • TCP also provides flow control. Each end has a finite amount of buffer space
Establishing and terminating a TCP connection • Establishing a connection • The requesting end (client) sends a SYN segment specifying the port number of the server that the client wants to connect and the client’s initial sequence number • The server responds with its own SYN sequence number. The server also acks the client’s SYN by acking the client’s SYN • The client acks the SYN from the server • Terminating a connection • Client sends a FIN; Upon receiving the FIN the sever sends an ack • The server sends a FIN and the client sends as ack
Problems with TCP • TCP has been tuned for traditional wired networks. • It reacts to the packet losses as follows: - Drops transmission window size before Retransmission. - Initiates congestion control - Resets its Retransmission timer. • Result? - Unnecessary reduction in the link’s bandwidth utilization.
Design Alternatives • A few reliable transport layer protocols for wireless links have been proposed earlier. • Split Connection Approach • Fast Retransmit Approach • Link-level Retransmission Approach
Split Level Connection approach(Indirect TCP or I-TCP) • Splits a TCP connection between a Fixed Host (FH) and a Mobile Host (MH) into two. • One connects the FH and the Base Station (BS). • The other connection is between the BS and the MH.
Split Connection (cont.) • Advantage: Separation of flow control and congestion control of wireless link. • Drawbacks • Semantics: I-TCP acks are not end to end and hence violates the semantics of TCP Acks. An ack can be received by the sender even before the packet is received. • Application Re-linking: Applications on the MHs have to be re-linked with I-TCP library for socket system calls and need to use I-TCP socket system calls. • Software overhead: Every packet has to go through the TCP protocol stack and incur the associated overhead four times. Since the second connection is over one-hop wireless link, there is no need to use TCP on this link, a rather more optimized wireless link specific protocol can be used
Fast Retransmit Approach • This approach addresses the TCP performance issue when communication resumes after handoff. • TCP assumes the delay caused by handoffs are due to congestion and when timeout occurs, it reduces its widow size, and retransmits unacknowledged packets. • Generally, handoffs are completed quickly ( between a few 10s to a couple of hundred ms) • So, due to the coarse transmit timeout granularities (in the order of 500ms), a mobile host has to wait for long time before timeouts occur at the sender and packets get retransmitted. • To speed up the retransmission of lost packets due to handoff, Mobile Host sends a certain threshold number of duplicate acknowledgements to the sender. • Sender immediately reduces its window size and retransmits packets. • Drawback: Addresses only handoffs and not the error characteristics of wireless link.
Link Level Retransmission • The protocol is implemented at the data link level. • At the data-link level, it implements a retransmission protocol coupled with forward error correction. • Advantage: It improves the reliability of communication, independent of higher level protocol. • Drawbacks: • Redundant retransmission possible, because TCP also implements retransmission. So performance can degrade • A tight coupling of transport and link-level retransmissions are needed for good performance. Information about time out values need to be passed down to the data-link layer.
Observation • As we saw, each of the protocols discussed so far has a few drawbacks. • The “Snoop” protocol tries to address these issues
Snoop Protocol • Basic Idea: Cache the unacknowledged TCP data packets at the Base Station. • Perform local retransmission on receiving duplicate acks or on timeouts. • Modification: For data transfer from FH to MH, modification is done only to the routing code at the Base Station.
Snoop Protocol (cont.) • Let us look at how the protocol works in the following two cases. • Data transfer from a fixed host (FH) to a mobile host (MH). • Data transfer from a mobile host to a fixed host.
Snoop Protocol (cont.) • Data transfer from FH to MH: • Base Station routing code is modified using a module, called the “snoop” module • Snoop module monitors every packet that passes through the connection. • No transport layer code runs at the base station • Snoop module maintains a cache of TCP packets sent from the FH that have not been acknowledged yet by the MH • When a new packet arrives from the FH, the snoop module adds it to its cache and passes it on to the routing code at the base station, which performs the normal routing • The snoop module also keeps track of the acks received from the MH • When a lost packet is detected (through duplicate acks or local timeouts), it retransmits the lost packet to the MH if it has the packet cached, thus hiding the packet loss from the FH, and thereby preventing the invocation of unnecessary congestion control mechanisms
Snoop Protocol (cont.) • How does it work? The Snoop module has two associated procedures. * Snoop_data() * Snoop_ack()
Snoop_data() module • This module processes data packets from fixed host coming into the base station. Three types of packets arise. • (i) If the packet is a new packet in the normal TCP sequence • Packet is added to the snoop cache and forwarded to MH • A timestamp on one packet per transmitted window is placed in order to estimate the roundtrip time of the wireless link
Snoop_data module… • (ii) If the packet is an out-of-sequence packet that has been cached earlier (happens when dropped packets (acks) cause timeout at sender) • If the sequence number is greater than the last ack seen, it is likely the packet did not reach MH and hence is forwarded • If the sequence number is less than the last ack, then this packet has already been received by the MH. In this case, it is possible that the last ack was lost; so the snoop module at the BS generates the last ack seen and sends it to FH
Snoop_data module… • (iii) If the packet is an out-of-sequence packet that has not been cached earlier (in this case the packet was either lost earlier due to congestion or has been delivered out of order by the network) • Such a packet is forwarded to the MH and marked as having been retransmitted by sender The module Snoop_ack uses this information to process acknowledgements
Flowchart for Snoop_data module Packet Arrives • Forward Packet • Reset local retransmit counter New pkt? No Yes Sender Retransmission • Mark as congestion. • Forward Packet No In-sequence? Common Case Yes Congestion Loss *Cache packet. *Forward packet to the mobile
Snoop Acknowledgement • This module monitors and processes ack packets from mobile host coming into the base station. Several cases arise • (i) Received Ack is a new Ack: This initiates cleaning up of the snoop cache and all acked packets are freed. • The roundtrip time estimate for the wireless link is also updated at this time (note that this is done only for one packet in each window and only if no retransmissions happened in that window) • Finally, the ack is forwarded to the FH • (ii) If the ack is spurious (i.e., this ack has smaller sequence number than the one seen earlier) • The ack is simply discarded
Snoop Acknowledgement… • (iii) The ack is a duplicate ack (i.e., the next packet in sequence has not been received by the MH) • (a) the packet for which the dupack was received is not in snoop cache • If the packet is not in cache, it has to be forwarded to FH • If the packet is in cache and is marked as retransmitted by sender, then the dupack needs to be forwarded to FH because the TCP stack maintains state based on the number of dupacks
Snoop Acknowledgement… • (b) This dupack was not expected (this happens when the first dupack arrives for the packet, after a subsequent packet in the stream arrives at the Base Station) • In order to minimize such dupacks, a lost packet is retransmitted as soon as the loss is detected and at a higher priority than the normal packets (snoop also estimates the maximum number of dupacks that can arrive for a packet)
Flowchart for Snoop Ack module Ack arrives • * Free buffers • * Update RTT • * Propogate Ack • to sender. Yes New ack? No Common Case Discard No Dup ack? Yes Spurious Ack * Retransmit lost packet with high priority Yes Discard First one? No Later Dup acks for lost packets Next packet lost
Snoop Protocol (cont.) • Data transfer from a Mobile Host: Where are the bulk packet losses in a mobile network? • They are more likely to occur when packets are sent from the mobile host to the base station over the wireless link. • So, the strategy of caching at the base station alone won’t work.
Snoop Protocol (cont.) • Data transfer from a Mobile Host (cont.) Basic Idea: • The Base Station keeps track of packets lost in any transmitted window. • It generates Negative Acks (NACKs) for the lost packets and sends them to the mobile host. (the implementation of NACKs is based on the selective acknowledgment (SACK) option in TCP.) SACKs is currently not supported in most TCP implementations. • SACKs was proposed for handling multiple dropped packets in a window. The basic idea here is that in addition to cumulative acks, the receiver can inform the sender which packets it did not receive. • The snoop protocol uses SACKs to cause the MH to quickly retransmit missing packets. • So, SACKs processing should be enabled at the MH.
Snoop Protocol (cont.) • Data transfer from a Mobile Host Modifications: • At the MH, enable SACK processing • At the Base Station, SACKs are to be generated for the lost packets. • At the FH, no changes have to be made.
Implementation • Cache: Size of the cache needs to be large enough to handle maximum transmission window size. • Copy data: Data copying is avoided by reference counting mechanism present in Kernel mbufs. • The last link round trip time estimated is updated once per transmission window. • The Snoop protocol also does retransmission driven by timeouts.
Network Topology Fixed Host Ethernet Base Station Mobile Host
Implementation (cont.) • Implementation was done on a test bed consisting of IBM Think Pad laptops. • Base Stations: i486 running BSD/OS 2.0 • AT & T Wavelan with a maximum bandwidth of 2 Mbps per mobile host.
Experiment • Data transfer was done from the FH to the mobile receiver. • Sender TCP stack was based on TCP Reno, which supports fast retransmission. • Max Window Size: 64 Kbytes. • Max TCP segment size: 1460 bytes. • Poisson-distributed bit error model was used. • Error was “generated” by changing the TCP checksum of the packet at the BS.
Experimental Results. • For error rates of over 5 X 10-7, the snoop protocol performs significantly better than unmodified TCP. The throughput increased by a factor of upto 20 times. • At very low error rates, little difference was observed. Moreover, snoop then behaves as if it were not present and hence ensures no degradation in performance.
Conclusions • Snoop protocol, unlike split connection, does not violate semantics of TCP Acks. • Snoop protocol handoff times are between 10 and 25 ms as against I-TCP which varies between 265 and 1400 ms. • Snoop protocol does not perform redundant retransmission like link-level retransmission protocol.
Source “Improving TCP performance over wireless Networks.” Hari Balakrishnan, Srinivasan Seshan, Elan Amir and Randy Katz, Mobicom 1995