Introduction to the TCP and UDP protocols

The properties of a socket depend on the characteristics of the protocol in which they are implemented. Generally, communication with sockets is done through a protocol of the TCP/IP family. The two most common are TCP and UDP.

When implemented with the TCP protocol, the sockets have the following properties:

  • Connection-oriented.
  • The transmission of all packets is guaranteed without errors or omissions.
  • It is guaranteed that every packet will reach its destination in the same order in which it was transmitted. These properties are very important to guarantee the correctness of the programs that deal with this information.

The UDP protocol has the following properties:

  • Is a non-connection-oriented protocol
  • It only guarantees that if a message arrives, it arrives in a reliable way
  • In no case is it guaranteed that all messages will arrive, or arrive in the same order in which they were sent

Sockets can be implemented through a different number of channels: Unix domain sockets, TCP, and UDP. The Python socket library provides specific classes to handle common transport, as well as a generic interface to control everything else.

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

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