Thursday, 4 May 2023

TCP

TCP

TCP is a connection oriented protocol, it creates a session between the source and destination and provides reliable delivery. 
Bits are ordered with sequence numbers and are reordered on delivery, if the data becomes corrupt TCP requests them to be sent again. TCP also uses flow control to regulate the amount of data that can be sent, it does this using windowing, reducing the bit size to 16 bits. The sequence number of is a 32 bit field used for reassembly of data. A visual is shown below;


Common applications that use TCP are email, web applications and file transfer. TCP is used because guaranteed delivery of all segments is essential. Alternatively UDP which doesn't use guaranteed delivery is the preferred protocol for online phone services such as Microsoft Teams and Google Meet and live streaming, this is due to the reduction in bandwidth and the need for real time data delivery without delay.

TCP (Transmission Control Protocol) uses various flags to control and manage communication between network devices. Here is an overview of the TCP flags commonly used in TCP packet headers:

SYN (Synchronize):
The SYN flag is used to establish a TCP connection between two devices. When a device wants to initiate a connection, it sends a TCP packet with the SYN flag set. The receiving device responds with a SYN-ACK packet, indicating acknowledgment of the request and its own readiness to establish the connection.

ACK (Acknowledgment):
The ACK flag is used to acknowledge received data or confirm the successful receipt of a packet. It is commonly used in combination with other flags to indicate the status of the connection. In a TCP header, the ACK flag is set when the acknowledgement number field is valid and acknowledging data received from the other device.

FIN (Finish):
The FIN flag is used to initiate the graceful termination of a TCP connection. When a device wants to close a connection, it sends a TCP packet with the FIN flag set. The other device acknowledges the FIN packet and responds with its own FIN packet. This exchange allows both devices to close the connection gracefully.

RST (Reset):
The RST flag is used to reset a TCP connection and abort communication abruptly. It is typically sent in response to an error or when a device encounters an unexpected or invalid state. The RST flag helps in recovering from connection issues and restoring the TCP stack to a known state.

PSH (Push):
The PSH flag is used to request immediate data delivery to the receiving application. When a device sets the PSH flag, it signals to the receiving device that the data should be pushed up to the application layer without delay, even if there is more data to be sent in subsequent packets.

URG (Urgent):
The URG flag is used to indicate the presence of urgent or priority data in the TCP packet. It is typically used in combination with the urgent pointer field to identify a specific section of data that requires immediate attention by the receiving application.

Understanding these TCP flags is crucial for analyzing network traffic, troubleshooting connectivity issues, and ensuring reliable communication between devices. By examining the flags in TCP packet headers, network administrators can gain insights into the status of TCP connections, identify anomalies or errors, and optimize network performance.




No comments:

Post a Comment

Fast switching vs Process switching

Process Switching: Process switching is the traditional method of packet forwarding used in early routers. When a packet arrives at a router...