[Python-ideas] TCP Fast Open protocol

Federico Reghenzani federico.dev at reghe.net
Thu Jan 10 21:44:54 CET 2013


Hi all,

I'm new in Python development. I'm interesting in the new TCP Fast Open
protocol (http://research.google.com/pubs/pub37517.html). This protocol is
implemented in linux kernel 3.6 for client and 3.7 for server, and in
python changeset 5435a9278028 are defined the related constants. This TCP
change is an important optimization, in particular for http, and it is
completely backward compatible: even if a client or a server doesn't
support TFO, the connection proceed with normal procedure.

I think can be useful an implementation in socketserver module: an
attribute "allow_tcp_fast_open" that automatically set before listening the
correct socket option (another attribute is necessary to choose the queue
size). Similar implementation can be done in http modules.

The default value of this attribute may be "True" (according to its
backward compatibility), but new versions of glibc might expose
TCP_FASTOPEN costant even if the kernel does not support it (so use hasattr
to check if the constant exists don't guarantee that TFO is supported by
kernel). Maybe more complex code can resolve this problem, but I don't know
how do that (maybe catching exception or checking kernel version?)

I attached the simple patch for socketserver (and doc), let me know what
you think!


Federico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130110/4147933e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tfo.patch
Type: application/octet-stream
Size: 2079 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130110/4147933e/attachment.obj>


More information about the Python-ideas mailing list