Difference between revisions of "Manual:OSPF-examples"

From MikroTik Wiki
Jump to: navigation, search
(New page: OSPF Examples Category:Manual Category:Unfinished)
 
(added nbma example)
Line 1: Line 1:
OSPF Examples
+
= OSPF Examples =
 +
 
 +
== NBMA networks ==
 +
 
 +
OSPF network type NBMA (Non-Broadcast Multiple Access) uses only unicast communications, so it is the preferred way of OSPF configuration in situations where multicast addressing is not possible or desirable for some reasons. Examples of such situations:
 +
* in 802.11 wireless networks multicast packets are not retransmitted; using multicast here this can create OSPF stability problems;
 +
* using multicast may not be efficient in bridged or meshed network (i.e. large layer-2 broadcast domains).
 +
 
 +
Especially efficient way to configure OSPF is to allow only a few routers on a link to become the designated router. (But be careful - if all routers that are capable of becoming the designated router will be down on some link, OSPF will be down on that link too!) Since a router can become the DR only when priority on it's interface is not zero, this priority can be configured as zero in interface and nbma-neighbor configuration to prevent that from happening.
 +
 
 +
[[Image:ospf-nbma.png]]
 +
 
 +
In this setup only C and D are allowed to become designated routers.
 +
 
 +
On all routers:
 +
routing ospf network add network=10.1.1.0/24 area=backbone
 +
routing ospf nbma-neighbor add address=10.1.1.1 priority=0
 +
routing ospf nbma-neighbor add address=10.1.1.2 priority=0
 +
routing ospf nbma-neighbor add address=10.1.1.3 priority=1
 +
routing ospf nbma-neighbor add address=10.1.1.4 priority=1
 +
(Adding nbma-neighbor to self makes no sense, but does not create any problems either.)
 +
 
 +
Configure interface priorities.
 +
On routers A, B:
 +
 
 +
routing ospf interface add interface=ether1 network-type=nbma priority=0
 +
 
 +
On routers C, D (they can become the designated router):
 +
 
 +
routing ospf interface add interface=ether1 network-type=nbma priority=1
 +
 
 +
=== Results===
 +
On Router A:
 +
<pre>
 +
[admin@A] > routing ospf neighbor print
 +
0 router-id=10.1.1.5 address=10.1.1.5 interface=ether1 priority=1 dr-address=10.1.1.4
 +
  backup-dr-address=10.1.1.3 state="Full" state-changes=6 ls-retransmits=0
 +
  ls-requests=0 db-summaries=0 adjacency=4m53s
 +
 
 +
1 router-id=10.1.1.3 address=10.1.1.3 interface=ether1 priority=1 dr-address=1.1.1.4
 +
  backup-dr-address=10.1.1.3 state="Full" state-changes=6 ls-retransmits=0
 +
  ls-requests=0 db-summaries=0 adjacency=4m43s
 +
 
 +
2 address=10.1.1.2 interface=ether1 priority=0 state="Down" state-changes=2
 +
 
 +
3 address=10.1.1.1 interface=ether1 priority=0 state="Down" state-changes=2
 +
</pre>
 +
 
 +
On Router D:
 +
<pre>
 +
[admin@D] /routing ospf> neighbor p
 +
0 address=10.1.1.4 interface=ether1 priority=1 state="Down" state-changes=2
 +
 
 +
1 router-id=10.1.1.3 address=10.1.1.3 interface=ether1 priority=1 dr-address=10.1.1.4
 +
  backup-dr-address=10.1.1.3 state="Full" state-changes=6 ls-retransmits=0
 +
  ls-requests=0 db-summaries=0 adjacency=6m8s
 +
 
 +
2 router-id=10.1.1.2 address=10.1.1.2 interface=ether1 priority=0 dr-address=10.1.1.4
 +
  backup-dr-address=10.1.1.3 state="Full" state-changes=5 ls-retransmits=0
 +
  ls-requests=0 db-summaries=0 adjacency=6m4s
 +
 
 +
3 router-id=10.1.1.1 address=10.1.1.1 interface=ether1 priority=0 dr-address=10.1.1.4
 +
  backup-dr-address=10.1.1.3 state="Full" state-changes=5 ls-retransmits=0
 +
  ls-requests=0 db-summaries=0 adjacency=6m4s
 +
</pre>
  
 
[[Category:Manual]]
 
[[Category:Manual]]
 
[[Category:Unfinished]]
 
[[Category:Unfinished]]

Revision as of 14:01, 30 July 2009

OSPF Examples

NBMA networks

OSPF network type NBMA (Non-Broadcast Multiple Access) uses only unicast communications, so it is the preferred way of OSPF configuration in situations where multicast addressing is not possible or desirable for some reasons. Examples of such situations:

  • in 802.11 wireless networks multicast packets are not retransmitted; using multicast here this can create OSPF stability problems;
  • using multicast may not be efficient in bridged or meshed network (i.e. large layer-2 broadcast domains).

Especially efficient way to configure OSPF is to allow only a few routers on a link to become the designated router. (But be careful - if all routers that are capable of becoming the designated router will be down on some link, OSPF will be down on that link too!) Since a router can become the DR only when priority on it's interface is not zero, this priority can be configured as zero in interface and nbma-neighbor configuration to prevent that from happening.

Ospf-nbma.png

In this setup only C and D are allowed to become designated routers.

On all routers:

routing ospf network add network=10.1.1.0/24 area=backbone
routing ospf nbma-neighbor add address=10.1.1.1 priority=0
routing ospf nbma-neighbor add address=10.1.1.2 priority=0
routing ospf nbma-neighbor add address=10.1.1.3 priority=1
routing ospf nbma-neighbor add address=10.1.1.4 priority=1

(Adding nbma-neighbor to self makes no sense, but does not create any problems either.)

Configure interface priorities. On routers A, B:

routing ospf interface add interface=ether1 network-type=nbma priority=0

On routers C, D (they can become the designated router):

routing ospf interface add interface=ether1 network-type=nbma priority=1

Results

On Router A:

[admin@A] > routing ospf neighbor print
 0 router-id=10.1.1.5 address=10.1.1.5 interface=ether1 priority=1 dr-address=10.1.1.4
   backup-dr-address=10.1.1.3 state="Full" state-changes=6 ls-retransmits=0
   ls-requests=0 db-summaries=0 adjacency=4m53s

 1 router-id=10.1.1.3 address=10.1.1.3 interface=ether1 priority=1 dr-address=1.1.1.4
   backup-dr-address=10.1.1.3 state="Full" state-changes=6 ls-retransmits=0
   ls-requests=0 db-summaries=0 adjacency=4m43s

 2 address=10.1.1.2 interface=ether1 priority=0 state="Down" state-changes=2

 3 address=10.1.1.1 interface=ether1 priority=0 state="Down" state-changes=2

On Router D:

[admin@D] /routing ospf> neighbor p
 0 address=10.1.1.4 interface=ether1 priority=1 state="Down" state-changes=2

 1 router-id=10.1.1.3 address=10.1.1.3 interface=ether1 priority=1 dr-address=10.1.1.4
   backup-dr-address=10.1.1.3 state="Full" state-changes=6 ls-retransmits=0
   ls-requests=0 db-summaries=0 adjacency=6m8s

 2 router-id=10.1.1.2 address=10.1.1.2 interface=ether1 priority=0 dr-address=10.1.1.4
   backup-dr-address=10.1.1.3 state="Full" state-changes=5 ls-retransmits=0
   ls-requests=0 db-summaries=0 adjacency=6m4s

 3 router-id=10.1.1.1 address=10.1.1.1 interface=ether1 priority=0 dr-address=10.1.1.4
   backup-dr-address=10.1.1.3 state="Full" state-changes=5 ls-retransmits=0
   ls-requests=0 db-summaries=0 adjacency=6m4s