Computer Networking: �A Top Down Approach �6th edition �Jim Kurose, Keith Ross�Addison-Wesley�March 2012
Computer Communications �& Networks
CSNC-2413
Lec: 12, 13
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
3.6 Principles of congestion� control
3.7 TCP congestion control
2
Principles of Reliable data transfer
3
Channel with NO bit errors/loss etc
4
Channel with bit errors
5
What happens if ACK/NAK corrupted?
can’t transmit new pkt
can’t re-transmit old pkt
Just retransmit old pkt…
Handling duplicates:
Sender sends one packet,
then waits for receiver
response
Stop and Wait protocol
A fatal flaw
6
Sender receiver actions
Sender:
Receiver:
7
NAK-free protocol
“ACK for last pkt received OK”
“seq# of pkt being ACKed”
8
Channel with bit errors & pkt loss
New assumption:
underlying channel can also �“lose“ packets (Data or ACKs)
Q: how to deal with loss?
Use Countdown timer…
sender waits “reasonable” amount of time for ACK
What is the “right value” for timer…? depends on network conditions…!
9
Protocol in action
10
Protocol in action
11
Stop-and-wait operation
12
Stop-and-wait performance
Dtrans =
L
R
8000 bits
109 bits/sec
=
=
8 microsec
13
Pipelined protocols
14
Pipelining: increased utilization
15
Pipelined protocols
Go-back-N:
when pkt is lost, �sender retransmits all the pkts, starting from the one lost
Selective Repeat:
when pkt is lost, �sender retransmits only the lost pkt
16
“up to N unACKed packets in pipeline”
Go-Back-N and Selective Repeat
Go-Back-N Protocol
send pkt0
send pkt1
send pkt2
send pkt3
(wait)
sender
receiver
receive pkt0, send ack0
receive pkt1, send ack1
receive pkt3, discard,
(re)send ack1
rcv ack0, send pkt4
rcv ack1, send pkt5
pkt 2 timeout
send pkt2
send pkt3
send pkt4
send pkt5
X
loss
receive pkt4, discard,
(re)send ack1
receive pkt5, discard,
(re)send ack1
rcv pkt2, deliver, send ack2
rcv pkt3, deliver, send ack3
rcv pkt4, deliver, send ack4
rcv pkt5, deliver, send ack5
ignore duplicate ACK
0 1 2 3 4 5 6 7 8
sender window (N=4)
0 1 2 3 4 5 6 7 8
0 1 2 3 4 5 6 7 8
0 1 2 3 4 5 6 7 8
0 1 2 3 4 5 6 7 8
0 1 2 3 4 5 6 7 8
0 1 2 3 4 5 6 7 8
0 1 2 3 4 5 6 7 8
0 1 2 3 4 5 6 7 8
0 1 2 3 4 5 6 7 8
17
Go-Back-N: sender
(upto N consecutive unACK’ed pkts can be sent)
18
GBN: receiver
19
Selective repeat in action (N=4)
Under GBN, this pkt will be dropped
20
Selective Repeat (improvement of the GBN Protocol)
21
Selective repeat: sender, receiver windows
22
Selective repeat:� dilemma
Example:
wrongly receives duplicate data as new (in lower fig)
Q: what relationship between Seq# size and window size?
N ≤ 2k/2
In real life, we use k bits to implement Seq# �A practical issue…!
23
Pipelined protocols: overview
Go-back-N:
Selective Repeat:
24