Study Guide
IPv4 and IPv6 Addresses
What an IP address is, how an IPv4 address is built from four octets, public, private and special addresses, and how IPv6 addresses are written.
Lesson 3.5 Networking Fundamentals
For data to reach the right device, every device needs an address, just as a letter needs one. This lesson is about the address used to find a device anywhere in the world: what it is for, how it is built, and the different kinds.
Stage: Think
Sending a parcel
Think it through
A parcel travels from Leeds to a house in Glasgow, passing through three depots on the way. What on the parcel stays the same for the whole journey, and what changes at each depot?
- Hint 1: What is written on the label?
- Hint 2: Who decides where the parcel goes after each depot?
Show what happens
The destination on the label never changes. Where it is sent next changes at every depot. Networks use two kinds of address in exactly this way.
Think it through
Show the answer
Answer: B. The final destination, to choose the next depot.
The final destination. From it, each depot works out the next stop. The two network addresses divide the work in the same way.
Stage: Explain
IP addresses and MAC addresses
A device on a network has two addresses, and a parcel shows why. A parcel has a label with the final destination, which stays on it for the whole journey. At each stage it is also sent to the next depot, and that changes every time it is handed on.
- The IP address is the label. IP stands for Internet Protocol, the set of rules for addressing and moving data across networks.
- The MAC address is the next depot. It is a number built into each network interface, used to hand data to the next device on the local network.
| Question | IP address | MAC address |
|---|---|---|
| What is it like? | The destination on a parcel’s label | The address of the next depot |
| What is it for? | Finding the right device across many networks, anywhere in the world | Handing data to the next device on the local network |
| Does it change on the journey? | No: it stays the same from sender to receiver | Yes: it is replaced at every router on the way |
| What does one look like? | 192.168.1.10 | 00:1A:2B:3C:4D:5E |
| Which device reads it? | Routers | Switches |
| Which layer is it? | Layer 3, Network | Layer 2, Data Link |
Check your understanding
Show the answer
Answer: C. The MAC address: it is replaced each time.
The MAC address, which says which device on each local network receives the data next. The IP address normally stays the same from sender to receiver.
Where the comparison stops. A parcel’s label is never rewritten. An IP address sometimes is: a home or school router usually swaps the sender’s address on the way out to the internet. That is called address translation and is taught in IP forwarding, default gateways and NAT/PAT.
The rest of this lesson is about IP addresses. Ethernet Switching and MAC Addresses covers MAC addresses.
Stage: Predict
The structure of an IPv4 address
The version of IP in use since the early internet is version 4, IPv4. An IPv4 address is 32 bits long: thirty-two ones and zeros. Nobody wants to read that, so it is split into four groups of eight bits, called octets, and each octet is written as an ordinary number from 0 to 255 with dots between them. This is called dotted decimal.
192.168.1.10 is four octets, 192, 168, 1, 10, which in binary are 11000000, 10101000, 00000001, 00001010: 32 bits in total.
4 octets × 8 bits = 32 bits. The dots separate the octets.
Think it through
Look at 192.168.1.10 and 192.168.1.77. What do the two addresses share, and what might that tell you?
- Hint 1: Compare the addresses octet by octet.
Show what happens
They share the first three octets, 192.168.1, and differ only in the last. Like a street name and a house number, the shared part can say which network, and the rest which device.
Network and host portions
Every IPv4 address has two parts, usually labelled N and H:
- the network portion (N), shared by every device on the same network, like a street name;
- the host portion (H), which identifies one device on that network, like a house number.
192.168.1.10/24: the first 24 bits are the network portion and the last 8 bits are the host portion. Applying the /24 mask gives the network address 192.168.1.0.
N Network portion: 24 bits H Host portion: 8 bits
In this example the first three octets are the street and the last is the house, so 192.168.1.10 and 192.168.1.77 are neighbours on the same network.
The address alone does not say where the boundary falls. A second setting does that. It is often written after the address as a slash and a number, such as /24, meaning “the first 24 bits are the network portion”. The next lesson explains it fully; for now, read /24 as “the first three octets are the network”.
Stage: Predict
Public and private addresses
Think it through
Show the answer
Answer: B. Reuse the same addresses inside separate buildings.
Reuse addresses inside separate buildings, where the internet never sees them. Those are private addresses.
IPv4 has about 4.3 billion possible addresses, which is fewer than the number of devices in the world. One way the shortage is managed is by letting the same addresses be reused inside separate buildings.
- A public address is unique across the whole internet, so data can be sent to it from anywhere.
- A private IPv4 address is used only inside one organisation’s or household’s network. The same private addresses are used again in millions of other buildings, so the internet does not carry traffic addressed to them.
A school is a good example. Every computer inside it has a private address. The school’s router has one public address, given to it by the company that provides the internet connection. When a computer inside sends something to the internet, the router replaces the private address with its own public one on the way out, and reverses the swap for the reply. That is the address translation mentioned where the parcel comparison stops, usually shortened to NAT.
Private IPv4 and IPv6
Three ranges of IPv4 addresses are reserved for private use. They are often called the RFC 1918 ranges. An RFC, or Request for Comments, is a numbered internet standards document, and number 1918 is the one that set these ranges aside.
| Private range | First address | Last address | How to recognise it |
|---|---|---|---|
10.0.0.0/8 | 10.0.0.0 | 10.255.255.255 | Starts with 10. |
172.16.0.0/12 | 172.16.0.0 | 172.31.255.255 | Starts with 172, and the second number is from 16 to 31. |
192.168.0.0/16 | 192.168.0.0 | 192.168.255.255 | Starts with 192.168. |
Check your understanding
Show the answer
Answer: B. No: the second number must be from 16 to 31.
No. Only 172.16 to 172.31 is private, and 32 is just outside it. The example below checks five more.
A technician is handed five addresses and asked which are private. Check each one against the three ranges, in order.
10.200.3.4starts with 10. Private.172.20.1.1starts with 172, and the second number, 20, is between 16 and 31. Private.172.40.1.1starts with 172, but 40 is outside 16 to 31. Not private. This is the one that catches people out: only part of the 172 range is reserved.192.169.1.1starts with 192, but the second number is 169, not 168. Not private.198.51.100.7is in none of the three ranges, so it is not private. It is not an ordinary public address either: it belongs to a range reserved for examples, described in the next section.
What the last case shows: “not private” does not mean “public”. Other ranges are set aside for other purposes.
IPv6, the newer version of IP described at the end of this lesson, has its own equivalent of private addresses, called unique local addresses.
Stage: Predict
Other special IPv4 addresses
Think it through
A laptop shows the address 169.254.12.7 and cannot reach anything, while its neighbours work normally. What might have gone wrong?
- Hint 1: Do the neighbours’ addresses look anything like it?
- Hint 2: Where does a laptop normally get its address from?
Show what happens
It gave itself an address because nothing answered when it asked for one automatically. That range has a special meaning, listed below with the others worth recognising.
A few more ranges are worth recognising, because they explain things you will see on real devices:
- Loopback,
127.0.0.0/8: a loopback address is one a device uses to talk to itself, usually127.0.0.1. The VyOS routing table in Routing, default gateways and NAT/PAT lists127.0.0.0/8on its loopback interface. - Link-local,
169.254.0.0/16: an address some systems give themselves when the service that normally hands out addresses automatically (DHCP, taught in a later lesson) does not answer. Seeing one usually means automatic configuration failed. - Documentation ranges,
192.0.2.0/24,198.51.100.0/24and203.0.113.0/24: reserved for examples, which is why these lessons use them for “internet” addresses. 0.0.0.0: used before a device has an address, and in routing to mean “any destination”.
Stage: Predict
IPv6 addresses
Think it through
If you could redesign IP addresses so that they would never run out, what would you change?
- Hint 1: How many possible values does each extra bit add?
Show what happens
Make them longer. IPv6 addresses are four times as long as IPv4 ones, which gives far more addresses than could ever be used.
Reusing private addresses only eases the shortage. IPv6 removes it by making the address four times as long: 128 bits instead of 32. That gives more addresses than could ever be used.
A 128-bit number written in dotted decimal would be unreadable, so IPv6 addresses are written in hexadecimal, as eight groups of four hexadecimal digits separated by colons:
2001:0db8:0000:0000:0000:0000:0000:0010
Two rules make them shorter:
- Leading zeros in a group can be dropped:
0db8becomesdb8. - One run of groups that are all zeros can be replaced by
::.
With both rules, that full address becomes 2001:db8::10.
Check your understanding
Show the answer
Answer: C. 2001:db8::1
2001:db8::1. Leading zeros go from each group, and the single run of zero groups becomes one double colon.
Take 2001:db8::10, an address from the range reserved for documentation.
- Count the written groups:
2001,db8and10are three groups. - Work out what
::replaces: an address has eight groups, so::stands for 8 − 3 = 5 groups of zeros. - Restore leading zeros:
db8becomes0db8and10becomes0010. - Write it in full:
2001:0db8:0000:0000:0000:0000:0000:0010.
:: can appear only once, otherwise it would be impossible to tell how many zero groups each one hides.
Kinds of IPv6 address
Now that the format is familiar, here are the kinds of IPv6 address, each recognised by how it starts.
| Kind | Starts with | What it is for |
|---|---|---|
| Global unicast | 2 or 3 | The ordinary, internet-wide address: IPv6’s equivalent of a public address. |
| Unique local | fd | Used inside one organisation only: IPv6’s equivalent of a private address. |
| Link-local | fe80 | Created automatically by every device, and works only on its own local network. |
| Loopback | ::1 | A device talking to itself, like 127.0.0.1. |
| Multicast | ff | One message to a chosen group of devices. |
IPv6 has no broadcast. The job of finding other devices on the local network, which IPv4 does by broadcasting, is done in IPv6 with multicast messages, in a process called Neighbour Discovery.
When a user cannot get online, the address their device shows is an early clue. A 169.254.x.x address suggests nothing answered when it asked for an address automatically. An address in a different private range from colleagues suggests it has joined the wrong network, such as a guest Wi-Fi.
Stage: Apply
Apply it in a new situation
These questions use the lesson in situations it has not shown. For the strongest test of your understanding, come back to them on another day and answer each one at the first attempt.
Apply it
- Hint 1: Look again at the special IPv4 addresses.
Show the answer
Answer: A. It did not get an address automatically.
It gave itself a link-local address because nothing answered its request for one, so the problem is with automatic addressing, not with the internet.
Apply it
Show the answer
Answer: B. Private is about reachability, not protection.
Private means not reachable directly from the internet, which is a matter of addressing. Anything already inside the network can still reach it, so it is not a security control.
Stage: Check
Check your understanding
These questions come from the approved revision bank. Choose an answer and check it; the explanation and its sources follow.
Show answer
Answer: 10.25.1.9; 172.31.200.8; 192.168.4.20
10.25.1.9, 172.31.200.8 and 192.168.4.20 lie within the three RFC 1918 blocks. 172.32.0.1 is outside 172.16.0.0/12. 192.0.2.10 is outside all three RFC 1918 ranges; being outside these ranges does not by itself prove public routability.
Revision sources: Session 5: Networking Fundamentals — Part 1 (Classroom session record)
Show answer
Answer: IPv4: 32 bits; IPv6: 128 bits
IPv4 has 32-bit addresses and IPv6 has 128-bit addresses. 48 bits describes a conventional Ethernet MAC address. Reversing the values or treating bits as bytes changes their meaning.
Revision sources: Session 5: Networking Fundamentals — Part 1 (Classroom session record)
Study and revision
Practise addressing questions and flashcards through the Networking & Protocols topic.
Stage: Consolidate
What to remember
- The IP address is the destination; the MAC address is the next hop, replaced at every router.
- An IPv4 address is 32 bits in four octets, with a network portion and a host portion set by a separate setting.
- Private ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16; not private does not always mean public.
- Special ranges include loopback, link-local and documentation addresses.
- IPv6 addresses are 128 bits in hexadecimal, shortened by dropping leading zeros and one run of zero groups.
Key terms
- IP address
A logical network-layer address identifying an interface for delivery across networks. IPv4 addresses are 32 bits; IPv6 addresses are 128 bits.
- Private IPv4 address
An address from the RFC 1918 blocks 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16, used inside private networks rather than routed on the public internet.
- Loopback address
An address a device uses to send traffic to itself, such as 127.0.0.1 in IPv4 or ::1 in IPv6.
Common misunderstandings
Other special-purpose ranges exist, including loopback, link-local and the documentation ranges.
Private means “not reachable directly from the internet”, which is a matter of addressing. It is not a security control: anything already inside the network can reach a private address.
The network and host boundary is set by a separate setting, the subnet mask or prefix length, not by the address alone.
Lesson sources and acknowledgements
Sources and scope
- Taught in Session 5 (see the Session 5 Learning Log): IP and MAC addresses compared, IPv4 and IPv6 address lengths, public and private addresses, the RFC 1918 ranges, IPv6 address types and Neighbour Discovery.
- From the Study Buddy session on 23 September (see the entry): IPv4 as 32 bits in four octets, the N and H notation, and IPv6 as 128-bit hexadecimal.
- Moved from an earlier lesson: “Private IPv4 and IPv6” was previously part of What Is a Network? and keeps its heading and anchor here. Its wording was rewritten on 13 October 2026, and the kinds of IPv6 address moved below the section that explains how an IPv6 address is written.
- Supplementary explanation: the parcel comparison and its limit, the school example of public and private addresses, the “how to recognise it” column and the five-address worked example, the special IPv4 ranges, IPv6 shortening rules, the worked expansion, the table of IPv6 kinds and the misunderstandings.
- Simplifications: the “starts with” column for IPv6 gives the usual appearance of each kind. The reserved ranges are a little wider: global unicast is
2000::/3, unique local isfc00::/7(of which thefdhalf is the part in use), link-local isfe80::/10and multicast isff00::/8. Some internet providers also translate addresses a second time on their own equipment (Carrier-Grade NAT), so a home router’s outside address is not always a public one.
Guided version (published 1 November 2026, awaiting the site owner’s editorial review): the parcel opening questions, every question asked in the lesson with its feedback and hints, the address exercises and the closing summary are supplementary explanation written for the Study Guide. The settings are fictional. The questions in the lesson’s steps are not revision-bank items; those in “Check your understanding” are, unchanged.
Communication sent to every device in the relevant broadcast domain. Routers do not normally forward ordinary local broadcasts.
A measure intended to modify risk, for example by restricting access, detecting misuse or supporting recovery.
An application-layer protocol that automatically provides IP configuration, such as an address, subnet mask, default gateway and DNS server information.
A base-16 number system using the digits 0–9 and the letters A–F, where A = 10 and F = 15. One hexadecimal digit represents exactly four bits.
An endpoint that sends or receives data on a network. Hosts are nodes, but not every node is an end host.
A logical network-layer address identifying an interface for delivery across networks. IPv4 addresses are 32 bits; IPv6 addresses are 128 bits.
An address a device uses to send traffic to itself, such as 127.0.0.1 in IPv4 or ::1 in IPv6.
A link-layer address used for local frame delivery, conventionally 48 bits written in hexadecimal. It may be randomised or spoofed, so it is not proof of identity.
Communication sent to a selected group of recipients.
Translating IP addresses as traffic passes a device, commonly so that devices with private addresses can use a public-facing address.
The IPv6 mechanism, using ICMPv6 messages, that finds neighbouring devices and their link-layer addresses. It replaces ARP in IPv6.
The first address of a subnet, with all host bits set to 0. It identifies the network itself rather than any one device.
A group of eight bits, which can hold a value from 0 to 255. An IPv4 address is made of four octets.
The number of leading network bits in an address, written after a slash, such as /24.
An address from the RFC 1918 blocks 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16, used inside private networks rather than routed on the public internet.
An agreed set of rules for how data is formatted, transmitted and interpreted so that devices can communicate.
A device that forwards traffic between networks, for example between a private local network and the internet.
A device’s list of destination networks and how to reach each one: through a directly connected interface or via a next-hop router.
A 32-bit value that marks which bits of an IPv4 address belong to the network (1s) and which belong to the host (0s), such as 255.255.255.0.
A device that connects devices within a local network and forwards Ethernet frames using the MAC addresses it has learned.
Communication sent to one intended recipient.
Your progress on this lesson
Saved in this browser only. It is not sent anywhere, does not follow you to another device, and is lost if you clear this site’s data.
This browser is not allowing the site to save progress, so it will be forgotten when you leave the page.