Wednesday, February 27, 2013

OSPF Network Types.

I think this topic is one of my weakest areas in the CCNP track. So I need to strengthen it. And the better way to do so is practice.
OSPF uses broadcast and DR/BDR elections which means some issues with underlying L2 protocols. So let's consider all L2 options and how OSPF handles them.

Point-to-point.
It is the easiest one:
R1#show running-config interface serial 1/0
interface Serial1/0
 ip address 10.0.0.1 255.255.255.0
 ip ospf 1 area 0
end
R1#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           0   FULL/  -        00:00:31    10.0.0.2        Serial1/0
R1#show ip ospf interface serial 1/0
Serial1/0 is up, line protocol is up
  Internet Address 10.0.0.1/24, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 64
  Enabled by interface config, including secondary ip addresses
  Transmit Delay is 1 sec, State POINT_TO_POINT
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

It is default network type for serial links. This type of media supports broadcast (and, therefore, OSPF multicast) so neighboring routers are automatically discovered.
The main reason for DR/BDR election is reducing of full-mesh LSA flooding between adjacent routers on the media. But serial links by default aren't multiaccess media, so DR/BDR election is not necessary.

Broadcast.
The second easiest one:

R1#show running-config interface FastEthernet 0/0
interface FastEthernet0/0
 ip address 10.0.0.1 255.255.255.0
 ip ospf 1 area 0
end
R1#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           1   2WAY/DROTHER    00:00:39    10.0.0.2        FastEthernet0/0
3.3.3.3           1   FULL/BDR        00:00:37    10.0.0.3        FastEthernet0/0
4.4.4.4           1   FULL/DR         00:00:36    10.0.0.4        FastEthernet0/0
R1#show ip ospf interface FastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 10.0.0.1/24, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10
  Enabled by interface config, including secondary ip addresses
  Transmit Delay is 1 sec, State DROTHER, Priority 1
  Designated Router (ID) 4.4.4.4, Interface address 10.0.0.4
  Backup Designated router (ID) 3.3.3.3, Interface address 10.0.0.3
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5


Non-Broadcast Multiaccess.
The rest of this post is related to obscure Frame Relay technology which I have never seen in real production networks. Configuration examples can be found here.
With Frame Relay you have several interface configuration options, namely - physical interface, point-to-point subinterfaces, point-to-multipoint subinterfaces. Let's consider all of them.

Connection using physical interfaces.
This is a hub-and-spoke topology with R1 as a hub-router, mening R2 and R3 don't have common DLCI.
R1#show running-config interface s1/0
interface Serial1/0
 ip address 10.0.0.1 255.255.255.0
 encapsulation frame-relay
 ip ospf 1 area 0
 no keepalive
 frame-relay interface-dlci 102
 frame-relay interface-dlci 103
 frame-relay lmi-type ansi
end

Because only R1 has DLCIs to all other routers, it should become DR, on other routers the ospf priority is set to 0:
R2#show running-config interface s1/0
interface Serial1/0
 ip address 10.0.0.2 255.255.255.0
 encapsulation frame-relay
 ip ospf priority 0
 ip ospf 1 area 0
 no keepalive
 frame-relay map ip 10.0.0.3 201
 frame-relay interface-dlci 201
 frame-relay lmi-type ansi
end
R1#show ip ospf interface serial 1/0
Serial1/0 is up, line protocol is up
  Internet Address 10.0.0.1/24, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type NON_BROADCAST, Cost: 64
  Enabled by interface config, including secondary ip addresses
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 1.1.1.1, Interface address 10.0.0.1
  No backup designated router on this network
  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5

The network type is non-broadcast which means that no OSPF multicast messages are allowed. So you need to manually specify neighbors, forcing OSPF to use unicast messages:
R1#show running-config | section router ospf
router ospf 1
 neighbor 10.0.0.2
 neighbor 10.0.0.3
R1#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           0   FULL/DROTHER    00:01:41    10.0.0.2        Serial1/0
3.3.3.3           0   FULL/DROTHER    00:01:55    10.0.0.3        Serial1/0


Notice, that with Frame Relay you actually can specify ospf network type as broadcast. But this will require frame-relay mappings with "broadcast" keyword:
R1#show running-config interface serial 1/0
interface Serial1/0
 ip address 10.0.0.1 255.255.255.0
 encapsulation frame-relay
 ip ospf network broadcast
 ip ospf 1 area 0
 no keepalive
 frame-relay map ip 10.0.0.3 103 broadcast
 frame-relay map ip 10.0.0.2 102 broadcast

 frame-relay interface-dlci 102
 frame-relay interface-dlci 103
 frame-relay lmi-type ansi
end
R1#show ip ospf interface serial 1/0
Serial1/0 is up, line protocol is up
  Internet Address 10.0.0.1/24, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 64
  Enabled by interface config, including secondary ip addresses
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 1.1.1.1, Interface address 10.0.0.1
  No backup designated router on this network
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
R1#show running-config | section router ospf 1
router ospf 1
 log-adjacency-changes

Router will send multicast packets as unicast according to configured Frame Relay mappings, which will lead essentially to dynamic neighbor discovery.
R1#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           0   FULL/DROTHER    00:00:36    10.0.0.2        Serial1/0
3.3.3.3           0   FULL/DROTHER    00:00:30    10.0.0.3        Serial1/0


Connection using point-to-point subinterfaces.
The topology is the same:
R1#show running-config interface serial 1/0
interface Serial1/0
 no ip address
 encapsulation frame-relay
 no keepalive
end
R1#show running-config interface serial 1/0.102
interface Serial1/0.102 point-to-point
 ip address 10.0.0.1 255.255.255.128
 ip ospf 1 area 0
 frame-relay interface-dlci 102
end
R1#show running-config interface serial 1/0.103
interface Serial1/0.103 point-to-point
 ip address 10.0.0.129 255.255.255.128
 ip ospf 1 area 0
 frame-relay interface-dlci 103

On other routers the configuration is almost the same.
R1#show ip ospf interface serial 1/0.102
Serial1/0.102 is up, line protocol is up
  Internet Address 10.0.0.1/25, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 64
  Enabled by interface config, including secondary ip addresses
  Transmit Delay is 1 sec, State POINT_TO_POINT
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

As we can see IOS uses point-to-point network type, which is pretty logical.
R1#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           0   FULL/  -        00:00:34    10.0.0.2        Serial1/0.102
3.3.3.3           0   FULL/  -        00:00:38    10.0.0.130      Serial1/0.103

And as long these interfaces are point-to-point we don't need DR/BDR on them.

Connection using point-to-multipoint subinterfaces.
R1#show running-config interface serial 1/0
interface Serial1/0
 no ip address
 encapsulation frame-relay
 no keepalive
end
R1#show running-config interface serial 1/0.1
interface Serial1/0.1 multipoint
 ip address 10.0.0.1 255.255.255.0
 ip ospf network point-to-multipoint
 ip ospf 1 area 0
 snmp trap link-status
 frame-relay map ip 10.0.0.3 103 broadcast
 frame-relay map ip 10.0.0.2 102 broadcast

end
R1#show ip ospf interface serial 1/0.1
Serial1/0.1 is up, line protocol is up
  Internet Address 10.0.0.1/24, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_MULTIPOINT, Cost: 64
  Enabled by interface config, including secondary ip addresses
  Transmit Delay is 1 sec, State POINT_TO_MULTIPOINT
  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5

By default OSPF treats these multipoint-subinterfaces as regular non-broadcast interfaces, preventing dynamic neighbor discovery. Therefore "ip ospf network point-to-multipoint" is required. Frame relay mappings with "broadcast" keyword required as well. After this configuration OSPF treats each pair of routers (that have common DLCI) as point-to-point neighbors and DR/BDR therefore aren't needed:
R1#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           0   FULL/  -        00:01:43    10.0.0.3        Serial1/0.1
2.2.2.2           0   FULL/  -        00:01:59    10.0.0.2        Serial1/0.1


Alternatively you can use "ip ospf network point-to-multipoint non-broadcast". As with regular non-broadcast interfaces you have to specify neighbors manually, but no DR/BDR elections will occur, because each pair of adjacencies will be treated as point-to-point:
R1#show running-config interface serial 1/0.1
interface Serial1/0.1 multipoint
 ip address 10.0.0.1 255.255.255.0
 ip ospf network point-to-multipoint non-broadcast
 ip ospf 1 area 0
 frame-relay interface-dlci 102
#Notice, that there is no more frame-relay mappings due to lack of multicast requirement.
 frame-relay interface-dlci 103
end
R1#show running-config | section router ospf
router ospf 1
 neighbor 10.0.0.3
 neighbor 10.0.0.2
R1#show ip ospf interface serial 1/0.1
Serial1/0.1 is up, line protocol is up
  Internet Address 10.0.0.1/24, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_MULTIPOINT, Cost: 64
  Enabled by interface config, including secondary ip addresses
  Transmit Delay is 1 sec, State POINT_TO_MULTIPOINT
  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5


To sum up the information above:
Type DR/BDR Dynamic Neighbors Hello/Dead Labels
Broadcast Y Y 10/40 Default for Ethernet links, requires broadcast mappings (for Frame Relay)
Non-Broadcast Y N 30/120 Default for Frame Relay physical and multipoint interfaces
Point-to-Point N Y 10/40 Default for Serial links and Frame Relay point-to-point subinterfaces
Point-to-Multipoint N Y 30/120 Requires static neighbors and broadcast mappings (for Frame Relay)
Point-to-Multipoint Non-Broadcast N N 30/120 Requires static neighbors

And the last important thing - you can mix network types on different ends of the link as long as they can interoprate with each other, in other words when these two types of networks both (not) require DR/BDR, dynamic neighbor discovery and have identical timers values:
OSPF over Frame-Relay – Part 6: Troubleshooting
Understanding OSPF Network Types

No comments:

Post a Comment