rename length to packet_size