Router.
Router Determines path of travel for a datagram in TCP/IP.
A router is a networking device that forwards data packets between computer networks. Routers perform the traffic directing functions on the Internet. ... A packet is typically forwarded from one router to another router through the networks that constitute an internetwork until it reaches its destination node.
A router is an electronic device and/or software that connects at least two networks and forwards packets among them according to the information in the packet headers and routing tables. Routers are fundamental to the operation of the Internet and other complex networks (such as enterprise-wide networks).
Your workstation will then create a packet, stamp it with the destination IP address, and forward the packet to the network gateway. In many cases this gateway is a router. Routers are devices used to interconnect networks. Their job is to figure out how to move packets from one network to another.
Once the router receives the packet, the packet would be transferred to it data link layer and then IP where the router determines the next hop for the packet based on the forwarding table. It modifies the source and destination MAC addresses and reduce the TTL by 1. The packet then goes to the next hop.