assert valid packet length