The Network Layer - Subnetting - Subnet masks

8 important questions on The Network Layer - Subnetting - Subnet masks

How are subnet IDs calculated?

They are calculated by a subnet mask.

What is a subnet mask?

A subnet mask is a 32-bit address used to distinguish between a network address and a host address in IP address. They are normally written out as four octets in decimal. In binary, it is a string of 1s followed by a number of 0s.

Why does a computer need a subnet mask? Use the example given by Sunny's classroom

On a LAN there are two computers: A and B. There is another computer C, that is not on the LAN. Computer A wants to communicate with computer B and with C somewhere on the internet. How does computer A know that B is on the LAN and C is remote? That is because of the subnet mask.

Let's compare A and B
A's subnet mask (binary): 11111111 11111111 11111111 00000000
A's IP address: 00001010 00000001 10010111 00001010
B's IP address: 00001010 00000001 10010111 00000011
C's IP address: 01000000 11100011 10100000 00010111

     Computer A is comparing the IP addresses based on the subnet mask. It uses the AND operator to determine this. As you can see above, the first three octets are the same for A and B which is how the Network ID is identified. This shows that A and B are on the same network (LAN). Computer A now knows that Computer B is a local. The last octet is reserved for the host ID in this case, because A and B are on the same network.

Now, Computer A is going to compare the IP address of C based on the subnet mask. As you can see above by comparing the first three octets, the network ID is different. Computer A now knows the network ID is different. Therfore, subnet mask is used by a computer to determine if another (target) computer is on the same network or a different network.
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart

How does a computer use a subnet mask to determine if an IP address exists on the same network

A subnet mask is a way for a computer to use AND operators to determine if an IP address exists on the same network.

What is IP address 9.100.100.100 in binary?

0000 1001      0110 0100      0110 0100      0110 0100

The number 9 in binary is just 1001, why does the IP address have four 0s in front of it?

It has to be padded by four 0s because each octet needs 8 bits

Each IP class has a subnet mask, such as 255.255.255.0, what is this in binary?

1111 1111      1111 1111     1111 1111      0000 0000

What is the purpose of the first three octets of a subnet mask?

The first three octets tell a router what part of the IP address is the subnet ID.

The question on the page originate from the summary of the following study material:

  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Remember faster, study better. Scientifically proven.
Trustpilot Logo