6

Let's say there are two PCs, PC A and PC B. PC A wants to communicate with PC B, such as sending a message. I need to describe the arp packets for this task.

Known details:

PC A -> SW 1 -> Router -> SW 2 -> PC B

Host A and host B are in a different network

PC A : MAC Address a.a.a.a IP Address 1.1.1.1 Default gateway 4.4.4.4

PC B : MAC Address b.b.b.b IP Address 2.2.2.2 Default gateway 5.5.5.5

So, I wonder how the router would react to the arp packet. If PC A wants to send a message to PC B, it will first send an arp packet with its own MAC and IP addresses as source and PC B's IP address and zero value for the MAC address as destination.The ethernet packet would contain PC A's MAC and IP as source but then I don't know wheter the destination ip would be A's default gateway or it will be a broadcast like the MAC address? I believe that default configuration routers has the proxy arp disable. What would actually happen?

NetworkNewbie
  • 63
  • 1
  • 1
  • 4

3 Answers3

14

Your reasoning is the wrong way. TCP/IP handles the layers top down, not bottom up.

PC A will first do a lookup in the routing table and decide that the only way to reach PC B is via the router specified in that routing table.

If the MAC address of the router is unknown it will send an ARP request to figure out which MAC address corresponds to the gateway IP.

Then the frame (containing the IP packet) will be sent to the MAC address of the router which will do a lookup in its routing table to see on which interface PC B is connected or via which next hop it should be routed. Assuming PC B is connected to another interface of the router the router will do a lookup (and if needed an ARP request) to figure out the MAC address of PC B and then forward the frame.

Teun Vink
  • 17,433
  • 6
  • 46
  • 70
1

In simple terms,if PCB sits in different network PCA doesnt bother about PCB's physical address.

When PCA wants to sends data to PCB sitting in different network, PCA needs to know the mac of its gateway. If it doesnt know it will send arp for gateway's physical address.Once ARP is resolved for its gateway address, it will use Destination IP address of PCB and Destination Mac address of gateway's interface.

0

If in different networks then pc A will determine if pc B resides on the same subnet or not by doing a binary AND operation that compares its own address and subnet mask with that of the destination address.
If not within the same subnet then pc A will send the frame to its default gateway which is the router in this case, which will in turn send it onwards to the destination host if it has a determined path to that address.

The router will reply to the arp with the mac address of the gateway. The router will strip off the source mac address and replace it with its own before exiting the egress interface.

MattE
  • 2,097
  • 4
  • 24
  • 34