2

Hi I'm a newbie in Networking, still confused about some basic concepts. If given a picture below: enter image description here

My questions is:

Let's say node C wants to send a datagram to node A but node C doesn't know node A's MAC address. So node C passes an ARP query packet which contains MAC broadcast address FF-FF-FF-FF-FF-FF and node A's IP address. I know node A will return its MAC address when it receives the packet. But what happen if the LAN use private IP address? what will the router do when it receive the packet? since the router's other interface might connect to some other node or even another switch, will the router broadcast the packet to all its interfaces?

1
  • Sounds like this question is mainly asking about the difference between a switch and a router. I couldn't find an earlier question about that on this site. That question has however been asked and answered a few times on Super User.
    – kasperd
    Commented Aug 27, 2018 at 16:30

2 Answers 2

5

Let's say node C wants to send a datagram to node A but node C doesn't know node A's MAC address. So node C passes an ARP query packet which contains MAC broadcast address FF-FF-FF-FF-FF-FF and node A's IP address. I know node A will return its MAC address when it receives the packet.

This is a correct description of ARP for IPv4.

But what happen if the LAN use private IP address?

It doesn't matter what IP range the LAN uses as long as it forms one subnet.

what will the router do when it receive the packet?

When the (broadcast) ARP request doesn't ask for the router's LAN IP address the request is just dropped.

since the router's other interface might connect to some other node or even another switch, will the router broadcast the packet to all its interfaces?

No, a router does not forward L2 broadcasts that are used with ARP.

If node C wants to send an IP packet to a destination outside the LAN, its routing table tells it to pass the packet to the router as gateway. The packet is encapsulated by an L2 frame addressing the router's MAC. The router then receives the frame with the packet and forwards the latter according to its own routing table.

If the destination is local to the router, the router ARPs the destination IP and uses the discovered MAC for the Ethernet frame (assuming Ethernet is used). If the destination isn't local to the router it will use the next hop's MAC as local L2 destination in the frame.

2

The router is constantly "veryfing" the destination IP address of every packet that comes to each one of its interfaces.

If the destination address matches with any entry of the routing table then it forwards the packet to the corresponding interface.

The following picture shows the Routing table of each router in a network:

enter image description here

When the router "sees" an ARP packet, it checks the destination IP and does the following checklist:

  1. If the destination IP is the router itself, then it answers with an ARP reply sending its own MAC.

  2. If the destination IP belongs to the local network, then it ignores it.

  3. If the destination IP belongs to a external network that exists in the routing table, then the router replies with its own MAC address.

  4. Everything else is ignored.

1
  • I'll change it to "verifying"
    – jcbermu
    Commented Aug 27, 2018 at 12:50

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.