What is IP?

The Internet Protocol (IP) is the principal communications protocol in the Internet Protocol Suite for relaying datagrams across network boundaries. It provides the addressing system that enables data to be routed between devices on different networks.

Key Features

Addressing

Provides unique IP addresses to identify devices on networks worldwide.

Routing

Enables packets to find their way across multiple networks to reach destinations.

Fragmentation

Breaks large packets into smaller fragments when crossing networks with different MTUs.

Best Effort

Provides unreliable, connectionless delivery - reliability is handled by higher layers.

IPv4 Header Structure

The IP header contains essential routing and delivery information:

  • Version: IP version (4 for IPv4)
  • Header Length: Size of IP header
  • Type of Service: Quality of service indicators
  • Total Length: Size of entire IP packet
  • Identification: Unique packet identifier for fragmentation
  • Flags: Fragmentation control
  • Fragment Offset: Position of fragment in original packet
  • Time to Live (TTL): Maximum hops before packet is discarded
  • Protocol: Next layer protocol (TCP=6, UDP=17)
  • Header Checksum: Error detection for header
  • Source/Destination Address: 32-bit IP addresses

IP Addressing

IPv4 uses 32-bit addresses, typically written in dotted decimal notation:

  • Class A: 1.0.0.0 to 126.255.255.255 (large networks)
  • Class B: 128.0.0.0 to 191.255.255.255 (medium networks)
  • Class C: 192.0.0.0 to 223.255.255.255 (small networks)
  • Private Ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
  • Loopback: 127.0.0.0/8 (localhost)

Routing Fundamentals

IP routing determines the path packets take through networks:

  • Routing Tables: Store network destinations and next-hop information
  • Default Gateway: Router for packets destined outside local network
  • Subnet Masks: Determine network and host portions of addresses
  • CIDR: Classless Inter-Domain Routing for efficient address allocation

IP in AWS Architecture

IP addressing is fundamental to AWS networking:

  • VPC CIDR Blocks: Define IP address ranges for virtual networks
  • Subnet Design: Allocate IP ranges within availability zones
  • Elastic IPs: Static public IP addresses for AWS resources
  • Route Tables: Control IP traffic routing within VPCs
  • NAT Gateways: Enable private subnet internet access
  • Security Groups: IP-based access control rules
  • Load Balancers: Distribute traffic across multiple IP addresses

Modern Challenges & Solutions

IPv4 Address Exhaustion

Problem: Limited 32-bit address space

Solutions: NAT, CIDR, IPv6 adoption

Security

Problem: No built-in authentication or encryption

Solutions: IPSec, VPNs, application-layer security

Quality of Service

Problem: Best-effort delivery only

Solutions: DSCP markings, traffic shaping, QoS policies