2

This might be a duplicate but I didn't find it.Maybe I didn't used the right keywords while searching.

I was reading this book and in Chapter 1, it was written that

When a source node wants the network to deliver a message to a certain destination node, it specifies the address of the destination node.

One thing that is bugging me how does the source node knows the address of the destination node when it is communicating for the first time?

Does the source node have to know the address of the destination node before starting to communicate for the first time?

1
  • 2
    This can vary depending on the type of network and which layer you are concerned about, so narrowing this down would be good. Here's a start: Often this is specified in a configuration or generated by user input (you type stackexchange.com in your browser and the computer will use DNS to find the IP address in the background). HTTP traffic uses a known port, so that can be looked up. Local MAC addresses are found through the ARP protocol. It could be a service that is located through a broadcast/multicast mechanism such as mDNS. All this and more can and often are cached on your system. – YLearn Sep 5 '14 at 15:04
5

Because you specified an address, or name that can be resolved to an address.

How did your computer get to this website? You entered a URL (or clicked a link) pointing here. Behind the "mouse", your computer used it's configured DNS server(s) to resolve the name to an address. That DNS request had to find it's way to your default gateway (pre-configured) -- assuming it's not a local server, etc. On your local ethernet (wifi), your computer finds the address (MAC) of the gateway via ARP.

2
  • my question was not about that.on the internet its ok but what happens in intranet.suppose I have two computers A and B on intranet and computer A wants to send message to computer B for the first time.How will the communication start? – rock321987 Sep 5 '14 at 17:25
  • Just like I said, a) you tell it, or b) it references a name-to-address map. In the case of NetBIOS (WINS), that would be through broadcast discovery -- both A and B are broadcasting their presence. – Ricky Sep 5 '14 at 20:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.