IPv4 Forwarding
- When a host attempts to send a packet via IPv4
- the protocol compares the source and destination IP address in the packet against the sending host’s subnet mask
- If the masked portions of the source and destination IP addresses match, then the destination interface is assumed to be on the same IP network or subnet
- E.g.,:
- the protocol compares the source and destination IP address in the packet against the sending host’s subnet mask
Example
- host will determine that the destination IPv4 address is on the same IP network (192.168.0.0/24) and try to deliver the packet locally
- On Ethernet, the host would use the address resolution protocol (ARP) to identify the MAC address associated with the destination IP address
- If the masked portion does not match, the host assumes that the packet must be routed to another IP network
- E.g.,
Example
- source host 192.168.0.100 identifies that the destination IPv4 address is on a different IP network (192.168.1.0/24)
- it forwards the packet to a router rather than trying to deliver it locally
- Most hosts are configured with a default gateway parameter
- is the IP address of a router interface that the host can use to forward packets to other networks
- default gateway must be in the same IP network as the host

