Classless routing vs classful routing

Router routes traffic based on the longest prefix, and cannot find any match traffic will be dropped.

Classless routing

The routing that we normally understand is classless routing.

Let’s explore the routing tables of R1 and R2.

R1_1

R2_1

R1_2.png

R1 pings to 10.10.10.2 because a specific static route 10.10.10.2 is in the routing table

R1_3.png

R1 can ping to the above two addresses because the default route is matched. So classless routing is this:

  1. Find the route with the longest prefix.
  2. If there is no match in the longest prefix it will match the default route

Classful routing

R1_4.png

ip classless is turned on by default. To demonstrate classful routing we need to turn off ip classless and ip cef.

R1_1

Let’s revisit R1’s routing table. With classful routing, routing decision changes.

R1_5.png

No problem with 10.10.10.2 because there is a specific match in the routing table.

No problem with 172.30.1.1 because there is no big networks 172.30.x.x in the routing table and it matches the default route.

Problem with 192.168.1.33, because there is a big network which says:

192.168.1.0/24 is variably subnetted, 4 subnets, 3 masks.

Now 192.168.1.33 is under 192.168.1.0/24 and because there is no specific route and it matches the big network the traffic is dropped due to no match is found. Router will not look into the default route when there is no match for 192.168.1.0/24.

R1_6.png

From the debug it says 192.168.1.33 is unroutable. In this scenario specific route to 192.168.1.33 has to be added to the routing table.

R1_7.png

So classful routing:

  1. matches route with the longest prefix same as the classless routing.
  2. if there is a big network, and there is no specific route to this big network the traffic is drop.
  3. If there is no longest prefix route, and the address is not under any big network then router consults the default route.
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s