ARP is the Address Resolution Protocol.
TCP/IP stacks use ARP to map between an IP address (like 10.0.1.1) and hardware (usually MAC) address, like 00:11:22:AA:BB:CC. Because there's overhead in performing mapping, computers maintain a cache of recently mapped addresses. The command arp -a
displays the cache. Sometimes the cache may also contain mappings for computers which have announced their address or otherwise contacted your computer. Cache entries will expire after a certain length of time, so if your computer hasn't contacted another one in a while you won't see that other one in the cache.
There's no reason to expect that this cache would contain the IP addresses of every computer on your network. That's not what it does, and no one should be suggesting that it will contain the IP address of every computer on your network. That's simply incorrect.
You can try iterating over all the IP addresses on your network and pinging each one. That will force your computer to attempt to use ARP to map the IP address to the hardware address for each computer. You can also try pinging the broadcast address of the network (ping 192.168.1.255
in this case).
After completion, arp -a
will provide a more thorough (but still possibly incomplete) list of computers on your network. Note that pinging the broadcast address may cause a lot of traffic on your network and may not be welcome on other people's networks. Also, some computers may choose not to respond.
If you want to scan the network, a better tool to use is a network scanner, like nmap. In this case, you might try running nmap -sn '192.168.1.*'
.
Beware that nmap will also happily scan ports to discover running services, depending on the options you give it. It can be quite slow. It can also trigger security monitors. Some organizations will consider nmap scanning to be a hostile action.
Note that you will likely have to install nmap on your computer to use it.
Also, hosts may hide from nmap's scan, so it will not necessarily provide a complete list of all computers on your network.
Ultimately you already answered your own question. Only your router (and wifi access point, if it's separate) knows all the computers that are on your network, and ultimately only it can provide a reliable list.
If it supports it, you can try using SNMP, the Simple Network Management Protocol, which is designed to talk to and manage routers, among other devices. SNMP can report a routers DHCP lease list, which is the definitive list of IP addresses that the router has assigned to computers on the network (note however that computers which have been configured to use a static IP address may not show up here). It can also access the router's ARP cache. And depending on the wifi access point, it may be able to return the list of devices that the access point knows is connected. Between these you can piece together a comprehensive list of computers on the network.
To do this you'll need to install SNMP manager software on your computer. How you do this and how you use it to talk to your router or access point are highly dependent on your setup; if you need help with this, try to figure it out and post new questions about.