Added receiving and replying of packets for testing