Implementation of simple low level protocols using python