teluzia.Cloud Engineer · Day 17
CHAPTER 03 · NETWORKING FUNDAMENTALS

Subnetting and routing

4–5 hours including independent practice3 topics
LET’S MAKE THIS SIMPLE

What you’re learning today

Divide a parent network and predict forwarding decisions. Subnets partition address space; routing chooses a next hop based on the destination. You will build a small routing table on paper and verify subnet boundaries with Python without changing your machine’s actual routes. Increasing prefix length divides a network into smaller blocks. A /24 splits into two /25 networks or four /26 networks. Every child must fit completely inside its parent, start on a valid boundary and avoid unintended overlap. Capacity planning must include reservations, growth and the number of required segments. A route associates a destination prefix with a next hop or local interface. When several routes match, the most specific matching prefix normally wins. A default IPv4 route 0.0.0.0/0 matches all destinations but yields to more specific routes. Actual route selection can include additional policy and metrics.

Think of it this way

Subnetting assigns neighborhoods; routing is the delivery map that chooses the next road toward a destination.

TOPIC 01 / 03Step by step

Subdivision and nonoverlap

Increasing prefix length divides a network into smaller blocks. A /24 splits into two /25 networks or four /26 networks. Every child must fit completely inside its parent, start on a valid boundary and avoid unintended overlap. Capacity planning must include reservations, growth and the number of required segments. 10.0.0.0/25 and 10.0.0.128/25 together exactly cover 10.0.0.0/24, while 10.0.0.64/25 is not a valid strict /25 boundary. Correct subdivision prevents ambiguous assignments and makes subnet roles, available capacity and future expansion visible before you configure interfaces or create any cloud networking resources at all. Choosing visually convenient decimal starts without prefix alignment creates invalid or overlapping networks; calculate block size and validate each child network before assigning roles today.

WORKED EXAMPLE
10.0.0.0/25 and 10.0.0.128/25 together exactly cover 10.0.0.0/24, while 10.0.0.64/25 is not a valid strict /25 boundary.
Why this matters

Correct subdivision prevents ambiguous assignments and makes subnet roles, available capacity and future expansion visible before you configure interfaces or create any cloud networking resources at all.

A common trap

Choosing visually convenient decimal starts without prefix alignment creates invalid or overlapping networks; calculate block size and validate each child network before assigning roles today.

MAKE IT VISIBLE

Explore a network boundary

CHANGE ONE VALUE. SEE WHAT HAPPENS.

Where does this network begin?

A CIDR prefix reserves the first bits for the network. More network bits means fewer addresses inside each network.

00001010000000000000000100101010
Network bits: 24Host bits: 8
NETWORK10.0.1.0/24
ADDRESS RANGE10.0.1.0 – 10.0.1.255
TOTAL ADDRESSES256
AWS SUBNET USABLE251
✦

AWS reserves five addresses in each subnet. Conventional IPv4 host counting often subtracts two instead. This explorer uses the AWS subnet count. AWS IPv4 subnet sizes range from /16 to /28; values outside that range are shown here to teach CIDR math.

Read all topics in this lesson

A complete reference to revisit alongside the guided steps above.

Subdivision and nonoverlap

Increasing prefix length divides a network into smaller blocks. A /24 splits into two /25 networks or four /26 networks. Every child must fit completely inside its parent, start on a valid boundary and avoid unintended overlap. Capacity planning must include reservations, growth and the number of required segments. 10.0.0.0/25 and 10.0.0.128/25 together exactly cover 10.0.0.0/24, while 10.0.0.64/25 is not a valid strict /25 boundary. Correct subdivision prevents ambiguous assignments and makes subnet roles, available capacity and future expansion visible before you configure interfaces or create any cloud networking resources at all. Choosing visually convenient decimal starts without prefix alignment creates invalid or overlapping networks; calculate block size and validate each child network before assigning roles today.

WORKED EXAMPLE
10.0.0.0/25 and 10.0.0.128/25 together exactly cover 10.0.0.0/24, while 10.0.0.64/25 is not a valid strict /25 boundary.

Why this matters

Correct subdivision prevents ambiguous assignments and makes subnet roles, available capacity and future expansion visible before you configure interfaces or create any cloud networking resources at all.

A common trap

Choosing visually convenient decimal starts without prefix alignment creates invalid or overlapping networks; calculate block size and validate each child network before assigning roles today.

Routes and longest-prefix match

A route associates a destination prefix with a next hop or local interface. When several routes match, the most specific matching prefix normally wins. A default IPv4 route 0.0.0.0/0 matches all destinations but yields to more specific routes. Actual route selection can include additional policy and metrics. Given 0.0.0.0/0 via A and 10.0.0.0/24 via B, traffic to 10.0.0.42 chooses B because /24 is more specific than /0. Longest-prefix reasoning explains why adding a default route does not override an existing specific route and helps diagnose unexpected traffic paths without changing unrelated network components immediately. Assuming the first route displayed always wins ignores specificity and policy; compare destination membership and prefix length before interpreting a route listing during troubleshooting of reachability.

WORKED EXAMPLE
Given 0.0.0.0/0 via A and 10.0.0.0/24 via B, traffic to 10.0.0.42 chooses B because /24 is more specific than /0.

Why this matters

Longest-prefix reasoning explains why adding a default route does not override an existing specific route and helps diagnose unexpected traffic paths without changing unrelated network components immediately.

A common trap

Assuming the first route displayed always wins ignores specificity and policy; compare destination membership and prefix length before interpreting a route listing during troubleshooting of reachability.

Return paths and host configuration

Reachability requires a viable forward path and a return path, plus permissive filtering and a listening application where relevant. A host decides whether a destination is local using its interface prefix, then uses routing for remote destinations. Incorrect masks can make a host attempt direct neighbor resolution for a remote address. A request can leave through a correct gateway but never receive a reply if the destination lacks a return route to the source network. Checking both directions prevents one-sided reasoning and makes packet loss diagnosable across interfaces, gateways and security boundaries rather than attributing every timeout to the application service alone. A working outbound route does not prove bidirectional reachability; inspect the return route and filtering rules before concluding the remote application is broken or unavailable to users.

WORKED EXAMPLE
A request can leave through a correct gateway but never receive a reply if the destination lacks a return route to the source network.

Why this matters

Checking both directions prevents one-sided reasoning and makes packet loss diagnosable across interfaces, gateways and security boundaries rather than attributing every timeout to the application service alone.

A common trap

A working outbound route does not prove bidirectional reachability; inspect the return route and filtering rules before concluding the remote application is broken or unavailable to users.

KEEP THESE WITH YOU

Today’s takeaways

Align child boundaries.

Apply longest-prefix match.

Trace return traffic as well as requests.

CLOSE THE LOOP

Ready to complete this day?

Verify the practical steps and pass the knowledge check (at least two thirds correct).

Lab steps verifiedKnowledge check passed