In the Comptia Network+ All in One, it is said that most home routers have a switch built into them. It is also said that the first thing the router does is strip off any layer two information present in the Data Frame. My question is that, if I am using a router with a LAN and I send a Data Frame to a machine in the same LAN, I can get the MAC address from my ARP table (if I already have it, that is). But this specific aspect of the router makes it inefficient according to me in some sense as it has to again see the IP address and send an ARP request to the in built switch through the LAN facing interface.
Does this imply that all Data Frames sent to the router are necessarily addressed with the MAC address of the Router only, with the IP address of the destination as the only piece of information about the target machine, as using the information in the ARP table does not make sense if what the router does at the very beginning is strip off layer 2 information.
2 Answers
You are confusing a couple of things.
What you need to understand is that any frames on the LAN are sent directly from host-to-host, not passing through the router. Host A sending a frame to Host B on the same ethernet network will address the frame with the MAC address of Host B.
Frames containing packets destined for a different network are addressed to the router. The router strips off the frame, switches the packet to the next interface, and builds a new frame for the network on the next interface. Not all layer-2 protocols use MAC addresses. For example, it is common to have ethernet or Wi-Fi on a LAN, but the next interface in a router uses PPPoA. PPP frames do not use addressing because there are only two endpoints, and the ATM part of that uses VPI/VCI for addressing, not MAC addresses.
-
But according to the book, most routers have a switch built into them, and the machines on a LAN can connect directly to it. So is it if I have to send a Data Frame I'll send it to the router only, isn't it ? Commented Jul 8, 2020 at 16:32
-
1"most routers have a switch built into them" That is for consumer-grade devices which are off-topic here. In any case, the switch is actually separate, even though it is in the same box, and the frames do not pass through the router. Hosts can tell if a packet is destined for a different network, and they address the frames for the destination host for the same network, but address the frames for the router for a different network. Switches are transparent devices that do nothing to the frame.– Ron Maupin ♦Commented Jul 8, 2020 at 16:35
-
1The book is talking about consumer-grade devices that have both a router and a switch in the same box. these devices are common for home use, but rarely used in commercial networks (presumably the ones you're planning to work on). Commented Jul 8, 2020 at 16:35
When a host communicate with another host within the same layer 2 network, the communication is made directly between the 2 hosts and the router is not involved.
The router will only received, thus process, frames where the destination mac address is its own, or broadcast frames.
This concern frames that should be forwarded to another layer 2 LAN, or frames where the final recipient is the router itself (for router management or routing protocols).