MASENO UNIVERSITY
DEPARTMENT OF INFOTMATION TECHNOLOGY
THE TRANSPORT LAYER
Session Coverage:
Role and Operation at Transport layer
Specific Transport Layer responsibilities
Transport layer protocols
Socketing at the Transport Layer
Transport Layer Services
1.1 Introduction
The transport layer is responsible for process-to-process delivery of the entire message. A
process is an application program running on a host.
Whereas the network layer oversees source-to-destination delivery of individual packets, it
does not recognize any relationship between those packets.
It treats each one independently, as though each piece belonged to a separate message,
whether or not it does.
The transport layer, on the other hand, ensures that the whole message arrives intact and in
order, overseeing both error control and flow control at the source-to-destination level.
1.2 Role of the Transport Layer
Responsible for logical communications between applications running on different hosts.
The link between the application layer and the lower layers; those are responsible for
network transmission.
1.3 Functions
The transport layer is responsible for the delivery of a message from one process to another.
i. Service-point addressing:
Computers often run several programs at the same time. For this reason, source-to-
destination delivery means delivery not only from one computer to the next but also
from a specific process (running program) on one computer to a specific process
(running program) on the other.
Page 1 of 9
The transport layer header must therefore include a type of address called a service-point
address (or port address).
The network layer gets each packet to the correct computer; the transport layer gets the
entire message to the correct process on that computer.
ii. Segmentation and reassembly
A message is divided into transmittable segments, with each segment containing a
sequence number.
These numbers enable the transport layer to reassemble the message correctly upon
arriving at the destination and to identify and replace packets that were lost in
transmission.
iii. Connection control
The transport layer can be either connectionless or connection-oriented. A
connectionless transport layer treats each segment as an independent packet and delivers
it to the transport layer at the destination machine.
A connection-oriented transport layer makes a connection with the transport layer at the
destination machine first before delivering the packets.
After all the data are transferred, the connection is terminated.
iv. Flow control
Like the data link layer, the transport layer is responsible for flow control. However, flow
control at this layer is performed end to end rather than across a single link.
v. Error control
Like the data link layer, the transport layer is responsible for error control.
However, error control at this layer is performed process-to-process rather than across a
single link.
The sending transport layer makes sure that the entire message arrives at the receiving
transport layer without error (damage, loss, or duplication).
Error correction is usually achieved through retransmission
Page 2 of 9
1.4 Specific transport layer responsibilities:
Tracking individual conversations
Segmenting data and reassembling segments
Adds header information
Identify, separate, and manage multiple conversations
Uses segmentation and multiplexing to enable different communication conversations to
be interleaved on the same Network.
IP does not specify how the delivery or transportation of the packets takes place.
Transport layer protocols specify how to transfer messages between hosts, and are
responsible for managing reliability requirements of a conversation.
1.5 Transport Layer Protocols
The transport layer includes:
Transmission Control Protocol (TCP) - Reliable protocol for the TCP/IP stack
User Datagram Protocol (UDP) - unreliable protocol for the TCP/IP stack
Sequenced Packet Exchange (SPX) reliable protocol for the IPX/SPX (Novell Netware
Stack)
Page 3 of 9
1.5.1 Transmission Control Protocol (TCP)
Features of TCP
Establishes a Session - TCP is a connection-oriented protocol that negotiates and establishes a
permanent connection (or session) between source and destination devices prior to
forwarding any traffic.
Ensures Reliable Delivery - For many reasons, it is possible for a segment to become corrupted
or lost completely, as it is transmitted over the network. TCP ensures that each segment that
is sent by the source arrives at the destination.
Provides Same-Order Delivery - Because networks may provide multiple routes that can have
different transmission rates, data can arrive in the wrong order.
Supports Flow Control - Network hosts have limited resources (i.e., memory and processing power).
When TCP is aware that these resources are overtaxed, it can request that the sending application
reduce the rate of data flow
TCP Reliability and Flow Control Operations:
Number and track data segments transmitted to a specific host from a specific
application
Acknowledge received data
Retransmit any unacknowledged data after a certain amount of time
Sequence data that might arrive in wrong order
Send data at an efficient rate that is acceptable by the receiver.
TCP Header
TCP is a stateful connection oriented transport layer protocol which means it keeps track of
the state of the communication session.
TCP records which information it has sent, and which information has been acknowledged
Page 4 of 9
Figure 1: Transport Layer Header (Source: Comer, 2008; 5th edition)
Table 1: Functions of Flags in the TCP Header
TCP Header Field Description
Source Port A 16-bit field used to identify the source application by port number.
Destination Port A 16-bit field used to identify the destination application by port number.
Sequence Number A 32-bit field used for data reassembly purposes.
Acknowledgment A 32-bit field used to indicate that data has been received and the next byte expected from
Number the source.
Header Length A 4-bit field known as ʺdata offsetʺ that indicates the length of the TCP segment header
Reserved A 6-bit field that is reserved for future use
A 6-bit field used that includes bit codes, or flags, which indicate the purpose and function
Control bits
of the TCP segment.
Window size A 16-bit field used to indicate the number of bytes that can be accepted at one time.
Checksum A 16-bit field used for error checking of the segment header and data.
Urgent A 16-bit field used to indicate if the contained data is urgent.
Page 5 of 9
1.5.2 User Datagram Protocol (UDP)
UDP provides the basic functions for delivering datagrams between the appropriate applications,
with very little overhead and data checking.
• UDP is a connectionless protocol.
• UDP is known as a best-effort delivery protocol because there is no acknowledgment that
the data is received at the destination.
Features UDP
• Data is reconstructed in the order that it is received.
• Any segments that are lost are not resent.
• There is no session establishment.
• The sending is not informed about resource availability
UDP Header
Figure 2: User Datagram Protocol Header (Source: Comer, 2008; 5th edition)
Table 2: Functions of Flags in the UDP Header
UDP Header Field Description
A 16-bit field used to identify the source application by port
Source Port
number.
A 16-bit field used to identify the destination application by port
Destination Port
number.
A 16-bit field that indicates the length of the UDP datagram
Length
header
A 16-bit field used for error checking of the datagram header and
Checksum
data.
Page 6 of 9
Socketing Role of Transport Layer: Separating Multiple Communications
TCP and UDP transport layer protocols use port numbers to manage multiple, simultaneous
conversations.
The source port number is associated with the originating application on the local host
whereas the destination port number is associated with the destination application on the
remote host.
Figure 3: Use of Ports in Segments (Source: Comer, 2008; 5th edition)
The source and destination ports are placed within the segment.
The segments are then encapsulated within an IP packet.
The combination of the source IP address and source port number, or the destination IP
address and destination port number is known as a socket.
Sockets enable multiple processes, running on a client, to distinguish themselves from each
other, and multiple connections to a server process to be distinguished from each other.
Table 3: Categories of Ports (IANA)
Port Group Number Description
Range
• These port numbers are reserved for common or popular services and
applications such as web browsers, email clients, and remote access clients.
Well-known Ports 0 to 1,023
• Defined well-known ports for common server applications enables clients
to easily identify the associated service required.
• These port numbers are assigned by IANA to a requesting entity to use
with specific processes or applications.
• These processes are primarily individual applications that a user has chosen
Registered Ports 1,024 to 49,151 to install, rather than common applications that would receive a well-
known port number.
• For example, Cisco has registered port 1812 for its RADIUS server
authentication process.
• These ports are also known as ephemeral ports.
• The client’s OS usually assign port numbers dynamically when a connection
Private and/or Dynami
49,152 to 65,535 to a service is initiated.
c Ports
• The dynamic port is then used to identify the client application during
communication.
Page 7 of 9
Port Number Protocol Application
20 TCP File Transfer Protocol (FTP) - Data
21 TCP File Transfer Protocol (FTP) - Control
22 TCP Secure Shell (SSH)
23 TCP Telnet
25 TCP Simple Mail Transfer Protocol (SMTP)
53 UDP, TCP Domain Name Service (DNS)
67 UDP Dynamic Host Configuration Protocol (DHCP) - Server
68 UDP Dynamic Host Configuration Protocol - Client
69 UDP Trivial File Transfer Protocol (TFTP)
80 TCP Hypertext Transfer Protocol (HTTP)
110 TCP Post Office Protocol version 3 (POP3)
143 TCP Internet Message Access Protocol (IMAP)
161 UDP Simple Network Management Protocol (SNMP)
443 TCP Hypertext Transfer Protocol Secure (HTTPS)
Novell Network Protocol Stack: Transport Layer Protocol
The transport layer protocol utilized in Novell Netware stack is the Sequenced Packet
Exchange.
The protocol is connection oriented; established and managed connections for the duration
of data transmission.
The SPX header is made up of 32 binary bits as shown in table below.
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
Connection control Data stream type Source connection ID
Destination connection ID Sequence number
Acknowledgement Number Allocation number
Data :::
Page 8 of 9
Functions of the Various Flags
i. Connection control (8 Binary bits).
Value Description
0x10 End of message.
0x20 Attention.
0x40 Acknowledgement required.
0x80 System packet.
ii. Data stream type (8 Binary bits)
Value Description
0xFE End of connection. This is the last message for this connection.
0xFF End of connection acknowledgement.
iii. Source connection ID (16 Binary bits).
iv. Destination connection ID. (16 Binary bits).
v. Sequence number (16 Binary bits); an incremental count of the number of SPX packets
transmitted by the sender.
vi. Acknowledgement number (16 Binary bits); the sequence number to be expected in the next SPX
packet.
vii. Allocation number (16 Binary bits); the number of outstanding receive buffers available.
viii. Data. 0 to 534 bytes; if this is not a system packet, then this field may contain data up to 534
bytes.
ASSIGNMENT (Due 28th November 2020, 5:00pm)
[1] Explain with the aid of suitable diagrams how the TCP/IP protocol achieves reliable
routable data transmission in internetworking. (10 Marks)
[2] Differentiate between dual stack and dual layer in TCP/IP stack and hence explain how data
moves:
a) Between two IPv6 segments over an IPv6 internet infrastructure.
b) From an IPv6 device to an IPv4 devices
(20 Marks)
Page 9 of 9