SlideShare a Scribd company logo
1 of 16
Chapter 3
Transport Layer

Computer Networking:
A Top Down Approach,
4th edition.
Jim Kurose, Keith Ross
Addison-Wesley, July
2007.
Reliable Data Transfer: Getting Started
rdt_send(): called from
above, (e.g., by app.). Passed data to
deliver to receiver upper layer

send
side

udt_send(): called by rdt
protocol, to transfer packet over
unreliable channel to receiver

deliver_data(): called by rdt
to deliver data to upper layer

receive
side

rdt_rcv(): called when packet
arrives on rcv-side of channel
Rdt2.0: FSM Specification
rdt_send(data)
snkpkt = make_pkt(data, checksum)
udt_send(sndpkt)
rdt_rcv(rcvpkt) &&
isNAK(rcvpkt)
Wait for

call from
above

Wait for
ACK or
NAK

udt_send(sndpkt)

rdt_rcv(rcvpkt) && isACK(rcvpkt)
Λ

receiver
rdt_rcv(rcvpkt) &&
corrupt(rcvpkt)
udt_send(NAK)
Wait for call
from below

sender
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
Rdt2.0
• rdt2.0 is a stop and wait
protocol

– Sender sends one packet, then
waits for receiver response

Handling Duplicates:

• rdt2.0 has a fatal flaw
• What happens if ACK/NAK get
corrupted?

•

•

•

–

•

Add checksum bits to ACK/NAK

How the protocol should recover
from errors in ACK/NAK?

– Retransmission on receipt of a
corrupt ACK/NAK
– Retransmission causes duplicates

– Receiver does not know whether
ACK or NAK it sent was received
correctly
– Receiver does not know a priori
whether an arriving packet
contains new data or is a
retransmission

Sender retransmits current
packet if ACK/NAK garbled
Sender adds sequence number
to each packet
Receiver discards (doesn’t
deliver up) duplicate packet
Rdt2.1: Sender, handles garbled ACK/NAKs
rdt_send(data)
sndpkt = make_pkt(0, data, checksum)
udt_send(sndpkt)

Wait for call
0 from
above

Wait for
ACK or
NAK 0

rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt)
&& isACK(rcvpkt)

rdt_rcv(rcvpkt) &&
( corrupt(rcvpkt) ||
isNAK(rcvpkt) )
udt_send(sndpkt)

rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt)
&& isACK(rcvpkt)

Λ

rdt_rcv(rcvpkt) &&
( corrupt(rcvpkt) ||
isNAK(rcvpkt) )
udt_send(sndpkt)

Λ
Wait for
ACK or NAK
1

Wait for
call 1
from
above
rdt_send(data)

sndpkt = make_pkt(1, data, checksum)
udt_send(sndpkt)
Rdt2.1: Receiver, handles garbled ACK/NAKs
rdt_rcv(rcvpkt) && notcorrupt(rcvpkt)
&& has_seq0(rcvpkt)

rdt_rcv(rcvpkt) && (corrupt(rcvpkt))

extract(rcvpkt,data)
deliver_data(data)
sndpkt = make_pkt(ACK, chksum)
udt_send(sndpkt)

sndpkt = make_pkt(NAK, chksum)
udt_send(sndpkt)
rdt_rcv(rcvpkt) &&
not corrupt(rcvpkt) &&
has_seq1(rcvpkt)
sndpkt = make_pkt(ACK, chksum)
udt_send(sndpkt)

Wait for
0 from
below

rdt_rcv(rcvpkt) && (corrupt(rcvpkt))
sndpkt = make_pkt(NAK, chksum)
udt_send(sndpkt)

Wait for
1 from
below

rdt_rcv(rcvpkt) && notcorrupt(rcvpkt)
&& has_seq1(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
sndpkt = make_pkt(ACK, chksum)
udt_send(sndpkt)

rdt_rcv(rcvpkt) &&
not corrupt(rcvpkt) &&
has_seq0(rcvpkt)
sndpkt = make_pkt(ACK, chksum)
udt_send(sndpkt)
Rdt2.2: a NAK-free protocol
• Same functionality as rdt2.1, using ACKs only
• Instead of NAK, receiver sends ACK for last packet
received OK
– Receiver must explicitly include seq # of the
packet being ACKed
• Duplicate ACK at sender results in same action as
NAK: retransmit current packet
Rdt2.2: Sender, Receiver Fragments
rdt_send(data)
sndpkt = make_pkt(0, data, checksum)
rdt_rcv(rcvpkt) &&
udt_send(sndpkt)
( corrupt(rcvpkt) ||
Wait for
Wait for
isACK(rcvpkt,1) )
ACK

call 0 from
above

rdt_rcv(rcvpkt) &&
(corrupt(rcvpkt) ||
has_seq1(rcvpkt))
udt_send(sndpkt)

Wait for
0 from
below

0

Sender FSM
Fragment

Receiver FSM
Fragment

udt_send(sndpkt)
rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt)
&& isACK(rcvpkt,0)
Λ

rdt_rcv(rcvpkt) && notcorrupt(rcvpkt)
&& has_seq1(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
sndpkt = make_pkt(ACK,1, chksum)
udt_send(sndpkt)
Rdt3.0: Channels with Errors and Loss
New Assumption: Underlying channel can also lose packets
(data or ACKs)
 What to do when packet loss occurs?
 Retransmissions
 How to detect loss?
 Sender waits “reasonable” amount of time for ACK
 Must wait at least as long as RTT plus processing
delay.
 Retransmits if no ACK received in this time
 If packet (or ACK) just delayed (not lost):
 Retransmission will be duplicate, but use of sequence
numbers can handles this.
Rdt3.0 Sender
rdt_send(data)
sndpkt = make_pkt(0, data, checksum)
udt_send(sndpkt)
start_timer

rdt_rcv(rcvpkt)

Λ

Wait for
call 0 from
above

rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt)
&& isACK(rcvpkt,1)

timeout
udt_send(sndpkt)
start_timer
rdt_rcv(rcvpkt) &&
( corrupt(rcvpkt) ||
isACK(rcvpkt,0) )

Λ

Wait
for
ACK 0

timeout
udt_send(sndpkt)
start_timer
rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt)
&& isACK(rcvpkt,0)
stop_timer

stop_timer

Λ

rdt_rcv(rcvpkt) &&
( corrupt(rcvpkt) ||
isACK(rcvpkt,1) )

Wait
for
ACK1

Wait for
call 1 from
above
rdt_send(data)
sndpkt = make_pkt(1, data, checksum)
udt_send(sndpkt)
start_timer

rdt_rcv(rcvpkt)

Λ
Pipelined Reliable Data Transfer
Protocols
 Rdt3.0 works, but performance is poor
 Poor Performance is due to the fact that

it is a stop and wait protocol


Poor utilization of the resource

 Solution

Sender is allowed to send multiple packets
without waiting for ACKs.
 Pipelining


Since many sender to receiver packets can be
visualized as filling a pipeline
Increase utilization
Pipelined Reliable Data Transfer Protocols
 Pipelining has the following consequences for

reliable data transfer
 Range of sequence numbers must be increased
 Sender and receiver sides may have to buffer
more than one packet.

 Two basic approaches towards pipeline error

recovery:

Go-Back-N, Selective Repeat
Go-Back-N (GBN)
Sender:
 Sender is allowed to transmit multiple packets without waiting

for an acknowledgement
 Constrained to a certain maximum number N.
 Base or send_base
 Sequence number of oldest unacknowledged packet
 Nextseqnum
 Sequence number of next packet to be sent
 The range of sequence numbers for transmitted but not
acknowledged packets can be viewed as a window of size N.
 This window slides forward as the protocol operates
Go-Back-N
GBN sender must respond to three types of events
 Invocation from above (rdt_send() is called):
 If window is full, returns data to upper layer
 Maintain synchronization mechanism
 Receipt of an ACK:
 ACK for packet with seq # n is taken as“Cumulative ACK”
 More shortly in receiver
 Time out event:
 Sender has timer for oldest unacknowledged packet
• If timer expires, retransmit all unacknowledged packets
Go-Back-N
Receiver:
 If a packet with seq # n is received correctly and is in
order


ACK is sent and data is delivered to upper layers

 For all other cases
 Receiver discards the packet and resends ACK for most
recently received in order packet
 Packets are delivered one at a time to upper layers


If a packet k has been received and delivered, then all
packets with seq # lower than k have also been delivered.

 Receiver discards out of order packets
 No receiver buffering
 Need only remember expectedseqnum
GBN in
action

http://www.eecis.udel.edu/~amer/450/TransportApplets/GBN/GBNindex.html

More Related Content

What's hot

Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network
Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network
Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network partha pratim deb
 
Sliding window protocol
Sliding window protocolSliding window protocol
Sliding window protocolranakishi
 
Ibm mq dqm setups
Ibm mq dqm setupsIbm mq dqm setups
Ibm mq dqm setupssarvank2
 
Implementing ssl self sign demo
Implementing ssl self sign demoImplementing ssl self sign demo
Implementing ssl self sign demosarvank2
 
Queue Manager both as sender and Receiver.docx
Queue Manager both as sender and Receiver.docxQueue Manager both as sender and Receiver.docx
Queue Manager both as sender and Receiver.docxsarvank2
 
Ibm mq c luster overlap demo script
Ibm mq c luster overlap demo scriptIbm mq c luster overlap demo script
Ibm mq c luster overlap demo scriptsarvank2
 
Leaky bucket algorithm
Leaky bucket algorithmLeaky bucket algorithm
Leaky bucket algorithmUmesh Gupta
 
Investigating the Use of Synchronized Clocks in TCP Congestion Control
Investigating the Use of Synchronized Clocks in TCP Congestion ControlInvestigating the Use of Synchronized Clocks in TCP Congestion Control
Investigating the Use of Synchronized Clocks in TCP Congestion ControlMichele Weigle
 
Distributed Video Streaming over Internet
Distributed Video Streaming over InternetDistributed Video Streaming over Internet
Distributed Video Streaming over InternetVideoguy
 
CCDT(client connection)MQ.docx
CCDT(client connection)MQ.docxCCDT(client connection)MQ.docx
CCDT(client connection)MQ.docxsarvank2
 
Importance of sliding window protocol
Importance of sliding window protocolImportance of sliding window protocol
Importance of sliding window protocoleSAT Journals
 
Module15: Sliding Windows Protocol and Error Control
Module15: Sliding Windows Protocol and Error Control Module15: Sliding Windows Protocol and Error Control
Module15: Sliding Windows Protocol and Error Control gondwe Ben
 

What's hot (20)

Fast020702
Fast020702Fast020702
Fast020702
 
Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network
Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network
Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network
 
Cubic
CubicCubic
Cubic
 
Go Back N Arq1
Go  Back N Arq1Go  Back N Arq1
Go Back N Arq1
 
Sliding window protocol
Sliding window protocolSliding window protocol
Sliding window protocol
 
Tcp congestion avoidance
Tcp congestion avoidanceTcp congestion avoidance
Tcp congestion avoidance
 
Ibm mq dqm setups
Ibm mq dqm setupsIbm mq dqm setups
Ibm mq dqm setups
 
Implementing ssl self sign demo
Implementing ssl self sign demoImplementing ssl self sign demo
Implementing ssl self sign demo
 
Queue Manager both as sender and Receiver.docx
Queue Manager both as sender and Receiver.docxQueue Manager both as sender and Receiver.docx
Queue Manager both as sender and Receiver.docx
 
Ibm mq c luster overlap demo script
Ibm mq c luster overlap demo scriptIbm mq c luster overlap demo script
Ibm mq c luster overlap demo script
 
Week8 lec2-bscs1
Week8 lec2-bscs1Week8 lec2-bscs1
Week8 lec2-bscs1
 
Week5 lec2-bscs1
Week5 lec2-bscs1Week5 lec2-bscs1
Week5 lec2-bscs1
 
Leaky bucket algorithm
Leaky bucket algorithmLeaky bucket algorithm
Leaky bucket algorithm
 
8 congestion-ipv6
8 congestion-ipv68 congestion-ipv6
8 congestion-ipv6
 
Polyraptor
PolyraptorPolyraptor
Polyraptor
 
Investigating the Use of Synchronized Clocks in TCP Congestion Control
Investigating the Use of Synchronized Clocks in TCP Congestion ControlInvestigating the Use of Synchronized Clocks in TCP Congestion Control
Investigating the Use of Synchronized Clocks in TCP Congestion Control
 
Distributed Video Streaming over Internet
Distributed Video Streaming over InternetDistributed Video Streaming over Internet
Distributed Video Streaming over Internet
 
CCDT(client connection)MQ.docx
CCDT(client connection)MQ.docxCCDT(client connection)MQ.docx
CCDT(client connection)MQ.docx
 
Importance of sliding window protocol
Importance of sliding window protocolImportance of sliding window protocol
Importance of sliding window protocol
 
Module15: Sliding Windows Protocol and Error Control
Module15: Sliding Windows Protocol and Error Control Module15: Sliding Windows Protocol and Error Control
Module15: Sliding Windows Protocol and Error Control
 

Viewers also liked

Language Assessement
Language AssessementLanguage Assessement
Language AssessementBussinessman
 
21 Ideas To Get Things Done by Taking Control of Your Time, Tasks & Priorities
21 Ideas To Get Things Done by Taking Control of Your Time, Tasks & Priorities21 Ideas To Get Things Done by Taking Control of Your Time, Tasks & Priorities
21 Ideas To Get Things Done by Taking Control of Your Time, Tasks & PrioritiesDeanna Maio
 
Faesal BP3IP MTL TRISAKTI 2013
Faesal BP3IP MTL TRISAKTI 2013 Faesal BP3IP MTL TRISAKTI 2013
Faesal BP3IP MTL TRISAKTI 2013 Lalu Faesal Salim
 
Sejarah komputer
Sejarah komputerSejarah komputer
Sejarah komputervanradhinal
 
Google earth user_guide
Google earth user_guideGoogle earth user_guide
Google earth user_guidesami horchani
 
1.1 on counting
1.1 on counting1.1 on counting
1.1 on countingTzenma
 
Quran learning for_kids-a_life_of_piety
Quran learning for_kids-a_life_of_pietyQuran learning for_kids-a_life_of_piety
Quran learning for_kids-a_life_of_pietySchoolQuran
 
Teks Pengacara Sambutan Merdeka Raya 2013
Teks Pengacara Sambutan Merdeka Raya 2013Teks Pengacara Sambutan Merdeka Raya 2013
Teks Pengacara Sambutan Merdeka Raya 2013Anis Lisa Ahmad
 
BRaSS UCC - Entrepreneur of the Year Presentation 2014
BRaSS UCC - Entrepreneur of the Year Presentation 2014BRaSS UCC - Entrepreneur of the Year Presentation 2014
BRaSS UCC - Entrepreneur of the Year Presentation 2014Peter Duffy
 
ppt sejarah komputer
ppt sejarah komputerppt sejarah komputer
ppt sejarah komputertrioagustina
 
Fotografia digital
Fotografia digitalFotografia digital
Fotografia digitaliros1998
 
Mischool newsletter pacaralr
Mischool newsletter pacaralrMischool newsletter pacaralr
Mischool newsletter pacaralrcarogarnier
 
Użytkownik – charakterystyki – percepcja
Użytkownik – charakterystyki – percepcjaUżytkownik – charakterystyki – percepcja
Użytkownik – charakterystyki – percepcjaEdyta Waniewska
 

Viewers also liked (17)

Language Assessement
Language AssessementLanguage Assessement
Language Assessement
 
21 Ideas To Get Things Done by Taking Control of Your Time, Tasks & Priorities
21 Ideas To Get Things Done by Taking Control of Your Time, Tasks & Priorities21 Ideas To Get Things Done by Taking Control of Your Time, Tasks & Priorities
21 Ideas To Get Things Done by Taking Control of Your Time, Tasks & Priorities
 
Faesal BP3IP MTL TRISAKTI 2013
Faesal BP3IP MTL TRISAKTI 2013 Faesal BP3IP MTL TRISAKTI 2013
Faesal BP3IP MTL TRISAKTI 2013
 
Sejarah komputer
Sejarah komputerSejarah komputer
Sejarah komputer
 
Google earth user_guide
Google earth user_guideGoogle earth user_guide
Google earth user_guide
 
Jobbers
JobbersJobbers
Jobbers
 
1.1 on counting
1.1 on counting1.1 on counting
1.1 on counting
 
Week11 lec2
Week11 lec2Week11 lec2
Week11 lec2
 
Quran learning for_kids-a_life_of_piety
Quran learning for_kids-a_life_of_pietyQuran learning for_kids-a_life_of_piety
Quran learning for_kids-a_life_of_piety
 
Teks Pengacara Sambutan Merdeka Raya 2013
Teks Pengacara Sambutan Merdeka Raya 2013Teks Pengacara Sambutan Merdeka Raya 2013
Teks Pengacara Sambutan Merdeka Raya 2013
 
BRaSS UCC - Entrepreneur of the Year Presentation 2014
BRaSS UCC - Entrepreneur of the Year Presentation 2014BRaSS UCC - Entrepreneur of the Year Presentation 2014
BRaSS UCC - Entrepreneur of the Year Presentation 2014
 
ppt sejarah komputer
ppt sejarah komputerppt sejarah komputer
ppt sejarah komputer
 
Fotografia digital
Fotografia digitalFotografia digital
Fotografia digital
 
Mischool newsletter pacaralr
Mischool newsletter pacaralrMischool newsletter pacaralr
Mischool newsletter pacaralr
 
Seminar
SeminarSeminar
Seminar
 
CNWeek4 lec2-bscs1
CNWeek4 lec2-bscs1CNWeek4 lec2-bscs1
CNWeek4 lec2-bscs1
 
Użytkownik – charakterystyki – percepcja
Użytkownik – charakterystyki – percepcjaUżytkownik – charakterystyki – percepcja
Użytkownik – charakterystyki – percepcja
 

Similar to Week5 lec1-bscs1

Computer network
Computer networkComputer network
Computer networkDeepikaT13
 
Lecture 5
Lecture 5Lecture 5
Lecture 5ntpc08
 
KandR_TCP (1).ppt notes for congestion control
KandR_TCP (1).ppt    notes for congestion controlKandR_TCP (1).ppt    notes for congestion control
KandR_TCP (1).ppt notes for congestion controlGOKULKANNANMMECLECTC
 
Mobile Transpot Layer
Mobile Transpot LayerMobile Transpot Layer
Mobile Transpot LayerMaulik Patel
 
Transport Layer
Transport LayerTransport Layer
Transport LayerAmin Omi
 
Ch3 transport layer Network
Ch3 transport layer NetworkCh3 transport layer Network
Ch3 transport layer Networkcairo university
 
Computer network (16)
Computer network (16)Computer network (16)
Computer network (16)NYversity
 
Congestion control in TCP.pptx
Congestion control in TCP.pptxCongestion control in TCP.pptx
Congestion control in TCP.pptxkamalakantas
 
13_TCP_Attack.pptx
13_TCP_Attack.pptx13_TCP_Attack.pptx
13_TCP_Attack.pptxAlmaOraevi
 
High Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPHigh Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPDilum Bandara
 
COE332-Ch03d.pptx
COE332-Ch03d.pptxCOE332-Ch03d.pptx
COE332-Ch03d.pptxMemMem25
 
Computer Networks Module 2.pdf
Computer Networks Module 2.pdfComputer Networks Module 2.pdf
Computer Networks Module 2.pdfShanthalaKV
 
Analytical Research of TCP Variants in Terms of Maximum Throughput
Analytical Research of TCP Variants in Terms of Maximum ThroughputAnalytical Research of TCP Variants in Terms of Maximum Throughput
Analytical Research of TCP Variants in Terms of Maximum ThroughputIJLT EMAS
 
Comparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and VegasComparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and VegasIOSR Journals
 

Similar to Week5 lec1-bscs1 (20)

Week4 lec2-bscs1
Week4 lec2-bscs1Week4 lec2-bscs1
Week4 lec2-bscs1
 
Computer network
Computer networkComputer network
Computer network
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
KandR_TCP (1).ppt notes for congestion control
KandR_TCP (1).ppt    notes for congestion controlKandR_TCP (1).ppt    notes for congestion control
KandR_TCP (1).ppt notes for congestion control
 
Tr ns802 11
Tr ns802 11Tr ns802 11
Tr ns802 11
 
Mobile Transpot Layer
Mobile Transpot LayerMobile Transpot Layer
Mobile Transpot Layer
 
Transport Layer
Transport LayerTransport Layer
Transport Layer
 
Ch3 transport layer Network
Ch3 transport layer NetworkCh3 transport layer Network
Ch3 transport layer Network
 
Computer network (16)
Computer network (16)Computer network (16)
Computer network (16)
 
Week4 lec1-bscs1
Week4 lec1-bscs1Week4 lec1-bscs1
Week4 lec1-bscs1
 
Congestion control in TCP.pptx
Congestion control in TCP.pptxCongestion control in TCP.pptx
Congestion control in TCP.pptx
 
13_TCP_Attack.pptx
13_TCP_Attack.pptx13_TCP_Attack.pptx
13_TCP_Attack.pptx
 
High Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPHigh Performance Networking with Advanced TCP
High Performance Networking with Advanced TCP
 
Transport layer
Transport layerTransport layer
Transport layer
 
COE332-Ch03d.pptx
COE332-Ch03d.pptxCOE332-Ch03d.pptx
COE332-Ch03d.pptx
 
Micro project on ARQ
Micro project on ARQMicro project on ARQ
Micro project on ARQ
 
Go Back N ARQ
Go  Back N ARQGo  Back N ARQ
Go Back N ARQ
 
Computer Networks Module 2.pdf
Computer Networks Module 2.pdfComputer Networks Module 2.pdf
Computer Networks Module 2.pdf
 
Analytical Research of TCP Variants in Terms of Maximum Throughput
Analytical Research of TCP Variants in Terms of Maximum ThroughputAnalytical Research of TCP Variants in Terms of Maximum Throughput
Analytical Research of TCP Variants in Terms of Maximum Throughput
 
Comparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and VegasComparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
 

More from syedhaiderraza (18)

Week16 lec1
Week16 lec1Week16 lec1
Week16 lec1
 
Week15 lec1
Week15 lec1Week15 lec1
Week15 lec1
 
Week14 lec2
Week14 lec2Week14 lec2
Week14 lec2
 
Week14 lec1
Week14 lec1Week14 lec1
Week14 lec1
 
Week13 lec2
Week13 lec2Week13 lec2
Week13 lec2
 
Week13 lec1
Week13 lec1Week13 lec1
Week13 lec1
 
Week11 lec1
Week11 lec1Week11 lec1
Week11 lec1
 
Week10 lec1
Week10 lec1Week10 lec1
Week10 lec1
 
Week9 lec1
Week9 lec1Week9 lec1
Week9 lec1
 
Week3 lec3-bscs1
Week3 lec3-bscs1Week3 lec3-bscs1
Week3 lec3-bscs1
 
Week3 lec 2
Week3 lec 2Week3 lec 2
Week3 lec 2
 
Week3 lec 1
Week3 lec 1Week3 lec 1
Week3 lec 1
 
Week2 lec3-bscs1
Week2 lec3-bscs1Week2 lec3-bscs1
Week2 lec3-bscs1
 
Week2 lec2-bscs1
Week2 lec2-bscs1Week2 lec2-bscs1
Week2 lec2-bscs1
 
Week2 lec1-bscs1
Week2 lec1-bscs1Week2 lec1-bscs1
Week2 lec1-bscs1
 
Week1 lec2-bscs1
Week1 lec2-bscs1Week1 lec2-bscs1
Week1 lec2-bscs1
 
Week1 lec1-bscs1
Week1 lec1-bscs1Week1 lec1-bscs1
Week1 lec1-bscs1
 
Week16 lec2
Week16 lec2Week16 lec2
Week16 lec2
 

Recently uploaded

Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 

Recently uploaded (20)

Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 

Week5 lec1-bscs1

  • 1. Chapter 3 Transport Layer Computer Networking: A Top Down Approach, 4th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.
  • 2. Reliable Data Transfer: Getting Started rdt_send(): called from above, (e.g., by app.). Passed data to deliver to receiver upper layer send side udt_send(): called by rdt protocol, to transfer packet over unreliable channel to receiver deliver_data(): called by rdt to deliver data to upper layer receive side rdt_rcv(): called when packet arrives on rcv-side of channel
  • 3. Rdt2.0: FSM Specification rdt_send(data) snkpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && isNAK(rcvpkt) Wait for call from above Wait for ACK or NAK udt_send(sndpkt) rdt_rcv(rcvpkt) && isACK(rcvpkt) Λ receiver rdt_rcv(rcvpkt) && corrupt(rcvpkt) udt_send(NAK) Wait for call from below sender rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ACK)
  • 4. Rdt2.0 • rdt2.0 is a stop and wait protocol – Sender sends one packet, then waits for receiver response Handling Duplicates: • rdt2.0 has a fatal flaw • What happens if ACK/NAK get corrupted? • • • – • Add checksum bits to ACK/NAK How the protocol should recover from errors in ACK/NAK? – Retransmission on receipt of a corrupt ACK/NAK – Retransmission causes duplicates – Receiver does not know whether ACK or NAK it sent was received correctly – Receiver does not know a priori whether an arriving packet contains new data or is a retransmission Sender retransmits current packet if ACK/NAK garbled Sender adds sequence number to each packet Receiver discards (doesn’t deliver up) duplicate packet
  • 5. Rdt2.1: Sender, handles garbled ACK/NAKs rdt_send(data) sndpkt = make_pkt(0, data, checksum) udt_send(sndpkt) Wait for call 0 from above Wait for ACK or NAK 0 rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt) rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isNAK(rcvpkt) ) udt_send(sndpkt) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt) Λ rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isNAK(rcvpkt) ) udt_send(sndpkt) Λ Wait for ACK or NAK 1 Wait for call 1 from above rdt_send(data) sndpkt = make_pkt(1, data, checksum) udt_send(sndpkt)
  • 6. Rdt2.1: Receiver, handles garbled ACK/NAKs rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && has_seq0(rcvpkt) rdt_rcv(rcvpkt) && (corrupt(rcvpkt)) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt) sndpkt = make_pkt(NAK, chksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && not corrupt(rcvpkt) && has_seq1(rcvpkt) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt) Wait for 0 from below rdt_rcv(rcvpkt) && (corrupt(rcvpkt)) sndpkt = make_pkt(NAK, chksum) udt_send(sndpkt) Wait for 1 from below rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && has_seq1(rcvpkt) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && not corrupt(rcvpkt) && has_seq0(rcvpkt) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt)
  • 7. Rdt2.2: a NAK-free protocol • Same functionality as rdt2.1, using ACKs only • Instead of NAK, receiver sends ACK for last packet received OK – Receiver must explicitly include seq # of the packet being ACKed • Duplicate ACK at sender results in same action as NAK: retransmit current packet
  • 8. Rdt2.2: Sender, Receiver Fragments rdt_send(data) sndpkt = make_pkt(0, data, checksum) rdt_rcv(rcvpkt) && udt_send(sndpkt) ( corrupt(rcvpkt) || Wait for Wait for isACK(rcvpkt,1) ) ACK call 0 from above rdt_rcv(rcvpkt) && (corrupt(rcvpkt) || has_seq1(rcvpkt)) udt_send(sndpkt) Wait for 0 from below 0 Sender FSM Fragment Receiver FSM Fragment udt_send(sndpkt) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt,0) Λ rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && has_seq1(rcvpkt) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(ACK,1, chksum) udt_send(sndpkt)
  • 9. Rdt3.0: Channels with Errors and Loss New Assumption: Underlying channel can also lose packets (data or ACKs)  What to do when packet loss occurs?  Retransmissions  How to detect loss?  Sender waits “reasonable” amount of time for ACK  Must wait at least as long as RTT plus processing delay.  Retransmits if no ACK received in this time  If packet (or ACK) just delayed (not lost):  Retransmission will be duplicate, but use of sequence numbers can handles this.
  • 10. Rdt3.0 Sender rdt_send(data) sndpkt = make_pkt(0, data, checksum) udt_send(sndpkt) start_timer rdt_rcv(rcvpkt) Λ Wait for call 0 from above rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt,1) timeout udt_send(sndpkt) start_timer rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isACK(rcvpkt,0) ) Λ Wait for ACK 0 timeout udt_send(sndpkt) start_timer rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt,0) stop_timer stop_timer Λ rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isACK(rcvpkt,1) ) Wait for ACK1 Wait for call 1 from above rdt_send(data) sndpkt = make_pkt(1, data, checksum) udt_send(sndpkt) start_timer rdt_rcv(rcvpkt) Λ
  • 11. Pipelined Reliable Data Transfer Protocols  Rdt3.0 works, but performance is poor  Poor Performance is due to the fact that it is a stop and wait protocol  Poor utilization of the resource  Solution Sender is allowed to send multiple packets without waiting for ACKs.  Pipelining  Since many sender to receiver packets can be visualized as filling a pipeline Increase utilization
  • 12. Pipelined Reliable Data Transfer Protocols  Pipelining has the following consequences for reliable data transfer  Range of sequence numbers must be increased  Sender and receiver sides may have to buffer more than one packet.  Two basic approaches towards pipeline error recovery: Go-Back-N, Selective Repeat
  • 13. Go-Back-N (GBN) Sender:  Sender is allowed to transmit multiple packets without waiting for an acknowledgement  Constrained to a certain maximum number N.  Base or send_base  Sequence number of oldest unacknowledged packet  Nextseqnum  Sequence number of next packet to be sent  The range of sequence numbers for transmitted but not acknowledged packets can be viewed as a window of size N.  This window slides forward as the protocol operates
  • 14. Go-Back-N GBN sender must respond to three types of events  Invocation from above (rdt_send() is called):  If window is full, returns data to upper layer  Maintain synchronization mechanism  Receipt of an ACK:  ACK for packet with seq # n is taken as“Cumulative ACK”  More shortly in receiver  Time out event:  Sender has timer for oldest unacknowledged packet • If timer expires, retransmit all unacknowledged packets
  • 15. Go-Back-N Receiver:  If a packet with seq # n is received correctly and is in order  ACK is sent and data is delivered to upper layers  For all other cases  Receiver discards the packet and resends ACK for most recently received in order packet  Packets are delivered one at a time to upper layers  If a packet k has been received and delivered, then all packets with seq # lower than k have also been delivered.  Receiver discards out of order packets  No receiver buffering  Need only remember expectedseqnum