TCP/UDP & Ports

A network protocol is a set of established rules that specify how to format, send and receive data so that computer network endpoints, including computers, servers, routers and virtual machines, can communicate despite differences in their underlying infrastructures, designs or standards.

HTTP protocol for communication between web browsers and servers.

TCP (Transmission Control Protocol)

TCP (Transmission Control Protocol) is one of the main protocols of the Internet protocol suite.

It lies between the Application and Network Layers which are used in providing reliable delivery services.

Transmission Control Protocol is a connection-oriented protocol for communications that helps in the exchange of messages between different devices over a network.

The Internet Protocol (IP), which establishes the technique for sending data packets between computers, works with TCP.

Working Principle of TCP

In TCP, the connection is established by using three-way handshaking.

TCP

The client sends the segment with its sequence number.

The server, in return, sends its segment with its own sequence number as well as the acknowledgement sequence, which is one more than the client sequence number.

When the client receives the acknowledgment of its segment, then it sends the acknowledgment to the server. In this way, the connection is established between the client and the server.

3 Way Hand-Shake

Three Way Handshake is a process that is used to establish a connection between Client and Server. It has three steps of process.

UDP (User Datagram Protocol)

User Datagram Protocol (UDP) is a Transport Layer protocol. UDP is a part of the Internet Protocol suite, referred to as UDP/IP suite. Unlike TCP, it is an unreliable and connectionless protocol.

The UDP helps to establish low-latency and loss-tolerating connections over the network. The UDP enables process-to-process communication.

There is no need to establish a connection before data transfer.

UDP

UDP works on DNS, VOIP, and DHCP Applications.

Working Principle of UDP

  • In UDP, the receiver does not generate an acknowledgement of packet received and in turn, the sender does not wait for any acknowledgement of packet sent.

  • This shortcoming makes this protocol unreliable as well as easier on processing.

  • UDP is said to be an unreliable transport protocol but it uses IP services which provides best effort delivery mechanism.

Use Cases

Use Cases

Ports

A port is a virtual point where network connections start and end. Ports are software-based and managed by a computer's operating system.

Each port is associated with a specific process or service.

Ports allow computers to easily differentiate between different kinds of traffic: emails go to a different port than webpages, for instance, even though both reach a computer over the same Internet connection.

Ports are standardized across all network-connected devices, with each port assigned a number.

Most ports are reserved for certain protocols — for example, all Hypertext Transfer Protocol (HTTP) messages go to port 80.

Since the port is a 16-bit unsigned number it ranges from 0 to 65535.

Types of Ports

Ports

Common Network Ports

Common Protocols

Last updated