A-Level Computer Science / Unit 2: Networks, Connectivity and the Internet

2.1.8 IP Addressing II — Subnetting and Address Types

🔒 Lesson slides are available to signed-in users. Sign in

2.1.8 IP Addressing II — Subnetting and Address Types

In IP Addressing I, you learned the job of an IP address and how IPv4 and IPv6 are written. Now consider a larger question: how does an organisation organise its addresses, and which type of address should each network interface use?

This page examines network and host identifiers, subnets, and two separate distinctions: public versus private and static versus dynamic. The examples are deliberately simple so you can concentrate on explanation rather than lengthy calculations.

After studying this page, you should be able to

  • explain the difference between a network identifier and a host identifier;
  • describe what subnetting changes and why an organisation may use it;
  • compare public and private IP addresses, with accurate security implications;
  • describe the basic purpose of Network Address Translation (NAT);
  • compare static and dynamic addresses and justify a choice.

1. An address contains network and host information

When several interfaces belong to the same IP network, part of their address is shared. The rest distinguishes an interface within that network. A subnet mask or prefix length tells us where the division occurs.

Network ID: the address information used to identify a network or subnet.
Host ID: the part that distinguishes a host interface within that network.
Prefix length: the number of leading address bits used as the network portion.

For example, the /24 in 10.72.18.46/24 means the first 24 bits identify the network. IPv4 has 32 bits in total, leaving 8 bits for the host part in this example.

Do not assume every address splits after three numbers

The split depends on the prefix length. A /24 address is useful for teaching because the split happens between octets, but other prefixes divide bits at different positions.

2. Worked example — identifying the two portions

Consider an IPv4 interface with the address 10.72.18.46/24.

10.72.18 46 . Network portion: 24 bits Host portion: 8 bits
QuestionAnswerWhy?
What is the network address?10.72.18.0The host bits are set to zero.
What is the host identifier?46The final octet is the host portion in a /24 network.
What does /24 mean?24 network bitsThe remaining 8 of the 32 IPv4 bits are host bits.

Give the reason

Avoid saying that 46 is the host ID “because it is last”. Say that the /24 prefix leaves the last 8 bits as the host portion.

3. What does subnetting do?

An organisation may begin with one IP network but want smaller groups for different purposes. Subnetting takes one address range and divides it into more than one smaller network. Each resulting subnet has its own network address.

Subnet: one smaller logical network within an allocated IP address range.
Subnetting: dividing an existing IP network into smaller logical networks by extending the network prefix.

Here is a simple illustration. A neighbourhood recycling centre wants one group of addresses for its reception computers and another for its sorting-area devices.

Starting network 10.72.18.0/24 Reception subnet 10.72.18.0/25 Sorting-area subnet 10.72.18.128/25

Changing the prefix from /24 to /25 gives one extra network bit. That allows this address block to be shown as two smaller subnets. In practice, a router or a Layer 3 switch can forward data between those subnets.

One important limit

Subnetting does not increase the number of addresses in the original range. It divides the existing range into smaller parts. For this lesson, understanding the purpose and the network/host distinction matters more than lengthy subnet calculations.

4. Why might an organisation create subnets?

NeedHow subnetting helpsEffect for users or staff
Reduce unnecessary trafficLocal broadcasts remain within their own subnet.Other groups receive fewer broadcasts that do not concern them.
Organise devicesEquipment can be placed into separate network groups.Network problems can be investigated by area or function.
Apply access controlsTraffic between subnets can pass through a device that enforces rules.For example, visitors may be blocked from reaching staff-only systems.
Plan address useGroups can receive their own address ranges.It becomes easier to manage which interfaces belong in each part of the network.

A subnet is not a security product

Separate subnets make it possible to apply different access rules. They do not automatically block all communication between groups. A router, firewall or suitable network policy must enforce the restriction.

5. Public and private addresses

Not every IPv4 address is intended to be reachable through the public Internet. Some address ranges are reserved for use inside private networks.

CharacteristicPublic IP addressPrivate IPv4 address
UseFor globally routed Internet connections.For communication inside private networks.
UniquenessMust be globally unique while allocated.The same private values can be reused by unrelated organisations.
Public routingCan be routed across the Internet.Is not normally routed across the public Internet.
Common locationThe Internet-facing interface of an organisation's connection.Laptops, printers and other internal interfaces.

An IPv4 address such as 10.72.18.46 belongs to a private range. Private address ranges are useful because multiple organisations can choose internal addresses without requiring a separate public IPv4 address for every device. You do not need to memorise the full list of private ranges for this page.

What does this mean for security?

A private IPv4 address is not directly routed through the public Internet. This can reduce the direct exposure of an internal device. A public address may be reachable by outside systems if the network permits that traffic.

Private does not mean protected

Private addressing does not encrypt messages, remove malware, or stop someone who already has access to the internal network. Firewalls, access rules and secure account settings remain important.

6. How can a private-addressed device use the Internet?

A private IPv4 address is not normally used as a globally routed Internet destination. To communicate with public Internet servers, many networks use a router or firewall that performs Network Address Translation (NAT).

NAT: a method that changes relevant IP address information as traffic passes between networks, commonly allowing privately addressed devices to share a public IPv4 connection.

Suppose a computer at the recycling centre has private address 10.72.18.46. Its Internet-facing router uses the public address 203.0.113.47 in this documentation-only example.

  1. The computer sends a request towards the Internet.
  2. The NAT device substitutes public-facing address information and remembers which internal connection made the request.
  3. The server replies to the public-facing connection.
  4. The NAT device uses its stored mapping to deliver the reply to the correct computer.

Describe NAT precisely

NAT changes address information so private interfaces can communicate through public addressing. Do not call NAT a firewall: translation and deciding which connections are allowed are different jobs.

7. Static and dynamic IP addresses

An address can be configured to stay the same, or it can be supplied from a pool and possibly reassigned later. This is separate from whether the address is public or private.

QuestionStatic addressDynamic address
Does it stay fixed?Normally yes, until it is deliberately changed.It may change when the assignment is renewed or replaced.
How is it supplied?Manually configured, or consistently reserved for a device.Commonly assigned automatically by the network.
Typical reasonOther devices need a predictable address for a service.Devices join and leave without staff entering settings for each one.
ExampleInternal inventory server or network printer.Visitor tablet or employee laptop.

DHCP: automatic configuration

DHCP (Dynamic Host Configuration Protocol): a service that can supply IP configuration automatically, commonly giving a device an address for a limited lease period.

When a client joins a network, DHCP can provide an address and information needed to use that network. This reduces manual setup and allows addresses to be reused when devices leave. A client may receive the same address again; dynamic does not mean changing every time.

Static does not mean public

A fixed address may be used only inside a private network. Equally, an Internet-facing connection may use a public address assigned dynamically.

8. Two independent descriptions

It helps to ask two questions about an address: Where can it be used? and how stable is its assignment?

Possible combinationIllustrative situationReason
Private + staticInternal stock serverUsed within the organisation; other systems need a consistent address.
Private + dynamicStaff laptop on local Wi-FiInternal use; automatic allocation makes connecting easier.
Public + staticPublicly hosted service's Internet connectionThe service has a stable, externally reachable address.
Public + dynamicConsumer broadband connectionThe ISP supplies public addressing that may be reassigned.

For an explain question

State the relevant feature and link it to the requirement. For example, a fixed internal server address is useful because other devices can use a known address to find the service reliably.

9. Interactive — IP Address Explorer

This is your existing explorer. The IPv4 notation tab is a brief recap of IP Addressing I. Use the CIDR split, subnetting and NAT tabs to explore the main ideas of this lesson.

The diagrams show how addressing works. You are not expected to memorise every intermediate binary calculation shown by the widget.

IPv4 notation visualiser

Enter four decimal bytes. The widget shows the matching 32-bit binary address.

Dotted decimal 150.20.7.45

CIDR netID / hostID visualiser

Choose an address and a CIDR suffix. The highlighted bits show where the netID ends and the hostID begins.

netID bits 20
hostID bits 12
HostID codes 4096
netID bits hostID bits

Sub-netting visualiser

Start with an 8-bit hostID. Choose how many of those bits are reused as the internal LAN code.

LAN code workstation code
LAN code 101
LAN number 5
Workstation code 01100
Workstation number 12

NAT translation demo

Choose one internal device and send a request to the Internet. Watch the private source address being replaced by the public address of the NAT box.

Private network

NAT box Public IP 203.0.113.8
Internet Destination server 198.51.100.40

Select an internal device, then send a request.

  1. Step 1: The device sends a packet using its private internal IP address.
  2. Step 2: The NAT box replaces the private source address with its public IP address.
  3. Step 3: The Internet server replies to the public address of the NAT box.
  4. Step 4: The NAT box sends the reply back to the correct internal device.

Practice — applying addressing decisions

Original exam-style scenario

A community recycling centre has a reception network and a separate network for equipment in the sorting area. A stock server is used only by employees. Visitors occasionally connect tablets to guest Wi-Fi.

  1. An interface uses 10.72.18.46/24. State its network address and its host identifier. [2]
  2. Explain one benefit of placing the two work areas in different subnets. [2]
  3. Give one reason for assigning the internal stock server a private IP address and one reason for keeping it static. [2]
  4. Explain one advantage of supplying guest tablets with dynamic IP addresses. [2]
Reveal suggested marking points — 8 marks

(a) [2]: Network address 10.72.18.0 [1]; host identifier 46 [1].

(b) [2]: For example, broadcasts remain within their subnet [1], so the other area receives fewer unnecessary local messages [1]. Also accept an explained management benefit or a rule-based access-control benefit.

(c) [2]: Private: the server is used internally and its address is not routed directly through the public Internet [1]. Static: staff devices can find the server using a consistent address [1].

(d) [2]: The network can assign addresses automatically [1], avoiding manual IP setup each time a tablet connects [1]. Explained reuse of addresses is also acceptable.

These answers are independent classroom marking suggestions, not official Cambridge marking instructions.

Correct the statements

  1. “Any device with a private IP address is secure.”
  2. “Dynamic addresses change every time a computer starts.”
  3. “A static IP address must be visible to everyone on the Internet.”
  4. “Subnetting creates new addresses that were not in the original network.”
Reveal explanations
  1. Private addressing restricts normal public routing, but separate security controls remain necessary.
  2. A dynamically assigned address may be reused for the same device.
  3. An internal private address can be static; static only describes whether it is intended to stay fixed.
  4. Subnetting divides one address block rather than increasing its total size.

Review — how the ideas fit together

TermMeaning to remember
Network ID / Host IDThe prefix separates network information from information identifying a host within that network.
SubnettingMakes smaller logical networks from an existing network range.
Public addressCan be used in globally routed Internet communication.
Private addressUsed internally; not routed directly across the public Internet.
NATTranslates addressing information between private and public communication.
Static addressIntended to remain stable.
Dynamic addressAssigned in a way that permits later reassignment.

Self-check

  1. Can I explain what a /24 prefix tells us?
  2. Can I describe subnetting without claiming it adds more addresses?
  3. Can I give a specific security consequence of public versus private addressing?
  4. Can I explain NAT without confusing it with a firewall?
  5. Can I choose static or dynamic addressing for an unfamiliar situation and explain my reason?