0% found this document useful (0 votes)
57 views

Lec 3 - Transport Layer - IV - Reliable Data Transfer

This document outlines the transport layer and principles of reliable data transfer. It discusses how reliable data transfer protocols must account for unreliable network characteristics like bit errors, packet loss, and delayed packets. It presents several iterations of a basic reliable data transfer protocol, each building upon the previous version to handle more complex network conditions through mechanisms like sequence numbers, acknowledgements, timeouts, and retransmissions. The goal is to incrementally develop the sender and receiver sides of the protocol to provide reliable end-to-end delivery over an unreliable network.

Uploaded by

Hamna Younis
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Lec 3 - Transport Layer - IV - Reliable Data Transfer

This document outlines the transport layer and principles of reliable data transfer. It discusses how reliable data transfer protocols must account for unreliable network characteristics like bit errors, packet loss, and delayed packets. It presents several iterations of a basic reliable data transfer protocol, each building upon the previous version to handle more complex network conditions through mechanisms like sequence numbers, acknowledgements, timeouts, and retransmissions. The goal is to incrementally develop the sender and receiver sides of the protocol to provide reliable end-to-end delivery over an unreliable network.

Uploaded by

Hamna Younis
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Computer and

Communication Networks
EE-357
By Dr Mir Yasir Umair
Associate Professor, MCS, NUST
Transport Layer
Reliable Data Transfer
Chapter 3 outline
3.1 transport-layer services 3.5 connection-oriented
3.2 multiplexing and demultiplexing transport: TCP
▪ segment structure
3.3 connectionless transport: UDP ▪ reliable data transfer
3.4 principles of reliable data transfer ▪ flow control
▪ connection management

3.6 principles of congestion


control
3.7 TCP congestion control

Transport Layer 3-3


Principles of reliable data transfer
❖ important in application, transport, link layers
▪ top-10 list of important networking topics!

❖ characteristics of unreliable channel will determine complexity of reliable data


transfer protocol (rdt)

Transport Layer 3-4


Principles of reliable data transfer
❖ important in application, transport, link layers
▪ top-10 list of important networking topics!

❖ characteristics of unreliable channel will determine complexity of reliable data


transfer protocol (rdt)

Transport Layer 3-5


Principles of reliable data transfer
❖ important in application, transport, link layers
▪ top-10 list of important networking topics!

❖ characteristics of unreliable channel will determine complexity of reliable data


transfer protocol (rdt)

Transport Layer 3-6


Reliable data transfer: getting started
rdt_send(): called from above, deliver_data(): called by
(e.g., by app.). Passed data to rdt to deliver data to upper
deliver to receiver upper layer

send receive
side side

udt_send(): called by rdt, rdt_rcv(): called when packet


to transfer packet over arrives on rcv-side of channel
unreliable channel to receiver

Transport Layer 3-7


Reliable data transfer: getting started
we’ll:
• incrementally develop sender, receiver sides of
reliable data transfer protocol (rdt)
• consider only unidirectional data transfer
o but control info will flow on both directions!

• use finite state machines (FSM) to specify sender,


receiver
event causing state transition
actions taken on state transition
state: when in this
“state” next state state state
uniquely determined 1 event
by next event 2
actions

Transport Layer 3-8


rdt1.0: reliable transfer over a reliable channel
❖underlying channel perfectly
reliable
▪ no bit errors
▪ no loss of packets

Wait for rdt_send(data) Wait for rdt_rcv(packet)


call from call from extract (packet,data)
above packet = make_pkt(data) below deliver_data(data)
udt_send(packet)

sender receiver

Transport Layer 3-9


rdt2.0: channel with bit errors
❖ underlying channel may flip bits in packet
▪ checksum to detect bit errors
❖ the question: how to recover from errors:
▪ acknowledgements (ACKs): receiver explicitly tells sender that pkt
received OK
▪ negative acknowledgements (NAKs): receiver explicitly tells sender
that pkt had errors
▪ sender retransmits pkt on receipt of NAK
❖ new mechanisms in rdt2.0 (beyond rdt1.0):
▪ error detection
How do humans recover from “errors”
▪ receiver feedback: control msgs (ACK,NAK) rcvr->sender

during conversation?

Transport Layer 3-10


rdt2.0: channel with bit errors
❖ underlying channel may flip bits in packet
▪ checksum to detect bit errors
❖ the question: how to recover from errors:
▪ acknowledgements (ACKs): receiver explicitly tells sender that pkt
received OK
▪ negative acknowledgements (NAKs): receiver explicitly tells sender
that pkt had errors
▪ sender retransmits pkt on receipt of NAK
❖ new mechanisms in rdt2.0 (beyond rdt1.0):
▪ error detection
▪ feedback: control msgs (ACK,NAK) from receiver to sender

Transport Layer 3-11


rdt2.0 has a fatal flaw!
what happens if handling duplicates:
ACK/NAK corrupted? • sender retransmits current
• sender doesn’t pkt if ACK/NAK corrupted
know what • sender adds sequence
happened at number to each pkt
receiver! • receiver discards
(doesn’t deliver up)
• can’t just retransmit: duplicate pkt
possible duplicate

stop and wait


sender sends one packet,
then waits for receiver
response

Transport Layer 3-12


rdt2.1: discussion
sender: receiver:
• seq # added to pkt ❖ must check if received packet is
• two seq. #’s (0,1) will suffice. Why? duplicate
▪ state indicates whether 0 or 1 is expected pkt
• must check if received ACK/NAK seq #
corrupted ❖ note: receiver can not know if its
last ACK/NAK received OK at
sender

Transport Layer 3-13


rdt2.1 channel with corrupted ACK/ NAK
rdt2.1 channel with corrupted ACK/ NAK
rdt2.2: a NAK-free protocol
❖ same functionality as rdt2.1, using ACKs only
❖ instead of NAK, receiver sends ACK for last pkt
received OK
▪ receiver must explicitly include seq # of pkt being ACKed

❖ duplicate ACK at sender results in same action as


NAK: retransmit current pkt

Transport Layer 3-16


rdt2.2: a NAK-free protocol
rdt2.2: a NAK-free protocol
rdt3.0: channels with errors and loss

new assumption: underlying channel can also lose packets (data, ACKs)
o checksum, seq. #, ACKs, retransmissions will be of help … but not enough

approach: sender waits “reasonable”


amount of time for ACK
• retransmits if no ACK received in this
time
• if pkt (or ACK) just delayed (not lost):
o retransmission will be duplicate, but seq. #’s already
handles this
o receiver must specify seq # of pkt being ACKed
• requires countdown timer

Transport Layer 3-19


rdt3.0 in action
sender receiver sender receiver
send pkt0 pkt0 send pkt0 pkt0
rcv pkt0 rcv pkt0
ack0 send ack0 ack0 send ack0
rcv ack0 rcv ack0
send pkt1 pkt1 send pkt1 pkt1
rcv pkt1 X
ack1 send ack1 loss
rcv ack1
send pkt0 pkt0
rcv pkt0 timeout
ack0 send ack0 resend pkt1 pkt1
rcv pkt1
ack1 send ack1
rcv ack1
send pkt0 pkt0
(a) no loss rcv pkt0
ack0 send ack0

(b) packet loss


Transport Layer 3-20
rdt3.0 in action
sender receiver
sender receiver send pkt0 pkt0
send pkt0 pkt0 rcv pkt0
send ack0
rcv pkt0 ack0
send ack0 rcv ack0
ack0 send pkt1 pkt1
rcv ack0 rcv pkt1
send pkt1 pkt1
send ack1
rcv pkt1 ack1
ack1 send ack1
X
loss timeout
resend pkt1 pkt1
rcv pkt1
timeout
resend pkt1 pkt1 rcv ack1 (detect duplicate)
rcv pkt1 send pkt0
pkt0
send ack1
(detect duplicate) ack1
ack1 send ack1 rcv ack1 rcv pkt0
rcv ack1 send pkt0
ack0 send ack0
send pkt0 pkt0 pkt0
rcv pkt0
rcv pkt0 ack0 (detect duplicate)
ack0 send ack0 send ack0

(c) ACK loss (d) premature timeout/ delayed ACK

Transport Layer 3-21


Performance of rdt3.0
❖ rdt3.0 is correct, but performance stinks
❖ e.g.: 1 Gbps link, 15 ms prop. delay, 8000 bit packet:
L 8000 bits
Dtrans = R = 9 = 8 microsecs
10 bits/sec

▪ U sender: utilization – fraction of time sender busy sending

U L/R .008
sender = = = 0.00027
RTT + L / R 30.008

▪ if RTT=30 msec, 1KB pkt every 30 msec: 33kB/sec thruput


over 1 Gbps link
❖ network protocol limits use of physical resources!
Transport Layer 3-22
rdt3.0: stop-and-wait operation
sender receiver
first packet bit transmitted, t = 0
last packet bit transmitted, t = L / R

first packet bit arrives


RTT last packet bit arrives, send ACK

ACK arrives, send next


packet, t = RTT + L / R

U L/R .008
sender = = = 0.00027
RTT + L / R 30.008

Transport Layer 3-23


Thank you

EE 451 Mobile Communications

You might also like