UDP Lite
Encyclopedia
UDP-Lite is a connectionless protocol
Connectionless protocol
In telecommunications, connectionless describes communication between two network end points in which a message can be sent from one end point to another without prior arrangement. The device at one end of the communication transmits data addressed to the other, without first ensuring that the...

, very similar to UDP
User Datagram Protocol
The User Datagram Protocol is one of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer applications can send messages, in this case referred to as datagrams, to other hosts on an Internet Protocol network without requiring...

. Unlike UDP, where either all or none of a packet is protected by a checksum, UDP-Lite allows for partial checksums that only cover part of a datagram (header and the custom amount of the beginning of payload), and will therefore deliver packets that have been partially corrupted. It is designed for multimedia protocols, such as voice over IP
Voice over IP
Voice over Internet Protocol is a family of technologies, methodologies, communication protocols, and transmission techniques for the delivery of voice communications and multimedia sessions over Internet Protocol networks, such as the Internet...

, in which receiving a packet with a partly damaged payload is better than receiving no packet at all. For computing the checksum it uses the same checksum algorithm used for the UDP (and the TCP).

Since most modern link layers protect the carried data with a strong CRC and will discard damaged frames, making effective use of UDP-Lite requires the link layer to be aware of the network-layer data being carried. Since no current IP stacks implement such cross-layer interactions, making effective use of UDP-Lite currently requires specially modified device drivers.

The IP protocol identifier is 136, so UDP-Lite creates a new port space, differently from TCP and UDP, and UDP-Lite packets are not delivered to UDP applications (UDP has the protocol identifier 17).

Support for UDP-Lite was added in the Linux kernel
Linux kernel
The Linux kernel is an operating system kernel used by the Linux family of Unix-like operating systems. It is one of the most prominent examples of free and open source software....

version 2.6.20. The BSD socket API is extended to support UDP-Lite by the third parameter of the socket system call: Set it to IPPROTO_UDPLITE to request an UDP-Lite socket:

int s = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDPLITE);


One can also easily set what part of the packet will be covered by the checksum (starting from the beginning including header)

int val = 20; // 8 octets of header + 12 octets of some user protocol.
setsockopt(s, SOL_UDPLITE, UDPLITE_SEND_CSCOV, &val, sizeof(int));

If a packet smaller than 12 octets is sent in such a setup, the checksum will cover the whole packet.

On the receiving side a socket will by default drop all packet which are not covered completely (UDP emulation). To permit for smaller coverage one can use:

int min = 20; // 8 octets of header + 12 octets of some user protocol.
setsockopt(s, SOL_UDPLITE, UDPLITE_RECV_CSCOV, &min, sizeof(int));

This will allow for packets where at minimum 12 octets of user data are checksummed. Any packet with a smaller coverage will be silently dropped as bad. If a packet has a coverage length of at least 20 (including header) and its checksum is correct, it will be delivered to application (whole or part of the payload can still by corrupted, because it could be not covered by checksum or because the checksum was correct incidentally, but the latter is very unlikely). If the checksum is incorrect the packet will be dropped (because it is actually impossible to know if the error was inside the payload data or in the UDP-Lite header, so the packet could actually be destined for a different program).

The smallest possible coverage is 8 (headers need to be included in checksum). Packets with a smaller length of coverage will always be dropped independent of any settings (ignoring sniffers which are interested in all traffic) as not conforming to standard.

External links

  • RFC 3828 - The Lightweight User Datagram Protocol (UDP-Lite)
  • RFC 5097 - MIB for the UDP-Lite protocol
  • RFC 4019 - RObust Header Compression (ROHC): Profiles for User Datagram Protocol (UDP) Lite
  • RFC 5405 - Unicast UDP Usage Guidelines for Application Designers
  • UDP Lite WiKi
  • Socket API for UDP-Lite
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK