Troubleshooting IP connectivity
BennyTheMan
Member Posts: 76 ■■■□□□□□□□
in CCNA & CCENT
I am reading ch 18 of Todd Lammle's book (Troubleshooting IP Network Conn.) and am coming across something I don't understand. It is talking about how a host sends out a packet and says "If it's determined to be a local request, IP just broadcasts a frame out on the local network looking for the local host using an ARP request to the default gateway to discover the MAC address of the router."
I am a bit confused because if the host is configured with the IP address of the default gateway, why would it need to get the MAC address of the default gateway. I remember this related to ARP requests, but I'm still a little unclear on all of this. To me it seems like the process should be quite simple, but it appears unnecessarily complicated.
Any help appreciated.
Thanks,
Benny
I am a bit confused because if the host is configured with the IP address of the default gateway, why would it need to get the MAC address of the default gateway. I remember this related to ARP requests, but I'm still a little unclear on all of this. To me it seems like the process should be quite simple, but it appears unnecessarily complicated.
Any help appreciated.
Thanks,
Benny
Comments
-
clarson Member Posts: 903 ■■■■□□□□□□switches use the mac address to determine where to send a frame. Switches don't care what the ip address is.
So, if the host doesn't know what the mac address is, it will use arp to get it. Then use the router's mac address to send the frame to the router through the switch.
Without all the context, it is a bit confusing about the "if it's determined to be local request" and why it is sending traffic to a router. If it is just a local host on the same subnet, the host should be sending an arp to the other local host to get it's mac address and not that of the router. -
networker050184 Mod Posts: 11,962 ModThe host is configured with the gateway IP yes. How does it know what destination MAC to put in the frame though?An expert is a man who has made all the mistakes which can be made.
-
GSXR750K2 Member Posts: 323 ■■■■□□□□□□On a LAN, Layer 2 rules. As clarson explained, switches use the source MAC of a frame to build their tables so they can have a Layer 2 picture of where everything is. Layer 2 doesn't cross a network boundary, so if you wanted to talk to a device that is not local (on the same LAN), then the IP address will come into play.
Think of MAC addresses as apartment numbers in a building, and the building as LAN. If you want to knock on a door in the same building (same LAN) there's not point in going outside, you just go the apartment (MAC). If you want to knock on someone's door in another building, you have to leave your building (LAN) and get routed to the other building. Once inside the new building (different LAN) you will go to the person's apartment (MAC address) to knock on the door.
Not 100% accurate, but hopefully that sheds some light on how the whole shebang works. -
james43026 Member Posts: 303 ■■□□□□□□□□I'm going to break this down a bit.
"If it's determined to be a local request, IP just broadcasts a frame out on the local network looking for the local host using an ARP request to the default gateway to discover the MAC address of the router."
So what does this mean? This means if a client wants to send information, it must first determine if it's destination is on the same subnet as the sending client, if it determines that the destination is another subnet, then the sending client knows that it must send traffic to it's default gateway. The next step is for the sending client to obtain the MAC address of the default gateway by sending out an ARP broadcast, the default gateway responds with it's MAC address. The sending client now constructs a frame that has a destination MAC of the default gateway, but the IP destination is the IP address of the true destination. With ethernet you always need a MAC address for the source and destination. Remember MAC address are required for any layer 2 device like a switch to make a switching decision, as a layer 2 switch doesn't look at IP addresses.
-
volfkhat Member Posts: 1,075 ■■■■■■■■□□Think of MAC addresses as apartment numbers in a building, and the building as LAN. If you want to knock on a door in the same building (same LAN) there's not point in going outside, you just go the apartment (MAC). If you want to knock on someone's door in another building, you have to leave your building (LAN) and get routed to the other building. Once inside the new building (different LAN) you will go to the person's apartment (MAC address) to knock on the door.
Awesome explanation! -
GSXR750K2 Member Posts: 323 ■■■■□□□□□□Awesome explanation!
Glad you like it. I've helped some friends with CCNA studies so I've come up with some helpful ways to get things across.
The apartment analogy is more suited for explaining things like internal/external IP ranges and NAT, but it can be bent a little to relate other things. james did a better job of explaining the OP's specific scenario.