naive packet encoder