A2.3.1 · Data transmissions
IP addressing
By the end you can
Compare IPv4 and IPv6, public and private, static and dynamic addresses, and explain how NAT lets many devices share one public address.
An is the number that identifies a device on a network that uses the Internet Protocol, and it is what routers use to deliver packets. Several different kinds exist; the syllabus wants you to compare them in three ways: the version, whether it is public or private, and whether it is static or dynamic.
IPv4 and IPv6#
addresses are 32 bits, written as four decimal numbers from 0 to 255 separated by dots (192.168.1.1). That gives about 4.3 billion addresses, and with phones, laptops and smart devices, they ran out. addresses are 128 bits, written as eight groups of four hexadecimal digits separated by colons (2001:0db8:85a3:0000:0000:8a2e:0370:7334), giving about 3.4 × 1038 addresses, so many that every device could have its own for ever. IPv6 also has a simpler fixed-format header, and has IPsec encryption support as standard (optional in IPv4). To keep IPv6 readable, you may drop leading zeros in a group, and replace one run of all-zero groups with ::.
Public and private#
A is unique across the whole internet. Internet registries hand them out, and anything that must be reachable from outside (a website, a mail server, your router's internet side) has one. A is for use inside a network only. Three ranges are reserved for this, and internet routers will not forward them, so every home and school can use the same ones without clashing:
10.0.0.0to10.255.255.255(over 16 million addresses)172.16.0.0to172.31.255.255192.168.0.0to192.168.255.255
The whole 127.x.x.x block is : sending to 127.0.0.1 (IPv6: ::1) sends the data back to your own machine, which is how programmers test network software without a network. IPv6 has its own private block too, the addresses starting fc or fd (FC00:: to FDFF::).
IPv4, private
10101100.00010100.00000101.00000101
It falls in one of the three ranges reserved for private networks (10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255, 192.168.0.0 to 192.168.255.255). Routers on the internet do not forward these, so any home or school network can reuse them, and NAT is needed to reach the internet.
Static and dynamic#
A address is set by hand (or reserved) and never changes. Servers, printers and routers need one, so everyone knows where to find them. It costs administrator effort, and mistakes cause conflicts. A address is leased for a time by DHCP and may be different next time. Phones and laptops get these: it is automatic, and a small pool of addresses can serve far more devices than are ever online together.
Network address translation#
If everything inside uses private addresses, how does a laptop reach a website? Through on the router. When your laptop (192.168.1.20) sends a packet out, the router replaces the private source address with its own public address and picks a fresh port number, writing both in a NAT table. When the reply arrives for that public address and port, the router looks it up and sends it to the right laptop. Thousands of devices appear to the internet as one address, which saves IPv4 addresses, and since the table only has entries for connections started from inside, outsiders cannot start a conversation with a hidden device, which is a modest security benefit.
Check yourself
IP addressing
Quick questions, made fresh every time and marked here. Do a few until they feel easy.
Exam practice
Paper 1-style questions
5 questions · 18 marks
Write your answer as you would in the exam, then show the mark points and tick each one your answer made. These are our own questions in the style of the exam, not past-paper questions.
1.Distinguish between IPv4 and IPv6.
[4]Distinguish: Make the differences between two things clear.
2.Describe the difference between public and private IP addresses.
[4]Describe: A detailed account: say what happens, step by step if it is a process.
3.Describe the differences between static and dynamic IP addresses, and give a use for each.
[4]Describe: A detailed account: say what happens, step by step if it is a process.
4.Describe how network address translation (NAT) works and why it is used.
[4]Describe: A detailed account: say what happens, step by step if it is a process.
5.State the purpose of the address 127.0.0.1 and its IPv6 equivalent.
[2]State: Give a short answer, no explanation needed.
In a nutshell
- An IP address identifies a device on a network that uses the Internet Protocol. IPv4 is 32 bits (about 4.3 billion addresses, written as four numbers); IPv6 is 128 bits (eight groups of hex).
- Public addresses are unique on the internet. Private ones (10.x.x.x, 172.16 to 172.31, 192.168.x.x) are reused inside networks and are not routed on the internet.
- 127.0.0.1 (IPv6 ::1) is loopback: it points back at the same machine.
- Static addresses are fixed (for servers and printers); dynamic addresses are leased, usually by DHCP (for ordinary client devices).
- NAT lets many private devices share one public address by rewriting addresses and ports and keeping a table of connections, which also hides the inside from the outside.
