# Network Prefix on Octet Boundar and Variable Length Subnet Masking ###### tags: `elearning` `Multimedia Wireless Network` ###### Note Page : [:link:](https://hackmd.io/@YTL0307/HJEb6jWCo) --- [TOC] --- ## **Network Prefix on Octet Boundary** - What happens when a network prefix doesn't fall on an octet boundary? - We saw that when a network prefix falls on an octet boundary, it is very easy to determine the network portion and the host portion of the address without looking at the binary equivalent. ![](https://i.imgur.com/ELCTaWv.png) - The first three octets represent the network number and the last octet represents the host address. - Remember also that the first number in a subnet is reserved. - In this example, it is easy to see that the IP addresses ending in zero are the reserved subnet numbers, and those ending in numbers other than zero are hosts. - Here are the addresses of the first subnet and first host in that subnet, shown in binary and decimal format. ![](https://i.imgur.com/luT7gyd.png) - When a single octet comprises both network and host bits, however, it's not so easy to tell the difference between a network number and a host address. You have to look at the binary equivalent. ![](https://i.imgur.com/SxSQJdw.png) - Notice here that with a 27-bit prefix length - The first available subnet number is actually 192.168.3.0, where all bits in the subnet portion are turned off and the first host address in this subnet is 192.168.3.1. ![](https://i.imgur.com/OioKf1z.png) - Nothing looks different yet. - The second available subnet is 192.168.3.32, where the far-right bit in the subnet portion is turned on. ![](https://i.imgur.com/bFaswM8.png) - The powers of two table on screen shows you how the bits in the last octet now add up to 32. - The first host address in this subnet, then, is 192.168.3.33. ![](https://i.imgur.com/4ajE3l8.png) - Now this address or host address looks very different, and here is where the purpose of the mask really becomes clear. - If the network prefix does not fall on an octet boundary. it is impossible to determine the actual subnet number without the mask. --- ## **Variable Length Subnet Masking Example** - Using the subnet mask and converting binary to decimal, we can start to build a table of the network numbers available and the host ranges possible within each network. ![](https://i.imgur.com/AUqAQgr.png) - The table shows the first two subnets we just looked at, displaying both the dotted decimal equivalents of the full IP addresses and the last octet of the binary numbers. - The PC 192.168.3.60 wants to communicate with 192.168.3.66. ![](https://i.imgur.com/QgMr2Tx.png) ![](https://i.imgur.com/mcdIkIM.png) - Once again, the first step is to determine if the two devices are on the same network or in this case the same subnet. - We apply the subnet mask to the source IP address and determine that the subnet number is 192.168.3.32 - Now, if we apply the same subnet mask to the destination IP address, we determine that the subnet number is 192.168.3.64. - Because the two devices are not on the same network, they must use a router to communicate. - Remember that Acme's manufacturing facility was assigned the network range of 192.168.3.0/24, which they needed to subnet to meet their needs. ![](https://i.imgur.com/OZJk7tQ.png) ![](https://i.imgur.com/t2uNacu.png) - The table shows each subnet number and the range of assignable host numbers in decimal using a 27-bit subnet mask. - The table also shows the last octet in binary of each subnet as well as its corresponding host address range. - Remember that there are two reserved addresses in each subnet. - Now let's assign a few of these subnets and see what the new IP addressing scheme looks like at the ACME manufacturing facility. ![](https://i.imgur.com/JsEnggm.png) - In the graphic on screen, you'll see that we've assigned three subnets, 192.168,3.0, 192.168.3.32, and 192.168.3.64 to the three different networks. - We've also assigned 3 host numbers from each subnet to the network devices within each subnet. - Notice that the router has 3 network interfaces in three different subnets, so it must have a unique IP address for each.