Sie sind auf Seite 1von 21

Chapter 3 Transport Layer

A note on the use of these ppt slides:


Were making these slides freely available to all (faculty, students, readers). Theyre in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following: qIf you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, wed like people to use our book!) qIf you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. q Thanks and enjoy! JFK/KWR All material copyright 1996-2007 J.F Kurose and K.W. Ross, All Rights Reserved

Computer Networking: A Top Down Approach 4th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.

Transmission Control Protocol (TCP): RFCs: 793, 1122, 1323, 2018, 2581

Reliable data transfer

Connection-oriented

Flow control
r

sender will not overwhelm receiver

Congestion control
r

Sender will not overwhelm the network


2

Chapter 3 outline
3.1 Transport-layer

services

3.5 Connection-oriented

transport: TCP
r r r r

3.2 Multiplexing and

segment structure reliable data transfer flow control connection management

demultiplexing

3.3 Connectionless

transport: UDP reliable data transfer

3.4 Principles of

3.6 Principles of

congestion control control

3.7 TCP congestion


3

Reliable Data Transfer


Assumption:
r

Underlying channel may corrupt packets and/or loose packets

Stop-and-wait Protocol
Sender:

i) send a data segment w/ seqno= x, x = 0 or 1

ii) wait for ACK w/ack = x;

buffer data segment, starts timer

iii) If timeout occurs, retransmit the data segment

if ACK w/ correct ack no. received, set x:=(x+1)mod2, go to i) If ACK w/ incorrect ack no., ignore

Receiver:

1 expect data segment w/ seq =x;

if data segment w/ correct seqno received, send ACK w/ ACK=x, set x:=(x+1)mod2, go to i) if data segment w/ incorrect seq no received, discard data segment, and retransmit ACK.
5

Stop and Wait in action

Stop and Wait in action

Stop and Wait Protocol


Advantages? Disadvantages?

stop-and-wait operation
sender first packet bit transmitted, t = 0 last packet bit transmitted, t = L / R first packet bit arrives last packet bit arrives, send ACK receiver

RTT

ACK arrives, send next packet, t = RTT + L / R

sender

L/R RTT + L / R
30.008

= 0.00027

microsec onds
9

Performance of Stop and Wait

Example: 1 Gbps link, 15 ms end-end prop. delay, 1000 byte packet:


L (packet length in bits) 8000 b/pkt = = 8 microsec R (transmission rate, bps) 10^9 b/sec : utilization fraction of time sender busy sending
sender

Ttransmit =

rU sender

U
r r1000

L/R RTT + L / R

.008
30.008

= 0.00027

microsec onds

byte pkt every 30 msec -> 33kB/sec throuput over 1 Gbps link
10

Pipelined protocols

Pipelining: sender allows multiple, in-flight, yetto-be-acknowledged pkts

11

Pipelining: increased utilization


sender first packet bit transmitted, t = 0 last bit transmitted, t = L / R first packet bit arrives last packet bit arrives, send ACK last bit of 2nd packet arrives, send ACK last bit of 3rd packet arrives, send ACK receiver

RTT

ACK arrives, send next packet, t = RTT + L / R

Increase utilization by a factor of 3!

3L bits sent every (RTT+L/R) units of time


12

Pipelined Protocols
Two generic forms of pipelined protocols:
r r

Go-Back-N Selective repeat

13

Go-Back-N: Basic Idea

Sender:
r r r r

Packets transmitted continually (when available) without waiting for ACK, up to N outstanding, unACKed packets A timer is started when a packet is sent On getting an ACK(n), stops the timer for packet n, sends additional packets if possible timeout(n): retransmit pkt n and all higher seq # pkts in window, restart the timer if there are unacked pkts

Receiver:
r

if correctly received and in-order

Out-of-order/Corrupted Packets:

send cummulative ACK(n) acknowledging receipt of all packets up to and including n pass packet to to higher layer,
14

GBN in action
N=4

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

As acknowledgement arrives, window moves forward

15

GBN
Advantages? Disadvantages?

16

Selective Repeat Protocol


As in Go-Back-N
r r

Packet sent when available up to window limit

Unlike Go-Back-N
r r r r r r

Receiver: buffer out-of-order pkts Out-of-order (but otherwise correct) is ACKed no cumulative ACKs, ACK(n) means packet n has been received Sender: on timeout of packet k, retransmit just pkt k Uses a separate timer for each transmitted packet

Comments
r

Save bandwidth no need to retransmit correctly received packets

17

Selective repeat

Sender: data from above :

if next available seq # in window, send pkt, start timer resend pkt n, restart timer mark pkt n as received if n is the smallest unACKed pkt, advance window base to next unACKed seq #

timeout(n):
r

ACK(n) in [sendbase,sendbase+N-1]:
r r

18

Selective Repeat

Receiver:
r r r

pkt n in [rcvbase, rcvbase+N-1]


send ACK(n) out-of-order: buffer in-order: deliver (also deliver buffered, in-order pkts), advance window to next not-yet-received pkt ACK(n) ignore

pkt n in [rcvbase-N,rcvbase-1]
r

otherwise:
r

19

Selective repeat in action (N=4)

Sent but not acked

Sent and acked

Recvd out of order, 20 buffered

Selective repeat: dilemma


Seq # are fields (say k bits

long) in packet hdr


Seq# lie in a range [0, 2k-1].

Example:

k=2, seq #s: 0, 1, 2, 3 window size=3

receiver sees no difference

in two scenarios!
incorrectly passes duplicate

data as new in (a)

Q: What relationship between seq # space and window size?

21

Das könnte Ihnen auch gefallen