Modifed the Router handlePacket function to take a link as an argument.