0% found this document useful (0 votes)
8 views65 pages

Transport Layer

transport layer lecture

Uploaded by

Abdullah Abbasi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views65 pages

Transport Layer

transport layer lecture

Uploaded by

Abdullah Abbasi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Department of Electrical and Computer Engineering.

COMSATS University Islamabad.

CHAPTER 3

Process-to-Process Delivery:
UDP, TCP, and SCTP
PROCESS-TO-PROCESS
DELIVERY
The transport layer is responsible for process-to-
process delivery—the delivery of a packet, part of a
message, from one process to another. Two processes
communicate in a client/server relationship, as we will
see later.
Topics discussed in this section:
Client/Server Paradigm
Multiplexing and Demultiplexing
Connectionless Versus Connection-Oriented Service
Reliable Versus Unreliable
Three Protocols
EEE 314: Data Communications 2
& Computer Networks
Note

The transport layer is responsible for


process-to-process delivery.

EEE 314: Data Communications 3


& Computer Networks
Types of data deliveries

EEE 314: Data Communications 4


& Computer Networks
Port numbers

EEE 314: Data Communications 5


& Computer Networks
IP addresses versus port numbers

EEE 314: Data Communications 6


& Computer Networks
IANA ranges

EEE 314: Data Communications 7


& Computer Networks
Socket address

EEE 314: Data Communications 8


& Computer Networks
Multiplexing and demultiplexing

EEE 314: Data Communications 9


& Computer Networks
Position of UDP, TCP, and SCTP in
TCP/IP suite

EEE 314: Data Communications 10


& Computer Networks
USER DATAGRAM PROTOCOL
(UDP)
The User Datagram Protocol (UDP) is called a
connectionless, unreliable transport protocol. It does
not add anything to the services of IP except to provide
process-to-process communication instead of host-to-
host communication.
Topics discussed in this section:
Well-Known Ports for UDP
User Datagram
Checksum
UDP Operation
Use of UDP
EEE 314: Data Communications 11
& Computer Networks
Well-known ports used with UDP

EEE 314: Data Communications 12


& Computer Networks
User datagram format

EEE 314: Data Communications 13


& Computer Networks
Note

UDP length
= IP length – IP header’s length

EEE 314: Data Communications 14


& Computer Networks
Pseudoheader for checksum
calculation

EEE 314: Data Communications 15


& Computer Networks
Queues in UDP

EEE 314: Data Communications 16


& Computer Networks
TCP
TCP is a connection-oriented protocol; it creates a
virtual connection between two TCPs to send data. In
addition, TCP uses flow and error control mechanisms
at the transport level.

Topics discussed in this section:


TCP Services
TCP Features
Segment
A TCP Connection
Flow Control
Error Control
EEE 314: Data Communications 17
& Computer Networks
Well-known ports used by TCP

EEE 314: Data Communications 18


& Computer Networks
Stream delivery

EEE 314: Data Communications 19


& Computer Networks
Sending and receiving buffers

EEE 314: Data Communications 20


& Computer Networks
TCP segments

EEE 314: Data Communications 21


& Computer Networks
Note

The bytes of data being transferred in


each connection are numbered by TCP.
The numbering starts with a randomly
generated number.

EEE 314: Data Communications 22


& Computer Networks
Note

The value in the sequence number field


of a segment defines the
number of the first data byte
contained in that segment.

EEE 314: Data Communications 23


& Computer Networks
Note

The value of the acknowledgment field


in a segment defines
the number of the next byte a party
expects to receive.
The acknowledgment number is
cumulative.

EEE 314: Data Communications 24


& Computer Networks
EEE 314: Data Communications 25
& Computer Networks
Control field

EEE 314: Data Communications 26


& Computer Networks
Description of flags in the control
field

EEE 314: Data Communications 27


& Computer Networks
EEE 314: Data Communications 28
& Computer Networks
Connection establishment using three-
way handshaking

EEE 314: Data Communications 29


& Computer Networks
Note

A SYN segment cannot carry data, but it


consumes one sequence number.

EEE 314: Data Communications 30


& Computer Networks
Note

A SYN + ACK segment cannot


carry data, but does consume one
sequence number.

EEE 314: Data Communications 31


& Computer Networks
Note

An ACK segment, if carrying no data,


consumes no sequence number.

EEE 314: Data Communications 32


& Computer Networks
Four way handshaking for
connection termination (Half Close)

EEE 314: Data Communications 33


& Computer Networks
Connection Termination using
three way handshaking (Full Close)

EEE 314: Data Communications 34


& Computer Networks
Flow control

EEE 314: Data Communications 35


& Computer Networks
Error control

EEE 314: Data Communications 36


& Computer Networks
Flow control, error control

EEE 314: Data Communications 37


& Computer Networks
Why Flow and Error control
• For reliable and efficient data
communication a great deal of
coordination is required.
Constraints:
• Both sender and receiver have limited
speed
• Both sender and receiver have limited
memory.
EEE 314: Data Communications 38
& Computer Networks
Flow Control

Note

Flow control refers to a set of procedures


used to restrict the amount of data
that the sender can send before
waiting for acknowledgment.

EEE 314: Data Communications 39


& Computer Networks
Error Control

Note

Error control is based on automatic


repeat request, which is the
retransmission of data.

EEE 314: Data Communications 40


& Computer Networks
Taxonomy of protocols

EEE 314: Data Communications 41


& Computer Networks
Example Flow Diagram

EEE 314: Data Communications 42


& Computer Networks
Example Flow Diagram

EEE 314: Data Communications 43


& Computer Networks
Stop and wait constraints
• As in stop-and-wait flow control, only one
frame is in transit which is not suitable for
a single message comprising of multiple
frames.

EEE 314: Data Communications 44


& Computer Networks
Sliding Window
To improve the efficiency, it must allow
multiple frames to be in transit at the
same time.
• In full duplex mode, piggyback scheme
is used to improve the efficiency.

EEE 314: Data Communications 45


& Computer Networks
Sliding Window
• To keep track of the frame, sender sends
the sequential numbered frames.
• As this sequential number is a part of
frame and occupies some space so it
should be limited size.
• If the header consists of 3 bits then
sequential number should be in the range
of 0 to 7.

EEE 314: Data Communications 46


& Computer Networks
Protocols for Noisy channels

EEE 314: Data Communications 47


& Computer Networks
Stop-and-Wait ARQ
Note

Error correction in Stop-and-Wait ARQ is


done by keeping a copy of the sent
frame and retransmitting of the frame
when the timer expires.

EEE 314: Data Communications 48


& Computer Networks
Note

•In Stop-and-Wait ARQ, we use


sequence numbers to number the
frames.
•The sequence numbers are based on
modulo-2 arithmetic.
•The sequence number of the next frame
expected.
EEE 314: Data Communications 49
& Computer Networks
Design of the Stop-and-Wait ARQ Protocol

EEE 314: Data Communications 50


& Computer Networks
Example
Figure shows an example of Stop-and-Wait
ARQ. Frame 0 is sent and acknowledged.
Frame 1 is lost and resent after the time-out.
The resent frame 1 is acknowledged and the
timer stops. Frame 0 is sent and acknowledged,
but the acknowledgment is lost. The sender has
no idea if the frame or the acknowledgment is
lost, so after the time-out, it resends frame 0,
which is acknowledged.

EEE 314: Data Communications 51


& Computer Networks
EEE 314: Data Communications 52
& Computer Networks
Go-Back-N Protocol
• In the Go-Back-N Protocol, the
sequence numbers are modulo 2m,
• where m is the size of the sequence
number field in bits.

EEE 314: Data Communications 53


& Computer Networks
Note

The send window can slide one


or more slots when a valid
acknowledgment arrives.

EEE 314: Data Communications 54


11.54 & Computer Networks
Figure 11.16 Flow diagram for Example 11.6

EEE 314: Data Communications 55


11.55 & Computer Networks
Figure 11.14 Design of Go-Back-N ARQ

EEE 314: Data Communications 56


11.56 & Computer Networks
Figure 11.15 Window size for Go-Back-N ARQ

EEE 314: Data Communications 57


11.57 & Computer Networks
Go-Back-N Protocol
• In Go-Back-N ARQ, the size of the send
window must be less than 2m;
• the size of the receiver window
is always 1.

EEE 314: Data Communications 58


& Computer Networks
Lost of frame in Go-Back-N

EEE 314: Data Communications 59


& Computer Networks
Lost Ack in Go-Back-N

EEE 314: Data Communications 60


& Computer Networks
Selective Repeat ARQ
• In this only those frames are retransmitted for
which negative ack is received.
• It is more efficient than go-back-N
• Receiver requires storage buffer to contain
missing or corrupt frames untill the frame in error
is correctly received.
• Transmitter is more complex because it must be
capable of sending frame out of sequence.

EEE 314: Data Communications 61


& Computer Networks
Selective Repeat ARQ

EEE 314: Data Communications 62


& Computer Networks
EEE 314: Data Communications 63
& Computer Networks
Note

In Selective Repeat ARQ, the size of the


sender and receiver window
must be at most one-half of 2m.

EEE 314: Data Communications 64


11.64 & Computer Networks
Selective Repeat ARQ

EEE 314: Data Communications 65


11.65 & Computer Networks

You might also like