SlideShare a Scribd company logo
University of Sharjah: College of Computing and Informatics
Dr. Bouziane Brik
1
Content
Week 9: Transport Layer
 Principles of Transport Layer
 Transport-layer Services
 Multiplexing and demultiplexing
 Transport Layer Protocols
 Connectionless Transport: UDP
 Connection-oriented Transport: TCP
 Segment Structure
 Reliable Data Transfer
 Flow Control
 Connection management
University of Sharjah: College of Computing and Informatics
Dr. Bouziane Brik
TCP Sender (Events)
2
Sender Events
Host B
Host A
Seq=92, 8 bytes of data
Seq=92, 8 bytes of data
ACK=100
timeout
Receive data from Application layer
1
2
3
University of Sharjah: College of Computing and Informatics
Dr. Bouziane Brik
TCP Sender (simplified)
event: data received from
application
 create segment with seq #
 seq # is byte-stream number
of first data byte in segment
 start timer if not already
running
• think of timer as for oldest
unACKed segment
• expiration interval:
TimeOutInterval
event: timeout
 retransmit segment that
caused timeout
 restart timer
event: ACK received
 if ACK acknowledges
previously unACKed segments
• update what is known to be
ACKed
• start timer if there are still
unACKed segments
3
1 2
3
University of Sharjah: College of Computing and Informatics
Dr. Bouziane Brik
TCP Receiver: ACK generation [RFC 5681]
Event at receiver
Arrival of in-order segment with
expected seq #. All data up to
expected seq # already ACKed
Arrival of in-order segment with
expected seq #. One other
segment has ACK pending
Arrival of out-of-order segment
higher-than-expect seq. # .
Gap detected
Arrival of segment that
partially or completely fills gap
TCP receiver action
Delayed ACK. Wait up to 500ms
for next segment. If no next segment,
send ACK
Immediately send single cumulative
ACK, ACKing both in-order segments
Immediately send duplicate ACK,
indicating seq. # of next expected byte
Immediate send ACK, provided that
segment starts at lower end of gap
4
University of Sharjah: College of Computing and Informatics
Dr. Bouziane Brik
TCP: retransmission scenarios
lost ACK scenario
Host B
Host A
Seq=92, 8 bytes of data
Seq=92, 8 bytes of data
ACK=100
X
ACK=100
timeout
premature timeout
Host B
Host A
Seq=92, 8
bytes of
data
ACK=120
timeout
ACK=100
ACK=120
SendBase=100
SendBase=120
SendBase=120
Seq=92, 8 bytes of data
Seq=100, 20 bytes of data
SendBase=92
send cumulative
ACK for 120
5
University of Sharjah: College of Computing and Informatics
Dr. Bouziane Brik
TCP: retransmission scenarios
cumulative ACK
covers for earlier lost
ACK
Host B
Host A
Seq=92, 8 bytes of data
Seq=120, 15 bytes of data
Seq=100, 20 bytes of data
X
ACK=100
ACK=120
6
University of Sharjah: College of Computing and Informatics
Dr. Bouziane Brik
TCP fast retransmit
Host B
Host A
timeout
ACK=100
ACK=100
ACK=100
ACK=100
X
Seq=92, 8 bytes of data
Seq=100, 20 bytes of
data
Seq=100, 20 bytes of data
Receipt of three duplicate ACKs
indicates 3 segments received
after a missing segment – lost
segment is likely. So retransmit!
if sender receives 3 additional
ACKs for same data (“triple
duplicate ACKs”), resend unACKed
segment with smallest seq #
 likely that unACKed segment lost,
so don’t wait for timeout
TCP fast retransmit
7
Seq=120, 10 bytes of
data
Seq=130, 10 bytes of
data
Seq=140, 10 bytes of
data
University of Sharjah: College of Computing and Informatics
Dr. Bouziane Brik
8
Content
Week 9: Transport Layer
 Principles of Transport Layer
 Transport-layer Services
 Multiplexing and demultiplexing
 Transport Layer Protocols
 Connectionless Transport: UDP
 Connection-oriented Transport: TCP
 Segment Structure
 Reliable Data Transfer
 Flow Control
University of Sharjah: College of Computing and Informatics
Dr. Bouziane Brik
TCP flow control
application
process
TCP socket
receiver buffers
TCP
code
IP
code
receiver protocol stack
Q: What happens if network
layer delivers data faster than
application layer removes
data from socket buffers?
Network layer
delivering IP datagram
payload into TCP
socket buffers
from sender
Application removing
data from TCP socket
buffers
9
University of Sharjah: College of Computing and Informatics
Dr. Bouziane Brik
TCP flow control
application
process
TCP socket
receiver buffers
TCP
code
IP
code
receiver protocol stack
Q: What happens if network
layer delivers data faster than
application layer removes
data from socket buffers?
from sender
Application removing
data from TCP socket
buffers
receive window
flow control: # bytes
receiver willing to accept
10
University of Sharjah: College of Computing and Informatics
Dr. Bouziane Brik
TCP flow control
application
process
TCP socket
receiver buffers
TCP
code
IP
code
receiver protocol stack
Q: What happens if network
layer delivers data faster than
application layer removes
data from socket buffers?
receiver controls sender, so
sender won’t overflow
receiver’s buffer by
transmitting too much, too fast
flow control
from sender
Application removing
data from TCP socket
buffers
11
University of Sharjah: College of Computing and Informatics
Dr. Bouziane Brik
TCP flow control
 TCP receiver “advertises” free buffer
space in rwnd field in TCP header
• RcvBuffer size set via socket
options (typical default is 4096 bytes)
• many operating systems autoadjust
RcvBuffer
 sender limits amount of unACKed
(“in-flight”) data to received rwnd
 guarantees receive buffer will not
overflow
buffered data
free buffer space
rwnd
RcvBuffer
TCP segment payloads
to application process
TCP receiver-side buffering
12
University of Sharjah: College of Computing and Informatics
Dr. Bouziane Brik
TCP flow control
 TCP receiver “advertises” free buffer
space in rwnd field in TCP header
• RcvBuffer size set via socket
options (typical default is 4096 bytes)
• many operating systems autoadjust
RcvBuffer
 sender limits amount of unACKed
(“in-flight”) data to received rwnd
 guarantees receive buffer will not
overflow
flow control: # bytes receiver willing to accept
receive window
TCP segment format
13
University of Sharjah: College of Computing and Informatics
Dr. Bouziane Brik
14
Chapter 4: network layer
TCP/IP: Transmission Control Protocol / Internet Protocol
University of Sharjah: College of Computing and Informatics
Dr. Bouziane Brik
15
4.1 introduction
4.2 virtual circuit and datagram
networks
4.3 what’s inside a router
4.4 IP: Internet Protocol
– datagram format
– IPv4 addressing
– ICMP
– IPv6
4.5 routing algorithms
– link state
– distance vector
Chapter 4: outline

More Related Content

PPTX
Lecture15Lecture15Lecture15Lecture15.pptx
PPTX
Unit 4.pptxenhdgjkslkxnjhjijnbhndnernjdxcndf
PPTX
Transport Layer Services : Multiplexing And Demultiplexing
PPTX
CNT - Module 1.Introduction to CN-OSI layers
PPTX
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
PPT
Transport Layer
PPTX
Module 2.pptx.............sdvsdcdssdfsdf
PPT
unit 3 ns.ppt
Lecture15Lecture15Lecture15Lecture15.pptx
Unit 4.pptxenhdgjkslkxnjhjijnbhndnernjdxcndf
Transport Layer Services : Multiplexing And Demultiplexing
CNT - Module 1.Introduction to CN-OSI layers
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
Transport Layer
Module 2.pptx.............sdvsdcdssdfsdf
unit 3 ns.ppt

Similar to Lecture17Lecture17Lecture17Lecture17.pptx (20)

PDF
Computer Communication Networks- Introduction to Transport layer
PDF
COMPUTER NETWORKBY DINESHY ADAV AHDHHDKDJD
PPTX
Computer networks unit iv
PPTX
Transport_Layer_Protocols.pptx
PPT
Transmission control protocol ...............................
PPTX
DOCX
transport layer
PPTX
Transport layer in OSI Layers in detail.pptx
PPT
PPTX
Chapter_3_v8.0 - Transport Layer with UDP and TCP
PPT
PPT
Transmission control protocol _
PPSX
TCP-IP Reference Model
PPTX
transport protocols
PPTX
Networking essentials lect3
PPT
Ch3 transport layer Network
PPTX
Transport layer
PPTX
CS3591- Computer Networks Unit-2 Transport layer
PPTX
Transport layer
PPT
Chapter3.ppt hu yyttujhgft uhhgfrghbhhgghhjhy
Computer Communication Networks- Introduction to Transport layer
COMPUTER NETWORKBY DINESHY ADAV AHDHHDKDJD
Computer networks unit iv
Transport_Layer_Protocols.pptx
Transmission control protocol ...............................
transport layer
Transport layer in OSI Layers in detail.pptx
Chapter_3_v8.0 - Transport Layer with UDP and TCP
Transmission control protocol _
TCP-IP Reference Model
transport protocols
Networking essentials lect3
Ch3 transport layer Network
Transport layer
CS3591- Computer Networks Unit-2 Transport layer
Transport layer
Chapter3.ppt hu yyttujhgft uhhgfrghbhhgghhjhy
Ad

More from FutureTechnologies3 (20)

PPTX
SVN Version ControlSVN Version ControlSVN Version Control.pptx
PPTX
Monaco Editor 1Monaco EditorMonaco Editor 1 1.pptx
PPTX
iOS appiOS appiOS appiOS appiOS app.pptx
PPTX
PresentationPresentationPresentationPresentation.pptx
PPTX
StuxnetStuxnetStuxnetStuxnetStuxnet.pptx
PPTX
EDR XDREDR XDREDR XDREDR XDREDR XDR.pptx
PPTX
How to Add Audio Fil es to Android App in Android Studio.pptx
PPTX
Monaco_Editor_PresentationMonaco_Editor_Presentation.pptx
PPTX
SVN_Version_Control_Presentation (2).pptx
PPTX
Visual_Studio_Code_Presentation (1).pptx
PPTX
DOC-20250512-WA0030 (11111).stuxnet.pptx
PPTX
attacksattacksattacksattacksattacks.pptx
PPTX
13-hamedHanymohamedHany-date-2025 5 10.pptx
PPTX
13-mohamedHanymohamedHany-date-2025 5 9.pptx
PPTX
13-MohamedHany-11111-date-2025 5 12.pptx
PPTX
13-MohamedHany -6666-date-2025 5 12.pptx
PPTX
13-MohamedHany -2-dateeee-2025 5 12.pptx
PPTX
13-MohamedHany - 5-dateee-2025 5 12.pptx
PPTX
13-5-2025 a13-5-2025 a13-5-2025 a13-5-2025 a.pptx
PPTX
10-5-202510-5-202510-5-202510-5-2025.pptx
SVN Version ControlSVN Version ControlSVN Version Control.pptx
Monaco Editor 1Monaco EditorMonaco Editor 1 1.pptx
iOS appiOS appiOS appiOS appiOS app.pptx
PresentationPresentationPresentationPresentation.pptx
StuxnetStuxnetStuxnetStuxnetStuxnet.pptx
EDR XDREDR XDREDR XDREDR XDREDR XDR.pptx
How to Add Audio Fil es to Android App in Android Studio.pptx
Monaco_Editor_PresentationMonaco_Editor_Presentation.pptx
SVN_Version_Control_Presentation (2).pptx
Visual_Studio_Code_Presentation (1).pptx
DOC-20250512-WA0030 (11111).stuxnet.pptx
attacksattacksattacksattacksattacks.pptx
13-hamedHanymohamedHany-date-2025 5 10.pptx
13-mohamedHanymohamedHany-date-2025 5 9.pptx
13-MohamedHany-11111-date-2025 5 12.pptx
13-MohamedHany -6666-date-2025 5 12.pptx
13-MohamedHany -2-dateeee-2025 5 12.pptx
13-MohamedHany - 5-dateee-2025 5 12.pptx
13-5-2025 a13-5-2025 a13-5-2025 a13-5-2025 a.pptx
10-5-202510-5-202510-5-202510-5-2025.pptx
Ad

Recently uploaded (20)

PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Computing-Curriculum for Schools in Ghana
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
Introduction to pro and eukaryotes and differences.pptx
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
Indian roads congress 037 - 2012 Flexible pavement
PPTX
20th Century Theater, Methods, History.pptx
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PDF
HVAC Specification 2024 according to central public works department
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
Hazard Identification & Risk Assessment .pdf
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Computing-Curriculum for Schools in Ghana
Practical Manual AGRO-233 Principles and Practices of Natural Farming
A powerpoint presentation on the Revised K-10 Science Shaping Paper
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Introduction to pro and eukaryotes and differences.pptx
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
B.Sc. DS Unit 2 Software Engineering.pptx
Indian roads congress 037 - 2012 Flexible pavement
20th Century Theater, Methods, History.pptx
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
HVAC Specification 2024 according to central public works department
TNA_Presentation-1-Final(SAVE)) (1).pptx
Chinmaya Tiranga quiz Grand Finale.pdf
Hazard Identification & Risk Assessment .pdf
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)

Lecture17Lecture17Lecture17Lecture17.pptx

  • 1. University of Sharjah: College of Computing and Informatics Dr. Bouziane Brik 1 Content Week 9: Transport Layer  Principles of Transport Layer  Transport-layer Services  Multiplexing and demultiplexing  Transport Layer Protocols  Connectionless Transport: UDP  Connection-oriented Transport: TCP  Segment Structure  Reliable Data Transfer  Flow Control  Connection management
  • 2. University of Sharjah: College of Computing and Informatics Dr. Bouziane Brik TCP Sender (Events) 2 Sender Events Host B Host A Seq=92, 8 bytes of data Seq=92, 8 bytes of data ACK=100 timeout Receive data from Application layer 1 2 3
  • 3. University of Sharjah: College of Computing and Informatics Dr. Bouziane Brik TCP Sender (simplified) event: data received from application  create segment with seq #  seq # is byte-stream number of first data byte in segment  start timer if not already running • think of timer as for oldest unACKed segment • expiration interval: TimeOutInterval event: timeout  retransmit segment that caused timeout  restart timer event: ACK received  if ACK acknowledges previously unACKed segments • update what is known to be ACKed • start timer if there are still unACKed segments 3 1 2 3
  • 4. University of Sharjah: College of Computing and Informatics Dr. Bouziane Brik TCP Receiver: ACK generation [RFC 5681] Event at receiver Arrival of in-order segment with expected seq #. All data up to expected seq # already ACKed Arrival of in-order segment with expected seq #. One other segment has ACK pending Arrival of out-of-order segment higher-than-expect seq. # . Gap detected Arrival of segment that partially or completely fills gap TCP receiver action Delayed ACK. Wait up to 500ms for next segment. If no next segment, send ACK Immediately send single cumulative ACK, ACKing both in-order segments Immediately send duplicate ACK, indicating seq. # of next expected byte Immediate send ACK, provided that segment starts at lower end of gap 4
  • 5. University of Sharjah: College of Computing and Informatics Dr. Bouziane Brik TCP: retransmission scenarios lost ACK scenario Host B Host A Seq=92, 8 bytes of data Seq=92, 8 bytes of data ACK=100 X ACK=100 timeout premature timeout Host B Host A Seq=92, 8 bytes of data ACK=120 timeout ACK=100 ACK=120 SendBase=100 SendBase=120 SendBase=120 Seq=92, 8 bytes of data Seq=100, 20 bytes of data SendBase=92 send cumulative ACK for 120 5
  • 6. University of Sharjah: College of Computing and Informatics Dr. Bouziane Brik TCP: retransmission scenarios cumulative ACK covers for earlier lost ACK Host B Host A Seq=92, 8 bytes of data Seq=120, 15 bytes of data Seq=100, 20 bytes of data X ACK=100 ACK=120 6
  • 7. University of Sharjah: College of Computing and Informatics Dr. Bouziane Brik TCP fast retransmit Host B Host A timeout ACK=100 ACK=100 ACK=100 ACK=100 X Seq=92, 8 bytes of data Seq=100, 20 bytes of data Seq=100, 20 bytes of data Receipt of three duplicate ACKs indicates 3 segments received after a missing segment – lost segment is likely. So retransmit! if sender receives 3 additional ACKs for same data (“triple duplicate ACKs”), resend unACKed segment with smallest seq #  likely that unACKed segment lost, so don’t wait for timeout TCP fast retransmit 7 Seq=120, 10 bytes of data Seq=130, 10 bytes of data Seq=140, 10 bytes of data
  • 8. University of Sharjah: College of Computing and Informatics Dr. Bouziane Brik 8 Content Week 9: Transport Layer  Principles of Transport Layer  Transport-layer Services  Multiplexing and demultiplexing  Transport Layer Protocols  Connectionless Transport: UDP  Connection-oriented Transport: TCP  Segment Structure  Reliable Data Transfer  Flow Control
  • 9. University of Sharjah: College of Computing and Informatics Dr. Bouziane Brik TCP flow control application process TCP socket receiver buffers TCP code IP code receiver protocol stack Q: What happens if network layer delivers data faster than application layer removes data from socket buffers? Network layer delivering IP datagram payload into TCP socket buffers from sender Application removing data from TCP socket buffers 9
  • 10. University of Sharjah: College of Computing and Informatics Dr. Bouziane Brik TCP flow control application process TCP socket receiver buffers TCP code IP code receiver protocol stack Q: What happens if network layer delivers data faster than application layer removes data from socket buffers? from sender Application removing data from TCP socket buffers receive window flow control: # bytes receiver willing to accept 10
  • 11. University of Sharjah: College of Computing and Informatics Dr. Bouziane Brik TCP flow control application process TCP socket receiver buffers TCP code IP code receiver protocol stack Q: What happens if network layer delivers data faster than application layer removes data from socket buffers? receiver controls sender, so sender won’t overflow receiver’s buffer by transmitting too much, too fast flow control from sender Application removing data from TCP socket buffers 11
  • 12. University of Sharjah: College of Computing and Informatics Dr. Bouziane Brik TCP flow control  TCP receiver “advertises” free buffer space in rwnd field in TCP header • RcvBuffer size set via socket options (typical default is 4096 bytes) • many operating systems autoadjust RcvBuffer  sender limits amount of unACKed (“in-flight”) data to received rwnd  guarantees receive buffer will not overflow buffered data free buffer space rwnd RcvBuffer TCP segment payloads to application process TCP receiver-side buffering 12
  • 13. University of Sharjah: College of Computing and Informatics Dr. Bouziane Brik TCP flow control  TCP receiver “advertises” free buffer space in rwnd field in TCP header • RcvBuffer size set via socket options (typical default is 4096 bytes) • many operating systems autoadjust RcvBuffer  sender limits amount of unACKed (“in-flight”) data to received rwnd  guarantees receive buffer will not overflow flow control: # bytes receiver willing to accept receive window TCP segment format 13
  • 14. University of Sharjah: College of Computing and Informatics Dr. Bouziane Brik 14 Chapter 4: network layer TCP/IP: Transmission Control Protocol / Internet Protocol
  • 15. University of Sharjah: College of Computing and Informatics Dr. Bouziane Brik 15 4.1 introduction 4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol – datagram format – IPv4 addressing – ICMP – IPv6 4.5 routing algorithms – link state – distance vector Chapter 4: outline