Another way to tell whether your computer is on the same network as the computer you are trying to communicate with is to look at the subnet mask. The subnet mask is what your computer uses to determine whether the network device it is trying to communicate with is on the same network or not. The subnet mask helps the system determine the network ID portion of the IP address by comparing the subnet mask against the IP address. If there is a 255 in the subnet mask, then the corresponding octet in the IP address is part of the network ID. Once the network ID is known, any systems that have the same network ID are considered to be on the same network - otherwise they would have a different network ID.
Different classes of IP addresses are associated with different default subnet masks. For example, a Class A address has a default subnet mask of 255.0.0.0, a Class B address has a default subnet mask of 255.255.0.0, and a Class C address has a default subnet mask of 255.255.255.0. Looking at the subnet masks, any octet that has the value of 255 means that the corresponding octet in the IP address is part of the network ID.
To put this all together, Table below shows an example of two computers and their IP address configurations.Comparing IP Addresses with Subnet Mask
Item Address Computer A (IP Address) 188.8.131.52 Computer A (Subnet Mask) 255.0.0.0 Computer B (IP Address) 184.108.40.206
Using this example, Computer A tries to connect to Computer B. The first thing that Computer A does is compare its IP address with its own subnet mask to determine what octets make up the network ID. Here it sees that the first octet is the network ID because the subset mask has the number 255 in only the first octet. Then Computer A compares its subnet mask with the IP address of Computer B (the remote computer it is trying to communicate with) and identifies that the network IDs of Computer A and Computer B are different - the two computers are on different networks.
When Computer A realizes that the remote computer it is trying to communicate with (Computer B) is on a different network, it starts to panic because it doesn't have the capability to send the information over to the other computer. Computers can pass information directly to other computers only if both systems are on the same network. So what happens? This is where the default gateway fits into the story.
In this tutorial:
- Networking the Operating System
- Understanding Networking Components
- Installing a network adapter in Windows 2000/XP/2003
- Network client
- The TCP/IP Protocol
- Subnet mask
- Default gateway
- Configuring TCP/IP en masse using DHCP
- Understanding Name Resolution
- The LMHOSTS file
- The HOSTS file
- Troubleshooting with TCP/IP Utilities
- Sharing File System Resources
- Enabling File and Printer Sharing in Windows 2000/XP/2003
- Sharing a folder in Windows XP
- Hidden shares
- Using a UNC path
- Sharing Printer Resources
- Understanding Windows Services
- Browser service