tcp over wireless - 國立臺灣大學hsinmu/courses/_media/... · tcp over wireless prof. ......

17
TCP over Wireless PROF. MICHAEL TSAI 2016/6/3

Upload: duongdiep

Post on 24-Mar-2018

221 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

TCP over Wireless

PROF. MICHAEL TSAI

2016/6/3

Page 2: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

TCP Congestion Control (TCP Tahoe)

• Only ACK correctly received packets

• Congestion Window Size: Maximum number of bytes that can be sent without receiving acknowledgements.

• Larger window size == faster rate

• Three major mechanisms:

• Slow start

• Congestion avoidance

• Fast retransmit

2

Page 3: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

Slow start + congestion avoidance

• Congestion window size = 1 initially.

• Ssthresh: slow start threshold

• Slow start:For each received ACK (with a new seq. no. ), the window size is exponentially increased (e.g., doubled). (when the window size is smaller than ssthresh)

• Congestion avoidance:After reaching ssthresh, the window size is linearly increased.

• Additive Increase

3

Source Destination

Page 4: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

Slow start + congestion avoidance

• TCP calculates expected round trip time (RTT) and its deviation

• Timeout: wait time > expected RTT + 4 * deviation

• Timeout: it signals a packet loss due to congestion (?)

• When a timeout happens, TCP Tahoe does the following:

• Dropping ssthresh into half the current window or 2 (multiplicative decrease)

• Resetting its window size to 1 + enter slow start

• Double round trip time timer

4

Page 5: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

5

Pseudocode

Initially:

cwnd = 1;

ssthresh = infinite;

New ack received:

if (cwnd < ssthresh)

/* Slow Start*/

cwnd = cwnd + 1;

else

/* Congestion Avoidance */

cwnd = cwnd + 1/cwnd;

Timeout:

/* Multiplicative decrease */

ssthresh = cwnd/2;

cwnd = 1;

Page 6: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

6

The big picture (with timeouts)

Time

cwnd

Timeout

SlowStart

AIMDTimeout

ssthresh

SlowStart

SlowStart

AIMD

Initially:

cwnd = 1;

ssthresh = infinite;

New ack received:

if (cwnd < ssthresh)

/* Slow Start*/

cwnd = cwnd + 1;

else

/* Congestion Avoidance */

cwnd = cwnd + 1/cwnd;

Timeout:

/* Multiplicative decrease */

ssthresh = cwnd/2;

cwnd = 1;

Page 7: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

7

Fast Retransmit

• Resend a segment after 3 duplicate ACKs

• Duplicate ACK means that an out-of sequence segment was received

• Notes:

• ACKs are for next expected packet

• Packet reordering can cause duplicate ACKs

• Window may be too small to get enough duplicate ACKs

cwnd = 1

cwnd = 2

cwnd = 4

3 duplicate

ACKs

Page 8: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

Big problems for TCP

• High bit error rates:up to 10^-5 bit error rate.Lots of lost packets due to bit errors.

• Disconnections:

• Handoff: mobile devices move between base stations / access points.

• Mobility: mobile devices move in and out of range of the transmitter.

• Fading: signals blocked by buildings or other obstacles.

• Round trip time could significantly vary.(Indication of packet loss could be inaccurate)

• Big problem: packet losses are not necessarily due to congestion! (the assumption of the original TCP)

8

Page 9: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

9

Page 10: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

Classification of Solutions

• Link layer

• Goal: improve the quality of the link layer, hide the losses from TCP

• “Local problems should be solved locally”

• End-to-end

• Additional considerations are added to TCP to improve its performance

• Limited performance improvement

• No modification on the hosts is required

• Split-connection

• Wireless usually the last link to the mobile host

• Isolate that wireless link with the rest of the path (wired)

• Two TCP connections, bridged at the wireless gateway

• Use regular TCP for wired links

• Use a special protocol designed specifically for that wireless link

10

Page 11: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

Indirect TCP (I-TCP)

11

Peter A. Steenkiste, CMCL, CMU 28

I-TCP

Mobile hostAccess Point

Internet

“wireless” transportStandard TCP

Page 12: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

Indirect TCP (I-TCP)

12

Peter A. Steenkiste, CMCL, CMU 29

I-TCP and Mobility

Mobile Host Access point (2)

Internet

Access Point (1)

Socket migration

and state transfer

Page 13: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

I-TCP

• Advantages

• No changes in the fixed network / hosts (TCP)

• Wireless transmission errors do not propagate to the wire-line network

• Simple and effective

• Disadvantages

• End-to-end semantics become less clear

• Higher end-to-end delay due to buffering and forwarding at the gateway

13

Page 14: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

Snooping TCP

• Transparent extension of TCP within the gateway

• Hides wireless losses from wired host

• Buffer packets sent to the mobile host

• Local retransmission:lost packets on the wireless link, for both directions, are retransmitted immediately by the mobile host or foreign agent

• Wireless gateway snoops the packet flow so that it can cover up signs of packet loss

• Recognizes ACK in both directions and suppresses duplicate ACKs

14

Page 15: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

Snooping TCP

15

Page 16: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

Snooping TCP

• Data transfer to the mobile host

• FA buffers data until it receives ACK from the MH

• FA detects packet loss via duplicated ACKs or timeout

• Data transfer from the mobile host

• FA detects packet loss on the wireless link via sequence numbers

• FA answers directly with a NACK to the MH

• MH can now retransmit data with only a very short delay

• Integration of the MAC layer

• Similar mechanisms often exist in MAC

16

Page 17: TCP over Wireless - 國立臺灣大學hsinmu/courses/_media/... · TCP over Wireless PROF. ... Indirect TCP (I-TCP) 11 U 28 I -T C P e host s oint et ort TC P. Indirect TCP (I-TCP)

Snooping TCP

17

Peter A. Steenkiste, CMCL, CMU 32

Snooping TCP

Internet

Buffering of data

End-to-end TCP connection

Local Retransmission Wired

HostWireless

Gateway

Mobile

Host

Snooping of ACKs