Default Gateway
- when two end system hosts attempt to communicate via IPv4,
- protocol compares the src and dst address in each packet against the netmask
- if the masked portions of the src and dst IP addresses match
- destination assumed to be reachable via local layer 2 network

- first 28 bits of the src and dst address are the same
- IP concludes the destination IPv4 address is on the same IP network or subnet
- tries to deliver packet locally
- destination assumed to be reachable via local layer 2 network
- if masked portion does not match
- IP assumes the packet must be routed to another IP network or subnet:

- when dst IPv4 address is on a different IP network or subnet
- host forwards packet to its default gateway
- is a router configured with a path to remote networks
- router determines what to do with the packet
- performs same comparison between the src and dst address and netmask
- router uses its routing table to determine which interface to forward to
- if not suitable path, router drops the packet
- informs host that it could not be delivered
- if packet dst is still another network, process repeats
- host forwards packet to its default gateway
- IP assumes the packet must be routed to another IP network or subnet:
- paths to other IP networks can be:
- manually configured in routing table
- learned by a dynamic routing protocol
- allow routers to share information about known networks and possible paths to them
- allows them to choose the best routes to any given destination
Info
Default gateway router’s interface IP can be any usable host ID.
- normally set to first or last usable host address