1 cse 524: lecture 13 transport layer (part 4). 2 administrative homework #4 due monday 11/12...

37
1 CSE 524: Lecture 13 Transport Layer (Part 4)

Upload: alexia-joanna-griffith

Post on 20-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

1

CSE 524: Lecture 13

Transport Layer (Part 4)

Page 2: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

2

Administrative

• Homework #4 due Monday 11/12• Reading assignment Chapter 3

Page 3: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

3

Transport layer

• So far…– Transport layer functions

– Specific transport layers• UDP

• TCP– In the middle of congestion control

• This class– Finish TCP

– Advanced topics• Survey of advanced transport layer issues

• Queue management and congestion control (in particular)

Page 4: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

4

TL: TCP Tahoe slow start

• Recall– Connection starts out with cwnd=1

– Increases cwnd by 1 segment for every acknowledgement• Exponential increase

• cwnd doubled every RTT

Page 5: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

5

TL: TCP Tahoe congestion avoidance

• Loss implies congestion – why?– Not necessarily true on all link types

• If loss occurs when cwnd = W– Network can handle 0.5W ~ W segments

– Loss detected via timeout or 3 duplicate acknowledgements (“fast retransmit”)

– Set ssthresh to 0.5W and slow-start from cwnd=1

• Upon receiving ACK with cwnd > ssthresh– Increase cwnd by 1/cwnd

– Results in additive increase

Page 6: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

6

TL: TCP Tahoe congestion avoidance

/* slowstart is over */ /* cwnd > ssthresh */Until (loss event) { every w segments ACKed: cwnd++ }ssthresh = cwnd/2cwnd = 1 perform slowstart

Congestion avoidance

1

1: TCP Reno halves cwnd and skips slowstart after three duplicate ACKs

Page 7: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

7

TL: TCP Tahoe congestion avoidance plot

Time

Sequence No

Page 8: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

8

TL: TCP Tahoe fast retransmit

• Timeouts (see previous)• Duplicate acknowledgements (dupacks)

– Repeated acks for the same sequence number

– When can duplicate acks occur?• Loss

• Packet re-ordering

• Window update – advertisement of new flow control window

– Assume re-ordering is infrequent and not of large magnitude

– Use receipt of 3 or more duplicate acks as indication of loss

– Don’t wait for timeout to retransmit packet

Page 9: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

9

TL: TCP Tahoe fast retransmit

Time

Sequence NoDuplicate Acks

RetransmissionX

Page 10: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

10Time

Sequence NoX

X

XX

TL: TCP Tahoe fast retransmit plot

Page 11: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

11

TL: TCP Reno

• All mechanisms in Tahoe

• Add delayed acks (see flow control section)

• Header prediction– Implementation designed to improve performance

– Has common case code inlined

• Add “fast recovery” to Tahoe’s fast retransmit– Do not revert to slow-start on fast retransmit

– Upon detection of 3 duplicate acknowledgments• Trigger retransmission (fast retransmission)

• Set cwnd to 0.5W (multiplicative decrease) and set threshold to 0.5W (skip slow-start)

• Go directly into congestion avoidance

– If loss causes timeout (i.e. self-clocking lost), revert to TCP Tahoe

Page 12: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

12

TL: TCP Reno congestion avoidance

/* slowstart is over */ /* cwnd > ssthresh */Until (loss detected) { every w segments ACKed: cwnd++ }/* fast retrasmit */if (3 duplicate ACKs) { ssthresh = cwnd/2 cwnd = cwnd/2 skip slow start go to fast recovery}

Congestion avoidance

1

Page 13: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

13

TL: TCP Reno example

1

2

4

RTTRTT RTT

WW+1

2W

Congestion avoidance

Fast Retransmit/RecoverySlow-start

Page 14: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

14

TL: TCP Reno fast recovery

• Tahoe– Loses self-clocking

• Issues in recovering from loss– Cumulative acknowledgments freeze window after fast retransmit

• On a single loss, get almost a window’s worth of duplicate acknowledgements

– Dividing cwnd abruptly in half further reduces sender’s ability to transmit

• Reno– Use fast recovery to transition smoothly into congestion avoidance– Each duplicate ack notifies sender that single packet has cleared network– Inflate window temporarily while recovering lost segment– Allow new packets out with each subsequent duplicate

acknowledgement to maintain self-clocking– Deflate window to cwnd/2 after lost packet is recovered

Page 15: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

15

TL: TCP Reno fast recovery behavior

• Behavior– Sender is idle for some time

• Waiting for ½ cwnd worth of dupacks

• Window inflation puts “inflated cwnd” at original cwnd after ½ cwnd worth of dupacks

• Additional dupacks push “inflated cwnd” beyond original cwnd allowing for additional data to be pushed out during recovery

– After pausing for ½ cwnd worth of dupacks• Transmits at original rate after wait

• Ack clocking rate is same as before loss

– Results in ½ RTT time idle, ½ RTT time at old rate

– Upon recovery of lost segment, cwnd deflated to cwnd/2

Page 16: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

16

TL: TCP Reno fast recovery example

• TCP connection with cwnd=16 at segment number 32– Receiver receives segment 31 and sends cumulative ack 32– Sender sends segments 32-48– Segment 32 lost, but receiver receives 33-48 and

acknowledges each them with cumulative ack 32– Receiver sends 16 duplicate cumulative acks for ack 32

• acks from 31, 33, 34=>rexmit 32 (cwnd=8)• acks from 35, 36, 37, 38, 39, 40, 41 42 (cwnd=16)• ack from 43=>send 49 (cwnd=17)• acks from 44, 45, 46, 47, 48=> send 50, 51, 52, 53, 54 (cwnd=22)

– Receiver gets rexmit of 32 and sends back ack 49• ack 49=>deflate window (cwnd=8), send 55, 56

Page 17: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

17

TL: TCP Reno fast recovery plot

Time

Sequence NoSent for each dupack after

W/2 dupacks arrive

Page 18: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

18

TL: TCP Reno and fairness

Fairness goal: if N TCP sessions share same bottleneck link, each should get 1/N of link capacity

TCP congestion avoidance:

• AIMD: additive increase, multiplicative decrease– increase window by 1 per

RTT

– decrease window by factor of 2 on loss event

TCP connection 1

bottleneckrouter

capacity R

TCP connection 2

Page 19: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

19

TL: Why is TCP Reno fair?

Recall phase plot discussion with two competing sessions:• Additive increase gives slope of 1, as throughout increases

• multiplicative decrease decreases throughput proportionally

R

R

equal bandwidth share

Connection 1 throughputConnect

ion 2

th

roughput

congestion avoidance: additive increaseloss: decrease window by factor of 2

congestion avoidance: additive increaseloss: decrease window by factor of 2

Page 20: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

20

TL: TCP Reno and multiple losses• Multiple losses cause timeout in TCP Reno

Time

Retransmissiontimeout

Sequence NoDuplicate AcksX

X

XX

Now what?

Page 21: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

21

TL: TCP NewReno changes

• More intelligent slow-start– Estimate ssthresh based while in slow-start

• Adapt more gradually to new window• Address multiple losses in window

Page 22: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

22

TL: TCP NewReno gradual adaptation

• Send a new packet out for each pair of dupacks• Do not wait for ½ cwnd worth of duplicate acks to

clear

Page 23: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

23

TL: TCP NewReno gradual fast recovery plot

Time

Sequence NoSent after every

other dupack

Page 24: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

24

TL: TCP NewReno and multiple losses

• Partial acknowledgements– Window is advanced, but only to the next lost segment

– Stay in fast recovery for this case, keep inflating window on subsequent duplicate acknowledgements

– Remain in fast recovery until all segments in window at the time loss occurred have been acknowledged

– Do not halve congestion window again until recovery is completed

• When does NewReno timeout?– When there are fewer than three dupacks for first loss

– When partial ack is lost

• How quickly does NewReno recover multiple losses?– At a rate of one loss per RTT

Page 25: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

25

TL: TCP NewReno multiple loss plot

Time

Sequence NoX

X

XX

Now what? – partial ackrecovery

Page 26: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

26

TL: TCP with SACK

• Basic problem is that cumulative acks only provide little information– Add selective acknowledgements

• Ack for exact packets received

• Not used extensively (yet)

• Carry information as bitmask of packets received

– Allows multiple loss recovery per RTT via bitmask

• How to deal with reordering?

Page 27: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

27

TL: TCP with SACK plot

Time

Sequence NoX

X

XX

Now what? – sendretransmissions as soonas detected

Page 28: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

28

TL: Interaction of flow and congestion control

• Sender’s max window (advertised window, congestion window)

• Question:– Can flow control mechanisms interact poorly with congestion control

mechanisms?

• Answer:– Yes…..Delayed acknowledgements and congestion windows

• Delayed Acknowledgements – TCP congestion control triggered by acks

• If receive half as many acks window grows half as fast

– Slow start with window = 1• Will trigger delayed ack timer• First exchange will take at least 200ms• Start with > 1 initial window

– Bug in BSD, now a “feature”/standard

Page 29: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

29

TL: TCP Flavors

• Tahoe, Reno, NewReno Vegas• TCP Tahoe (distributed with 4.3BSD Unix)

– Original implementation of Van Jacobson’s mechanisms

– Includes slow start, congestion avoidance, fast retransmit

• TCP Reno– Fast recovery

• TCP NewReno, SACK, FACK– Improved slow start, fast retransmit, and fast recovery

Page 30: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

30

TL: Evolution of TCP

1975 1980 1985 1990

1982TCP & IP

RFC 793 & 791

1974TCP described by

Vint Cerf and Bob KahnIn IEEE Trans Comm

1983BSD Unix 4.2

supports TCP/IP

1984Nagle’s algorithmto reduce overhead

of small packets;predicts congestion

collapse

1987Karn’s algorithmto better estimate

round-trip time

1986Congestion

collapseobserved

1988Van Jacobson’s

algorithmscongestion avoidance and congestion control(most implemented in

4.3BSD Tahoe)

19904.3BSD Renofast retransmitdelayed ACK’s

1975Three-way handshake

Raymond TomlinsonIn SIGCOMM 75

Page 31: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

31

TL: TCP Through the 1990s

1993 1994 1996

1994ECN

(Floyd)Explicit

CongestionNotification

1993TCP Vegas

(Brakmo et al)real congestion

avoidance

1994T/TCP

(Braden)Transaction

TCP

1996SACK TCP(Floyd et al)

Selective Acknowledgement

1996Hoe

Improving TCP startup

1996FACK TCP

(Mathis et al)extension to SACK

Page 32: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

32

TL: TCP and Security

• Transport layer security– Layer underneath application layer and above transport layer– SSL, TLS– Provides TCP/IP connection the following….

• Data encryption• Server authentication• Message integrity• Optional client authentication

– Original implementation: Secure Sockets Layer (SSL)• Netscape (circa 1994)• http://www.openssl.org/ for more information• Submitted to W3 and IETF

– New version: Transport Layer Security (TLS)• http://www.ietf.org/html.charters/tls-charter.html

Page 33: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

33

TL: TCP and Quality of Service

• Ad hoc…– Connection-based service differentiation

• Web switches

• Operating system policies– Buffer allocation

– Scheduling of protocol handlers

Page 34: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

34

TL: Advanced topics

• TCP header compression– Many header fields fixed or change slightly– Compress header to save bandwidth

• TCP timestamp option– Ambiguity in RTT for retransmitted packets– Sender places timestamp in packet which receiver echoes back

• TCP sequence number wraparound (TCP PAWS)– 32-bit sequence/ack # wraps around– 10Mbs: 57 min., 100Mbs: 6 min., 622Mbs: 55 sec. < MSL!– Use timestamp option to disambiguate

• TCP window scaling option– 16-bit advertised window can’t support large bandwidth*delay networks– For 100ms network, need 122KB for 10Mbs (16-bit window = 64KB)– 1.2MB for 100Mbs, 7.4MB for 622Mbs– Scaling factor on advertised window specifies # of bits to shift to the left– Scaling factor exchanged during connection setup

Page 35: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

35

TL: Advanced topics (continued)

• Non-responsive, aggressive applications– Applications written to take advantage of network resources (multiple

TCP connections)

– Network-level enforcement, end-host enforcement of fairness

• Congestion information sharing – Individual connections each probe for bandwidth (to set ssthresh)

– Share information between connections on same machine or nearby machines (SPAND, Congestion Manager)

• Short transfers slow– Flows timeout on loss if cwnd < 3

– 3-4 packet flows (most HTTP transfers) need 2-3 round-trips to complete

– Change dupack threshold for small cwnd

– Use larger initial cwnd (IETF approved initial cwnd = 3 or 4)

Page 36: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

36

TL: Advanced topics (continued)

• Asymmetric TCP– TCP over highly asymmetric links is limited by ACK throughput (40

byte ack for every MTU-sized segment)– Coalesce multiple acknowledgements into single one

• TCP over wireless– TCP infers loss on wireless links as congestion and backs off– Add link-layer retransmission and explicit loss notification (to squelch

RTO)

• TCP-friendly rate control– Multimedia applications do not work well over TCP’s sawtooth– Derive smooth, stable equilibrium rate via equations based on loss rate

• TCP Vegas– TCP increases rate until loss– Avoid losses by backing off sending rate when delays increase

Page 37: 1 CSE 524: Lecture 13 Transport Layer (Part 4). 2 Administrative Homework #4 due Monday 11/12 Reading assignment Chapter 3

37

TL: Advanced topics (continued)

• ATM– TCP uses implicit information to fix sender’s rate– Explicitly signal rate from network elements

• ECN– TCP uses packet loss as means for congestion control– Add bit in IP header to signal congestion (hybrid between

TCP approach and ATM approach)

• Active queue management– Congestion signal the result of congestion not a signal of

imminent congestion– Actively detect and signal congestion beforehand