All subjects · Computer Science · WCP01 Principles of Computer Science
Network addressing: IPv4, IPv6 and MAC addresses
Edexcel IAL Computer Science · WCP01 Principles of Computer Science
Every device on a network needs addresses so data can be delivered. IP addresses identify a device's location on a network; MAC addresses identify its network hardware (spec point 3.1.3).
IPv4
- An IPv4 address is 32 bits, written as four denary numbers (each 8 bits, 0 to 255) separated by dots, for example 192.168.1.25.
- In binary: 11000000.10101000.00000001.00011001.
- Number of possible addresses = 232 = 4 294 967 296, about 4.3 billion. This is not enough for every device on the internet, which is why IPv6 was introduced (along with private addresses behind a router).
IPv6
- An IPv6 address is 128 bits, written as eight groups of four hexadecimal digits separated by colons, for example 2001:0db8:0000:0000:0000:ff00:0042:8329.
- Leading zeros in a group can be dropped, and one run of all-zero groups can be replaced by :: (only once), giving 2001:db8::ff00:42:8329.
- Number of possible addresses = 2128, about 3.4 x 1038, so the address space will not run out.
- Each group of 4 hex digits = 16 bits, and 8 x 16 = 128.
MAC addresses and how they work together
- A MAC (media access control) address is a 48-bit address given to a network interface card when it is made. It is written as six pairs of hex digits, for example 3C:5A:B4:12:9F:0E. It is normally fixed and unique worldwide; the first half identifies the manufacturer.
- IP addresses are logical and can change (assigned by the network, often by DHCP); they are used by routers to send packets across networks. MAC addresses are physical and used by switches to deliver frames to the right device within the local network.
- Expressions: n bits give 2n addresses; a 48-bit MAC space has 248 addresses.
Worked example
Convert the IPv4 address 192.168.1.25 to binary.
- 192 = 11000000
- 168 = 10101000
- 1 = 00000001
- 25 = 00011001
Answer: 11000000.10101000.00000001.00011001
Check yourself
- How many bits are in an IPv4 address?
Show answer
32. Four 8-bit numbers: 4 x 8 = 32.
- What is the largest number that can appear in one part of an IPv4 address?
Show answer
255. Each part is 8 bits: 28 - 1 = 255.
- An IPv6 address has 8 groups of 4 hexadecimal digits. How many bits does each group hold?
Show answer
16. Each hex digit is 4 bits, so 4 x 4 = 16 bits.
- Convert the IPv4 part 172 to 8-bit binary.
Show answer
10101100. 172 = 128 + 32 + 8 + 4 = 10101100.
- An IPv4 octet is 11000000 in binary. What is it in denary?
Show answer
192. 128 + 64 = 192.
- Which statement about MAC addresses is correct?
- They are 32-bit addresses assigned by the router
- They change every time a device joins a network
- They are used by routers to send data across the internet
- They are 48-bit addresses assigned to a network interface card when it is made
Show answer
They are 48-bit addresses assigned to a network interface card when it is made. MAC addresses are physical, fixed and used within a local network.
- Which is a valid IPv4 address?
- 10.0.256.17
- 10.0.255.17
- 10.0.17
- 10:0:255:17
Show answer
10.0.255.17. Four parts, each 0 to 255, separated by dots.
- Explain why IPv6 was introduced.
Show answer
IPv4 uses 32 bits so it has only about 4.3 billion addresses, which is not enough for all the devices connected to the internet; IPv6 uses 128 bits giving a vastly larger number of addresses.. Compare the size of the address spaces.
Sources
Last updated 8 November 2026. Spotted a mistake? Tell us.