[Twisted-Python] suggestions for improvement in Twisted APIs

Miika Komu mkomu at cs.hut.fi
Sat May 4 07:28:20 EDT 2013


Howdy,

we investigated the networking APIs of Twisted (10.2) and published our
findings in Ottawa Linux Symposium 2012:

http://nw.dreamhosters.com/ols/ols2012/ols2012-komu.pdf

We propose two types of improvements to the framework described in full
detail in section 4.3.1 of the publication. First, we suggest security
bug fixes. Second, we suggest improvements that can improve either the
user experience (i.e. by improving latency in IPv6 environments) or
developers (after all, frameworks are a conveniency for the developers).
The suggestions for improvements are briefly summarized below.

Security issues
---------------
* R1.3:  IPv6-mapped addresses should not be present on the wire for
security reasons.
* R3.2: Server-side multihoming for UDP does not work properly. The
framework should use SO_BINDTODEVICE option or sendmsg()/recvmsg()
interfaces in a proper way.
* (R5.3): The framework does not initialize the SSL/TLS implementation
automatically

Suggested improvements (for better end-user or developer experience)
--------------------------------------------------------------------
* (R1.1): The framework does not support symbolic host names in its
APIs, i.e., does not hide the details of hostname-to-address resolution
from the application
* R1.2: The details of IPv6 are not abstracted away from the application
* R2.1: The framework does not implement DNS look ups with
getaddrinfo(). This is important for IPv6 source address selection
* R2.2: The framework does not support parallel DNS look ups over IPv4
and IPv6 to optimize latency
* R3.3: The framework does not support parallel connect() over IPv4 and
IPv6 to minimize the latency for connection set-up
* (R4.1): TCP and UDP are not easily interchangeable

Please refer to section 4.3.4 in the publication for a more elaborate
discussion of the improvements.



More information about the Twisted-Python mailing list