Sun Management Center 3.6.1 User's Guide

Using Netmasks

The format of the netmask is a series of 1s followed by a series of 0s. By ANDing an IP address with a netmask, you can get the address of the subnet.

Routers use netmasks to decide whether to forward a packet to an external subnet. For example, suppose a machine with an IP address of 129.123.56.95 sends an email to another machine whose IP address is 129.123.56.100. By ANDing both IP addresses with a netmask (255.255.255.0), the result is 129.123.56.0 for both machines. The router then concludes that the source machine and the destination machine are in the same subnet. Therefore, the router does not forward the email to external subnets.

On the other hand, if the destination address is 129.123.67.100, then the resulting subnet address is 129.123.67.0. The router forwards the email to the external subnet (129.123.67.0).


Note –

Although some of these examples only apply to Ethernet links, the principles apply regardless of the network type.