Ospf network type vs link type

Hi everyone

ospf has a general category called (ospf network types) which are :
1-broadcast
2-Non-broadcast
3-point-to-point
4-point-to-multipoint
5-point-to-multipoint non-broadcast
6-loopback

but what is the difference between these network types and the network types are on the picture :
1-stub
2-transit
3-point to point

there are two times of point to point netork types ,what is that ?

The best way I can describe it is:
A. Link types (such as transit, stub and point-to-point) are contained within Type-1 Router LSAs and describe the link. These elements are used by other routers in the area to accurately form a topology diagram of their local area. The link-type (transit, stub or point-to-point) also help routers receiving Router LSAs to predict what type of data will be contained in the “Link Data” section of that LSA. For example, if a link-type is described as “Stub” then the receiving router will know that the Link-Data of that LSA will contain the IPv4 Subnet Mask configured on that link. However if the Link-Type is “Transit” then the Link-Data for that LSA will contain the router’s interface IPv4 address.

B. The network types (NBMA, Broadcast, Point-to-Multipoint, etc) are only useful for the local router and are not advertised in any LSA. This information dictates to the local router how it may discover OSPF neighbors and whether OSPF packets should be transmitted as multicast or unicast. Network Type is determined by the layer-2 encapsulation configured on the interface.

Hope that helps!
Keith

1 Like

thanks keith ,
i will tell you what i understand and tell me if i`m right or wrong :-
1-there are something called L2 Network type which are;
1-broadcast
2-Non-broadcast
3-point-to-point
4-point-to-multipoint
5-point-to-multipoint non-broadcast
6-loopback
and these called ( L2 network types) are used by ospf in order to specify how to send the the OSPF frame,if that frame will be sent to multicast DST ip address 224.0.0.5 or 224.0.0.6 like broadcast and non-broadcast or unicast DST ip address like the Point-to-x Network types

and there are another network types which are (L3 OSPF Link type) which is used to specify how to advertise the subnet and the subnet mask for each link

I would say yes, you are correct. I would add that you probably shouldn’t refer to them as “L2 Network Type” or “L3 Network Types”. The OSPF documentation never uses the phrase L2 network type (although you and I know that the L2 encapsulation is how those six network types are determined).

Other than that, everything you said is correct.

1 Like

Keith , i want to ask you another question
it`s possible to change the L2 network type.
i mean by default the L2 network type on Ethernet/FDDI/Token Ring is broadcast and i could change that network type by using this command
interface F0/0
ip ospf network point-to-point
but is it possible to change the L3 network type manullly from stub to transit or point to point ?

As far as I’m aware, you cannot change those link-types through configuration. A link with no OSPF neighbors detected will always advertise itself as “stub”. The only way to change that link type (if it’s some flavor of Ethernet or Frame-Relay) to “transit” would be to add another router to it that can become an OSPF adjacency. Also, a link that’s running PPP or HDLC encapsulation will always advertise itself as a combination of “Stub/Point-to-Point”. There’s no way to change that kind of link to “Transit”.

but keith hold on
if we have this senario
R1<----------------ser1/0----------->R2
10.1.121.0/24

R1#show ip ospf database router self-originate
Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 0.0.0.2
(Link Data) Router Interface address: 10.1.121.1
Number of MTID metrics: 0
TOS 0 Metrics: 64

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

here the L3 Link type is (point to point )on serial interface

R1-R2)#int ser 1/0
)#ip ospf network broadcast

R1#show ip ospf database router self-originate
Link connected to: a Transit Network
(Link ID) Designated Router address: 10.1.121.1
(Link Data) Router Interface address: 10.1.121.1
Number of MTID metrics: 0
TOS 0 Metrics: 64

did you see that ?the link type is changed .

I stand corrected…good catch on that! A couple of things to point out though:

  1. Point-to-point is superior to broadcast in many ways, the least of which is that it doesn’t require the overhead of DR and BDR elections. So in the real world, I can’t think of any reasons why you’d ever implement the “IP ospf network broadcast” command on a point-to-point serial link. You’re only making OSPF work harder when you do that.

  2. While you have discovered that (by implementing the “IP ospf network” command) one can change P2P links to Transit (or vice-versa), there is no way to change them to Stub. Or to change a “stub” link to P2P or Transit.

All good stuff! Kudos to you for working this one out in the lab because THAT’s the best way to learn!

1 Like

keith i need extra help,please don`t go
as we explained before there are
-OSPF L2 network Type
-OSPF L3 Link Type

when i type this command

R1-R2)#int ser 1/0
)#ip ospf network broadcast

that means i need to change the L2 network type from point-to -point to broadcast L2 network type

but when i use this command , this command is also affecting the L3 Link type from point-to-point link type to transit link type
but what does this means ?i`m still not understanding this point
if i want to change the L2 stuff in ospf, why that is affecting the L3 stuff in ospf ?i need to change something related to L2 , why L3 also changed ?

First, I think it’s important that we use the correct terminology here. OSPF has nothing to do with Layer-2 of the OSI model. So it’s confusing and misleading to refer to something OSPF is doing as “L2 Network Type” because that gets one thinking about Layer-2 (the Datalink Layer) of the OSI model which OSI has nothing to do with.

Instead lets use this terminology:
A. When you say, “L2 Network Type” = Link Type
B. When you say, “L3 Link Type” = Network Type

So in the world of OSPF, what you and I would call an interface (i.e. interface Gigabit0/1) is classified by OSPF in two ways:
—the “Link Type” of that interface
—the “Network Type” that interface connects to.

By default, the “Network Type” is derived from the Link Type. So OSPF first determines the Link Type of a port/interface. It does this by looking at the Layer-2 encapsulation configured on that interface. Keep in mind OSPF knows NOTHING about how that Layer-2 encapsulation works, what rules it has, how it performs addressing (at Layer-2), or any of that stuff. All OSPF knows is this:
—At first, all links are classified as “Stub.” This is because, at the beginning, OSPF doesn’t know if any other OSPF routers exist on the link. Assuming it is the only router on the link, the link type is set to Stub (i.e. “There are no other routers beyond me at this point. I’m the end-of-the-line.”)

—If the L2 encapsulation is Ethernet or Frame-Relay, then this link (i.e., interface) could possibly connect to multiple routers…all of which see each other and can communicate directly. If OSPF receives a Hello packet on this type of link, it re-classifies this as Transit and determines that a DR/BDR election needs to take place.

—If the L2 encapsulation is PPP or HDLC, then OSPF knows this link could only connect to one other router. Once again, the link starts out as “Stub” and then, if a Hello packet is received it retains the “Stub” classification but then also describes the link again as Point-to-Point. Don’t ask me why OSPF does this…it just does.

AFTER all of that is done and the Link Type has been determined…THEN OSPF will use that information (the Link Type value) to determine the Network Type. If the Link Type was Point-to-Point, then the Network Type will also be Point to Point. If the Link Type was determined to be Stub then OSPF will once again look at the L2 Encapsulation on that link. Ethernet will become OSPF Network Type = Broadcast. Frame-Relay will become OSPF Network Type Non-Broadcast Multi-Access.

So as you can see, by default OSPF first determined the Link Type…then determines the Network Type.

However, let’s say you have a Serial interface that is currently disabled (shutdown). YOu have activated OSPF on that interface and you have also implemented the command, “ip ospf network xxxx”. Then you enable the interface. In this case, you are forcing OSPF to FIRST determine the Network Type, which you have pre-determined with the command. Once it sees your pre-configured Network Type it will do the following:

  1. OSPF starts sending Hello Packets.
  2. Regardless of the preconfigured network type, initially OSPF will create a Router LSA describing that link as “Stub” because it doesn’t know if another OSPF router exists on the link.
  3. The moment an incoming OSPF Hello packet is received, OSPF will look at the pre-configured Network Type and make a decision about the resulting Link Type:
    -----3a. If the configured Network Type is “broadcast” or “non-broadcast” the Link Type will be set to “Transit”
    -----3b. If the configured Network Type is “point-to-point” or “point-to-multipoint” the Link Type will be set to a combination of “Stub” and “Point to Point”.

I hope that clarifies things.
Keith

Thanks Keith for your efforts and for your reply.i don`t have any words to respect you.words only are not enough to thank you.

keith,why you said
“L2 Network Type” = Link Type
“L3 Link Type” = Network Type ?
in ospf , the L2 stuff are controlled by the OSPF Netowrk type which are (broadcast,NBMA,Point-to-x,etc) but NOT controlled by the L3 Link types(stub,transit,point to point)
L2 Network types are controlling
-if there are DR/BDR on that link
-how many adjacencies on that link
-are updates sent to unicast or multicast
-the HelloInterval and the DeadInterval
-and the final point is the L3 Link-type(stub,transitm,point to point)
and all these stuff are related to L2 things NOT L3 things
of course OSPF have a partial vision about the L2 stuff NOT a full vision but all these stuff are L2 Stuff

and vice versa, the L3 Link-types which are (stub,transit,point to point)is controlling :-
-how the routers are in the same area are going to see each others
-how to advertise the ip addresses & subnet masks.
that is controlled by L3 Link-types NOT L2 Network Types.

thats what you are told me before im righ and that is what i think.
please if im wrong tell me why im wrong.

if we have two things right now,
1-OSPF Network Types(Broadcast,NBMA,Point-to-x,etc)
2-OSPF Link types (transit,point to point,stub)
can we say that #1 is related to L2 stuff
and #2 is related to L3 stuff ?
OR
can we say #1 is related to L3 stuff
and #2 is related to L2 stuff ?

Hello major133,

You wrote, “in ospf , the L2 stuff are controlled by the OSPF Netowrk type which are (broadcast,NBMA,Point-to-x,etc) but NOT controlled by the L3 Link types(stub,transit,point to point)”

If you type the command, “IP ospf network point-to-point” on a GigabitEthernet interface we both know that OSPF will set the link type to “point-to-point” of that interface. So let me ask you a question; Even though OSPF changes the link-type in its LSA (in this situation) to “point-to-point” does that change affect/control the Ethernet protocol in any way? Does the Ethernet protocol on that interface behave any differently than it did before? Does it affect the CSMA/CD process or the use of MAC addresses? The answer is, no…it doesn’t. The change of Link-Type within the Router LSA only affects how OSPF advertises/describes that link to other OSPF routers…in no way does it actually change the Layer-2 operations on that link. If it was operating under the rules of Ethernet, it’s still operating under those rules. If it was operating under the rules of PPP, it still uses the rules of PPP.

That’s why I said we shouldn’t call it “L2 network type” because it is not affecting (or controlling) the Layer-2 characteristics of the interface in any way.

I would go so far as to say that network types (broadcast.NBMA,Point-to-x,etc) are physical layer and datalink layer(L2) in the sense that the default setting Is based off the physical network interface you’re plugging in. Although configurable it still initially relies on whether it’s Ethernet, serial, etc.

is that correct ?

if we have two things ,
1-OSPF Network Types(Broadcast,NBMA,Point-to-x,etc)
2-OSPF Link types (transit,point to point,stub)
can we say that #1 is related to L2 stuff
and #2 is related to L3 stuff ?
OR
can we say #1 is related to L3 stuff
and #2 is related to L2 stuff ?