introduction 1 lecture 14 transport layer (transmission control protocol) slides are modified from...

18
Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering Department Fall 2011 CPE 400 / 600 Computer Communication Networks

Upload: isaac-ellis

Post on 18-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Introduction 1

Lecture 14Transport Layer

(Transmission Control Protocol)

slides are modified from J. Kurose & K. Ross

University of Nevada – RenoComputer Science & Engineering Department

Fall 2011

CPE 400 / 600Computer Communication Networks

Page 2: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-2

Chapter 3 outline

3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer

3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection

management 3.6 Principles of

congestion control 3.7 TCP congestion

control

Page 3: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-3

Principles of Congestion Control

Congestion: informally: “too many sources sending too

much data too fast for network to handle” different from flow control! manifestations:

lost packets (buffer overflow at routers) long delays (queueing in router buffers)

a top-10 problem!

Page 4: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-4

Causes/costs of congestion: scenario 1

two senders, two receivers

one router, infinite buffers

no retransmission

large delays when congested

maximum achievable throughput

unlimited shared output link buffers

Host Alin : original data

Host B

lout

Page 5: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-5

Causes/costs of congestion: scenario 2

one router, finite buffers sender retransmission of lost packet

finite shared output link buffers

Host A lin : original data

Host B

lout

l'in : original data, plus retransmitted data

Page 6: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-6

Causes/costs of congestion: scenario 2 always: (goodput)

“perfect” retransmission only when loss:

retransmission of delayed (not lost) packet makes

larger (than perfect case) for same

lin

lout

=

lin

lout

>l

inl

out

“costs” of congestion: more work (retrans) for given “goodput” unneeded retransmissions: link carries multiple copies of

pkt

Page 7: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-7

Causes/costs of congestion: scenario 3 four senders multihop paths timeout/retransmit

lin

Q: what happens as and increase ?

lin

finite shared output link buffers

Host Alin : original data

Host B

lout

l'in : original data, plus retransmitted data

Page 8: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-8

Causes/costs of congestion: scenario 3

another “cost” of congestion: when packet dropped, any “upstream

transmission capacity used for that packet was wasted!

Host A

Host B

lo

u

t

Page 9: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-9

Approaches towards congestion control

end-end congestion control:

no explicit feedback from network

congestion inferred from end-system observed loss, delay

approach taken by TCP

network-assisted congestion control:

routers provide feedback to end systems single bit indicating

congestion (SNA, DECbit, TCP/IP ECN, ATM)

explicit rate sender should send at

two broad approaches towards congestion control:

Page 10: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-10

Case study: ATM ABR congestion control

ABR: available bit rate:

“elastic service” if sender’s path

“underloaded”: sender should use

available bandwidth if sender’s path

congested: sender throttled to

minimum guaranteed rate

RM (resource management) cells:

sent by sender, interspersed with data cells

bits in RM cell set by switches (“network-assisted”) NI bit: no increase in rate

(mild congestion) CI bit: congestion

indication RM cells returned to sender

by receiver, with bits intact

Page 11: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-11

Case study: ATM ABR congestion control

two-byte ER (explicit rate) field in RM cell congested switch may lower ER value in cell sender’ send rate thus maximum supportable rate on

path EFCI bit in data cells: set to 1 in congested

switch if data cell preceding RM cell has EFCI set, sender sets

CI bit in returned RM cell

Page 12: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-12

Chapter 3 outline

3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer

3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection

management 3.6 Principles of

congestion control 3.7 TCP congestion

control

Page 13: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-13

TCP congestion control: goal: TCP sender should transmit as fast as

possible, but without congesting network Q: how to find rate just below congestion level

decentralized: each TCP sender sets its own rate, based on implicit feedback: ACK: segment received (a good thing!),

network not congested, so increase sending rate

lost segment: assume loss due to congested network, so decrease sending rate

Page 14: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-14

TCP congestion control: bandwidth probing

“probing for bandwidth”: increase transmission rate on receipt of ACK, until eventually loss occurs, then decrease transmission rate continue to increase on ACK, decrease on loss (since

available bandwidth is changing, depending on other connections in network)

ACKs being received, so increase rate

X

X

XX

Xloss, so decrease rate

send

ing r

ate

time

Q: how fast to increase/decrease? details to follow

TCP’s“sawtooth”behavior

Page 15: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-15

TCP Congestion Control: details

sender limits rate by limiting number of unACKed bytes “in pipeline”:

cwnd: differs from rwnd (how, why?) sender limited by min(cwnd,rwnd)

roughly,

cwnd is dynamic, function of perceived network congestion

rate = cwnd

RTT bytes/sec

LastByteSent-LastByteAcked cwnd

cwndbytes

RTT

ACK(s)

Page 16: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-16

TCP Congestion Control: more details

segment loss event: reducing cwnd

timeout: no response from receiver cut cwnd to 1

3 duplicate ACKs: at least some segments getting through recall fast retransmit cut cwnd in half, less

aggressively than on timeout

ACK received: increase cwnd

slowstart phase: increase exponentially

fast (despite name) at connection start, or following timeout

congestion avoidance: increase linearly

Page 17: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-17

TCP Slow Start when connection begins, cwnd = 1

MSS example: MSS = 500 bytes &

RTT = 200 msec initial rate = 20 kbps

available bandwidth may be >> MSS/RTT desirable to quickly ramp up to

respectable rate

increase rate exponentially until first loss event or when threshold reached double cwnd every RTT done by incrementing cwnd by 1

for every ACK received

Host A

one segment

RTT

Host B

time

two segments

four segments

Page 18: Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer

Transport Layer 3-18

Transitioning into/out of slowstartssthresh: cwnd threshold maintained by TCP on loss event: set ssthresh to cwnd/2

remember (half of) TCP rate when congestion last occurred when cwnd >= ssthresh: transition from slowstart to

congestion avoidance phase

slow start

timeoutssthresh = cwnd/2

cwnd = 1 MSSdupACKcount = 0

retransmit missing segment timeout

ssthresh = cwnd/2 cwnd = 1 MSS

dupACKcount = 0retransmit missing segment

Lcwnd > ssthresh

cwnd = cwnd+MSSdupACKcount = 0transmit new segment(s),as allowed

new ACKdupACKcount++

duplicate ACK

Lcwnd = 1 MSS

ssthresh = 64 KBdupACKcount = 0 congestion

avoidance