Docsity

Pipelined Protocols - Computer Networks - Lecture Slides, Slides of Computer Networks

Partial preview of the text

Download Pipelined Protocols - Computer Networks - Lecture Slides and more Slides Computer Networks in PDF only on Docsity!

9: Pipelined Protocols and RTT

Transport LayerDocsity.com (^) 3-

3: Transport Layer (^) 3a-

Stop and Wait

 Rdt3.0 also called Stop and Wait

 Sender sends one packet, then waits for

receiver response

 What is wrong with stop and wait?

 Slow!! Must wait full round trip time between

each send

 Obvious Fix?

 Instead send lots, then stop and wait

 Call this a pipelined protocol because many

packets in the pipeline at the same time

Transport Layer 3-

rdt3.0: stop-and-wait operation

first packet bit transmitted, t = 0

sender receiver

RTT

last packet bit transmitted, t = L / R

first packet bit arrives last packet bit arrives, send ACK

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

U

sender =^

L / R = 0.

RTT + L / R

3: Transport Layer (^) 3a-

How bad is Stop and Wait?

 Depends on network conditions

 example: 1 Gbps link, 15 ms end-to-end prop. delay, 1KB

packet:

Ttransmit = 1kb/pkt 10**9 b/sec = 1 microsec

Utilization = U = =^

1 microsec 30.001 msec

Utilization of the channel = 0.003%  1KB pkt every 30 msec -> 33kB/sec throughput over 1 Gbps link  network protocol limits use of physical resources!

 In general, smaller packets, longer RTT and higher maximum bandwidth, all make the situation worse

3: Transport Layer (^) 3a-

Filling the pipeline

 How much in-flight data is needed to “fill

the pipeline”?

 Similar to question of how much water

needed to fill a pipe (area of crosssection *

length of pipe)

 For networks, it is bandwidth*delay

Transport Layer 3-

Pipelined Protocols

Go-back-N: big picture:

 sender can have up to

N unacked packets in

pipeline

 rcvr only sends

cumulative acks  doesn’t ack packet if there’s a gap

 sender has timer for

oldest unacked packet

 if timer expires, retransmit all unack’ed packets

Selective Repeat: big pic

 sender can have up to

N unack’ed packets in

pipeline

 rcvr sends individual ack for each packet

 sender maintains timer

for each unacked

packet

 when timer expires, retransmit only unack’ed packet

Transport Layer 3-

GBN: sender extended FSM

Wait start_timerudt_send(sndpkt[base])^ //resend all packets in window udt_send(sndpkt[base+1]) … udt_send(sndpkt[nextseqnum-1])

timeout

rdt_send(data) if (nextseqnum < base+N) { sndpkt[nextseqnum] = make_pkt(nextseqnum,data,chksum) udt_send(sndpkt[nextseqnum]) if (base == nextseqnum) //one timer per window start_timer nextseqnum++ } else refuse_data(data) //or just block the caller

base = getacknum(rcvpkt)+1 //cummulative ack If (base == nextseqnum) stop_timer //have acked all outstanding else //send any data this allows us room in window to send start_timer //start timer for remaining base to nextseqnum

rdt_rcv(rcvpkt) && notcorrupt(rcvpkt)

base= nextseqnum=

rdt_rcv(rcvpkt) && corrupt(rcvpkt)

Λ

/*don’t do anything if receiver feedback corrupt */

Docsity.com

Transport Layer 3-

GBN: receiver extended FSM

ACK-only: always send ACK for correctly-received pkt

with highest in-order seq #  may generate duplicate ACKs  need only remember expectedseqnum

 out-of-order pkt:

 discard (don’t buffer) ->receiver buffering is not required but can help if want to!  Re-ACK pkt with highest in-order seq #

Wait

udt_send(sndpkt)

default rdt_rcv(rcvpkt) && notcurrupt(rcvpkt) && hasseqnum(rcvpkt,expectedseqnum) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(expectedseqnum,ACK,chksum) udt_send(sndpkt) expectedseqnum++

expectedseqnum= sndpkt = make_pkt(expectedseqnum,ACK,chksum)

Λ

3: Transport Layer (^) 3a-

Selective Repeat

 GBN forces sender to retransmit all

packets in window even if some have been

correctly received

 To avoid that we need a finer granularity

of acknowledgement

 individual acknowledgements vs cumulative

acknowledgements

Transport Layer 3-

Selective Repeat

 receiver individually acknowledges all correctly

received pkts

 buffers pkts, as needed, for eventual in-order delivery to upper layer

 sender only resends pkts for which ACK not

received

 sender timer for each unACKed pkt

 sender window

 N consecutive seq #’s  again limits seq #s of sent, unACK’ed pkts

Transport Layer 3-

Selective repeat

data from above :

 if next available seq # in window, send pkt

timeout(n):

 resend pkt n, restart timer

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

 mark pkt n as received  if n smallest unACKed pkt, advance window base to next unACKed seq #

sender

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

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

 ACK(n)

otherwise:

 ignore

receiver

Transport Layer 3-

Selective repeat in action

Loss of one pkt causes retransmission of just that pkt

3: Transport Layer (^) 3a-

Pipelined protocols

Sequence Number

Dilemma

Example:

 seq #’s: 0, 1, 2, 3  window size=  receiver sees no difference in two scenarios!  incorrectly passes duplicate data as new in (a)  Similar to the problem we saw in stop and wait until we added seq 0 and 1

3: Transport Layer (^) 3a-

Sequence Number Space

 Q: what relationship

between seq # size

and window size?

 A: sequence number

space >= 2 * window

size

 True for Stop and Wait (1 <= ½*2)  need old and new version of every sequence #

 Still one problem, packets

could conceivably delayed

for arbitrarily long in the

network so could get an

old packet N even after

the sequence number

space has wrapped around

 Solution? Not really. In

practice, assume a

maximum time a packet

could live in the network