Un2 CN
Un2 CN
2.0 INTRODUCTION
The transport layer supports two protocols in TCP/IP protocol suite. One is
Transmission Control Protocol (TCP). TCP is connection oriented that provides
reliable end-to-end transmission. Another protocol is User Datagram Protocol (UDP).
UDP is simple and provides well sequenced transport function when reliability and
serving are less important than size and speed. Transport layer services are
implemented by transport protocols used between two transport entities. Transport
layer services are similar to the data link services. Data link layer is designed to
provide its services within a single network, while the transport layer provides
services across an inter network made up of many networks. There are seven
categories of services provided by the transport layer. These services are End to end
delivery, Addressing, Reliable delivery, Flow control, Connection management,
Multiplexing and Congestion Control.
2.1 OBJECTIVE
After going through this unit, you should be able to:
• Know the Functions and Services of transport layer
• Understand the Working of transport layer
• Understand the TCP Window management
• Know the different transport layer design issues
34
Transport Layer
2.2 ADDRESSING
Transport layer interact with the functions of session layer. Many protocols combine
session, presentation and application level protocols into a single package called an
application. In these cases delivery to the session layer functions is, in effect delivery
to the application. So communication occurs not just from end machine to end
machine but from end application to end application. Data generated by an application
on one machine must be received not just by other machines but by the correct
application on that machine.
In most cases, we end up with the communication between many to many entities,
called service access points as shown in figure 2 given below. To ensure accurate
delivery from service access point to service access point we used another level of
addressing in addition to the network and data link level.
1 2 3 6 5 9
Transport Transport
Network Network
Physical Physical
35
Network, Transport • Duplication control
and Application
Layer Reliable
Delivery
Mechanisms full errors handling at this layer are based on error detection and
retransmission. With the error handling, performed using algorithms
implemented in software such as checksum “error detection and correction”.
Segmentation: When the size of the data units received from the upper layer is
too long for the network layer datagram and data link layer frame to handle, the
transport layer divides it into smaller usable blocks. This dividing process is
called segmentation.
Concatenation: When the sizes of the data units belonging to a single session
are so small that several can fit together into a single data queue are frame, the
transport protocol combines them into a single data unit. This combining
process is called concatenation.
Sequence Number: Most transport layer services add sequence number at the
end of each segment.
If a longer data unit has been segmented the sequence number indicate the
reassembly.
If several shorter units have been concatenated the numbers indicate the end of
each subunit and allow them to be separated accurately at the destination.
c) Loss Control: The third aspect of reliability covered by the transport layer is
loss control as depicted in figure 4. The transport layer ensures all pieces of the
transmission arrive at the destination, not just some of them. When data have
been segmented for delivery, some segments may be lost in transmit. Sequence
number allows the receiver’s transport layer protocol to identify any missing
segment and request in delivery.
36
Transport Layer
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………
2. List the methods or mechanism provided by Transport layer for reliable delivery
of data.
……………………………………………………………………………………
……………………………………………………………………………………
37
Network, Transport
and Application
2.4 FLOW CONTROL
Layer Like the data link layer transport layer is responsible for flow control. Flow control is
performed end to end rather than across a single link. Transport layer flow control
uses a sliding window protocol. The window at the transport layer can vary in size to
accommodate buffer occupancy as depicted in figure 6 given below.
Sliding window is used to make data transmission more efficient as well as to control
the flow of data so that the receiver does not become overwhelmed. Sliding window
used at the transport layer are usually byte oriented rather than frame oriented.
2. An acknowledgement can expand the size of the window based on the sequence
number of the acknowledged data segment.
38
This step is called connection establishment. Connection establishment requires three Transport Layer
actions called three way handshake as shown in figure 7 given below.
• The computer requesting the connection sends a connection request packet to
the intended receiver.
• The responding computer returns a confirmation packet to the requesting
computer.
• The requesting computing returns a packet acknowledging the confirmation.
Connection Termination: Once all of the data have been transferred, the connection
must be terminated.
39
Network, Transport
and Application
2.6 MULTIPLEXING
Layer To improve transmission efficiency, the transport layer has the option of multiplexing.
Multiplexing at this layer occurs in two ways as shown in figure 9:
1. Upward -meaning that multiple transport layer connections use the same
network connection
1 2 3 2
Transport
Layer
Transport
Layer
Upward Downward
40
Transport Layer
Figure 10:
Open Loop: Polices are applied to prevent congestion before it happens.
41
Network, Transport The size of the congestion window increase exponentially. The sender sends one
and Application segment receives one acknowledgement, increases the size to two segments, sends
Layer two segments, receives ack for two segments; increase the size to four and so on.
In other words, after receiving the 3rd ACK, the size of the window has been
increased to eight segments (i.e. 23 = 8). To avoid congestion before it happen one
must slow down this exponential growth. After the size reaches the threshold, the size
is increased one segment for each acknowledgement even if as ACK is for several
segment.
Multiplicative Decrease
If the congestion occurs the congestion windows size must be decreased. The only
way the sender causes that connection has occur through a lost segment. If the sender
does not receive an acknowledgement for a segment before it transmission timer
matured, it assumes that there is congestion.
The strategy says if a time out occurs, the threshold must be set to half of the
congestion window size and the congestion or size should start from one again.
2. Delay is defined as the time interval elapsed between the departures of data
from the source to its arrival at the destination.
3. Jitter: Jitter refers to the variation in time between packets arriving at the
destination.
2. Buffering: Flows can be buffered on the receiving side before being delivered.
Buffering those does not affected the reliability of bandwidth and increases the
delay but it smoothes out the jitter.
Here we discuss some scheduling techniques to improve the quality of service such as:
i) FIFO Queuing
42
Transport Layer
FIFO Queuing
In FIFO Queuing packets wait in a buffer (Queue) until the node is ready to
process them. If the average rate is higher than the average processing rate, the
queue will fill up and new packets will be discarded.
Priority Queuing
In this packets are first assigned to priority class. Each priority class has its
own Queue. The packets in the highest priority Queue are processed first. But if
there is a continuous flow in high-priority Queue, the packets in the low priority
Queues will never have a chance to be processes.
The system processes packets in each queue in a round-robin fashion with the
number of packets selected from each queue based on the corresponding weight.
For example: If the weights are 3, 2 and 1, three packets are processed from the
first queue, two from the second queue and one from the third queue.
If the system does not impose priority on the classes, all weights can be equal.
In thus way, we have fair queuing with priority.
4. Traffic Shaping
a) Leaky bucket
b) Token bucket
A sliding window is used to make transmission more efficient as well as to control the
flow of data so that the destination does not become over whelmed with data. TCP’s
sliding window is byte oriented
43
Network, Transport
and Application
Layer
Receiver Buffer is Full
1 byte
Receiver Buffer is Full
2. But the interactive application reads one byte from the buffer, so one byte space
becomes empty.
3. The receiving TCP sends a window update to the sender informing that it can
send 1 byte.
5. The buffer is full again and the window size is 0. The behavior can continue
forever’s.
The sender can also help to improve the situation. It should not send tiny segments
instead it must wait and send a full segment or at least one containing half of the
receivers buffers size.
2.10 PORTS
In computer networking of connection-based communication port is like a medium
through which, an application establish a connection with another application by
binding a socket by a port number. Addressing the information and the port number,
accompanied the data transfer over the network.
44
The Ports are used by TCP and UDP to deliver the data to the right application, are Transport Layer
identified by a 16-bit number present in the header of a data packet. Ports are typically
used to map data to a particular process running on a client. If we consider a letter
(data packet) sent to a particular apartment (IP) with house no. (Port no), at this time
the port no. is the most important part for the delivery of the letter. In order for the
delivery to work, the sender needs to include a house number along with the address
to ensure the letter gets to the right destination.
Do you know?
TCP and UDP ports are 16 bit number
The TCP and UDP protocols use ports to map incoming data to a particular process
running on a computer.
Types of Port
1. Well known port (0 to 1023)-They are controlled by IANA
Do you know?
Port number permits unique identification of several simultaneous processes using
TCP/UDP
Now we are aware of the importance of the port number. In the same order there are
some ports which are predefine and called reserved ports. Some of them are given in
Table 1given below:
45
Network, Transport Do you know?
and Application
Layer If we consider the range of the port numbers, there are 0 to 65,535 ports available.
Tips
The port numbers ranging from 0 - 1023 are reserved ports or we can say that are
restricted ports. All the 0 to 1023 ports are reserved for use by well-known services
such as FTP, telnet and http and other system services. These ports are called well-
known ports.
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………
2.11 SUMMARY
Transport layer is mainly responsible for end to end reliable delivery, segmentation
and concatenation. Two main protocols that operate on transport layer are TCP and
UDP.TCP provides reliable connection oriented service while UDP provides
unreliable connectionless service. The data link and transport layer perform many of
the same duties .The data link layer function in a single network, while the transport
layer operates across an internet. Flow control at the transport layer is handles by
three walled sliding window. Multiplexing can be downward of upward in transport
layer. Connection establishment and termination can be done by using three way
handshakes. Transport layer works on port address. To know more about the
Transport layer and its protocols (TCP and UDP), student may please refer to the
course material of BCS-61TCP/IP Programming or BCS-54 Network Programming.
46
5. Larry L. Peterson, Computer Networks: A Systems Approach, 3rd Edition (The Transport Layer
Morgan Kaufmann Series in Networking).
7. www.wikipedia.org
47