1 of 59

Mobile Ad hoc

&

Sensor Networks

UNIT -II

1

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

2 of 59

TCP Protocol Overview

TCP adds great deal of functionality to the IP service it is layered over:

  • Streams: TCP data is organized as a stream of bytes
  • Reliable Delivery: Sequence numbers are used to coordinate which data has been transmitted and received
  • Network Adaption: TCP will dynamically learn the delay characteristics of a network and adjust its operation to maximize throughput without overloading the network.
  • Flow Control: TCP manages data buffers and coordinates traffic so that its buffers will never overflow. Fast senders will stopped periodically to keep up with slow receivers.

2

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

3 of 59

TCP Basics

  • Byte Stream Delivery: transmit data in manageable pieces to the receiver

  • Connection-Oriented: Two communicating TCP entities (the sender and the receiver) must first agree upon the willingness to communicate

  • Full-Duplex: TCP almost always operates in full-duplex mode,
    • TCP exhibit asymmetric behavior only during connection start and close sequences (i.e., data transfer in the forward direction but not in the reverse, or vice versa)

3

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

4 of 59

Reliable TCP Guarantees

  • A number of mechanisms help provide the guarantees:
    • Checksums: To detect errors with either the TCP header or data
    • Duplicate data detection: Discard duplicate copies of data that has already been received
    • Retransmissions:
      • For lost and damaged data
      • Due to lack of positive acknowledgements
      • Timeout period calls for a retransmission
    • Sequencing: To deliver the byte stream data to an application in order
    • Timers: Various static and dynamic timers used for deciding when to retransmit
    • Window: For flow control in the form of a data transmission window size

4

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

5 of 59

TCP Header Format

5

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

6 of 59

TCP in Wired Network and MANET

Data stream in Wired Network

ACKs stream

Data stream in a MANET

ACKs stream

TCP

Source

TCP

Sink

1

N

4

3

2

6

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

7 of 59

Overview of TCP Concepts

  • Conventional TCP: Tahoe, Reno, New-Reno
  • Sending rate is controlled by
    • Congestion window (cwnd): limits the # of packets in flight
    • Slow-start threshold (ssthresh): when CA start
  • Loss detection
    • 3 duplicate ACKs (faster, more efficient)
    • Retransmission timer expires (slower, less efficient)
  • Overview of congestion control mechanisms
    • Slow-start phase: cwnd start from 1 and increase exponentially
    • Congestion avoidance (CA): increase linearly
    • Fast retransmit and fast recovery: Trigger by 3 duplicate ACKs

Overview

7

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

8 of 59

TCP Basics

Slow-start

Congestion

avoidance

8

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

9 of 59

Congestion Control

  • Slow Start (SS): A mechanism to control the transmission rate.
    • When TCP connection starts (Initial Value): CWND =1,
    • congestion window increases by one segment for each acknowledgement returned
  • Congestion Avoidance(CA): Used to reduce the transmission rate
    • When Slow Start drops one or more packets due to congestion
  • Fast Retransmit: Sender receiving triple duplicate ACKs
    • Immediate transmission of missing packet without waiting for the Retransmission Timeout to expire
  • Fast Recovery: In SS or CA when sender receiving triple duplicate ACKs 🡪 Sender only enters Congestion Avoidance mode

9

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

10 of 59

What is Different in MANETs?

  1. Mobility
    • Route stability and availability
  2. High bit error rate
    • Packets can be lost due to “noise”
  3. Unpredictability/Variability
    • Difficult to estimate time-out, RTT, bandwidth
  4. Contention: packets compete for airtime
    • Intra-flow and inter-flow contentions
  5. Long connections have poor performance
    • More than 4 hops thruput drops dramatically

Overview

10

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

11 of 59

Overview of Best Protocols

  • TCP-Westwood [Casetti et. al.]
    • Estimate bandwidth to alleviate the effect of wireless errors.
  • TCP-Jersey [Xu et. al.]
    • Estimate bandwidth to alleviate the effect of wireless errors.
    • Congestion warning assists the determination of packet loss due to wireless error from congestion.
  • ATP [Sundaresan et. al.]
    • Rate based transmission, periodic rate feedback, no timeout concept, reliability provided by SACK.
  • Split-TCP [Kopparty et. al.]
    • Separating congestion control from reliability.
    • Dropped packets are recovered from the most recent proxy instead of the source.

5-11

Overview

11

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

12 of 59

Why Does TCP Fail in MANETs?

12

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

13 of 59

Specific problems of TCP over MANETs

  • TCP misinterprets route failures as congestion
    • Effects: Reduce sending rate
    • Buffered packets (Data and ACKs) at intermediate nodes are dropped.
    • Sender encounters timeout.
      • Under prolonged disconnection, a series of timeouts may be encountered.

TCP in MANET

13

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

14 of 59

Specific problems of TCP over MANETs

  • TCP misinterprets wireless errors as congestion
    • Effects: Incorrect execution of congestion control 🡪 Performance drops.
    • Wireless channel is error-prone compared to wireline
      • Fading, interference, noise

TCP in MANET

14

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

15 of 59

Specific problems of TCP over MANETs

  • Intra-flow and inter-flow contention
    • Effects: Increased delay, unpredictability, and unfairness.
    • Inter-flow contention: contention of nearby flows.
    • Intra-flow contention: between packets of the same flow (e.g. forward data and reverse ACKs).
    • Wireline: only packet on same link “compete”
    • Wireless: all close by devices compete for the channel

Data stream

ACKs stream

Two nearby flows

TCP in MANET

15

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

16 of 59

Drawback of TCP Exponential Back Off

16

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

17 of 59

No communication between the partitions

Impact of Partition on Throughput

S

A

B

C

P

X

Y

Z

D

Link Failure

Data transfer continues in spite of failure

17

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

18 of 59

  • A network partition occurs when a given mobile node moves away, or is interrupted by the medium, thereby splitting its adjacent nodes into two isolated parts of the network that are called partitions.

  • Partition is defined within the context of a connection which is interrupted due to a link breakage

  • It results there are no alternate paths available through some other nodes

18

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

19 of 59

Effects of Partitions on TCP

Node 5 moves away from node 3 (short-term partition)

19

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

20 of 59

1

2

3

4

5

6

7

8

9

The routing protocol reestablishes the path through node 6

Reestablishing Path

20

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

21 of 59

Long Term Partition

Node 5 moves away from node 3 (long-term partition)

21

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

22 of 59

No communication between the partitions

Long Term Network Partition

22

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

23 of 59

TCP Throughput

  • TCP throughput is inversely proportional to the number of hops
  • Larger the number of nodes a TCP connection needs to span, lower is the end-to-end throughput, as there will be more medium contention taking place in several regions of the network

23

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

24 of 59

Impact of Lower Layers on TCP - MAC

  • RTS/CTS control frames are used.
  • This makes it possible to recover a packet loss at the link level instead of waiting for TCP to detect the loss only at the destination when it has already taken too long time.
  • Another mechanism introduced by the IEEE 802.11 MAC is NAV, which is used to track medium activity.
  • Every node maintains an information parameter called NAV which is updated according to other nodes' transmission schedules.
  • NAV-> Network Allocation Vector - virtual carrier sensing mechanism used with wireless network protocols

24

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

25 of 59

  • In order to provide fair access to the medium -> nodes must await an IFS interval and then contend for the medium again. The contention is carried out by means of a binary exponential backoff mechanism which imposes a further random interval, aiming to avoid collisions.
  • At every unsuccessful attempt, this random interval tends to become higher (its range of randomness is doubled at every attempt) and after some number of attempts (typically, seven times) the MAC layer gives up and drops the data, which is reported as a route failure to the network layer.
  • MAC protocol using short RTS/CTS control frames to reserve the medium, bandwidth wastage is considerably minimized in case of collisions as these frames are much smaller than DATA frames. As for the virtual carrier sense mechanism, it prevents the so-called hidden node problem.

25

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

26 of 59

Hidden and Exposed Terminals �

26

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

27 of 59

Hidden Terminals: Solution

27

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

28 of 59

Exposed terminals : Solution

28

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

29 of 59

Impact of Lower Layers on TCP -MAC

  • Consider a linear topology in which each node can only communicate with its adjacent neighbors
  • In addition, consider that in Figures (a) and (b) there exist a single TCP connection running between nodes 1 and 5

29

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

30 of 59

Capture Conditions

  • In Figure (c) where there are two independent connections,(connection 2-3) (connection 4-5)
  • Assuming that connection 2-3 experiences collision due to the hidden node problem caused by the active connection 4-5 , node 2 will back off and retransmit the lost frame
  • At every retransmission, the binary exponential backoff mechanism imposes an increasingly backoff interval, and implicitly, this is actually decreasing the possibility of success for the connection 2-3 to send a packet as connection 4-5 will “dominate” the medium access once it has lower backoff value
  • In consequence, the connection 2-3 will hardly obtain access to the medium while connection 4-5 will capture it

30

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

31 of 59

Network Layer Impact

  • Routing strategies play a key role on TCP performance

  • There have been a lot of proposed routing schemes and each of them have different effects on the TCP performance

31

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

32 of 59

DSR

  • DSR protocol operates on an on-demand basis in which a node wishing to find a new route broadcasts a RREQ packet
  • The problem with this approach concerns the high probability of stale routes in environments where high mobility as well as medium constraints may be normally present
  • The problem is exacerbated by the fact that other nodes can overhear the invalid route reply and populate their buffers with stale route information
  • It can be mitigated by either manipulating TCP to tolerate such a delay or by making the delay shorter so that the TCP can deal with them smoothly

32

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

33 of 59

TORA�

  • TORA has been designed to be highly dynamic by establishing routes quickly and concentrating control messages within a small set of nodes close to the place where the topological change has occurred
  • TORA makes use of directed acyclic graphs, where every node has a path to a given destination and established initially
  • This protocol can also suffer from stale route problem similar to the DSR protocol
  • The problem occurs mainly because TORA does not prioritize shorter paths, which can yield considerable amount of out-of-sequence packets for the TCP receiver, triggering retransmission of packets

33

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

34 of 59

Path Asymmetry Impact

  • In Ad hoc networks, there are several asymmetries

  • Loss Rate Asymmetry: It takes place when the backward path is significantly more error prone than the forward path

  • Bandwidth Asymmetry: Arises when forward and backward data follow distinct paths with different speeds
    • Can happen in ad hoc networks when all nodes not have the same interface speed

  • Media Access Asymmetry: Arises when TCP ACKs and Data are contending for the same

34

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

35 of 59

Route Assymetry

  • Route asymmetry implies in distinct paths in both directions
  • Route asymmetry is associated with the possibility of different transmission ranges for the nodes
  • The inconvenience with different transmission ranges is that it can lead to conditions in which the forward data follow a considerably shorter path than the backward data (TCP ACK) due to lack of power in one (or more) of the nodes in the backward path
  • However, multi-hop paths are prone to have low throughput and TCP ACKs may face considerable disruptions
  • All the above forms of asymmetry can lead to lack of ACKs for the sender node.
  • The problem might be exacerbated when the ACKs arrive bunched up at the sender, causing bursty traffic in the forward path, which is known as ACK compression phenomenon.
  • Asymmetry condition can lead to inaccuracy in RTT estimation.

35

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

36 of 59

Some Proposed Solutions

  • TCP header compression has been proposed to reduce the size of ACK packets in the backward path. However, this option alone can be ineffective.
  • The problem is, considerable overhead which impairs the enhancement provided by such a compression.
  • Despite being compressed, the packets still have to interact with other backward traffics.
  • ACK filtering is another approach that attempts to minimize the amount of ACK in the backward path.
  • This scheme takes advantage of the fact that ACK packets are cumulative. Here, new ACK is to be enqueued.
  • A drawback with this scheme is that state information needs to be maintained for the connections with enquired packets

36

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

37 of 59

  • ACK congestion control and ACK-first scheduling schemes extend congestion control mechanism for ACK packets and give priority for them over data packets.
  • The former relies on a random early detection (RED) mechanism for detecting congestion in the backward path, which is signaled back to the sender that, in turn, slows down its transmission rate.
  • Latter ACKs must be scheduled with high priority so that the sender does not freeze the connection.

37

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

38 of 59

  • TCP sender adaptation relies on the idea that the sender node should avoid slowing down in its CWND by considering the amount of data acknowledged by each ACK.
  • The sender should estimate the admitted rate of the connection so that it never sends excessive bursts into the network.
  • ACK reconstruction ,which receives the spaced ACKs from the receiver and paces its relaying to the sender in a regulated rate. This rate is based on the amount of data acknowledged by the received ACK and also on the actual rate of the backward path.
  • As a result, the CWND growing at the sender is controlled by the actual rate in the backward path and no burst behaviour arises.

38

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

39 of 59

Solutions for TCP over Ad Hoc�

Mobility-Related

TCP-Feedback

    • TCP sender can effectively distinguish between route failure and network congestion by receiving Route Failure Notification (RFN) messages from intermediate nodes
    • Upon receipt of a Route Re-establishment Notification (RRN) message from the routing protocol, the sender leaves the frozen state and resumes transmission using the same variables values prior to the interruption
    • A route failure timer is employed to prevent infinite wait for RRN messages, is started whenever a RFN is received and upon expiration of this timer, the frozen timers of TCP are reset hence allowing the TCP congestion control to be invoked normally

39

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

40 of 59

  • Explicit Link Failure Notification (ELFN) is a cross-layer proposal in which TCP also interacts with the routing protocol in order to detect route failure and take appropriate actions
  • ELFN messages are sent back to the TCP sender from the node detecting the failure
  • ELFN messages contain sender and receiver addresses and ports, as well as the TCP sequence number
  • Whenever the TCP sender receives an ELFN message, it enters a “stand-by” mode in which its timers are disabled and probe packets are sent regularly towards the destination in order to detect route restoration
  • Upon receiving an ACK packet, the sender leaves the “stand-by” mode and resumes transmission using its previous timer values and state variables

The ELFN Approach

40

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

41 of 59

  • Relies on the idea that routing error recovery should be accomplished in a fast fashion by the routing algorithm

  • It disables such a mechanism whenever two successive retransmissions due to timeout occur, assuming that it actually indicates route failure

  • TCP sender doubles the RTO once and if the missing packet does not arrive before the second RTO expires, the packet is retransmitted again and again, but the RTO is no longer increased

Fixed Retransmission Timeout (RTO)

41

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

42 of 59

  • The Ad hoc TCP (ATCP) protocol does not impose changes to the standard TCP itself and instead, it implements an intermediate layer between the network and the transport layers in order to provide an enhanced performance to TCP

  • ATCP relies on the ICMP protocol and on the Explicit Congestion Notification (ECN) scheme to detect / distinguish network partition and congestion, respectively

  • The intermediate layer keeps track of the packets to and from the transport layer so that the TCP congestion control is not invoked when it is not really needed

The ATCP Protocol

42

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

43 of 59

  • Mobility in MANETs is extremely frequent and the packet usually arrive out-of-order (OOO) at the destination

  • The TCP-DOOR (Detection of Out-Of-Order and Response) protocol focuses on the idea that OOO delivery of packets can happen frequently in MANETs as a result of nodes mobility

  • TCP-DOOR implements a detection of such deliveries at both entities: TCP sender and TCP receiver

TCP-DOOR (Detection Out-Of-Order and Response )

43

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

44 of 59

  • Additional ordering information is used in both types of packets (data and ACK)
  • One extra byte is required for ACKs and two extra bytes are required for data.
  • For every packet sent the sender increments its own stream sequence number inside the two-byte option regardless whether it is a retransmission or not .
  • This allows the receiver to precisely detect OOO delivery of data packets and notify the sender via a specific bit into the return ACK packet.
  • After detecting OOO events, the TCP sender can respond with two mechanisms: temporarily disabling congestion control and instant recovery during congestion avoidance.

44

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

45 of 59

  • The approaches that rely on feedback information from inside the network (TCP-F, ELFN-based, ATCP) may fail in situations where TCP sender is unable to receive data from the next hop node
  • The usage of explicit notification by the intermediate nodes, such as ECN, raises many security concerns
  • The assumption in TCP-DOOR that OOO packets are exclusive results of route disturbance may not be true in a quite a few scenarios
  • The main concern addressed by the approaches presented so far is how to avoid the TCP exponential backoff mechanism when losses take place by factors other than congestion

Main Drawbacks

45

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

46 of 59

COPAS

  • A protocol called COPAS (COntention-based PAth Selection) has been proposed to address TCP performance drop due to the capture problem and resulting unfairness

  • COPAS implements two novel routing techniques in order to contention-balance the network, namely, the use of disjoint forward (for TCP data) and reverse (for TCP ACK) paths to reduce the conflicts between TCP packets traveling in opposite directions

Fairness-Related

46

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

47 of 59

  • In COPAS, upon receipt of a non-duplicate RREQ packet, to this packet nodes append a weighted average of the number of times it has backed off in a "recent past" due to activity in the medium. The RREQ packet is then rebroadcast.
  • COPAS is actually determining how busy the wireless shared medium is in the neighborhood of a node.
  • More times a node backs off, means that more busy is the medium around it.
  • After receiving the first RREQ packet, the destination waits for an appropriate amount of time to learn all possible routes.
  • COPAS employs two selection criteria in order to choose exactly two routes: path disjointness, and least contented routes.

47

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

48 of 59

  • COPAS uses all possible node- disjoint routes (between source and destination) at the destination and selects the two least contented routes based on the information collected by the arriving RREQ packets.
  • The destination responds with at most two RREPs along the chosen paths.
  • Along with the RREP, the destination also sets a direction flag in the packet header to indicate to the source node which path is to be used as forward (for TCP data packets) and reverse (for TCP ACK packets) traffic.
  • This direction information is also kept in a node's routing table.

48

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

49 of 59

Route Establishment in COPAS

C

D

E

F

S

B

H

I

J

4

4

2

5

3

1

8

7

G

D

E

C

F

S

B

G

H

I

J

4

4

2

5

3

1

8

7

TCP ACK

TCP Data

(a) – Network contention perceived at node D

(b) – Routes selected by node D

49

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

50 of 59

Average Aggregate Throughput

Simulation results of COPAS applied to scenario of 50 and 100 nodes

50 Nodes

100 Nodes

50

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

51 of 59

  • Two unique features of ad hoc wireless networks are the key to understand unfair TCP behaviors: Spatial reuse constraint and the location dependency
  • View a node and its interfering neighbors to form a neighborhood (the neighborhood of a node X is formed by all nodes within communication range of X)
  • Flows get different feedback in terms of packet loss rate and packet delay when congestion happens
  • The main achievement of NRED is the ability to detect early congestion and drop packets proportionally to a flow’s channel bandwidth utilization

Neighborhood RED (Randomly Early Detection)

51

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

52 of 59

Node A’s Neighborhood and Distributed Queue

  • Keep estimating the size of neighborhood queue
  • Once queue size exceeds certain threshold, a drop probability is computed
  • This is propogated to provide cooperative packet drop

52

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

53 of 59

53

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

54 of 59

54

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

55 of 59

55

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

56 of 59

56

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

57 of 59

57

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

58 of 59

58

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao

59 of 59

59

Mobile Ad hoc & Sensor Networks by Dr. S.Siva Nageswara Rao