emulation of protocols using tcp