Implementation of the Packet class.