Let's say we have the following configuration.
WAN - Router -------------------- Switch --------- Client
| |
Multiple switches connected to router |
Multiple Clients connected to each switch
When the router receives a packet, then the router would have to lookup its ARP table to find the appropriate MAC that corresponds to the IP address to create the frame to send off to the switch.
However, let's assume among the many switches there is a switch, let's call it S1
, that is only connected to clients with IPs in range 123.123.123.0/24. This would mean that we can set up a routing rule at the router to route all traffic in range of 123.123.123.0/24 to be sent to the interface that leads to S1
.
We can see that when routing, the router wouldn't need a routing table of every client. However, the ARP table would need a table of every client. That seems very inefficient to me. Is this really how it works? Wouldn't it make more sense for the Switch to be able to have its own ARP table so that you only need to look up a subset of clients?
To me, it would make more sense for the router here not to build a frame and send the packet that lacks L2 info to the switch, and then the switch builds a frame if the frame is incomplete. I know that switches operating in L2 does not want to look at the IP addresses, but I don't understand why it's designed that way.