Home > Articles > Cisco > CCNA Routing and Switching

Network Routing Protocols and Methods, Part 2

In the conclusion of this series, Sean Wilkins, co-author of CCNA Routing and Switching 200-120 Network Simulator, explains how to untangle the detailed network information provided by two popular network routing protocols.
Like this article? We recommend

Overview

This article takes the theory of how a dynamic routing protocol should work, bringing it into reality with two walkthroughs. The first walkthrough focuses on how Routing Information Protocol (RIP) works as a dynamic vector protocol. The second walkthrough shows how the Open Shortest Path First (OSPF) protocol works as a link-state protocol.

For these walkthroughs, we'll use the simple three-router topology shown in Figure 1.

Figure 1 Topology for the walkthroughs.

The following table shows the IP addresses assigned for this topology. This information is common to the walkthroughs for both RIP and OSPF.

Router

Interface

IP Address/Network

R1

Loopback0

10.0.0.1/24

GigabitEthernet0/1

192.168.1.1/24

R2

GigabitEthernet0/1

192.168.2.1/24

GigabitEthernet0/2

192.168.1.2/24

R3

GigabitEthernet0/2

192.168.2.2/24

Loopback0

20.0.0.1/24

RIP Walkthrough

Since RIP is a distance vector protocol, it learns about routes when its neighbors advertise a copy of their routing tables. After receiving the routing tables, RIP combines this information with its own interfaces to form its own routing table. This information for RIP is initially stored inside the RIP database that can be viewed on each respective device. Listing 1 shows an abbreviated version of this database for R1:

Listing 1—R1 RIP Database.

10.0.0.0/24    directly connected, Loopback0
20.0.0.0/24
    [2] via 192.168.1.2, 00:00:25, GigabitEthernet0/1
192.168.1.0/24    directly connected, GigabitEthernet0/1
192.168.2.0/24
    [1] via 192.168.1.2, 00:00:25, GigabitEthernet0/1

Here, R1 is showing that the 10.0.0.0/24 (Loopback0) and 192.168.1.0/24 (GigabitEthernet0/1) networks are directly connected, and two additional networks are located out the GigabitEthernet0/1 interface (toward R2). The routing table of R1 reflects this same information, as shown in Listing 2:

Listing 2—R1 Routing Table.

      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.0.0.0/24 is directly connected, Loopback0
L        10.0.0.1/32 is directly connected, Loopback0
      20.0.0.0/24 is subnetted, 1 subnets
R        20.0.0.0 [120/2] via 192.168.1.2, 00:00:17, GigabitEthernet0/1
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, GigabitEthernet0/1
L        192.168.1.1/32 is directly connected, GigabitEthernet0/1
R     192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:17, GigabitEthernet0/1

Keep in mind that neither of these tables tells you about the devices connected to the 192.168.2.0/24 or 20.0.0.0/24 networks. The same details are shown on R2 and R3 when viewing their RIP databases and routing tables in Listings 3–6.

Listing 3—R2 RIP Database.

10.0.0.0/24
    [1] via 192.168.1.1, 00:00:21, GigabitEthernet0/2
20.0.0.0/24
    [1] via 192.168.2.2, 00:00:22, GigabitEthernet0/1
192.168.1.0/24    directly connected, GigabitEthernet0/2
192.168.2.0/24    directly connected, GigabitEthernet0/1

Listing 4—R2 Routing Table.

      10.0.0.0/24 is subnetted, 1 subnets
R        10.0.0.0 [120/1] via 192.168.1.1, 00:00:09, GigabitEthernet0/2
      20.0.0.0/24 is subnetted, 1 subnets
R        20.0.0.0 [120/1] via 192.168.2.2, 00:00:11, GigabitEthernet0/1
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, GigabitEthernet0/2
L        192.168.1.2/32 is directly connected, GigabitEthernet0/2
      192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.2.0/24 is directly connected, GigabitEthernet0/1
L        192.168.2.1/32 is directly connected, GigabitEthernet0/1

For R2, the only networks that are not directly connected are the Loopback0 interfaces of R1 and R3.

Listing 5—R3 RIP Database.

10.0.0.0/24
    [2] via 192.168.2.1, 00:00:23, GigabitEthernet0/2
20.0.0.0/24    directly connected, Loopback0
192.168.1.0/24
    [1] via 192.168.2.1, 00:00:23, GigabitEthernet0/2
192.168.2.0/24    directly connected, GigabitEthernet0/2

Listing 6—R3 Routing Table.

      10.0.0.0/24 is subnetted, 1 subnets
R        10.0.0.0 [120/2] via 192.168.2.1, 00:00:10, GigabitEthernet0/2
      20.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        20.0.0.0/24 is directly connected, Loopback0
L        20.0.0.1/32 is directly connected, Loopback0
R     192.168.1.0/24 [120/1] via 192.168.2.1, 00:00:10, GigabitEthernet0/2
      192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.2.0/24 is directly connected, GigabitEthernet0/2
L        192.168.2.2/32 is directly connected, GigabitEthernet0/2

The R3 tables look like a mirror version of R1, with the R1 Loopback0 interface and the link between R1 and R2 being advertised by RIP. R3 is not aware of which device(s) are connected to these other networks—only that they can be located out its GigabitEthernet0/2 interface.

OSPF Walkthrough

Unlike RIP, which is a distance vector protocol, , OSPF is a link-state protocol. OSPF makes its routing decisions based on a database that provides a picture of which networks are located off of every router in the same link-state domain. As with RIP, this information is stored initially in a local OSPF database, which is used to determine the best path for each specific destination, based on Dijkstra's shortest path first (SPF) algorithm.

The first part of the OSPF database we'll examine is the overview. Listing 7 shows a high-level view of the entries in the database; it doesn't show the specific advertised networks.

Listing 7—OSPF Database Overview.

            OSPF Router with ID (1.1.1.1) (Process ID 10)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         95          0x80000002 0x0076C0 2
2.2.2.2         2.2.2.2         96          0x80000003 0x00025C 2
3.3.3.3         3.3.3.3         102         0x80000002 0x0076A2 2

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.1.2     2.2.2.2         96          0x80000001 0x0009B0
192.168.2.2     3.3.3.3         102         0x80000001 0x003478

Listing 7 shows that three different OSPF routers are in the network, advertised as router link states using the router-ID (RID): 1.1.1.1 (R1), 2.2.2.2 (R2), and 3.3.3.3 (R3). The entry also shows two network link entries that advertise two transit networks. Transit networks are links where multiple OSPF devices exist; in this case, the link between R1 and R2 and the link between R2 and R3 are transit networks.

Listing 8 shows the router link-state entry for R1:

Listing 8—R1 Router Link-State Entry.

          OSPF Router with ID (1.1.1.1) (Process ID 10)

              Router Link States (Area 0)

LS age: 165
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 1.1.1.1
Advertising Router: 1.1.1.1
LS Seq Number: 80000002
Checksum: 0x76C0
Length: 48
Number of Links: 2

  Link connected to: a Stub Network
   (Link ID) Network/subnet number: 10.0.0.0
   (Link Data) Network Mask: 255.255.255.0
    Number of MTID metrics: 0
     TOS 0 Metrics: 1

  Link connected to: a Transit Network
   (Link ID) Designated Router address: 192.168.1.2
   (Link Data) Router Interface address: 192.168.1.1
    Number of MTID metrics: 0
     TOS 0 Metrics: 1

This entry contains some useful information. It shows that R1 is connected to a stub network (not a link with another OSPF router), which is connected to the 10.0.0.0/24 network. It's also connected to a transit network. The information for the network connected to this transit network is shown in a separate linked network link-state entry shown in Listing 9 (To find the correct link, look at the advertising router and link ID.)

Listing 9—R1 Linked Network Entry.

LS age: 248
Options: (No TOS-capability, DC)
LS Type: Network Links
Link State ID: 192.168.1.2 (address of Designated Router)
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0x9B0
Length: 32
Network Mask: /24
      Attached Router: 2.2.2.2
      Attached Router: 1.1.1.1

This entry shows that R1 is connected to a transit network that's connected to the 192.168.1.0/24 network.

Now take a look at the R2 router link entry in Listing 10:

Listing 10—R2 Router Link Entry.

          OSPF Router with ID (1.1.1.1) (Process ID 10)

              Router Link States (Area 0)

LS age: 482
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 2.2.2.2
Advertising Router: 2.2.2.2
LS Seq Number: 80000003
Checksum: 0x25C
Length: 48
Number of Links: 2

  Link connected to: a Transit Network
   (Link ID) Designated Router address: 192.168.1.2
   (Link Data) Router Interface address: 192.168.1.2
    Number of MTID metrics: 0
     TOS 0 Metrics: 1

  Link connected to: a Transit Network
   (Link ID) Designated Router address: 192.168.2.2
   (Link Data) Router Interface address: 192.168.2.1
    Number of MTID metrics: 0
     TOS 0 Metrics: 1

This entry shows that R2 is connected to two different transit networks. As with the R1 entry, these transit networks can be linked to their respective entries, as shown in Listing 11:

Listing 11—R2 Linked Network Entries.

          OSPF Router with ID (2.2.2.2) (Process ID 10)

              Net Link States (Area 0)

Routing Bit Set on this LSA in topology Base with MTID 0
LS age: 551
Options: (No TOS-capability, DC)
LS Type: Network Links
Link State ID: 192.168.1.2 (address of Designated Router)
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0x9B0
Length: 32
Network Mask: /24
      Attached Router: 2.2.2.2
      Attached Router: 1.1.1.1

Routing Bit Set on this LSA in topology Base with MTID 0
LS age: 558
Options: (No TOS-capability, DC)
LS Type: Network Links
Link State ID: 192.168.2.2 (address of Designated Router)
Advertising Router: 3.3.3.3
LS Seq Number: 80000001
Checksum: 0x3478
Length: 32
Network Mask: /24
      Attached Router: 3.3.3.3
      Attached Router: 2.2.2.2

These entries show that the two R2 connected transit networks are connected to the 192.168.1.0/24 and 192.168.2.0/24 networks, respectively.

Finally, let's take a look at the R3 router link entry in Listing 12:

Listing 12—R3 Router Link Entry.

          OSPF Router with ID (1.1.1.1) (Process ID 10)

              Router Link States (Area 0)

LS age: 720
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 1.1.1.1
Advertising Router: 1.1.1.1
LS Seq Number: 80000002
Checksum: 0x76C0
Length: 48
Number of Links: 2

  Link connected to: a Stub Network
   (Link ID) Network/subnet number: 10.0.0.0
   (Link Data) Network Mask: 255.255.255.0
    Number of MTID metrics: 0
     TOS 0 Metrics: 1

  Link connected to: a Transit Network
   (Link ID) Designated Router address: 192.168.1.2
   (Link Data) Router Interface address: 192.168.1.1
    Number of MTID metrics: 0
     TOS 0 Metrics: 1

Like the R1 router entry, this entry shows that R3 is connected to a stub network and a transit network. The stub network connects to the 20.0.0.0/24 network, and the transit entry can be linked to the entry shown in Listing 13:

Listing 13—R3 Linked Network Entry.

Routing Bit Set on this LSA in topology Base with MTID 0
LS age: 779
Options: (No TOS-capability, DC)
LS Type: Network Links
Link State ID: 192.168.2.2 (address of Designated Router)
Advertising Router: 3.3.3.3
LS Seq Number: 80000001
Checksum: 0x3478
Length: 32
Network Mask: /24
      Attached Router: 3.3.3.3
      Attached Router: 2.2.2.2

This entry shows that R3 is connected to a transit network that is connected to the 192.168.2.0/24 network.

When you combine all of this information, you get a view of how the network is seen by OSPF. The protocol is able to get a complete list of all the networks that are inside the OSPF domain and make forwarding decisions based on this full view. (This view can be restricted as well, with other features not discussed in this article.)

Obviously, walking through the OSPF database is quite a bit more confusing then walking through the RIP database. The way that OSPF organizes information is intended to be efficient for the protocol—not necessarily for the viewing engineer. Although this article picks out the specific linked entries that match with the specific devices in the network, it's important to remember that all of these entries exist in the OSPF database of all routers in the OSPF domain (by default). Differentiating which entry links with which router is a matter of tracing the RIDs and networks, which is well outside the scope of this article.

To bring the OSPF portion of this article together, let's look at the routing tables of the routers in Listings 14–16, to see how this information contained within their databases is translated once OSPF has a chance to calculate the best routes to insert.

Listing 14—R1 Routing Table.

      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.0.0.0/24 is directly connected, Loopback0
L        10.0.0.1/32 is directly connected, Loopback0
      20.0.0.0/24 is subnetted, 1 subnets
O        20.0.0.0 [110/3] via 192.168.1.2, 01:04:32, GigabitEthernet0/1
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, GigabitEthernet0/1
L        192.168.1.1/32 is directly connected, GigabitEthernet0/1
O     192.168.2.0/24 [110/2] via 192.168.1.2, 01:08:50, GigabitEthernet0/1

Listing 15—R2 Routing Table.

      10.0.0.0/24 is subnetted, 1 subnets
O        10.0.0.0 [110/2] via 192.168.1.1, 01:04:07, GigabitEthernet0/2
      20.0.0.0/24 is subnetted, 1 subnets
O        20.0.0.0 [110/2] via 192.168.2.2, 01:04:07, GigabitEthernet0/1
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, GigabitEthernet0/2
L        192.168.1.2/32 is directly connected, GigabitEthernet0/2
      192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.2.0/24 is directly connected, GigabitEthernet0/1
L        192.168.2.1/32 is directly connected, GigabitEthernet0/1

Listing 16—R3 Routing Table.

      10.0.0.0/24 is subnetted, 1 subnets
O        10.0.0.0 [110/3] via 192.168.2.1, 01:04:39, GigabitEthernet0/2
      20.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        20.0.0.0/24 is directly connected, Loopback0
L        20.0.0.1/32 is directly connected, Loopback0
O     192.168.1.0/24 [110/2] via 192.168.2.1, 01:09:23, GigabitEthernet0/2
      192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.2.0/24 is directly connected, GigabitEthernet0/2
L        192.168.2.2/32 is directly connected, GigabitEthernet0/2

Summary

While this article (especially the OSPF portion) could be a bit confusing, you must remember that this is how the databases look in a very simple network. Imagine what they look like in a larger network! Keep in mind that many network engineers don't completely understand the contents of these tables; they're able to get through their work by using this information combined with network documentation and other observed configuration on the devices.

In reading through this article (possibly multiple times), you should get an idea of how distance vector and link-state protocols differ in their view of the network and how they make their decisions.

vceplus-200-125    | boson-200-125    | training-cissp    | actualtests-cissp    | techexams-cissp    | gratisexams-300-075    | pearsonitcertification-210-260    | examsboost-210-260    | examsforall-210-260    | dumps4free-210-260    | reddit-210-260    | cisexams-352-001    | itexamfox-352-001    | passguaranteed-352-001    | passeasily-352-001    | freeccnastudyguide-200-120    | gocertify-200-120    | passcerty-200-120    | certifyguide-70-980    | dumpscollection-70-980    | examcollection-70-534    | cbtnuggets-210-065    | examfiles-400-051    | passitdump-400-051    | pearsonitcertification-70-462    | anderseide-70-347    | thomas-70-533    | research-1V0-605    | topix-102-400    | certdepot-EX200    | pearsonit-640-916    | itproguru-70-533    | reddit-100-105    | channel9-70-346    | anderseide-70-346    | theiia-IIA-CIA-PART3    | certificationHP-hp0-s41    | pearsonitcertification-640-916    | anderMicrosoft-70-534    | cathMicrosoft-70-462    | examcollection-cca-500    | techexams-gcih    | mslearn-70-346    | measureup-70-486    | pass4sure-hp0-s41    | iiba-640-916    | itsecurity-sscp    | cbtnuggets-300-320    | blogged-70-486    | pass4sure-IIA-CIA-PART1    | cbtnuggets-100-101    | developerhandbook-70-486    | lpicisco-101    | mylearn-1V0-605    | tomsitpro-cism    | gnosis-101    | channel9Mic-70-534    | ipass-IIA-CIA-PART1    | forcerts-70-417    | tests-sy0-401    | ipasstheciaexam-IIA-CIA-PART3    | mostcisco-300-135    | buildazure-70-533    | cloudera-cca-500    | pdf4cert-2v0-621    | f5cisco-101    | gocertify-1z0-062    | quora-640-916    | micrcosoft-70-480    | brain2pass-70-417    | examcompass-sy0-401    | global-EX200    | iassc-ICGB    | vceplus-300-115    | quizlet-810-403    | cbtnuggets-70-697    | educationOracle-1Z0-434    | channel9-70-534    | officialcerts-400-051    | examsboost-IIA-CIA-PART1    | networktut-300-135    | teststarter-300-206    | pluralsight-70-486    | coding-70-486    | freeccna-100-101    | digitaltut-300-101    | iiba-CBAP    | virtuallymikebrown-640-916    | isaca-cism    | whizlabs-pmp    | techexams-70-980    | ciscopress-300-115    | techtarget-cism    | pearsonitcertification-300-070    | testking-2v0-621    | isacaNew-cism    | simplilearn-pmi-rmp    | simplilearn-pmp    | educationOracle-1z0-809    | education-1z0-809    | teachertube-1Z0-434    | villanovau-CBAP    | quora-300-206    | certifyguide-300-208    | cbtnuggets-100-105    | flydumps-70-417    | gratisexams-1V0-605    | ituonline-1z0-062    | techexams-cas-002    | simplilearn-70-534    | pluralsight-70-697    | theiia-IIA-CIA-PART1    | itexamtips-400-051    | pearsonitcertification-EX200    | pluralsight-70-480    | learn-hp0-s42    | giac-gpen    | mindhub-102-400    | coursesmsu-CBAP    | examsforall-2v0-621    | developerhandbook-70-487    | root-EX200    | coderanch-1z0-809    | getfreedumps-1z0-062    | comptia-cas-002    | quora-1z0-809    | boson-300-135    | killtest-2v0-621    | learncia-IIA-CIA-PART3    | computer-gcih    | universitycloudera-cca-500    | itexamrun-70-410    | certificationHPv2-hp0-s41    | certskills-100-105    | skipitnow-70-417    | gocertify-sy0-401    | prep4sure-70-417    | simplilearn-cisa    |
http://www.pmsas.pr.gov.br/wp-content/    | http://www.pmsas.pr.gov.br/wp-content/    |