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.
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.
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.
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address size | 32 bits | 128 bits |
| Written as | Four decimal numbers, 0–255, separated by dots, e.g. 192.168.1.1 | Eight groups of four hexadecimal digits, separated by colons, e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334 |
| Total addresses | About 4.3 billion | About 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.
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.
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 range | Typically used for |
|---|---|
10.0.0.0 to 10.255.255.255 | One large private network |
172.16.0.0 to 172.31.255.255 | A handful of mid-sized private networks |
192.168.0.0 to 192.168.255.255 | Smaller 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.
Real example: a school's own web server, which needs to be found at the exact same address every single time.
- Always reachable at the same address (essential for anything other devices need to find reliably: servers, printers set up once and left alone)
- 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)
Real example: a student's phone joining the school's guest WiFi for one afternoon.
- Reuses a limited pool efficiently (assigned automatically only while a device is actually connected, then freed for the next device once it disconnects)
- 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.
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'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.
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.
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.
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.
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.
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
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.
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.
[2]Distinguish between a public IP address and a private IP address.
Marking points
评分要点
- A public IP address is globally unique and directly reachable from anywhere on the internet; it is used by things the outside world must find, such as web servers.
- A private IP address is only unique within its own network and is not directly reachable from outside; it is used by ordinary devices behind a router, such as laptops and printers.
- 公有 IP 地址全球唯一,可从互联网任何地方直接访问;用于外界必须找到的东西,例如网页服务器。
- 私有 IP 地址只在自己的网络内唯一,不能从外部直接访问;用于路由器后面的普通设备,例如笔记本和打印机。
[3]Explain why a web server would normally be given a static IP address rather than a dynamic one.
Marking points
评分要点
- Other devices need to reach a web server reliably at the same address every time.
- A static address never changes, so DNS records and links keep pointing at the right place.
- A dynamic address can change between sessions, so the server could become unreachable at its old address.
- 其他设备需要每次都能在同一地址可靠地访问网页服务器。
- 静态地址从不改变,所以 DNS 记录和链接始终指向正确的位置。
- 动态地址两次会话之间可能改变,所以服务器在旧地址上可能变得无法访问。
[4]Explain the role of network address translation (NAT) in letting several devices on one home network reach the internet through a single address.
Marking points
评分要点
- Every device behind the home router has a private IP address, but the internet only ever sees the router's one public address.
- When a device sends a packet out, NAT rewrites the source address to the router's public address and assigns a port, recording the mapping in a NAT table.
- When a reply comes back on that port, the router looks it up in the table and rewrites the address back to the correct private device before forwarding it inward.
- So many devices share one public address, conserving the limited IPv4 pool.
- 家用路由器后面的每台设备都有一个私有 IP 地址,但互联网只看到路由器的一个公有地址。
- 当一台设备把数据包发出去时,NAT 把源地址改写成路由器的公有地址并分配一个端口,在 NAT 表中记录这个映射。
- 当回复在那个端口回来时,路由器在表中查找它,把地址改写回正确的私有设备,再向内转发。
- 所以许多设备共用一个公有地址,节省了有限的 IPv4 地址池。
Flashcards
Active recall for this statement’s key terms.
Keep this statement’s practice with you
Free account: unlock every revision question and flashcard for A2.3.1, and every other IB CS 2027 statement.