cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1093
Views
0
Helpful
3
Replies

How do hosts benefit from using an accurate Subnet Mask?

Joshua Davis
Level 1
Level 1

Hi,

I have 5 Cisco certifications and to be honest I do so much voice and UC stuff now I am starting to forget R&S so pelase excuse me for asking a really dumb question.  All the loopbacks on my devices have a /32 SNM 255.255.255.255 and I started to wonder what purpose the subnet mask serves for the host anyways.  We absolutely need subnet masks for our networks to to create broadcast domains, for security concerns, to allow for route summarizations ect.but those items are used by routers primarily not by hosts.  If you configure a host with an incorrect SNM of /32 what detriment is it to the host? I guess I don't consider that most traffic between hosts would be on the same subnet, but a host can just send packets to its default gateway and let the router do its job.  Why is there the need for a host to be able to correctly identify its own subnet and to identify that other IP addresses belong to the same subnet?

Again stupid question but couldn't help but wonder.

Josh

1 Accepted Solution

Accepted Solutions

Jon Marshall
Hall of Fame
Hall of Fame

Joshua

pc1 = 192.168.5.10 255.255.255.0  default-gateway 192.168.5.1

pc2 = 192.168.5.20 255.255.255.0  default-gateway 192.168.5.1

pc3 = 192.168.6.10 255.255.255.0  default-gateway 192.168.6.1

pc1 wants to talk to pc2. It needs to know whether to send it to the default-gateway or whether it is on the same subnet.

1) pc1 compares it's own address with it's subnet mask and knows it is on the 192.168.5.x network

2) pc1 then compares pc2's address with it's own subnet mask (it only knows it's own subnet mask). It works out pc2 is on the 192.168.5.x network as well

3) so pc1 knows it is on the same network and it arps out for the pc2's mac-address.

4) pc1 then sends the traffic to pc2

pc1 wants to talk to pc3

1) same as above - pc1 is on the 192.168.5.x network

2) pc1 compares pc3's address with it's own subnet mask. It works out that pc3 is the 192.168.6.x network ie. a different network

3) because it is on a different network it knows it must use it's default-gateway so it arps out for 192.168.5.1

4) pc1 then sends the traffic to it's default-gateway

So you can see that using the subnet mask allows the host to work out whether it needs to send traffic direct to the destination ie. pc1 -> pc2 or whether it should send the traffic to it's default-gateway as in the pc1 -> pc3 example.

Note step 3) in both example above where pc1 arps, chances are that pc1 will already have at least it's default-gateway's mac-address so it probably wouldn't need to arp for that and it might already have pc2's mac-address in it's arp table if it has talked to it recently.

The above is all about end hosts. Loopbacks on network devices are often given /32 addresses because they are used purely for managing the device so you only need to be able to route to the /32 address from anywhere on the network.

Jon

View solution in original post

3 Replies 3

If the host receives a packet,  then subnet mask will help him out to   take a decision whether the reply should be send to it gateway

regards

Harish.

Jon Marshall
Hall of Fame
Hall of Fame

Joshua

pc1 = 192.168.5.10 255.255.255.0  default-gateway 192.168.5.1

pc2 = 192.168.5.20 255.255.255.0  default-gateway 192.168.5.1

pc3 = 192.168.6.10 255.255.255.0  default-gateway 192.168.6.1

pc1 wants to talk to pc2. It needs to know whether to send it to the default-gateway or whether it is on the same subnet.

1) pc1 compares it's own address with it's subnet mask and knows it is on the 192.168.5.x network

2) pc1 then compares pc2's address with it's own subnet mask (it only knows it's own subnet mask). It works out pc2 is on the 192.168.5.x network as well

3) so pc1 knows it is on the same network and it arps out for the pc2's mac-address.

4) pc1 then sends the traffic to pc2

pc1 wants to talk to pc3

1) same as above - pc1 is on the 192.168.5.x network

2) pc1 compares pc3's address with it's own subnet mask. It works out that pc3 is the 192.168.6.x network ie. a different network

3) because it is on a different network it knows it must use it's default-gateway so it arps out for 192.168.5.1

4) pc1 then sends the traffic to it's default-gateway

So you can see that using the subnet mask allows the host to work out whether it needs to send traffic direct to the destination ie. pc1 -> pc2 or whether it should send the traffic to it's default-gateway as in the pc1 -> pc3 example.

Note step 3) in both example above where pc1 arps, chances are that pc1 will already have at least it's default-gateway's mac-address so it probably wouldn't need to arp for that and it might already have pc2's mac-address in it's arp table if it has talked to it recently.

The above is all about end hosts. Loopbacks on network devices are often given /32 addresses because they are used purely for managing the device so you only need to be able to route to the /32 address from anywhere on the network.

Jon

Joseph W. Doherty
Hall of Fame
Hall of Fame

Disclaimer

The  Author of this posting offers the information contained within this  posting without consideration and with the reader's understanding that  there's no implied or expressed suitability or fitness for any purpose.  Information provided is for informational purposes only and should not  be construed as rendering professional advice of any kind. Usage of this  posting's information is solely at reader's own risk.

Liability Disclaimer

In  no event shall Author be liable for any damages whatsoever (including,  without limitation, damages for loss of use, data or profit) arising out  of the use or inability to use the posting's information even if Author  has been advised of the possibility of such damage.

Posting

Besides what's already described in the other posts, a correct subnet mask also is used to properly deal with IP subnet broadcast addresses.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card