Chapter 4 Transport Alyer
Chapter 4 Transport Alyer
Transport layer
1. Transport Layer
The Transport layer is a Layer 4 ensures that messages are transmitted in the order in which they
are sent and there is no duplication of data. The main responsibility of the transport layer is to
transfer the data completely. It receives the data from the upper layer and converts them into
smaller units known as segments. This layer can be termed as an end-to-end layer as it provides a
point-to-point connection between source and destination to deliver the data reliably.
Generally, transport layer is 4th position in the OSI (Open System Interconnection) model. It’s
main goal is to make end to end communication over the network system, and it also delivers
different communication services directly to application processes working on dissimilar various
hosts. Transport layer obtains all messages from applications, and transmits those messages into
network layer. Then finally, all messages are reassembled into fully fledged messages, and then
forward them on to 7th Layer.
Packets of information that passes through 7 different layers are referred by different names in
each layer. At the application level, data that needs to be exchanged is referred to as a message
(data). Then the transport layer takes this message and adds transport layer headers to it.
1 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
The resulting encapsulated packet is called a segment. Therefore, data encapsulation is the process
of adding a header to wrap/envelop the data that flows down the OSI model. So, encapsulated data
at transport layer called segments.
To accommodate multiple signals, single medium is logically separated into sub channels. The
main advantage of multiplexing is used for most effective use of the available channel capacity
(bandwidth utilization) for reducing bandwidth wastage. Multiplexer (mux) is combines several
signals into a single signal. Multiplexing and DE-multiplexing at physical layer is different than
at transport layer which will discus at its chapter.
But multiplexing at transport layer is gathering data from multiple application processes of the
sender, enveloping that data with a header, and sending them as a whole to the intended receiver
with mechanism called multiplexing. So, multiplexing is the encapsulation of multiple data packets
by the transport layer into singular segments to pass to the network layer. Therefore, passing these
resulting segments to the network layer is called multiplexing.
Is delivering received segments at the receiver side to the correct app layer processes is called
demultiplexing. The reverse process which is delivering data to the correct socket by the transport
2 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
layer is called demultiplexing. But this still doesn’t explain how the transport layer identifies the
correct socket. Port numbers are the ones that do the trick.
Connectionless Service
In a connectionless service, the packets are sent from one party to another with no need for
connection establishment or connection release. The packets are not numbered; they may be
delayed or lost or may arrive out of sequence. There is no acknowledgment either. We will see
shortly that one of the transport layer protocols in the Internet model, UDP, is connectionless.
3 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
In a connection-oriented service, a connection is first established between the sender and the
receiver. Data are transferred. At the end, the connection is released. We will see shortly that TCP
and SCTP are connection-oriented protocols.
Process-to-process delivery
The data link layer is responsible for delivery of frames between two neighboring nodes over a
link. This is called node-to-node delivery. The network layer is responsible for delivery of
datagrams between two hosts. This is called host-to-host delivery. Communication on the Internet
is not defined as the exchange of data between two nodes or between two hosts. Real
communication takes place between two processes (application programs). We need process-to-
process delivery. However, at any moment, several processes may be running on the source host
and several on the destination host. To complete the delivery, we need a mechanism to deliver data
from one of these processes running on the source host to the corresponding process running on
the destination host. 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,
The transport layer service can be reliable or unreliable. If the application layer program needs
reliability, we use a reliable transport layer protocol by implementing flow and error control at the
transport layer. This means a slower and more complex service. On the other hand, if the
4 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
application program does not need reliability because it uses its own flow and error control
mechanism or it needs fast service or the nature of the service does not demand flow and error
control (real-time applications), then an unreliable protocol can be used.
Congestion control and quality of service are two issues so closely bound together that improving
one means improving the other and ignoring one usually means ignoring the other. Most
techniques to prevent or eliminate congestion also improve the quality of service in a network.
1. Addressing:
Computers run several programs simultaneously due to this reason, the transmission of data from
source to the destination not only from one computer to another computer but also from one
process to another process. The transport layer adds the header that contains the address known as
a service-point address or port address. The responsibility of the network layer is to transmit the
data from one computer to another computer and the responsibility of the transport layer is to
transmit the message to the correct process.
It is port number that used identify each several processes run at application layer and its length is
a 16-bit unsigned integer, and ranging from [0 – 65535].
IANA (Internet Assigned Numbers Authority) IANA divided the port numbers into three
different ranges:
5 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
1.2.Registered ports: are not assigned and controlled by IANA; can only be registered with IANA
to prevent duplication [1024 - 49151]
1.3.Dynamic ports: neither controlled nor registered [49152 - 65535]
Socket Addressing: Transport layer actually does not directly deliver messages to processes. So,
who does that? There is an intermediate software interface called a socket layer that does the
transmission of messages between the underline network and the processes. So, a socket address
is the combination of an IP address and a port number. Generally, Transport layer actually does
not directly deliver messages to processes (or process to process delivery requires two identifiers).
When packets arrive at transport layer, the transport layer looks for the destination port number in
the segment. But destination port number alone is not enough for the TCP to demultiplex the
incoming segment.
6 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
However; this layer has to examine all the four elements such as local host, local port, foreign host
and foreign port. The two identifiers are IP address at network layer and port number at transport
layer that required process to process delivery. Generally, the combination of these two numbers
called socket address
When the transport layer receives the message from the upper layer, it divides the message into
multiple segments, and each segment is assigned with a sequence number that uniquely identifies
each segment. When the message has arrived at the destination, then the transport layer
reassembles the message based on their sequence numbers. Therefore, one message is splitted
into different segments, and every segment has own sequence number. All messages are
reassembled accurately upon reach at their target point, and replace all packets which were
destroyed during transmission.
3. Connection control:
Transport layer provides two services Connection-oriented service and connectionless service. A
connectionless service treats each segment as an individual packet, and they all travel in different
routes to reach the destination. A connection-oriented service makes a connection with the
transport layer at the destination machine before delivering the packets. In connection-oriented
service, all the packets travel in the single route. Packet retransmission thus treats a symptom of
network congestion (the loss of a specific transport-layer segment) but does not treat the cause of
network congestion too many sources attempting to send data at too high a rate. To treat the cause
of network congestion, mechanisms are needed to throttle senders in the face of network
Congestion.
7 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
4. Flow control:
The transport layer also responsible for flow control but it is performed end-to-end rather than
across a single link. Flow control tells the sender how much data should be sent to the receiver so
that it is not lost. This mechanism makes the sender wait for an acknowledgment before sending
the next data. Flow control so a mechanism controlling of overwhelming problem which is a
problem happen if rate at which data are absorbed by the receiver is less than the rate at which
data are produced by sender.
Suppose if any frame sent is not received by the receiver and is lost. So, the receiver will not end
any acknowledgment as it has not received any frame. Also, the sender will not send the next
frame as it will wait for the acknowledgment for the previous frame which it had sent. So, a
deadlock situation can be created here. To avoid any such situation there is a time-out timer. The
sender will wait for this fixed amount of time for the acknowledgment and if the acknowledgment
is not received then it will send the frame again. There are two types of delays while sending these
frames:
5. Error control:
The transport layer is also responsible for Error control. Error control is performed end-to-end
rather than across the single link. The sender transport layer ensures that message reach at the
destination without any error. It is technique that generally observes proper flow of data from
8 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
sender to receiver. It is very essential because it is possible for sender to transmit data or
information at very fast rate and hence receiver can receive this information and process it.
6. 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-the number of packets a network can handle.
Congestion control refers to techniques and mechanisms that can either prevent congestion,
before it happens, or remove congestion, after it has happened. In general, we can divide
congestion control mechanisms into two broad categories: open-loop congestion control
(prevention) and closed-loop congestion control (removal).
Open loop congestion control to stop the congestion and close loop congestion helps to control
to discard the congestion in a network that it happened once. In open-loop congestion control,
policies are applied to prevent congestion before it happens.
Closed-loop congestion control mechanisms try to alleviate congestion after it happens. Several
mechanisms have been used by different protocols.
Generally, congestion control refers to the mechanisms and techniques to control the congestion
and keep the load below the capacity. We may ask why there is congestion on a network.
Congestion happens in any system that involves waiting. For example, congestion happens on a
freeway because any abnonnality in the flow, such as an accident during rush hour, creates
blockage.
It is a standard protocol that allows the systems to communicate over the internet. It establishes
and maintains a connection between hosts. When data is sent over the TCP connection, then the
TCP protocol divides the data into smaller units known as segments. Each segment travels over
the internet using multiple routes, and they arrive in different orders at the destination. The
transmission control protocol reorders the packets in the correct order at the receiving end. So, it
9 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
is protocols that used to send data that require more reliable and need to retransmit for any
segments that aren’t acknowledged. So, TCP waits for an acknowledgment of the receiving ends.
Generally, it is reliable protocols which means provide guaranteed delivery of segments.
Assign this numbers for each divided segments to represents the position of the data in an
original data stream.
10 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
4. Flags: Controls functions used to set up and terminate a session at transport layer such as the
following
4.1.Acknowledgement number: (is 32-field)
4.2.PSH: The PSH field is used to inform the sender that higher throughput is needed so if
possible, data must be pushed with higher throughput.
4.3. RST: (Reset)
The reset bit is used to reset the TCP connection when there is any confusion occurs in the
sequence numbers.
The minimum size of the header is 5 words, and the maximum size of the header is 15
words.
Therefore, the maximum size of the TCP header is 30 bytes, and the minimum size of the
TCP header is 10 bytes.
Each bit of a control field functions individually and independently. A control bit defines
the use of a segment or serves as a validity check for other fields.
11 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
8. Window Size:
The window is a 16-bit field that defines the size of the window which used for TCP as a
mechanism to control flow of data to prevent from sending too much data to control
overwhelming.
It defines the optional fields that convey the additional information to the receiver.
UDP is a simple protocol and it provides non sequenced transport functionality but effective
protocol (faster and efficient). It is used when reliability and security are less important than speed
and size. It doesn’t create a virtual circuit (using three-way handshake) between sender and
receiver. Or UDP doesn’t contact the destination before delivering information. Because of no
three-way handshake UDP is known by connectionless and unreliable protocol.
32 bits
12 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.