8

An ARP request is made to know the MAC address of the device that has some specific IP assigned. This way we will be able to know what MAC address we should set to send out IP packet.

If a device wants to send a packet to another device in an external network, it first looks at its default gateway's IP address, then it makes an ARP request to know the MAC address of the device that has the gateway's IP address assigned, and then sends the IP packet using that MAC address.

Let's say that we didn't have any default gateway ip address configured in the device that wants to send IP packets. Let's say the router didn't have any IP address assigned either. But the router has an entry in its routing table entry to redirect the packet that the device wants to send. Then...

  1. The device sends an ARP request asking which device has the IP address of the packet that it wants to send.
  2. Even though the router itself doesn't have that IP address assigned it should answer with its own MAC address anyways because it can redirect the IP packet to the correct destination.

I haven't made a proof of concept to see if the router would actually behave as I said or not, but I have understood that the router just won't answer to the ARP request in this case. Why though?

5
  • 8
    Apparently someone did do that. Btw it's called Proxy ARP.
    – Adrian
    Commented Nov 25 at 14:53
  • 2
    No, there is an IP address associated with that G0/0/0 interface. You are just seeing proxy ARP (a bad idea) in action. The interface has an IP address so that the ISP knows how to send packets to it. Yes, the default route only points to the interface instead of the ISP next hop address, but the router interface itself has an IP address from the ISP. The router interface for the hosts also has an IP address.
    – Ron Maupin
    Commented Nov 25 at 15:09
  • 2
    @Adrian You should post that as an answer.
    – Barmar
    Commented Nov 25 at 15:24
  • 1
    @Barmar Done.
    – Adrian
    Commented Nov 25 at 15:33
  • 1
    It's nice to see the next generation re-inventing proxy-arp. We don't use proxy-arp any more for far too many reasons to list. (but it is a valuable tool to understand for the one time in your 50 year networking career that it's the correct tool for the job.)
    – Ricky
    Commented Nov 25 at 22:05

5 Answers 5

8

Let's say the router didn't have any IP address assigned either

The router would not be an IP router for that router interface because it would not know about the network directly connected to it. A router not having an IP address for an interface means that the router cannot use that interface for IP. Putting an IP address (either IPv4 or IPv6) enables IP for that interface. Routers route packets between different networks, and a router that does not know how to reach a network will drop any packets destined for that network. The IP address on the router interface tells the router how to reach that network. You could, of course, have a router interface for a different network protocol, e.g. IPX or AppleTalk, that has no IP address, but that router interface would not route IP.

Proxy ARP (a bad idea) if configured on a router will let the router answer for a MAC address on a different network, but the router needs to know what the originating network is so that responses can be sent back to that network (remember that most transport or application-lay protocols are request/response).

6
  • 2
    "A router not having an IP address for an interface means that the router cannot use that interface for IP". As far as I know, the router's IP address is only used to answer ARP requests. If a network admin decided to configure the default gateway of all devices in a network using the router's MAC address instead of its IP address then the router wouldn't need its IP address since no ARP request would be made because everyone already knows the MAC address of the router. Why do you say then that the route cannot use that interface for IP? Am I misunderstanding something?
    – Adrian
    Commented Nov 25 at 17:39
  • 1
    "The IP address on the router interface tells the router how to reach that network" I thought it was the routing table of the router that told the router which network interface to use to reach such network? How exactly does the router use the network interface's IP address instead of its routing table to know how to reach that network?
    – Adrian
    Commented Nov 25 at 17:41
  • 1
    There are three ways a network gets into the routing table. The first way is directly connected networks, and the interface for the directly connected network needs an address to be able to determine the network on the interface. The address with a bitwise AND of the network mask gives the router the network on that interface. That network will then be in the routing table of the router.
    – Ron Maupin
    Commented Nov 25 at 17:59
  • 1
    @Adrian, the router also needs some IP address to use for sending ICMP error messages. But you're right, the L2 address would be enough for other hosts to send the router packets to route onward.
    – ilkkachu
    Commented Nov 26 at 17:06
  • 1
    I'm going to accept this answer because it is the one with most upvotes, but the explanation of why you need an IP assigned doesn't convince me. Check this post.
    – Adrian
    Commented Nov 26 at 22:54
9

OK, so you have these (theoretical) options:

  • The TCP/IP way:

    Any time I want to send a packet to a new IP not on the local network:

    • I lookup the IP of the default gateway (in the local routing table)
    • I lookup the MAC address of that default gateway (in the local ARP cache since it's the default gateway and I use that IP all the time)
    • I send my packet to that MAC address.

    Result:

    • Packets sent: 1.
    • Packets received: 0.
    • Latency before sending the packet: virtually 0.
    • Size of my ARP table: very small (only devices on my local network).
  • The Adrian way:

    Any time I want to send a packet to a new IP not on the local network:

    • I send an ARP request to know where to send my packet
    • I wait for the ARP response
    • I send my packet to that MAC address. This either requires buffering the packet until I get an ARP response, or relying on upper layers to retransmit.

    Result:

    • Packets sent: 2.
    • Packets received: 1.
    • Latency before sending the packet: RTT from device to router + processing time by router + possibly retransmit timeout.
    • Size of my ARP table: possibly very large (since every single destination IP would need an entry).

Option 1 is how TCP/IP works. Option 2 is what you are asking about. Why would anyone think option 2 is better?

Of course option 2 does not actually work on TCP/IP devices. It could possibly work if you set the local network IP to 0.0.0.0/0 (so that all IP packets are sent to the local network) and the router had proxy ARP enabled (for any IP, which I don't think would be possible on most devices).

8

As many have answered, the function to providing routing when an endstation is not aware of a router is called Proxy ARP. It used to be commonly enabled by routers, to provide service to misconfigured / underconfigured end stations. But Proxy ARP doesn't scale well--it causes every end stations to essentially create a static host route for every IP address it ever wants to connect to (in the form of their ARP caches). It probably also upsets security folks--we don't want that.

The other aspect you ask about is why the router needs an IP address in order to provide routing service. In general, a router needs to know what networks are locally connected to it. It needs this information so that, when attempting to deliver a packet, it can know when and if it should use the Layer 2 network service to deliver the frame, or if it should to a next hop route (whether static, learned, or last resort). This is just like any other IP processing node.

So you could invent some other way for a router to understand when a packet gets local delivery or is forwarded, one that doesn't require it having an IP address. But now you are creating a parallel but different behavior which, combined with the limits of Proxy ARP, is no better (and probably worse) than the current way it works.

Again, what routers do to decide where to forward a packet is no different than what non-routers do--it's just that non-routers usually only have two choices: deliver locally or forward to a gateway (router). A router may have several local networks, and several next-hop options. But at the lowest level, routers and non-routers have routing tables that work the same way. It would be weird (as in non-obvious, requiring higher cognitive load) if it were otherwise.

1
  • 2
    I remember from old public docs of Rutgers University's network that they deliberately used 0.0.0.0/0 proxy-ARP (in late 1980s) as a cheap form of gateway failover. Sure, these days it probably wouldn't scale well. Commented Nov 26 at 9:32
4

Let's say that we didn't have any default gateway ip address configured in the device that wants to send IP packets.

Without a route & gateway to the destination, a host can only drop the packet. There is no fall-back mode and generally, you route packets where you know they are right - it's not try and error.

Let's say the router didn't have any IP address assigned either.

A node without IP address isn't reachable. When you can't reach the gateway, the route isn't usable.

But the router has an entry in its routing table entry to redirect the packet that the device wants to send.

What you refer to sounds like proxy ARP - that is only used for workarounds and mostly only temporarily.

Consider the default route 0.0.0.0/0 that fits any IP address. You are suggesting that the router then answers to any ARP request? That's not how IP works.

Picture a network that has two routers attached, one for the Internet, the other for the corporate (large) network. Each router has a default route (ultimately leading to to the Internet) - which one should answer to an ARP request? From whom? By logic, the Internet router could try to apply the same logic and ARP for an Internet address instead of using its routing table. If the corporate router answers instead of the real uplink router, the packets goes the wrong direction. As a result, any non-trivial networks becomes either hard or even impossible to handle.

On the other hand, if a router has no IP address on one of its interfaces, how is it supposed to know when to answer to ARP requests on another interface, ie. which addresses are actually local to it when other routers proxy remote addresses?

At the end of the day, your proposal begins to sound much like bridging, not routing. It's impossible to scale bridging to the size of a global network.

6
  • 2
    "A node without IP address isn't reachable. When you can't reach the gateway, the route isn't usable." But the router IS reachable through its MAC address. It's just that it won't be able to answer ARP requests, but if the MAC address is already known then it shouldn't matter. The MAC address could be already known, for instance, when it's configured as the default gateway of the device (instead of the router IP address as is usually done). But that's only if the gateway was configured to begin with, otherwise then it's basically Proxy ARP.
    – Adrian
    Commented Nov 25 at 18:06
  • 1
    @Adrian IP doesn't care about MAC addresses - they're just a means to get a packet from one IP host to another. if the MAC address is already known - how? when it's configured as the default gateway - how do you configure a gateway on a network that is not MAC-based?
    – Zac67
    Commented Nov 25 at 19:38
  • 2
    @Zac67: One increasingly common method is IPv6 nexthop for IPv4 routes, which allows an IPv4 gateway to have no IPv4 addresses whatsoever (being resolvable to its MAC address via NDP rather than ARP). Another method (which I've heard one routing daemon use before the "v6 nexthop" option became available) is to define static ARP entries for dummy IPv4 addresses with the gateway's MAC and use those dummy addresses as route nexthops. I would be not surprised at all if some platform allowed raw MAC addresses as route nexthops. Commented Nov 26 at 9:20
  • 2
    (I tested the "dummy ARP entry" method yesterday when arguing with Ron in the other answer's comments, and it did indeed allow a Linux/RouterOS gateway that has no IPv4 addresses to forward IPv4 packets. For the "IPv6 nexthop" method, it's ip route add <dst4> via inet6 <gw6> on Linux, but I'm sure I've seen other platforms support it as well.) Commented Nov 26 at 9:26
  • "Without a route & gateway to the destination, a host can only drop the packet. There is no fall-back mode and generally, you route packets where you know they are right - it's not try and error." You can have a route without a gateway, so it's not try and error because I have a route configured. It's just that the route doesn't have a gateway.
    – Adrian
    Commented Nov 26 at 20:59
2

Apparently someone did do that. Btw it's called Proxy ARP.

The linked youtube video also illustrates why you shouldn't do that. It's basically because you'd fill the ARP cache with more and more entries, one for each IP address in the internet that you want to communicate with.

Also, you need an IP address assigned to have IP enabled. (See Ron Maupin's comments).


EDIT:

I struggled really hard to understand why exactly you need an IP address assigned to have IP enabled so I posted a different question to discuss every explanation given in the other answers. In case you want to check it out, here is the link.

9
  • 1
    This is different than your question. Proxy ARP is only part of it, but the router interfaces do have IP addresses, unlike your question of the router interfaces not having IP addresses. I did mention proxy ARP in my answer, as did the other answers. Proxy ARP is a bad idea, but it still requires IP addressing on the router. The router interfaces would not have IP enabled without IP addressing, so they would not route IP packets.
    – Ron Maupin
    Commented Nov 25 at 15:41
  • 2
    @RonMaupin Whether the router has an IP address of its own is irrelevant to proxy ARP. That may be necessary to manage the router, but not for this type of routing. Analogous to the IP address of a switch.
    – Barmar
    Commented Nov 25 at 15:48
  • 1
    @Barmar, unless an IP address is configured on an interface, the interface will not have IP enabled on the interface. In any case, the video has IP addressing configured on the interfaces, unlike the OP question, so it is not actually an answer to the question.
    – Ron Maupin
    Commented Nov 25 at 16:15
  • 3
    @RonMaupin: That's really not true. Unnumbered IP-capable interfaces do exist, both for point-to-point style interfaces and for Ethernet style interfaces. Commented Nov 25 at 17:17
  • 2
    @RonMaupin Within the Cisco products used in enterprise networks, or within IP routers in general? I'm very sure it's untrue for at least several kinds of IP routers in general, which just happen to not be Cisco routers, and although those happen to be off topic for this website, I don't think it's correct to pretend that such routers don't exist at all. (Even more so, given that OP's question is a hypothetical, it doesn't follow that such routers can't exist...) Commented Nov 25 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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