The routers require subnet mask to route the packets to other routers or hosts, but why do host machines that are not routers such as computer running Ubuntu or windows need subnet mask to be configured. It does not do any routing. Where is the subnet mask used in the non-router host machine ?

  • The host machine needs to know what its own network is. Also, it does have a routing table and it does route internally. – Ron Maupin Mar 21 '20 at 17:16

Imagine this scenario:

enter image description here

Host B knows it's own IP address (

Consider, if Host B needs to speak to Host A with the IP (which we can tell exists in the same Network as Host B because of the blue circle), Host B can speak to it directly.

But How does Host B know that? It doesn't have the luxury of a pretty topology photo and blue circle to look at like we do.

Instead, it uses the Subnet Mask. Assume it has a Subnet Mask of Host B can do a little subnetting to determine that the IP addresses through are on it's own network. And from there determine that (Host A) is indeed in this range.

This is also what tells Host B that if it needs to speak to Host D, that Host D's IP address ( does NOT fall in Host B's network, and therefore the packet must be sent to the Default Gateway (i.e., the Router).

More details on the process (and where the image above came from) can be found in this video: https://www.youtube.com/watch?v=QPi5Nvxaosw

Disclaimer, I created the video, hope it helps

  • 1
    Thanks for the video. Most of the tutorial on the internet does not with the arp that is missing piece of knowledge. – Talespin_Kit Mar 22 '20 at 9:03

The host's subnet mask allows it to know what addresses are on its local LAN (so it uses ARP to learn their MAC address, and sends traffic directly to them) vs what addresses are not within their subnet (for which they use their default gateway.)

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