Communication between 2 computers

networkingnewbie

Honorable
Oct 19, 2012
16
0
10,520
Hello, I understand the fundamentals of networking; however, I am stumped when I think about how two computers communicate. Let's take Computer A, which sends a message to Computer B. I understand that the Mac address of Computer A is sent out with the IP address of Computer B. A broadcast is sent out stating "is this you", and when computer B recognizes its address it accepts the message. Now tell me, how does computer A know the IP address of computer B? I know the switch eventually learns all the Mac address and the router learns the IP address, but how on earth does computer A know that Billy is 192.168.1.44? Is this a DNS table?
 
Solution
Very simplified explanation:

Two computers: A & B

Computer A has a packet of data to send to Computer B but does not know it's address.

Computer A first checks with DNS.

If no joy there then the hosts file is checked.

If still no joy then a general broadcast is sent out asking for the address of <B>

Assuming one of the above methods results in a hit then the local ARP cache is checked for a matching MAC address.

If no MAC found then an ARP broadcast is sent asking for the owner of <IP address of B> and adds the reply to the cache for future use.


Things to bear in mind here is that broadcasts are limited to the local network segment only and are not routed to other networks.

networkingnewbie

Honorable
Oct 19, 2012
16
0
10,520
Yes, but my original questions is how did it get these IP addresses? So brand new computer on the network and it needs to communicate with computer B. How does it know what the IP address is? From the DNS server? Where specifically does it obtain the IP address?
 

networkingnewbie

Honorable
Oct 19, 2012
16
0
10,520
Yes, it sends out an ARP request with the IP address. Please don't answer the question without reading my original question. When it sends out the ARP request it already has the IP address and is looking for the Mac Address. My question is, how does it already know the IP address.
 
Very simplified explanation:

Two computers: A & B

Computer A has a packet of data to send to Computer B but does not know it's address.

Computer A first checks with DNS.

If no joy there then the hosts file is checked.

If still no joy then a general broadcast is sent out asking for the address of <B>

Assuming one of the above methods results in a hit then the local ARP cache is checked for a matching MAC address.

If no MAC found then an ARP broadcast is sent asking for the owner of <IP address of B> and adds the reply to the cache for future use.


Things to bear in mind here is that broadcasts are limited to the local network segment only and are not routed to other networks.

 
Solution