0

I mean why not just:

  • a MAC address? It should eliminate the need in ARP requests asking for gateway address. Also it should eliminate the need in changing IP addresses in settings when gateway IP is changed.

  • an interface (such as ethernet port or wlan adapter)? It should eliminate the problem that MAC address of a gateway can also be changed, making the settings invalid. Of course it cannot be used with dumb hubs (and can be used with switches/routers/etc), but who uses them these days?

2
  • 2
    Why could it not be used with hubs ? What you are suggesting is flawed but it would work on hubs as well if you ignore all the obvious issues Dec 19 '19 at 10:57
  • Routers do not have default gateways, they have routing tables that determine where to send packets. One (or more) route in the the routing table may be a default route, but that is not a requirement.
    – Ron Maupin
    Dec 19 '19 at 18:33
7

why not just ... a MAC address?

A router might not use a MAC address on an interface - not all L2 protocols use MACs even though many do (mainly the IEEE ones like Ethernet or 802.11). Also, routers are used in network layer protocols which only have a very rough concept of data link layer topologies (if at all).

Also [MAC address] should eliminate the need in changing IP addresses in settings when gateway IP is changed.

When the gateway's MAC address changed (load balancing, redundant failover), all your routes would break. As it really is, a simple gARP updates all ARP caches around the network without any need to touch routing tables.

why not just ... an interface?

Interfaces can be point-to-point (like a simple serial interface) or point-to-multipoint (like with Ethernet or Wi-Fi). On a point-to-multipoint interface you can't simply send a packet, but you need to specify the recipient in the local network. That's where the gateway address is required.

Of course [interface as gateway] cannot be used with dumb hubs (and can be used with switches/routers/etc)

Switches do require a destination MAC address for forwarding, they cannot forward by IP address. Still, the local sender needs to be able to determine that MAC.

Generally, you can't/shouldn't attempt to mix addressing schemes between layers. It wouldn't work in your favor. The whole point of layering is to make each layer independent from the others so you're getting a modular system that has an extreme range of adaptability.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.