- Learn
- Computer Science & IT
- Information Technology
- Networking Fundamentals
- IP Addressing and Subnetting
IP Addressing and Subnetting
BeginnerLesson 4 of 9 in Networking Fundamentals Course
What you will learn
- Convert octets between binary and decimal, and explain how a 32-bit IPv4 address is written and how it splits into a network part and a host part.
- Convert octets between binary and decimalUse the place values of an 8-bit octet to turn any number from 0 to 255 into binary and back, quickly and without errors.
- Explain how an IPv4 address is builtRead dotted-decimal notation, see that a mask decides where the network part ends, and recognize the historical address classes and why classless addressing replaced them.
- Convert octets between binary and decimal
- Write masks in dotted-decimal and CIDR prefix form, find the network address, broadcast address and usable host range of any IPv4 subnet, and use them to check a host's settings.
- Write subnet masks in dotted-decimal and prefix notationConvert between dotted-decimal masks and prefix lengths, recognize valid masks, and work out the size and block size of a subnet from its prefix.
- Find the network address, broadcast address and host rangeApply a mask to any IPv4 address, by the binary method or the block-size method, to find its subnet, its first and last usable addresses and its number of hosts.
- Check whether hosts share a subnet and verify host settingsDecide whether two addresses are in the same subnet, explain how a host chooses between direct delivery and its default gateway, and find address, mask and gateway errors.
- Write subnet masks in dotted-decimal and prefix notation
- Tell public from private and shared IPv4 addresses, explain why private addressing exists, and recognize the reserved ranges that have special meanings.
- Tell public addresses from private addressesRecognize the three private ranges and the shared address space, and explain how private networks reach the internet through address translation.
- Recognize special-purpose IPv4 addressesIdentify loopback, link-local (APIPA), unspecified, broadcast, multicast, reserved, documentation and benchmarking addresses, and use them when troubleshooting.
- Tell public addresses from private addresses
- Divide a block into equal subnets, design a variable-length plan that fits real host counts, and check a plan for alignment, overlap and blocks that can be combined.
- Divide a block into equal subnetsBorrow host bits to create a required number of equal subnets or subnets of a required size, and list every resulting subnet with its range.
- Design a variable-length (VLSM) address planSize each subnet to its own need, allocate subnets from largest to smallest on correct boundaries, and record a complete, non-overlapping plan with room to grow.
- Check blocks for overlap and combine them into a summaryTest whether a prefix is a valid network and whether two blocks overlap, and find the single prefix that summarizes a group of contiguous subnets.
- Divide a block into equal subnets
- Explain why IPv6 exists, write 128-bit addresses in full and shortened form, and find and plan IPv6 prefixes and subnets.
- Write IPv6 addresses in full and compressed formUse hexadecimal to read IPv6 addresses, apply the two shortening rules and the recommended text form, and describe how IPv4 and IPv6 run side by side.
- Find and plan IPv6 prefixes and subnetsRead prefix lengths, find the prefix of an address, divide a site prefix into /64 subnets and check an interface's IPv6 settings.
- Write IPv6 addresses in full and compressed form
- Recognize unicast, multicast and anycast addresses and the special IPv6 ranges from their prefixes, and build an interface ID with modified EUI-64.
- Recognize global unicast, unique local and link-local addressesIdentify the three main kinds of IPv6 unicast address from their first hex digits, and explain where each one can be used.
- Recognize multicast, anycast and special IPv6 addressesExplain why IPv6 has no broadcast, read multicast scopes and well-known groups, build a solicited-node address, and identify anycast, loopback, unspecified, mapped and documentation addresses.
- Build interface IDs, including modified EUI-64Describe the ways an interface gets its 64-bit interface ID, and build and recognize a modified EUI-64 interface ID from a MAC address.
- Recognize global unicast, unique local and link-local addresses
IP Addressing and Subnetting study guide
1Read IPv4 addresses in binary and dotted-decimal form
An IPv4 address looks like four ordinary numbers, but subnetting works on the bits behind them. Learn to move between those two views without losing your place. The same address can belong to different-sized networks depending on its mask, so reading the number is only the first step. You will also meet the old address classes, which still appear in networking vocabulary even though modern networks use explicit prefixes.
1.1 Convert octets between binary and decimal
An octet is a group of eight bits. Each bit holds either 0 or 1. An IPv4 address has four octets, making 32 bits in all. Start with one octet; the same method works on each of the four parts.
Give each bit its value
Read the positions from left to right:
| Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Each position is worth twice the one to its right. Add a position's value only when its bit is 1. For 10101100, the active positions are 128, 32, 8 and 4:
The zero in the 64 position contributes nothing. In 01100100, the 1s select 64, 32 and 4, giving 100. The leftmost bit carries the greatest value; 10000000 is 128, while 00000001 is 1.
Build binary from decimal
To convert 200, work through the same values in order. At each position, ask whether its value fits into the amount left.
- 128 fits: write 1 and leave 72.
- 64 fits: write 1 and leave 8.
- 32 and 16 do not fit: write 0 in both positions.
- 8 fits: write 1 and leave 0.
- The 4, 2 and 1 positions are all 0.
The result is 11001000. Check it by adding the selected values: 128 + 64 + 8 = 200. Once the remainder reaches zero, keep writing zeros until all eight positions are filled.
Write decimal 10 as 00001010 when it is an octet. The shorter binary number 1010 has the same value, but eight positions let you line up an address with its subnet mask. Do not treat a binary string as a decimal number: binary 00000100 means four, not one hundred.
Recognize mask patterns
Subnet masks repeatedly use octets whose 1s fill from the left. These patterns are useful enough to learn:
| Binary | Decimal | Binary | Decimal |
|---|---|---|---|
| 10000000 | 128 | 11111000 | 248 |
| 11000000 | 192 | 11111100 | 252 |
| 11100000 | 224 | 11111110 | 254 |
| 11110000 | 240 | 11111111 | 255 |
Each row adds another place value. For instance, 224 is 128 + 64 + 32. An octet of all zeros is 0; all ones sum to 255.
Count combinations
With one bit there are two possible patterns. With two bits there are four: 00, 01, 10 and 11. Each added bit doubles the possibilities, so bits give values. Eight bits give 256 values, numbered 0 through 255. This distinction between the number of values and the largest value matters when you count addresses.
Key Takeaways
- An octet has eight bits, with place values 128 through 1 from left to right.
- Add the values under 1 bits to convert binary to decimal.
- Convert decimal by testing each place value and subtracting those that fit.
- Write eight positions when lining an octet up with a mask.
- Eight bits give 256 values, from 0 to 255.
1.2 Explain how an IPv4 address is built
An IPv4 address is a 32-bit number used to identify a network interface. Its familiar form, dotted decimal, converts each of four octets to decimal and separates them with dots. The dots mark boundaries between octets; they are not decimal points.
Read four octets
The address 192.168.10.77 is:
11000000.10101000.00001010.01001101
The first octet is 128 + 64 = 192. The second is 128 + 32 + 8 = 168. The third is 8 + 2 = 10, and the fourth is 64 + 8 + 4 + 1 = 77. Each octet must be between 0 and 255. An address such as 192.168.1.256 is invalid because its final number needs more than eight bits.
The full space contains addresses: 4,294,967,296. Some are reserved for specific purposes, so this is not the number available for ordinary internet hosts.
An address belongs to an interface, the connection through which a device joins a network. A router connecting three IP networks needs addressing on all three interfaces. A laptop using Wi-Fi and Ethernet can have a different IPv4 address on each. This is why troubleshooting starts with the interface in use.
Find the boundary with a mask
Every address has a network portion and a host portion. The network portion identifies its subnet; the host portion selects an interface within that subnet. These are portions of the same 32 bits, not extra numbers added to the address.
The address alone does not show the split. With /16, 172.16.45.200 belongs to 172.16.0.0/16. With /21, it belongs to 172.16.40.0/21. The longer prefix keeps more bits in the network portion and leaves fewer for hosts. Always carry the prefix with an address when calculating its subnet.
Understand the old classes
Before CIDR, address classes supplied fixed default boundaries:
| Class | First octet | Old default or purpose |
|---|---|---|
| A | 1–126 | /8, mask 255.0.0.0 |
| B | 128–191 | /16, mask 255.255.0.0 |
| C | 192–223 | /24, mask 255.255.255.0 |
| D | 224–239 | Multicast groups |
| E | 240–255 | Reserved space |
The first bits are 0, 10, 110, 1110 and 1111, respectively. First octets 0 and 127 have special uses even though their leading bit is 0. For example, 150.20.0.9 falls in the historical class B range; 230.0.0.5 is a multicast group address.
Fixed classes wasted space. A network needing 300 host addresses would exceed a class C block's 254 usable addresses but use only a small part of a class B block's 65,534. Classless Inter-Domain Routing (CIDR) replaced fixed boundaries in 1993. A prefix can now be any length from 0 to 32. 10.1.2.0/24 is a valid classless block: the old class A label does not force it to use /8.
Key Takeaways
- IPv4 uses four decimal octets, each between 0 and 255.
- An address identifies an interface, so one device can have several addresses.
- A mask or prefix supplies the network/host boundary.
- Modern CIDR prefixes override historical class defaults.
2Use subnet masks and prefixes to find a subnet's boundaries
A subnet mask turns an address into a usable network plan. You will read masks in both common forms, find the first and last addresses of a subnet, and decide which addresses can go on interfaces. Then use the same calculations to check a host and its gateway. The key is to locate the boundary correctly: sometimes it falls within an octet, and sometimes the host portion spans more than the final octet.
2.1 Write subnet masks in dotted-decimal and prefix notation
A subnet mask marks which bits belong to the network. It has 32 bits: a continuous run of 1s from the left, followed by 0s. A 1 keeps the corresponding address bit in the network portion. A 0 marks a host position.
Count network bits
Prefix notation writes the number of mask 1s after a slash. /24 means 24 network bits and eight host bits. Its mask is 11111111.11111111.11111111.00000000, or 255.255.255.0.
For /21, split 21 into 8 + 8 + 5. The first two octets are 255. The next contains five 1s, 11111000, worth 248. The final octet is zero. The mask is 255.255.248.0.
To go the other way, count the 1s in each octet. 255.255.255.192 contains 8 + 8 + 8 + 2 = 26, so it is /26. The partly filled octet is often the only part you need to convert.
| Prefix | Mask | Host bits | Total addresses | Ordinary usable hosts |
|---|---|---|---|---|
| /24 | 255.255.255.0 | 8 | 256 | 254 |
| /25 | 255.255.255.128 | 7 | 128 | 126 |
| /26 | 255.255.255.192 | 6 | 64 | 62 |
| /27 | 255.255.255.224 | 5 | 32 | 30 |
| /28 | 255.255.255.240 | 4 | 16 | 14 |
| /30 | 255.255.255.252 | 2 | 4 | 2 |
Check that a mask is valid
A mask octet can be 0, 128, 192, 224, 240, 248, 252, 254 or 255. However, valid octets alone are not enough: the entire mask must keep the continuous run of 1s. After an octet below 255, every later octet must be zero. 255.255.0.255 fails because its 1s restart. 255.255.255.100 fails because binary 100 is 01100100, which breaks the pattern within one octet.
Count addresses and find the increment
If the prefix is , the host-bit count is . There are addresses. In an ordinary broadcast subnet, reserve the all-zero host pattern for the network and the all-one pattern for broadcast, leaving usable addresses. /31 and /32 have special uses and are handled separately.
The block size, or increment, is 256 minus the mask value in the octet where the mask stops being 255. With /26, that octet is the fourth: 256 − 192 = 64. Networks start at .0, .64, .128 and .192. With /21, the increment is 256 − 248 = 8 in the third octet; the fourth octet is still part of the host portion.
A larger prefix number means fewer addresses: /26 is smaller than /25. Each added network bit halves the possible host patterns.
Recognize the ends of the prefix scale
A /0 has no fixed network bits and mask 0.0.0.0; it covers the entire IPv4 space. A /32 fixes all 32 bits and has mask 255.255.255.255; it identifies one exact address. These endpoints help you read a default route or host prefix without trying to assign an ordinary usable-host count to it.
Read settings in different forms
Windows ipconfig displays a dotted-decimal mask. Linux ip addr attaches the prefix to the address. macOS ifconfig may display a hexadecimal mask such as 0xffffff00, equivalent to 255.255.255.0. These are different ways to show the same boundary.
Key Takeaways
- A valid mask has contiguous 1s followed by 0s.
- A prefix counts network bits; the remaining bits are host bits.
- Ordinary usable host count is .
- The increment is 256 minus the mask value in the boundary octet.
- A longer prefix describes a smaller block.
2.2 Find the network address, broadcast address and host range
The network address has every host bit set to 0. The broadcast address has every host bit set to 1. In an ordinary IPv4 subnet, the addresses between those endpoints are available for interfaces.
Apply the mask bit by bit
A bitwise AND keeps a 1 only when both input bits are 1. All other pairs give 0. ANDing an address with its mask preserves the network bits and clears the host bits.
For 192.168.10.77/26, the first 24 bits are fully masked. Work on the final octet:
Address: 01001101 (77)
Mask: 11000000 (192)
AND: 01000000 (64)
The network is 192.168.10.64. Six host bits remain. Set them all to 1: 01111111 is 127, making the broadcast 192.168.10.127. The usable range runs from 192.168.10.65 through 192.168.10.126, containing addresses.
The broadcast is one less than the next network address. Adding the whole block size to .64 produces .128, the next subnet, not this subnet's broadcast.
Use the block-size shortcut
For 172.16.45.200/21, convert /21 to 255.255.248.0. The boundary is in octet three, with increment 8. Multiples around 45 are 40 and 48, so 45 lies in the block starting at 40.
- Network:
172.16.40.0. - Next network:
172.16.48.0. - Broadcast:
172.16.47.255. - First and last usable:
172.16.40.1and172.16.47.254.
The full fourth octet is host space, so clear it to 0 for the network and fill it with 255 for the broadcast. The block has 11 host bits, giving usable addresses.
An address ending in .0 or .255 can still be a host address in a larger subnet. Both 172.16.41.0 and 172.16.44.255 lie between these endpoints. Their complete host portions are neither all zeros nor all ones. Judge all host bits, not only the last decimal number.
The increment describes movement in one octet, not always the number of addresses in the whole block. In the /21 example, eight third-octet values each contain 256 final-octet values, giving 2,048 total addresses. Subtracting the two reserved endpoints gives the same 2,046 usable addresses as the host-bit formula. Keep these two meanings of “block size” separate when the boundary is before octet four.
Handle /31 and /32 correctly
A /31 contains two addresses. On a supported point-to-point router link, both are usable under RFC 3021; no broadcast reservation is needed. For example, 10.0.0.8/31 can number its two endpoints as 10.0.0.8 and 10.0.0.9.
A /32 identifies one exact address, such as a router's logical loopback interface. It does not supply a range of hosts. Do not apply the ordinary subtract-two formula to either special case.
Check an endpoint calculation
Verify that the network begins on the increment, the original address falls within the block, and the next network begins immediately after the broadcast. For ordinary broadcast subnets, first usable is network + 1 and last usable is broadcast − 1. If the prefix cuts the third octet, a calculation that changes only the fourth octet has missed the boundary.
Key Takeaways
- AND the address with its mask to find the network address.
- Set all host bits to 1 to find the broadcast address.
- Use the increment in the octet where the prefix boundary falls.
- The next network is one address beyond the broadcast.
- An ending of .0 or .255 alone does not decide whether an address is usable.
- A supported /31 link uses both addresses; /32 identifies one address.
2.3 Check whether hosts share a subnet and verify host settings
A host uses its own address and mask to decide whether a destination is local. If both addresses produce the same network address under that mask, it sends directly on the local network. Otherwise, it sends to its default gateway, a router interface in its own subnet.
Compare networks, not the first three numbers
192.168.1.100/25 belongs to 192.168.1.0/25. The address 192.168.1.130/25 belongs to 192.168.1.128/25. Their first three octets match, but the /25 boundary divides the last octet in half. They are in different subnets.
The prefix also changes whether an address is assignable. 192.168.10.64 is a usable address in 192.168.10.0/25, whose hosts run from .1 to .126. In 192.168.10.64/26, the same .64 is the network address. You need both address and mask to judge it.
Check a gateway
Suppose a PC has 192.168.10.70/26 with gateway 192.168.10.1. The PC's subnet is 192.168.10.64/26, with hosts .65 through .126. The gateway .1 is outside that range, so it is not a valid directly connected gateway for these settings.
Check the address plan before changing anything. If the PC belongs in this subnet, use the address of the router interface serving it, such as .65 if that is the configured router address. If the PC belongs elsewhere, correct its address or mask to match that plan. A plausible unused address is not enough: the gateway entry must identify the actual router interface.
Notice mismatched masks
Host A is 192.168.1.10/24; host B is 192.168.1.200/25. A treats B as local. B places itself in 192.168.1.128/25 and treats A as remote. They disagree because their masks define different boundaries. Communication may fail or depend on routing behavior. Interfaces intended to share one subnet must use its planned prefix consistently.
A duplicate address causes a different problem: two interfaces claim the same address on the same network. Traffic may reach the wrong interface or fail intermittently. The fact that private addresses are reusable across separate organizations does not permit duplicates within one connected subnet.
Read the relevant settings
On Windows, run ipconfig or ipconfig /all. On Linux, ip addr shows addresses and prefixes; ip route shows a gateway after default via. On macOS, use network settings or ifconfig for the address and mask.
Ask whether the address is usable under its prefix, whether the actual gateway is in the subnet, and whether the prefix matches the plan. Also check uniqueness when symptoms are intermittent.
On Cisco IOS, an interface-mode command such as ip address 192.168.10.65 255.255.255.192 sets an IPv4 address. show ip interface brief lists interface addresses and status; it does not replace checking the configured mask. Separate routed interfaces normally need non-overlapping subnets, and IOS commonly rejects overlaps.
Key Takeaways
- Compare calculated network addresses under the same mask to test subnet membership.
- Use a directly connected router interface as the default gateway.
- Check the host address, prefix and gateway against the address plan.
- Keep interface addresses unique within a subnet.
3Distinguish public, private and special-purpose IPv4 addresses
An address can look ordinary and still have a special job. Private space belongs inside networks; other ranges identify local tests, temporary link-local settings, multicast groups or examples. Learning the exact boundaries helps you choose valid addresses and read troubleshooting clues. You will connect private addressing with NAT, then distinguish a useful clue about a fault from proof of its precise cause.
3.1 Tell public addresses from private addresses
Public IPv4 addresses are globally unique addresses eligible for routing across the internet. Most organizations obtain them from an ISP. IANA allocates space through five Regional Internet Registries: AFRINIC, APNIC, ARIN, LACNIC and RIPE NCC. Being public does not guarantee that a device will accept connections; routes and security settings still matter.
Learn the three private blocks
RFC 1918 reserves address space that organizations can reuse internally:
| Prefix | Inclusive range |
|---|---|
| 10.0.0.0/8 | 10.0.0.0–10.255.255.255 |
| 172.16.0.0/12 | 172.16.0.0–172.31.255.255 |
| 192.168.0.0/16 | 192.168.0.0–192.168.255.255 |
These addresses are not routed on the public internet. Two separate organizations may both use 10.1.0.0/24 internally. Within either connected subnet, each interface still needs its own address.
Pay particular attention to 172. Only second octets 16 through 31 are private. 172.20.10.2 lies inside the block, while 172.15.0.1 and 172.32.0.1 lie outside it. The mask 255.240.0.0 keeps the first four bits of the second octet fixed, spanning 16 possible second-octet values.
Connect private hosts to public networks
An edge router or firewall can perform network address translation (NAT). For an outgoing connection, it replaces a private source address with a public address and maintains the information needed to translate the reply.
Port address translation (PAT) lets several internal hosts share one public address. Port numbers help distinguish their connections. This reduces the public addresses an organization needs. NAT and PAT describe translation behavior; they are not extra private address ranges.
IPv4 has about 4.3 billion possible addresses, with substantial space reserved for special uses. IANA distributed its last general free pool blocks in February 2011. Private addressing with translation allows reuse; IPv6 supplies a much larger address space.
Recognize an ISP's shared space
100.64.0.0/10 spans 100.64.0.0 through 100.127.255.255. RFC 6598 reserves it for provider networks using carrier-grade NAT (CGNAT). It is neither public space nor one of the three RFC 1918 private blocks.
If a home router's outside interface shows 100.72.5.9, that address lies in the ISP's shared range. The provider may translate it again before traffic reaches the public internet. Calling every nonpublic address “RFC 1918” would hide this difference.
Choose space that can connect later
A large organization may divide the private 10.0.0.0/8 block into site and department networks. Small routers often default to 192.168.0.0/24 or 192.168.1.0/24. Before connecting two sites through a VPN, compare their plans. If both use the same subnet, an address such as 192.168.1.20 cannot uniquely identify which site's host is intended. Choose non-overlapping space for networks that will meet.
Key Takeaways
- RFC 1918 reserves exactly 10/8, 172.16/12 and 192.168/16.
- Only second octets 16–31 are private within the 172 range.
- NAT translates addresses; PAT separates shared-address connections through ports.
- 100.64.0.0/10 is ISP shared space, distinct from RFC 1918.
- Avoid overlapping private ranges when connecting sites.
3.2 Recognize special-purpose IPv4 addresses
Special-purpose addresses carry information about how a packet or interface is being used. Check the whole reserved range before treating an unfamiliar address as an ordinary public host.
Tests that stay on the host
127.0.0.0/8 is loopback space. 127.0.0.1 is the usual loopback address, but 127.0.0.53 is also inside the block. A loopback packet stays on the host. A successful ping 127.0.0.1 checks local IP software; the packet never tests the network cable or remote router.
Addresses limited to one link
IPv4 link-local space is 169.254.0.0/16. On Windows it is associated with Automatic Private IP Addressing (APIPA). A host that cannot obtain a DHCP address may select a local address from 169.254.1.0 through 169.254.254.255, using a /16 mask. The first and last /24 blocks are reserved for this selection process.
Such an address supports communication on the local link, not routed internet access. If a DHCP-configured workstation unexpectedly shows 169.254.37.12, check its link, switch port or VLAN and the path to DHCP. The address suggests failed automatic assignment; by itself it does not identify which component failed. A manually entered link-local address can look the same.
Separate the zero and broadcast meanings
0.0.0.0 can be a source meaning that the host has no address yet. In a server's listening settings, it means all local IPv4 addresses. With /0, 0.0.0.0/0 names every IPv4 destination and is used for a default route. The prefix changes the meaning.
255.255.255.255 is the limited broadcast, kept on the local network. A subnet's own broadcast, such as 192.168.10.127 for 192.168.10.64/26, is a directed broadcast. Routers normally disable forwarding of directed broadcasts by default.
Know the other ranges
| Range | Purpose |
|---|---|
| 224.0.0.0/4 | Multicast groups, through 239.255.255.255 |
| 240.0.0.0/4 | Reserved space; its last address is limited broadcast |
| 192.0.2.0/24 | Documentation, TEST-NET-1 |
| 198.51.100.0/24 | Documentation, TEST-NET-2 |
| 203.0.113.0/24 | Documentation, TEST-NET-3 |
| 198.18.0.0/15 | Network benchmark testing, through 198.19.255.255 |
A multicast address identifies a group destination, not a host's own unicast address. The smaller block 224.0.0.0/24 is reserved for local-link control traffic. Examples include 224.0.0.5 for OSPF routers and 224.0.0.251 for multicast DNS.
Documentation blocks let instructions show realistic address calculations without naming a live public host. Benchmark space serves controlled performance tests. Neither category becomes an ordinary internet host range simply because it is outside RFC 1918. IANA's special-purpose registry is the reference for less familiar blocks.
Key Takeaways
- Loopback traffic stays on the host.
- Unexpected APIPA settings suggest a DHCP assignment or connectivity problem.
- 0.0.0.0, 0.0.0.0/0 and a server listening on 0.0.0.0 have different meanings.
- Limited broadcast stays local; directed broadcast depends on the subnet.
- Multicast identifies group destinations.
- Documentation and benchmark ranges have separate reserved purposes.
4Subnet an IPv4 address block
Subnetting gives each network enough addresses without letting its range collide with another. Begin with equal-sized blocks, then fit different host counts with VLSM. Planning also means checking what remains free: enough addresses in total can still be unusable if they are split across the wrong boundaries. Finally, learn when several blocks can be named by one shorter prefix and when that summary would include extra space.
4.1 Divide a block into equal subnets
Subnetting divides an address block by moving bits from the host portion into the network portion. All resulting blocks are smaller and have longer prefixes. When they all use the same prefix, the plan is called fixed-length subnet masking (FLSM).
Choose enough subnet bits
Borrowing bits creates equal subnets. Add to the starting prefix. From 192.168.10.0/24, suppose you need six subnets. Two extra bits give four subnets, which is too few. Three give eight, so use /27.
A /27 leaves five host bits, giving usable addresses in each subnet. Its mask is 255.255.255.224, and its increment is 32 in the last octet.
| Network | Usable final octets | Broadcast final octet |
|---|---|---|
| 192.168.10.0/27 | 1–30 | 31 |
| 192.168.10.32/27 | 33–62 | 63 |
| 192.168.10.64/27 | 65–94 | 95 |
| 192.168.10.96/27 | 97–126 | 127 |
| 192.168.10.128/27 | 129–158 | 159 |
| 192.168.10.160/27 | 161–190 | 191 |
| 192.168.10.192/27 | 193–222 | 223 |
| 192.168.10.224/27 | 225–254 | 255 |
The first and last subnets are valid. Subtract two for network and broadcast addresses inside an ordinary subnet, not from the number of subnets. The old rule that avoided “subnet zero” and the all-ones subnet does not apply to modern classless planning.
Choose enough host bits
If the requirement gives host count, choose the smallest host-bit count satisfying at least equal to that count. Then calculate the prefix as .
For 500 usable addresses, eight host bits give 254, which is too few. Nine give 510, so use /23. For 30 usable addresses, /27 fits exactly; 31 requires /26.
Count every interface that needs an address. Thirty computers plus a router gateway need 31 usable addresses, even before printers, servers or switch management. If a stated host count already includes the gateway, do not add it a second time.
A prefix change can also carry the list across an octet boundary. Dividing 10.30.8.0/22 into /25s borrows three bits and gives eight blocks. Their starts are 10.30.8.0, 10.30.8.128, 10.30.9.0, 10.30.9.128, continuing through 10.30.11.128. After the final-octet .128 block, the next start increments octet three and resets octet four. Every block still contains 128 total addresses.
Test both limits
A plan can pass the host test and fail the subnet test. Five LANs needing 40 usable addresses each require five /26 blocks. A /24 holds only four of those blocks. The five blocks require 320 total addresses, so they cannot fit into 256. A /23 has room for eight /26 blocks.
Conversely, making many very small blocks can satisfy the subnet count while leaving too few host addresses in each. Start with the supplied parent block, calculate the candidate prefix, and check both requirements before listing networks.
FLSM keeps the plan simple, but all networks receive the same size. Giving a two-interface router link a /27 leaves 28 usable addresses unused. When needs differ substantially, different prefix lengths can use the parent space more efficiently.
Key Takeaways
- Borrowing bits produces equal subnets.
- Find the smallest block that fits every required interface.
- Add gateways and other infrastructure unless the stated count includes them.
- Check subnet count and usable hosts together.
- All subnets, including the first and last, are available in modern classless plans.
4.2 Design a variable-length (VLSM) address plan
Variable-length subnet masking (VLSM) gives each subnet its own prefix length. A large LAN can receive a /25, a smaller LAN a /27, and a two-interface router link a /30, all inside one parent block.
Size the requirements first
Plan 192.168.50.0/24 for three LANs needing 100, 50 and 20 usable addresses, plus two router links. Here the LAN counts already include their gateways.
- 100 needs seven host bits: 126 usable, so
/25. - 50 needs six: 62 usable, so
/26. - 20 needs five: 30 usable, so
/27. - Each link uses
/30: two usable addresses.
Reserve expected growth before making these choices. A current count of 50 may fit a /26, but a requirement of 70 after growth does not.
Allocate largest to smallest
Large blocks have fewer possible starting positions. In a /24, a /25 starts at .0 or .128. Allocating small blocks first can split free space across both halves and leave no whole /25.
| Use | Network | Usable addresses | Broadcast |
|---|---|---|---|
| LAN A | 192.168.50.0/25 | .1–.126 | .127 |
| LAN B | 192.168.50.128/26 | .129–.190 | .191 |
| LAN C | 192.168.50.192/27 | .193–.222 | .223 |
| Link 1 | 192.168.50.224/30 | .225–.226 | .227 |
| Link 2 | 192.168.50.228/30 | .229–.230 | .231 |
All abbreviated addresses in the table begin with 192.168.50. The masks are 255.255.255.128, .192, .224 and .252, respectively.
After placing a block, move to the next free address that is aligned for the next block's size. A /26 must start on a multiple of 64 in the last octet. 192.168.50.100/26 is a host address within the .64 block, not a new network beginning at .100.
Account for the free space
The plan uses 128 + 64 + 32 + 4 + 4 = 232 total addresses. Addresses .232 through .255 remain free: 24 addresses, expressible as 192.168.50.232/29 and 192.168.50.240/28.
A fourth LAN needing 20 usable addresses requires a whole /27, or 32 total addresses. It cannot fit in those 24 remaining addresses. Even when a free total is large enough, its alignment and continuity must also suit the requested block. Starting from a /23 would provide more room to preserve larger growth blocks.
On a supported point-to-point link, a /31 uses both of its two addresses and consumes half the space of a /30. Choose the link convention before completing the plan; its endpoints must support it.
A growth allowance can change a prefix at a sharp threshold. A LAN needing 14 usable addresses fits /28, but adding one more required interface raises the need to 15 and forces /27. Its allocation doubles from 16 total addresses to 32. Add expected devices to the usable requirement before rounding to a power-of-two block; adding a few spare addresses after choosing /28 cannot enlarge that block beyond its boundary.
Audit the plan
Record each network, prefix, dotted mask, usable range and broadcast. Check that every subnet fits its requirement, starts on its own boundary, stays inside the parent block and does not overlap another allocation.
Key Takeaways
- VLSM uses different prefix lengths within one parent block.
- Size every requirement before allocating space.
- Place the largest blocks first on their proper boundaries.
- Record network, mask, usable range and broadcast for each allocation.
- Free space must be sufficiently large, contiguous and aligned for growth.
- A supported /31 can save space on a point-to-point link.
4.3 Check blocks for overlap and combine them into a summary
A usable plan needs distinct, correctly aligned blocks. Summarization, also called aggregation or supernetting, then names suitable groups of blocks with one shorter prefix. The checks for overlap and summary both depend on address boundaries.
Check alignment and overlap
A network address must have all host bits zero. For /26, the last-octet increment is 64. 192.168.1.32/26 is therefore not a network beginning at .32; it lies inside 192.168.1.0/26.
Two correctly aligned CIDR blocks either stay separate or one contains the other. 10.0.0.0/23 covers 10.0.0.0 through 10.0.1.255. A proposed 10.0.1.0/24 lies completely inside it. They overlap even though their written network addresses differ.
To test this efficiently, apply the shorter prefix to both network addresses. If the results match, the more specific block lies inside the less specific one. You can also compare the complete first-to-last ranges. Separate allocations in one address plan must not claim any of the same addresses.
Find an exact summary
Consider four networks: 172.16.0.0/24, 172.16.1.0/24, 172.16.2.0/24 and 172.16.3.0/24. They are contiguous and contain 1,024 addresses in all.
The first two octets share 16 bits. In the third octet, 0 is 00000000 and 3 is 00000011; they share the first six bits. Keeping 22 bits gives 172.16.0.0/22, covering exactly 172.16.0.0 through 172.16.3.255.
For an exact single-block summary, the combined coverage must be continuous, contain a power-of-two number of addresses, and start on the matching boundary. With equal-sized input blocks, their count must also be a power of two. Different-sized blocks can combine: 192.168.10.0/25, 192.168.10.128/26 and 192.168.10.192/26 fill one complete /24.
Distinguish covering from exact
Four /24 blocks from 172.16.1.0/24 through 172.16.4.0/24 also contain 1,024 addresses, but they start at the wrong boundary for /22. The smallest single block containing them is 172.16.0.0/21. It includes additional /24 blocks outside the requested group.
Use the first address of the first block and the last address of the last block to check a covering prefix. Looking only at network addresses can miss the size of the final block. For example, 10.20.0.0/24 plus 10.20.1.0/23 cannot be treated as two valid adjacent allocations: the second label is misaligned and actually falls within 10.20.0.0/23.
An address plan that gives each site a contiguous aligned parent block is easier to summarize and extend. For example, separate site blocks 10.1.0.0/16 and 10.2.0.0/16 let each site's smaller subnets retain a clear common prefix.
Key Takeaways
- Check network alignment before comparing blocks.
- Aligned CIDR blocks either do not overlap or one contains the other.
- An exact summary requires continuous coverage, a power-of-two size and an aligned start.
- A covering prefix can include addresses beyond the requested blocks.
5Write and read IPv6 addresses and prefixes
IPv6 expands the address space and changes how addresses are written. Hexadecimal groups replace dotted decimal, and careful shortening makes long addresses easier to read without changing their bits. You will expand and compress addresses, then divide a site prefix into LAN subnets. The main planning shift is to count subnets and preserve the /64 LAN structure, instead of choosing LAN sizes from individual host counts.
5.1 Write IPv6 addresses in full and compressed form
IPv6 uses 128-bit addresses, compared with IPv4's 32 bits. Its space contains about addresses. The larger space supports globally unique addressing at a scale IPv4 cannot provide.
Read hexadecimal groups
Hexadecimal uses 0–9 and a–f; a means 10 and f means 15. Each digit represents four bits, a nibble. Hex 4b represents 0100 1011, or decimal 75. Four hex digits form a 16-bit group, often called a hextet.
A full IPv6 address has eight groups, separated by colons:
2001:0db8:0000:0000:0008:0800:200c:417a
Count eight groups of 16 bits to account for all 128 bits. Hex letters are case-insensitive, but the recommended text form uses lowercase.
Shorten without changing values
First remove leading zeros inside each group. 0db8 becomes db8, 0008 becomes 8, and 0000 becomes 0. Keep internal and trailing zeros: 0800 becomes 800, not 8.
Next, replace one continuous run of all-zero groups with ::. Use it only once. Two double colons would leave the division of missing groups ambiguous. The full example becomes 2001:db8::8:800:200c:417a.
RFC 5952 recommends compressing the longest run. If runs tie, compress the first. Leave a single zero group as 0:
| Address after removing leading zeros | Recommended form |
|---|---|
| 2001:db8:0:1:0:0:0:1 | 2001:db8:0:1::1 |
| 2001:db8:0:0:1:0:0:1 | 2001:db8::1:0:0:1 |
| 2001:db8:0:1:1:1:1:1 | 2001:db8:0:1:1:1:1:1 |
The last address has only one zero group, so recommended form keeps it visible. A valid IPv6 spelling and the recommended spelling are different questions: some valid forms are longer or use uppercase.
Expand a short address
For 2001:db8:acad:12::100, five groups are visible. Eight minus five leaves three zero groups represented by ::. Insert them, then pad each group to four digits:
2001:0db8:acad:0012:0000:0000:0000:0100
This expansion also shows why 2001:db8::1 and 2001:db8::1:0 differ. Their final 16 bits differ; removing a trailing zero group changes the address.
In a URL, square brackets separate an IPv6 literal from a port: http://[2001:db8::10]:8080/. Here the brackets are part of URL syntax, while the colons inside identify the address.
Recognize coexistence approaches
IPv4 and IPv6 use different packet formats and do not communicate directly. Dual stack runs both protocols, allowing each connection to use the appropriate one. Tunneling carries packets of one protocol inside packets of the other across an intervening network. NAT64, commonly paired with DNS64, translates between IPv6-only clients and IPv4-only servers. These are different jobs: adding an IPv6 address to a dual-stack host does not translate an IPv4 packet.
Key Takeaways
- IPv6 writes 128 bits as eight hexadecimal groups.
- Remove leading zeros within groups, keeping internal and trailing zeros.
- Use :: once; recommended form compresses the longest run of at least two zero groups.
- When runs tie, compress the first and use lowercase.
- Expand :: by restoring enough groups to make eight.
- Dual stack, tunneling and translation solve different coexistence needs.
5.2 Find and plan IPv6 prefixes and subnets
An IPv6 prefix keeps the first stated number of bits. 2001:db8:acad:12::25/64 has a 64-bit network prefix and a 64-bit interface ID. IPv6 uses slash prefixes, not dotted-decimal subnet masks.
Keep a /64 for LANs
The standard LAN subnet is /64. It supports the 64-bit interface IDs used by SLAAC and modified EUI-64. One /64 contains addresses, about , so LAN planning does not shrink blocks to match a few dozen hosts.
For a /64, keep the first four full groups and clear the other four. The address 2001:db8:acad:12:a::1/64 belongs to 2001:db8:acad:12::/64. That prefix remains a complete IPv6 address: omitting the :: would leave only four written groups with no notation for the missing ones.
Separate site, subnet and interface
A typical site plan contains a global routing prefix, a subnet ID and the interface ID. If the site receives a /48, its first three groups are fixed. Group four provides 16 subnet bits before the /64 interface boundary.
The subnet count is . Count through the fourth group from 0 to ffff:
2001:db8:acad::/64.2001:db8:acad:1::/64.2001:db8:acad:2::/64.- Continue through
2001:db8:acad:ffff::/64.
A /56 leaves eight subnet bits, giving LAN subnets. For 2001:db8:acad:4b00::/56, the first two hex digits of group four, 4b, remain fixed. The /64 subnet group can run from 4b00 through 4bff.
Read boundaries inside groups
Each hex digit holds four bits. Prefix lengths divisible by four fall on nibble boundaries, which are easy to see. For /56, keep 14 hex digits. Applying it to 2001:db8:acad:4b7f::25 produces 2001:db8:acad:4b00::/56: the final two digits of group four become zero.
Subnet IDs are hexadecimal. An ID written 10 represents decimal 16, not ten. A plan can label VLAN 10 with subnet text 10, but that is a naming choice, not decimal arithmetic.
The subnet-count rule also works away from nibble boundaries. A /55 site leaves nine bits before /64, so it holds 512 LANs. For 2001:db8:acad:4a00::/55, the LAN group runs from 4a00 through 4bff: one bit of the second hex digit in that group can vary. A /56 beginning at 4a00 instead stops at 4aff. Use bit counts when a prefix cuts through a hex digit; visually keeping whole digits would lose that extra subnet bit.
Router-to-router links can use /64 or a /127; the latter holds exactly two addresses under RFC 6164. This point-to-point choice does not change the standard /64 layout for LANs.
Configure and verify an interface
In Cisco IOS interface configuration mode, ipv6 address 2001:db8:acad:1::1/64 assigns an address. Appending eui-64 to a /64 prefix command asks the router to build the ID from its MAC address. show ipv6 interface brief lists addresses, including link-local ones. Windows ipconfig and Linux ip -6 addr also show IPv6 settings. Verify the prefix as well as the address: a correct-looking host ID cannot fix a wrong subnet prefix.
Key Takeaways
- Use /64 LANs with a 64-bit interface ID.
- A /48 supplies 65,536 /64 subnets; a /56 supplies 256.
- Clear every bit after the prefix to find the network address.
- Nibble boundaries align prefixes with complete hexadecimal digits.
- A /127 is a two-address router-link prefix.
6Identify IPv6 address types and interface IDs
An IPv6 interface often holds several addresses at once, each with a different reach or purpose. Learn what their prefixes reveal, how multicast replaces broadcast, and why anycast cannot be recognized from its spelling alone. You will also build a modified EUI-64 interface ID from a MAC address, then relate that method to privacy and duplicate-address checks when reading real interface output.
6.1 Recognize global unicast, unique local and link-local addresses
A unicast address identifies one interface. An IPv6 interface normally has a link-local address and may also have global or unique local addresses. Several addresses on one interface are expected, so inspect each address's role before deciding which one to use.
Global unicast addresses
The currently allocated global unicast space is 2000::/3, beginning with hex 2 or 3. These addresses are intended for globally unique, internet-routable unicast communication. The range also contains special-purpose reservations: 2001:db8::/32 and 3fff::/20 are documentation space, for example. A leading 2 or 3 is a first classification clue, not permission to assign an arbitrary address from that space.
As with public IPv4, global scope does not guarantee that a service is reachable. The network must route the prefix, and security policy may block traffic.
Link-local addresses
The reserved link-local prefix is fe80::/10. Its address format uses zero bits through the /64 boundary, followed by a 64-bit interface ID, so normal addresses appear as fe80::....
Link-local addresses serve communication on one link. Routers never forward packets with a link-local source or destination onto another link. IPv6 neighbor discovery and router advertisements use this local reach; a host's default gateway is often a router's link-local address.
Because fe80::1 can exist on several separate links, a host may need a zone index to select the interface. fe80::1%eth0 identifies the Linux interface named eth0. Windows may show an interface number, such as %12. The zone is local information, not another part of the 128 address bits.
Unique local addresses
Unique local addresses (ULAs) occupy fc00::/7. Locally assigned ULAs begin with fd, from fd00::/8. A site prefix combines that beginning with a 40-bit randomly chosen Global ID, producing a /48. Next come a 16-bit subnet ID and a 64-bit interface ID.
For example, fd3c:9a21:7b04::/48 provides site-local addressing without depending on an ISP's global prefix. The random Global ID makes accidental overlap between independently planned sites unlikely. ULAs are not routed on the public internet, but they work within a routed organization without requiring NAT.
A host can use a ULA for an internal service and a global address for an internet service. Its source-address selection chooses an appropriate address for the connection. The older fec0::/10 site-local category was deprecated and replaced by the ULA approach.
| Type | Prefix clue | Intended reach |
|---|---|---|
| Global unicast | Allocated from 2000::/3 | Internet routing, except reserved subranges |
| Unique local | fc00::/7; locally assigned fd00::/8 | Private routed networks |
| Link-local | fe80::/10 | One link only |
A ULA and a link-local address therefore serve different needs: an organization can route a ULA between its internal subnets, while a link-local address stays on its originating link.
Key Takeaways
- One IPv6 interface can have several unicast addresses.
- Global allocation begins with 2 or 3, but reserved subranges have special uses.
- Link-local addresses stay on one link and may need a zone index.
- Locally assigned ULAs begin with fd and can be routed internally.
6.2 Recognize multicast, anycast and special IPv6 addresses
IPv6 has no broadcast addresses. It uses multicast groups for many tasks that need delivery to multiple interested interfaces. Other special addresses identify local tests, unconfigured sources or compatibility with IPv4.
Read multicast groups and scopes
Multicast addresses begin with ff, the ff00::/8 range. The next four bits are flags and the following four specify scope, the area in which the group is valid. Scope 1 is interface-local, 2 link-local, 5 site-local, 8 organization-local and e global. A multicast address is a destination, never a packet's source.
| Group | Members |
|---|---|
| ff02::1 | All nodes on the link |
| ff02::2 | All routers on the link |
| ff02::1:2 | DHCPv6 servers and relay agents on the link |
| ff05::1:3 | DHCPv6 servers in the site |
A solicited-node multicast address combines ff02::1:ff00:0/104 with the last 24 bits of a unicast address. For 2001:db8:acad:1::7:3a, expand the ending to 0007:003a. The last 24 bits are 07:003a, giving ff02::1:ff07:3a. Neighbor discovery can send a request to this smaller group instead of all nodes. Different unicast addresses can share the same last 24 bits, so the group need not identify just one interface.
Distinguish anycast from multicast
Anycast configures the same unicast address on several interfaces. Routing delivers a packet to one selected destination, according to routing metrics and policy. It need not be the geographically closest server or the one with the lowest measured delay. Public DNS services use this approach in IPv4 as well as IPv6.
Multicast delivers to group members; anycast selects one destination. An anycast address has no special visible prefix: the configuration and routing make it anycast.
Recognize special single addresses
::1/128 is loopback, the single IPv6 address for traffic that stays on the host. ::/128, normally written ::, is the unspecified address, used as a source before an address is available. With /0, ::/0 instead describes all IPv6 destinations and denotes a default route.
Documentation prefixes are 2001:db8::/32 and 3fff::/20. They support examples without naming live global hosts.
Recognize IPv4 embedded in IPv6 text
IPv4-mapped addresses use ::ffff:0:0/96 on dual-stack hosts. ::ffff:192.0.2.10 is equivalent to ::ffff:c000:20a; the last 32 bits hold the IPv4 value.
You can check the embedded value one byte at a time. Decimal 192 becomes hex c0, 0 becomes 00, 2 becomes 02 and 10 becomes 0a. Grouping the bytes as c000:020a preserves all 32 bits; shortening removes only the leading zero from 020a. This is why a dotted-decimal ending and a hexadecimal ending can name the same mapped value.
The NAT64 well-known prefix is 64:ff9b::/96, so 64:ff9b::192.0.2.10 is 64:ff9b::c000:20a. Although both forms embed IPv4 bits, they serve different purposes. A mapped address represents an IPv4 endpoint within a host's IPv6 programming interface; the NAT64 prefix identifies addresses used by a translator.
Key Takeaways
- IPv6 replaces broadcast tasks with multicast groups.
- The multicast scope limits a group’s reach.
- Solicited-node groups use the unicast address’s last 24 bits.
- Anycast selects one routed destination and has no distinct address spelling.
- ::1 is loopback; :: is unspecified; ::/0 is a default route.
- Mapped and NAT64 addresses embed IPv4 bits for different purposes.
6.3 Build interface IDs, including modified EUI-64
In a /64 subnet, the interface ID is the final 64 bits of the address. It can be set manually, assigned by DHCPv6, or created by the host through SLAAC. Host-created IDs may be random or follow modified EUI-64.
Turn a MAC address into an ID
A MAC address has 48 bits. Modified EUI-64 expands it to 64 bits and changes one bit. Use MAC 00:1a:2b:3c:4d:5e:
- Split it into two 24-bit halves:
001a2band3c4d5e. - Insert
fffebetween them:001a2bfffe3c4d5e. - Regroup into four hextets:
001a:2bff:fe3c:4d5e. - Flip the universal/local bit in the first byte. Its value is 2, the seventh bit from the left. Binary
00000000becomes00000010, so00becomes02.
The ID is 021a:2bff:fe3c:4d5e. Combined with 2001:db8:acad:1::/64, it gives 2001:db8:acad:1:21a:2bff:fe3c:4d5e. The leading zero of 021a disappears in recommended IPv6 text. A link-local address using this ID is fe80::21a:2bff:fe3c:4d5e.
Flip the bit in either direction
“Flip” means change 0 to 1 or 1 to 0. It does not always mean add 2. A first byte of 02 changes to 00. For MAC 3c:22:fb:12:34:56, first byte 3c is 00111100. Flipping its bit worth 2 gives 00111110, or 3e. The final ID is 3e22:fbff:fe12:3456.
Insert fffe between the original halves before grouping into hextets. It appears across the middle hextet boundary, in the pattern xxxx:xxff:fexx:xxxx. Appending it at the end produces a different ID.
Read an ID carefully
The middle ff:fe pattern suggests modified EUI-64, but a manually chosen or random ID can contain the same bits. Recover a MAC only when you know this method was used: remove the inserted fffe, then flip the bit worth 2 again. The operation reverses itself.
For a reverse calculation, suppose 0a64:22ff:fe12:ab34 is known to be modified EUI-64. Remove the middle fffe to recover 0a:64:22:12:ab:34. Flip the first byte’s bit worth 2: 0a becomes 08. The original MAC is 08:64:22:12:ab:34. Removing the marker alone would leave the wrong first byte; undo both construction steps.
A MAC-derived ID can let observers link a device's activity across networks. Modern desktop and mobile systems commonly use stable per-network IDs and temporary IDs for outgoing connections, reducing that exposure. A random-looking ID is normal; SLAAC does not require a MAC-derived value.
Check uniqueness before use
A host performs duplicate address detection (DAD) for a new unicast address. It sends a neighbor solicitation from the unspecified source :: to the address's solicited-node multicast group. If a conflict is detected, the host cannot use that address. Otherwise, it can move from tentative to usable after the check completes. A 64-bit interface ID and a correct prefix establish the address's shape; DAD checks whether it is already in use on the link.
Key Takeaways
- An interface ID can be manual, server-assigned or host-created.
- Modified EUI-64 inserts fffe between a MAC address’s 24-bit halves.
- Flip the first byte’s bit worth 2 in either direction.
- The ff:fe pattern is a clue; configuration establishes how an ID was made.
- Random IDs reduce exposure of a device’s MAC-derived identity.
- DAD checks a tentative unicast address for a local conflict.
IP Addressing and Subnetting examples
1Read IPv4 from the bits up
10 steps
- 1IntroductionSee the bits behind an address
A subnet calculation becomes easier when decimal numbers and binary positions describe the same thing to you. Start with one octet, convert it in both directions, and then place it in a complete IPv4 address.
You will use the mask to separate network and host positions. The dots make an address easier to read, but they do not determine that boundary.
- 2ExplanationGive eight positions their values
An octet has eight positions, worth 128, 64, 32, 16, 8, 4, 2 and 1 from left to right. A bit set to 1 contributes its value; a bit set to 0 contributes nothing.
Think of eight switches, each controlling one fixed amount. Turning on 128 and 64 selects 192. Turning on 8 and 1 as well selects 201; the positions themselves never move.
- 3ExampleConvert 205 by subtraction
Begin with decimal 205. Select 128, leaving 77, then 64, leaving 13. Skip 32 and 16 because they do not fit. Select 8, leaving 5; select 4, leaving 1; skip 2 and select 1.
The eight decisions are
11001101. Check the selected amounts: 128 + 64 + 8 + 4 + 1 = 205. Keep zeros in the skipped positions so the bits remain aligned. - 4ChallengeRead a new octet
What decimal number is
01011001? Work from the eight place values before revealing the answer.---reveal---
The 1 bits select 64, 16, 8 and 1, giving 89. The first zero contributes nothing; it does not shift the remaining digits. A full octet keeps the 64 position second from the left, whether or not the 128 bit is set.
- 5Key InsightSeparate patterns from maximum values
Eight bits give patterns, but the largest decimal value is 255 because the first pattern represents zero. Three bits similarly give eight values, numbered 0 through 7.
This difference matters in addressing: a count tells you how many patterns exist, while a maximum tells you the label on the last one. They differ by one when numbering begins at zero.
- 6ExampleAssemble four octets
Place decimal 205 after three other octets to write
192.168.7.205. The complete binary address is11000000.10101000.00000111.11001101. Four eight-bit groups make 32 bits.Each decimal component must fit in one octet. Replacing 205 with 305 would make the address invalid, because 305 cannot fit in eight bits; a dot does not create extra capacity.
- 7ExplanationLet the mask decide the split
The network and host portions share those same 32 bits. With
/24, the first 24 bits identify the network and the final eight identify positions within it. With/26, two more bits belong to the network.The address remains unchanged, but the network is smaller. An interface address without its prefix cannot tell you exactly which other addresses are local.
- 8ConnectionUse classes as historical vocabulary
Older classful defaults were
/8for class A,/16for class B and/24for class C. Their ordinary first-octet ranges were 1–126, 128–191 and 192–223.CIDR removed these fixed boundaries. A configured prefix such as
/26supplies the actual mask even when an address falls in the old class C range. Class D names multicast; class E names reserved space. - 9ChallengeCombine notation and prefix reading
An interface shows
10.19.7.205/26. How many bits are in its complete address, and how many are host bits?---reveal---
The complete IPv4 address has 32 bits. The
/26assigns 26 to the network, leaving six host bits. Its historical class A beginning does not replace the explicit prefix with/8; each octet still occupies eight positions. - 10RecapCarry the address and prefix together
You can now translate octets without changing bit positions and read their four-part IPv4 form. Use the explicit prefix whenever you divide the 32-bit address into network and host portions.
For the next calculation, keep both pieces of information visible: the address supplies the bits to examine, and the mask tells you which of them to preserve for the network.
2Find a subnet and check a host
14 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionTurn one address into a range
- 2ExampleTranslate /26 into a mask
- 3ChallengeCheck another mask
- 4ExampleLocate the enclosing block
- 5ExampleCheck with binary AND
- 6ExampleFind the final and usable addresses
- 7ExampleMove the boundary to octet three
- 8ChallengeDecide whether .0 is usable
- 9TipRecognize the small-prefix exceptions
- 10ExplanationChoose local delivery or a gateway
- 11ChallengeInspect a gateway entry
- 12TipCheck settings in interface output
- 13ChallengeCombine host validity and gateway checks
- 14RecapCheck the boundary before the settings
3Read address categories during troubleshooting
9 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionUse ranges as practical clues
- 2ExplanationRead the private range boundaries
- 3ChallengeClassify two nearby addresses
- 4ConnectionSeparate NAT, PAT and provider space
- 5ExampleInterpret unexpected link-local settings
- 6ChallengeDistinguish local software from a local link
- 7ExplanationKeep broadcasts and groups distinct
- 8ChallengeRead an example-address report
- 9RecapMatch the category to the evidence
4Allocate and audit a VLSM plan
14 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionBuild a plan that fits
- 2ExampleTest an equal-sized choice
- 3ChallengeCheck count and capacity together
- 4ExampleChoose a size for each requirement
- 5ExampleAllocate the largest LAN
- 6ExamplePlace the middle LAN
- 7ExamplePlace the small LAN and link
- 8Key InsightInspect what remains free
- 9ChallengeMake a growth decision
- 10ExampleTest a proposed extra allocation
- 11ExplanationCombine blocks only when coverage fits
- 12ChallengeFind the summary of unequal blocks
- 13ChallengeAudit the original plan
- 14RecapSave the ranges, not just the labels
5Shorten IPv6 and find its LAN
12 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionRead long addresses with confidence
- 2ExplanationRead eight hexadecimal groups
- 3ExampleCompress the longest zero run
- 4ChallengeCheck the shortened form
- 5ConnectionSeparate compression from compatibility
- 6ExampleKeep four groups for a /64
- 7ExplanationCount site subnet bits
- 8ExampleFollow a /56 across group four
- 9ChallengeApply the /56 boundary
- 10TipRead hexadecimal IDs and link prefixes
- 11ChallengeCombine shortening and subnet membership
- 12RecapKeep notation and allocation distinct
6Identify IPv6 roles and build an interface ID
14 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionRead an interface with several addresses
- 2ExplanationGive each unicast address a role
- 3ExampleSelect the link for a local address
- 4ChallengeChoose an address for internal routing
- 5ExplanationReplace broadcast with interested groups
- 6ExampleBuild a solicited-node group
- 7ChallengeDistinguish group delivery from anycast
- 8ConnectionRecognize the all-zero special case
- 9ExampleExpand a MAC to 64 bits
- 10ExampleFlip the bit worth two
- 11ChallengeCheck the direction of the flip
- 12TipTreat ID appearance as a clue
- 13ChallengeConnect multicast to duplicate detection
- 14RecapRead scope before interpreting an ID
IP Addressing and Subnetting practice questions
Set 1: IPv4 bits, masks and address boundaries10 Practice Questions
Question 1 of 10
192.168.84.158/28. The address plan reserves the first usable address of each subnet for its router. What default gateway should this host use?Show answerHide answer
192.168.84.144/28, whose usable addresses run from .145 through .158. The plan reserves the first usable address, .145, for its router. Address .144 names the network, while .159 is broadcast; neither can serve as the gateway interface address.Question 2 of 10
172.29.8.4 classified?Show answerHide answer
172.16.0.0 through 172.31.255.255, so a second octet of 29 places this address inside it. Treating it as public would overlook the /12 range. Shared provider space begins at 100.64, and link-local space begins at 169.254.Question 3 of 10
127.0.0.1, but cannot reach its gateway. What has the successful ping tested?Show answerHide answer
Question 4 of 10
192.168.42.183/27?Show answerHide answer
/27 has an increment of 32 in the last octet, and 183 lies between 160 and 191. Its network is therefore 192.168.42.160. The nearby value .176 aligns to a smaller block, not a /27; .192 begins the next subnet and lies above the supplied address.Question 5 of 10
10.26.73.19/20?Show answerHide answer
/20 mask is 255.255.240.0, so third-octet blocks advance by 16. Octet 73 lies in 64–79, ending at 10.26.79.255. Using 10.26.73.255 treats the network as /24 and ignores the host bits that remain in the third octet.Question 6 of 10
255.255.240.128. Why is it invalid?Show answerHide answer
11110000, which starts the host portion, but the next octet, 128, introduces another 1. Mask 1s must form one continuous run from the left. Both 240 and 128 are possible mask-octet values individually; their placement together breaks the full-mask rule.Question 7 of 10
10010110 represent?Show answerHide answer
Question 8 of 10
Show answerHide answer
11011010. The similar-looking 11010110 represents 214 because it selects 4 in place of 8; writing all eight place values prevents that swap.Question 9 of 10
10.24.8.6/27 on an interface. How many bits of that address form its network portion?Show answerHide answer
/27 prefix assigns 27 bits to the network portion and leaves five host bits. The historical class A default of /8 does not override that configured prefix. An address beginning with 10 can be divided with modern classless prefixes just like other unicast blocks.Question 10 of 10
/22?Show answerHide answer
/22 mask has two full octets of 1s and six more 1s in the third octet. Binary 11111100 is 252, giving 255.255.252.0. Placing 252 in the final octet would count 30 network bits, because three preceding octets of 255 already contribute 24.Set 2: Size and verify an IPv4 address plan10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
/24 must supply at least seven equal subnets. What prefix creates the fewest equal subnets that meet the count?Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
10.72.4.0/24 supply six equal LAN subnets, each needing 45 usable addresses?Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
192.168.63.0/24, .0/25 and .128/27 are allocated. What is the first available aligned /26 network?Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
/24 plan allocates one /25, one /26 and one /27 without overlap. How many additional /30 blocks fit in its remaining space if allocations leave the final /27 free?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
10.82.6.0/23 and 10.82.7.128/25 relate?Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
172.22.12.0/24 through 172.22.15.0/24?Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
100.111.6.8. What address category is this?Show answerHide answer
Save this lesson to see this answer.
Set 3: Read IPv6 addresses, prefixes and types10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
2001:db8:9c00:ab00::/56. How many /64 LANs can it create, and what is the final LAN prefix?Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
fe80::91%eth1?Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
2001:0db8:0000:0000:0030:0000:0000:0009?Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
:: replace in 2001:db8:56::a:9?Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
2001:db8:6a20:17:abcd::6/64?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
fd8a:42c1:9b20:4::18/64 and a global address. What can the fd address provide?Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
ff02::2 identify?Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
2001:db8:4::12ab:cdef?Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
08:7a:4c:90:12:34?Show answerHide answer
Save this lesson to see this answer.
Set 4: Diagnose subnet and address-reading mistakes10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
10.34.5.20/24; host B is 10.34.5.180/25. How does each classify the other destination using its own mask?Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
169.254.88.14/16. What is the most useful next check?Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
172.23.11.0 be assigned to an ordinary host in 172.23.8.0/21?Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
10.90.5.0/24 and 10.90.6.0/24, and does it cover only those networks?Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
2001:db8:0:4:0:9:0:2 be written in RFC 5952 recommended form?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
2001:db8:b170:58c7::12/60?Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
02 when building a modified EUI-64 ID?Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
fd00::/8?Show answerHide answer
Save this lesson to see this answer.
Set 5: Combine planning, diagnosis and IPv6 skills10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
198.19.18.6 belong to?Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
/24 must hold LANs needing 110, 60 and 26 usable addresses, plus two /30 links. Counts include gateways. How many addresses remain unallocated?Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
10.61.8.0/24, a /26 allocation at .0 must stay. Can one /25 and one /26 still be added without overlap?Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
192.168.117.0/25, 192.168.117.128/26 and 192.168.117.192/26 be summarized exactly by one prefix?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
10.44.9.126/25. The intended router interface is 10.44.9.129/25. Why is that gateway invalid for the PC?Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
0044:55ff:fe66:7788. What MAC address produced it?Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
::/128 and ::/0?Show answerHide answer
Save this lesson to see this answer.
Stuck on your own question? Homework Help
Key Terms
A
Address allocation
Alignment
Anycast
APIPA
B
Benchmarking address
Binary
10101100 equals 172 because its 1 bits select the values 128, 32, 8 and 4.Bit
Bitwise AND
Block size
Borrowed bit
Broadcast address
C
Carrier-grade NAT
CIDR
Classful addressing
Contiguous blocks
D
Default gateway
Directed broadcast
Documentation address
Dotted-decimal notation
Dual stack
Duplicate address
Duplicate address detection
E
Exact summary
F
FLSM
G
Global routing prefix
Global unicast address
Growth reserve
H
Hexadecimal
Hextet
Host bit
Host portion
Host prefix
I
Interesting octet
Interface ID
IPv4 address
IPv4 link-local
IPv4 loopback
IPv4 multicast
IPv4-mapped address
IPv6 /127 link
IPv6 address
IPv6 link-local address
L
Limited broadcast
M
Mask mismatch
Modified EUI-64
Multicast scope
N
NAT
NAT64
Network address
Network interface
Network portion
Nibble
1010, while f corresponds to the four bits 1111.Nibble boundary
O
Octet
01001101.Overlap
P
Parent block
PAT
Place value
00001010, the two 1 bits occupy positions worth 8 and 2, producing the decimal value 10.Point-to-point link
Prefix length
Private IPv4 address
Public IPv4 address
S
Same-subnet test
Shared address space
SLAAC
Solicited-node multicast
Stable per-network ID
Subnet ID
Subnet mask
Subnet zero
Subnetting
Summarization
T
Temporary interface ID
Tunneling
U
Unicast
Unique local address
Universal/local bit
Unspecified IPv6 address
Usable host range
V
VLSM
Z
Zero compression
Zone index
About this lesson
Make your own Study Materials
Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.