TCP/UDP & Ports
Last updated
Last updated
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.
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.
In TCP, the connection is established by using three-way handshaking.
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.
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.
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.
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.