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

Sliding window protocol
Sliding window protocolSliding window protocol
Sliding window protocol
ranakishi
 
Distributed Video Streaming over Internet
Distributed Video Streaming over InternetDistributed Video Streaming over Internet
Distributed Video Streaming over Internet
Videoguy
 

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

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 komputer
vanradhinal
 
Google earth user_guide
Google earth user_guideGoogle earth user_guide
Google earth user_guide
sami horchani
 
Teks Pengacara Sambutan Merdeka Raya 2013
Teks Pengacara Sambutan Merdeka Raya 2013Teks Pengacara Sambutan Merdeka Raya 2013
Teks Pengacara Sambutan Merdeka Raya 2013
Anis Lisa Ahmad
 
ppt sejarah komputer
ppt sejarah komputerppt sejarah komputer
ppt sejarah komputer
trioagustina
 
Fotografia digital
Fotografia digitalFotografia digital
Fotografia digital
iros1998
 

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 (16)
Computer network (16)Computer network (16)
Computer network (16)
NYversity
 

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

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Recently uploaded (20)

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 

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