Packet encoding/decoding system (Sean)