Skip to contentSkip to conversation

net: RFC 3828-compliant UDP-Lite support

PATCH In review Gerrit Renker 5 participants 13 messages Jun 8, 2006 – Jun 9, 2006 1 message not in the archive

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: RFC 3828-compliant UDP-Lite support

Attached is an extension which adds RFC3828 - compliant UDP-Lite functionality to the IPv4 networking stack.

The code has been adapted from our stable kernel patch, which we have been maintaining and testing extensively over the last 9 months. The attached has been tested to run ok so far on i386, dual-processor, and AMD architectures.

Due to the similarities to UDP, a lot of code from net/ipv4/udp.c has been reused; whereas checksumming code has been rewritten entirely - in particular with regard to ensuring correct behaviour in various and unusual cases, such as fragmentation and split. Use CONFIG_IP_UDPLITE=y to enable, find docs attached.

Please CC: any feedback/discussion to [email protected]

---

 Documentation/networking/udp_lite.txt |  246 ++++
 include/asm-mips/socket.h             |    2
 include/linux/in.h                    |    1
 include/linux/net.h                   |   16
 include/linux/skbuff.h                |   15
 include/linux/snmp.h                  |   18
 include/linux/socket.h                |    1
 include/linux/udplite.h               |   89 +
 include/net/snmp.h                    |    7
 include/net/udplite.h                 |   65 +
 include/net/xfrm.h                    |    2
 net/Kconfig                           |    1
 net/Makefile                          |    1
 net/core/sock.c                       |    7
 net/ipv4/af_inet.c                    |   64 +
 net/ipv4/proc.c                       |   32
 net/udp_lite/Kbuild                   |    1
 net/udp_lite/Kconfig                  |   20
 net/udp_lite/udplitev4.c              | 1730 ++++++++++++++++++++++++++++++++++
 19 files changed, 2296 insertions(+), 22 deletions(-)
Documentation/networking/udp_lite.txt +246 -0
diff -Nurp  a/Documentation/networking/udp_lite.txt b/Documentation/networking/udp_lite.txt
@@ -0,0 +1,246 @@
+  ===========================================================================
+                      The UDP-Lite protocol (RFC 3828)
+  ===========================================================================
+
+  last modified: Wed 7 Jun 2006
+
+
+  UDP-Lite is a Standards-Track IETF transport protocol which features a
+  variable-length checksum. This has advantages for transport of multimedia
+  (video, VoIP) over wireless networks, as partly damaged packets can still be
+  fed into the codec instead of being discarded due to a failed checksum test.
+
+  This file briefly describes the existing kernel support and the socket API.
+  For in-depth information, you can consult:-
+
+   o The UDP-Lite Homepage: http://www.erg.abdn.ac.uk/users/gerrit/udp-lite/
+       Fom here you can always also pull the latest patch for the stable
+       kernel tree and example application source code.
+
+   o The UDP-Lite HOWTO on
+     http://www.erg.abdn.ac.uk/users/gerrit/udp-lite/files/UDP-Lite-HOWTO.txt
+
+   o The Ethereal UDP-Lite WiKi (with capture files):
+     http://wiki.ethereal.com/Lightweight_User_Datagram_Protocol
+
+   o The Protocol Spec:  RFC 3828,    http://www.ietf.org/rfc/rfc3828.txt
+
+
+
+  I) APPLICATIONS
+
+  Several applications have ported successfully to UDP-Lite. Ethereal
+  now comes with UDP-Lite support by default. The tarball on
+
+  http://www.erg.abdn.ac.uk/users/gerrit/udp-lite/files/udplite_linux.tar.gz
+
+  has source code for several client-server and network testing examples.
+
+  Porting applications to UDP-Lite is straightforward: only socket level and
+  IPPROTO need to be changed, senders additionally set the checksum coverage
+  length (default = header length = 8). Details are in the next section.
+
+
+
+  II) PROGRAMMING API
+
+  UDP-Lite introduces a new socket type, the SOCK_LDGRAM (note the L) for
+  lightweight, connection-less services. These are the socket options:
+
+    * Sender checksum coverage: UDPLITE_SOCKOPT_SEND_CSCOV
+
+      For instance,
+
+      int val = 20;
+      setsockopt(s, SOL_UDPLITE, UDPLITE_SOCKOPT_SEND_CSCOV, &val, sizeof(int));
+
+      sets the checksum coverage length to 20 (12b data + 8b header).
+
+
+    * Receiver checksum coverage: UDPLITE_SOCKOPT_RECV_CSCOV
+
+      This option is analogously used at the receiver to set its
+      checksum coverage.
+      While the checksum coverage at the sender means the /actual/
+      length that will be used for the checksum, the receiver
+      checksum coverage stands for the /minimum/ coverage value a
+      receiver is willing to accept; and may drop packets which do
+      not meet this threshold.
+
+  A detailed description of the socket options is in section IV.
+
+
+
+  III) HEADER FILES
+
+  The socket API requires support in header files in /usr/include:
+    * /usr/include/netinet/udplite.h
+    * /usr/include/netinet/in.h
+    * /usr/include/bits/socket.h
+  Changes are minor and replicate the information contained in the patched
+  kernel include files; details and example files for various distros can
+  be found on the UDP-Lite homepage
+
+
+
+  IV) KERNEL BEHAVIOUR WITH REGARD TO THE VARIOUS SOCKET OPTIONS
+
+  To enable debugging messages, the log level must be set to 8, as most
+  messages use the KERN_DEBUG level (7).
+
+
+  1) Sender Socket Options
+
+  If the sender specifies a value of 0 as coverage length, the module
+  assumes full coverage, transmits a packet with coverage length of 0
+  and according checksum.  If the sender specifies a coverage < 8 and
+  different from 0, the kernel assumes 8 as default value.  Finally,
+  if the specified coverage length exceeds the packet length, the packet
+  length is used instead as coverage length.
+
+
+  2) Receiver Socket Options
+
+  The receiver specifies the minimum value of the coverage length it
+  is willing to accept.  A value of 0 here indicates that the receiver
+  always wants the whole of the packet covered. In this case, all
+  partially covered packets are dropped and an error is logged.
+
+  It is not possible to specify illegal values (<0 and <8); in these
+  cases the default of 8 is assumed.
+
+  All packets arriving with a coverage value less than the specified
+  threshold are discarded, these events are also logged.
+
+
+  3) Disabling the Checksum Computation
+
+  On both sender and receiver, trying to disable the UDP Lite checksum
+  (option SO_NO_CHECK) in setsockopt(2) results in an error. Thus
+
+        setsockopt(sockfd,SOL_SOCKET, SO_NO_CHECK, ... );
+
+  will always result in an error, while
+
+        getsockopt(sockfd, SOL_SOCKET, SO_NO_CHECK, &value,...);
+
+  will always return a value of 0 (meaning checksum enabled). Packets
+  with a zero checksum field are silently discarded by the receiver.
+
+
+  4) Fragmentation
+
+  The checksum computation respects both buffersize and MTU. The size
+  of UDP Lite packets is determined by the size of the send buffer. The
+  minimum size of the send buffer is 2048 (defined as SOCK_MIN_SNDBUF
+  in include/net/sock.h), the default value is configurable as
+  net.core.wmem_default or via setting the SO_SNDBUF socket(7)
+  option. The maximum upper bound for the send buffer is determined
+  by net.core.wmem_max.
+
+  Given a payload size larger than the send buffer size, UDP Lite will
+  split the payload into several individual packets, filling up the
+  send buffer size in each case.
+
+  The precise value also depends on the interface MTU. The interface MTU,
+  in turn, may trigger IP fragmentation. In this case, the generated
+  UDP Lite packet is split into several IP packets, of which only the
+  first one contains the header.
+
+  The send buffer size has implications on the checksum coverage length.
+  Consider the following example:
+
+  Payload: 1536 bytes            Send Buffer:     1024 bytes
+  MTU    :   1500 bytes          Coverage Length: 856  bytes
+
+  UDP Lite will ship the 1536 bytes in two separate packets:
+
+  Packet 1: 1024 payload + 8 byte header + 20 byte IP header = 1052 bytes
+  Packet 2:  520 payload + 8 byte header + 20 byte IP header =  528 bytes
+
+  The coverage packet covers the UDP Lite header and 848 bytes of the
+  payload in the first packet, the second packet is fully covered. Note
+  that for the second packet, the coverage length exceeds the packet
+  length. The kernel always re-adjusts the coverage length to the packet
+  length in such cases.
+
+  As an example of what happens when one UDP Lite packet is split into
+  several tiny fragments, consider the following example.
+
+  Payload: 1024 bytes            Send buffer size: 1024 bytes
+  MTU:      300 bytes            Coverage length:   575 bytes
+
+  +-+-----------+--------------+--------------+--------------+
+  |8|    272    |      280     |     280      |     280      |
+  +-+-----------+--------------+--------------+--------------+
+               280            560            840           1032
+                                    ^
+  *****checksum coverage*************
+
+  The UDP Lite module generates one 1032 byte packet (1024 + 8 byte
+  header). According to the interface MTU, these are split into 4 IP
+  packets (280 byte IP payload + 20 byte IP header). The kernel module
+  sums the contents of the entire first two packets, plus 15 bytes of
+  the last packet before releasing the fragments to the IP module.
+
+
+
+  V) UDP-LITE RUNTIME STATISTICS AND THEIR MEANING
+
+  Exceptional and error conditions are logged to syslog at the KERN_DEBUG
+  level.  Live statistics about UDP-Lite are available in /proc/net/snmp
+  and can--with newer versions of netstat--be queried using
+
+                                 netstat -svu
+
+  This displays UDP-Lite statistics variables, whose meaning is as follows.
+
+   InDatagrams:     Total number of received datagrams (as in UDP).
+
+   InPartialCov:    Number of received datagrams with csum coverage < length.
+
+   NoPorts:         Number of packets received to an unknown port (as in UDP).
+                    These cases are counted separately (not as InErrors).
+
+   InErrors:        Number of erroneous UDP-Lite packets. Errors include:
+                      * internal socket queue receive errors
+                      * packet too short (less than 8 bytes or stated
+                        coverage length exceeds received length)
+                      * no socket available for ICMP error condition
+                      * xfrm4_policy_check returned error
+                      * application has specified larger min. coverage
+                        length than that of incoming packet (cf. below)
+                      * checksum coverage violated          (InBadCoverage)
+                      * bad checksum                        (InBadChecksum)
+
+   InBadCoverage:   Datagrams with invalid checksum coverage (also InErrors):
+                      * coverage length is less than the minimum 8
+                      * coverage length exceeds actual datagram length
+
+   InBadChecksum:   Datagrams with wrong checksum (also InErrors).
+
+   OutDatagrams:    Total number of sent datagrams.
+
+   OutPartialCov:   Number of sent datagrams  with csum coverage < length.
+
+  If a receiving application has specified a  minimum coverage length and
+  received a packet with a smaller coverage value than this, or if it has
+  specified full coverage (UDP mode) and received a partially covered packet,
+  this counts as error (under InErrors), and an error message is logged.
+
+
+
+  VI) OPEN ISSUES
+
+  At the University of Aberdeen (where this patch was developed), much work
+  has gone into making sure that the UDP-Lite v4 variant behaves according
+  to spec. We have been maintaining and updating a patch for the stable
+  kernel tree since 2.6.12.4 and have run extensive experiments to verify
+  the protocol behaviour. As a result, there was no time left to develop an
+  IPv6 extension with the same degree of testing.
+  Secondly, the statistics variables detailed in the previous section are
+  not standardized. A MIB for UDP-Lite does not (yet) exist. For a person
+  familiar with SNMP/ASN.1 it would be a trivial task to turn the above
+  variable definitions into a MIB, in the same manner as per e.g. RFC 2013.
+  Anyone interested in helping with these two issues should contact us at
+  <[email protected]>.
include/asm-mips/socket.h +2 -0
diff -Nurp  a/include/asm-mips/socket.h b/include/asm-mips/socket.h
@@ -80,6 +80,7 @@ To add: #define SO_REUSEPORT 0x0200	/* A
  *
  * @SOCK_DGRAM - datagram (conn.less) socket
  * @SOCK_STREAM - stream (connection) socket
+ * @SOCK_LDGRAM - UDP Lite (conn.less) datagram socket (see RFC 3828)
  * @SOCK_RAW - raw socket
  * @SOCK_RDM - reliably-delivered message
  * @SOCK_SEQPACKET - sequential packet socket
@@ -93,6 +94,7 @@ enum sock_type {
 	SOCK_RDM	= 4,
 	SOCK_SEQPACKET	= 5,
 	SOCK_DCCP	= 6,
+	SOCK_LDGRAM	= 7,
 	SOCK_PACKET	= 10,
 };
 
include/linux/in.h +1 -0
diff -Nurp  a/include/linux/in.h b/include/linux/in.h
@@ -44,6 +44,7 @@ enum {
 
   IPPROTO_COMP   = 108,                /* Compression Header protocol */
   IPPROTO_SCTP   = 132,		/* Stream Control Transport Protocol	*/
+  IPPROTO_UDPLITE = 136,	/* UDP-Lite Protocol (RFC 3828)	        */
 
   IPPROTO_RAW	 = 255,		/* Raw IP packets			*/
   IPPROTO_MAX
include/linux/net.h +9 -7
diff -Nurp  a/include/linux/net.h b/include/linux/net.h
@@ -67,6 +67,7 @@ typedef enum {
  * enum sock_type - Socket types
  * @SOCK_STREAM: stream (connection) socket
  * @SOCK_DGRAM: datagram (conn.less) socket
+ * @SOCK_LDGRAM: UDP Lite datagram  socket (see RFC 3828)
  * @SOCK_RAW: raw socket
  * @SOCK_RDM: reliably-delivered message
  * @SOCK_SEQPACKET: sequential packet socket
@@ -79,13 +80,14 @@ typedef enum {
  * overrides this enum for binary compat reasons.
  */
 enum sock_type {
-	SOCK_STREAM	= 1,
-	SOCK_DGRAM	= 2,
-	SOCK_RAW	= 3,
-	SOCK_RDM	= 4,
-	SOCK_SEQPACKET	= 5,
-	SOCK_DCCP	= 6,
-	SOCK_PACKET	= 10,
+	SOCK_STREAM	    =  1,
+	SOCK_DGRAM	    =  2,
+	SOCK_RAW	    =  3,
+	SOCK_RDM     	=  4,
+	SOCK_SEQPACKET	=  5,
+	SOCK_DCCP	    =  6,
+	SOCK_LDGRAM	    =  7,
+	SOCK_PACKET	    = 10,
 };
 
 #define SOCK_MAX (SOCK_PACKET + 1)
include/linux/skbuff.h +8 -7
diff -Nurp  a/include/linux/skbuff.h b/include/linux/skbuff.h
@@ -223,13 +223,14 @@ struct sk_buff {
 	struct net_device	*input_dev;
 
 	union {
-		struct tcphdr	*th;
-		struct udphdr	*uh;
-		struct icmphdr	*icmph;
-		struct igmphdr	*igmph;
-		struct iphdr	*ipiph;
-		struct ipv6hdr	*ipv6h;
-		unsigned char	*raw;
+		struct tcphdr	  *th;
+		struct udphdr	  *uh;
+		struct udplitehdr *ulh;                 /* UDP-Lite (RFC 3828) */
+		struct icmphdr	  *icmph;
+		struct igmphdr	  *igmph;
+		struct iphdr	  *ipiph;
+		struct ipv6hdr	  *ipv6h;
+		unsigned char	  *raw;
 	} h;
 
 	union {
include/linux/snmp.h +18 -0
diff -Nurp  a/include/linux/snmp.h b/include/linux/snmp.h
@@ -158,6 +158,24 @@ enum
 	__UDP_MIB_MAX
 };
 
+/*
+ *   UDP Lite (RFC 3828) runtime statistics.
+ *   A MIB does not exist yet, but these statistics are useful nevertheless.
+ */
+enum
+{
+	UDPLITE_MIB_NUM = 0,
+	UDPLITE_MIB_INDATAGRAMS,	        /* total received datagramns             */
+	UDPLITE_MIB_INDATAGRAMS_PARTIAL_CHECK,	/* rcvd datagrams with partial coverage  */
+	UDPLITE_MIB_NOPORTS,			/* rcvd datagrams with port errors       */
+	UDPLITE_MIB_INERRORS,			/* total erroneous rcvd datagrams        */
+	UDPLITE_MIB_INERRORS_CHECKSUM_COVERAGE,	/* checksum coverage errors              */
+	UDPLITE_MIB_INERRORS_CHECKSUMMING,      /* checksum itself did not qualify       */
+	UDPLITE_MIB_OUTDATAGRAMS,		/* total sent datagrams                  */
+	UDPLITE_MIB_OUTDATAGRAMS_PARTIAL_CHECK,	/* sent datagrams with partial coverage  */
+	__UDPLITE_MIB_MAX
+};
+
 /* sctp mib definitions */
 /*
  * draft-ietf-sigtran-sctp-mib-07.txt
include/linux/socket.h +1 -0
diff -Nurp  a/include/linux/socket.h b/include/linux/socket.h
@@ -264,6 +264,7 @@ struct ucred {
 #define SOL_IPV6	41
 #define SOL_ICMPV6	58
 #define SOL_SCTP	132
+#define SOL_UDPLITE	136     /* UDP-Lite (RFC 3828) */
 #define SOL_RAW		255
 #define SOL_IPX		256
 #define SOL_AX25	257
include/linux/udplite.h +89 -0

89 lines not on this page · raw message

include/net/snmp.h +7 -0
diff -Nurp  a/include/net/snmp.h b/include/net/snmp.h
@@ -100,6 +100,13 @@ struct udp_mib {
 	unsigned long	mibs[UDP_MIB_MAX];
 } __SNMP_MIB_ALIGN__;
 
+
+/* UDP Lite (RFC 3828) */
+#define UDPLITE_MIB_MAX	__UDPLITE_MIB_MAX
+struct udplite_mib {
+	unsigned long	mibs[UDPLITE_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
 /* SCTP */
 #define SCTP_MIB_MAX	__SCTP_MIB_MAX
 struct sctp_mib {
include/net/udplite.h +65 -0

65 lines not on this page · raw message

include/net/xfrm.h +2 -0
diff -Nurp  a/include/net/xfrm.h b/include/net/xfrm.h
@@ -501,6 +501,7 @@ u16 xfrm_flowi_sport(struct flowi *fl)
 	switch(fl->proto) {
 	case IPPROTO_TCP:
 	case IPPROTO_UDP:
+	case IPPROTO_UDPLITE:
 	case IPPROTO_SCTP:
 		port = fl->fl_ip_sport;
 		break;
@@ -521,6 +522,7 @@ u16 xfrm_flowi_dport(struct flowi *fl)
 	switch(fl->proto) {
 	case IPPROTO_TCP:
 	case IPPROTO_UDP:
+	case IPPROTO_UDPLITE:
 	case IPPROTO_SCTP:
 		port = fl->fl_ip_dport;
 		break;
net/Kconfig +1 -0
diff -Nurp  a/net/Kconfig b/net/Kconfig
@@ -164,6 +164,7 @@ endif
 
 source "net/dccp/Kconfig"
 source "net/sctp/Kconfig"
+source "net/udp_lite/Kconfig"
 source "net/tipc/Kconfig"
 source "net/atm/Kconfig"
 source "net/bridge/Kconfig"
net/Makefile +1 -0
diff -Nurp  a/net/Makefile b/net/Makefile
@@ -44,6 +44,7 @@ obj-$(CONFIG_ECONET)		+= econet/
 obj-$(CONFIG_VLAN_8021Q)	+= 8021q/
 obj-$(CONFIG_IP_DCCP)		+= dccp/
 obj-$(CONFIG_IP_SCTP)		+= sctp/
+obj-$(CONFIG_IP_UDPLITE)	+= udp_lite/
 obj-$(CONFIG_IEEE80211)		+= ieee80211/
 obj-$(CONFIG_TIPC)		+= tipc/
 
net/core/sock.c +6 -1
diff -Nurp  a/net/core/sock.c b/net/core/sock.c
@@ -426,7 +426,12 @@ set_rcvbuf:
 			break;
 
 	 	case SO_NO_CHECK:
-			sk->sk_no_check = valbool;
+			/* UDP-Lite (RFC 3828) mandates checksumming,
+			 * hence user must not enable this option.   */
+			if (sk->sk_protocol == IPPROTO_UDPLITE)
+				ret = -EOPNOTSUPP;
+			else
+				sk->sk_no_check = valbool;
 			break;
 
 		case SO_PRIORITY:
net/ipv4/af_inet.c +59 -5

124 lines not on this page · raw message

net/ipv4/proc.c +30 -2
diff -Nurp  a/net/ipv4/proc.c b/net/ipv4/proc.c
@@ -14,6 +14,10 @@
  *		Fred Baumgarten, <[email protected]>
  *		Erik Schoenfelder, <[email protected]>
  *
+ * Changes:
+ *		William Stanislaus: added support for UDP-Lite protocol (RFC 3828),
+ *		code maintained by Gerrit Renker <[email protected]>
+ *
  * Fixes:
  *		Alan Cox	:	UDP sockets show the rxqueue/txqueue
  *					using hint flag for the netinfo.
@@ -38,6 +42,7 @@
 #include <net/protocol.h>
 #include <net/tcp.h>
 #include <net/udp.h>
+#include <net/udplite.h>              /* UDP Lite (RFC 3828) */
 #include <linux/inetdevice.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
@@ -66,9 +71,10 @@ static int sockstat_seq_show(struct seq_
 		   tcp_death_row.tw_count, atomic_read(&tcp_sockets_allocated),
 		   atomic_read(&tcp_memory_allocated));
 	seq_printf(seq, "UDP: inuse %d\n", fold_prot_inuse(&udp_prot));
+	seq_printf(seq, "UDPLITE: inuse %d\n", fold_prot_inuse(&udplite_prot));
 	seq_printf(seq, "RAW: inuse %d\n", fold_prot_inuse(&raw_prot));
-	seq_printf(seq,  "FRAG: inuse %d memory %d\n", ip_frag_nqueues,
-		   atomic_read(&ip_frag_mem));
+	seq_printf(seq, "FRAG: inuse %d memory %d\n", ip_frag_nqueues,
+		             atomic_read(&ip_frag_mem));
 	return 0;
 }
 
@@ -176,6 +182,18 @@ static const struct snmp_mib snmp4_udp_l
 	SNMP_MIB_SENTINEL
 };
 
+static struct snmp_mib snmp4_udplite_list[] = {  /* UDP Lite ([email protected]) */
+	SNMP_MIB_ITEM("InDatagrams",   UDPLITE_MIB_INDATAGRAMS),
+	SNMP_MIB_ITEM("InPartialCov",  UDPLITE_MIB_INDATAGRAMS_PARTIAL_CHECK),
+	SNMP_MIB_ITEM("NoPorts",       UDPLITE_MIB_NOPORTS),
+	SNMP_MIB_ITEM("InErrors",      UDPLITE_MIB_INERRORS),
+	SNMP_MIB_ITEM("InBadChecksum", UDPLITE_MIB_INERRORS_CHECKSUMMING),
+	SNMP_MIB_ITEM("InBadCoverage", UDPLITE_MIB_INERRORS_CHECKSUM_COVERAGE),
+	SNMP_MIB_ITEM("OutDatagrams",  UDPLITE_MIB_OUTDATAGRAMS),
+	SNMP_MIB_ITEM("OutPartialCov", UDPLITE_MIB_OUTDATAGRAMS_PARTIAL_CHECK),
+	SNMP_MIB_SENTINEL
+};
+
 static const struct snmp_mib snmp4_net_list[] = {
 	SNMP_MIB_ITEM("SyncookiesSent", LINUX_MIB_SYNCOOKIESSENT),
 	SNMP_MIB_ITEM("SyncookiesRecv", LINUX_MIB_SYNCOOKIESRECV),
@@ -302,6 +320,16 @@ static int snmp_seq_show(struct seq_file
 			   fold_field((void **) udp_statistics, 
 				      snmp4_udp_list[i].entry));
 
+    seq_puts(seq, "\nUdpLite:");                           /* UDP Lite (RFC 3828) */
+	for (i = 0; snmp4_udplite_list[i].name != NULL; i++)
+		seq_printf(seq, " %s", snmp4_udplite_list[i].name);
+
+	seq_puts(seq, "\nUdpLite:");
+	for (i = 0; snmp4_udplite_list[i].name != NULL; i++)
+		seq_printf(seq, " %lu",
+			   fold_field((void **) udplite_statistics,
+				      snmp4_udplite_list[i].entry));
+
 	seq_putc(seq, '\n');
 	return 0;
 }
net/udp_lite/Kbuild +1 -0
diff -Nurp  a/net/udp_lite/Kbuild b/net/udp_lite/Kbuild
@@ -0,0 +1 @@
+obj-$(CONFIG_IP_UDPLITE) += udplitev4.o
net/udp_lite/Kconfig +20 -0
diff -Nurp  a/net/udp_lite/Kconfig b/net/udp_lite/Kconfig
@@ -0,0 +1,20 @@
+config IP_UDPLITE
+	bool "The UDP-Lite Protocol (EXPERIMENTAL)"
+	depends on INET && EXPERIMENTAL
+        default n
+	---help---
+	  The UDP Lite Protocol (RFC 3828, <http://tools.ietf.org/html/rfc3828>)
+
+	  UDP-Lite is a Standards-Track IETF transport protocol. It features a
+	  variable-length checksum, which allows partially damaged packets to be
+	  forwarded to media codecs, rather than being discarded due to invalid
+	  (UDP) checksum values. This can have advantages for the transport of
+	  multimedia (e.g. video/audio) over wireless networks.
+
+	  The socket API resembles that of UDP. Applications must indicate their
+	  wish to utilise the partial checksum coverage feature offered by UDP-
+	  Lite by setting a socket option.
+
+	  More information can be found in Documentation/networking/udp_lite.txt
+
+	  If in doubt, say N.
net/udp_lite/udplitev4.c +1730 -0

1,730 lines not on this page · raw message

#1 lore raw

In article <200606081150.34018@this-message-has-been-logged> (at Thu, 8 Jun 2006 11:50:33 +0100), Gerrit Renker <[email protected]> says:

Quoted 2 lines

Attached is an extension which adds RFC3828 - compliant UDP-Lite functionality to the IPv4 networking stack.

:

Quoted 7 lines
 net/core/sock.c                       |    7
 net/ipv4/af_inet.c                    |   64 +
 net/ipv4/proc.c                       |   32
 net/udp_lite/Kbuild                   |    1
 net/udp_lite/Kconfig                  |   20
 net/udp_lite/udplitev4.c              | 1730 ++++++++++++++++++++++++++++++++++
 19 files changed, 2296 insertions(+), 22 deletions(-)

Plase do the ipv6 side. Thank you.

BTW, is it possible to do merge or share codes among the following things?
- udp / udp-lite (=> net/ipv4, net/ipv6)
and/or
- udp-lite/ipv6 / udp-lite/ipv4 (=> net/udplite)

Regards,

Signature · 2 lines
YOSHIFUJI Hideaki @ USAGI Project  <[email protected]>
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA

A message that is not in the archive (sent off-list or not yet received): [email protected]

maintainer
#3 lore raw

From: Gerrit Renker <[email protected]>
Date: Thu, 8 Jun 2006 12:22:54 +0100

Quoted 2 lines

I am sorry, I don't at the moment have the time to port to v6 with the same degree of rigour.

You give the impression that you would just disappear from the face of the planet should your work actually be integrated into the kernel tree.

So I can only assume that you are posting this for people to play around with, and not for serious consideration of inclusion into the kernel tree.

We're trying to avoid this serious problem we have where a group or individual submits on a piece of code, works just hard enough to get it integrated into the tree, then disappears and does not stick around to support the inevitable ensuing bugs and problem reports. Such behavior is totally irresponsible, yet it happens quite a bit.

So if you can't be bothered to cook up IPV6 support, chances are you won't stick around to support your code if it went into the tree either.

#4 lore raw
In reply to Gerrit Renker

In article <200606081150.34018@this-message-has-been-logged> (at Thu, 8 Jun 2006 11:50:33 +0100), Gerrit Renker <[email protected]> says:

Documentation/networking/udp_lite.txt line 48

Quoted 2 lines
Documentation/networking/udp_lite.txt +2 -0
+  UDP-Lite introduces a new socket type, the SOCK_LDGRAM (note the L) for
+  lightweight, connection-less services. These are the socket options:

I disagree. It should be SOCK_DGRAM.

Signature · 2 lines
YOSHIFUJI Hideaki @ USAGI Project  <[email protected]>
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
#5 lore raw
In reply to Gerrit Renker

Ar Iau, 2006-06-08 am 11:50 +0100, ysgrifennodd Gerrit Renker:

Documentation/networking/udp_lite.txt line 48

Quoted 2 lines
Documentation/networking/udp_lite.txt +2 -0
+  UDP-Lite introduces a new socket type, the SOCK_LDGRAM (note the L) for
+  lightweight, connection-less services. These are the socket options:

This is not the intended use of the socket API when distinguishing between services. The socket() call has a protocol field that is usually unused and it exists precisely to disambiguate multiple protocols with the same generic behaviour but different properties.

	s = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDPLITE);

is probably the right way to do this, keeping 0 "default" as before meaning IPPROTO_UDP

#6 lore raw

In article <[email protected]> (at Thu, 08 Jun 2006 15:47:52 +0100), Alan Cox <[email protected]> says:

Quoted 3 lines

Ar Iau, 2006-06-08 am 11:50 +0100, ysgrifennodd Gerrit Renker:

Quoted 2 lines
Documentation/networking/udp_lite.txt +2 -0
+  UDP-Lite introduces a new socket type, the SOCK_LDGRAM (note the L) for
+  lightweight, connection-less services. These are the socket options:

:

Quoted 4 lines
	s = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDPLITE);

is probably the right way to do this, keeping 0 "default" as before meaning IPPROTO_UDP

I do think so, too.

--yoshfuji

#7 lore raw
In reply to Alan Cox

Quoting Alan Cox:

|  Ar Iau, 2006-06-08 am 11:50 +0100, ysgrifennodd Gerrit Renker:
|  > +  UDP-Lite introduces a new socket type, the SOCK_LDGRAM (note the L) for
|  > +  lightweight, connection-less services. These are the socket options:
|  
|  This is not the intended use of the socket API when distinguishing
|  between services. The socket() call has a protocol field that is usually
|  unused and it exists precisely to disambiguate multiple protocols with
|  the same generic behaviour but different properties.
|  
|  	s = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDPLITE);
|  
|  is probably the right way to do this, keeping 0 "default" as before
|  meaning IPPROTO_UDP

Understood. Please, anyone, disregard or un-apply the previous UDP-Lite patch. A revised patch will be prepared and posted as soon as testing permits.

maintainer
#8 lore raw

From: Gerrit Renker <[email protected]>
Date: Thu, 8 Jun 2006 17:03:54 +0100

Quoted 3 lines

Understood. Please, anyone, disregard or un-apply the previous UDP-Lite patch. A revised patch will be prepared and posted as soon as testing permits.

Nobody is going to integrate your patch anywhere, don't worry. You make it clear that once you toss this piece of code over the wall, you'll disappear.

#9 lore raw
Quoted 7 lines · David Miller
Quoted 3 lines

Understood. Please, anyone, disregard or un-apply the previous UDP-Lite patch. A revised patch will be prepared and posted as soon as testing permits.

Nobody is going to integrate your patch anywhere, don't worry. You make it clear that once you toss this piece of code over the wall, you'll disappear.

Having dealt with more than enough code thrown over the wall in recent times, I agree.

But, if someone well known & trusted wants to claim responsibility for the code once it's upstream, that might be a way forward (I think the Apache project has or had a policy like this).

- James

Signature · 2 lines
James Morris
<[email protected]>
#10 lore raw

Quoting James Morris:

|  On Thu, 8 Jun 2006, David Miller wrote:
|  
|  > > Understood. Please, anyone, disregard or un-apply the previous
|  > > UDP-Lite patch.  A revised patch will be prepared and posted as soon
|  > > as testing permits.
|  > 
|  > Nobody is going to integrate your patch anywhere, don't worry.
|  > You make it clear that once you toss this piece of code over
|  > the wall, you'll disappear.
|  
|  Having dealt with more than enough code thrown over the wall in recent 
|  times, I agree.

I understand the points of both of you well enough. But how come this is interpreted as saying I'd "toss this piece of code over the wall"? I can understand getting tired of cowboy coding jobs, but there is a misunderstanding here.

Of course do and will I maintain that code and every issue related it. I have been maintaining, improving, testing this code for 9 months. The protocol spec (RFC 3828) was developed at University of Aberdeen, and there is continuing research into UDP-Lite here, i.e. it is not a `dead' project. That is why I held back regarding the IPv6 port: I can ensure that this (IPv4) code is up to standard and to date, but am lacking the required additional time to implement the same for IPv6.
I am trying to contact people to help with the port, but for the moment I will take responsibility only for the IPv4 version.

And if there is someone well-known and respected' who is interested in taking this code over, I would only be happy for him/her to do this. But I won't simply disappear' :-)

maintainer
#11 lore raw

From: Gerrit Renker <[email protected]>
Date: Thu, 8 Jun 2006 21:09:33 +0100

Quoted 5 lines

That is why I held back regarding the IPv6 port: I can ensure that this (IPv4) code is up to standard and to date, but am lacking the required additional time to implement the same for IPv6. I am trying to contact people to help with the port, but for the moment I will take responsibility only for the IPv4 version.

It's not like an ipv6 port is such a big pile of work.

I'd say it would take you an afternoon, max.

You don't have to test it to the point where it is ISO9000 compliant, that's not what is being asked of you.

#12 lore raw

Quoting David Miller:

|  From: Gerrit Renker <[email protected]>
|  Date: Thu, 8 Jun 2006 21:09:33 +0100
|  
|  > That is why I held back regarding the IPv6 port:
<snip> 
|  
|  It's not like an ipv6 port is such a big pile of work.
|  

I see the point and will port to v6 (have asked colleages for help). Until then, I will keep an up-to-date (-mm) patch in the tarball

http://www.erg.abdn.ac.uk/users/gerrit/udp-lite/files/udplite_linux.tar.gz

This has applications as well. I would value any more input: the suggestion to use SOCK_DGRAM has already been integrated and proved a really good idea (much less to patch, cleaner code). Usually an update is there on the same day the new kernel comes out.
Thank you for your replies and comments, I will be back when the v6 side is ready.

#13 lore raw

In article <[email protected]> (at Fri, 9 Jun 2006 10:36:41 +0100), Gerrit Renker <[email protected]> says:

Quoted 1 line

Thank you for your replies and comments, I will be back when the v6 side is ready.

Please fix the following as well.

1. Put your code in net/ipv4, probably as udplite.c, and remove net/udp-lite/. Similarly, plasse put implementation as net/ipv6/udplite.c.
2. Eliminate any cosmetic changes (space, new-line, coding style etc.); minimize diffs between udp.c udplite.c

BTW, I cannot find descriptions about fragmentation of UDP-Lite in the spec. Is it yours?

Signature · 2 lines
YOSHIFUJI Hideaki @ USAGI Project  <[email protected]>
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA