IP Addressing and Subnet Masks: How Networks Work

IP Addressing and Subnet Masks: How Networks Work

Every device on the internet or a local network has an IP address.
But how does it know if another device is on the same network or not?

Thatโ€™s where the subnet mask comes in.

๐Ÿ“Œ What is an IP address?

An IPv4 address has 4 numbers separated by dots โ†’ e.g. 192.168.1.20
Itโ€™s also called a dotted quad because it has 4 octets.

๐Ÿงฉ What does the subnet mask do?

The subnet mask tells you:

  • What part of the address is the network
  • What part is the host (specific device on that network)

Example:

IP:       192.168.1.20  
Mask:     255.255.255.0  
โ†’ Network part: 192.168.1  
โ†’ Host part: 20

Devices on the same network can communicate directly.
If not, the message goes through a gateway.

๐Ÿ” What does โ€œ/24โ€ mean?

The CIDR notation (e.g. /24) is a shorthand for the subnet mask.

  • /24 = 24 bits for the network โ†’ 255.255.255.0
  • /16 = 255.255.0.0
  • /8 = 255.0.0.0

Example:

192.168.1.0/24 โ†’ 256 total IPs (0 to 255)  
โ†’ 254 usable for hosts (excluding network and broadcast)

๐ŸŽฏ Practical Example

Two PCs:

  • IP: 192.168.1.10/24
  • IP: 192.168.1.50/24

โœ… Can talk directly.
But 192.168.2.10/24? โŒ Outside the network โ†’ needs a gateway.

โ“ Interactive Quiz

1. What does the "/24" mean in an IP address?





2. What does the subnet mask do?





3. Why is it called a "dotted quad"?





4. How many usable hosts are in a /24 network?





5. If two devices are on different subnets:





© Nc6 by Giuseppe Fanuzzi - IT08952900721 - PIQA6QP