Only two routing protocols use link-state: Open Shortest Path First (OSPF) and Intermediate System to Intermediate System (IS-IS). Open Shortest Path First (OSPF) and Intermediate System to Intermediate System (IS-IS) share many similarities and differences. Both routing protocols provide the necessary routing functionality.
Open Shortest Path First (OSPF)
The Open Shortest Path First (OSPF) protocol is the most popular protocol that uses link-state. The Internet Engineering Task Force (IETF) designed OSPF in 1987. Currently, the OSPF has two working versions. OSPFv2 for IPv4 networks, as explained in RFC 2328, is an open standard. The second version is OSPFv3 for IPv6 networks, as stated in RFC 2740. The OSPFv3 also supports IPv4 addresses. Open Shortest Path First (OSPF) is an open standard that will run on most routers. Open Shortest Path First (OSPF) uses the Dijkstra algorithm to provide a loop-free topology. It provides fast convergence with triggered and incremental updates via Link State Advertisements (LSAs). It is also a classless protocol and allows for a hierarchical design with VLSM and route summarization.
Intermediate System to Intermediate System (IS-IS)
Intermediate System to Intermediate System (IS-IS) is an open standard routing protocol designed by the International for Standardization (ISO) and described in ISO 10589. It was initially designed for the Open System Interconnection (OSI) protocol suite and not for the TCP/IP protocol suite. Later, Integrated IS-IS, or Dual IS-IS, started providing support for IP networks. Though IS-IS is known as the routing protocol for Internet Service Providers(ISPs) and carriers, more enterprise networks are beginning to use IS-IS. The ISPs and carriers use IS-IS because of its scalability and strength. It is much easier than OSPF to build a large network. IS-IS carries a payload of reachability data, but for the most part, it doesn’t care what’s in the payload.
Link-state routing protocols have several advantages and disadvantages compared to distance vector routing protocols. This article will discuss these advantages and disadvantages.
Advantages of link-state
Fast Network Convergence—Fast network convergence is the main advantage of the link state routing protocol. On receiving an LSP, link state routing protocols immediately flood the LSP out of all interfaces without any changes except for the interface from which the LSP was received.
Topological Map—Link state routing creates the network topology using a topological map or SPF tree. Using the SPF tree, each router can determine the shortest path to each network separately.
Hierarchical Design—Link state routing protocols use multiple areas and create a hierarchical design for the network areas. The multiple areas allow better route summarization.
Event-driven Updates– After the initial flooding of LSPs, the LSPs are sent only when there is a change in the topology and contain only the information regarding that change. The LSP contains only the information about the affected link. The link state never sends periodic updates.
Disadvantages of Link State
The Link-state also has some disadvantages compared to distance vector routing protocols:
Memory Requirements—The link state routing protocol creates and maintains a database and SPF tree, which require more memory than a distance vector protocol.
Processing Requirements—Link state routing protocols require more CPU processing because the SPF algorithm requires more CPU time than distance-vector algorithms, like Bellman-Ford. After all, link-state protocols build a complete map of the topology.
Bandwidth Requirements–The link state routing protocol floods the link-state packet duringinitial startup and at events like network breakdown and network topology changes, affecting the network’s available bandwidth. If the network is not stable, it also creates issues with the bandwidth.
Link-state routing protocols are also known as shortest-path first protocols. They maintain a complete picture of all the routers running a link-state routing protocol in the complete network. All routers running a link-state routing protocol originate information about themselves and their directly connected routers, links, and the state of those links as multicast messages.
The link-state router tries to maintain complete network topology by updating itself whenever a change occurs. Link-state routing protocols are based on the Shortest Path First (SPF) algorithm to find the best path to a destination. The shortest Path First (SPF) algorithm is also known as the Dijkstra algorithm. The OSPF is an example of a Link-State Routing Protocol.
Link State Process
Following is the process of the link-state routing protocol. The process is the same for both OSPF for IPv4 and OSPF for IPv6.
Link and Link-State
Link and Link-state is the first step in the routing process. Each router learns about its links and directly connected networks. When a router interface is configured with an IP address and subnet mask and also in the state of no shutdown, it becomes part of that network. Refer to the topology in the Figure below. R3 has just been added to the network, and the IP addresses on the router interface are not configured yet; only the physical connectivity has been done. So, the router is not part of Link-State.
The network administrator now configured the IP addresses of the router interfaces connected to R2 and R5 and changed the state of interfaces from shutdown to no shutdown. As they become active, R3 learns about its own directly connected networks. Without any routing protocols, these directly connected networks are now entries in the routing table.
The router’s interfaces must be accurately configured with IP addresses and subnet masks, and the link must be in the state of no shutdown before the link-state routing protocol can learn about a link. Also, like distance vector protocols, the interface must be included in one of the network router configuration statements before participating in the link-state routing process.
Link-state routers have direct information from all their neighbor routers. Each router originates information about itself, its directly connected links, and the state of those links. This information is passed around the network from router to router, and each router makes a copy of it without changing it. So, every router gets identical information about the internetwork, and each router will independently calculate its best paths.
In the reference topology, the R3 link to its directly connected networks are:
FastEthernet 0/0 – 192.168.2.0/24
FastEthernet 0/1 – 192.168.3.0/24
The link-state information includes the following information:
The interface’s IPv4 address and subnet mask
The type of network, such as Ethernet or Serial link
The cost of that link
Any neighbor routers on that link
The link state of R3 is the following:
Link1
Network: 192.168.2.0/24
IP address: 192.168.2.1
Type of network: Ethernet
Cost of that link: 10
Neighbours: None
Link2
Network: 192.168.3.0/24
IP address: 192.168.3.1
Type of network: Serial
Cost of that link: 64
Neighbours: None
Hello Protocol
The second step in the link-state routing process is the responsibility of meeting with neighbors on directly connected networks. Routers with the link-state routing protocol use a Hello protocol for establishing and maintaining router-neighbor relationships. A neighbor is any other router enabled with the same link-state routing protocol. The link-state routing protocol uses Hello packets for neighbour discovery and also for recovery.
The protocol continues exchanging Hello packets between two adjacent neighbors and serves as a keep-alive function to monitor the neighbor’s state. Suppose any router stops receiving Hello packets from a particular neighbor. This neighbor is considered unreachable, so the link-state protocol clears this router from adjacency.
Now refer to Figure 1 above, R1 sends Hello packets to it’s all interfaces when the administrator configures it, to discover the link-state neighbours .R2, and R3 respond to the Hello packet with their own Hello packets as these routers have configured with the same link-state routing protocol as shown in figure 2. The FastEthernet 0/0 interface has no neighbors. So R1 did not receive any hello on this interface; therefore, it does not continue with the link-state routing process steps for the FastEthernet 0/0 link.
OSPF Hello Packet
After the primary exchange of Hello Packet, the routers add each other to their Neighbor Tables. The Neighbour table is the list of connected OSFP-enabled routers. Hello, packets are not recorded in the OSPF database, but if the hello packet has not been received from a particular neighbor for 40 seconds. The link-state routing protocol marked this particular neighbor as down. For example, OSPF will not take any notice if a link goes down for 20 seconds and again comes back to up status.
If a link goes down from a minute to half an hour, OSPF floods an LSA when it goes down and another LSA when it is up again. If a link is down for over half an hour, LSAs originated by remote routers begin to age out. When the link returns, all these LSAs will be flooded again. If a link is down for over an hour, any LSAs originated by remote routers will have aged out and been flushed. The link will be like a new OSPF route when it comes back up.
Building the Link State Packet (LSP)
The third step in the link-state routing process is building the link-state packet (LSP) containing the state of each directly connected link. It carries the information a network router generates in a link-state routing protocol that lists the router’s neighbors. It is a datagram determining the names of routers, including the cost or distance to any neighboring routers and linked local networks. It can also choose a new neighbor In case of link failure. The LSP also determines what the new neighbor is if a link fails and the cost of changing a link if required.
LSPs are queued for transmission and must time out at about the same time. The network is used to distribute the LSP but cannot use the routing database. When a router has established adjacencies to other routers, it can build its LSP containing the link-state information about its links. Now refer to the figure below. The LSP from R1 should contain the information like the following:
R1; FastEthernet network 192.168.0.0/24; Cost 1
R1 -> R2; Serial point-to-point network; 192.168.1.0/24; Cost 1
R1 -> R3; Serial point-to-point network; 192.168.3.0/24; Cost 1
Flooding LSP
After building the LSP, each router floods the LSP to all neighbours in the link-state routing process. This is the fourth step in the link-state routing process. The neighbor routers receive the LSP and save it in the database. All routers in the same routing area flood the link-state information to each other.
When a router receives the LSP from any of its interfaces, then the receiving router immediately sends that LSP out to all interfaces except the receiving interface. This process continues from router to router in the same area until all routers receive the LSP. When flooding LSP is completed then the link-state routing protocol calculates the SPF algorithm, thus the link-state routing convergence speed is very high.
The routers do not send LSPs periodically like the hello packet. They are only sent during the initial startup of the routing protocol on the router. After that, the LSPs are needed to flood when network changes occur in the topology. They are also required when a network breakdown occurs or after the network comes back.
The LSPs also included information, such as sequence numbers and aging information, to help manage the flooding LSP process. Each router uses this information to determine if it has received the LSP from another router or has new and updated information than the LSP already contained in the link-state database. This process allows a router to keep only the most current information in its link-state database. Suppose we discuss the topology in the previous lesson, building the Link State Packet. The R1 will flood the LSP packet to all its interfaces containing the following data.
R1; FastEthernet network 192.168.0.0/24; Cost 1
R1 -> R2; Serial point-to-point network; 192.168.1.0/24; Cost 1
R1 -> R3; Serial point-to-point network; 192.168.3.0/24; Cost 1
Building the SPF Tree
The routers in the same area use the link-state database and SPF algorithm to build the SPF tree. For example, in the figure below, R1 builds the SPF tree using the link-state information from all other routers. The SPF algorithm reads the router’s LSP to recognize networks and the link’s costs.
In the first step, R1 identifies its directly connected networks and their costs. After identifying the directly connected network, R1 begins identifying unknown networks from R2 and R3. Then, the SPF algorithm calculates the shortest paths to reach each network.
The SPF algorithm then calculates the shortest paths to reach each network. Each router in the area builds its own SPF tree separately from all other routers. To ensure accurate routing, the link-state databases used to construct those trees must be identical on all routers.
Building the Link-State Database
Link-state database building is the last step in the link-state routing process. Each router in the link-state uses the database to build a complete map of the topology and computes the best path to each destination network. All routers receive LSPs from every other link-state router in the same routing area. the
These LSPs are stored in the link-state database. Each router maintains a separate link-state database for every area to which it belongs, in case more than one area is configured in the network. The link-state database is also referred to as the topological database, and routers belonging to the same area have the same topological database for the area.
The databases for each area always process separately and calculate the link-state shortest path separately for each area and the topological database. The shortest path is flooded throughout the respected area only. The area database build of router links advertisements, network links advertisements, and summary link advertisements included external routes in all non-stub area databases.
Summary of Link-State Process
Every router in an OSPF area will complete the following link-state process to exchange a state of convergence:
Each router learns about its own directly connected networks and Links by detecting the interfaces in the upstate.
All routers are responsible for “saying hello” to their neighbors on directly connected networks.
Each router builds a Link-State Packet (LSP) containing the state of each directly connected link—the LSP contains neighbor, neighbor ID, link type, and link bandwidth.
Each router floods the LSP to all neighbors. Those neighbors store all LSPs received in a database. They then flood the LSPs to their neighbors until all area routers have received them LSPs. Each router stores a copy of each LSP received from its neighbors in a local database.
Each router floods the LSP to all neighbors, storing all LSPs received in a database.
All routers use the database to build a complete topology map and calculate the best path to each destination network using Dijkstra’s Algorithm.
Important Term of Link-State Protocol
Topological database – It is a set of information collected from LSAs.
SPF algorithm– The shortest path first (SPF) algorithm is a calculate the SPF tree on the bases of information in the database.
Routing tables – A list of the known paths and interfaces.
LSA – A link-state advertisement (LSA); is a small packet of routing information that is sent among routers. It is a basic communication way of the OSPF routing protocol for the Internet Protocol (IP). It communicates the router’s local routing topology to all other local routers in the same OSPF area.
LSP – It is a packet containing information generated by a network router in a link-state routing protocol that lists the router’s neighbours. It is a special datagram determining the names of routers including the cost or distance to any neighbouring routers and linked local networks. It can also determine the new neighbour In case of link failure.
The shortest path first protocol, or Link-state routing protocol, uses Edsger Dijkstra’s shortest path first (SPF) algorithm. Open Shortest Path First (OSPF) and Intermediate System-to-Intermediate System (IS-IS) are commonly used link-state routing protocols. Link-state routing protocols are more complex than the distance vector routing protocol. However, their basic functionality and configuration are just a sample. We can configure the basic Open Shortest Path First (OSPF) routing protocol using the following command.
Router(config)#router ospf <process-id>
Router(config-router)#network <network ID>
Dijkstra’s Algorithm
Dijkstra’s algorithm was published in 1959, and the creator’s name was Edsger Dijkstra, so it was named after its creator. OSPF(Open Shortest Path First) and IS-IS (Intermediate System-to-Intermediate System )protocols use Dijkstra’s algorithm to calculate the best path for a source to destination. Dijkstra’s algorithm is usually called the shortest path first (SPF) algorithm. The algorithm uses the addition of cost beside each path, from source to destination, to determine the total cost of a route. The route with the lowest price is considered the best route, and the route with the highest cost is regarded as the worst.
Shortest Path First Protocol (SPF) Example
The link between each router is labelled in the figure below with a cost value. There are three paths from R1 LAN to R6 LAN and vice versa. The figure shows that the lowest cost is 37, so this is the shortest path for sending data between LAN R1 and LAN R6. Each router containing the SPF (Shortest path first) Algorithm determines its own cost to each destination in the topology.
If you notice that path 2 has the least hop count, but the shortest path is path 3; the cost to reach R2 to R5 is 20 and higher than the cost from R2 to R5 through R4, which is 11.
IPv6 Routing Information Protocol (RIP), also known as RIPng (RIP Next Generation), supports IPv6 addresses. It is a Distance Vector routing protocol that uses a hop count as a routing metric. After enabling IPv6 RIP, we also need to configure the advertisement of IPv6 RIP routes. We can display IPv6 RIP settings to verify the configuration of RIPng.
It is helpful as a foundation for understanding basic network routing. Now, examine the reference topology in the figure. In this topology, all routers’ basic configurations have been completed, and all router interfaces have been configured and enabled. However, there are no dynamic routing and static routes configured on the routers, so remote network access is currently not possible.
The IPv6 unicast routing must be configured on all routers before configuring an IPv6 route to forward IPv6 packets. In the RIPv2, we enable RIP on the router configuration mode only, but RIPng is needed to allow for on each interface of the router on interface mode. There is no <network network-address> command available in RIPng.
Configuration
So, let’s come to the above topology configuration. As I said earlier, all basic configuration and IP address configuration on router interfaces has been done, so we only now require the configuration of RIP next-generation on all interfaces:
Router0
Router1
Enable IPv6 unicast-routing on Router2, Router3, Router4, and Router5 and configure all RIPng interfaces using command <IPv6 rip fschubRIPng enable> command.
Propagate Default IPv6 Route
The default IPv6 static route propagating process in RIPng is equal to RIPv2, except that an IPv6 default static route must be specific. The command for propagating a default static IPv6 route is the following:
The IPv6 route is the global configuration mode command, and the IPv6 rip is the interface mode command.
Verifying the RIPng Configuration
We can verify and examine the configuration using the show ipv6 protocol command, but the amount of information, as it is for its IPv4 counterpart, is not the same. However, we can confirm the following parameters using the command:
RIPng is configured on the router and also running.
The interfaces where RIPng is enabled.
We can also use the show ipv6 route command to display the routing table information, as shown in Figure. The output can confirm the IPv6 routes installed in the routing table.
Examine the routing table to see the hop count from Router0 to Router2. Notice that Router0 has two hops for the Router2 network if we configure RIPv1 or RIPv2 for the same Router2. The hop count will be one. This is because the IPv4 routing count of the next-hop router is the first hop, but the RIPng count of the sending router is the first hop.
We can advertise a default route using RIP. Route propagation is useful when there is a single exit point in the network to reach the Internet or any other service. The default-information originate command in the router configuration mode allows default static route advertisement, so we need to configure the router with the default-information originate command.
Refer to Figure 1. In this topology, Router0 is a single way to the webserver. So, all that is required for Router0 to reach the web server is a default static route going out of the FastEthernet 0/1 interface. Similar default static routes are also needed on Router1 and Router2, so it is much easier to configure a static default route on the edge router (Router0 in this topology). Then, Router0 propagate it to all other routers using RIP. To provide web connectivity to all other networks in the RIP routing domain, the default static route also needs to be advertised to all other routers that use the dynamic routing protocol. To propagate a default route, the Router0 must be configured with:
The default-information originate command propagates the static default route in RIP updates. Router0 now has a Gateway of Last Resort and default route installed in its routing table. Now configure a RIP (Routing Information Protocol) on Router1 and Router2 to propagate the default static route to Router1 and Router2. We can verify the default static route on the routing table of Router1 and Router2 using the show ip route command. If we check the routing table of Router1 and Router2, it will display a default static route and the gateway of last resort, but when we check the show startup-config, there will be no default route configured in the startup configuration file.
By default, Routing Information Protocol (RIP) sends its routing table updates on all interfaces on which Routing Information Protocol (RIP) is enabled every 30 seconds. However, RIP updates must only be sent to interfaces connecting to other RIP-enabled routers. This required us to stop sending an update on interfaces where not needed. The passive-interface can stop sending updates where not needed. Sending out un-needed updates on all interfaces affects the network in the following ways:
Security Risk—Advertising routing table updates in the form of broadcasting is a security risk. Anyone can intercept the routing table updates using packet sniffing tools and software. So, the attacker can use routing table updates to corrupt the routing table with false metrics and route the traffic to the wrong path.
Wasted Resources–All network devices received the routing table update, and they processed the update, which wasted the network devices’ resources.
Wasted Bandwidth—An unnecessary update is broadcast to each device on the network, consuming the link’s bandwidth and causing bandwidth waste.
To overcome all the above-mentioned problems, we can use the passive-interface command. The passive interface prevents the transmission of routing updates through a router-specific interface. The command stops broadcasting routing table updates to the specified interface where they are not needed.
Configurations of Passive-interfaces and verify the interface
Referring to the reference topology, there is no need for Router0 to forward RIP updates to the LAN interface. However, Router0 is sending RIP updates to all computers on the LAN. We can verify this by enabling a debug on Router0 using the <debug ip rip> command in privileged exec mode. We can verify the interface passive configuration using the show ip protocol command.
So, we need to configure the fast Ethernet 0/0 interface connected to the LAN as a passive interface. The process to configure the passive-interface is as follows:
We can also configure the passive-interface for all dynamic protocols. If we want to cancel the passive-interface configuration from any interface, we can use no passive-interface <interface-Id> command. We can also use the passive-interface default command to configure all interfaces as passive.
Routing Information Protocol (RIP) is a dynamic routing protocol that defines a way for routers to connect different networks using the Internet Protocol (IP) to share information about how to route traffic among these other networks.
The routing information protocol (RIP) uses hop count as a routing metric to find the best path between the source and the destination network. Hop count is the number of routers along the path between the source and destination network. The path with the lowest hop count between the source and destination is considered the best and, therefore, placed in the routing table.
RIP exchange routing updates periodically in a broadcast every 30 seconds. It broadcasts the entire routing table to its closest neighbours’ routers each time. The neighbours are the routers that are connected directly to this router.
The neighbours will pass the information on to their nearest neighbours, and so on. The routers always trust routing information received from neighbour routers. This is also known as routing on rumours. There are three versions of the routing information protocol: RIP Version 1, RIP Version 2, and RIPng.
In case of a router crash or a network connection disruption, the network discovers this because that router will not send an update to its neighbours. If the discontinued route remains for 180 seconds, the RIP router will drop that route.
RIP also prevents routing loops by limiting the hops allowed in a path from source to destination. The maximum hop count allowed for RIP is 15, and a hop count 16 is considered network unreachable.
RIP is a distance-vector routing protocol with an AD value of 120. It works on the application layer of the OSI model. RIP uses port number 520.
The RIP cannot scale extensive and complex networks. It pushes its whole routing table every 30 seconds, so it cannot converge quickly. RIP is used only due to its simplicity. RIP is primarily not used in modern networking; it is only the foundation for networking students to understand routing.
RIP Configuration
This article explains how to configure the RIP Routing protocol in detail. RIP is a Distance Vector routing protocol. Learn how to enable router RIP configuration mode and configure Routing Information Protocol routing in a Cisco router with the example in packet tracer.
Routing Information Protocol Configuration Mode
The figure above shows the reference topology, including its IP addresses. In the topology, all routers are configured with basic management features, and all interfaces are configured and enabled.
No dynamic and static routes are configured; therefore, we cannot access the routers remotely. We can enable RIP protocol using the router rip command, as shown below.
Router0(config)#router rip
Router0(config-router)#
The command provides access to the router configuration mode where the RIP routing settings are configured.
To eliminate and remove the RIP configuration, use the no router rip command in global configuration mode. This command immediately stops the RIP process and erases all existing RIP configurations. To display and check the router mode command, execute the question mark(?) command in router mode, as shown in the figure below.
Advertising Networks
After entering the RIP router configuration mode, it needs to know which local interfaces should use to communicate with other routers, as well as which locally connected networks it should advertise to those routers. To configure a RIP routing for a network, use the following command:
Router0(config-router)#network <netwowrk address>
Enter the classful network address for each directly connected network in the network address. This command enables Routing Information Protocol on all interfaces that belong to a specific network, and the associated interfaces now can also send and receive RIP updates.
The router can advertise the particular network in RIP routing updates sent to other routers every 30 seconds. If we enter the subnet in the network address parameter, the router IOS automatically converts the classless network address to a classful network address. Because RIPv1 is a classful routing protocol for IPv4.
For example, if we enter the network address 192.168.1.32, the IOS would automatically convert the 192.168.1.0 in the running configuration file without displaying any error message but instead correct the input and enter the classful network address. Following is the route advertisement configuration of this topology
Router0 Route Advertisement
Router1 Route Advertisement
Router1 has five networks to advertise after configuring IP addresses to the router interface. The following is the procedure to promote its network.
The remaining routers in the topology have one route each to advertise in this topology. We can advertise routes in the same way. The complete configuration can be viewed in the video.
Examining Default RIP Settings
To examine and show the default RIP setting, use the show ip protocols command in privileged exec mode. The figure below illustrates the output of this command on Router0 of the reference topology:
The command should display the IPv4 routing protocol settings currently configured on the router. The parameters displayed in the Figure above include the following:
The configured routing protocol is RIP.
The timer values, for example, the next routing update, are sent by R1 in 21 seconds. Invalid after 180 seconds, hold down timing and flush timing.
The version of RIP currently configured
Current route summarization state
Current paths and routing for the network.
The routing information source, including administrative distance value, is currently configured.
This command is also helpful to verify other routing protocols and their operation.
The other command that shows and verifies the routing protocol is the show ip route command. The command should display the Routing Information Protocol routing table. We can also verify the Routing Information Protocol configuration from show startup-config and show running-config
Enabling RIPv2
When a Routing Information Protocol is configured on a Cisco router, by default it is running RIPv1, which is displayed in the output of the show ip protocol command. However, the router can only send RIPv1 messages; we can read both RIPv1 and RIPv2 messages. A RIPv1 router ignores the RIPv2 fields in the route entry. We can enable RIPv2 using the version 2 command in router configuration mode, as shown below.
Router0(config-router)version 2
Now you can verify the version configuration using the show ip protocol command. The Routing Information Protocol process also includes the subnet mask in all updates, making RIPv2 a classless routing protocol. We can again switch to the version using the below command:
Router0(config-router)#no version 2
This command returns the router to the default setting of sending version 1 updates but listening for version 1 or version 2 updates.
Disabling Auto-Summarization
RIPv2 automatically summarizes networks at major network boundaries by default, Just like RIPv1, so we can modify the default RIPv2 behaviour using the following command:
Router0(config-router)#no auto-summary
This command modifies the default RIPv2 behaviour of automatic summarization. In the case of using RIPv1, the command does not affect. After executing this command, route summarization to their classful address should be disabled at boundary routers.
RIPv2 now includes all subnets with their masks in its routing updates. The show ip protocols display and state that automatic network summarization is ineffective. It is essential to enable RIPv2 before automatic summarization is disabled.
With fixed-length subnet masking (FLSM), a similar number of addresses is allocated for each subnet. It is a sequence of numbers of unchanging length that streamlines packet routing within the subnets of a proprietary network. If all the subnetworks have similar requirements for the number of hosts, these fixed-size address blocks would be enough.
But that is most frequently not the case. Fixed-length subnet masking (FLSM) is also referred to as conventional subnetting. The traditional subnetting method wastes IP addresses because the same number of addresses is allocated to each subnetwork even though the requirements are not similar.
The topology shown in Figure 1 above requires 5 subnets, one for the four LANs and one for WAN connection between routers. Using traditional subnetting with the address of 130.10.0.0/23, we can borrow a bit from the third octet and 2 bits from the last octet of the host portion to meet the subnet need of 5 subnets.
Though traditional subnetting meets the requirements of the largest LAN and divides the address space into enough subnets, it results in the major waste of unused addresses.
For example, only two addresses are required for a WAN subnet. However, each subnet has 62 usable addresses, and 60 unused addresses are available in these subnets. This also limits the network’s growth by reducing the total number of subnets available.
This incompetent use of addresses is a feature of traditional subnetting. Traditional subnetting schemes in this scenario are not professional and are full of waste. To avoid a waste of IP address subnetting a subnet, or using a Variable Length Subnet Mask (VLSM), was designed. Figure 3 shows the pie chart for the above fixed-length subnet masking (FLSM) table.
Applying a traditional subnetting scheme to this scenario is inefficient and wasteful. This example is a good model for showing how to use subnetting a subnet to maximize address utilization. Subnetting a subnet, or using a variable-length subnet mask (VLSM), to avoid wasting addresses.
The IETF introduced RFC 1517 in 1993, introducing classless inter-domain routing (CIDR). The CIDR replaced the old classful network assignments. The classful address has now become obsolete due to the CIDR scheme.
The CIDR network address is determined by the subnet mask instead of the value of the address’s first octet. The network and host portions of the IP address are also determined by the subnet mask, which is called the network prefix. The network prefix is also known as prefix lengths such as /16, /17, /25, and /30.
The ISPs are no longer bound only to the 8/16 or /24 subnet mask. They can now assign IP addresses more efficiently using any prefix length. Now, the ISPs can assign IP address blocks according to the customers’ requirements, from a few hosts to hundreds or thousands of hosts. The CIDR also reduces routing table size and manages the IPv4 address space more efficiently using Route summarization and supernetting.
Route Summarization and Supernetting
Route summarizations, also known as prefix aggregation, combine multiple routes into a single route to reduce the size of routing tables. For example, one summary static route can change several specific static route statements.
The figure below illustrates the route summarization. Router1 has 5 different routes. Each network has a different IP address network. All networks can be summarized into a single network to Router0.
The 172.16.0.0/21 summarized or aggregated route includes all the networks belonging to Router2, Router3, Router4, and Router5. To summarize this type of route, suppernetting is required. A supernet summarizes multiple network addresses with a smaller mask than the classful mask.
Supernetting is required when the route summarization mask is less than the default traditional classful mask. The supernet is always a route summary, but a route summary is not always a supernet. The procedure to determine a summary route is the following:
Convert all network addresses into binary format.
Count the number of far-left matching bits to identify the summarised route’s prefix length or subnet mask.
Copy the matching bits and add zero to the remaining places to determine the summarized network address.
This address and subnet mask can now be used as a summary route for all the networks. We can configure Summary routes for both static routes and classless routing protocols. The figure below illustrates the summary routing procedure:
Static Routing CIDR Example
The smaller routing tables make the routing table lookup process easy, fast, and efficient because there are fewer routes to search. So, if we use a single static route instead of multiple static routes, the size of the routing table is reduced.
A single static route can efficiently represent dozens, hundreds, or even thousands of routes. It is possible to configure a summary static route using CIDR.
In the Figure below, Router0 has been configured to reach the identified networks in the topology. Though acceptable, configuring a summary static route would be more efficient.
Figure 2 shows route aggregation using CIDR summarization. The four static route entries were reduced to 172.16.0.0/21 entries. The example below removes the six static route entries and replaces them with a static route summary.
Classless Routing Protocol Example
In the classful routing protocols, the receiving router automatically applies the default subnet mask to the network address in the routing table. If the topology in the figure contained a classful routing protocol, then Router0 would only install 172.16.0.0/16 in the routing table.
Variable Length Subnet Mask(VLSM) and supernet routes needed classless routing protocols such as RIPv2, OSPF and EIGRP. Classless routing protocols advertise network addresses with their associated subnet masks. When a supernet route is in a routing table, such as a static route, a classful routing protocol does not include that route in its updates.