Module 12: Gateways to Other Networks
Network Boundaries
In a network, each host must use a router to communicate with other networks. The IPv4 address of the router interface connected to the host’s network is called the default gateway address. This address can be:
- Statically configured: Manually set by the network administrator on the host.
- Dynamically assigned: Received automatically via DHCP.
For most home and small business networks, the wireless router acts as a DHCP server for local hosts. These hosts, connected either by Ethernet cable or wirelessly, are considered part of the internal network (or inside network).
When connected to the ISP, the wireless router functions as a DHCP client, obtaining an external IPv4 address for its internet-facing interface. This address, usually public and internet-routable, is assigned by the ISP and enables internet access for the hosts on the internal network. The wireless router serves as the boundary between the local internal network and the external internet.
NAT Operation
The wireless router plays a crucial role in translating internal IPv4 addresses to external ones using Network Address Translation (NAT). This process ensures efficient use of IPv4 addresses and provides privacy for internal network hosts.
-
Public vs. Private IPv4 Addresses:
- The router receives a public IPv4 address from the ISP, which allows it to send and receive packets on the internet.
- For internal hosts, the router assigns private IPv4 addresses that are not routable on the internet.
-
How NAT Works:
- When an internal host communicates with an external network (e.g., the internet), the private source IPv4 address in the outgoing packet is replaced by the router’s public IPv4 address.
- For incoming packets, the router reverses the process, replacing the public destination address with the private IPv4 address of the host.
-
Packet Translation:
- Outgoing Packets:
- The router translates the source IPv4 address of packets from internal hosts to its own public IPv4 address.
- Incoming Packets:
- The router translates the destination IPv4 address back to the private IPv4 address of the intended internal host.
- Outgoing Packets:
-
Efficiency:
- Using NAT, the router can allow many internal hosts to share the same public IPv4 address.
- Only packets destined for other networks need to be translated. Packets within the internal network are not affected by NAT.