| 1 |
.\" Copyright 2008, Gerrit Renker <[email protected]> |
| 2 |
.\" Copyright, the authors of the Linux man-pages project |
| 3 |
.\" |
| 4 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 5 |
.\" |
| 6 |
.TH udplite 7 2026-02-08 "Linux man-pages 6.18" |
| 7 |
.SH NAME |
| 8 |
udplite \- Lightweight User Datagram Protocol |
| 9 |
.SH SYNOPSIS |
| 10 |
.nf |
| 11 |
.B #include <sys/socket.h> |
| 12 |
.\" FIXME . see #defines under `BUGS', |
| 13 |
.\" when glibc supports this, add |
| 14 |
.\" #include <netinet/udplite.h> |
| 15 |
.P |
| 16 |
.B sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDPLITE); |
| 17 |
.fi |
| 18 |
.SH DESCRIPTION |
| 19 |
This is an implementation of the Lightweight User Datagram Protocol |
| 20 |
(UDP-Lite), as described in RFC\ 3828. |
| 21 |
.P |
| 22 |
UDP-Lite is an extension of UDP (RFC\ 768) to support variable-length |
| 23 |
checksums. |
| 24 |
This has advantages for some types of multimedia transport that |
| 25 |
may be able to make use of slightly damaged datagrams, |
| 26 |
rather than having them discarded by lower-layer protocols. |
| 27 |
.P |
| 28 |
The variable-length checksum coverage is set via a |
| 29 |
.BR setsockopt (2) |
| 30 |
option. |
| 31 |
If this option is not set, the only difference from UDP is |
| 32 |
in using a different IP protocol identifier (IANA number 136). |
| 33 |
.P |
| 34 |
The UDP-Lite implementation is a full extension of |
| 35 |
.BR udp (7)\[em]that |
| 36 |
is, it shares the same API and API behavior, and in addition |
| 37 |
offers two socket options to control the checksum coverage. |
| 38 |
.SS Address format |
| 39 |
UDP-Litev4 uses the |
| 40 |
.I sockaddr_in |
| 41 |
address format described in |
| 42 |
.BR ip (7). |
| 43 |
UDP-Litev6 uses the |
| 44 |
.I sockaddr_in6 |
| 45 |
address format described in |
| 46 |
.BR ipv6 (7). |
| 47 |
.SS Socket options |
| 48 |
To set or get a UDP-Lite socket option, call |
| 49 |
.BR getsockopt (2) |
| 50 |
to read or |
| 51 |
.BR setsockopt (2) |
| 52 |
to write the option with the option level argument set to |
| 53 |
.BR IPPROTO_UDPLITE . |
| 54 |
In addition, all |
| 55 |
.B IPPROTO_UDP |
| 56 |
socket options are valid on a UDP-Lite socket. |
| 57 |
See |
| 58 |
.BR udp (7) |
| 59 |
for more information. |
| 60 |
.P |
| 61 |
The following two options are specific to UDP-Lite. |
| 62 |
.TP |
| 63 |
.B UDPLITE_SEND_CSCOV |
| 64 |
This option sets the sender checksum coverage and takes an |
| 65 |
.I int |
| 66 |
as argument, with a checksum coverage value in the range 0..2\[ha]16-1. |
| 67 |
.IP |
| 68 |
A value of 0 means that the entire datagram is always covered. |
| 69 |
Values from 1\-7 are illegal (RFC\ 3828, 3.1) and are rounded up to |
| 70 |
the minimum coverage of 8. |
| 71 |
.IP |
| 72 |
With regard to IPv6 jumbograms (RFC\ 2675), the UDP-Litev6 checksum |
| 73 |
coverage is limited to the first 2\[ha]16-1 octets, as per RFC\ 3828, 3.5. |
| 74 |
Higher values are therefore silently truncated to 2\[ha]16-1. |
| 75 |
If in doubt, the current coverage value can always be queried using |
| 76 |
.BR getsockopt (2). |
| 77 |
.TP |
| 78 |
.B UDPLITE_RECV_CSCOV |
| 79 |
This is the receiver-side analogue and uses the same argument format |
| 80 |
and value range as |
| 81 |
.BR UDPLITE_SEND_CSCOV . |
| 82 |
This option is not required to enable traffic with partial checksum |
| 83 |
coverage. |
| 84 |
Its function is that of a traffic filter: when enabled, it |
| 85 |
instructs the kernel to drop all packets which have a coverage |
| 86 |
.I less |
| 87 |
than the specified coverage value. |
| 88 |
.IP |
| 89 |
When the value of |
| 90 |
.B UDPLITE_RECV_CSCOV |
| 91 |
exceeds the actual packet coverage, incoming packets are silently dropped, |
| 92 |
but may generate a warning message in the system log. |
| 93 |
.\" SO_NO_CHECK exists and is supported by UDPv4, but is |
| 94 |
.\" commented out in socket(7), hence also commented out here |
| 95 |
.\".P |
| 96 |
.\"Since UDP-Lite mandates checksums, checksumming can not be disabled |
| 97 |
.\"via the |
| 98 |
.\".B SO_NO_CHECK |
| 99 |
.\"option from |
| 100 |
.\".BR socket (7). |
| 101 |
.SH ERRORS |
| 102 |
All errors documented for |
| 103 |
.BR udp (7) |
| 104 |
may be returned. |
| 105 |
UDP-Lite does not add further errors. |
| 106 |
.SH FILES |
| 107 |
.TP |
| 108 |
.I /proc/net/snmp |
| 109 |
Basic UDP-Litev4 statistics counters. |
| 110 |
.TP |
| 111 |
.I /proc/net/snmp6 |
| 112 |
Basic UDP-Litev6 statistics counters. |
| 113 |
.SH VERSIONS |
| 114 |
UDP-Litev4/v6 first appeared in Linux 2.6.20. |
| 115 |
.SH BUGS |
| 116 |
.\" FIXME . remove this section once glibc supports UDP-Lite |
| 117 |
Where glibc support is missing, the following definitions are needed: |
| 118 |
.P |
| 119 |
.in +4n |
| 120 |
.EX |
| 121 |
#define IPPROTO_UDPLITE 136 |
| 122 |
.\" The following two are defined in the kernel in linux/net/udplite.h |
| 123 |
#define UDPLITE_SEND_CSCOV 10 |
| 124 |
#define UDPLITE_RECV_CSCOV 11 |
| 125 |
.EE |
| 126 |
.in |
| 127 |
.SH SEE ALSO |
| 128 |
.BR ip (7), |
| 129 |
.BR ipv6 (7), |
| 130 |
.BR socket (7), |
| 131 |
.BR udp (7) |
| 132 |
.P |
| 133 |
RFC\ 3828 for the Lightweight User Datagram Protocol (UDP-Lite). |
| 134 |
.P |
| 135 |
.I Documentation/networking/udplite.rst |
| 136 |
in the Linux kernel source tree |