Skip to main content

IP Routing

IP routing#

  • Happens at the Network layer
  • The IP packets specify the source and the destination IP addresses
  • Routers are the devices that connect LANs to the public internet
  • Each host in the LAN that is connected to the internet has an IPv4 address, IPv6 address, default gateway and DNS configured in it
  • Whenever a device needs to send data to another device with an IP that doesn’t belong to the LAN, it sends the request to the router which is also known as the default gateway and the router forwards the request along the path to the destination
  • The router swaps the source IP with it’s own before forwarding the request
  • The router has a route table which is necessary to identify the next router to which the request must be forwarded in order to reach the destination.

NAT (Network Address Translation)#

  • It is responsibility of the router to keep track of the request and the source IP of the devices in the LAN so that it can forward the response to the correct host
  • This service provided by the router is referred to as NAT