Skip to main content

Network Layer

The network layer is responsible for addressing and routing across multiple networks.

Why It Matters​

  • Routing mistakes lead to "host/network unreachable" incidents.
  • NAT behavior impacts service exposure and debugging.
  • Subnet design determines scalability and blast radius.

IP Addressing​

IPv4 and IPv6​

TopicIPv4IPv6
Length32-bit128-bit
Notation192.168.1.102001:db8::10
Address SpaceLimitedVery large

CIDR and Subnets​

  • CIDR /24 means 24 network bits.
  • Subnetting controls address capacity and segmentation.

Routing Fundamentals​

Routers forward packets based on the longest-prefix match.

Useful commands:

ip route
traceroute api.example.com

NAT (Network Address Translation)​

Common NAT Types​

  • SNAT: internal source translated to egress public IP.
  • DNAT: inbound traffic forwarded to internal destination.

Typical backend impact:

  • Client IP visibility depends on proxy/NAT chain.
  • Connection tracking table limits can drop traffic under load.

ICMP for Diagnostics​

ICMP supports control messages used by ping and path diagnostics.

ping -c 4 1.1.1.1
mtr -rw api.example.com

Cloud and Kubernetes Notes​

  • VPC/VNet subnet planning should reserve growth headroom.
  • Kubernetes CNI allocates pod IPs; check overlap with node/service CIDRs.
  • Security group/NACL policy can mimic routing failures.

Incident Patterns​

Pattern: Host Unreachable​

  1. Verify local route table.
  2. Check next-hop gateway reachability.
  3. Confirm subnet and security policy alignment.

Pattern: Intermittent packet loss​

  1. Compare behavior by path/region.
  2. Check MTU mismatch and fragmentation.
  3. Inspect congestion and queue drops.