Networking

Subnet Mask Assignment

Like an IP address, a subnet mask is most commonly expressed in a 32-bit dotted-decimal format. Unlike an IP address, though, a subnet mask performs just one function: It defines which parts of the IP address refer to the network address and which refer to the node address. Each of the classes of IP address used for address assignment has a standard subnet mask associated with it. The default subnet masks are listed in Table 3.

Table 3 Default Subnet Masks Associated with IP Address Classes

Address Class

Default Subnet Mask

A

255.0.0.0

B

255.255.0.0

C

255.255.255.0



Default Gateways

Default gateways are the means by which a device can access hosts on other networks for which it does not have a specifically configured route. Most workstation configurations actually just use a default gateway rather than having any static routes configured. Such a configuration is practical because workstations are typically only connected to one network, and thus have only one way off that network.

When a system wants to communicate with another device, it first determines whether the host is on the local network or a remote network. If the host is on a remote network, the system looks in the routing table to determine whether it has an entry for the network that the remote host is on. If it does, it uses that route. If it does not, the data is sent to the default gateway.

In essence, the default gateway is simply the path out of the network for a given device.