I will start with a scenario. Please excuse me if its a low-level question. Lets say there are 2 AS, AS 100 and AS 200. *In AS 100 there are 3 routers R1,R2 and R3 running OSPF and RB1 and RB2 running BGP where RB1 is connected to another BGP router RB3 in AS 200.

*AS 200 has routers R5,R6 and R7 running ospf and RB3 and RB4 running BGP. RB3 is coonected to RB1 of As 100 and RB4 is connected to some other AS.

1)From my understanding, r1,r2 and r3 know about each and the networks connected. Does r1,r2 and r3 also relays this information to RB1 and RB2? And similarly, does r5,r6 and r7 relays its links and networks to RB3 and RB4?

Because, suppose, if a host connected to R1 of AS 100 wants to communicate to a host connected to R5 present in AS 200, how does it do?

2)And as far as i know, RB1 and RB2 have an ibgp session and they have identical database. Same goes for RB3 and RB4.

But do the routers r1,r2,r3,r5,r6 and r7 have the same database as RB1,RB2,RB3 and RB4? If thats not the case, how does a host in AS 100 know it has to send it to which border router(In this case, RB1 or RB2) to reach AS 200.

And one final question, how much does r1,r2 and r3 know? And same goes for RB1 and RB2?

  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Commented Apr 1, 2018 at 19:05

1 Answer 1


RB1 and RB2 in AS100 do not know about the OSPF routes of R1, R2 and R3, unless RB1 and RB2 are also running OSPF, or one of the other routers is running BGP, and the routers running both protocols redistribute routes between OSPF and BGP. Routers do not share routes unless they run a common routing protocol between them.

OSPF and BGP maintain their own tables. A router will select the best route (or use a tie breaker, like AD, in the case of equal paths) from the various routing protocols it is running to insert into its routing table, but the routing protocols do not share routes.

Unless RB1 learns, in some way, about the OSPF routes of R1, R2, and R3, it will never share those with AS200, and vice versa.

BGP doesn't even advertise routes unless the routes are in the routing table of the BGP router, and the BGP router uses the network statements for the routes, or the routes have been redistributed into BGP. One mistake that people often make is assuming that you can simply add a network statement to advertise a route in a routing protocol, but that is not true. BGP must have the exact route in the routing table, and network statements only tell OSPF which interfaces to include in the routing process.

  • Sorry for the previous comment. What i mean to say is, if suppose RB1 and RB2 are made to run ospf on top of BGP then the routes are exchanged among the routers r1,r2,r3,RB1 and RB2. But arent the ospf table separated from the bgp table. So how does a packet entering RB1 destined for a host connected to R1 reach as it has come from RB3 using ebgp? Does RB1 refer the ospf database at that time? And if RB1 knows about all the networks present in AS 100 using ospf, does it send it to RB3 using ebgp connection?
    – RRHS
    Commented Jan 2, 2018 at 7:33
  • 2
    Packets don't traverse the routers using routing protocols. The routing protocols simply populate the routing tables, and packets are routed based on what is in the routing tables. Routers get routes from directly connected networks, statically configured routes, and through routing protocols. The routing tables are populated with the best routes from those three sources. What the router knows in its routing protocol tables and routing table may or may not be advertised to its neighbors. BGP only advertises what you tell it to advertise, as long as the exact route exists in the routing table.
    – Ron Maupin
    Commented Jan 2, 2018 at 7:42
  • I always found the term "routing protocol" misleading...
    – JFL
    Commented Jan 2, 2018 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.