A2.3.1 — IP Addressing

← Back to A2.3 overview

The Internet Protocol (IP)

IP facilitates the routing and delivery of packets across networks. Every device connected to a network using IP is assigned an IP address, a unique numerical identifier used for communication.

IPv4 vs IPv6

FeatureIPv4IPv6
Address size32-bit128-bit
FormatDotted decimal — 192.168.1.1
Each segment: 0–255
8 groups of 4 hex digits — 2001:0db8:85a3::8a2e:0370:7334
Total addresses~4.3 billion~340 undecillion (3.4 × 10³⁸)
HeaderComplex — 14 fieldsSimplified — 8 fixed fields
IPsec supportOptionalMandatory

Public vs Private IP Addresses

Public IP Addresses

  • Assigned to devices that directly access the internet.
  • Globally unique. No two devices can share the same public IP
  • Managed and allocated by IANA (Internet Assigned Numbers Authority) via regional registries.
  • Used by web servers, email servers, and any internet-accessible device.

Private IP Addresses

  • Used within a private network , not exposed to the internet.
  • Defined by RFC 1918. Not routed on the internet ,reusable by anyone in private networks.
  • Devices need NAT to communicate with the internet.

Special: Loopback Address

  • IPv4: 127.0.0.1 — directs network traffic back to the device itself. Range 127.0.0.0–127.255.255.255 reserved for loopback.
  • IPv6: ::1 (shorthand for 0000:0000:0000:0000:0000:0000:0000:0001).
  • Used for testing network software on the local machine without sending data over a real network.

Static vs Dynamic IP Addresses

StaticDynamic
AssignmentPermanently assigned. Does not change.Assigned temporarily by a DHCP server. May change on each connection.
ConfigurationManually configured by a network administrator.Automatically configured, no manual input needed.
Best forWeb servers, email servers, printers. anything needing a stable, consistent address.End-user devices — laptops, phones, home PCs. Efficiently manages limited IP pools.

NAT — Network Address Translation

IPv4 doesn't have enough addresses for every device to have a unique public IP. NAT solves this by allowing many private IP addresses to share a single public IP address.

How NAT works

  1. A device on the private network sends a packet to the internet.
  2. The router (NAT device) replaces the device's private IP and source port with the router's public IP and a modified port number.
  3. The modified packet is sent to the internet.
  4. When a response arrives, the router consults its internal NAT table to find which private device the response belongs to.
  5. The router translates the public IP + port back to the correct private IP + port and forwards it to the device.
sUMMARY: