SlideShare a Scribd company logo
1 of 71
Download to read offline
Transport Layer
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Dr. SHANTHI S
Associate Professor
Computer Science & Engineering
Kongu Engineering College
Perundurai, Erode, Tamilnadu
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
UNIT – IV
Transport Layer: Transport Layer Services –
Connectionless and Connection Oriented Services –
Transport Layer Protocols: Go-back-N ,
Selective Repeat – UDP – TCP: TCP Services –
TCP Features – TCP Segment – TCP Connection –
TCP Congestion Control.
Transport Layer Concept
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Transport-Layer Services
Process-to-Process Communication
Encapsulation and Decapsulation
Multiplexing and Demultiplexing
Flow Control
Error Control
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Types of data deliveries
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Addressing: Port Numbers
 port numbers are integers 0 -65,535 (16 bits)
ICANN Ranges
1. well-known port numbers => used by server
0 – 1023. Assigned & Controlled by
ICANN
2. ephemeral port number => used by client
1024 – 49151 Registered & not Assigned &
Controlled
3. Dynamic port 49152 – 65535
Not Registered & not Assigned & Controlled
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Port numbers
Well Known
ephemeral port
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
IP addresses versus port numbers
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Socket Addresses
The combination of an IP address and a port
number is called as socket address
A pair of client socket address and the server
socket address are part of the network-layer packet
header and the transport-layer packet
header.
The IP header contains
the IP addresses;
Transport layer header
=> the port numbers.
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Multiplexing and demultiplexing
Can we have 1024,1025 &
1024 as port no. for P1,P2
&P3?
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Flow Control
Pushing or Pulling
one of the solutions is normally to use two Buffers
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Error Control
Error control at the transport layer is responsible for
1. Detecting and discarding corrupted packets.
2. Keeping track of lost and discarded packets and
resending them.
3. Recognizing duplicate packets and discarding them.
4. Buffering out-of-order packets until the missing packets
arrive.
Sequence Numbers => 2m − 1; m=> No of bits to
represent sequence no.
Acknowledgment
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Combination of Flow & Error Control
Sliding Window
The buffer is
represented as a
set of slices,
called the
sliding window,
that occupies part
of the circle at
any time
Window Size=7
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Combination of Flow & Error Control
Window Size=7
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Congestion Control
Congestion in a network may occur if the load on the
network—the number of packets sent to the network—is
greater than the capacity of the network
Congestion control refers to the mechanisms and
techniques that control the congestion and keep the load
below the capacity
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Connectionless Service
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Connection-Oriented Service
Make a connection-
oriented protocol at
the transport layer
over either a
connectionless
(Datagram
Approach) or
connection-oriented
(Virtual Circuit)
protocol at the
network layer.
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Flow Control - Simple Protocol
Flow diagram
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Stop-and-Wait Protocol
Stop-and-Wait protocol is a connection-oriented protocol that
provides flow and error control.
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Stop-and-Wait Protocol
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Think!
Assume that, in a Stop-and-Wait system, the bandwidth of the
line is 1 Mbps, and 1 bit takes 20 milliseconds to make a round
trip. What is the bandwidth-delay product? If the system data
packets are 1,000 bits in length, what is the utilization percentage
of the link?
bandwidth-delay product (Capacity) = BW X Delay
utilization percentage = packet length/Capacity
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Think!
Assume that, in a Stop-and-Wait system, the bandwidth of the
line is 1 Mbps, and 1 bit takes 20 milliseconds to make a round
trip. What is the bandwidth-delay product? If the system data
packets are 1,000 bits in length, what is the utilization percentage
of the link?
bandwidth-delay product (Capacity) = BW X Delay
= (1 × 106) × (20 × 10−3) = 20,000 bits
utilization percentage = packet length/Capacity
=1,000/20,000 = 5%
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Go-Back-N Protocol (GBN) - Sender
The send
window can
slide one or
more slots when
an error-free
ACK
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Go-Back-N Protocol (GBN) - Receiver
Timers
Although there can be a timer for each packet that is sent, in our
protocol we use only one.
Receiver
Resending packets
When the timer expires, the sender resends all outstanding packets
sender has already sent packet 6 and the only timer expires &
ACK has received for packets 2; the sender goes back and resends
packets 3, 4, 5, and 6 => GO-BACK-3
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Go-Back-N
Sf => sequence number of the
first (oldest) outstanding packet
Sn => Next to send ;
Rn => accepted & ACK
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Go-Back-N – cumulative acknowledgments
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Go-Back-N
versus
Stop-and-Wait
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Selective Repeat (SR)
Windows
Maximum size = 2m−1
m = 4, SN=> 0 to 15,
Window size=8
Acknowledgments
AckNo defines the sequence
number of a single packet that is
received safe
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Selective
Repeat
(SR)
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Selective Repeat (SR)
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Think ! GBN & Selective Repeat (SR)
Assume a sender sends 6 packets: packets 0, 1, 2, 3, 4, and 5.
The sender receives an ACK with ackNo = 3. What is the
interpretation if the system is using GBN or SR?
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Think ! GBN & Selective Repeat (SR)
Assume a sender sends 6 packets: packets 0, 1, 2, 3, 4, and 5.
The sender receives an ACK with ackNo = 3. What is the
interpretation if the system is using GBN or SR?
In GBN, 0, 1 and 2 received successfully and the
packets from 3 ( 3,4 and 5) need to be retransmitted
In SR, only packet with sequence no. 3 received
successfully
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Go-Back-N Selective Repeat
All the frames are re-transmitted from the
lost packet to the last packet transmitted.
Only those frames are re-transmitted
which are found suspected.
Sender window size of Go-Back-N
Protocol is N
Sender window size of selective Repeat
protocol is also N
Receiver window size of Go-Back-N
Protocol is 1
Receiver window size of selective Repeat
protocol is N
Type of Acknowledgement is cumulative Type of Acknowledgement is individual
Out-of-Order packets are NOT Accepted Out-of-Order packets are Accepted
Go-Back-N Protocol is less complex Selective Repeat protocol is more complex
Efficiency of Go-Back-N Protocol is
N/(1+2a)
Efficiency of selective Repeat protocol is
also N/(1+2a),
where a = tp/tt.
Where tp is propagation delay and tt is the transmission delay
Go-Back-N vs Selective Repeat
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Goback-N & Repeat (SR)
A sender wants to transmit 10 data packets to the receiver.
Out of these 10 data packets, every 4th data packet is lost.
How many packets sender will have to send in total using
i) Go-Back-N?
ii) Selective Repeat ?
Solution ?
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Selective Repeat VS Selective Repeat (SR)
A sender wants to transmit 10 data packets to the receiver.
Out of these 10 data packets, every 4th data packet is lost.
How many packets sender will have to send in total using
i) Go-Back-N?
ii) Selective Repeat ?
Solution @ https://youtu.be/dinR1zht598
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Reliable Delivery
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Transport and Data Link Error Control
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Sequence Control
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Loss Control
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Duplication Control
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Bidirectional Protocols: Piggybacking
Simple, Stop & Wait, Goback-N, Selective
repeat => unidirectional
In all, data packets flow in only one direction and
acknowledgments travel in the other direction
Piggybacking => acknowledgments also need to
flow in both directions
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
USER DATAGRAM PROTOCOL (UDP)
connectionless, unreliable transport protocol
Services: Process-to-Process Communication,
Connectionless Services, No Flow Control
Lack of Congestion Control
No Error Control
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Optional Inclusion of Checksum
The sender of a UDP packet can choose not to calculate the
checksum => checksum field is filled with all 0s
17
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TRANSMISSION CONTROL PROTOCOL (TCP)
TCP Services
Process-to-Process Communication
Stream Delivery Service
Full-Duplex Communication
Multiplexing and Demultiplexing
Connection-Oriented Service => three phases process
Reliable Service
TCP Features
Numbering System => Sequence Number,
Acknowledgment Number
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TRANSMISSION CONTROL PROTOCOL (TCP)
Sequence Number
1. The sequence number of the first segment is the ISN
(initial sequence number), which is a random
number.
2. The sequence number of any other segment is the
sequence number of the previous segment plus the
number of bytes carried by the previous segment.
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TRANSMISSION CONTROL PROTOCOL (TCP)
Sequence Number
Suppose a TCP connection is transferring a file of 5000
bytes. The first byte is numbered 10001. What are the
sequence numbers for each segment if data are sent in
five segments, each carrying 1000 bytes?
ISN = 10001
Sequence no. of 1st segment = 10001
Sequence no. of 2nd segment = 10001 + 1000 = 11001
Sequence no. of 3rd segment = 11001 + 1000 = 12001
….
ACK for 1st = 11001; 2nd = 12001….
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TRANSMISSION CONTROL PROTOCOL (TCP)
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TRANSMISSION CONTROL PROTOCOL (TCP)
6
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP Connection Establishment
Three way Hanshaking
Window
Size
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
SYN, SYN+ACK segment cannot
carry data & consumes sequence
no.
TCP - SYN Flooding Attack
 one or more malicious attackers send a large number of SYN
segments to a server pretending that each of them is coming
from a different client by faking the source IP addresses in the
datagrams
 server, assuming that the clients are issuing an active open,
allocates the necessary resources (SYN + ACK => fake clients)
 denial of service attack
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP - SYN Flooding Attack
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP - SYN Flooding Attack
TCP - Data Transfer, & Pushing Data, & Urgent Data
Client => 2,000
bytes ( 2 Seg)
Server => 2,000
bytes (1 Seg)
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP - Connection termination
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP - Connection termination - Half-close
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
State transition diagram
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP Congestion Control
Rwnd => size of sender window, is controlled by receiver
 TCP is an end-to-end protocol that uses the service of
IP & IP is a simple protocol with no congestion
control
 TCP need to take care of congestion in intermediate
network
 TCP needs to define policies that accelerate the data
transmission when there is no congestion and reduce
the transmission speed when congestion is detected
 To control the number of segments to transmit, TCP
uses another variable called a congestion window,
cwnd
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP Congestion Control
 The cwnd variable and the rwnd variable together
define the size of the send window in TCP
 Actual window size = minimum (rwnd, cwnd)
Congestion Detection
 The TCP sender uses the occurrence of two events as
signs of congestion in the network:
1. time-out => lost due to congestion
2. receiving three duplicate ACKs => segment has been
delayed due to congestion
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP Congestion Control - Congestion Policies
1. Slow Start: Exponential Increase
Initially
cwnd to 1 MSS
If an ACK arrives,
cwnd = cwnd + 1.
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP Congestion Control - Congestion Policies
2. Congestion Avoidance: Additive Increase
If an ACK arrives,
cwnd =cwnd + (1/cwnd)
Cwnd= 4+ ¼ th of cwnd
= 4+1
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP Congestion Control - Congestion Policies
3 . Fast Recovery
 is optional in TCP
 It starts when three duplicate ACKs arrive
 If a duplicate ACK arrives, cwnd = cwnd + (1 / cwnd).
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP Congestion Control – Policies Transition
1. Taho TCP
Uses only => slow start and congestion avoidance
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP Congestion Control – Policies Transition
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP Congestion Control – Policies Transition
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP Congestion Control – Policies Transition
2. Reno TCP
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP Congestion Control
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP Congestion Control – Policies Transition
3. New Reno TCP =>
Additive Increase, Multiplicative Decrease (AIMD)
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
TCP Throughput
Wmax = (10 + 12 + 10 + 8 + 8) / 5
= 9.6 MSS
Throughput = (0.75 Wmax / RTT)
= 0.75 × 960 kbps / 100 ms
= 7.2 Mbps
Throughput = (0.75)*Wmax / RTT
Wmax is the average of window sizes when the congestion occurs
If MSS = 10 KB (kilobytes) and RTT = 100 ms. What is the
throughput for the transmission shown in the figure?
Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
Reference
Behrouz A. Forouzan, ―Data Communications and
Networking‖, McGraw-Hill, 5th Edition, 2015

More Related Content

What's hot

Transport Layer Part 1
Transport Layer Part 1Transport Layer Part 1
Transport Layer Part 1
Tutun Juhana
 

What's hot (20)

Tcp Udp Icmp And The Transport Layer
Tcp Udp Icmp And The Transport LayerTcp Udp Icmp And The Transport Layer
Tcp Udp Icmp And The Transport Layer
 
Chapter 3 v6.0
Chapter 3 v6.0Chapter 3 v6.0
Chapter 3 v6.0
 
the transport layer
the transport layerthe transport layer
the transport layer
 
Transport Layer
Transport LayerTransport Layer
Transport Layer
 
Chapter03 sg
Chapter03 sgChapter03 sg
Chapter03 sg
 
Computer Network Interview Questions
Computer Network Interview QuestionsComputer Network Interview Questions
Computer Network Interview Questions
 
Week9 lec1
Week9 lec1Week9 lec1
Week9 lec1
 
Transport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And DemultiplexingTransport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And Demultiplexing
 
Lec 12(Transport Layer)
Lec 12(Transport Layer)Lec 12(Transport Layer)
Lec 12(Transport Layer)
 
Transport services
Transport servicesTransport services
Transport services
 
Transportlayer tanenbaum
Transportlayer tanenbaumTransportlayer tanenbaum
Transportlayer tanenbaum
 
Lec9
Lec9Lec9
Lec9
 
Internet
InternetInternet
Internet
 
Transport layer protocol
Transport layer protocolTransport layer protocol
Transport layer protocol
 
Transport layer
Transport layerTransport layer
Transport layer
 
Transport Layer
Transport LayerTransport Layer
Transport Layer
 
Transport layer
Transport layerTransport layer
Transport layer
 
The Transport Layer
The Transport LayerThe Transport Layer
The Transport Layer
 
IRJET- Performance Improvement of Wireless Network using Modern Simulation Tools
IRJET- Performance Improvement of Wireless Network using Modern Simulation ToolsIRJET- Performance Improvement of Wireless Network using Modern Simulation Tools
IRJET- Performance Improvement of Wireless Network using Modern Simulation Tools
 
Transport Layer Part 1
Transport Layer Part 1Transport Layer Part 1
Transport Layer Part 1
 

Similar to Transport layer

Flow & Error Control
Flow & Error ControlFlow & Error Control
Flow & Error Control
tameemyousaf
 
Computer network (13)
Computer network (13)Computer network (13)
Computer network (13)
NYversity
 

Similar to Transport layer (20)

Transport layer
Transport layerTransport layer
Transport layer
 
Micro project on ARQ
Micro project on ARQMicro project on ARQ
Micro project on ARQ
 
Importance of sliding window protocol
Importance of sliding window protocolImportance of sliding window protocol
Importance of sliding window protocol
 
Importance of sliding window protocol
Importance of sliding window protocolImportance of sliding window protocol
Importance of sliding window protocol
 
Ijetcas14 572
Ijetcas14 572Ijetcas14 572
Ijetcas14 572
 
Ch 18 intro to network layer - section 3
Ch 18   intro to network layer - section 3Ch 18   intro to network layer - section 3
Ch 18 intro to network layer - section 3
 
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
 
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
 
Computer Network presention Pravin Bhargav , Surykant Ratrey (1).pptx
Computer Network presention  Pravin Bhargav , Surykant Ratrey (1).pptxComputer Network presention  Pravin Bhargav , Surykant Ratrey (1).pptx
Computer Network presention Pravin Bhargav , Surykant Ratrey (1).pptx
 
High Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPHigh Performance Networking with Advanced TCP
High Performance Networking with Advanced TCP
 
Data link control notes
Data link control notesData link control notes
Data link control notes
 
Computer networks network layer,routing
Computer networks network layer,routingComputer networks network layer,routing
Computer networks network layer,routing
 
go back n protocol
go back n protocolgo back n protocol
go back n protocol
 
DATA LINK LAYER.pdf
DATA LINK LAYER.pdfDATA LINK LAYER.pdf
DATA LINK LAYER.pdf
 
Automatic Repeat Request (Arq) Protocols
Automatic Repeat Request (Arq) ProtocolsAutomatic Repeat Request (Arq) Protocols
Automatic Repeat Request (Arq) Protocols
 
5 DLL-LLC- Book
5 DLL-LLC- Book5 DLL-LLC- Book
5 DLL-LLC- Book
 
Flow & Error Control
Flow & Error ControlFlow & Error Control
Flow & Error Control
 
Computer network (13)
Computer network (13)Computer network (13)
Computer network (13)
 
Energy-Aware Multipath Routing Scheme Based on Particle Swarm Optimization (E...
Energy-Aware Multipath Routing Scheme Based on Particle Swarm Optimization (E...Energy-Aware Multipath Routing Scheme Based on Particle Swarm Optimization (E...
Energy-Aware Multipath Routing Scheme Based on Particle Swarm Optimization (E...
 
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
 

Recently uploaded

electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.
benjamincojr
 
Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..
MaherOthman7
 
Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
BalamuruganV28
 
Microkernel in Operating System | Operating System
Microkernel in Operating System | Operating SystemMicrokernel in Operating System | Operating System
Microkernel in Operating System | Operating System
Sampad Kar
 

Recently uploaded (20)

electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
CLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference ModalCLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference Modal
 
Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdf
 
Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
 
Piping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdfPiping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdf
 
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message QueuesLinux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
 
Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...
Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...
Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...
 
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxSLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
Basics of Relay for Engineering Students
Basics of Relay for Engineering StudentsBasics of Relay for Engineering Students
Basics of Relay for Engineering Students
 
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdfInvolute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
 
Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
 
analog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptxanalog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptx
 
Microkernel in Operating System | Operating System
Microkernel in Operating System | Operating SystemMicrokernel in Operating System | Operating System
Microkernel in Operating System | Operating System
 
Lab Manual Arduino UNO Microcontrollar.docx
Lab Manual Arduino UNO Microcontrollar.docxLab Manual Arduino UNO Microcontrollar.docx
Lab Manual Arduino UNO Microcontrollar.docx
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility Applications
 

Transport layer

  • 1. Transport Layer Dr. S.Shanthi/ASP/CSE/Kongu Engg. College Dr. SHANTHI S Associate Professor Computer Science & Engineering Kongu Engineering College Perundurai, Erode, Tamilnadu
  • 2. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College UNIT – IV Transport Layer: Transport Layer Services – Connectionless and Connection Oriented Services – Transport Layer Protocols: Go-back-N , Selective Repeat – UDP – TCP: TCP Services – TCP Features – TCP Segment – TCP Connection – TCP Congestion Control.
  • 3. Transport Layer Concept Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 4. Transport-Layer Services Process-to-Process Communication Encapsulation and Decapsulation Multiplexing and Demultiplexing Flow Control Error Control Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 5. Types of data deliveries Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 6. Addressing: Port Numbers  port numbers are integers 0 -65,535 (16 bits) ICANN Ranges 1. well-known port numbers => used by server 0 – 1023. Assigned & Controlled by ICANN 2. ephemeral port number => used by client 1024 – 49151 Registered & not Assigned & Controlled 3. Dynamic port 49152 – 65535 Not Registered & not Assigned & Controlled Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 7. Port numbers Well Known ephemeral port Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 8. IP addresses versus port numbers Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 9. Socket Addresses The combination of an IP address and a port number is called as socket address A pair of client socket address and the server socket address are part of the network-layer packet header and the transport-layer packet header. The IP header contains the IP addresses; Transport layer header => the port numbers. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 10. Multiplexing and demultiplexing Can we have 1024,1025 & 1024 as port no. for P1,P2 &P3? Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 11. Flow Control Pushing or Pulling one of the solutions is normally to use two Buffers Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 12. Error Control Error control at the transport layer is responsible for 1. Detecting and discarding corrupted packets. 2. Keeping track of lost and discarded packets and resending them. 3. Recognizing duplicate packets and discarding them. 4. Buffering out-of-order packets until the missing packets arrive. Sequence Numbers => 2m − 1; m=> No of bits to represent sequence no. Acknowledgment Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 13. Combination of Flow & Error Control Sliding Window The buffer is represented as a set of slices, called the sliding window, that occupies part of the circle at any time Window Size=7 Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 14. Combination of Flow & Error Control Window Size=7 Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 15. Congestion Control Congestion in a network may occur if the load on the network—the number of packets sent to the network—is greater than the capacity of the network Congestion control refers to the mechanisms and techniques that control the congestion and keep the load below the capacity Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 17. Connection-Oriented Service Make a connection- oriented protocol at the transport layer over either a connectionless (Datagram Approach) or connection-oriented (Virtual Circuit) protocol at the network layer. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 18. Flow Control - Simple Protocol Flow diagram Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 19. Stop-and-Wait Protocol Stop-and-Wait protocol is a connection-oriented protocol that provides flow and error control. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 21. Think! Assume that, in a Stop-and-Wait system, the bandwidth of the line is 1 Mbps, and 1 bit takes 20 milliseconds to make a round trip. What is the bandwidth-delay product? If the system data packets are 1,000 bits in length, what is the utilization percentage of the link? bandwidth-delay product (Capacity) = BW X Delay utilization percentage = packet length/Capacity Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 22. Think! Assume that, in a Stop-and-Wait system, the bandwidth of the line is 1 Mbps, and 1 bit takes 20 milliseconds to make a round trip. What is the bandwidth-delay product? If the system data packets are 1,000 bits in length, what is the utilization percentage of the link? bandwidth-delay product (Capacity) = BW X Delay = (1 × 106) × (20 × 10−3) = 20,000 bits utilization percentage = packet length/Capacity =1,000/20,000 = 5% Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 23. Go-Back-N Protocol (GBN) - Sender The send window can slide one or more slots when an error-free ACK Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 24. Go-Back-N Protocol (GBN) - Receiver Timers Although there can be a timer for each packet that is sent, in our protocol we use only one. Receiver Resending packets When the timer expires, the sender resends all outstanding packets sender has already sent packet 6 and the only timer expires & ACK has received for packets 2; the sender goes back and resends packets 3, 4, 5, and 6 => GO-BACK-3 Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 25. Go-Back-N Sf => sequence number of the first (oldest) outstanding packet Sn => Next to send ; Rn => accepted & ACK Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 26. Go-Back-N – cumulative acknowledgments Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 28. Selective Repeat (SR) Windows Maximum size = 2m−1 m = 4, SN=> 0 to 15, Window size=8 Acknowledgments AckNo defines the sequence number of a single packet that is received safe Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 30. Selective Repeat (SR) Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 31. Think ! GBN & Selective Repeat (SR) Assume a sender sends 6 packets: packets 0, 1, 2, 3, 4, and 5. The sender receives an ACK with ackNo = 3. What is the interpretation if the system is using GBN or SR? Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 32. Think ! GBN & Selective Repeat (SR) Assume a sender sends 6 packets: packets 0, 1, 2, 3, 4, and 5. The sender receives an ACK with ackNo = 3. What is the interpretation if the system is using GBN or SR? In GBN, 0, 1 and 2 received successfully and the packets from 3 ( 3,4 and 5) need to be retransmitted In SR, only packet with sequence no. 3 received successfully Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 33. Go-Back-N Selective Repeat All the frames are re-transmitted from the lost packet to the last packet transmitted. Only those frames are re-transmitted which are found suspected. Sender window size of Go-Back-N Protocol is N Sender window size of selective Repeat protocol is also N Receiver window size of Go-Back-N Protocol is 1 Receiver window size of selective Repeat protocol is N Type of Acknowledgement is cumulative Type of Acknowledgement is individual Out-of-Order packets are NOT Accepted Out-of-Order packets are Accepted Go-Back-N Protocol is less complex Selective Repeat protocol is more complex Efficiency of Go-Back-N Protocol is N/(1+2a) Efficiency of selective Repeat protocol is also N/(1+2a), where a = tp/tt. Where tp is propagation delay and tt is the transmission delay Go-Back-N vs Selective Repeat Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 34. Goback-N & Repeat (SR) A sender wants to transmit 10 data packets to the receiver. Out of these 10 data packets, every 4th data packet is lost. How many packets sender will have to send in total using i) Go-Back-N? ii) Selective Repeat ? Solution ? Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 35. Selective Repeat VS Selective Repeat (SR) A sender wants to transmit 10 data packets to the receiver. Out of these 10 data packets, every 4th data packet is lost. How many packets sender will have to send in total using i) Go-Back-N? ii) Selective Repeat ? Solution @ https://youtu.be/dinR1zht598 Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 37. Transport and Data Link Error Control Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 41. Bidirectional Protocols: Piggybacking Simple, Stop & Wait, Goback-N, Selective repeat => unidirectional In all, data packets flow in only one direction and acknowledgments travel in the other direction Piggybacking => acknowledgments also need to flow in both directions Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 44. USER DATAGRAM PROTOCOL (UDP) connectionless, unreliable transport protocol Services: Process-to-Process Communication, Connectionless Services, No Flow Control Lack of Congestion Control No Error Control Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 45. Optional Inclusion of Checksum The sender of a UDP packet can choose not to calculate the checksum => checksum field is filled with all 0s 17 Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 46. TRANSMISSION CONTROL PROTOCOL (TCP) TCP Services Process-to-Process Communication Stream Delivery Service Full-Duplex Communication Multiplexing and Demultiplexing Connection-Oriented Service => three phases process Reliable Service TCP Features Numbering System => Sequence Number, Acknowledgment Number Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 47. TRANSMISSION CONTROL PROTOCOL (TCP) Sequence Number 1. The sequence number of the first segment is the ISN (initial sequence number), which is a random number. 2. The sequence number of any other segment is the sequence number of the previous segment plus the number of bytes carried by the previous segment. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 48. TRANSMISSION CONTROL PROTOCOL (TCP) Sequence Number Suppose a TCP connection is transferring a file of 5000 bytes. The first byte is numbered 10001. What are the sequence numbers for each segment if data are sent in five segments, each carrying 1000 bytes? ISN = 10001 Sequence no. of 1st segment = 10001 Sequence no. of 2nd segment = 10001 + 1000 = 11001 Sequence no. of 3rd segment = 11001 + 1000 = 12001 …. ACK for 1st = 11001; 2nd = 12001…. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 49. TRANSMISSION CONTROL PROTOCOL (TCP) Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 50. TRANSMISSION CONTROL PROTOCOL (TCP) 6 Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 51. TCP Connection Establishment Three way Hanshaking Window Size Dr. S.Shanthi/ASP/CSE/Kongu Engg. College SYN, SYN+ACK segment cannot carry data & consumes sequence no.
  • 52. TCP - SYN Flooding Attack  one or more malicious attackers send a large number of SYN segments to a server pretending that each of them is coming from a different client by faking the source IP addresses in the datagrams  server, assuming that the clients are issuing an active open, allocates the necessary resources (SYN + ACK => fake clients)  denial of service attack Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 53. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP - SYN Flooding Attack
  • 54. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP - SYN Flooding Attack
  • 55. TCP - Data Transfer, & Pushing Data, & Urgent Data Client => 2,000 bytes ( 2 Seg) Server => 2,000 bytes (1 Seg) Dr. S.Shanthi/ASP/CSE/Kongu Engg. College
  • 56. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP - Connection termination
  • 57. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP - Connection termination - Half-close
  • 58. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College State transition diagram
  • 59. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP Congestion Control Rwnd => size of sender window, is controlled by receiver  TCP is an end-to-end protocol that uses the service of IP & IP is a simple protocol with no congestion control  TCP need to take care of congestion in intermediate network  TCP needs to define policies that accelerate the data transmission when there is no congestion and reduce the transmission speed when congestion is detected  To control the number of segments to transmit, TCP uses another variable called a congestion window, cwnd
  • 60. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP Congestion Control  The cwnd variable and the rwnd variable together define the size of the send window in TCP  Actual window size = minimum (rwnd, cwnd) Congestion Detection  The TCP sender uses the occurrence of two events as signs of congestion in the network: 1. time-out => lost due to congestion 2. receiving three duplicate ACKs => segment has been delayed due to congestion
  • 61. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP Congestion Control - Congestion Policies 1. Slow Start: Exponential Increase Initially cwnd to 1 MSS If an ACK arrives, cwnd = cwnd + 1.
  • 62. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP Congestion Control - Congestion Policies 2. Congestion Avoidance: Additive Increase If an ACK arrives, cwnd =cwnd + (1/cwnd) Cwnd= 4+ ¼ th of cwnd = 4+1
  • 63. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP Congestion Control - Congestion Policies 3 . Fast Recovery  is optional in TCP  It starts when three duplicate ACKs arrive  If a duplicate ACK arrives, cwnd = cwnd + (1 / cwnd).
  • 64. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP Congestion Control – Policies Transition 1. Taho TCP Uses only => slow start and congestion avoidance
  • 65. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP Congestion Control – Policies Transition
  • 66. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP Congestion Control – Policies Transition
  • 67. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP Congestion Control – Policies Transition 2. Reno TCP
  • 68. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP Congestion Control
  • 69. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP Congestion Control – Policies Transition 3. New Reno TCP => Additive Increase, Multiplicative Decrease (AIMD)
  • 70. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College TCP Throughput Wmax = (10 + 12 + 10 + 8 + 8) / 5 = 9.6 MSS Throughput = (0.75 Wmax / RTT) = 0.75 × 960 kbps / 100 ms = 7.2 Mbps Throughput = (0.75)*Wmax / RTT Wmax is the average of window sizes when the congestion occurs If MSS = 10 KB (kilobytes) and RTT = 100 ms. What is the throughput for the transmission shown in the figure?
  • 71. Dr. S.Shanthi/ASP/CSE/Kongu Engg. College Reference Behrouz A. Forouzan, ―Data Communications and Networking‖, McGraw-Hill, 5th Edition, 2015