Skip to topic
    ← Back to course topics

    Public and private IP addresses — AQA A-Level Computer Science

    Public IP addresses are globally unique and routable across the public Internet, whereas private IP addresses are reserved for local area networks and cannot be routed across the Internet. Network Address Translation (NAT) maps private addresses to a public address, conserving the limited IPv4 address space and enhancing local network security.

    Public and private IP addresses explained

    Routable IP addresses are public addresses that Internet routers forward between networks, so any host on the Internet can, in principle, send packets to them.

    Read the full explanation

    Non-routable addresses are private addresses, reserved for use inside a local network, and routers on the Internet do not forward packets addressed to them. In practice, private addresses are set aside in defined ranges such as 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255 and 192.168.0.0 to 192.168.255.255. A home or office network may give each device a private address, while a router uses one public address to communicate with the Internet. Learners should be able to state the difference in terms of whether packets can be routed across the Internet, and to identify which kind of address a given device would use when communicating with external servers.

    Your focus

    1. Distinguish between routable and non-routable

    Which command word is this?

    Set out the causes, reasons, or mechanisms of a process. For NAT questions, you must trace the lifecycle of a packet, including header replacement, table storage, and reply matching.

    Public and private IP addresses exam tips

    Topic Overview

    In AQA A-Level Computer Science, understanding public and private IP addressing is fundamental to networking, architecture, and protocol analysis. This topic explains how billions of networked devices communicate across both internal local networks and the wider Internet without exhausting the 32-bit IPv4 address space.

    Students must master the distinction between globally routable public addresses and locally isolated private addresses, alongside the critical bridging mechanism of Network Address Translation (NAT). These principles underpin modern cybersecurity, enterprise infrastructure design, and the transition toward IPv6.

    Key Concepts
    • →Public IP addresses: Globally unique, routable addresses assigned by ICANN/ISPs that allow direct communication over the Internet.
    • →Private IP addresses: Non-routable addresses reserved under RFC 1918 (such as 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) used exclusively within local area networks.
    • →Network Address Translation (NAT): The process performed by a router or firewall that rewrites IP header addresses and ports to allow private IP devices to share a public IP address.
    • →Port Address Translation (PAT): A specific form of NAT where multiple devices share a single public IP by using unique Layer 4 port numbers to multiplex connections.
    • →Address exhaustion: The rapid depletion of the 4.3 billion available IPv4 addresses, which necessitated private addressing, NAT, and the development of 128-bit IPv6.
    Marking Points
    • States that routable addresses are public and can be routed across the Internet
    • States that non-routable addresses are private and are not forwarded by Internet routers
    • Identifies that private addresses are used within a local network
    • Explains that a router typically translates between private addresses and one public address when a device communicates externally
    Examiner Tips
    • 💡Use the terms routable and non-routable precisely, linking each to whether Internet routers forward the packet
    • 💡When asked to distinguish, give a contrast in each clause rather than describing one type only
    • 💡Name a private address range when giving an example to show knowledge of the concept
    • 💡Always specify that public IP addresses must be globally unique, while private IP addresses only need to be locally unique to their LAN segment.
    • 💡When explaining NAT, always mention the NAT translation table and the role of port numbers in distinguishing which private client sent the original request.
    • 💡Use correct RFC 1918 example subnets (e.g. 192.168.x.x or 10.x.x.x) when asked to provide an example of a private IP address in exam questions.
    Common Mistakes
    • Describes private addresses as unusable on a local network; correct this by stating they are used inside a local network but not across the Internet
    • Confuses public and private with IPv4 and IPv6; correct this by recognising the distinction concerns routing scope, not the address version
    • Claims every device on the Internet has a private address; correct this by stating that devices communicating externally use a public address, often via a router
    • Believing NAT is a replacement for a firewall: While NAT hides private IP addresses from direct incoming external scans, it is an addressing protocol, not a comprehensive security tool. Outbound-initiated malicious payloads can still enter.
    • Thinking private IP addresses cannot access the Internet at all: Private IP packets cannot traverse the Internet directly, but they can access web services seamlessly when mapped via NAT at the gateway router.
    • Assuming every device on a home Wi-Fi network has a distinct public IP address: All connected devices typically share one single public IP address assigned to the domestic broadband router.
    Revision Plan
    1. 1Day 1-2: Review IPv4 address formats, binary-to-decimal conversion, and the RFC 1918 designated private address blocks.
    2. 2Day 3-4: Diagram the step-by-step operation of Network Address Translation (NAT) and Port Address Translation (PAT), focusing on packet header modification.
    3. 3Day 5-6: Compare IPv4 conservation methods (NAT and private addressing) with the long-term solution offered by IPv6's 128-bit address space.
    4. 4Day 7: Complete past paper exam questions focused on network protocols, NAT tables, and address classification under timed conditions.
    Exam Question Types
    • 📋Comparison/Distinction questions: Stating two or three definitive differences between public and private IP addresses (e.g. routability, uniqueness, allocation authority).
    • 📋Scenario-based NAT explanation: Explaining how packets traverse a gateway router from a local workstation to an external server using a NAT table.
    • 📋Short definition questions: Identifying whether a given IP address belongs to a private range or explaining why IPv4 addresses have become scarce.
    Command Word Expectations (AQA)
    Explain

    Set out the causes, reasons, or mechanisms of a process. For NAT questions, you must trace the lifecycle of a packet, including header replacement, table storage, and reply matching.

    Compare

    Identify both similarities and differences between two concepts (such as public vs private IP addresses), linking corresponding qualities rather than listing isolated descriptions.

    State

    Provide a concise, factual answer without lengthy reasoning, such as identifying a valid private IP address range or naming the translation mechanism.

    How Students Lose Marks (Examiner Pitfalls)
    Pitfall: Confusing private IP addresses with MAC addresses or claiming private IP addresses are completely invisible to the outside world without mentioning NAT.
    ❌ Weak Answer (Loses Marks):A private IP address is hidden on a LAN so hackers cannot see it, while a public IP is what you use on Google.
    Example improved answer:A private IP address is drawn from non-routable address spaces (such as 192.168.0.0/16) and is used exclusively within a private local area network (LAN). Because routers on the global Internet discard packets with private destination addresses, a router must use Network Address Translation (NAT) to replace the private source IP address with its own globally unique public IP address before forwarding traffic onto the Internet.
    Examiner Tip: Explicitly state that private IP addresses are non-routable on the Internet and mention Network Address Translation (NAT) when describing how hosts communicate externally.
    Pitfall: Stating that private IP addresses must be globally unique across all computers worldwide.
    ❌ Weak Answer (Loses Marks):Every device in the world has a unique private IP address given to it by its manufacturer.
    Example improved answer:Private IP addresses only need to be unique within their specific local area network. Different, unconnected private networks frequently reuse the exact same private address ranges (e.g. 192.168.1.10), as they are isolated by boundary routers.
    Examiner Tip: Contrast the scope of uniqueness: public IPs are globally unique, whereas private IPs are locally unique within an isolated network segment.
    Step-by-Step Worked Solutions

    Question: Explain the role of Network Address Translation (NAT) when a host on an internal network with the IP address 192.168.1.45 requests a webpage from an external web server with the public IP address 93.184.216.34. [4 marks]

    1. 1.Step 1: Identify source and destination in the initial packet: The host creates an IP packet with private source address 192.168.1.45 and destination 93.184.216.34, sent with an ephemeral source port.
    2. 2.Step 2: Explain router NAT table operation: The edge router intercepts the packet at the LAN boundary, replaces the private source IP address with its own public IP address, and allocates an external port number. It logs this mapping (internal IP, internal port, external port, destination IP) in its NAT translation table.
    3. 3.Step 3: Detail external transmission and return packet handling: The packet is routed across the Internet to the web server. When the web server replies, it sends the response to the router's public IP address and the allocated external port.
    4. 4.Step 4: Final translation to internal client: The router consults its NAT table, identifies the original client (192.168.1.45:port), modifies the destination IP/port back to the private address, and forwards the packet onto the LAN.
    Final Answer: NAT modifies outbound packets by replacing the private IP address with the router's public IP address, recording the mapping and port numbers in a NAT table. Upon receiving the return traffic, NAT maps the destination back to the host's private IP address, enabling Internet communication using a single shared public IP.

    Question: An organisation has 250 workstations in one building and wishes to connect them to the Internet. Discuss why the network administrator configures the workstations with private IPv4 addresses rather than public IPv4 addresses. [4 marks]

    1. 1.Step 1: Discuss address conservation: IPv4 addresses are 32-bit and in severely depleted supply. Allocating 250 distinct public IPv4 addresses is costly and often impossible through an ISP.
    2. 2.Step 2: Explain cost efficiency: Private IP addresses are free to allocate internally under RFC 1918 standards, requiring only one or a few public IP addresses for the gateway router.
    3. 3.Step 3: Discuss security benefits: Devices assigned private IP addresses cannot be addressed or initiated directly from external Internet hosts. This prevents direct unsolicited incoming connections from malicious actors.
    4. 4.Step 4: Synthesise network management: Private IP addressing allows internal restructuring and subnetting without needing ISP approval or re-registering public IP ranges.
    Final Answer: Using private IPv4 addresses conserves the depleted global IPv4 address pool and reduces ISP leasing costs, as 250 devices can share a single public IP via NAT. Furthermore, private addresses enhance security because internal hosts are not directly routable or accessible from the public Internet.
    Active Recall Memory Test
    What are the three main IPv4 private address ranges reserved by RFC 1918?
    Key Fact: 10.0.0.0 to 10.255.255.255 (10.0.0.0/8), 172.16.0.0 to 172.31.255.255 (172.16.0.0/12), and 192.168.0.0 to 192.168.255.255 (192.168.0.0/16).
    Why can two computers in different houses have the exact same private IP address without causing a conflict?
    Key Fact: Because private IP addresses are only used within isolated local networks and are non-routable over the public Internet; boundary routers use NAT with distinct public IPs.
    What data does a router record in its NAT table to correctly route responses back to internal devices?
    Key Fact: Internal source IP address, internal source port number, external translated port number, and the external destination IP address/port.
    What primary problem does the combination of private IP addressing and NAT solve?
    Key Fact: The depletion and exhaustion of available 32-bit IPv4 addresses.
    Frequently Asked Questions
    Can two devices have the same public IP address?
    No two active interfaces on the public Internet can have the same public IP address simultaneously because public addresses must be globally unique to ensure packets are routed to the correct destination. However, multiple local devices on the same home or office network can share one public IP address when communicating with the Internet via Network Address Translation (NAT) on their gateway router.
    Why can't private IP addresses be routed over the Internet?
    Private IP addresses are specifically designated as non-routable by RFC 1918 standards. Internet backbone routers are explicitly programmed to drop any packet that contains a private IP address in its destination header. This prevents routing confusion, as millions of separate private local networks worldwide use the exact same address ranges.
    What is the difference between NAT and PAT?
    Basic NAT maps one private IP address to one public IP address (often one-to-one from a pool of public IPs). Port Address Translation (PAT), frequently called NAT overload, maps multiple private IP addresses to a single public IP address by assigning unique Layer 4 port numbers to each connection. PAT is the most common form of NAT used in consumer and small business routers.
    Will IPv6 completely eliminate the need for private IP addresses and NAT?
    IPv6 provides an enormous address space (2^128 addresses), eliminating the strict need for NAT as an address-conservation technique since every device on Earth can have a globally unique IPv6 address. However, private addressing concepts still exist in IPv6 (such as Unique Local Addresses, or ULAs) for internal network isolation, security boundaries, and local communication without Internet connectivity.