1

I'm having the following topology:

[router A] port1===port1 [router B] port2===port2 [router C]
subnet 1 on router A and B via port1
subnet 2 on router B and C via port2

Now all routers are in area 0, but they are not in the same subnet. If I check the neighbors on router A, I will only see router B, on router B I see neighbors A and C (but on different subnets/interfaces) and on C ) only see B as neighbor. So far so good, you can only have neighbors on the same subnet, so no surprise that you won't see all of the routers being neighbors.

But this is exactly the point: I would have expected that router A won't see routes on router C but obviously it still does receive that route. What is the explanation for that? Is it that each subnet has only 2 participants which are automatically DR and BDR which would then pass all the (learned) routes to the other connected subnets or what is the exact reason why it's ever working? Is there any construction where such a topolocy would not work at all (where all routers are in the same area, but have different subnets and wouldn't hold every route from all the routers in the same area)? I can't find that information...

Next question that arises is if that setup is significantly slower: Suppose router C goes down, now router B has to remove those routes and then pass that information to A, I suppose that takes much more time as if all devices where neighbors (please suppose that you'd have not only those 3 but say 20 devices where all of them are connected in the same fashion, A to B, B to C, C to D, etc.)?

Thanks very much for the clarifications!

4
  • 1
    Routing protocols, including OSPF, exchange routing information from which the routers can populate their routing tables. OSPF is designed so that OSPF on a router knows about every other router and network within that area. OSPF converges very quickly to topology changes. Contrast that to RIP that only knows about directly connected neighbors and is slow to converge, which may briefly cause routing loops and black holes.
    – Ron Maupin
    Oct 19, 2022 at 12:40
  • To be honest this question is weird. Not only is this a normal behaviour of OSPF. Actually, it is even required. A, B, C cannot be in the same subnet and be connected with each other sequentially like in the presented diagram. They have to be in different subnets. This is basic routing, whether done manually or through OSPF, RIP or whatever other means.
    – ciamej
    Oct 19, 2022 at 22:14
  • And if you have a different topology, when A, B, C are all neighbours and are in the same subnet, there is no routing involved at all. Routing really comes into play when you have different subnets.
    – ciamej
    Oct 19, 2022 at 22:16
  • What looks weird here is probably due to a misunderstanding. I know the purpose of routing protocols and that you need em for different subnets, otherwise there is no routing needed as you said. The thing is that almost everybody says 'for being a ospf neighbor you have to be in the same subnet'. if you are not neighbor, no routes will be exchanged. that was the reason why I've created this thread. So it almost looked like "if you're not a neighbor, OSPF won't work'. So I wannted to understand what the facts are...
    – BlackFlag
    Oct 20, 2022 at 6:14

2 Answers 2

3

update: Explanation of DR/BDR mechanism in OSPF

First, I would recommend first understanding how OSPF works on point-to-point links, i.e., on the links that can connect only two routers. On such links there is no DR/BDR mechanism. DR/DBR mechanism was originally an optimization for a special case, and it just happened that each link now can be this special case.

Second,

only DR or BDR talks to the ospf speakers

no, this is not exactly true. DR and BDR talk to other speakers on the same link (interface) in question. This only makes sense, if you consider that a link can connect more than two routers (see below). Every router still sends and receives LSAs on all its another interfaces. DR/BDR mechanism changes how this LSA is propagated on this particular link.

Third, the issue with Ethernet, is that Ethernet a broadcast multi-access link, i.e., a link that connects more than two routers and is capable of sending packet to more than one receiver. Ethernet used to be a shared bus, and now it is kinda a network of switches that emulate a shared bus. Since you can't tell by the cable, whether more than one router is on the link, OSPF per default works in such mode. As @RonMaupin said, if you know that you only have a cable, you can turn off this mode, and then you would not need DR/BDR mechanims. See this question for details.

The general idea:

The idea of DR/BDR mode is (was?, not an issue now) on a very high level to reduce traffic on the link, i.e., Ethernet segment.

Technically broadcast multiaccess link means that each router can talk to any other router (i.e., the topology is full mesh). In a full mesh each router would have to send LSAs to each other router on the link, which is suboptimal, [and since it is a broadcast link also unnecessary]. In order to avoid this, there is an optimization which makes a shared link a star instead of full mesh.

One router is selected as DR. When another router on this link receives an LSA from an interface not on this link, it sends this LSA to DR. DR then sends this LSA to each other router on this link. Just to clarify, each router that receives an LSA on such link, then sends it on each of its other interfaces.

Now, LSAs should be transmitted reliably and BDR is just a backup, in case DR fails. BDR receives the same LSAs and ACKs and silently collects them.


some comments to Zac67's answer.

I would have expected that router A won't see routes on router C but obviously it still does receive that route. What is the explanation for that?

The role of routing (aka layer 3) is to connect different subnets (layer 2) with each other. The role of routers is to forward traffic between different subnets. The purpose of any routing protocol including OSPF is that every router learns path to every other router (well actually end-system) in the network. In your diagram the purpose of a routing protocol is that A learns how to reach C and vice versa.

If A knew how to reach C (e.g., because they are on the same subnet) then you would not need OSPF or any routing protocol. Note that in your diagram, if B is a router then having A and C on the same subnet is a misconfiguration. They cannot be on the same subnet, because they cannot reach each other using layer 2 mechanism.

Is it that each subnet has only 2 participants which are automatically DR and BDR which would then pass all the (learned) routes to the other connected subnets or what is the exact reason why it's ever working?

yes, with two routers on a link, one will be DR/BDR, but this is actually not relevant. DR/BDR is there because Ethernet can connect more than two routers. You could have a point-to-point link. But these are OSPF internals that are not relevant for the concept.

Is it that each subnet has only 2 participants which are automatically DR and BDR which would then pass all the (learned) routes to the other connected subnets or what is the exact reason why it's ever working?

again, this is exactly what a routing protocol does.

Is there any construction where such a topology would not work at all (where all routers are in the same area, but have different subnets and wouldn't hold every route from all the routers in the same area)? I can't find that information...

if your network is configured correctly, and there is a physical working path, then NO.

Areas do not change that fact. Areas change how exactly routes from other routers are learned, but the result should be the same - each router will (eventually, see [1]) know path every other router/end system in the network. Areas are also OSPF internals that are not relevant.

Next question that arises is if that setup is significantly slower: Suppose router C goes down, now router B has to remove those routes and then pass that information to A, I suppose that takes much more time as if all devices where neighbors (please suppose that you'd have not only those 3 but say 20 devices where all of them are connected in the same fashion, A to B, B to C, C to D, etc.)?

How slow it goes mainly depends on how long it takes for neighbors to detect that C did go down. If there is some physical layer indication that the line is down, then other routers can start converging, which means propagating new routes, immediately. If not, then HELLO protocol should be able to detect that C is not responding. In this case you would have to check hello interval/router dead interval on your router and compare it to the one of your layer 2 protocol (e.g., RSTP).

Now, how fast routers recalculate new path depends on the exact mechanics of the routing protocol and on the performance of the routers. My gut tells that OSPF is capable of converging faster then RSTP and definitely faster then STP.


[1] well, it may take some time to calculate routes, and during this time routes may not be available

5
  • my confusion about the 'not working when not in the same subnet' comes from the fact that only DR or BDR talks to the ospf speakers. so it can only work when a speaker which is not DR or BDR in in one subnet is BDR or DR in the next subnet to propagate all learned routes. Is that correct?
    – BlackFlag
    Oct 19, 2022 at 12:14
  • If there are only two routers on a link, even with ethernet, OSPF can be configured to use unicast, rather than having a DR/BDR.. I know advocates of both methods for such a situation. I really do not see any difference once the adjacency has been established, but there are network engineers who would argue to death that you should configure the two routers to use unicast OSPF.
    – Ron Maupin
    Oct 19, 2022 at 12:32
  • @BlackFlag see update
    – Effie
    Oct 19, 2022 at 12:47
  • @Effie: Thanks very much for your update. "When another router on this link receives an LSA from an interface not on this link, it sends this LSA to DR. DR then sends this LSA to each other router on this link." <--- is it possible to do a practical example on that? I'm not sure if I got the point...
    – BlackFlag
    Oct 24, 2022 at 7:26
  • @BlackFlag I think you can find a PDF for Radia Pelman's book "Interconnections, second Edition" in Internet (not sure it is legal, so I won't post a link). Chapter 12.7 explains the issues of broadcast links and reasons for this mechanism. As I said, (1) it only makes sense when you consider that a link can connects more than two routers and (2) there is no point of understanding this mechanism, unless you understand the basic flooding mechanism.
    – Effie
    Oct 24, 2022 at 9:28
5

I would have expected that router A won't see routes on router C but obviously it still does receive that route. What is the explanation for that?

Propagating routes to all subnets is the main point of running OSPF (or any other routing protocol). If your routers have established adjacencies then that is exactly what you'd expect.

The DR/BDR selection is just a matter of efficiency, it doesn't change the basic propagation. If desired, you can change propagation scopes by using different areas and types, or by setting up explicit route filtering (when supported).

Suppose router C goes down, now router B has to remove those routes and then pass that information to A

B would remove the subnets behind C (that your diagram doesn't show). If the link between B and C runs across a switch, then that link through B and the attached segment/subnet stay 'up'.

I suppose that takes much more time as if all devices where neighbors

Note that with a switch in between, C goes offline silently, requiring B to age out its information. Once that happens it sends a link-state update to its neighbors which then in turn update their neighbors. Updating chained routers takes a tiny bit longer to propagate than an immediate update (likely in the range of milliseconds).

3
  • yes we do expect that from ospf, however this does not explain why it works when your ospf routers are on different subnets
    – BlackFlag
    Oct 19, 2022 at 9:14
  • I think there's a misconception: OSPF generally propagates all link and subnet information within an area, not only between direct neighbors. The area type decides about how information from outside that area is handled.
    – Zac67
    Oct 19, 2022 at 9:23
  • "The DR/BDR selection is just a matter of efficiency, it doesn't change the basic propagation" <- this comma should be a semicolon (maybe), hyphen, or full stop. en.wikipedia.org/wiki/Comma_splice
    – user253751
    Oct 19, 2022 at 18:25

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.