30
TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption Ahmed Ayadi , Patrick Maill´ e, David Ros IT/TELECOM Bretagne Rennes, France 8-9 February 2011 Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 1 / 22

TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Embed Size (px)

Citation preview

Page 1: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

TCP over low-power and lossy networks: tuning thesegment size to minimize energy consumption

Ahmed Ayadi, Patrick Maille, David Ros

IT/TELECOM BretagneRennes, France

8-9 February 2011

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 1 / 22

Page 2: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Motivation

The IETF Working Group 6LoWPAN has recently introduced an adaptationlayer that provides header compression and fragmentation/reassemblymechanisms to allow sending/receiving IPv6 packets over LLNs (e.g., IEEE802.15.4),

The 6LoWPANs have given more chance for TCP to be deployed in theLow-power and Lossy Networks such as Wireless Sensor Networks.

However, the IPv6 MTU is 1280 bytes while an 802.15.4 frame can have apayload limited to 74 bytes,

A TCP segment might end up fragmented into as many as 18 fragments atthe 6LoWPAN layer,

If a single one of those fragments is lost in transmission, all fragments mustbe resent,

Sending long TCP segments increases the packet error rate, while sendingshort TCP segments increases the overhead.

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 2 / 22

Page 3: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Motivation

The IETF Working Group 6LoWPAN has recently introduced an adaptationlayer that provides header compression and fragmentation/reassemblymechanisms to allow sending/receiving IPv6 packets over LLNs (e.g., IEEE802.15.4),

The 6LoWPANs have given more chance for TCP to be deployed in theLow-power and Lossy Networks such as Wireless Sensor Networks.

However, the IPv6 MTU is 1280 bytes while an 802.15.4 frame can have apayload limited to 74 bytes,

A TCP segment might end up fragmented into as many as 18 fragments atthe 6LoWPAN layer,

If a single one of those fragments is lost in transmission, all fragments mustbe resent,

Sending long TCP segments increases the packet error rate, while sendingshort TCP segments increases the overhead.

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 2 / 22

Page 4: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Outline

1 Introduction

2 TCP energy consumption modelTCP energy consumption model: NotationsLink layer: one-hop modelMulti-hop modelTCP Model

3 Results and discussionModel assessmentFEC redundancy ratio and energy consumptionSelecting the TCP MSS to minimize energy consumption

4 Conclusion and perspectives

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 3 / 22

Page 5: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Introduction

Focus on the energy cost when TCP is used in multi-hops LLNs.

Present a simple mathematical model aimed at predicting the energyconsumed by the wireless nodes of an LLN in a bulk-data transfer scenario.

The model estimates TCP energy performance based on the bit error rate,the maximum number of retransmissions at link layer, the number of hopsbetween the sender and the receiver, the amount of FEC, and the TCPmaximum segment size.

The proposed model allows us to study the tradeoffs involved in sendingshort versus long TCP segments.

Applying the model, we study the energy efficiency of TCP over an LLNusing 6LoWPAN and IEEE 802.15.4 protocols.

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 4 / 22

Page 6: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Notations

We assume that the energy consumed by a TCP transmission in a wirelessLLN mainly corresponds to the data emission and reception, and thusdirectly depends on the number of bits sent by all nodes.

The following table lists most of the variables used in the model.

Variable DefinitionD Link-layer data frame sizeA Link-layer acknowledgement frame sizeh Number of hops between source and destinationr Maximum number of link-layer transmission attemptsm Number of fragments corresponding to a single TCP segment (due

to link layer fragmentation)α FEC redundancy ratioB Bit error rate

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 5 / 22

Page 7: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Link Layer Modeling

Automatic Repeat reQuest (ARQ)

I ARQ uses the cyclic redundancy check (CRC) error-detecting code thatis added to the data: the receiver uses the error-detecting code numberto check the integrity of the received data

I After receiving a correct frame, the receiver replies by an ACK.I If the sender does not receive an ACK before the timeout, it

re-transmits the frame/packet until the sender receives anacknowledgment or exceeds a predefined number of re-transmissions.

Forward Error Correction (FEC)

I The main idea of FEC is to add redundancy to the original frame, toallow the destination node to detect and correct some bit errors.

I The FEC algorithm adds (α× K) redundancy bits to form a frame oflength D.

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 6 / 22

Page 8: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Link Layer Modeling

Automatic Repeat reQuest (ARQ)

I ARQ uses the cyclic redundancy check (CRC) error-detecting code thatis added to the data: the receiver uses the error-detecting code numberto check the integrity of the received data

I After receiving a correct frame, the receiver replies by an ACK.I If the sender does not receive an ACK before the timeout, it

re-transmits the frame/packet until the sender receives anacknowledgment or exceeds a predefined number of re-transmissions.

Forward Error Correction (FEC)

I The main idea of FEC is to add redundancy to the original frame, toallow the destination node to detect and correct some bit errors.

I The FEC algorithm adds (α× K) redundancy bits to form a frame oflength D.

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 6 / 22

Page 9: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Link Layer Modeling

ACKs are sent without FEC.

Sender ReceiverData frame .

(a) Failure.

Sender Receiver

Data frame

Ack frame.

(b) Partial failure.

Sender Receiver

Data frame

Ack frame

(c) Success.

Pfail = 1 −c∑

i=0

(Di

)B i (1 − B)D−i ,

Ppartial = (1 − Pfail)(1 − (1 − B)A)

Psucc = (1 − Pfail)(1 − B)A

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 7 / 22

Page 10: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Link Layer Modeling

F i : Probability that a destination node does not receive a link layer data frameafter r attempts (i th hop)

F = P rfail.

Hf : Expected number of bits sent after r attempts knowing that the (one-hop)transmission has failed

Hf = r × D.

Hs : Expected number of bits sent within r attempts knowing that the(one-hop) transmission has succeeded

Hs =1

1− F(

r∑i=1

(ri

)P ipartialP

r−ifail (rD + iA)

+r∑

k=1

Psucc

k−1∑i=0

(k − 1

i

)P ipartialP

k−1−ifail (kD + (i + 1)A))

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 8 / 22

Page 11: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Link Layer Modeling

F i : Probability that a destination node does not receive a link layer data frameafter r attempts (i th hop)

F = P rfail.

Hf : Expected number of bits sent after r attempts knowing that the (one-hop)transmission has failed

Hf = r × D.

Hs : Expected number of bits sent within r attempts knowing that the(one-hop) transmission has succeeded

Hs =1

1− F(

r∑i=1

(ri

)P ipartialP

r−ifail (rD + iA)

+r∑

k=1

Psucc

k−1∑i=0

(k − 1

i

)P ipartialP

k−1−ifail (kD + (i + 1)A))

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 8 / 22

Page 12: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Link Layer Modeling

F i : Probability that a destination node does not receive a link layer data frameafter r attempts (i th hop)

F = P rfail.

Hf : Expected number of bits sent after r attempts knowing that the (one-hop)transmission has failed

Hf = r × D.

Hs : Expected number of bits sent within r attempts knowing that the(one-hop) transmission has succeeded

Hs =1

1− F(

r∑i=1

(ri

)P ipartialP

r−ifail (rD + iA)

+r∑

k=1

Psucc

k−1∑i=0

(k − 1

i

)P ipartialP

k−1−ifail (kD + (i + 1)A))

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 8 / 22

Page 13: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Multi-hop model

Sender Receiver

...

(d) End-to-end failure scenario: theframe cannot be forwarded after runsuccessful retransmissions.

Sender Receiver

.

(e) End-to-end success scenario:the frame arrives at the destination.This scenario may also include par-tial failures over one or more hops(not depicted).

Figure: Failure and success scenarios in a multi-hop transmission.

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 9 / 22

Page 14: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Multi-hop model

Qs : Probability of an end-to-end packet transmission success

Qs =h∏

i=1

(1 − F i )

Es : Expected number of bits sent for a successful end-to-end packet transmissionknowing that it has succeeded

Es =h∑

i=1

Hsi

Ef : Expected number of bits sent for an end-to-end packet transmission knowingthat it has failed

Ef =

∑hk=1(

∑k−1i=1 Hsi + Hfk )

∏k−1j=1 (1 − F j)F k

1 −∏h

i=1(1 − F i )

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 10 / 22

Page 15: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Multi-hop model

Qs : Probability of an end-to-end packet transmission success

Qs =h∏

i=1

(1 − F i )

Es : Expected number of bits sent for a successful end-to-end packet transmissionknowing that it has succeeded

Es =h∑

i=1

Hsi

Ef : Expected number of bits sent for an end-to-end packet transmission knowingthat it has failed

Ef =

∑hk=1(

∑k−1i=1 Hsi + Hfk )

∏k−1j=1 (1 − F j)F k

1 −∏h

i=1(1 − F i )

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 10 / 22

Page 16: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Multi-hop model

Qs : Probability of an end-to-end packet transmission success

Qs =h∏

i=1

(1 − F i )

Es : Expected number of bits sent for a successful end-to-end packet transmissionknowing that it has succeeded

Es =h∑

i=1

Hsi

Ef : Expected number of bits sent for an end-to-end packet transmission knowingthat it has failed

Ef =

∑hk=1(

∑k−1i=1 Hsi + Hfk )

∏k−1j=1 (1 − F j)F k

1 −∏h

i=1(1 − F i )

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 10 / 22

Page 17: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

TCP Model

Ps : The success probability of a TCP segment transmission attempt is simply theprobability that all m data fragments be correctly sent to the destination, and theTCP ACK be successfully sent back to the source:

Ps = Qms × Qs,ack ,

Knowing that a transmission is successful at the TCP level (i.e., the TCP ACK iscorrectly received by the TCP source, which implies that all m fragments correctlyreached the destination), the expected total number of bits sent by all nodesequals:

Ss = Es ×m + Es,ack

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 11 / 22

Page 18: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

TCP Model

Ps : The success probability of a TCP segment transmission attempt is simply theprobability that all m data fragments be correctly sent to the destination, and theTCP ACK be successfully sent back to the source:

Ps = Qms × Qs,ack ,

Knowing that a transmission is successful at the TCP level (i.e., the TCP ACK iscorrectly received by the TCP source, which implies that all m fragments correctlyreached the destination), the expected total number of bits sent by all nodesequals:

Ss = Es ×m + Es,ack

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 11 / 22

Page 19: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

TCP Model

Knowing that a TCP transmission attempt has failed, the expected number ofbits sent end-to-end by all nodes is:

Sf =1

1 − Ps

[If (1 − Qm

s )︸ ︷︷ ︸end-to-end transmission failure

of one or more of the m fragments

+ (Es ×m + Ef ,ack)Qms (1 − Qs,ack)︸ ︷︷ ︸

end-to-end transmission failure of the TCP ACK

],

If =m∑

k=1

(m

k

)(kEf +(m−k)Es

)(1−Qs)k(Qs)m−k = m(1−Qs)Ef +mEsQs(1−Qm

s ).

This therefore corresponds to a total number of bits sent (per segment) of

S = Sf (1/Ps − 1) + Ss .

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 12 / 22

Page 20: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Scenario & Parameters

TCP Sender TCP Receivern-1 n n+1

Figure: Chain Topology

Parameter Valueh 5r 3α 0BER B 3 × 10−4

Link-layer Ack frame size 40 bitsLink-layer data frame header 120 bitsIP header 160 bitsTCP header 160 bits

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 13 / 22

Page 21: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Scenario & Parameters

TCP Sender TCP Receivern-1 n n+1

Figure: Chain Topology

Parameter Valueh 5r 3α 0BER B 3 × 10−4

Link-layer Ack frame size 40 bitsLink-layer data frame header 120 bitsIP header 160 bitsTCP header 160 bits

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 13 / 22

Page 22: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Model assessment (1/2)

10−6 10−5 10−4 10−3

101

102

103

BER

Consumed

energy(J)

MSS = 512 (model)

MSS = 512 (simulation)

MSS = 64 (model)

MSS = 64 (simulation)

Figure: Energy consumption with long or short TCP segments, as a function ofthe BER B.

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 14 / 22

Page 23: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Model assessment (2/2)

2 3 4 5 6 7

101

102

Maximum link layer attempts

Consumed

energy(J)

MSS = 512 (simulation)

MSS = 512 (model)

MSS = 64 (simulation)

MSS = 64 (model)

Figure: Energy consumption with short or long TCP segments, as a function ofthe number of link layer attempts r (with B = 5 × 10−4).

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 15 / 22

Page 24: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

FEC redundancy ratio and energy consumption (1/2)

10−3 10−2 10−1 100100

101

102

103

Redundancy ratio (α)

Consumed

energy(J)

MSS = 512, r=1

MSS = 512, r=3

MSS = 64, r=1

MSS = 64, r=3

Figure: Consumed energy using short or long TCP segment, as a function of theredundancy ratio α (B = 3 × 10−4, h = 5).

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 16 / 22

Page 25: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

FEC redundancy ratio and energy consumption (2/2)

10−2 10−1 100100

101

102

103

Redundancy ratio (α)

Consumed

energy(J)

MSS = 512, B = 10−3

MSS = 512, B = 10−4

MSS = 64, B = 10−3

MSS = 64, B = 10−4

Figure: Consumed energy using short or long TCP segment, as a function of theredundancy ratio α (r = 1, h = 5).

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 17 / 22

Page 26: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Selecting the TCP MSS to minimize energy consumption

2 4 6 8 10100

101

102

Number of Hops (h)

Consumed

energy(J)

MSS = 512, B = 4× 10−4

MSS = 64, B = 4× 10−4

Figure: Energy consumption for short and long TCP segment sizes, as a functionof the network size (r = 3).

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 18 / 22

Page 27: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Selecting the TCP MSS to minimize energy consumption

Depending on the transmission distance and the BER. We remark that for a givenBER, short MSSs tend to outperform long MSSs when the distance grows: it ismore and more interesting to use short MSS values instead of long ones.

2 4 6 810−5

10−4

10−3

10−2

10−1

Number of Hops (h)

BER

MSS=64

MSS=512

Figure: Long (MSS=512 bytes) versus short (MSS=64 bytes) in a multi-hoptransmission (r = 3).

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 19 / 22

Page 28: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

The impact of ARQ max attempts

2 4 6 810−5

10−4

10−3

r = 1

r = 2

r = 3

r = 4

r = 5r = 7

Number of Hops (h)

BER

Figure: Long (MSS=512 bytes) versus short (MSS=64 bytes) in a multi-hop TCPtransmission: prefer the short MSS above the curves, the long one below.

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 20 / 22

Page 29: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

The effect of FEC mechanisms

Not surprisingly (the FEC reducing the effect of transmission errors), redundancymakes large MSSs outperform small MSSs due to the overhead reduction theyallow.

2 4 6 810−5

10−4

10−3

10−2

10−1

α = 10−3

α = 10−2

α = 10−1

Number of Hops (h)

BER

Figure: Long (MSS=512 bytes) versus short (MSS=64 bytes) in a multi-hop TCPtransmission: prefer the short MSS above the curves, the long one below.

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 21 / 22

Page 30: TCP over low-power and lossy networks: tuning the segment size to minimize energy consumption

Conclusion and perspectives

ConclusionI We have proposed an analytical model to estimate the number of bits

sent by all wireless nodes in a TCP session in a Low power and LossyNetwork, in order to evaluate the overall energy consumption,

I We have shown that using a large TCP segment size is lessenergy-consuming in small, low-error networks, while it becomesinteresting to reduce the MSS when the network is large or very lossy,

PerspectivesI A first interesting direction would be to model the collision process,

that has been observed in our simulations for large MSS values,I We would also like to consider the case when duplicate frames are not

detected at the link layer; likewise, the transport layer modeling couldbe extended to encompass TCP’s delayed acknowledgementmechanism, and also larger TCP windows,

I We are currently investigating an adaptation algorithm whichdynamically adjusts the TCP segment size to the optimal MSS value.

Ahmed Ayadi (IT/TELECOM Bretagne) NTMS Wireless Sensor Networks 2011 Paris, 8-9 February 2011 22 / 22