Kevin De Baerdemaeker

TCP/IP

Modified 2024-04-08

The protocol includes 4 layers:

TCP Headers

HeaderDescription
Source PortThe port opened by the sender to send the TCP packet from. Value is random.
Destination PortThe port where an application or service is running.
Source IP
Destination IP
Sequence NumberWhen a connection occurs, the first piece of data is a random number.
Acknowledgment NumberSequence Number + 1
ChecksumReceiver needs to verify the data
DataThe information in bytes
FlagDetermines how to handle the packet during the handshake process.

Three-way Handshake

StepMessageDescription
1SYNInitiates connection and synchronizes devices
2SYN/ACKSent by the receiver to confirm correct synchronization
3ACKAcknowledges the received packets
4DATA
5FINProperly close the connection, and possibly acknowledges
#RSTAbruptly ends all communication (errors, low resources)

Backlinks