🌐 What is a Subnet Mask?

 

 

📖 Definition
A subnet mask is a 32-bit number used to divide an IP address into network and host portions.

🧠 Concept

1 → Network

0 → Host

📍 Example:
IP: 192.168.1.10
Mask: 255.255.255.0

👉 Network = 192.168.1
👉 Host = 10

🧠 CIDR (Classless Inter-Domain Routing)

📖 Definition
CIDR is a notation that represents the number of network bits in an IP address.

📍 Example:
192.168.1.0/24

🔄 Subnet Mask vs CIDR

Subnet MaskCIDR
255.0.0.0/8
255.255.0.0/16
255.255.255.0/24

Why is Subnetting Important?

Efficient IP usage

Better network segmentation

Improved performance & security

🎯 Interview Focus (Very Important)

What is subnet mask?
A subnet mask is used to separate the network portion and host portion of an IP address, enabling efficient routing and network segmentation.

What is CIDR?
CIDR is a method of representing IP addresses using slash notation to define the number of network bits.

Difference between subnet mask and CIDR?
Subnet mask is written in dotted decimal format, while CIDR is a compact representation using slash notation.

What is /24?
/24 means the first 24 bits are used for the network and the remaining 8 bits are used for hosts.