First exams 2027 · SL & HL

A2.3.1 · Data transmissions

IP Addressing

Every device on the internet needs an address to be found by, the same way every house needs one to receive mail. But there's more than one kind of address, and knowing which kind applies where is most of what this statement actually tests.

Core for SL & HL Typically 2–4 marks · AO1/AO2 Command term: describe

Explainer

A postal address works because it's structured: country, then city, then street, then house number, each part narrowing down where a letter should end up. An IP address does the same job for a device on a network, a structured number that uniquely identifies it so data sent to it actually arrives.

Df

An IP address is a number assigned to a device on a network, following the Internet Protocol, that uniquely identifies it so other devices know where to send data meant for it.

Explainer

IPv4 vs IPv6

IPv4 is the older, still far more common addressing scheme, but it has a hard capacity limit that the internet has already run into. IPv6 exists specifically to solve that limit, at the cost of a longer, less familiar-looking address.

FeatureIPv4IPv6
Address size32 bits128 bits
Written asFour decimal numbers, 0–255, separated by dots, e.g. 192.168.1.1Eight groups of four hexadecimal digits, separated by colons, e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Total addressesAbout 4.3 billionAbout 340 undecillion (3.4 × 1038), enough for every device ever likely to be built

The whole reason IPv6 exists: 4.3 billion sounds like a lot until it's divided among billions of people who each own several devices, phones, laptops, watches, smart speakers, and IPv4 ran out of fresh addresses to hand out years ago.

Explainer

Public vs private addresses

Not every device needs to be reachable from anywhere on the internet, and giving every device its own globally unique address would burn through IPv4's already-limited supply even faster. Splitting addresses into public and private is how the internet avoids that.

1

A public IP address is globally unique, no two devices on the internet share one, and is directly reachable from anywhere. Public addresses are used by things the outside world needs to find directly: websites, mail servers, a home router's outward-facing side.

2

A private IP address only has to be unique inside its own network, not the whole internet, and isn't directly reachable from outside it. Private addresses are used by the ordinary devices sitting behind a router: laptops, phones, printers, smart TVs.

Reserved private rangeTypically used for
10.0.0.0 to 10.255.255.255One large private network
172.16.0.0 to 172.31.255.255A handful of mid-sized private networks
192.168.0.0 to 192.168.255.255Smaller networks, most home WiFi routers included

These three ranges are set aside specifically so they're never handed out as public addresses, which is exactly what makes them safe to reuse: your home network's 192.168.1.7 and a completely different household's 192.168.1.7 never collide, because neither is ever directly visible to the other from the public internet.

Explainer

Static vs dynamic addresses

An address can also be classified by whether it ever changes. This is a genuine trade-off, not a case of one option simply being better.

Static

Real example: a school's own web server, which needs to be found at the exact same address every single time.

Advantage
  • Always reachable at the same address (essential for anything other devices need to find reliably: servers, printers set up once and left alone)
Disadvantage
  • Has to be set up and tracked manually (an administrator assigns it by hand, and it permanently occupies one address from the limited IPv4 pool whether or not the device is even switched on)
Dynamic

Real example: a student's phone joining the school's guest WiFi for one afternoon.

Advantage
  • Reuses a limited pool efficiently (assigned automatically only while a device is actually connected, then freed for the next device once it disconnects)
Disadvantage
  • Can change between sessions (unsuitable for anything that other devices need to find at a fixed, predictable address)
!

Dynamic addresses are handed out by a DHCP server (Dynamic Host Configuration Protocol), which keeps a pool of available addresses and lends one to each device as it connects, taking it back once the device disconnects or the lease expires.

Worked example

Network address translation (NAT)

Every device behind a home router has a private address, but the internet only ever sees the router's one public address. NAT is the mechanism that makes this actually work: it rewrites addresses (and port numbers) as traffic crosses the router, in both directions, keeping track of which internal device each conversation belongs to.

Df

Network address translation (NAT) is the process a router uses to translate the private IP addresses of devices on its internal network into its own single public IP address for anything they send to the internet, and to translate replies back to the correct private address on the way in.

Chloe and Lachlan share one router's public address Step 1 of 4

Chloe's laptop (private address 192.168.4.21) sends a request to a website, using local port 5001. It leaves the laptop addressed from 192.168.4.21:5001.

Outbound: 192.168.4.21:5001 → website

The router's NAT process rewrites the source address to its own public address, 203.0.113.9, and assigns a public port, 40001, recording the mapping in its own NAT table so it knows where any reply belongs.

NAT table adds: 192.168.4.21:5001 <-> 203.0.113.9:40001 Outbound (rewritten): 203.0.113.9:40001 → website

Meanwhile Lachlan's phone (private address 192.168.4.35) does the same thing from its own local port, 5001. Two devices, but the outside world only ever sees ONE public address, 203.0.113.9, just with a different port for each.

NAT table adds: 192.168.4.35:5001 <-> 203.0.113.9:40002 Outbound (rewritten): 203.0.113.9:40002 → website

When the website's reply arrives back at port 40001, the router looks that port up in its NAT table, finds Chloe's laptop, and rewrites the address back before forwarding it inward. Lachlan's reply, arriving on port 40002, gets routed back to his phone the same way.

Inbound to 203.0.113.9:40001 → NAT table lookup → forwarded to 192.168.4.21:5001 Inbound to 203.0.113.9:40002 → NAT table lookup → forwarded to 192.168.4.35:5001
!

Two separate reasons NAT matters, both examinable: it conserves the limited pool of public IPv4 addresses (thousands of devices behind one router share a single public address), and as a side effect it also hides the internal network's real structure, since an outside attacker can only ever see the router's one public address, never any specific device's actual private address.

Try it yourself

Run a NAT table as code

The exact outbound/inbound translation from the stepper above, written as a function. Try adding a third device, or looking up a port that was never assigned.

main.py
Loading Python engine…
Output
Press Run to see the output here.

Running in offline fallback mode. The full Python engine couldn't load (blocked school network, or no internet), so this console switched automatically to a small hand-written engine. It supports this page's functions and loops, but it isn't full Python.

The NAT table is a list of [private_ip, private_port, public_port] rows, exactly the "internal table that tracks active sessions" idea from the explainer above, just written out in code instead of prose.

Check your understanding

A company's internal network has 200 devices, each with a private address in the 192.168.0.0 to 192.168.255.255 range, but the company's router has only ONE public IP address from its internet provider. When an employee's laptop successfully browses a website, what makes this possible?

Common mistake

Markers reported this pattern when asked to explain NAT

RecurringA genuinely documented pattern: candidates asked to explain NAT's function lose marks for staying too abstract, naming that NAT is "good for security" or "helps save addresses" without ever stating the actual mechanism, that it translates a device's private address into a shared public one (and back again for the reply).

✕

Too vague: "NAT helps keep the network secure and saves IP addresses." Names a real benefit but never says what NAT actually does to earn it, this sentence could describe several unrelated network features.

✓

Names the mechanism: "NAT translates a device's private IP address into the router's public IP address (assigning it a port) when it sends data out, and translates incoming replies back to that private address using its own internal table." States exactly what is translated, in which direction, and how the router knows where a reply belongs, which is what actually earns the mark.

Linking question

How this connects to the rest of the syllabus

The IB syllabus is deliberately woven together, not a stack of isolated topics. Here's how IP addressing connects specifically to A4 (machine learning) and the theory of knowledge, worth thinking through, not just memorising: it's the kind of synthesis a Paper 1/2 question can genuinely ask for.

TOK

Are similar ethical principles needed when transmitting data over a network as when using data in machine learning algorithms? (Both involve data moving somewhere the original owner may not fully see or control, whether that's a packet crossing a network's boundary via NAT or a dataset being fed into a training algorithm.)

Revision questions

Past-paper style. Write an answer, then reveal the marking points and mark yourself.

Question 1 · 2 marks

[2]Distinguish between a public IP address and a private IP address.

Question 2 · 3 marks

[3]Explain why a web server would normally be given a static IP address rather than a dynamic one.

Question 3 · 4 marks

[4]Explain the role of network address translation (NAT) in letting several devices on one home network reach the internet through a single address.

Flashcards

Active recall for this statement’s key terms.