Communication
IP addresses and subnetting
What you need to be able to do
- 2.1Describe the format of IPv4 and IPv6 addresses and decide whether an address is valid.
- 2.1Explain subnetting: network ID and host ID, subnet masks, and why networks are subnetted.
- 2.1Explain how an IP address is associated with a device on a network.
- 2.1Explain public vs private (and the security implications) and static vs dynamic IP addresses.
You need: binary, denary and hex from Chapter 1, and routers. Next: URLs and DNS.
An IP address identifies a device (strictly, its network connection) so that packets can be routed to it across networks. It is a logical address that can change; the MAC address of the network card is a fixed hardware address used inside one LAN.
IPv4
Format
32 bits written as 4 groups (octets) of 8 bits, each shown in denary 0 to 255, separated by full stops: 192.168.3.2
How many?
\(2^{32}\approx4.3\) billion addresses: not enough for every device now online. That shortage is why IPv6 was introduced (and why LANs use private addresses behind one public one).
| Address | Valid IPv4? | Why |
|---|---|---|
| 192.168.3.2 | yes | 4 groups, each 0-255, full stops |
| 256.0.0.1 | no | 256 is more than 255 (8 bits hold 0-255) |
| 10.4.7 | no | only 3 groups |
| 172.16.300.1 | no | 300 > 255 |
| 256.0.0.A | no (and not IPv6 either) | 256 > 255; A is not a denary digit; not IPv6 because it uses full stops not colons and has too few groups |
IPv6
Format
128 bits written as 8 groups of 4 hexadecimal digits (each group 16 bits, 0000-FFFF), separated by colons: 2001:0db8:0000:0000:0000:ff00:0042:8329
Shortening
Leading zeros in a group can be dropped (0db8 → db8). One run of consecutive all-zero groups can be replaced by a double colon “::”, only once in an address: 2001:db8::ff00:42:8329
How many?
\(2^{128}\approx3.4\times10^{38}\) addresses: enough for every device for the foreseeable future, so no need to share public addresses.
| IPv4 | IPv6 | |
|---|---|---|
| Size | 32 bits | 128 bits |
| Groups | 4 groups of 8 bits | 8 groups of 16 bits |
| Written in | denary (0-255) | hexadecimal (0-FFFF) |
| Separator | full stops | colons; “::” for consecutive zero groups |
Public and private, static and dynamic
| Type | Meaning (credited wording) | Notes |
|---|---|---|
| Public | assigned to a device to allow it to be visible on / directly accessed from the internet | unique across the whole internet; e.g. the router's internet-facing address, a web server |
| Private | can only be accessed by other devices in the same LAN; assigned by the router within the LAN | reused in every LAN (e.g. 192.168.x.x, 10.x.x.x); never seen on the internet |
| Static | does not change each time the device connects to the network | set manually or reserved; needed for servers, printers, anything others must always find |
| Dynamic | may change each time the device connects (re-joins) the network | handed out automatically (DHCP) from a pool; most phones and laptops |
A router has both: a public address so it is visible to the internet / WAN, and a private address so the computers within the LAN can identify it. Through Network Address Translation it lets every device on the LAN share the one public address.
Security implication of private addresses
Devices with private addresses cannot be reached directly from the internet: an outsider sees only the router's public address, which (with its firewall) filters what gets in. A public address is directly visible, so it is more exposed to attack.
How an IP address gets onto a device
Dynamic: when a device joins the LAN, the router (DHCP server) allocates it an IP address from its pool, for a limited time (a lease). Static: the address is configured manually or reserved in the router for that device's MAC address.
Subnetting
- Every device in a subnetwork has the same network ID; each subnetwork has a different network ID.
- The host ID uniquely identifies the device within its subnetwork.
- A subnet mask shows where the split is: the octets that are 255 (all 1s in binary) mark the network ID; the octets that are 0 mark the host ID.
- The device / router finds the network ID by ANDing the IP address with the mask, bit by bit: 1 keeps the bit, 0 clears it.
| IP address | Subnet mask | Network ID | Host ID |
|---|---|---|---|
| 192.168.5.77 | 255.255.255.0 | 192.168.5 | 77 |
| 172.16.40.9 | 255.255.0.0 | 172.16 | 40.9 |
| 10.10.12.1 | 255.0.0.0 | 10 | 10.12.1 |
| IP 77 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | ||
| mask 0 | AND | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| → host part | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Why subnet?
| Reason | Because… |
|---|---|
| Reduces network traffic / congestion, improves performance | data sent between devices in the same subnet stays in that subnet, so it doesn't flood the whole network |
| Improves security | not all devices can access all segments; a compromised device does not expose the whole network; devices don't receive data not meant for them |
| Easier maintenance / management | faults can be isolated: one subnetwork can be taken down or changed while the rest continues |
| Easier to expand / control growth | new subnetworks can be added in an organised way |
Mark-scheme focus
Complete the description of IPv4 and IPv6 (5 marks)
![(d) The CCTV cameras transfer data wirelessly. (i) Complete the description: An IPv4 address contains … groups of digits. Each group is represented in … bits and the groups are separated by full stops. An IPv6 address contains … groups of digits. Each group is represented in … bits. Multiple groups that only contain zeros can be replaced with a … . [5]](/notes-content/9618/communication/img/9618_s23_11_q04_di.png)
- IPv4: 4 groups, 8 bits each B2
- IPv6: 8 groups, 16 bits each B2
- zero groups replaced with :: (a double colon) B1
- IPv6 groups of 4 bits (it is 4 hex digits = 16 bits)
- a single colon “:”
From: 9618/11/M/J/23 Q4(d)(i)
Identify and describe the two parts of an IP address in a subnetwork (3 marks)
![(e) One site has split the network into several subnetworks. An IP address in a subnetwork is divided into two parts. Identify and describe the two parts of an IP address in a subnetwork. [3]](/notes-content/9618/communication/img/9618_s23_13_q02_e.png)
- Network ID and host ID B1
- Each device in a subnetwork has the same network ID // each subnetwork has a different network ID B1
- Every device in a subnetwork has a different host ID // the host ID uniquely identifies the device within the subnetwork B1
- “Network IP and host IP”
- Public and private (a different idea)
From: 9618/13/M/J/23 Q2(e)
Complete the table of IP address types (4 marks)
![(d) Complete the table of types of IP addresses and descriptions: (type missing) an IP address assigned to a device to allow direct access on the internet; static IP address (description missing); (type missing) an IP address used for internal LAN communication only; dynamic IP address (description missing). [4]](/notes-content/9618/communication/img/9618_w23_12_q07_d.png)
- public IP address B1
- static: fixed / doesn't change each time a device re-joins a network B1
- private IP address B1
- dynamic: may be refreshed / changed each time a device re-joins a network B1
- static = “stays still”; dynamic = “moves”
- mixing public/private with static/dynamic
From: 9618/12/O/N/23 Q7(d)
- IP addresses in almost every paper: fill-in descriptions (5-6 marks), IPv4 vs IPv6 differences (2), valid / invalid with justification (2), types (2-4).
- Subnetting: purpose / benefits (2-4), network ID and host ID (3), reading a subnet mask (2).
Worked examples
Example 1 · Static and public; is 256.0.0.A valid? (Paper 1, 4 marks) ★ Easy
![Web browsers use IP addresses. (a) Complete the table by describing these types of IP address: Static, Public. [2] (b) Consider the IP address 256.0.0.A. Circle whether it is IPv4, IPv6 or an invalid IP address. Justify your choice. [2]](/notes-content/9618/communication/img/9618_w25_11_q07_ab.png)
(b) test it against both formats: is every IPv4 group 0-255? Does it look like IPv6 (8 hex groups with colons)?
- justifyno mark for circling; 2 for reasons
- (a)two descriptions
- (b)justification
- 256.0.0.A
- (b)Invalid
- Not IPv4256 > 255
- Not IPv6full stops, too few groups
5 Now solve it have a go on paper first, then open the worked solution
- (a) Static: an IP address that does not change each time a device connects to the network B1; Public: assigned to a device to allow it to be visible on the internet B1
- (b) Invalid (no mark): not IPv4 because the maximum denary value is 255 and it uses 256 B1; not IPv6 because it uses full stops not colons // there are not enough groups B1
“A” could be a hex digit, but hex belongs to IPv6, which this can't be ✓.
Example 2 · IP address fill-in (Paper 1, 6 marks) ★ Easy
![(c) Devices that connect to the WAN have an IP address. Complete the description: IPv4 is displayed as four groups of 8-bit numbers separated by … . Each IPv4 address is 32 bits. IPv6 is made of eight groups of 4 … numbers separated by colons. Multiple consecutive groups of … can be replaced with a double colon. Each IPv6 address is … bits. A … IP address can change each time the computer connects to a network. A … IP address can only be accessed by other devices in the same LAN and is assigned by the router within the LAN. [6]](/notes-content/9618/communication/img/9618_s25_12_q06_c.png)
Six gaps: four about format, two about types. Read the clue after each gap.
- (c)six words
5 Now solve it have a go on paper first, then open the worked solution
- full stops
- hexadecimal
- zeros
- 128
- dynamic
- private B6
128 = 8 groups × 16 bits ✓.
Example 3 · Subnetting benefits and reading subnet masks (Paper 1, 4 marks) ★★★ Hard
![(c) LANs can be made up of several subnetworks. (i) Give two benefits of dividing a network into subnetworks by subnetting the LAN. [2] (ii) Two devices are in different subnetworks: 10.10.12.1 with subnet mask 255.0.0.0, and 192.168.12.4 with subnet mask 255.255.255.0. Identify the network ID for the device with IP address 10.10.12.1, and the host ID for the device with IP address 192.168.12.4. [2]](/notes-content/9618/communication/img/9618_w22_13_q07_c.png)
Why it is hard: most candidates had never applied a mask; the octet-by-octet line-up is all it takes.
(ii): line the mask up with the address, octet by octet. 255 → that octet is network ID; 0 → host ID.
- 255.0.0.0first octet network, last three host
- 255.255.255.0first three network, last host
- (c)(i)two benefits of subnetting
- (c)(ii)network ID, host ID
- (ii)
- Device 1mask 255 only in octet 1 → network ID 10
- Device 2mask 0 only in octet 4 → host ID 4
Why is the network ID of 10.10.12.1 not 10.10?
Only the first octet of its mask is 255.
What did the report say?
“A small number of correct answers … many need to improve their understanding of subnet masks.”
5 Now solve it have a go on paper first, then open the worked solution
- (i) improves security B1; reduces congestion // allows extension of the network // aids day-to-day management // improves performance B1
- (ii) network ID of 10.10.12.1 = 10 B1
- host ID of 192.168.12.4 = 4 B1
10.10.12.1 AND 255.0.0.0 = 10.0.0.0 ✓; 192.168.12.4 has host part .4 under the 0 octet ✓.
Example 4 · A router's public and private address; why subnet (Paper 1, 4 marks) ★★ Medium
![(d) The LAN has a router with a public IP address and a private IP address. (i) State the purpose of a public IP address and a private IP address. [2] (ii) The LAN uses subnetting. Describe the purpose of subnetting in a network. [2]](/notes-content/9618/communication/img/9618_w24_13_q09_d.png)
(i): who each address is for. (ii): what subnetting does + one consequence.
- (d)(i)two purposes
- (d)(ii)purpose
5 Now solve it have a go on paper first, then open the worked solution
- (i) Public: so that the router is visible to the internet / external network / WAN B1; private: so that the router is identified to the computers within the LAN B1
- (ii) Divides the network into smaller networks B1 … which reduces traffic / congestion because traffic only travels through the parts necessary // easier maintenance B1
✓
Summary
- IPv4: 32 bits, 4 × 8-bit denary groups (0-255), full stops. IPv6: 128 bits, 8 × 16-bit hex groups, colons, “::” once for zero groups.
- Public: visible on the internet. Private: within the LAN only, assigned by the router (more secure). Static: never changes. Dynamic: may change at each connection (DHCP).
- Subnetting: network ID + host ID; mask 255 = network part, 0 = host part; less traffic, more security, easier management.
| If you see… | do this |
|---|---|
| “is this IPv4 / IPv6 / invalid?” | check group count, value range, separator, digits |
| a subnet mask | 255 octets → network ID; 0 octets → host ID |
| “purpose of subnetting” | divides network + consequence (traffic, security, management) |
| public / private vs static / dynamic | visibility vs permanence: two separate ideas |
Can I do this?
- I can describe IPv4 and decide whether an address is valid.
- I can describe IPv6, shorten it correctly and compare it with IPv4.
- I can explain public, private, static and dynamic addresses and how a device gets one.
- I can explain network ID / host ID and read a subnet mask.
- I can give the purposes / benefits of subnetting.
Anything unticked: revise that section first. All ticked: take the quiz.
Quiz
The multiple-choice and guided questions need JavaScript. The concept checks and exam practice below work without it.
Concept checks
Answer each one in your head first, then open it.
1Why can two different homes both use 192.168.1.5?Show answer
It is a private address: it only has to be unique inside each LAN. On the internet both homes appear as their routers' different public addresses.
2Why does IPv6 use hexadecimal?Show answer
128 bits in denary groups would be very long; each hex digit is exactly 4 bits, so 8 groups of 4 hex digits write it compactly.
3Why must “::” appear only once?Show answer
It stands for “as many zero groups as needed to make 8”; with two of them you couldn't tell how many zeros each one replaces.
Exam-style practice
New questions, not used above. Do them on paper, then mark your work against the official mark scheme.
![(d) Draw one line from each term (public, private, dynamic, static IP address) to its most appropriate description: only visible to devices within the LAN; increments by 1 each time the device connects; a new one is reallocated each time a device connects to the internet; can only be allocated to a router; visible to any device on the internet; does not change each time a device connects to the internet. [4]](/notes-content/9618/communication/img/9618_s21_12_q05_d.png)
Show the mark scheme
| Part | Answer / working | Marks | Guidance |
|---|---|---|---|
| (d) | Public → it is visible to any device on the internet | B1 | |
| Private → it is only visible to devices within the LAN | B1 | ||
| Dynamic → a new one is reallocated each time a device connects to the internet | B1 | ||
| Static → it does not change each time a device connects to the internet | B1 | ||
| Total: 4 marks | |||
![(d) The devices in the office have static private IP addresses. State what is meant by a static private IP address. [1]](/notes-content/9618/communication/img/9618_s24_13_q05_d.png)
Show the mark scheme
| Part | Answer / working | Marks | Guidance |
|---|---|---|---|
| (d) | Static: the IP for that device does not change; private: it can only be accessed / seen / used within the LAN | B1 | both ideas needed |
| Total: 1 mark | |||
A device has IP address 192.168.20.33 and subnet mask 255.255.255.0.
- (a)State the network ID and the host ID.[2]
- (b)State whether 2001:db8::1::7 is a valid IPv6 address. Justify your answer.[1]
Show the mark scheme
| Part | Answer / working | Marks | Guidance |
|---|---|---|---|
| (a) | Network ID: 192.168.20 | B1 | |
| Host ID: 33 | B1 | ||
| (b) | Invalid: “::” is used twice (it may only appear once) | B1 | |
| Total: 3 marks | |||
Your progress on this note is saved when JavaScript is on.