# Router
Routers are [[OSI Layer 3 - The Network Layer|network layer devices]] which are in charge of routing traffic between different networks in such a way as to minimize the number of hops. In the IP world, a network is defined as a set of IP addresses that belong to the same subnet.
![[Network Foundations - Components of a Network#^gzvl7j]]
Routers are also responsible for [[NAT|Network Address Translation]] and enforcing traffic rules through the use of a firewall.
Once a router receives a packet it discards the layer 2 header from it and replaces it with a new header that contains the MAC address of the next hop. It uses its routing table to decide what this next hop will be.