700 likes | 902 Views
Mobile Networks. Module F Transport Layer over Wireless Networks + Voice over IP (VoIP). JP Hubaux, P. Papadimitratos and M. Poturalski. http://mobnet.epfl.ch. Some slides adapted from Jochen H. Schiller , Nitin Vaidya, and James Kurose & Keith Ross. Outline. TCP in Mobile Networks
E N D
Mobile Networks Module FTransport Layer over Wireless Networks + Voice over IP (VoIP) JP Hubaux, P. Papadimitratos and M. Poturalski http://mobnet.epfl.ch Some slides adapted fromJochen H. Schiller, Nitin Vaidya, and James Kurose & Keith Ross
Outline • TCP in Mobile Networks • Real-time traffic in MobileNetworks
Reminder: Transmission Control Protocol Host A Host B SYN, Seq_no = x SYN, Seq_no = y, ACK, Ack_no = x+1 Seq_no = x+1, ACK, Ack_no = y+1 • Reliable, in-order data delivery • Flow control • Congestion avoidance and control • End-to-end semantics
TCP basic operation Application writes bytes in send buffer Application reads bytes from receive buffer Write 45 bytes Write 15 bytes Write 20 bytes Read 40 bytes Read 40 bytes Application layer Transport layer Segments Send buffer Receive buffer ACKs Sender Receiver Internet
TCP flow control • Flow control is a speed-matching service • Sender adjusts the transmission rate to the receiver • Receiver advertises the remaining buffer space (rwnd)to the sender • The sender keeps unacknowledged data below rwndLastByteSent – LastByteAcked ≤ rwnd
Congestion Light traffic • Arrival Rate << R • Low delay • Can accommodate more Congestion onset • Arrival rate approaches R • Delay increases rapidly • Throughput begins to saturate Saturation • Arrival rate > R • Large delays, packet loss • Useful application throughput drops R Throughput (bps) Arrival Rate Delay (sec) Arrival Rate R
TCP congestion control cwnd Time (expressed in RTTs) • Keeps TCP off the congestion collapse cliff • Congestion window mechanismLastByteSent – LastByteAcked ≤ min{cwnd, rwnd} • Slow Start phase • Increase congestion window size (cwnd) by one segment for each received ACK • Congestion window increases exponentially Segment ACK
TCP congestion control cwnd ssthresh • Congestion Avoidance phase • Congestion thresholdssthresh • When cwnd > ssthresh, increase cwnd slowly • cwnd++ per round-trip-time (RTT) • Each time an ACK arrives, cwnd is increased by 1/cwnd • In one RTT, cwnd segments are sent, so total increase in cwnd is cwnd x 1/cwnd = 1 • cwnd grows linearly Time (expressed in RTTs)
TCP congestion control Congestion detection: Timeout or Receipt of duplicate ACKs(Fast Retransmit) Assumption: current cwnd corresponds to available bandwidth TCP Tahoe ssthresh = ½ cwnd cwnd = 1 Go back to Slow Start Over several cycles expect to converge to ssthresh equal to about ½ the available bandwidth Congestion Avoidance Time-out ssthresh Congestion window Slow Start 0 Time (expressed in RTTs)
TCP congestion control • Fast Retransmit mechanism • If a segment is dropped, subsequent segments trigger duplicate ACKs • Sender retransmits segment instantly (without waiting for a timeout) when duplicate ACKs are received (typically 3) • Improves performance • Faster reaction to packet loss • Implemented in TCP-Reno (more recent than TCP-Tahoe) SEQ=1 ACK=1 SEQ=2 SEQ=3 SEQ=4 ACK=1 SEQ=5 ACK=1 ACK=1
Wireless and Mobile Networks Wireline Communication Internet Mobile Host (1) Access Point Wireless Communication Base Station Mobile Host (2)
Wireless and Mobile Networks • Wireless transmission errors • High Bit Error Rates • Packet (frame) loss Internet Mobile Host (1) Access Point
Wireless and Mobile Networks • Mobility • Disconnection • Hand-offs • Delays Internet Base Station (B) Mobile Host (2) Base Station (A) Mobile Host (2)
Challenge • TCP • Assumptions for the Wireline Internet • Packet loss only due to congestion • Packet loss is rare • Wireless and mobile networks • TCP assumptions are not valid • Problem: TCP under-performs • TCP cannotdistinguish between packet losses due to congestion and transmission or disconnection errors • Reducing the congestion window when an error or a disconnection occurs is notnecessary • Throughput suffers
Questions • What can we do about… • transmission errors? • errors due to mobility? • Which part of the system functionality should we modify… • The sender? • The receiver? • An intermediate node? • Some or all of the above?
Directions • Transmissions errors • Hide error losses from the sender • If the sender is unaware of the packet losses due to errors, it does not reduce the congestion window • Inform sender of packet loss cause • If the loss is due to an error, the congestion window is not reduced • Errors due to mobility • Hide mobility from the TCP sender • Make TCP adaptive to mobility
Solution classification • Split-connection approaches • Split a TCP connection into two: the wire-line part and wire-less part at a Base Station or Access Point (Foreign Agent) • Link layer approaches • Improve link layer reliability • End-to-end approaches • Modify TCP congestion control mechanism • Hybrid approaches
Indirect TCP (I-TCP) Access Point (Foreign Agent) Internet Mobile Host • Split the TCP connection at the FA into two parts • FA buffers and retransmits received segments • FA sends ACKs for the received segments • Standard TCP on the wire-line link • On the wireless link: • TCP optimized for wireless • Even standard TCP benefits from shorter RTT • Shorter timeout • Faster retransmissions Standard TCP “Wireless” TCP
I-TCP example Foreign Agent Correspondent Host Mobile Host segment 1 segment 2 segment 1 segment 3 ack 1 segment 2 ack 1 segment 2 ack 2 ack 2 segment 3 ack 3 ack 3 segment 2 timeout (short timeout thanks to short RTT)
I-TCP and mobility • Moving to a new foreign agent (FA) requires transfer of socket state • Including segments buffered at the FA Access Point (2) Socket migration and state transfer Internet Mobile Host Access point (1)
I-TCP summary • I-TCP Advantages • No changes in the fixed network or hosts (TCP protocol), all current TCP optimizations still work • Potentially no changes in mobile hosts • Wireless transmission errors do not “propagate” to the wire-line network • I-TCP Disadvantages • Loss of end-to-end semantics • An ACK does not imply that the receiver got the segment; what if the foreign agent crashes? • For mobility support, all FAs need to be I-TCP compatible, and the state needs to be transferred to maintain end-to-end semantics • Higher end-to-end delays due to buffering and forwarding to a new agent • Problem with security mechanisms, e.g. IPsec • FA needs to spoof ACKs
Mobile TCP (M-TCP) Access Point (Foreign Agent) Internet Mobile Host • Handling of long and frequent disconnections • Splits connection at FA as I-TCP does • Foreign agent • No caching, no retransmission • Monitors all packets • If it detects a disconnection (no ACKs from MN for a while) • Reports rwnd = 0 to sender • Sender automatically goes into “persist” mode: Does not timeout or in any other way change the congestion window Standard TCP “Wireless” TCP
M-TCP summary • M-TCP advantages • End-to-end semantics preserved • Moving to another FA does not require forwarding buffered packets to new FA (since FA does no buffering) • M-TCP disadvantages • Wireless link loss propagates to the wire-line network • Packets lost due to link errors need to be retransmitted by the sender • Problems with security mechanisms (just like I-TCP) • M-TCP handles mobility errors, not transmission errors
Hybrid approach similar to M-TCP • The link layer is typically in a better position to detect mobility than the transport layer • Link layer is often aware of ongoing handoffs • In contrast, M-TCP detects disconnections only after a connection is closed, based on missing ACKs • Hence, the link layer can trigger putting the sender (and possibly the MH) into “persistent” mode
Snooping TCP Local Retransmission Correspondent Host Foreign Agent • “TCP-Aware Link Layer” • Splits connection like I-TCP and M-TCP • FA buffers and retransmits segments (if necessary) • FA does not ACK buffered packets as I-TCP does (preserves end-to-end semantics) Internet Snooping of ACKs Buffering of data Mobile Host End-to-end TCP connection
Snooping TCP: data transfer • Data transfer to the Mobile Host • FA buffers a segment until it receives an ACK from the MH • FA detects segment loss via duplicate ACKs or a timeout • FA timeout is shorter than the round-trip timeout (RTO) at the sender • FA locally retransmits lost segments • FA drops duplicated ACKs from MH • Prevents unnecessary retransmissions and congestion window reductions at the sender • Does not violate end-to-end semantics:Even if the FA crashes before MH receives the segment, the sender will eventually detect the loss via a timeout and retransmit
Snooping TCP: data transfer • Data transfer from the Mobile Host • FA detects segment loss on the wireless link via missing sequence numbers • FA triggers retransmission of lost segment at MH • E.g., with a NACK mechanism • MH retransmits data with a much shorter delay Foreign Agent Mobile Host SEQ=1000 SEQ=1100 SEQ=1200 NACK=1100 SEQ=1100
Snooping TCP and mobility • When the MH moves to a new FA, should the buffered segments be transferred from the old FA? • Not necessary • Even if some of the buffered segments are lost in the transition, the sender will eventually timeout and retransmit them • This preserves end-to-end semantics • Yet, this buffer transfer would improve performance because the timeout puts the sender into slow start phase
Snooping TCP summary • Snooping TCP advantages • End-to-end semantics preserved • No changes in the Correspondent Host (CH) required • Transfer of buffered segments not necessary during handoff • MH can move to FA without Snoop TCP support • Snooping TCP disadvantages • Does not isolate wireless link failures as well as I-TCP does • If FA takes too long to retransmit a segment, CH will timeout • Requires modifications at Mobile Host • NACK or similar mechanism to force retransmission • Snooping cannot be done if TCP headers are encrypted (like in IPsec EPS; application layer security, e.g. TLS, is compatible) • Dropping duplicate ACKs can break integrity
Performance enhancing proxies (PEP) wireless Internet PEP Corr. Host Mobile Host • Transport layer proxies • Local retransmissions and acknowledgements • Any of the approaches reviewed above qualifies • Application layer proxies • HTTP, FTP, … • Content cashing, filtering, compression, picture downscaling • Big problem: breaks security end-to-end semantics • Disables use of IP security • Choose between PEP and security!
Deployment in practice • [Wei06] reports that split-connection (similar to I-TCP) and application layer proxies are used by US cellular operators (GPRS and CDMA2000 networks) • Deployed mechanism depends on traffic
Forward Error Correction (FEC) • FEC: Introduce redundancy in the packet, allowing a receiver to correct a limited number of errors • Increasingly popular in wireless standards • Repetition and Hamming codes in Bluetooth • Convolutional codes in IEEE 802.11a • Reed-Solomon + convolutional codes in WiMax • Turbo codes in HSDPA • LDPC in IEEE 802.11n • Helps to avoid retransmissions • Shorter and less variable transmission time • Increases computational and bandwidth overhead • Less of a concern nowadays thanks to Moore’s law
Efficient link layer handoff: IEEE 802.11r • Handoff without IEEE 802.11r • MH discovers new AP • MH authenticates with new AP • MH (re)associates with new AP • MH and new AP generate and confirm shared temporal keys (based on PSK or IEEE 802.1X) • MH requests QoS resources • Data communication with new AP can start communication with old AP still possible communication with old AP no longer possible • IEEE 802.11r allows key generation and QoS resource allocation (steps 4 and 5) to take place prior or during (re)association (step 3)
Fast Retransmit and Fast Recovery • Assumptions • Congestion causes many segments to be dropped • If a single segment is dropped, but the triggered duplicate ACKs are delivered, the network is probably not congested • Hence • No need for drastic reduction of congestion window (as in TCP Tahoe) • Fast Recovery phase SEQ=1 ACK=1 SEQ=2 SEQ=3 SEQ=4 ACK=1 SEQ=5 ACK=1 ACK=1
TCP Tahoe vs TCP Reno • 3 duplicate ACKs arrive • Fast Retransmit: instantly retransmit 1st lost segment • ssthresh = ½cwnd • cwnd = 1 • Enter Slow Start • 3 duplicate ACKs arrive • Fast Retransmit: instantly retransmit 1st lost segment • ssthresh = ½cwnd • cwnd = ssthresh + 3 • Enter Fast Recovery • Fast Recovery • Increase cwnd by 1 segment for every duplicate ACK received • When new ACK received • cwnd = ssthresh • Enter Congestion Avoidance • If a timeout occurs • Reset cwnd to 1 • Enter Slow Start Every duplicate ACK received indicates a delivered segment A new segment can be transmitted
TCP Reno vs TCP new-Reno • Fast Recovery • Increase cwnd by 1 segment for every duplicate ACK received • When new ACK received • cwnd = ssthresh • Enter Congestion Avoidance • If a timeout occurs • Reset cwnd to 1 • Enter Slow Start • Fast Recovery (FR) • Note last segment transmitted before entering FR as n • Increase cwnd by 1 segment for every duplicate ACK received • When new partialACK received (for k < n) • Retransmit 1st unacked segment • Remain in Fast Recovery • When ACK for n received • cwnd = ssthresh • Enter Congestion Avoidance • If a timeout occurs • Reset cwnd to 1 • Enter Slow Start
Performance comparison of TCP variants Congestion avoidance Triple duplicate ACK 20 Time-out • With single packet lost in congestion window, TCP Reno and TCP new-Reno avoid Slow Start, and outperform TCP Tahoe • cwnd oscillates around the optimal • With multiple packet lost per congestion window (not shown in the figure), TCP Reno underperforms severely; new-Reno introduced to resolve this • Bursty packet loss common in mobile networks 15 cwnd 10 Slow start 5 0 Behavior of Reno and new-Reno Time (expressed in RTTs)
Selective acknowledgment (SACK) • TCP acknowledgements are cumulative • ACK n acknowledges correct and in-sequence receipt of packets up to n • The sender only learns about the first lost segment • What if more segments are lost? • Selective retransmission as one solution • RFC2018 allows for acknowledgements of single packets, not only acknowledgements of in-sequence packet streams without gaps • Sender can retransmit missing packets more efficiently • Advantage • Higher efficiency • Disadvantage • More complex software in the receiver, more buffer needed at the receiver (CPU-, memory- and power-constraint MH)
Long disconnections timeout Correspondent Host • TCP doubles RTO each time a timeout occurs • Can cause unnecessary idle time after longer disconnection segment n+1 segment n+1 segment n+1 segment n+1 segment n+1 connection idle MH disconnected MH connected Mobile Host
Long disconnections timeout Fast Retransmission triggered Correspondent Host • TCP doubles RTO each time a timeout occurs • Can cause unnecessary idle time after longer disconnection • A Mobile Host aware of connection state can “wake up” the CH • Trigger fast retransmit with duplicate ACKs • Simple solution • No changes at CH necessary • But TCP at MH needs to be aware of connectivity segment n+1 segment n+1 segment n+1 ack n segment n+1 segment n+1 MH disconnected MH connected Mobile Host
Transaction oriented TCP (T-TCP) • TCP phases • Connection setup, data transmission, connection release • Using 3-way-handshake needs 3 packets for setup and release, respectively • Thus, even short messages need a minimum of 7 packets! • Transaction oriented TCP • RFC1644 describes a TCP version to avoid this overhead • Connection setup, data transfer and connection release can be combined • Thus, only 2 or 3 packets are needed • Advantage • Efficiency for single packet transaction • Disadvantage • Requires TCP modifications at all hosts
Explicit notification approaches • Explicit congestion notification • Instead of TCP indirectly inferring congestion, let routers and/or other hosts inform the sender/receiver directly • Requires changes to TCP and the routing infrastructure • Explicit bad state notification • Base Station/Access Point (FA) keeps track of wireless link conditions • Bad link conditions are signal to the Correspondent Host • Correspondent Host reacts accordingly • Reduces/freezes transmission rate • Resumes transmission at previous rate when good state notification arrives • Requires using a FA and making changes to TCP at all hosts
Conclusions • Many proposed techniques • Different characteristics and requirements • TCP used in more heterogeneous networks nowadays • Mobile networks • Over satellite links • Wide-spanning high-bandwidth networks • Can a single TCP protocol perform in these settings? • Or should we develop specialized TCP versions (and split TCP connections when possible)?
References • H. Elaarg, Improving TCP Performance over Mobile Networks, ACM Computing Surveys, Vol. 34, No. 3, September 2002 • J. Huang et al., Anatomizing Application Performance Differences on Smartphones, MobiSys 2010 • A. Bakre, B.R. Badrinath. I-TCP: Indirect TCP for Mobile Hosts. ICDCS 1995 • K. Fall, S. Floyd. Simulation-based comparisons of Tahoe, Reno and SACK TCP. ACMSigcomm 1996 • K. Brown, S. Singh. M-TCP: TCP for mobile cellular networks. ACM Sigcomm 1997 • H. Balakrishnan, S. Seshan , R. H. Katz. Improving reliable transport and handoff performance in cellular wireless networks. Wireless Networks. Volume 1, Issue 4, 1995 (this is the reference addressing Snooping TCP) • J. Border , M. Kojo , J. Griner , G. Montenegro , Z. Shelby. Performance Enhancing Proxies Intended to Mitigate Link-Related Degradations. RFC 3135, June 2001 • W. Wei, C. Zhang, H. Zang, J. Kurose, and D. Towsley. Inference and Evaluation of Split-Connection Approaches in Cellular Data Networks. PAM 2006 • M. Mathis, J. Mahdavi, S. Floyd, A. Romanov. TCP selective acknowledgment options. RFC 2018, October 1996 • R. Braden. T/TCP -- TCP Extensions for Transactions Functional Specification. RFC 1644, July 1994 • K. Ramakrishnan, S. Floyd, D. Black. The Addition of Explicit Congestion Notification (ECN) to IP. RFC 3168, September 2001 • B.S. Bakshi, P. Krishna, N.H. Vaidya, D.K. Pradhan.Improving Performance of TCP over Wireless Networks. ICDCS 1997
Real-time traffic in Wireless Networks • TCP • Reliable in-order delivery (no loss) • Delay-tolerant • Throughput optimization • Real-time traffic • Delay-sensitive • Loss-tolerant • Constant throughput requirements • We focus on VoIP • Represents the most demanding interactive real-time traffic
VoIP • Call establishment protocols • SIP, H.323, … • Transport protocols • RTP, RTCP, … • Audio (voice) codecs • ITU G.711, ITU G.722, ITU G.729, GSM, …
SIP: Session Initiation Protocol • SIP long-term vision: • All telephone calls, video conference calls take place over Internet • People are identified by names or e-mail addresses, rather than by phone numbers • You can reach callee, no matter where callee roams, no matter what IP device callee is currently using • Note: technically SIP is an application layer protocol • However, provided functionality not too different from Mobile IP or HIP