cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2621
Views
10
Helpful
7
Replies

OSPF directly connected routes vs supernetted routes

kaspergyselinck
Level 1
Level 1

Regarding OSPF dynamic routing protocol.

I've been under the impression that adding networks to the ospf router process is used to broadcast directly connected networks.

However, in a recent packer tracer exercise I've done, the assignment asked to add 1 summary network statement to add the whole network to the OSPF process. This seems to work, but it got me confused as to how to best configure OSPF.

If you have OSPF enabled and you add for example the following as the only statement to your OSPF process on router 1:

"network 192.168.0.0 0.0.0.255 area 0"

- knowing that this supernet covers even the networks which are not directly connected to the router -

and on router 2 you add the same and on router 3 the same again to the following example topology:

(network topology: ------ 192.168.0.0/28 --- Router 1 ---- 192.168.0.32/28 ----- Router 2 ----- 192.168.0.64/28 ---- Router 3 ----- 192.168.0.96/28

Is this supposed to work? And is this acceptible practice?

or should it be 

Router 1: network 192.168.0.0 0.0.0.15 area 0

  network 192.168.0.32 0.0.0.15 area 0

etc....

I hope this question makes sense.

Thanks in advance,

1 Accepted Solution

Accepted Solutions

Richard Burts
Hall of Fame
Hall of Fame

Perhaps we should start by clarifying some terminology. You refer to this network 192.168.0.0 0.0.0.255 and call it a supernet. How do you come to the conclusion that this is a supernet? This is the exact description of a class C network where 192.168.0 is the network part and 0 is the host part. This is not supernetting.

But if we bypass concern about terminology the rest of your post is a reasonable question about configuring OSPF with more specific or less specific network statements. Let us start by reviewing the basic function of the network statement in OSPF. The function of the network statement in OSPF is to determine whether to include specific interfaces in the OSPF process or not include those interfaces in the OSPF process. It is a fairly common practice to use network statements with masks that match the subnet of each interface - which is what you seem to be doing with 192.168.0.0 0.0.0.15 area 0 and 192.168.0.32 0.0.0.15 area 0.

But it is also possible to configure OSPF with more specific masks or less specific masks. It would be a possible (and correct) alternative to configure 192.168.0.1 0.0.0.0 area 0 and 192.168.0.33 0.0.0.0 area 0 which would have the same result of matching two interfaces and putting them both into area 0 using masks that are more specific. Or it would be possible (and correct) alternative to configure 192.168.0.0 0.0.0.255 which would have the effect of matching those two interfaces and putting them into area 0.

As long as both interfaces will go into the same area any of these three alternatives would work and would achieve the desired result. I have known people who prefer more specific masks on the basis that it is more precise and removes any ambiguity about what you want to achieve. I have also known people who prefer less specific masks (where they work) on the basis that the configuration is less complicated (and easier). What length of mask to use is a choice that you can make as you start a configuration using OSPF.

One thing to think about in this situation is what would happen if someone adds another interface to this router, perhaps using 192.168.0.128? If you have used 192.168.0.0 0.0.0.255 then the new interface is automatically included in OSPF in area 0. But what if the intent was to have this new interface go into area 1?

HTH

Rick

HTH

Rick

View solution in original post

7 Replies 7

Richard Burts
Hall of Fame
Hall of Fame

Perhaps we should start by clarifying some terminology. You refer to this network 192.168.0.0 0.0.0.255 and call it a supernet. How do you come to the conclusion that this is a supernet? This is the exact description of a class C network where 192.168.0 is the network part and 0 is the host part. This is not supernetting.

But if we bypass concern about terminology the rest of your post is a reasonable question about configuring OSPF with more specific or less specific network statements. Let us start by reviewing the basic function of the network statement in OSPF. The function of the network statement in OSPF is to determine whether to include specific interfaces in the OSPF process or not include those interfaces in the OSPF process. It is a fairly common practice to use network statements with masks that match the subnet of each interface - which is what you seem to be doing with 192.168.0.0 0.0.0.15 area 0 and 192.168.0.32 0.0.0.15 area 0.

But it is also possible to configure OSPF with more specific masks or less specific masks. It would be a possible (and correct) alternative to configure 192.168.0.1 0.0.0.0 area 0 and 192.168.0.33 0.0.0.0 area 0 which would have the same result of matching two interfaces and putting them both into area 0 using masks that are more specific. Or it would be possible (and correct) alternative to configure 192.168.0.0 0.0.0.255 which would have the effect of matching those two interfaces and putting them into area 0.

As long as both interfaces will go into the same area any of these three alternatives would work and would achieve the desired result. I have known people who prefer more specific masks on the basis that it is more precise and removes any ambiguity about what you want to achieve. I have also known people who prefer less specific masks (where they work) on the basis that the configuration is less complicated (and easier). What length of mask to use is a choice that you can make as you start a configuration using OSPF.

One thing to think about in this situation is what would happen if someone adds another interface to this router, perhaps using 192.168.0.128? If you have used 192.168.0.0 0.0.0.255 then the new interface is automatically included in OSPF in area 0. But what if the intent was to have this new interface go into area 1?

HTH

Rick

HTH

Rick

Richard,

Your answer was very helpful towards getting a better understanding of how network statements function in ospf and to get a better understanding of supernetting as well.

Thanks for your help.

Disclaimer

The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.

Liability Disclaimer

In no event shall Author be liable for any damages wha2tsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.

Posting

If you're a bit unclear about supernetting, it's the opposite of subnetting.

With classful addressing, you subdivide a classful address.  So, 10.x.x.x is naturally a class A, but if you create a network that 10.1.2.0/24, that's a subnetted network.

With classful addressing, if you combine multiple class networks into a single network, such as taking 192.168.0.0/24 and 192.168.1.0/24 class C's and make a network 192.168.0.0/23, the latter is a supernet.

Remember subnetting and supernetting only apply to classful addressing which has pretty much been replaced by CIDR.  With classless addressing we still often use the term subnets, but they are all independent networks.

Joseph

Very nice and succinct explanation of the relationship of subnetting and supernetting. And a good reminder that they were concepts of classful addressing. +5 

HTH

Rick

HTH

Rick

Thanks Rick.

I am glad that my answer was helpful. Thank you for using the rating system to mark this question as answered. This will help other readers in the forum to identify discussions that have helpful information. These forums are very good places to learn about Cisco networking and I hope to see you continue to be active in the forums.

HTH

Rick

HTH

Rick

Joseph W. Doherty
Hall of Fame
Hall of Fame

Disclaimer

The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.

Liability Disclaimer

In no event shall Author be liable for any damages wha2tsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.

Posting

Another way that might help you understand OSPF network statements, think of the OSPF network statement as working like an ACL's ACE that matches against the IP of each interface.  If there's a network statement match, that interface's IP's prefix is advertised by that OSPF process.  Also realize, you might have multiple network statements that match, but again like an ACL, first match "wins".

BTW, on later IOS versions, you can also add an interface prefix, to an OSPF process, by using an OSPF statement on the interface, negating the need to use the OSPF process network statement.