Prefix length

2.1 Explain characteristics of routing technologies

Route Selection

📘CompTIA Network+ (N10-009)


Prefix Length in Route Selection

Prefix length is a critical concept in networking that helps routers determine the most specific route to send traffic. It’s closely tied to subnetting and IP addressing.


1. What is Prefix Length?

  • The prefix length tells you how many bits of an IP address are used to identify the network portion.
  • It’s written in CIDR (Classless Inter-Domain Routing) notation, for example:
    • 192.168.1.0/24
    • /24 is the prefix length
  • The bigger the number, the more specific the network:
    • /24 → 255.255.255.0 → 256 addresses
    • /28 → 255.255.255.240 → 16 addresses

Key Idea:

  • The network with the longest prefix (most bits in the network portion) is the most specific route.
  • Routers use this to make routing decisions when multiple routes exist to the same destination.

2. Why Prefix Length Matters in Route Selection

When a router receives traffic, it looks at its routing table to decide where to send the packet. If there are multiple matching routes, the router chooses:

  1. The route with the longest prefix length (most specific)
  2. If the prefix lengths are equal, the router may use administrative distance to decide

Example Routing Table:

DestinationPrefixNext Hop
192.168.1.0/24/24Router A
192.168.1.0/16/16Router B
  • Traffic for 192.168.1.50 → matches both routes
  • Which route is used?
    • /24 is more specific than /16, so Router A is chosen.

Tip for the exam: Longest prefix = most specific = preferred route.


3. How Prefix Length Works with Subnets

  • Prefix length defines the size of the subnet.
  • A smaller prefix length → bigger subnet → more IP addresses
  • A larger prefix length → smaller subnet → fewer IP addresses, more specific routing

Example:

NetworkPrefix LengthNumber of IPsSpecificity
10.0.0.0/8/816,777,216Low
10.1.0.0/16/1665,536Medium
10.1.1.0/24/24256High

Routing Decision:

  • Packet for 10.1.1.25 → sent to /24 route, because it’s the most specific.

4. How This Appears in IT Environments

  • Internal Networks:
    • Large company networks often have multiple subnets. Routers use prefix length to make sure traffic goes to the correct department or VLAN.
  • Internet Routing:
    • ISPs advertise networks with different prefix lengths.
    • Routers always prefer the longest prefix match to direct traffic accurately.
  • Firewall & ACL Rules:
    • When applying rules, network admins often use prefix lengths to target specific subnets.
  • VPNs:
    • When multiple VPN routes exist, routers use prefix length to decide which VPN tunnel to send traffic through.

5. Key Points to Remember for the Exam

  1. Prefix length = number of network bits in the IP address.
  2. Longest prefix match is always preferred for route selection.
  3. Smaller subnets (larger prefix lengths) = more specific route.
  4. If multiple routes have the same prefix length, routers fall back on administrative distance.
  5. Found in routing tables, used in both IPv4 and IPv6 networks.

6. Quick Memory Trick

  • Think: “More bits = more specific = preferred route”
  • Example: /28 > /24 > /16 > /8 when deciding which route to take.

Exam Tip:
On CompTIA Network+, you may get a routing table and a destination IP. Your task will be to identify which route the router will choose, and the rule is always: longest prefix match wins.

Leave a Reply

Your email address will not be published. Required fields are marked *

Buy Me a Coffee