Professional Documents
Culture Documents
8 RDT Part2 Jan 25
8 RDT Part2 Jan 25
Gaurav S. Kasbekar
Dept. of Electrical Engineering
IIT Bombay
Introduction 1-1
Reference
These are a modified version of slides by
Kurose and Ross available at:
http://ctas.poly.asu.edu/millard/CET459/lectno/K%
20-%20R%20stuff/index.html
Introduction 1-2
Reliable Data Transfer
Bit errors
Channel can lose packets (data or ACKs)
No re-ordering
Note:
• More than two sequence numbers needed
• Initially assume infinite number of sequence
numbers for simplicity Transport Layer 3-8
Pipelining: increased utilization
sender receiver
first packet bit transmitted, t = 0
last bit transmitted, t = L / R
Increase in utilization
Utilization: by a factor of 3!
U 3*L/R .024
= = = 0.0008
sender 30.008
RTT + L / R microsecon 3-9
Window
How many transmitted,
unacknowledged packets
should be allowed?
e.g., in interval [𝑡1, 𝑡2] in fig
In “ideal scenario”
no congestion, unlimited
memory at receiver’s buffer
unlimited
Sender blocked
until A1 received
3-12
Packet Loss
What should the receiver
do upon receipt of packet
3?
1) Buffer and selectively
ACK packet 3
Selective Repeat Protocol
2) Discard packet 3
Go-Back-N
useful when receiver has
limited storage, processing
capabilities
Transport Layer 3-13
Go-Back-N Operation
• Receiver discards out-of-
order packets
• When timeout occurs,
sender resends that packet
and all subsequent packets
in window
• hence the name “Go-Back-N”
• Receiver ACKs are
cumulative
• ACK(n): ACKs all packets up
to and including packet n
• In figure, wouldn’t matter if
ACK0 were lost provided
ACK1 reached before pkt0’s
timeout
Transport Layer 3-14
Sender’s and Receiver’s Views of
Sequence Numbers
Sender’s Window:
send_base = seq. no. of oldest sent, unACKed packet
nextseqnum=smallest unused seq. no.
3-16
Go-Back-N Operation
• If receiver receives packet
with seq. no. greater than
expectedseqnum:
• discards packet (out-of-order)
• ACK not necessary for correct
operation
• But cumulative
ACK(expectedseqnum-1) still sent
• useful if previous ACKs were lost
3-17
Go-Back-N Operation
• Can the sender get an ACK for
a pkt with sequence number <
send_base-1?
• No, due to “no-reordering”
assumption
3-18
GBN: Sender FSM
rdt_send(data)
if (nextseqnum < base+N) {
sndpkt[nextseqnum] = make_pkt(nextseqnum,data,chksum)
udt_send(sndpkt[nextseqnum])
if (base == nextseqnum)
start_timer
nextseqnum++
}
L else
refuse_data(data)
base=1
nextseqnum=1
timeout
start_timer
Wait udt_send(sndpkt[base])
udt_send(sndpkt[base+1])
rdt_rcv(rcvpkt)
…
&& corrupt(rcvpkt)
udt_send(sndpkt[nextseqnum-1])
L rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
base = getacknum(rcvpkt)+1
If (base == nextseqnum)
stop_timer
else
start_timer
3-19
GBN: Receiver FSM
default
udt_send(sndpkt) rdt_rcv(rcvpkt)
&& notcurrupt(rcvpkt)
L && hasseqnum(rcvpkt,expectedseqnum)
expectedseqnum=1 Wait extract(rcvpkt,data)
sndpkt = deliver_data(data)
make_pkt(expectedseqnum,ACK,chksum) sndpkt = make_pkt(expectedseqnum,ACK,chksum)
udt_send(sndpkt)
expectedseqnum++