I have a question relating to switching and routing. I'm going to simplify the actual IP addresses to make it simple to follow. Also, please consider the scope of my question around the typical router doing L3, and a typical switch doing L2 (e.g., no special device such as an L3 switch).
Take the following scenario:
Host A in network 1.x needs to communicate to Host B on network 2.x. In between Host A and Host B is a switch on the 1.x network (call it Switch A) that Host A connects to, a Router, and another switch on the 2.x network that Host B connects to. The router is configured to route between the 1.x and 2.x networks through two different interfaces (as would be expected on a router!); Switch A and Switch B are connected to their respective interfaces on this router.
One of my colleagues contends the following:
The router maintains a "master" ARP table and knows about all MAC addresses connected to it through every interface, even if those hosts are connected through X number of downstream switches. (point of contention #1). Additionally, my colleague contends the router will change the destination MAC address in the L2 header (frame) to the MAC address of Host B, will forward the packet to Switch B, and Switch B essentially does nothing but forward onto the target MAC already indicated in the packet (actually frame at that point).
I contend the following:
The router deals with Layer 3 only, and only cares about what interfaces connect to which networks. Hence, it knows nothing about MAC addresses of destination hosts connected to it (beyond *maybe* the MAC addresses of direct attached devices, typically switches - even that I'm not convinced, though). The router maintains a routing table only, and simply reads the destination IP in the L3 header, determines which interface is configured for that network, and sends it out that interface. It is the job of Switch B to determine the MAC address of the destination host via a lookup in it's own ARP table, and the switch will subsequently modify the L2 header with the destination host MAC address and send the request to that MAC (Host B).
If a router was to truly know about all destination MAC addresses, it would simply get overloaded; the ARP table would be huge. It solely relies on a routing table, and that's it; the router lets the switch massage the L2 headers and deal with the IP<-->MAC address mapping via each switch's own independent ARP table.
To summarize my questions:
1. Does a router maintain any ARP tables whatsoever?
2. Does a router know anything about MAC addresses, even directly connected devices, such as directly connected switches?
3. Does a router ever manipulate the L2 header? Or is this a job left solely for the switch?
Now for the bonus questions:
4. How does this change on a L3 switch?
5. If L3 switches can do both routing + switching, why are routers and switches separate? If there's a "one device can do both", why are networks still employing separate devices, one for routing, and one for switching? Is it solely for bandwidth purposes, such as the ASIC technology is tuned for higher performance with the single-purpose devices? Or are there other reasons?
I'd love to hear from anyone that can help refute/confirm my colleagues stance.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!