Transmission Control Protocol (TCP)

TCP prevents loss of data, duplication, and damage. It ensures that the sent message isn't out of order. These characteristics make it a reliable protocol, unlike UDP.

Note

Please refer to the RFC 793 guide for more information about TCP.

TCP synchronizes using a three-way handshake. Synchronization between two nodes begins when a TCP segment is sent with the SYN (0x02) flag set.

TCP sockets are one-to-one. A source node transmits messages to the destination node.

Transmission Control Protocol (TCP)

TCP sockets are one-to-one

The three-way handshake protocol

A three-way handshake allows TCP to prevent out-of-order message delivery and duplicated transmission.

  1. Transmission begins when the SYN (0x02) flag is set in a packet and is sent to the destination.
  2. The destination receives the packet with the SYN (0x02) flag and sends an acknowledgement to the source by setting the ACK (0x10) flag in the reply. This stage is called SYN-ACK.
  3. The source receives the SYN-ACK message and sends an ACK segment, which notes that each packet in the TCP messages contains a sequence number to maintain the order.
  4. Once the transmission is done, the FIN (0x01) flag is set in the next reply packet.
    The three-way handshake protocol

    The three-way handshake protocol

The sequence numbers allow TCP to control the flow. TCP uses a sliding-window technique. If an ACK segment is not received in a particular period of time, then it retransmits the missing part of data. However, choosing an appropriate timeout is not an easy task. Therefore, in order to solve this issue, TCP uses adaptive retransmission.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.116.43