11-28-2021 11:32 PM
For communication with machines in the same LAN, hosts do ARP for translating the IP address to MAC address, which means, IP addresses are already known to each other. My question is, how does the host come to know about the IP addresses of each other in the first place?
11-29-2021 02:42 AM
My question is, how does the host come to know about the IP addresses of each other in the first place?
They dont , that where you requestion with broacast, who has X in the network.
You get to know only if you like to talk to other host, if not you do not need to know other host IP address.
11-29-2021 07:19 AM
As @balaji.bandi noted, they usually don't know.
More often they have the other host's "name", and if so, usually in IP, they use DNS to resolve that name to an IP.
Since you mentioned LANs, host names might also resolved by other than DNS, using proprietary LAN protocols too.
Whether using DNS or a proprietary host name to address resolution service, often host names are hard coded to an address or dynamically mapped to an allocated allocated address in conjunction with the DHCP process.
11-29-2021 08:17 AM
If I am understanding the discussion correctly the original poster is asking if a host needs to send an arp request for address a.b.c.d (which is in the same subnet as the host's interface) where did a.b.c.d come from. There are several potential answers:
- perhaps the host is running some application, and the application provided that address (or provided a name, which was resolved to an address).
- perhaps a user connected on this host supplied that address (or provided a name, which was resolved to an address).
11-29-2021 03:07 PM
Rick is correct, or to put it another way, something external to the host has to provide the destination hostname or IP. Hosts aren't clairvoyant.
Once "primed" with another hostname, it needs to be translated/mapped to an IP. Generally, as noted in my earlier reply, this might be done with DNS, or other LAN specific technique.
It's also possible, host (some app) was provided a hostname, and it's translated/mapped to an IP on the host using a host table. This table bypasses the need to tranlate/map an name using an external resource, but translation process, generally, looks first in host table and if entry not found there, it tries the external processes. (Much like an IP to MAC can be within a table, or ARP cache, on the host.)
11-30-2021 06:46 AM
@dailymotionad wrote:For communication with machines in the same LAN, hosts do ARP for translating the IP address to MAC address, which means, IP addresses are already known to each other. My question is, how does the host come to know about the IP addresses of each other in the first place?
The host only will have the IP of the hosts it has already communicated, so it does not know all the IP addresses in the LAN. A host will use ARP only if it needs to communicate with a certain host, but if it does not need anything from a particular host, it will not have that host in the ARP table.
Also, keep in mind that many people don't know the existence of Proxy ARP which is used mostly when the machine is not configured with a default gateway. If the request from host A is for a host(B) in another subnet and the router has a route for that, it may respond to the host(A) with its own MAC Address and the communication will go thru. Host(A) will now have the router MAC Address mapped to the host(B) IP address on the arp table.
11-30-2021 08:01 AM - edited 11-30-2021 08:02 AM
Hi,
I found an article that explains the subject in a very simple and easy way,
Hope this helps someone
https://www.geeksforgeeks.org/packet-flow-in-the-same-network/
When a source wants to send a packet to the destination device then,
1. The source ARP cache is checked if the ARP is resolved or not. If the ARP is not resolved, it puts the packet on hold and generates an ARP request.
2. If the ARP is already resolved then the packet will be delivered to the destination host.
3. The ARP request is broadcast all over the network to find out the device has a destination IP address.
Note – If the destination is present in the same network then ARP will find out destination MAC address but if it is present in a different network then ARP will find out default gateway MAC address.
4. When the device having the destination IP address receives the ARP request, it updates its own ARP cache.
5. The destination host machine generates an ARP reply containing its own MAC address.
6. Now, the device having the source IP address receives the ARP reply and updates its ARP cache.
7. Since, both source and destination IP address and MAC address are available now, therefore, the packet is delivered to the destination host.
Now, we have taken an idea about the ARP protocol.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide