Sunday, August 19, 2012

OSPF Internal Summarization

We are going to use the diagram in figure 1 for this post. I am going to summarize 4.0.0.0/8 from R3 into R1


Figure 1



Pre-summarization on R1 and R2:

Also note that I have three loopbacks configured on R3,  4.4.4.1/32, 4.4.5.1/32, 4.4.6.1/32.


R1#show ip route

     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/2] via 192.168.10.2, 00:14:46, FastEthernet0/0
     4.0.0.0/32 is subnetted, 3 subnets
O IA    4.4.5.1 [110/12] via 192.168.10.2, 00:01:36, FastEthernet0/0
O IA    4.4.4.1 [110/12] via 192.168.10.2, 00:01:36, FastEthernet0/0
O IA    4.4.6.1 [110/12] via 192.168.10.2, 00:01:36, FastEthernet0/0

C    192.168.10.0/24 is directly connected, FastEthernet0/0
O IA 192.168.20.0/24 [110/11] via 192.168.10.2, 00:14:46, FastEthernet0/0
R1#

R1#show ip ospf database

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         905         0x80000003 0x0055E9 1
2.2.2.2         2.2.2.2         915         0x80000005 0x00161D 1

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.10.2    2.2.2.2         915         0x80000001 0x00A50B

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
2.2.2.2         2.2.2.2         990         0x80000001 0x00FA31
4.4.4.1         2.2.2.2         120         0x80000001 0x0021FB
4.4.5.1         2.2.2.2         120         0x80000001 0x001606
4.4.6.1         2.2.2.2         120         0x80000001 0x000B10
192.168.20.0    2.2.2.2         990         0x80000001 0x00238A
R1#


R2#show ip route
Gateway of last resort is not set

     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     4.0.0.0/32 is subnetted, 3 subnets
O       4.4.5.1 [110/11] via 192.168.20.2, 00:02:49, FastEthernet0/1
O       4.4.4.1 [110/11] via 192.168.20.2, 00:02:49, FastEthernet0/1
O       4.4.6.1 [110/11] via 192.168.20.2, 00:02:49, FastEthernet0/1

C    192.168.10.0/24 is directly connected, FastEthernet0/0
C    192.168.20.0/24 is directly connected, FastEthernet0/1
R2#show ip ospf database

            OSPF Router with ID (2.2.2.2) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         1047        0x80000001 0x00A96F 1

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
4.4.4.1         2.2.2.2         172         0x80000001 0x0021FB
4.4.5.1         2.2.2.2         172         0x80000001 0x001606
4.4.6.1         2.2.2.2         172         0x80000001 0x000B10
192.168.10.0    2.2.2.2         1043        0x80000001 0x003789
192.168.20.0    2.2.2.2         1043        0x80000001 0x00238A

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         959         0x80000003 0x0055E9 1
2.2.2.2         2.2.2.2         967         0x80000005 0x00161D 1

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.10.2    2.2.2.2         967         0x80000001 0x00A50B

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
2.2.2.2         2.2.2.2         1044        0x80000001 0x00FA31
4.4.4.1         2.2.2.2         174         0x80000001 0x0021FB
4.4.5.1         2.2.2.2         174         0x80000001 0x001606
4.4.6.1         2.2.2.2         174         0x80000001 0x000B10
192.168.20.0    2.2.2.2         1044        0x80000001 0x00238A

                Router Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         947         0x80000002 0x008397 1
3.3.3.3         3.3.3.3         750         0x80000004 0x00D4E7 4

                Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.20.1    2.2.2.2         947         0x80000001 0x00A5F9

                Summary Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
2.2.2.2         2.2.2.2         1044        0x80000001 0x00FA31
192.168.10.0    2.2.2.2         1045        0x80000001 0x003789
R2#

Configuring the summarization: You always configure internal ospf summarization on the ABR toward the direction of area 0.

R2(config)#router ospf 1
R2(config-router)#area 2 range 4.0.0.0 255.0.0.0


Debug output from R1(Debug ip ospf flood) - R1 received and LSU from R2 and it indicates that 4.4.4.1, 4.4.5.1 and 4.4.6.1 have been max aged to 3600(Seconds) and should be removed from the LSDB.  It also indicated that 4.0.0.0/8 should be added to the LSDB with a new age of 1(seconds).  Once the LSDB processes this data, an LSACK is sent back confirming it has received the updates.

 R1#
*Mar  1 00:24:05.391: OSPF: received update from 2.2.2.2, FastEthernet0/0
*Mar  1 00:24:05.391: OSPF: Rcv Update Type 3, LSID 4.0.0.0, Adv rtr 2.2.2.2, age 1, seq 0x80000001
*Mar  1 00:24:05.395:       Mask /8
*Mar  1 00:24:05.423: OSPF: received update from 2.2.2.2, FastEthernet0/0
*Mar  1 00:24:05.423: OSPF: Rcv Update Type 3, LSID 4.4.6.1, Adv rtr 2.2.2.2, age 3600, seq 0x80000002
*Mar  1 00:24:05.427:       Mask /32
*Mar  1 00:24:05.427: OSPF: Rcv Update Type 3, LSID 4.4.5.1, Adv rtr 2.2.2.2, age 3600, seq 0x80000002
*Mar  1 00:24:05.427:       Mask /32
*Mar  1 00:24:05.427: OSPF: Rcv Update Type 3, LSID 4.4.4.1, Adv rtr 2.2.2.2, age 3600, seq 0x80000002
R1#
*Mar  1 00:24:05.431:       Mask /32
R1#
*Mar  1 00:24:07.895: OSPF: Sending delayed ACK on FastEthernet0/0
*Mar  1 00:24:07.895: OSPF: Ack Type 3, LSID 4.0.0.0, Adv rtr 2.2.2.2, age 1, seq 0x80000001
*Mar  1 00:24:07.895: OSPF: Ack Type 3, LSID 4.4.6.1, Adv rtr 2.2.2.2, age 3600, seq 0x80000002
*Mar  1 00:24:07.895: OSPF: Ack Type 3, LSID 4.4.5.1, Adv rtr 2.2.2.2, age 3600, seq 0x80000002
*Mar  1 00:24:07.899: OSPF: Ack Type 3, LSID 4.4.4.1, Adv rtr 2.2.2.2, age 3600, seq 0x80000002
R1#


Post-Configuration on R1 and R2:

R1#show ip route


Gateway of last resort is not set

     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/2] via 192.168.10.2, 00:21:05, FastEthernet0/0
O IA 4.0.0.0/8 [110/12] via 192.168.10.2, 00:03:00, FastEthernet0/0
C    192.168.10.0/24 is directly connected, FastEthernet0/0
O IA 192.168.20.0/24 [110/11] via 192.168.10.2, 00:21:05, FastEthernet0/0
R1#

R1#show ip ospf database

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         1281        0x80000003 0x0055E9 1
2.2.2.2         2.2.2.2         1291        0x80000005 0x00161D 1

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.10.2    2.2.2.2         1291        0x80000001 0x00A50B

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
2.2.2.2         2.2.2.2         1366        0x80000001 0x00FA31
4.0.0.0         2.2.2.2         201         0x80000001 0x00879E
192.168.20.0    2.2.2.2         1366        0x80000001 0x00238A
R1#

I will throw in some additional information how the routing table determined a Metric of 12 to get to 4.0.0.0/8. If you look at the summary for 4.0.0.0 from R2 perspective,(show ip ospf database summary 4.0.0.0) you will see it has a cost(metric) of 11. This is the view again from R2 perspective when it ran its SPF algorithm. This is only 11, now how do we get that extra 1 in the metric? Keep in mind that R1 has a type1(Router LSA) to reach R2 and it has a metric of 1. We can verify this by issueing(show ip ospf database router 2.2.2.2).

R1#show ip ospf database summary 4.0.0.0

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Summary Net Link States (Area 1)

  Routing Bit Set on this LSA
  LS age: 271
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 4.0.0.0 (summary Network Number)
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000001
  Checksum: 0x879E
  Length: 28
  Network Mask: /8
        TOS: 0  Metric: 11

R1#

R1#show ip ospf database router 2.2.2.2

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 1)

  Routing Bit Set on this LSA
  LS age: 1555
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 2.2.2.2
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000005
  Checksum: 0x161D
  Length: 36
  Area Border Router
  Number of Links: 1

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 192.168.10.2
     (Link Data) Router Interface address: 192.168.10.2
      Number of TOS metrics: 0
       TOS 0 Metrics: 1

Back to the summarization, we can see that R1 now has only one entry for the 4.x.x.x network. We can now add more loopbacks(Networks) on R3 and we will still continue to see just the summary route. This greates stability in the network as its less overhead on the R1 when new networks that fall into the range are added.  On R2 we can see that a discard route has also been added and this is to prevent uneccasry traffice from flowing into area 2 as the router will drop packets if it does not have a specific match.


R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     4.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O       4.4.5.1/32 [110/11] via 192.168.20.2, 00:14:08, FastEthernet0/1
O       4.0.0.0/8 is a summary, 00:14:08, Null0
O       4.4.4.1/32 [110/11] via 192.168.20.2, 00:14:08, FastEthernet0/1
O       4.4.6.1/32 [110/11] via 192.168.20.2, 00:14:08, FastEthernet0/1
C    192.168.10.0/24 is directly connected, FastEthernet0/0
C    192.168.20.0/24 is directly connected, FastEthernet0/1

R2#show ip ospf database

            OSPF Router with ID (2.2.2.2) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         182         0x80000002 0x00A770 1

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
4.0.0.0         2.2.2.2         852         0x80000001 0x00879E
192.168.10.0    2.2.2.2         182         0x80000002 0x00358A
192.168.20.0    2.2.2.2         182         0x80000002 0x00218B

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         1934        0x80000003 0x0055E9 1
2.2.2.2         2.2.2.2         1942        0x80000005 0x00161D 1

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.10.2    2.2.2.2         1942        0x80000001 0x00A50B

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
2.2.2.2         2.2.2.2         182         0x80000002 0x00F832
4.0.0.0         2.2.2.2         854         0x80000001 0x00879E
192.168.20.0    2.2.2.2         184         0x80000002 0x00218B

                Router Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         1923        0x80000002 0x008397 1
3.3.3.3         3.3.3.3         1725        0x80000004 0x00D4E7 4

                Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.20.1    2.2.2.2         1923        0x80000001 0x00A5F9

                Summary Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
2.2.2.2         2.2.2.2         184         0x80000002 0x00F832
192.168.10.0    2.2.2.2         184         0x80000002 0x00358A
R2#












No comments:

Post a Comment