Subnet Masks

๐Ÿ”€ Introduction In our previous lessons, we covered network IDs used to identify networks and host IDs used to identify individual hosts. Now, we'll introduce a third concept: the subnet ID.

๐Ÿ”ข IP Address Structure An IP address is a 32-bit number. Without subnetting, a portion of these bits is used for the network ID, and the remaining bits are used for the host ID. However, subnetting involves allocating some host ID bits for the subnet ID.

๐ŸŒ๐Ÿ”€ Delivering Packets Core routers on the Internet focus on the network ID to route packets to the appropriate gateway router. The gateway router uses additional information, including the subnet ID, to deliver the packet to the intended recipient machine.

๐Ÿ”’ Subnet Masks Subnet IDs are determined using subnet masks. Subnet masks are 32-bit numbers expressed as four octets in decimal. They define the boundaries of the subnet and specify which bits represent the subnet ID and host ID.

๐Ÿ”€๐Ÿ”ข Understanding Subnet Masks To understand subnet masks, let's compare them to IP addresses. Subnet masks consist of two sections: the mask itself, which is a string of ones, followed by zeros. The ones indicate the subnet ID, while the zeros indicate the host ID.

๐Ÿ”ข Subnetting Example For instance, let's work with the IP address 9.100.100.100. Each part of the IP address, or octet, consists of eight bits. We can represent the IP address and subnet mask in binary form and determine the subnet and host IDs based on the corresponding ones and zeros.

๐Ÿ”„ Size of Subnets The size of a subnet is determined by its subnet mask. For example, a subnet mask of 255.255.255.0 means that the last octet is reserved for host IDs, allowing for a total of 256 addresses (0-255). However, the addresses 0 and 255 are typically reserved for special purposes.

๐Ÿ”€โžก๏ธ Subnet Mask Notation Subnet masks can be represented using a shorthand notation called CIDR notation. For example, a subnet mask of 255.255.255.224 can be written as /27, indicating that there are 27 ones in the subnet mask. The IP address and subnet mask together can be written as 9.100.100.100/27.

๐ŸŒ๐Ÿ”’๐Ÿ”€๐Ÿ”ข

Last updated