A subnet mask is a way of identifying which IP addresses belong to the network, so hosts (computer or servers) can send/receive messages to/from eachother. A subnet mask is represented by 32 bits, grouped in bytes (8 bit groups) such as: 11111111.11111111.11111111.00000000 which is equivalent to the decimal representation 255.255.255.0. Another way of representing a subnet mask is by using the notation /24. The 24 in this example means that the subnet mask will have 24 consecutive bits as 1's and the rest will be 0s(8 bits, for a total of 32). So a subnet mask /18, for example, will be equal to 11111111.11111111.11000000.00000000 or 255.255.192.0
Hosts with IP addresses that match the subnet mask will be able to communicate with each other. A network with IP address 192.86.0.0/24 will be able to have 253 hosts (the first IP address is reserved for the network itself, and the last IP address will be reserved for the broadcast). The first host can have IP address of 192.86.10.1 and the last host will have 192.86.0.254. This means that any IP address that matches 192.86.0.x will belong to the network: 192.86.0.33, 192.86.0.142 or 192.86.0.205. If the subnet mask for the same network would be /18, that is, 192.86.0.0/18, then any address that matches the first 18 bits of the Network IP address, will belong to this network:
Network IP | 11000000.01010110.00000000.00000000 (192.86.0.0) |
Subnet Mask | 11111111.11111111.11000000.00000000 (255.255.192.0) |
Broadcast IP | 11111111.11111111.00111111.11111111 (192.86.63.255) |
First Host IP | 11111111.11111111.00000000.00000001 (192.86.0.1) |
Last Host IP | 11111111.11111111.00111111.11111110 (192.86.63.254) |
IP NOT in Network‡ | 11111111.11111111.01111100.10110110 (192.86.124.182) |
‡ For the IP that does not belong to the network, only the first 17 bits match the Network IP, but the sub mask specifies that the first 18 need to match. |
You can also determine the Network IP given an arbitrary Host IP and the subnet mask. For example, if the host IP address 10.255.193.29 is given together with its subnet mask /27 or 255.255.255.224, you can find its Network IP (and broadcast IP) by setting to 0's all the bits that the subnet mask has as zero:
Host IP | 00001010.11111111.11000001.00011101 (10.255.193.29) |
Subnet Mask | 11111111.11111111.11111111.11100000 (255.255.255.224) |
Network IP | 00001010.11111111.11000001.00000000 (10.255.193.0) |
Broadcast IP | 00001010.11111111.11000001.00011111 (10.255.193.31) |
During the exercise, some intermediaries (or link) should become "broken".
At least 1 should break while a node has a packet, so that packet doesn't
go through.