UDP Theory
UDP Theory
UDP (User Datagram Protocol) is a connectionless, lightweight transport protocol used in the
Internet Protocol (IP) suite. It provides a way for applications to send data, called datagrams, without
the overhead of establishing and maintaining a connection. UDP is faster but less reliable compared
to TCP, as it does not guarantee delivery, order, or error checking of the data.
Here is a simplified outline of how UDP communication works between a client and server:
Server Side:
server_socket.bind(('server_address', port))
3. Receive Data
Wait for data from clients. The recvfrom() method retrieves the message and the client's
address.
server_socket.sendto(response_data, client_address)
Client Side:
2. Send Data
Send data to the server using the sendto() method.
client_socket.close()
Key Characteristics of UDP: