Understanding TCP and UDP

As we discussed earlier in this chapter in the Transport layer section, TCP and UDP are the main protocols that are used to transfer data across a network. The delivery mechanisms that they have are different from each other. TCP has acknowledgments, sequence numbers, and flow control in transferring data process to provide a guaranteed delivery, whereas UDP does not provide a guaranteed delivery but provides a delivery with best efforts.

Transmission Control Protocol

TCP performs a three-way handshaking process before the protocol establishes the session. This is done in order to provide a guaranteed delivery. Refer to the following figure to understand the three-way handshaking process:

From the preceding image, imagine ...

Get Boost.Asio C++ Network Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.