

These two values are reserved for the network address (to refer to the entire network) and for local broadcasts on the subnet, respectively.

These are what I mean when I say “all 0” and “all 1”. The highest is 1111 1111, which is the decimal number 255. The lowest value in this subnet range is 0000 0000, which is the decimal number 0. (It’s conventional to write these 8-bit binary values as two groups of four with a space between because they’re easier to read that way.) If I write 15 in binary, I get 0000 1111. That means eight bits (32-24=8) are available for specifying the host. Think about just the host portion of the address. Since this difference occurs in the “network” portion of the address (where the mask has 1s instead of 0s), this address is in a different subnet. Look at the highlighted last two bits of the third octet in that 192.168.102.15 address. So 192.168.101.1 is part of my subnet and 192.168.101.100 is part of my subnet, but 192.168.102.15 isn’t part of my subnet and I need to go through the router to reach it. (To make it a little simpler, we always group all the ones to the left and all the zeroes to the right of the mask.)Īny other device with the same network portion is part of my subnet. The network portion is 192.168.101.0 and the host portion is xx.xx.xx.15. Anywhere the mask has a 0 is the host portion of the address. 0000 0000Īnywhere the mask has a 1 is the network portion of the address. Let’s look at the IP address side by side with the mask in both decimal and binary notation: 192.168.101.15 = 1100 0000. The thing that can make it confusing is that we use decimal notation for each of those 8-bit numbers, but the mechanics of subnetting are really going on in binary. We always write those 32 bits as four 8-bit numbers, often called octets. There are 32 bits in the IP address and the same number in the mask. My computer knows that another device is in my subnet by looking at my own IP address and my subnet mask. That router also needs to be on my subnet. If it’s not on my subnet, I need to forward the packet to a router first. If I want to communicate with another device in my subnet, I can send packets to it directly. My laptop is on a subnet that also includes a server, a printer, a couple of other workstations, and a router. But it’s useful to understand IPv4 first because the basic concepts are the same. In IPv6 things are slightly more complicated, so we’ll save IPv6 subnetting for another article. In IPv4, a network interface is connected to only one subnet and has only one IP address. All the devices in the same subnet can communicate directly with one another without going through any routers.

What is subnetting?Ī subnet is just a range of IP addresses. So how about a quick primer? To understand IPv4 subnets, remember what a subnet is and think about the IP address in binary. Subnetting isn’t hard, but I often see even experienced network engineers looking for subnet calculators or trying to count in binary on their fingers.
