TCP connection passing
Subsystems (2)
Here's something creepy for Halloween: a dirty little hack that allows you to pass TCP endpoints across hosts, across reboots, etc.
http://www.almesberger.net/tcpcp/tcpcp-0.tar.gz
(Includes a patch for 2.5.45, a bit of user space, and plenty of documentation of its shortcomings. The patch is a bit deceptive:
in order to make timestamps work properly, more invasive changes are needed.)
I got the idea for this hack while listening to Fabio Olive Leite's talk about load-balancing at Linux-Kongress, but besides that, he's not to blame for it.
The implementation is a proof of concept, which is quite sloppy with timestamps, MSS, window, etc., and don't even look at what it does to congestion control ...
Anyway, it seems to work, and it's fun to play with.
- Werner
Signature · 3 lines
_________________________________________________________________________ / Werner Almesberger, Buenos Aires, Argentina [email protected] / /_http://www.almesberger.net/____________________________________________/
TCP connection passing, version 1
A little update:
http://www.almesberger.net/tcpcp/tcpcp-1.tar.gz
This one gets timestamps right, but needs to change a few things in the rest of TCP. I've also added a Web server demo application.
- Werner
----------------------------------- CHANGES -----------------------------------
Version 1 (31-OCT-2002)
-----------------------
- tcpcp_hooks now try to load the tcpcp module
- added ts_offset to struct tcp_opt and related structures, so that tcpcp can adjust local timestamps on a per-socket basis
- added app/sendcp, a simple Web server with connection passing
- /proc/sys/net/ipv4/sysctl_privileged was not created when using tcpcp as a module
Signature · 3 lines
_________________________________________________________________________ / Werner Almesberger, Buenos Aires, Argentina [email protected] / /_http://www.almesberger.net/____________________________________________/
TCP connection passing, version 2
Another update:
http://www.almesberger.net/tcpcp/tcpcp-2.tar.gz
This one fixes window, MSS, and buffer space handling. I've also added a bit of documentation describing how to use it properly.
- Werner
----------------------------------- CHANGES -----------------------------------
Version 2 (31-OCT-2002)
-----------------------
- removed 1000 "voodoo slack" term in __tcpcp_maxicisize's size estimate
- tcpcp.c:tcpcp_init now correctly identifies the version as the one of the ICI format, not as the one of tcpcp itself
- tcpcp.c:tcpcp_buffers checks send sequence numbers
- tcpcp.c:tcpcp_fixup adjusts receive buffer to advertized window
- tcpcp.c:tcpcp_fixup sets MSS clamp to value from ICI
- documented request_module race in tcpcp_hooks.c
- README and tcpcp.c: added discussion of usefulness of tcpcp_start
- added description of handover procedure in doc/README.HANDOVER
- minor cleanups here and there
Signature · 3 lines
_________________________________________________________________________ / Werner Almesberger, Buenos Aires, Argentina [email protected] / /_http://www.almesberger.net/____________________________________________/
TCP connection passing, version 3
Almost a whole day since the last update ! High time for something new:
http://www.almesberger.net/tcpcp/tcpcp-3.tar.gz
The main change this time is that restarting the connection is no longer done by setting TCP_ICI, but by setting the new socket option TCP_KICK. This avoids the "need to reconfigure firewall within RTT or performance may suffer" race for applications.
So this leaves mainly the difficult parts (OOO recovery and urgent data) to implement/fix.
- Werner
----------------------------------- CHANGES -----------------------------------
Version 3 (1-NOV-2002)
----------------------
- moved activation of dormant connection from TCP_ICI/tcpcp_create to new socket option TCP_KICK and API function tcpcp_kick
- tcpcp_getici now returns any errors pending in sk->err
- API: added tcpcp_set_dst to set the destination address/port
- added "install" and "uninstall" make targets
- libtcpcp is now a shared library
- dumpici: added option -V that prints version information
- API: tcpcp_set_cong now sets errno
- README.HANDOVER: documented single host case and added TCP_KICK
- described not preserving error queue as feature, not bug
- minor cleanup here and there
Signature · 3 lines
_________________________________________________________________________ / Werner Almesberger, Buenos Aires, Argentina [email protected] / /_http://www.almesberger.net/____________________________________________/
TCP connection passing, version 4
A minor update:
http://www.almesberger.net/tcpcp/tcpcp-4.tar.gz
The main changes are that TCP_KICK has turned into the slightly more general TCP_CP_FN option, and that I've written down a few thoughts on "real" checkpointing in doc/README.CHECKPOINTING
The funny thing is that, when I started writing, I suspected that checkpointing wouldn't really be possible, but then I realized how it might actually work (okay, with a few hacks, but ... ;-)
The patch is now relative to 2.5.47.
- Werner
----------------------------------- CHANGES -----------------------------------
Version 4 (15-NOV-2002)
-----------------------
- upgraded to the 2.5.47 kernel
- added doc/README.CHECKPOINTING with a few reflections on how tcpcp could be abused for "real" checkpointing, where the previous connection owner suddenly dies
- renamed TCP_KICK to TCP_CP_FN, and added a sub-function code in optval
- renamed tcpcp_kick to tcpcp_activate
Signature · 3 lines
_________________________________________________________________________ / Werner Almesberger, Buenos Aires, Argentina [email protected] / /_http://www.almesberger.net/____________________________________________/