Each packet travels with the IP address and port of its source and the IP address and port of its destination. Because each possesses all required addressing information, the individual packets for a given file may travel different routes through the Internet. No singled dedicated connection is needed. When all the packets have all arrived, they are reassembled into the original file. The essential device in this process is the router.
Routers reside on local networks.
They are connected to other networks and know how to direct traffic between networks. Routers function as gateways to the Internet. In order to get a packet from the source to the destination, routers look at the source and destination addresses in the packet. If they know how to get the packet closer to the destination address, they do so. If not, they pass it along to a possibly more informed router.