add packet to network and reverse functions