Network Discovery – How Devices on LAN/VLAN Discover Other Local Devices

Networknetwork-discovery

Let's say you have a brand new 192.168.1.0/24 network that consists of a router, switch and two hosts (H1 and H2).

H1 would like to communicate with H2, but since this is a brand new network and no communication has never taken place before, how does H1 even know that H2 exits?

I understand that initially, the two hosts would not be aware of each other's IP addresses. I also understand that after a host becomes aware of another host's IP address and determines that it is on the same LAN, it can simply ARP to discover another host's MAC address. I'm just struggling to grasp how one host initially discovers the existence of other locally connected devices.

The answer to the question Found Here talks about the role of DNS, but I still don't understand how H1 would know the name of H2 to even ask the DNS server about what IP address belongs to a given name. Is there some sort of protocol/service that enables hosts existing on the same LAN/VLAN to know about all other hosts connected to that same LAN/VLAN?

In smaller networks that don't utilize a local DNS server, is this accomplished by NetBIOS? I'd be interested to also understand how this 'discovery' process works in this type of environment as well.

Thanks head of time!

Best Answer

This is an actual problem.

Most often, one hosts "wants" something from the other host, so it'll try to connect via a known DNS name. In a company network, a DNS server provides the IP address for a name (A record) and you're set. In smaller networks, broadcast name resolution might be working - this is also used by NetBIOS.

Broadcast to some UDP port is also used by various protocols for peers to "find" each other. Most often, multicast would actually be a better choice.

Generally, there is no single protocol or method that'll allow you to discover your local network in total. Various "bootstrap" methods can be used though. E.g. a Microsoft SMB client often discovers the DNS server by DHCP and then uses special DNS records to locate the nearest domain controller, LDAP server etc.

Related Topic