adding unit testing for packet encoding