{"id":178,"date":"2024-06-20T17:46:00","date_gmt":"2024-06-20T17:46:00","guid":{"rendered":"https:\/\/www.examlabs.com\/certification\/?p=178"},"modified":"2026-10-29T11:50:34","modified_gmt":"2026-10-29T11:50:34","slug":"networking-basics-what-is-ipv4-subnetting","status":"publish","type":"post","link":"https:\/\/www.examlabs.com\/certification\/networking-basics-what-is-ipv4-subnetting\/","title":{"rendered":"IPv4 Subnetting: Find the Network Boundary"},"content":{"rendered":"<p>Two IPv4 addresses can look almost identical and still belong to different local networks. A client at 198.51.100.141\/27 and a server at 198.51.100.170\/27 share their first three octets, but the client&#8217;s subnet ends at 198.51.100.159. The server is in the next block. That boundary determines whether the client ordinarily tries to reach a neighbor directly or sends the packet toward an appropriate gateway.<\/p>\n<p>IPv4 subnetting is the process of using an address and mask to identify those boundaries, allocate nonoverlapping networks and predict forwarding behavior. It is a foundational skill for <a href=\"https:\/\/www.examlabs.com\/200-301-exam-dumps\">Cisco CCNA 200-301<\/a>, but it applies to any correctly designed IPv4 network. The aim is not to memorize a table of host counts; it is to explain the address interval, available endpoint addresses and first-hop decision, then verify that a real host behaves as expected.<\/p>\n<h2>The prefix describes which bits are the network<\/h2>\n<p>An IPv4 address contains 32 bits divided into four eight-bit octets. A prefix length such as \/27 identifies how many leading bits of the address are used for the network portion. The remainder forms the host-address portion within that block. A \/27 corresponds to 255.255.255.224, leaving five host bits in the final octet.<\/p>\n<p>A network address is found by applying the subnet mask to the full address, conceptually a bitwise AND. The network portion remains unchanged while host bits become zero. The highest address in a conventional broadcast-capable subnet has its host bits set to one and is the directed broadcast address. Ordinary unicast hosts use addresses between those two boundary addresses, subject to special prefix cases discussed later.<\/p>\n<p>For a prefix whose interesting octet is the fourth, calculate the block size by subtracting that mask octet from 256. With \/27 the last mask octet is 224, so blocks begin at multiples of 32: .0, .32, .64, .96, .128, .160, .192 and .224. The correct block is the one whose start is not greater than the given address and whose next start is beyond it.<\/p>\n<p>This procedure is another way to read the same network bits. It should not be treated as a magical shortcut detached from the prefix. Understanding <a href=\"https:\/\/www.examlabs.com\/certification\/understanding-cidr-classless-inter-domain-routing\/\">CIDR and prefix length<\/a> explains why the block boundaries and route matches exist.<\/p>\n<h2>Work a \/27 calculation from beginning to end<\/h2>\n<p>Take 198.51.100.141\/27. Dividing the final octet by the block size gives 141 \u00f7 32 = 4 with a remainder. The fifth block starts at 4 \u00d7 32 = 128, so the network address is 198.51.100.128. The next block starts at .160; therefore this block ends at .159.<\/p>\n<table>\n<thead>\n<tr>\n<th scope=\"col\">Property<\/th>\n<th scope=\"col\">198.51.100.141\/27<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Subnet mask<\/td>\n<td>255.255.255.224<\/td>\n<\/tr>\n<tr>\n<td>Block size in fourth octet<\/td>\n<td>32 addresses<\/td>\n<\/tr>\n<tr>\n<td>Network address<\/td>\n<td>198.51.100.128<\/td>\n<\/tr>\n<tr>\n<td>Conventional host range<\/td>\n<td>198.51.100.129\u2013198.51.100.158<\/td>\n<\/tr>\n<tr>\n<td>Directed broadcast<\/td>\n<td>198.51.100.159<\/td>\n<\/tr>\n<tr>\n<td>Address count \/ conventional usable hosts<\/td>\n<td>32 \/ 30<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Now test 198.51.100.170\/27. Its final octet falls in the 160\u2013191 block. Its network address is 198.51.100.160, its conventional host range is .161\u2013.190 and .191 is the broadcast. The two example hosts are not on the same \/27 subnet. If the client has an appropriate gateway, normal IPv4 forwarding to the other subnet needs a Layer 3 decision.<\/p>\n<p>Using the same \/27 subnet mask on both hosts does not merge their blocks. Prefix length tells the size of each range; it does not mean every address with that prefix length belongs to the same range. The numeric network portion must match.<\/p>\n<h2>Calculate counts without assuming every address is usable<\/h2>\n<p>For an ordinary IPv4 subnet with a prefix length shorter than \/31, the total number of addresses is 2 raised to the number of host bits. A \/24 has eight host bits, giving 256 addresses. A \/27 has five, giving 32. A \/30 has two, giving four. On a conventional broadcast subnet, reserving one network address and one directed broadcast leaves two fewer addresses for ordinary hosts.<\/p>\n<p>That count is not automatically the number of endpoints the design can support after allocating gateways, infrastructure addresses, high availability or management interfaces. A \/27 can support 30 conventional unicast host addresses, but if one is used by the default gateway, only 29 remain for other hosts under that allocation. More reserved addresses reduce the remaining pool.<\/p>\n<p>A common mistake is to subtract two in every possible prefix. The special \/31 and \/32 cases need their own interpretation. Designing with an automatic \u201csubtract two\u201d rule can waste address space and misrepresent valid point-to-point configurations.<\/p>\n<h2>\/31 and \/32 are not ordinary broadcast subnets<\/h2>\n<p>RFC 3021 permits \/31 addressing on appropriate point-to-point IPv4 links. The two addresses in the \/31 are used as the link&#8217;s two endpoint addresses rather than treating one as the unusable network identifier and the other as an unusable broadcast address. This is useful where two router interfaces share a point-to-point link and the platform supports the model.<\/p>\n<p>For example, 198.51.100.20\/31 contains .20 and .21. In the supported point-to-point use case, each may identify an endpoint. It would be wrong to conclude that a \/31 has zero usable addresses merely by applying the conventional subnet&#8217;s subtract-two arithmetic without its special-case rules.<\/p>\n<p>A \/32 represents one IPv4 address. It is commonly used as a host route or to identify an individual interface or loopback address, depending on the deployment. It is not an ordinary multi-host Ethernet subnet with one \u201cnetwork\u201d and one \u201cbroadcast\u201d address to reserve. A \/32 route can be useful for identifying a specific destination without implying that a larger local segment exists.<\/p>\n<p>When preparing for CCNA or working in a real network, explain where the prefix is being used: broadcast multiaccess segment, point-to-point link or host route. The address math and operational role must agree.<\/p>\n<h2>Move to a prefix that crosses an octet boundary<\/h2>\n<p>Subnets larger than \/24 can extend the host portion into the third octet, so calculating only the final octet is not enough. Consider 172.16.13.200\/22. The subnet mask is 255.255.252.0. The interesting octet is the third, where the mask value 252 creates blocks of four: third-octet values 0\u20133, 4\u20137, 8\u201311, 12\u201315, and so forth.<\/p>\n<p>The address 172.16.13.200 belongs to the third-octet 12\u201315 block. Its network address is 172.16.12.0, and its conventional directed broadcast is 172.16.15.255. The host range is 172.16.12.1 through 172.16.15.254. There are ten host bits under a \/22 prefix, giving 1,024 total addresses and 1,022 conventional unicast host addresses.<\/p>\n<p>It would be incorrect to call 172.16.13.0 the network address simply because the host&#8217;s first three octets look fixed. The mask determines how many bits are fixed. With a \/22, only the first six bits of the third octet are network bits; the remaining two, plus the entire final octet, participate in the host range.<\/p>\n<p>Test another address such as 172.16.16.10\/22. It falls in the next block, with network 172.16.16.0, so it is not in the same \/22 as 172.16.13.200. This is why prefix comparison requires the actual masked bits, not a visual match of decimal octets.<\/p>\n<h2>Use VLSM to allocate different host requirements<\/h2>\n<p>Variable Length Subnet Masking allows a network designer to allocate differently sized, nonoverlapping CIDR blocks based on need. Suppose an authorized training network has 10.40.0.0\/24 available for a department needing 100 hosts, another needing 50, a smaller lab needing 20 and a management group needing 10. Assign the larger blocks first and keep every allocation aligned to its prefix boundary.<\/p>\n<table>\n<thead>\n<tr>\n<th scope=\"col\">Need<\/th>\n<th scope=\"col\">Allocation<\/th>\n<th scope=\"col\">Conventional usable hosts<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>100 hosts<\/td>\n<td>10.40.0.0\/25<\/td>\n<td>126<\/td>\n<\/tr>\n<tr>\n<td>50 hosts<\/td>\n<td>10.40.0.128\/26<\/td>\n<td>62<\/td>\n<\/tr>\n<tr>\n<td>20 hosts<\/td>\n<td>10.40.0.192\/27<\/td>\n<td>30<\/td>\n<\/tr>\n<tr>\n<td>10 hosts<\/td>\n<td>10.40.0.224\/28<\/td>\n<td>14<\/td>\n<\/tr>\n<tr>\n<td>Unallocated reserve<\/td>\n<td>10.40.0.240\/28<\/td>\n<td>14<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The \/25 covers .0\u2013.127, the \/26 covers .128\u2013.191, the \/27 covers .192\u2013.223, and each \/28 covers sixteen addresses. The blocks do not overlap. The reserve is not a promise that it can fit another 100-host requirement; it is a separate small allocation that can be used later if its size and placement are suitable.<\/p>\n<p>VLSM is not merely squeezing the largest possible number of names into an address range. A correct plan leaves appropriate gateway, infrastructure and growth space, aligns with routing and VLAN responsibilities, and avoids conflicts with other networks that may later be connected. A syntactically valid pair of overlapping prefixes can still create operational ambiguity and unexpected forwarding behavior.<\/p>\n<h2>Subnet math becomes a host and route decision<\/h2>\n<p>A host at 198.51.100.141\/27 sees 198.51.100.150 as local, but 198.51.100.170 as remote. On an ordinary Ethernet link, the client may use ARP to resolve a neighbor for the first address, while the second normally needs an appropriate gateway. That difference explains why a host can communicate with some devices despite a broken gateway.<\/p>\n<p>After the gateway receives a remote packet, routing considers destination prefixes in its table. A more-specific matching route can determine the next hop before a default route applies. The source host&#8217;s mask and the router&#8217;s route table operate at different stages, yet both use prefix boundaries to make forwarding decisions.<\/p>\n<p>This makes subnetting relevant to <a href=\"https:\/\/www.examlabs.com\/certification\/cisco-200-301-ccna-the-concepts-that-connect-the-blueprint\/\">CCNA network concepts<\/a> rather than merely a standalone arithmetic quiz. If an access VLAN contains a host with the wrong mask, adding a route upstream may not fix the host&#8217;s incorrect local-versus-remote decision. The engineer must identify the first boundary at which actual behavior diverges from the intended flow.<\/p>\n<p>Use a controlled simulation to prove it. Change one test host from \/27 to \/24 while keeping its address, and predict which destinations it will try to resolve directly. Inspect the host&#8217;s neighbor and routing behavior, then restore the correct mask and test the gateway path again. Do not make such a change on a production network just to demonstrate a training question.<\/p>\n<h2>Check your work with three changed cases<\/h2>\n<p>First calculate 203.0.113.77\/26. A \/26 has a block size of 64 in the final octet, so the network is 203.0.113.64, the conventional host range is .65\u2013.126 and the directed broadcast is .127. If your calculation returns .77 as the network, you have confused a host address with its block boundary.<\/p>\n<p>Second compare 192.0.2.127\/25 and 192.0.2.128\/25. Their decimal addresses are consecutive, but .127 is the directed broadcast of the first \/25 block and .128 is the network address of the second. They are not two ordinary usable endpoints on the same local subnet.<\/p>\n<p>Third assess the \/31 pair 192.0.2.200\/31 and 192.0.2.201\/31 as addresses on a supported point-to-point link. They are the two endpoint addresses of the same \/31 block, not a pair of ordinary hosts separated by a conventional network and broadcast reservation. Context determines whether the design is valid.<\/p>\n<p>For each case, report the mask, network, last address, conventional host treatment and resulting first-hop behavior. A calculator can confirm arithmetic, but a candidate should know why the result is correct and how it affects a device&#8217;s decision.<\/p>\n<p>IPv4 subnetting is ultimately a way of defining boundaries that the network will enforce through addressing and routing. Once those boundaries are understood, engineers can allocate VLANs without overlap, explain misleading host counts and determine whether a destination should stay on a link or be routed. The calculation becomes useful precisely when it predicts observable network behavior.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Two IPv4 addresses can look almost identical and still belong to different local networks. A client at 198.51.100.141\/27 and a server at 198.51.100.170\/27 share their first three octets, but the client&#8217;s subnet ends at 198.51.100.159. The server is in the next block. That boundary determines whether the client ordinarily tries to reach a neighbor directly [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1648,1650],"tags":[],"class_list":["post-178","post","type-post","status-publish","format-standard","hentry","category-all-certifications","category-cisco"],"_links":{"self":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/comments?post=178"}],"version-history":[{"count":4,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/178\/revisions"}],"predecessor-version":[{"id":28574,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/178\/revisions\/28574"}],"wp:attachment":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/media?parent=178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/categories?post=178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/tags?post=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}