early work on packet encoding and decoding