OSPF Route Advertisement Nature

Hi,

OSPF being a link state routing protocol prepares Link State Database. I would like to understand, if OSPF advertises and redistributes routes from its Link State Database table or from its Routing Table.

IMO, its Link State Database table, pls comment.

Thanx

«1

Comments

  • Hi,

    It is from the LSDB. Inside an area all the routers must have the same topological view, so LSAs are exchanged and all the routers have the same perspective of the network. 

    HTH

    Good luck!

  • Within the ospf flooding domain or an area ospf process exchanges LSA's (LSA type1, LSA type 2) and based on that all the ospf running routers maintain the same copy of the LSDB. Now it is upto the individual router which runs independent spf calculation for selecting the best route to reach a perticular destination.

    But when ospf process needs to send an LSA (type 3,4) outside its own area it behaves like a distance vector becuase the other area routers when receives a summary LSA (type3,4) they believe on the ABR which sends those LSA into the area so these routers just need to run spf to determine cost to reach to the ABR that means these routers adds up the cost (what ABR is advertising plus cost to reach to the ABR) to reach to the routes in the other area. So technically its wrong to say aospf is advetising routes because ospf just exchanges LSAs i.e within area type 1 and 2 while from other area type 3 and 4. 

    Now if you are considering redistribution of ospf process into some other IGP(RIP,EIGRP etc or other OSPF process), the redistribution will always performs from the ospf routing table i.e "show ip route ospf". In this by default "show ip route ospf" routes and "show ip ospf interface br" routes will be redistributed from ospf process to other IGP and these ospf routes will end up in the database of other IGP on the device on which redistribution is performed. The other IGP domain will then select the best path based on its best path selection procedures.

  • Hi.

    I tend to agree that routing protocol redistribution happens from the routing table and not the RIB.  When the redistribute ospf command is exectued, it instructs the router to redistribute all OSPF learned routes in the routing table.  In addition, the router will grab all connected interfaces that have an associated network statement.

     

  • Hi.

    I tend to agree that routing protocol redistribution happens from the routing table and not the RIB.  When the redistribute ospf command is exectued, it instructs the router to redistribute all OSPF learned routes in the routing table.  In addition, the router will grab all connected interfaces that have an associated network statement.

     

     

    Agreed! That's my understanding as well.

  • I tend to agree that routing protocol redistribution happens from the routing table and not the RIB.  When the redistribute ospf command is exectued, it instructs the router to redistribute all OSPF learned routes in the routing table.  In addition, the router will grab all connected interfaces that have an associated network statement.

    Thats true however just to add a point here, network statement under ospf process is not a good indication of router interfaces running ospf because there can be cases where ospf is running on interfaces by "ip ospf <process-id> area <area-id>" command. So the interfaces "show ip ospf int br" running ospf are redistributed into other protocol along with "show ip route ospf" routes. 

  • Suppose now the redistribution is from BGP in to OSPF, where the BGP redistributed prefixes will go first:

    LSDB table

    or

    Routing table

  • Hi.

    I think it's still from the routing table.  By default, when redistributing BGP into any other protocol, only the exteranl routes will be redistributed.  Now when we consider the AD of eBGP vs iBGP, under normal circumstances, only the eBGP routes will be installed in the routing table because all IGP administrave distance is beter than iBGP of 200. Even external EIGRP is beter than iBGP.  So when redistributing BGP into OSPF (which isn't a good idea in real life unless you are doing some serious filtering) the OSPF process should only see the eBGP routes in the routing table based on the default administrative distance values.  Of course, you can force BGP to release the internal routes with the bgp redistribute-internal command, but it should be used with caution.  I've only seen this command used with MPLS VPNs where BGP was used as the PE - CE protocol and the AS numbers were the same.

    Cheers.

  • Suppose now the redistribution is from BGP in to OSPF, where the BGP redistributed prefixes will go first:

    LSDB table

    or

    Routing table

    BGP routes will land up in the ospf database on the router which is performing the redistribution, and other ospf running routers in ospf domain will have in their database but they can run spf to install these routes in the routing table.

  • Thats true however just to add a point here, network statement under ospf process is not a good indication of router interfaces running ospf because there can be cases where ospf is running on interfaces by "ip ospf <process-id> area <area-id>" command. So the interfaces "show ip ospf int br" running ospf are redistributed into other protocol along with "show ip route ospf" routes. 

    The command "ip ospf <process-id> area <area-id>" is not supported on switches only on routers :-).  Although irelevant for this discussion.

  • If you want to see which interfaces are participating in OSPF look at either the show ip ospf interface or show ip ospf interface brief.  Whether you use the network statement or the interface level statement the result is the same.   Local interfaces that participate in an area will be advertised in the database via the Router LSA (LSA 1).  Redistributed routes will advertised as External LSAs (LSA 5).

     

    Brian McGahan, CCIE #8593 (R&S/SP/Security)

    [email protected]

     

    Internetwork Expert, Inc.

    http://www.INE.com

     

    From: [email protected] [mailto:[email protected]] On Behalf Of welshydragon
    Sent: Friday, February 17, 2012 1:55 PM
    To: Brian McGahan
    Subject: Re: [CCIE R&S] OSPF Route Advertisement Nature

     

    imagedcancerian:

    Thats true however just to add a point here, network statement under ospf process is not a good indication of router interfaces running ospf because there can be cases where ospf is running on interfaces by "ip ospf <process-id> area <area-id>" command. So the interfaces "show ip ospf int br" running ospf are redistributed into other protocol along with "show ip route ospf" routes. 

    The command "ip ospf <process-id> area <area-id>" is not supported on switches only on routers :-).  Although irelevant for this discussion.




    INE - The Industry Leader in CCIE Preparation
    http://www.INE.com

    Subscription information may be found at:
    http://www.ieoc.com/forums/ForumSubscriptions.aspx

  • Guys, 

    Just noticed another OSPF behaviour:

    While I am redistributing BGP in to OSPF its OSPF neighbor is seeing the route as O IA.

     

    I am doing this test on GNS, don't know if its GNS issue or ... (till now my GNS never misbehaved)

     


    R1(config-router)#do  sro

    router ospf 101 vrf VPN_A

     router-id 1.1.1.1

     log-adjacency-changes

     redistribute bgp 3 metric 5 metric-type 1 subnets

     


    R2(config-router)#do sh ip route ospf

         171.2.0.0/32 is subnetted, 1 subnets

    O IA    171.2.2.2 [110/15] via 10.10.10.1, 00:29:43, Ethernet0/2



    Is it correct behavious, shouldn't it be O E2.



  • It depends if you are running OSPF in same domain or not. Is the PE and CPE running OSPF with the same process-id?

    No sham-links?

  • Hi ashse,

    It looks like you are running same OSPF process-id on both sites, OSPF domain-id formation is based on OSPF process-id, if you have same OSPF process-id creates same domain and route-type will be O IA, if you run OSPF into different process-id creates different domain-id and routes will be external route.

    Verify OSPF domain-id using this command:

    show ip bgp vpnv4 rd x:x x.x.x.x

    and if you want to change OSPF domain-id  manually:

    R4(config-router)#router ospf 23 vrf xxxxx
    R4(config-router)#domain-id type 0005 value 000000170100

    Good Luck.

  • Suppose now the redistribution is from BGP in to OSPF, where the BGP redistributed prefixes will go first:

    LSDB table

    or

    Routing table

    It first goes to OSPF database(OSPF always builds the Link State Database before installing the route into routing table), you can see those prefixes as  external prefixes. Now if you are running EIGRP and OSPF on same router and both routing protocols getting same prefixes, EIGRP routes install into routing table because of lower AD but still routes exists into OSPF database.

  • Hi.

    I tend to agree that routing protocol redistribution happens from the routing table and not the RIB.  When the redistribute ospf command is exectued, it instructs the router to redistribute all OSPF learned routes in the routing table.  In addition, the router will grab all connected interfaces that have an associated network statement.

     

    You are right eborgard, neither EIGRP nor OSPF redistributes routes from topology table or Link State database, all redistribution is peformed from routing table advertised by particular routing protocol on routing table and connected interface running particular protocol:).

     

  • Guys,

     

    Correct me if i am wrong...

    When we are doing redistburation from e.g. EIGRP to OSPF ...all routes marked in routing table with "D" and "D EX " will be redistributed in OSPF (Will added in OSPF database).

    And connected interfaces that are running EIGRP are not redistributed in OSPF(Will not added in OSPF database).

     

    /Ganpat

     

  • Hi Ganpat,

    To make clear, I created simple topology and pasting the output for you:

    R1(EIGRP)-R2-OSPF-R3, I am doing mutual redistribution betwen EIGRP and OSPF on R2:

    R2#show ip ospf int brief
    Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
    Fa1/1        1     0               23.23.23.2/24      1     BDR   1/1
    R2#show ip eigrp interfaces
    EIGRP-IPv4 Interfaces for AS(100)
                            Xmit Queue   Mean   Pacing Time   Multicast    Pending
    Interface        Peers  Un/Reliable  SRTT   Un/Reliable   Flow Timer   Routes
    Fa1/0              1        0/0       257       0/1         1060           0
    Lo0                0        0/0         0       0/1            0           0

    R2#show ip int brief | ex un
    Interface                  IP-Address      OK? Method Status                Protocol
    FastEthernet1/0            12.12.12.2      YES manual up                    up 
    FastEthernet1/1            23.23.23.2      YES manual up                    up 
    Loopback0                  2.2.2.2         YES manual up                    up

    Now See the OSPF database:

    R2#show ip ospf database

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

                    Router Link States (Area 0)

    Link ID         ADV Router      Age         Seq#       Checksum Link count
    2.2.2.2         2.2.2.2         141         0x80000003 0x00F896 1
    3.3.3.3         3.3.3.3         218         0x80000002 0x006507 2

                    Net Link States (Area 0)

    Link ID         ADV Router      Age         Seq#       Checksum
    23.23.23.3      3.3.3.3         218         0x80000001 0x00B21F

                    Type-5 AS External Link States

    Link ID         ADV Router      Age         Seq#       Checksum Tag
    1.1.1.1         2.2.2.2         141         0x80000001 0x00BEE8 0
    2.2.2.2         2.2.2.2         141         0x80000001 0x009013 0
    12.12.12.0      2.2.2.2         141         0x80000001 0x003B4C 0

    Now looked on Bold marked routes, those are locally connected and advertised by EIGRP

    R2#show ip route eigrp


          1.0.0.0/32 is subnetted, 1 subnets
    D        1.1.1.1 [90/156160] via 12.12.12.1, 00:05:58, FastEthernet1/0

    So as soon as you redistribute EIGRP into OSPF, all routes advertised by EIGRP and locally configured for EIGRP will be added on OSPF database.

    Good Luck

  • It depends if you are running OSPF in same domain or not. Is the PE and CPE running OSPF with the same process-id?

    No sham-links?

     

  • Guys,

     

    Correct me if i am wrong...

    When we are doing redistburation from e.g. EIGRP to OSPF ...all routes marked in routing table with "D" and "D EX " will be redistributed in OSPF (Will added in OSPF database).

    And connected interfaces that are running EIGRP are not redistributed in OSPF(Will not added in OSPF database).

     

    /Ganpat

     

    Ganpat,

    In this case (redistribution of eigrp routes into ospf) - D, D EX and connected interfaces running EIGRP will be redistributed into OSPF. The connected routes are redistributed implictly, so if you have a redistribute connect statement with a route-map, you gotta watch yourself out, as some of the routes may not be redistributed as expected.

    HTH

    Good luck


  • I am running OSPF in two different domains (different process-ids). 

    There is no Sham-link.

  • I am running OSPF in two different domains (different process-ids). 

    Even running on different Domain-IDs getting O IA? Can you post the output of:

    show ip bgp vpnv4 rd x:x x.x.x.x

    and show ip ospf database summary x.x.x.x (where x is the route from other site)?

     

  • Thanks for your reply!!!

    That means EIGRP database is restributed in OSPF database.

    Not EIGRP routing table is resrtibuted in OSPF routing table.

    Please correct.

    R1#sh ip route
         23.0.0.0/24 is subnetted, 1 subnets
    D EX    23.23.23.0 [170/2560025856] via 12.12.12.2, 00:04:00, FastEthernet0/0
         12.0.0.0/24 is subnetted, 1 subnets
    C       12.12.12.0 is directly connected, FastEthernet0/0

    R2#sh ip route ospf

    R3#sh ip route
        23.0.0.0/24 is subnetted, 1 subnets
    C       23.23.23.0 is directly connected, FastEthernet0/0
         12.0.0.0/24 is subnetted, 1 subnets
    O E2    12.12.12.0 [110/20] via 23.23.23.2, 00:04:34, FastEthernet0/0

  • I am running OSPF in two different domains (different process-ids).

    Even here same basic rule of redistribution will follow. figure out which ospf routes are installed in the RT by which ospf process. 

    show ip route ofpf <process id>(ospf process specific routes) and show ip ospf <process id > int br (connected ospf process specific interfaces) both will be redistributed into other ospf process database on the border router.

  • Thanks for your reply!!!

    That means EIGRP database is restributed in OSPF database.

    Not EIGRP routing table is resrtibuted in OSPF routing table.

    Please correct.

    R1#sh ip route
         23.0.0.0/24 is subnetted, 1 subnets
    D EX    23.23.23.0 [170/2560025856] via 12.12.12.2, 00:04:00, FastEthernet0/0
         12.0.0.0/24 is subnetted, 1 subnets
    C       12.12.12.0 is directly connected, FastEthernet0/0

    R2#sh ip route ospf

    R3#sh ip route
        23.0.0.0/24 is subnetted, 1 subnets
    C       23.23.23.0 is directly connected, FastEthernet0/0
         12.0.0.0/24 is subnetted, 1 subnets
    O E2    12.12.12.0 [110/20] via 23.23.23.2, 00:04:34, FastEthernet0/0


  • Thanks for your reply!!!

    That means EIGRP database is restributed in OSPF database.

    Not EIGRP routing table is resrtibuted in OSPF routing table.

    Please correct.

    R1#sh ip route
         23.0.0.0/24 is subnetted, 1 subnets
    D EX    23.23.23.0 [170/2560025856] via 12.12.12.2, 00:04:00, FastEthernet0/0
         12.0.0.0/24 is subnetted, 1 subnets
    C       12.12.12.0 is directly connected, FastEthernet0/0

    R2#sh ip route ospf

    R3#sh ip route
        23.0.0.0/24 is subnetted, 1 subnets
    C       23.23.23.0 is directly connected, FastEthernet0/0
         12.0.0.0/24 is subnetted, 1 subnets
    O E2    12.12.12.0 [110/20] via 23.23.23.2, 00:04:34, FastEthernet0/0


  • That means EIGRP database is restributed in OSPF database.

    Not EIGRP routing table is resrtibuted in OSPF routing table.

    All Routes installed in routing table by EIGRP + All EIGRP enabled interfaces:)

  • Hi.

    I tend to agree that routing protocol redistribution happens from the routing table and not the RIB.  When the redistribute ospf command is exectued, it instructs the router to redistribute all OSPF learned routes in the routing table.  In addition, the router will grab all connected interfaces that have an associated network statement.

     

     

    Agreed! That's my understanding as well.

    I agree with the above.  I has always understood OSPF and the routing table as two separate entities.  OSPF exchanges routes and builds a topology, but it does not make the final decision of what gets put in the routing table.  OSPF offers it's routes to the routing table. 

    REDISTRIBUTION
    When you redistribute routing protocols into one another, the redistribution occurs within the protocol, with an associated metric that is assigned to those IP subnets.  The routing protocol then offers the redistributed IP subnets to the route table.  If the route table has a better metric for the same IP subnets you redistributed, those redistributed routes will not be excepted into the routing table.

    NETWORK COMMAND
    I've always understood that the network command does not "assign interfaces" per say, but identifies which IP subnets will participate in an OSPF area (a statement I read or heard a long time ago).  The anatomy of the network command (network x.x.x.x w.w.w.w area a.a.a.a) merely identifies the IP subnet (x) you want to have participate; followed by a wildard card mask (w - a reverse mask); which is assigned to an area (a).

    1)  when you use the network command, network 0.0.0.0 0.0.0.0 area 0.0.0.0, every interface on the router will participate in OSPF area 0 (the backbone area).
    2)  When you use the nework command, network 192.168.1.0 0.0.0.3 area 0.0.0.0, any interface participating in the 192.168.1.0/30 subnet will participate in OSPF area 0.

    There was a book a read in college that covers OSPF very well, "Routing
    in the Internet, by Christian Huitema", I highly recommend you reading
    it.  It really covers the basics of OSPF and routing tables very well.  There is website by the guy who co-authored the OSPF RFC that might help you understand more, routergod.com.  It's really cheesy, but like I said, the guy (J. Moy) co-authored the OSPF RFC 2328.

  • INE's CCIE R&S ATC covers route redistribution in a such good manner as well :)

Sign In or Register to comment.