Skip to content

Latest commit

 

History

History
17 lines (9 loc) · 1.1 KB

File metadata and controls

17 lines (9 loc) · 1.1 KB

Life of a Packet

TCP Byte Stream

Almost all web traffic is over TCP, the Transport Control Protocol. A server listens for connection requests and a client issues connection requests.

This exchange takes three messages, which is called "three way handshake":

  • the first handshake is the client sends a synchronize, or "SYN", message to the server.

  • the second handshake is the server sends a "synchronize and acknowledge" message, or "SYN-ACK".

  • the third handshake is the client sends an acknowledge message, also called "ACK".

Since the transport layer is to delivery data to the application, it needs another address to differentiate applications. It is different from the address used by the network layer, which is to differentiate computers. Such address is port.

When a packet is sent to the router, the router will decide where to delivery the packet. Inside the router, there is a forwarding table that contains the address pattern and the corresponding link to other router. The router matches the pattern with the packet's destination address and send it to the router with the best match.