IB COMPUTER SCIENCE | A2.3.1 IP Addressing

Lesson objective

Describe IPv4 and IPv6, public and private addresses, static and dynamic assignment, and how NAT supports private-to-public communication and conserves public IPv4 use.

Learn

A2.3.1 | DIFFERENT TYPES OF IP ADDRESSING

01 | AN ADDRESS HAS SEVERAL DIFFERENT CHARACTERISTICS

Your laptop can have an address such as 192.168.10.24 on the school network while a website sees the translated address used by the school’s internet connection. Tomorrow the laptop might receive the same local address, or a different one. These observations describe different aspects of addressing, not a contradiction.

An IP address identifies an interface for IP communication and supports packet delivery. A device can have several interfaces and multiple addresses, so “one device always has exactly one address” is an unreliable rule.

This lesson separates three questions: Which version? IPv4 or IPv6. Which scope? Public or private in the common IPv4 distinction. How is it assigned? Static or dynamic. We then use network address translation (NAT) to explain how private IPv4 hosts can communicate with public services.

These categories can be combined. An IPv4 address can be private and dynamically allocated, private and statically configured, public and dynamic, or public and static.

02 | IPV4: FOUR DECIMAL OCTETS, 32 BITS

An IPv4 address is 32 bits long. It is commonly written as four decimal numbers separated by dots, such as 192.168.10.24. Each number represents an 8-bit group called an octet, so each must be from 0 to 255.

The dots make the written address easier to read; they are not extra bits in the address. The address is still a binary value. For example, decimal 192 is binary 11000000, and decimal 24 is binary 00011000.

There are 2³² possible 32-bit patterns, approximately 4.3 billion. This is not the number of publicly assignable host addresses: some ranges and particular addresses are reserved or used for special purposes. The limited IPv4 address space is a major reason for address sharing and IPv6 adoption.

192

11000000

8 bits

168

10101000

8 bits

10

00001010

8 bits

24

00011000

8 bits

03 | IPV6: A MUCH LARGER ADDRESS SPACE

An IPv6 address is 128 bits long. Its full written form uses eight groups of four hexadecimal digits separated by colons. Each group represents 16 bits, so eight groups represent 128 bits.

For example, 2001:0db8:0000:0000:0000:0000:0000:0024 is a complete IPv6 example. The 2001:db8::/32 block is reserved for documentation; it is not a live public address to configure on your device.

Hexadecimal digits include 0–9 and A–F. They provide a compact way to write the much longer binary value. There are 2¹²⁸ possible bit patterns, approximately 3.4 × 10³⁸, although not every pattern is available for ordinary global interface assignment.

The main addressing comparison is 32 bits versus 128 bits, with dotted decimal versus colon-separated hexadecimal notation. IPv6 does not automatically make every application faster or eliminate the need for secure configuration.

04 | READ AN ABBREVIATED IPV6 ADDRESS

IPv6 notation permits two useful abbreviations. First, omit leading zeros inside a group: 0db8 can become db8 and 0024 can become 24. A group containing only zeros can be written as 0.

Second, replace one consecutive run of all-zero groups with ::. In the example, 2001:db8::24 represents the same 128-bit address as the full form. The abbreviation changes its written appearance, not its length in bits.

Use :: at most once in one address. Otherwise a reader could not tell how many omitted zero groups belong in each location. When expanding it, restore enough zero groups to make eight groups in total.

A zero inside a non-zero group is not a leading zero. For example, 1200 cannot be shortened to 12: those are different values.

StepWritten example
Full form2001:0db8:0000:0000:0000:0000:0000:0024
Remove leading zeros2001:db8:0:0:0:0:0:24
Compress one zero run2001:db8::24

05 | COMPARE IPV4 AND IPV6 WITHOUT MIXING THE CATEGORIES

FeatureIPv4IPv6
Address length32 bits128 bits
Common notationFour decimal octets separated by dotsEight hexadecimal groups in full form, separated by colons
Example for reading192.168.10.242001:db8::24, a documentation example
Address-space size2³² possible bit patterns2¹²⁸ possible bit patterns
Address conservationPrivate addressing with port translation commonly shares public IPv4 addressesLarge address space reduces the need for address-conservation NAT
DeploymentWidely used; often operates alongside IPv6Can coexist with IPv4 through suitable deployment mechanisms

IPv4 and IPv6 are different protocol versions; one is not simply the longer text form of the other. A dual-stack device can use both. Connectivity between versions requires suitable support; an IPv4-only endpoint does not automatically exchange native IPv6 packets.

Do not describe IPv4 as “private” and IPv6 as “public”. Both versions have address categories and scopes. The public/private comparison below begins with the common IPv4 case, then introduces IPv6 scope separately.

06 | PUBLIC IPV4: ADDRESSING FOR THE PUBLIC INTERNET

A public IPv4 address is intended for globally unique, publicly routable unicast addressing. Providers and organisations obtain address resources through allocation and assignment arrangements. Ordinary unrelated internet interfaces cannot simply choose the same public address and expect correct global delivery.

Public addressing does not mean a service is open to everybody. A firewall can block inbound traffic, an application can require authentication, and a host may have no listening service at all. Routability and permission are different questions.

The address on a home router’s internet-facing connection may be dynamically assigned or provided as a stable allocation. Some providers instead put the connection behind carrier-grade address sharing, so not every customer-facing router necessarily holds its own globally public IPv4 address.

You do not need provider implementation detail for the core comparison. Remember that public scope concerns external addressing and routing, not whether the address was assigned manually or automatically.

07 | PRIVATE IPV4: REUSE INSIDE SEPARATE NETWORKS

Private IPv4 addresses come from ranges reserved for private networks. They are not routed as ordinary public destinations across the global internet. A school and a home can both use 192.168.1.24 internally because the same private space can be reused in separate networks.

Within one connected addressing context, assignments still need to be coordinated. Giving two active interfaces the same conflicting address can break communication. Joining previously separate private networks can also expose overlapping-address problems.

Private is not a promise of confidentiality. It does not encrypt traffic, identify a trusted user or prevent every attack. Access control, endpoint protection and secure application design still matter.

Learn the complete ranges, especially the middle one: not every address beginning 172 is private.

Private blockInclusive range
10.0.0.0/810.0.0.0 to 10.255.255.255
172.16.0.0/12172.16.0.0 to 172.31.255.255
192.168.0.0/16192.168.0.0 to 192.168.255.255

08 | NOT PRIVATE DOES NOT AUTOMATICALLY MEAN ORDINARY PUBLIC

IP addressing includes special-purpose space. For example, IPv4 loopback addresses in 127.0.0.0/8 refer back to the local host; 127.0.0.1 is the familiar localhost example. They are not ordinary globally routable destinations.

Likewise, 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are reserved for documentation. This lesson uses these ranges to represent external systems in diagrams without pointing students at a real organisation’s service. They represent a public-side role in the model, but the actual example addresses are not live public destinations.

The activity below checks only whether a well-formed IPv4 address falls inside the three private-use blocks. An address outside those blocks is labelled “not RFC 1918 private”, not automatically “public”. It does not determine whether the address can be allocated to a host in a given subnet.

09 | STATIC: A STABLE CONFIGURED ASSIGNMENT

A static IP assignment is configured to remain stable rather than being selected through ordinary changing lease allocation. It is useful when systems need a predictable address, for example a router interface, an internal service or a printer.

Administrators must choose an appropriate address, prefix and gateway and avoid conflicts. Manually selecting an address inside an unmanaged DHCP allocation pool can create a collision with a later lease. Keep a documented allocation plan.

Static does not mean technically impossible to change. An administrator or provider can deliberately reconfigure the assignment. It means the address is intended to stay fixed until such a change, rather than relying on ordinary dynamic selection.

A DHCP reservation offers a related management option: the server supplies a chosen address to a recognised client. This gives a stable outcome while still delivering configuration through DHCP. Describe that mechanism explicitly rather than assuming all stable addresses were typed into the device.

10 | DYNAMIC: ALLOCATE AND MANAGE AUTOMATICALLY

A dynamic IP assignment is allocated automatically under a configuration mechanism, commonly a DHCP lease for IPv4. The service selects an available address and supplies associated settings. This reduces manual configuration for many changing clients.

The client can renew its lease. It may receive the same address repeatedly, so dynamic does not mean a new address on every connection or every renewal. The address may change when circumstances and allocation policy require it.

A moving student laptop is a good example: it can obtain configuration appropriate to the network it joins without carrying a manually fixed address for every location. A provider can also assign a public address dynamically to a customer connection.

Automatic allocation still needs enough address capacity, correct configuration and dependable service. A client cannot treat an expired lease as valid forever simply because it worked yesterday.

11 | SCOPE AND ASSIGNMENT ARE INDEPENDENT

ExampleScopeAssignment approach
Internal printer with documented fixed 192.168.10.40 configurationPrivate IPv4Static
Student laptop receiving 192.168.10.86 through ordinary DHCP allocationPrivate IPv4Dynamic
Provider supplies a fixed globally routable address for an external servicePublic IPv4Static
Provider leases a globally routable address to a connectionPublic IPv4Dynamic

The numbers themselves do not reveal whether they were allocated statically or dynamically. The same private address could be manually configured in one network and leased in another. Look at the assignment mechanism and policy.

Do not confuse dynamic addressing with dynamic routing. Addressing concerns interface configuration; routing concerns how packet-forwarding paths are selected. They answer different questions.

12 | NAT: TRANSLATE BETWEEN ADDRESSING CONTEXTS

Network address translation (NAT) changes IP addressing information as traffic passes a translating device. In a common outbound IPv4 arrangement, the translator replaces an internal private source address with an external address and tracks the mapping needed for return traffic.

Basic NAT translates addresses. Network address and port translation (NAPT), often called PAT or NAT overload, also translates transport port information. This allows many internal connections to share one public IPv4 address while keeping their mappings distinct.

For example, two laptops can both connect to the same HTTPS service. The translator can map their separate internal address/port pairs to different external ports using one external address. Replies can then be associated with the correct internal connection.

This conserves public IPv4 address use: each internal host does not need its own separate public IPv4 address for the ordinary shared outbound model. The translator does not create more unique IPv4 bit patterns; it reuses private space and multiplexes external use.

13 | FOLLOW TWO CONNECTIONS THROUGH A TRANSLATION TABLE

Our simplified TCP example has laptop A at 192.168.10.24 and laptop B at 192.168.10.25. Both use local source port 51000 to reach the same service at destination port 443. Their distinct internal addresses distinguish them before translation.

The translator uses documentation address 203.0.113.8 for its external role, with source ports 62001 and 62002. The external service is represented by 198.51.100.20. These are reserved teaching addresses, not live systems.

Step through outgoing and return traffic. The destination service does not see the private source addresses in these translated packets. The example omits handshake, checksum updates, mapping expiry and detailed mapping/filtering policies; real implementations track further connection information.

Internal TCP endpointTranslated external endpointRemote service
192.168.10.24:51000203.0.113.8:62001198.51.100.20:443
192.168.10.25:51000203.0.113.8:62002198.51.100.20:443

14 | NAT IS NOT ENCRYPTION OR A COMPLETE SECURITY POLICY

NAT changes addressing information. It does not by itself encrypt the application data, prove who a user is or remove vulnerabilities. A private address is not a security control that replaces a firewall.

Many ordinary inbound packets without an applicable mapping will not reach an internal host in the common sharing arrangement. This practical behaviour is not the same as a complete, deliberately designed security policy. Firewalls supply explicit filtering and state rules; NAT and firewall functions often coexist in one device.

Unsolicited inbound access may require a configured destination mapping, such as port forwarding, plus appropriate firewall permission. Direct peer connections can also be complicated by translation. Opening a mapping is not proof that the internal service is safe.

NAT has operational costs: the translating device tracks mappings, troubleshooting can be harder and failure or exhausted resources can interrupt communication. Use the conservation benefit alongside these limitations in a balanced description.

15 | IPV6 SCOPE AND AUTOMATIC CONFIGURATION

IPv6 has several scopes and address categories. Global unicast addresses support global unicast communication when routing and policy allow. Link-local addresses, from fe80::/10, are used on the local link and are not forwarded by routers to other links. Unique local addresses use fc00::/7, with locally generated addresses commonly beginning fd. They are intended for local communication rather than ordinary global internet routing.

These categories mean “every IPv6 address is public” is wrong. IPv6’s large space reduces the need for IPv4-style address-conservation translation, but it does not remove firewalls or the need to plan addressing and access.

IPv6 supports automatic configuration, including SLAAC, where a host can form addresses using advertised prefix information, and DHCPv6 for supported configuration roles. Manual configuration is also possible. IPv6 does not mean “always static”.

A device can hold several IPv6 addresses, including a link-local address and other addresses with different lifetimes or purposes. Do not assume a public address permanently identifies one person or one physical device.

16 | PUT THE CATEGORIES INTO PRACTICE

Classify the precise property requested in each situation. Separate version, scope, assignment and translation instead of trying to give one label that replaces all the others.

17 | COMMON MISCONCEPTIONS

ClaimCorrection
Dynamic means it changes on every connectionA dynamic lease may repeatedly provide the same address
Private addresses cannot communicate with public servicesA common IPv4 NAT/NAPT arrangement translates outbound traffic and replies
Anything outside RFC 1918 is publicSpecial-purpose ranges also exist
A static address is always publicPrivate interfaces can be statically configured
One external address means one internal deviceNAPT can share external addressing across many internal connections
IPv6 removes the need for securityRouting scope, firewall policy and application protection still matter

When describing an example, give separate properties: “This is a private IPv4 address allocated dynamically by DHCP.” Then describe translation separately if the scenario includes a NAT boundary.

18 | DESCRIBE THE FEATURE AND ITS PURPOSE

For describe, state the main characteristics clearly. For IPv4 and IPv6, include bit length and notation. For public and private, describe scope and reuse. For static and dynamic, describe the assignment mechanism and likely purpose.

A connected answer might say: “IPv4 uses 32-bit addresses written as four decimal octets, while IPv6 uses 128-bit addresses commonly written in hexadecimal groups. Private IPv4 ranges can be reused in separate internal networks, whereas public IPv4 addressing supports global routing. Either scope can use static or dynamic assignment.”

For translation: “NAPT maps internal address/port pairs to external address/port pairs, allowing multiple internal connections to share a public IPv4 address. Return packets are translated using the matching mapping, so the reply reaches the correct internal endpoint.”

Use a concrete example and avoid unrelated guarantees. Static does not mean secure, private does not mean encrypted, public does not mean unrestricted access, and IPv6 does not mean every application becomes faster.

MATCH THE ADDRESSING IDEA TO ITS MEANING

Terminology

Terminology

IP address

An address identifying an interface for IP communication and supporting packet delivery.

Interface

A network attachment point that can have one or more addresses.

IPv4

Internet Protocol version 4, using 32-bit addresses.

IPv6

Internet Protocol version 6, using 128-bit addresses.

Octet

An eight-bit group, commonly written as a decimal number in IPv4 notation.

Dotted decimal

IPv4 notation using four decimal octets separated by dots.

Hexadecimal

Base 16 notation using digits 0–9 and A–F.

IPv6 zero compression

Replacing one consecutive run of zero groups with :: in a written address.

Public IPv4 address

An address intended for globally unique publicly routable unicast use.

Private IPv4 address

An address in an RFC 1918 block reserved for private network use.

RFC 1918 ranges

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.

Address reuse

Using the same private address space in separate networks without requiring global uniqueness.

Loopback

Addressing referring back to the local host, such as IPv4 127.0.0.1.

Documentation address

Reserved example addressing that should not be treated as a live public service.

Static assignment

An address configuration intended to remain stable until deliberately changed.

Dynamic assignment

Automatic address allocation under a mechanism such as ordinary DHCP leasing.

DHCP lease

A time-limited allocation of an address and related configuration.

DHCP reservation

A configured chosen-address allocation to a recognised client through DHCP.

Address conflict

An unintended duplicate assignment that disrupts communication within a relevant addressing context.

NAT

Translation of IP addressing information across an addressing boundary.

Basic NAT

Address translation without the port-sharing mechanism of NAPT.

NAPT / PAT

Address and port translation allowing internal connections to share external IPv4 addressing.

Translation mapping

Recorded association between internal and translated endpoint information.

Transport port

A logical identifier helping distinguish transport endpoints, not a physical socket.

Port forwarding

A configured inbound destination mapping, subject to routing and security policy.

Dual stack

Support for both IPv4 and IPv6 on a system or network.

IPv6 global unicast

IPv6 addressing for global unicast communication where routing and policy allow.

IPv6 link-local

IPv6 addressing confined to the local link, from fe80::/10.

IPv6 unique local

IPv6 local-use addressing from fc00::/7; locally generated examples commonly start fd.

SLAAC

IPv6 stateless address autoconfiguration using advertised prefix information and host mechanisms.

Questions

Questions

CHECK YOUR UNDERSTANDING

Select all correct choices. Each exact set earns one point.

1. Which describe IPv4 correctly?
2. Which describe IPv6 correctly?
3. Which are RFC 1918 private IPv4 examples?
4. Which are careful scope statements?
5. Which describe static/dynamic assignment?
6. Which describe NAPT?
7. Which are correct about the translation example?
8. Which are realistic limitations?
9. Which apply to IPv6?
10. Which make accurate descriptions?

EXPLAIN AND COMPARE

Write your answers before revealing each sample.

1. Describe IPv4 addressing.

2. Describe IPv6 addressing and compare its size with IPv4.

3. Describe how 2001:db8::24 expands.

4. Describe public and private IPv4 addressing.

5. Give the three private IPv4 ranges.

6. Compare static and dynamic assignment.

7. Explain why an address cannot reveal its assignment method by its numbers alone.

8. Describe how NAPT conserves public IPv4 addresses.

9. Explain how the two laptops receive the correct replies in the example.

10. Describe two limitations of NAT.

11. Describe IPv6 scope and configuration options.

12. Describe a suitable addressing plan for a small school example.

DESCRIBE IT | A SCHOOL CONNECTION

A school uses private IPv4 addressing for laptops and stable addresses for internal services. Describe a suitable assignment approach for each, distinguish those choices from address scope, and show how two laptop connections can share one external IPv4 address through NAPT. Add an IPv6 comparison and state which security controls are still needed.

Flashcards

Flashcards

Click to flip. Select the ideas you need to revisit.

0 cards selected for revision.

    Selections are kept while this page is open.

    Workbook

    Workbook

    COMING SOON

    The workbook for A2.3.1 IP Addressing is coming soon. Complete the matching task and written questions in your exercise book.