My home page
Back to my software experience page
Back to my portfolio

ChaosNET in Python

This Python code serves as a cross-platform replacement for Brad Parker's chaosd process, which supports the basic illusion of a ChaosNET ether implemented either over WinSock/TCP stream sockets on the localhost or UNIX-domain stream sockets. Further code provides generic interfaces for creating clients attached to these virtual ethers with increasing complexity.

One of those clients is a simple masquerading gateway, which echoes one client's packets to and from the Internet encapsulated in UDP. This allows for remote machines following Bjorn Victor's CHUDP protocol to be transparently linked to a virtual Chaos network on the local machine.

The eventual goal would be to implement a FILE protocol server completely asynchronously, either based on the asyncore framework shown here, or perhaps by migrating to Twisted.

Component files

Example files

Comments

This code is perhaps not very idiomatic Python. I have not settled on a framework for formal unit tests, and am not sure the best way to do so for such interactive programs. It does not provide much error-checking at all in the encoding and decoding of the underlying packets. Asyncore seems to be the red-headed stepchild of asynchronous Python network frameworks, so I will probably go with the crowd and port this to Twisted at some point.