I’m wondering if I have a computer in subnet A with IP address 192.168.123.1
, and a computer with IP address 192.168.124.1
in a different subnet.
Both networks are connected with a router. If I want now to send a package from compputer A to computer B, I’ll have to use ARP to get their MAC address to send the frame (supposing ARP cache is empty).
My question is now: What would this ARP request look like, I have two possible methodes I can think of:
Computer A, sees that the IP address of computer B is outside his own subnet. It decides to send the package to his default gateway (router) and sends an ARP request with the IP adress of the router. Next: the router replies with his mac Address and the frame is send to the router, which will take care of the frame.
Computer A, is "stupid" and sends an ARP request with the IP address of B. The router is smart enough and sees that the IP address is in it's routeingtable. And replies with his own MAC address. Next, computer A sends the frame to the router, thinking it is computer B. The router sends the package to computer B.
The downside I see with the second approach, is that when you surf to google, it will do an arp request with the IP address of Google. The router will reply with it’s own, since it knows how to get to Google. The next time you surf to another website you will have to do the same thing again and send an arp request with the IP of that website. This will result in many arp requests (one for every website). And the arp cache will get very big.
I really don’t konw the answer. I found two YouTube videos—this one and this one—each telling me different things:
I hope somebody can help me.