Transport Layer Protocols TCP and UDP

You have learnt about IP Addressing and IP assignment in the earlier articles. While network layer protocols are used for logical addressing and routing, transport layer protocols provide end-to-end communication between hosts or computers on a TCP/IP Network.

Transport Layer Protocols

Transport layer protocols (Layer 4 of OSI model) provide end-to-end communication services for applications. The transport layer provides convenient services such as connection-oriented data stream support, reliability, flow control, and multiplexing. Well-known protocols at this layer are TCP & User Datagram Protocol (UDP).

User Datagram Protocol (UDP) is a transport layer protocol that is used for sending messages to other hosts on the network without prior communications, to set up special transmission channels or data paths. UDP does not provide reliability, ordering, or data integrity. UDP assumes that error checking and correction is either not necessary or performed in the application, hence avoiding the overhead of such processing at the network interface level.

UDP’s stateless nature is also useful for servers answering small queries from huge numbers of clients, such as Domain Name System (DNS), streaming media applications such as IPTV, Voice over IP (VoIP), Trivial File Transfer Protocol (TFTP), IP tunneling protocols and many online games.

Transmission Control Protocol (TCP) provides reliable, ordered delivery of a stream of bytes from a program on one computer to another program on a different computer on the network.TCP is the protocol used by major Internet applications such as the World Wide Web, email, remote administration and file transfer. UDP is used either by applications that have a built-in facility to check reliability or when transfers happen that do not require reliability. UDP has less overhead than TCP.

TCPUDP
ReliableUnreliable
Segment SequencingNo Sequencing
Acknowledge SegmentsNo Acknowledgement
Connection OrientedConnectionless
Segment retransmission and flow controlNo transmission

Parts & Sockets

Today computers use a variety of network applications such as browsers, email clients, chat software, etc. simultaneously and are assigned only a single p address. To avoid conflicts, port numbers are standardized by IANA for most network applications. When a network application from a client attempts to connect to corresponding network application to a server, the operating system uses combination of the assigned IP address along with a port number referred to as a socket for end-to-end communication.

Computers that have single IP address can host a variety of services using different port numbers eliminating the need for having multiple IP address. For example, a computer assigned with an IP address 12.1.1.1 can run a web server using port 80 and än ftp server using port 21.

Port numbers range from 0 to 65,535 as it uses a 16-bit scheme (2¹-65,536). 0 15 reserved and cannot be used and the actual range is between 1 to 65535.

Network applications are designed to use a single port number or range or port numbers. Some network applications such as network & Internet games, video conferencing software, etc. may use a dynamic range of port numbers for communication. For example Apple’s QuickTime Streaming Server uses UDP as its transport protocol in the 6970-9999 range.

Note: To know about the port numbers and range for specific network application, refer to product manual or the vendor’s website.

IANA Well-Known Ports

Port numbers in the range from 0 to 1023 are referred to as well-known ports. Look at the following table that summarises the standardized port numbers for common application layer protocols:

Port NumberTransportDescription
0TCP, UDPReserved
20TCPFTP (Data)
21TCPFTP (Control)
23TCPTelnet
25TCPSMTP
53UDPDNS Query
69UDPTFTP
80TCPHTTP
110TCPPOP3
111UDPRPC
119TCPNNTP
137UDPNETBOIS Name Service
143TCPIMAP4
161UDPSNMP
389TCPLDAP
443TCPHTTPS

Note: Only partial list of port numbers are included in this table; See the Service Name and Transport Protocol Port Number Registry of IANA for complete list of assigned ports.

Port numbers from 1024 to 49151 are the registered ports and are assigned by IANA for specific applications from products from a variety of vendors. Port numbers above 49151 are dynamic or private ports.

NETSTAT

NETSTAT (i.e. Network statistics), is a command line utility used for viewing port numbers used by network applications. This command is used understand and troubleshoot any network or transport later issues.

TCP/IP model

DoD (Department of Defense) or TCP/IP Model simplifies the 7 layer OSI Model into a 4 layer model (figure below):

OSI 7 Layers vs TCPIP Model 4 Layers.png
  1. Network Interface or Link Layer specifies how data is physically sent on a network using electrical, optical or radio waves. This layer includes devices such as NIC that directly interface with a network medium such as a UTP Cable.
  2. Internet Layer specifies IP packets sent on a Packet Switched Network and is same as the Network Layer.
  3. Transport Layer specifies how communication session takes place between computers and is the same as the Transport Layer discussed earlier.
  4. Application Layer specifies how applications and protocols communicate between end points. This layer combines Session, Presentation & Application layers of the OSI Model.

Note: Different applications use several protocols that are a part of the TCP/IP Protocol Suite operating at each layer of the OSI model.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.