Network+ · Chapter 7
IP Addressing
Public and private IPv4 ranges, APIPA, address classes A to E, choosing a private range, IPv6 basics and address types, tunneling and dual stack, SLAAC, EUI-64, and the chapter written labs.
Exam objectives covered
- Domain 1.0 Networking concepts: use appropriate IPv4 network addressing (public vs. private, APIPA, RFC 1918, loopback/localhost, subnetting with VLSM and CIDR, and address classes A to E).
- Domain 1.0 Networking concepts: evolving use cases, including IPv6 addressing, mitigating address exhaustion, and compatibility requirements (tunneling, dual stack, NAT64).
- Domain 3.0 Network operations: implement IPv4 and IPv6 network services, including stateless address autoconfiguration (SLAAC).
Public, private, APIPA, and loopback addresses
- Public addresses are routable on the Internet. Private addresses (RFC 1918) are not.
- Class A private range: 10.0.0.0 through 10.255.255.255.
- Class B private range: 172.16.0.0 through 172.31.255.255.
- Class C private range: 192.168.0.0 through 192.168.255.255.
- APIPA (Automatic Private IP Addressing) range: 169.254.0.1 through 169.254.255.254. A client that cannot reach a DHCP server configures itself with an APIPA address and the default Class B mask 255.255.0.0.
- Loopback (localhost) addresses point a host at itself. 127.0.0.1 is the one you use.
Seeing 169.254.x.x on a client means DHCP did not answer. It is a symptom to troubleshoot, not an address to keep.
IPv4 address classes
| Class | First octet range | Default network / host bits | Use |
|---|---|---|---|
| A | 1 through 126 | 8 / 24 | Unicast |
| B | 128 through 191 | 16 / 16 | Unicast |
| C | 192 through 223 | 24 / 8 | Unicast |
| D | 224 through 239 | Not applicable | Multicast |
| E | 240 through 255 | Not applicable | Experimental |
- The gap between 126 and 128 is the 127 loopback network.
- Class D and E have no network and host split because they are not used for ordinary host addressing.
Which private range should you use?
- For a corporate network of any size, consultants use a Class A private network (10.0.0.0) because it gives the most flexibility and room to grow.
- Example: Acme Corporation has 14 departments with about 70 users each. A plan of 10.1.x.0 with a /24 mask, where x is the department's subnet number, is easy to design, install, and troubleshoot.
- Using 10.0.0.0 with a /24 mask gives 65,536 networks of 254 hosts each.
- For a home network, use a Class C private address. It is the easiest to understand and configure, and the default Class C mask gives one network with 254 hosts.
- CIDR and VLSM let you give each department or building only the number of addresses it needs, without wasting space. Chapter 8 covers the subnet math. A /24 means 24 of the 32 mask bits are turned on.
Why IPv6, and how it differs
- Without IPv6 the world would run out of IPv4 addresses. IPv6 mitigates address exhaustion.
- An IPv6 address is 128 bits long and written in hexadecimal. An IPv4 address is 32 bits long and written in decimal.
- If the acronym IP is used alone, it means IPv4.
- Link-local addresses are like IPv4 APIPA addresses, but they cannot be routed at all, not even inside your organization.
- Unique local addresses are like IPv4 private addresses. They cannot be routed to the Internet, but unlike link-local they can be routed inside your organization.
Link-local: never routed. Unique local: routed inside the organization, never on the Internet.
IPv6 address types
| Type | Delivery | What to remember |
|---|---|---|
| Unicast | One-to-one: a packet goes to a single interface | An address assigned to one interface |
| Global unicast | One-to-one | Used just like a regular public, routable IPv4 address |
| Link-local | One-to-one on the local link | Always starts with FE80::/10. Not meant to be routed |
| Unique local | One-to-one | Starts with FC00::/7. Not routed to the Internet but still globally unique. Used to be called site-local |
| Multicast | One-to-many: delivered to multiple interfaces | Identifies a group of interfaces |
| Anycast | One-to-nearest: identifies multiple interfaces, delivered only to the first one it finds | The nearest interface answers |
| Loopback | The host itself | ::1, the IPv6 version of 127.0.0.1 |
- IPv6 has 128-bit addresses against 32-bit IPv4 addresses, so 96 more bits.
- Benefits over IPv4 include more available addresses, a simpler header, and options for authentication and other security.
- A MAC address is a 48-bit (6-byte) address physically assigned to a network interface such as a NIC. It is also called a hardware address or a burned-in address.
Match the phrase to the type: single interface is unicast, public-like is global unicast, not routed is link-local, not on the Internet but globally unique is unique local, multiple interfaces is multicast, nearest is anycast.
IPv6 compatibility: tunneling, dual stack, NAT64
- Tunneling carries IPv6 traffic inside IPv4 so it can cross an IPv4-only part of the network.
- Dual stack runs IPv4 and IPv6 side by side on the same devices.
- NAT64 translates between IPv6 and IPv4 so IPv6-only hosts can reach IPv4 services.
SLAAC and EUI-64
- Hosts can use stateless address autoconfiguration (SLAAC) to obtain an IPv6 address without a DHCP server. One way to build the interface ID is EUI-64.
- EUI-64 takes the host's 48-bit MAC address and inserts FF:FE in the middle, which makes a 64-bit interface ID.
- It also inverts the 7th bit of the first byte, typically changing it from 0 to 1.
| Step | Example |
|---|---|
| Start with the MAC address | 00:1A:2B:3C:4D:5E |
| Split it in half | 00:1A:2B | 3C:4D:5E |
| Insert FF:FE in the middle | 00:1A:2B:FF:FE:3C:4D:5E |
| Invert the 7th bit of the first byte (00 becomes 02) | 02:1A:2B:FF:FE:3C:4D:5E |
| Interface ID | 021A:2BFF:FE3C:4D5E |
Reading an EUI-64 address backwards: drop the FF:FE and flip the 7th bit back to recover the MAC address.
Exercise 7.1: Identify your own IP addresses
- Open a command prompt (Start, type cmd, press Enter).
- Run ipconfig /all and note the addresses on your computer. On Linux or macOS the command is ifconfig.
- Open a web browser, go to whatismyipaddress.com or a similar site, and note the address shown as your public IP.
- For each address, identify the version, the class, and the type. Is it public or private? What is in use on your Internet connection?
Written labs 7.1 and 7.2
- Cover the answer column and say each answer out loud before you check it. The Written labs visual lets you type answers and compare.
| Lab | Question | Answer |
|---|---|---|
| 7.1 | What is the valid range for a Class C private IP address? | 192.168.0.0 through 192.168.255.255 |
| 7.1 | Name some benefits of IPv6 over IPv4. | More available addresses, a simpler header, and options for authentication and other security |
| 7.1 | What auto configuration technology gives addresses that start with 169.254? | Automatic Private IP Addressing (APIPA) |
| 7.1 | What defines a unicast address? | An IP address assigned to an interface: one-to-one communication |
| 7.1 | What defines a multicast address? | A one-to-many address |
| 7.1 | What is the 48-bit (6-byte) address physically assigned to a NIC? | A MAC address (hardware address, burned-in address) |
| 7.1 | IPv6 has how many more bits than IPv4? | 96 more: 128 bits against 32 bits |
| 7.1 | What is the private address range for Class B? | 172.16.0.0 through 172.31.255.255 |
| 7.1 | What is the Class C first-octet range, in decimal and binary? | 192 through 223, and 110xxxxx |
| 7.1 | What is 127.0.0.1 used for? | Loopback or diagnostics. The whole range 127.0.0.1 through 127.255.255.254 is loopback |
| 7.2 | Which packet type goes to only a single interface? | Unicast |
| 7.2 | Which address type works like a regular public routable IPv4 address? | Global unicast |
| 7.2 | Which address type is not meant to be routed? | Link-local |
| 7.2 | Which type is not routed to the Internet but is still globally unique? | Unique local (used to be called site-local) |
| 7.2 | Which type is delivered to multiple interfaces? | Multicast |
| 7.2 | Which type identifies multiple interfaces but delivers only to the first it finds? | Anycast |
| 7.2 | Which addressing type is also called one-to-nearest? | Anycast |
| 7.2 | What is the IPv6 loopback address? | ::1 |
| 7.2 | What does a link-local address always start with? | FE80::/10 |
| 7.2 | What does a unique local range start with? | FC00::/7 |
Lab 7.2 gives you the whole IPv6 type map: unicast, global unicast, link-local, unique local, multicast, anycast. Say the delivery phrase for each without looking.
Exam essentials
- Class A is 1 to 126 (8 network bits, 24 host bits). Class B is 128 to 191 (16/16). Class C is 192 to 223 (24/8).
- Know the three private ranges: 10.0.0.0/8, 172.16.0.0 to 172.31.255.255, and 192.168.0.0 to 192.168.255.255.
- APIPA is 169.254.0.1 to 169.254.255.254 with mask 255.255.0.0.
- IPv6 exists because IPv4 addresses would run out. It is 128 bits, hexadecimal.
- Link-local cannot be routed at all. Unique local can be routed inside the organization.
- Read an EUI-64 address: FF:FE is inserted in the middle of the MAC address and the 7th bit of the first byte is inverted.
- IPv6 types: unicast is one-to-one, multicast is one-to-many, anycast is one-to-nearest. Global unicast is the public-style address, link-local starts with FE80::/10, unique local starts with FC00::/7, and loopback is ::1.
- The 127.0.0.1 loopback is for diagnostics. The whole 127.0.0.1 through 127.255.255.254 range is loopback.