Re: [PATCH] sockreg2.4.5-05 inet[6]_create() register/unregister table
Thanks! I'm glad you like our code. This patch does allow you to override TCP with a new implementation for new connections and then back out safely to the old TCP later. I think the feature you are asking for (replace TCP for EXISTING connections) is quite dangerous. You COULD grub around in existing sock structures and replace the proto_ops, but that would not be enough. We are talking about a stateful protocol here--your "TCP2" module would have to safely extract the state of the existing TCP connections and replace the control functions all as an atomic operation...and then undo that at the end. What was the application you had in mind? The applications we have been playing with do not suffer greatly from having to start new connections. Matt D. Robinson writes: > Is there any way to add in the capability to _replace_ TCP with > your own, so you can use your own layer? I guess you could > inet_unregister_protosw() of the IPPROTO_TCP, but does that > address outstanding connections? I don't believe so ... > > It would be nice if your patch offered that capability. Nice > work, BTW -- not enough compliments go out on lkml these days. :) > > --Matt > > "La Monte H.P. Yarroll" wrote: > > > > Here is the register/unregister inet[6]_create() table patch revised > > for 2.4.5. We thank Dave Miller for his helpful feedback on earlier > > versions of this patch. > > > > DESCRIPTION > > This patch adds a mechanism for registering new IP transport protocols > > for the socket() system call. It replaces the hard-coded switch > > tables in inet_create() and inet6_create() with explicit data > > structures. > > > > The new calls are: > > voidinet_register_protosw(struct inet_protosw *p); > > voidinet_unregister_protosw(struct inet_protosw *p); > > voidinet6_register_protosw(struct inet_protosw *p); > > voidinet6_unregister_protosw(struct inet_protosw *p); > > > > This is the first of a series of proposed changes to support IP > > transport modules. > > > > MOTIVATION > > As part of the effort to create the Linux Kernel implementation of > > SCTP , we seek to make it > > possible to load a new IP transport protocol as a kernel module. > > > > It is already possible to register new address families. It is even > > possible to register new transport protocols with IP. However, in > > order to be able to open a socket with a new transport protocol, you > > must replace the whole AF_INET address family. > > > > In addition to SCTP, there are other protocols which could find it > > useful to be in a kernel module. For example, TCP extensions like TCP > > framing and TCP over satellite, multicast protocols, and RTP/ROHC > > (robust header compression). In general, support for IP transport > > modules makes transport layer experimentation easier. > > > > CHANGES SINCE sockreg2.4.3-04 > > We noticed that inet6_protocol_base went away in 2.4.5, so we changed > > our v6 initialization to parallel the inet6_protocol initialization. > > We now call inet6_register_protosw() from *v6_init() instead of having > > a static array of struct protosw's. Since other protocols depend on > > raw sockets (e.g. ICMP, IGMP, NDISC) we still register rawv6_protosw > > in inet6_init(). > > > > piggy (La Monte H.P. Yarroll) > > Karl O. Knutson > > > > PATCH FOLLOWS > > diff -u -r linux-2.4.5/include/asm-alpha/socket.h linux/include/asm-alpha/socket.h > > --- linux-2.4.5/include/asm-alpha/socket.h Sat Feb 3 13:26:44 2001 > > +++ linux/include/asm-alpha/socket.hMon Jun 4 11:11:30 2001 > > @@ -66,6 +66,7 @@ > > /* level. For writing rarp and */ > > /* other similar things on the */ > > /* user level. */ > > +#defineSOCK_MAX(SOCK_PACKET+1) > > #endif > > > > #endif /* _ASM_SOCKET_H */ > > diff -u -r linux-2.4.5/include/asm-arm/socket.h linux/include/asm-arm/socket.h > > --- linux-2.4.5/include/asm-arm/socket.hSat Feb 3 13:26:44 2001 > > +++ linux/include/asm-arm/socket.h Mon Jun 4 11:11:30 2001 > > @@ -58,6 +58,7 @@ > > /* level. For writing rarp and */ > > /* other similar things on the */ > > /* user level. */ > > +#defineSOCK_MAX(SOCK_PACKET+
Re: [PATCH] sockreg2.4.5-05 inet[6]_create() register/unregister table
Thanks! I'm glad you like our code. This patch does allow you to override TCP with a new implementation for new connections and then back out safely to the old TCP later. I think the feature you are asking for (replace TCP for EXISTING connections) is quite dangerous. You COULD grub around in existing sock structures and replace the proto_ops, but that would not be enough. We are talking about a stateful protocol here--your TCP2 module would have to safely extract the state of the existing TCP connections and replace the control functions all as an atomic operation...and then undo that at the end. What was the application you had in mind? The applications we have been playing with do not suffer greatly from having to start new connections. Matt D. Robinson writes: Is there any way to add in the capability to _replace_ TCP with your own, so you can use your own layer? I guess you could inet_unregister_protosw() of the IPPROTO_TCP, but does that address outstanding connections? I don't believe so ... It would be nice if your patch offered that capability. Nice work, BTW -- not enough compliments go out on lkml these days. :) --Matt La Monte H.P. Yarroll wrote: Here is the register/unregister inet[6]_create() table patch revised for 2.4.5. We thank Dave Miller for his helpful feedback on earlier versions of this patch. DESCRIPTION This patch adds a mechanism for registering new IP transport protocols for the socket() system call. It replaces the hard-coded switch tables in inet_create() and inet6_create() with explicit data structures. The new calls are: voidinet_register_protosw(struct inet_protosw *p); voidinet_unregister_protosw(struct inet_protosw *p); voidinet6_register_protosw(struct inet_protosw *p); voidinet6_unregister_protosw(struct inet_protosw *p); This is the first of a series of proposed changes to support IP transport modules. MOTIVATION As part of the effort to create the Linux Kernel implementation of SCTP www.sourceforge.net/projects/lksctp, we seek to make it possible to load a new IP transport protocol as a kernel module. It is already possible to register new address families. It is even possible to register new transport protocols with IP. However, in order to be able to open a socket with a new transport protocol, you must replace the whole AF_INET address family. In addition to SCTP, there are other protocols which could find it useful to be in a kernel module. For example, TCP extensions like TCP framing and TCP over satellite, multicast protocols, and RTP/ROHC (robust header compression). In general, support for IP transport modules makes transport layer experimentation easier. CHANGES SINCE sockreg2.4.3-04 We noticed that inet6_protocol_base went away in 2.4.5, so we changed our v6 initialization to parallel the inet6_protocol initialization. We now call inet6_register_protosw() from *v6_init() instead of having a static array of struct protosw's. Since other protocols depend on raw sockets (e.g. ICMP, IGMP, NDISC) we still register rawv6_protosw in inet6_init(). piggy (La Monte H.P. Yarroll) Karl O. Knutson PATCH FOLLOWS diff -u -r linux-2.4.5/include/asm-alpha/socket.h linux/include/asm-alpha/socket.h --- linux-2.4.5/include/asm-alpha/socket.h Sat Feb 3 13:26:44 2001 +++ linux/include/asm-alpha/socket.hMon Jun 4 11:11:30 2001 @@ -66,6 +66,7 @@ /* level. For writing rarp and */ /* other similar things on the */ /* user level. */ +#defineSOCK_MAX(SOCK_PACKET+1) #endif #endif /* _ASM_SOCKET_H */ diff -u -r linux-2.4.5/include/asm-arm/socket.h linux/include/asm-arm/socket.h --- linux-2.4.5/include/asm-arm/socket.hSat Feb 3 13:26:44 2001 +++ linux/include/asm-arm/socket.h Mon Jun 4 11:11:30 2001 @@ -58,6 +58,7 @@ /* level. For writing rarp and */ /* other similar things on the */ /* user level. */ +#defineSOCK_MAX(SOCK_PACKET+1) #endif #endif /* _ASM_SOCKET_H */ diff -u -r linux-2.4.5/include/asm-cris/socket.h linux/include/asm-cris/socket.h --- linux-2.4.5/include/asm-cris/socket.h Fri Apr 6 12:51:19 2001 +++ linux/include/asm-cris/socket.h Mon Jun 4 11:11:30 2001 @@ -59,6 +59,7 @@ /* level. For writing rarp and */ /* other similar things on the */ /* user level. */ +#defineSOCK_MAX
Temporary home for sctp.refcode.org and sctp.chicago.il.us
Due to the collapse of Northpoint, both sctp.refcode.org and sctp.chicago.il.us have been down for more than a week. Many of you have been asking about the web sites because of my talk at the Linux 2.5 Summit. I've found a temporary home for both sites--they'll probably be there for a month or so. The temporary locations are: www.cs.uchicago.edu/~piggy/sctp_refcode www.cs.uchicago.edu/~piggy/sctp_chicago_il_us Some of the links are broken, but you CAN download source for both distributions. I'll clean it up a bit after the Bakeoff (say early May)... - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Temporary home for sctp.refcode.org and sctp.chicago.il.us
Due to the collapse of Northpoint, both sctp.refcode.org and sctp.chicago.il.us have been down for more than a week. Many of you have been asking about the web sites because of my talk at the Linux 2.5 Summit. I've found a temporary home for both sites--they'll probably be there for a month or so. The temporary locations are: www.cs.uchicago.edu/~piggy/sctp_refcode www.cs.uchicago.edu/~piggy/sctp_chicago_il_us Some of the links are broken, but you CAN download source for both distributions. I'll clean it up a bit after the Bakeoff (say early May)... - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/