When I hear the accurate descriptions/interpretations on what the On-Link Gateway category as a result of viewing the routing table. It begs the question, isn't this a short-cut to identifying the connection as a layer 2 address? It no longer is a layer 3 if it is on the same local network. Keeping it at level 2 makes it not have to use IP addresses.
1 Answers
isn't this a short-cut to identifying the connection as a layer 2 address?
It is.
Yes, technically an IP stack could have a routing table that just has layer-2 gateway addresses. (I don't know of any systems which do this.)
However, you already have ARP (or similar) for resolving on-link hosts, so there's no reason not to use it for resolving on-link gateways as well. The routing table remains simpler if it has only layer-3 addresses – it doesn't need to worry about the layer-2 address having changed, it doesn't need to care about different kinds of layer-2 addressing, etc.
For example, if a routing table entry uses an IP address as a gateway, then it will remain completely identical whether it goes through Ethernet, FireWire, Infiniband, or Token Ring (all of which have different L2 address types). This can become especially important with "routing protocols" (such as OSPF) that are used to distribute routes across an entire network.
That being said, the fact that a gateway address is just a stand-in for a layer-2 address is sometimes used for interesting things, e.g. on Linux you can have an IPv4 route which uses an IPv6 address as the "gateway" (with kernel 5.2 or newer).
- 426,297
- 64
- 894
- 966