Wireless Ad Hoc and Sensor Networks (Transport Layer) Application Transport Protocol Network Protocol Media Access Protocol Physical Channel (Radio) WS 2009/2010 Prof. Dr. Dieter Hogrefe / Prof. Dr. Xiaoming Fu Dr. Omar Alfandi Outline Introduction and challenges Which transport layer protocols? Traditional TCP ABi Brief frevisit itto Traditional ltcp Design goals and Classification of a Transport layer protocols for wireless ad hoc networks. Enhancements to TCP for wireless ad hoc networks TCP-based Others Summary 2 Introduction : Transport layer objectives Setting up : end-to-end connection end-to-end delivery of data packets flow control and congestion control There are: Connection-less transport layer protocols such as UDP Connection-oriented transport layer protocols such as TCP Introduction : Challenge The traditional wired transport layer protocols are not suitable for wireless ad hoc networks due to the inherent problems associated with ad hoc networks. TCP protocol does not work well in ad hoc networks What are the major reasons behind that? 3 4
Introduction : Major reasons (1/4) Misinterpretation of packet loss: Wired connection : packets loss are mainly due to congestions; Wireless ad hoc networks : high packet loss due to : High BER (wired link < 10 E-9, wireless link 10 E-5 ~ 10 E-4 and even higher) Collision due to hidden terminal problem Interference: wired link are well isolated, wireless links interfere; Frequent path breaks: wired due to failures, wireless: mobility; Large-scale and small-scale propagation phenomenon. Frequent path breaks Topology changes, route reconfigurations, etc.. Introduction : Major reasons (2/4) Effects of contention (dependency on path length) Within the increase in the number of hops in the path throughput decreases exponentially Misinterpretation of congestion window CW is the rate that is acceptable for the network and the receiver Asymmetric link behaviour Sometimes wireless link are directional in ad hoc networks leading to Delivery of a packet to a node and failure in the delivery of ACK Some routing gprotocols require the forward and backward paths to be the same 5 6 Introduction : Major reasons (3/4) Introduction : Major reasons (4/4) Resources contention Both DATA and ACK require RTS-CTS-DATA-ACK at the data-link layer Contention for resources in the same link at forward and backward paths Multipath routing Some routing protocols use multiple paths between the source and destination leading to: High number of out-of-order packets leading to DUPACKs Different RTO values leading to unnecessary retransmission Network partitioning and merging TCP receiver for session A TCP sender for session B TCP receiver for session B TCP sender for session A TCP receiver for session A TCP receiver for session B TCP sender for session B TCP sender for session A TCP receiver for session A TCP receiver for session B TCP sender for session B TCP sender for session A 7 8
Outline Introduction and challenges Which transport layer protocols? Traditional TCP ABi Brief frevisit itto Traditional ltcp Design goals and Classification of a Transport layer protocols for wireless ad hoc networks. Enhancements to TCP for wireless ad hoc networks TCP-based Others Summary Which transport layer protocols? TCP is reliable, incorporates congestion control, incorporates end-to-end d and flow control mechanisms Observations concerning ad hoc networks It is preferable to seamlessly l integrate t TCP in ad hoc networks: To enable seamless operation of higher layer protocols such as FTP,HTTP If not, to make as less modifications to TCP as possible: To make wireless and wired TCPs understands each other seamlessly If not, to split the TCP into wireless and wired part: To concentrate internetworking functions in gateways 9 10 Outline Introduction and challenges Which transport layer protocols? Traditional TCP ABi Brief frevisit itto Traditional ltcp Design goals and Classification of a Transport layer protocols for wireless ad hoc networks. Enhancements to TCP for wireless ad hoc networks TCP-based Others Summary Traditional TCP The major responsibilities of TCP in an active session are to: provide reliable in-order transport of data: to not allow losses of data. control congestions in the networks: to not allow degradation of the network performance. control a packet flow between the transmitter and the receiver: to not exceed the receiver's capacity. 11 12
In general TCP segment structure we distinguish between the following operational phases in TCP: slow-start phase (also known as exponential start); congestion avoidance phase; congestion control phase; fast retransmit phase; fast recovery. 13 14 TCP connection o establishment s e t and termination Outline Introduction and challenges Which transport layer protocols? Traditional TCP ABi Brief frevisit itto Traditional ltcp Design goals and Classification of a Transport layer protocols for wireless ad hoc networks. Enhancements to TCP for wireless ad hoc networks TCP-based Others Summary 15 16
Revisit: RTT and Timeout Every time TCP sends a segment, it starts a timeout: it must be larger than RTT: to avoid unnecessary retransmission; it should not be much larger than RTT: to not introduce big delays. The following dynamic expression is used for setting a timeout: Timeout = Estimate of RTT + 4xDeviation, where Sample RTT = t(the ACK is received) - t(the segment is sent to IP); Estimate of RTT = (1 - x) Estimate of RTT + x Sample RTT; x = 0.125 is mostly chosen given more wait to recent Sample RTT; Deviation = (1 - x)deviation + Sample RTT - Estimate of RTT ; Notes small deviations of Sample RTT: Timeout > Estimate of RTT; big deviation of Sample RTT: Timeout Estimate of RTT. Website: https://wiki.net.informatik.uni-goettingen.de/w/images/9/9f/telematik_ws2009_chapter4-i.pdf 17 Revisit: Reliable in-order data transfer Reliable in-order data transfer of TCP ensures the following: data stream in the receiver's buffer is uncorrupted; data stream in the receiver's buffer is in order (no gaps, no duplications). TCP at the client: frames application layer data into segments; each time TCP releases a segment to IP layer a timer starts; the following three cases are possible here: if the timer expires and no ACK is received, the TCP retransmits a segment; if ACK is received the TCP should check: this is a first-time ACK: all data up to the acknowledged byte have received correctly and in order. this is a duplicate ACK (DUPACK): some data have been received out of order, retransmit the segment. 18 Revisit: Flow control Flow control service is a rate matching provided by TCP using the dynamic rcvwin: rcvwin is sent with every ACK to the sender; initially, rcvwin = rcvbuf; for next ACK the receiver sends: rcvwin = rcvbuf - ( lastbytercv - lastbyteread ); the sender must ensure that ( lastbytesent -lastbyteacked ) rcvwin to not overflow. Data from IP Available space rcvwin rcvbuf TCP data in the buffer reading 19 Revisit: TCP Tahoe congestion control (1/3) Every transmission starts with connection setup and followed by slow start phase: the sender starts the session with a congestion window set to maximum segment size (MSS): it sends MSS bytes of data; starts retransmission timeout (RTO) and waits for acknowledgement packet (ACK). if ACK is received in RTO the congestion window is doubled and two MSSs of data are sent; the congestions window is doubled with every ACK until it reaches slow-start threshold; Website: https://wiki.net.informatik.uni-goettingen.de/w/images/e/e6/telematik_ws2009_chapter4-ii.pdf t i tik i tti / /i / / tik h t ii df 20
TCP Tahoe congestion control (2/3) The slow-start phase is followed by congestion avoidance phase: when the slow-start threshold is reached, the congestion window grows linearly; if the ACKs are received ed before timers (RTOs) expire: the congestion window grows until the receiver window advertised in connection setup; (lastbytesent t t - lastbyteacked) t rcvwin to NOT allow overflow TCP Tahoe congestion control (3/3) If the ACK is not received in RTO, TCP assumes the packets is lost (congestion): TCP enters the congestion control phase performing the following: reduces the slow-start start threshold to 1/2 of current CW; resets the congestion window to one MSS; activates the slow-start algorithm and resets the timeout. Congestion control Slow-start Congestion avoidance 21 22 TCP Tahoe with fast retransmit TCP Tahoe uses the fast retransmit procedure to respond to losses: if the sender receives three out-of-order segment with higher than expected seq. number; resend the out-of-order segment before timeout expires and enter slow start phase. Revisit: TCP Reno DUPACKs are not indication of severe congestion. On arrival of three DUPACKs: TCP Reno enters the fast recovery phase and performs the following actions; retransmits the lost segment and does not enter slow start phase; reduces the slow-start start threshold to 1=2 of the current CW; reduces the CW to a 1=2 of the current CW + 3. increases the CW linearly with reception of subsequent DUPACKs; one MSS per a DUPACK (meaning that one more packet left the network). on reception of ACK (this ACK is due to retransmission) the sender: resets the CW with the slow-start threshold; enters the congestion avoidance similar to TCP Tahoe. More improvements are available: TCP NewReno; TCP SACK. 23 24
Fast recovery procedure of TCP Reno Outline Introduction and challenges Which transport layer protocols? Traditional TCP ABi Brief frevisit itto Traditional ltcp Design goals and Classification of a Transport layer protocols for wireless ad hoc networks. Enhancements to TCP for wireless ad hoc networks TCP-based Others Summary 25 26 Design goals of a Transport layer protocols for wireless ad hoc networks The protocol should maximize the throughput per connection It should provide throughput h t fairness across contending flows Should incur minimum connection setup and connection maintenance overhead Should have mechanism for congestion control and flow control Should be able to provide both reliable and unreliable connections Should be able to adapt to the dynamics of the network such as the rapid change in topology The available bandwidth must be used efficiently Should be aware of resources constraints such as battery power Classification of the transport t layer protocols Split approaches - Split-TCP Transport layer protocols for wireless ad hoc networks TCP modifications End-to-End approaches - TCP-ELFN - TCP-F -TCP-BuS -ATCP Other protocols -ACTP - ATP 27 28
Outline Introduction and challenges Which transport layer protocols? Traditional TCP ABi Brief frevisit itto Traditional ltcp Design goals and Classification of a Transport layer protocols for wireless ad hoc networks. Enhancements to TCP for wireless ad hoc networks TCP-based Others Summary TCP enhancements: TCP-F Feedback-based TCP Support of reliable data-link layer protocols Routing support to inform the TCP sender about path breaks Routing protocols is expected to repair the broken path within a reasonable time The main aim of TCP-F is to minimize the throughput degradation resulting from path breaks sender receiver sender receiver 29 30 TCP-F In TCP-F an intermediate node upon detection of the link break Obtains information from TCP-F sender s packets routed via this node; generates a route failure notification (RFN) packet; routes this packet to the TCP-F sender; does not forward any yp packet from this connection; updates its routing table; stores information about generation of a RFN packet. Any intermediate node that forwards the RFN packet: if this node has an alternative route to destination: discards the RFN packet and uses this path to forward other packets: this allows to reduce an overhead involved in route re-establishment if this node does not alternate route to destination: updates its routing table and forwards the RFN packet to the source 31 TCP-F When TCP-F sender receives the RFN packet it enters the so- called snooze state: stops sending packet to the destination; cancels all the timers; freezes the congestion window; sets up a route failure timer = f(routing protocol, network size, network dynamic): when failure timer expires TCP-F enters the connected state. If the broken links rejoins or intermediate node obtains a new path to destination: route reestablishment notification (RRN) is sent to TCP-F sender; 32
TCP-F When the sender receives RRN packet: reactivates all timers and congestion window assuming that the network is back; starts transmitting data available in the buffer; takes care of packets lost due to path break. Sender (connected) Sender (from connected to snooze) Sender (from snooze to connected) RFN RRN RFN RRN 33 TCP-F : Advantages and disadvantages Advantages: provides simple feedback to minimize problems due to link breaks; still allows congestion control occurring due to buffer overflows; Disadvantages: requires merging of transport and network layer features (at least, cross-layering); requires ability of nodes to detect path breaks; requires ability of routing protocols to repair a link within a reasonable time; requires ability of node to determine the TCP-F sender; reactivated congestion window may not reflect allowed network rate. 34 TCP enhancements: TCP-ELFN TCP with Explicit Link Failure Notification According to TCP-ELFN an explicit it link failure notification is used. When an intermediate node detects a link failure: sends an explicit link failure notification (ELFN) to TCP-ELFN sender: either sending an ICMP destination unreachable message (DUR); or inserting info regarding link break in RouteError message of the routing protocol. Once the TCP-ELFN sender receives the ELFN packet: it disables its retransmission timer and CW; enters a standby state. 35 TCP-ELFN Being in standby state the TCP-ELFN sender: periodically originates probe packets to see if a new route is established; when ACK for a probe packet is received TCP-ELFN continues to perform as usual. Sender (connected) Sender (standby) Sender (standby) Sender (connected) probe routeok ICMP(DUP), RouteError probe routeok 36
TCP-ELFN: Advantages and disadvantages Advantages: provides path break information to the sender; does not heavily depend on routing protocol capabilities; Disadvantages: periodic packets consume bandwidth, sometimes it may not help (partitioning); reactivated t congestion window may not reflect the new allowed network rate. TCP enhancements: TCP-BuS TCP with BUffering and Sequence information protocol tries to notify the source about the path breaks using the feedback info; this protocol is more dependent on routing protocol compared to TCP-F and TCP-ELFN. TCP-BuS was proposed for usage with associativity-based routing (ABR) and uses: localized query (LQ) message of ABR; REPLY message of ABR. Both these messages are modified to carry TCP connection and segment information. Sender Intermediate upstream Receiver 37 Intermediate downstream 38 TCP-BuS When a link break is detected, intermediate downstream node: generates a route notification (RN) message to TCP-BuS receiver: RN includes the sequence number of packet belonging to that flow in the head of its queue; all packets belonging g to this flow are discarded at all intermediate nodes that forward RN. When a link break is detected, intermediate upstream node: generate explicit route disconnection notification (ERDN); when ERDN is received by the sender, it stops sending and freezes timers CW; all packets in transit nodes are buffered, till new partial path is found by source of ERDN; tries to find a new (partial) route to the TCP-BuS receiver; if it finds, explicit route successful notification packet (ERSN) to the sender is sent. TCP-BuS When ERDN is received the following is done at the sender: comparing sequence numbers segments are selectively retransmitted. TCP flow LQ REPLY 39 40
TCP-BuS: Advantages and disadvantages Advantages: avoidance of retransmissions due to buffering, usage of sequence numbers; selective retransmission improves the performance of TCP; Disadvantages: antages dependency on the routing protocol (ABR); buffering at intermediate t nodes (they could be overflowed, thus, may fail). TCP enhancements: ATCP Ad hoc TCP This is a wise realization of TCP with feedback due to: usage of explicit congestion notification field (currently is under consideration in IETF); usage of intermediate thin layer between traditional TCP and IP layer; only a few functions; does not require a certain routing protocol; adaptation of congestion window to a new path. Aim: to treat path breaks independently from congestion situations. 41 42 ATCP The following are advantages of such a layered structure: ATCP logic is separated from classic TCP; no changes to TCP are required; in principle, ATCP can be realized and installed separately from TCP; simple primitives can be defined between ATCP and TCP layers. Data TCP tcp_ input() tcp_ output() ATCP atcp_input() atcp_output() IP ip_input() ip_output() Data 43 ATCP when a TCP connection is established, ATCP enters the NORMAL state; in the NORMAL state ATCP does not interfere with classic TCP and remains invisible. DUR DISCONN DUR DUP DUR ACK/Packet NORMAL Before retransmits a RTO/ 3 TxPacket segments from DUP ACKs a buffer ACK ECN LOSS DUR: destination unreachable Tx : packet transmission DUPAC: duplicate ACK ECN: explicit congestion notification ECN CONGESTED 44
ATCP Consider the case when packets are lost or arrive out-of-order at destination: the receiver generate DUPACKs: Traditional TCP (e.g. Tahoe): the sender retransmits the segment; decrease its congestion window accordingly. ATCP: counts, waits if the number of DUPACKs reaches three; if so, it puts ATCP in the LOSS state and does not invoke the congestion control; in the LOSS state ATCP retransmits unacked segments from the sender's buffer. ATCP When ATCP is in the LOSS state: if new ACK is received from the receiver ATCP enters the NORMAL state; if ECN is received it enters the CONGESTED state; if ICMP DUR is received it enters the DISCONNECTED state. When ATCP is in the NORMAL state: t three DUPACKs are received ATCP enters goes to LOSS state; if ECN is received it enters the CONGESTED state and remains invisible for TCP; if ICMP DUP is received it enters the DISCONNECTED state. When ATCP is in the DISCONNECTED state: decrease the congestion window to one; remains in this state; if either ACK or DUPACK is received, it goes into NORMAL state. t 45 46 ATCP It is expected that the new route is found and the source is informed. When ATCP is in the CONGESTED state: if ICMP DUR is received it goes into DISCONNECTED state. In general, the following is made in ATCP: packet loss due to high BER: retransmits lost packet route reconfiguration delay and transient partitions: stops transmission until the new route has been found out-of-order of order packet delivery: makes classic TCP unaware of it and retransmits the packet from TCP buffer change in route: recomputes the congestion window ATCP: Advantages and disadvantages Advantages: compatible with traditional TCP; maintains the end-to-end semantics of TCP; Disadvantages: requires support from routing protocol (route changes, partition detection); requires changes to interface functions. 47 48
TCP enhancements: Split-TCP The following are two major problems with TCP: 1. degradation of throughput with increase in the path length: Short connections obtain more throughput than long connections. 2. unfairness among TCP flows: MAC layer contention (IEEE 802.11 MAC: channel capture effect): lengthy TCP flows: more points to contend. Split-TCP Split-TCP provides the solution by splitting the TCP functionalities into: congestion control; end-to-end reliability. Why it is possible? congestion control: local phenomenon due to high contention for resources; end-to-end d reliability: end-to-end d phenomenon. 49 50 Split-TCP Split-TCP splits the connection into a set of concatenated TCP connections Proxy node is responsible for: terminating the connection from the sender/precessor proxy node; setting up a connection with receiver/successor node. Split-TCP Proxy nodes are chosen using the distributed algorithm: simplest way: packet traversed n hops - behave as a proxy. Transmission control at the TCP sender window is split into: end-to-end CW: it is updated according to arrival of end-to-end ACKs. CW: (CW end-to-end CW) it is updated according to arrival of local ACKs (LACKs) from the next node. 51 52
Split-TCP The proxy node behaves as follows: it maintains CW that governs transmission in a segment; when packet arrives from predecessor the LACK is sent back; arrived packet is buffered; the buffered packet is forwarded to the next node. Split-TCP: Advantages and disadvantages Advantages: improved throughput: h t reduction in the path length; improved throughput fairness: each segment works at the most suitable rate; Disadvantages: requires modifications to TCP; the end-to-end connection handling is violated; the failure of proxy nodes may lead to throughput degradation; security encryption schemes may not work (intermediate nodes have to process). high resource consumption (buffer space). 53 54 Comparison of TCP solutions o s for ad hoc networks Issue TCP-F TCP-ELFN TCP-BuS ATCP Split-TCP Loss due to BER TCP TCP TCP No cong. control TCP Path break TCP snoozes TCP standby TCP snoozes TCP TCP Out-of-order order packets TCP TCP Resend Reordering TCP Congestion TCP TCP TCP ECN notification TCP Path break Yes Yes Yes Yes No notification Path reestablishment Notification Yes No Yes No No Depend on routing Yes Yes Yes Yes No End-to-end Yes Yes Yes Yes No semantics Buffer at inter. Node No No Yes No Yes Outline Introduction and challenges Which transport layer protocols? Traditional TCP ABi Brief frevisit itto Traditional ltcp Design goals and Classification of a Transport layer protocols for wireless ad hoc networks. Enhancements to TCP for wireless ad hoc networks TCP-based Others Summary 55 56
Other transport t protocols for ad hoc networks Application controlled transport protocol (ACTP) ACTP is a light-weight i transport t layer protocol: TCP: High reliability - a lot of retransmissions -- low throughput. UDP: Is not reliable at all - a lot of data just lost -- low reliability. ACTP: Is between TCP and UDP - some lost data may be recovered -- higher performance. ACTP is characterized by the following: it is responsible for feedback to end application; end-to-end reliability is left to applications; priorities of packet are implemented; implementation of priorities is left to lower layers. ACTP Each data to be transmitted contains the following information: delay (a maximum tolerable delay); number of the packet; priority of the packet. The delivery status t is maintained i at ACTP and available to application via isacked(): successful delivery of the packet (ACK was returned); possible loss of the packet (ACK is not returned within a deadline); remaining time for the packet (ACK is not returned but the deadline has not expired); no information available. Application SendTo(delay,message,priority) layer ACTP layer IProute() isacked() IP 57 58 ACTP: Advantages and disadvantages Advantages: scalable for large networks (light-weight); allows to set priorities to data; no congestion window; Disadvantages: congestions are possible; is not compatible with TCP; suitable for particular applications only. Ad-hoc transport protocol (ATP) The following are the major difference between ATP and TCP: ATP uses rate based transmission; i ATP separates congestion control and reliability: network congestion information is obtained from intermediate nodes; flow control and reliability information is obtained from ATP receiver. ATP uses assisted congestion control; ATP uses selective ACKs (SACKs). ATP uses the information available from underlying layers for: estimation of the initial transmission rate; detection, avoidance and control of congestion; detection of path breaks. 59 60
ATP The congestion information obtained from intermediate node is expressed in terms: weighted average queuing delay DQ: D xd ( 1 x) D Q Qnew Qold contention delay D C. During the connection setup phase or when ATP recovers from path break: ATP sender determines the transmission rate sending probe packets (quick start phase); intermediate node attaches the rate info in form of D C and D Q ; receiver e responds with ACK. At the uplink path the following always occurs: D Q and D C at each intermediate node is included in rate feedback field (ABR); ATP receiver collects D Q and D C and includes them in periodic SACKs. 61 ATP When congestion occurs TCP uses: decrease of the CW. Instead, ATP defines three phases: increase: If new rate (R) is higher than the current rate and beyond the threshold µ then: R Sold Snew Sold k is used (increased) where k is the fraction used to avoid rapid fluctuations. decrease: If new rate is lower than current the rate is decreased to a new rate. maintain: if new rate is higher than current but less than the threshold. 62 ATP: Advantages and disadvantages Advantages: improved performance in ad hoc network: Disadvantages: decoupling of congestion control and reliability; avoiding fluctuations of the congestion window. lack of interoperability with TCP. Outline Introduction and challenges Which transport layer protocols? Traditional TCP ABi Brief frevisit itto Traditional ltcp Design goals and Classification of a Transport layer protocols for wireless ad hoc networks. Enhancements to TCP for wireless ad hoc networks TCP-based Others Summary 63 64
Summary The major challenges and the design goals that a transport layer protocols faces were discussed TCP is the most widely used transport protocol and is considered to be the backbone of today s Internet It provides end-to-end, reliable, byte stream, in-order-delivery of packets to nodes Since TCP was designed to traditional wired networks, many of issues that are presented in dynamic topology It is very important to employ TCP in ad hoc networks to seamlessly ess communicate cate with Internet et A classification of TCP enhancements for ad hoc networks was listed A number of recently proposed solutions to improve TCP performance was explained, in addition other non-tcp solutions were also discussed 65