NotesA LevelComputer Scienceip addressing subnetting
Back to Computer Science Notes

ip addressing subnetting

A LevelComputer Science~6 min read

Overview

# IP Addressing and Subnetting - A-Level Computer Science Summary This lesson covers the structure and function of IPv4 and IPv6 addressing schemes, including the distinction between network and host portions, address classes, and the role of subnet masks in network segmentation. Students learn to calculate subnet addresses, determine valid host ranges, and understand CIDR notation, alongside the practical application of subnetting for efficient network design and IP address allocation. These concepts are fundamental for exam questions involving binary-to-decimal conversion, subnet calculations, and explaining the necessity of address translation (NAT) due to IPv4 exhaustion.

Core Concepts & Theory

IP Addressing forms the foundation of network communication, allowing devices to identify and communicate with each other across networks.

IPv4 Address: A 32-bit binary number typically expressed as four decimal octets (e.g., 192.168.1.1), where each octet ranges from 0-255. Each IP address consists of two components: the network portion (identifies the network) and the host portion (identifies the specific device).

Subnet Mask: A 32-bit number that separates the network and host portions of an IP address. Written in dotted decimal notation (e.g., 255.255.255.0) or CIDR notation (/24). When performing a bitwise AND operation between an IP address and subnet mask, the result reveals the network address.

Key Formula: Number of usable host addresses = 2^n - 2, where n = number of host bits. Subtract 2 because the network address (all host bits = 0) and broadcast address (all host bits = 1) cannot be assigned to devices.

IP Address Classes:

  • Class A: 1.0.0.0 to 126.255.255.255 (default mask /8 or 255.0.0.0)
  • Class B: 128.0.0.0 to 191.255.255.255 (default mask /16 or 255.255.0.0)
  • Class C: 192.0.0.0 to 223.255.255.255 (default mask /24 or 255.255.255.0)

Subnetting divides a network into smaller subnetworks, improving security, reducing broadcast traffic, and enabling efficient IP address allocation. CIDR (Classless Inter-Domain Routing) notation expresses subnet masks as /n, where n represents the number of network bits (e.g., 192.168.1.0/26 means 26 network bits, 6 host bits).

Private IP Ranges (RFC 1918): 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 — reserved for internal networks and not routable on the public internet.

Detailed Explanation with Real-World Examples

Think of IP addressing like a postal system: the network portion is the city/street, while the host portion is the specific house number. Just as postal workers need both to deliver mail, routers need both portions to forward data packets.

Real-World Subnetting Scenario: A school with 500 devices needs efficient network management. Instead of using a single Class B network (65,534 hosts — wasteful!), they subnet into departments:

  • Administration: 192.168.1.0/26 (62 usable hosts)
  • IT Department: 192.168.1.64/26 (62 usable hosts)
  • Staff Room: 192.168.1.128/27 (30 usable hosts)
  • Library: 192.168.1.160/27 (30 usable hosts)

This provides security isolation (staff cannot access student networks without routing), reduces broadcast domains (broadcast traffic contained within subnets), and enables policy enforcement (different firewall rules per department).

Coffee Shop WiFi Analogy: Public WiFi often uses 192.168.1.0/24, providing 254 addresses for customers. When full, latecomers receive "no available IP address" errors because all host addresses are assigned. The router maintains a DHCP pool (e.g., 192.168.1.10 to 192.168.1.254), reserving .1 for itself (default gateway) and .2-.9 for servers.

Corporate VPN Example: Companies use private addressing (10.0.0.0/8) internally. When employees work remotely, VPN clients receive private IP addresses from the corporate subnet, creating an encrypted tunnel that makes remote devices appear on the local network. NAT (Network Address Translation) allows thousands of private IPs to share a single public IP when accessing the internet, conserving the limited IPv4 address space.

Worked Examples & Step-by-Step Solutions

**Example 1**: Given IP 172.16.45.78/20, find the network address, broadcast address, and usable host range. *Solution*: 1. /20 means 20 network bits, 12 host bits 2. Subnet mask: 255.255.**240**.0 (240 = 11110000 in binary) 3. Convert third octet to binary: 45 = 00101101 4. Apply mask (AND operati...

Unlock 3 More Sections

Sign up free to access the complete notes, key concepts, and exam tips for this topic.

No credit card required · Free forever

Key Concepts

  • IP Address: A unique numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication.
  • IPv4: The fourth version of the Internet Protocol, using 32-bit addresses, typically represented in dotted-decimal notation.
  • IPv6: The sixth version of the Internet Protocol, using 128-bit addresses, designed to replace IPv4 due to address exhaustion.
  • Subnetting: The process of dividing a large IP network into smaller, more efficient subnetworks (subnets).
  • +4 more (sign up to view)

Exam Tips

  • Practice binary-to-decimal and decimal-to-binary conversions regularly, as they are fundamental for subnetting calculations.
  • Memorize the default subnet masks for classful networks (A, B, C) and understand how the CIDR prefix `/n` relates to the subnet mask in dotted-decimal notation.
  • +3 more tips (sign up)

AI Tutor

Get instant AI-powered explanations for any concept in this topic.

Still Struggling?

Get 1-on-1 help from an expert A Level tutor.

More Computer Science Notes

Ask Aria anything!

Your AI academic advisor