Sunday, May 4, 2014

OSPF Summarization

Lessons Learned:

OSPF Summarization

All devices within the same area must have the same LSDB
Implies summarization can occur.
-Between Areas
---#area (Source Area) range (address) (mask)
During redistribution
---#summary-address (Address) (mask)

Automatically generates discard route
-disabled with # no discard route (internal | external )

Can be used for TE via longest match routing 

--------------------------------------------------------------------------------

Since OSPF is a link state protocol – all routers within the same are have to have the same link state DB.

For summarization there are two different types
Inter-area summary – for summary of LSA type 3 which is the network summary LSA
This is implemented with the area-range command on the area border router.
Summary routes as they go into Area 0 or into another non-transit area.

External Summary – redistribution at the ASBR with the summary-address command.
Note: in a Not so stubby area – the ABR can summarize type 7 information as it is being generated as type 5. This technically counts as a redistribution form the type 7 LSA into the type 5 LSA.
Technical there’s only two places you can do this - On the ASBR – with the “summary-address command”  or ABR – with the “area range: command .

Regardless of what type of summary we generate - Just like EIGRP or BGP.
The process will automatically generate the discard route. the discard route is the match for the summary that is pointing to Null 0. 
Note: The idea behind the discard route is that if we lose one of the subnets that makeup the summary and we receive packets that are going to one of those destinations, we’re going to drop them locally instead of forwarding them on to a shorter match, like a default route.

This would then mean if we did want to use default routing for subnets that are inside one of our summaries, we would have to remove the Null route with the
# no discard route (internal | external ) command  - under the OSPF process.

Summarization can also be used for Traffic Engineering based on the longest match principal.
Regardless of what the distance is or the metric is to a particular destination, the router will always choose the path that has the most BITs in common with the destination. – the longest match.

This means if we we’re to summarize the destination on multiple ABR’s or ASBR’s – whichever one is advertising the longer match would be the one that is preferred for the destinations.


Traffic engineering –

Topology:
============

















Router 4 has a local route of 4.4.4.0 –
From the database on R3 you can see that I have two paths to that route – over R2 and R1.

R3#sh ip ospf database summary 4.4.4.0

            OSPF Router with ID (3.3.3.3) (Process ID 10)

                Summary Net Link States (Area 0)

  Routing Bit Set on this LSA
  LS age: 312
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 4.4.4.0 (summary Network Number)
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000002
  Checksum: 0xEC3D
  Length: 28
  Network Mask: /24
        TOS: 0  Metric: 2

  Routing Bit Set on this LSA
  LS age: 283
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 4.4.4.0 (summary Network Number)
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000002
  Checksum: 0xCE57
  Length: 28
  Network Mask: /24
        TOS: 0  Metric: 2


            OSPF Router with ID (30.30.30.3) (Process ID 50)
R3#

We can also see most of – if not all – the traffic is currenlt ygoing over R2’s FastEthernet0/1 interface.

R3#sh ip route | i IA
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
O IA    2.2.2.0 [110/2] via 192.168.23.2, 00:44:28, FastEthernet0/1
O IA    4.4.4.0 [110/3] via 192.168.23.2, 00:44:28, FastEthernet0/1
O IA    4.4.5.0 [110/3] via 192.168.23.2, 00:00:53, FastEthernet0/1
O IA    4.4.7.0 [110/3] via 192.168.23.2, 00:00:43, FastEthernet0/1
O IA    20.20.20.0 [110/2] via 192.168.23.2, 00:44:28, FastEthernet0/1
O IA    10.1.14.0 [110/2] via 172.16.13.1, 00:44:28, FastEthernet0/0
O IA    10.1.24.0 [110/2] via 192.168.23.2, 00:44:28, FastEthernet0/1
O IA    11.11.11.0 [110/2] via 172.16.13.1, 00:44:28, FastEthernet0/0
R3#

I want to force all 4.4.5.4 traffic to go over R3. The rest to still go over R2.

Note: The problem with using an IGP, to implement traffic engineering is that we cannot make changes on a per prefix basis. In BGP this not true. In OSPF there’s no way to say match a certain prefix and change the cost. If we change th cost on the interface it will inherently change the cost for any route  that is using that interface.

Instead the next best path is to use the longest match for TE.

So on R2 can use a summary range for the summary address and then on R3 use a more specific longer match for the / 24 routes.

External Summarization:
This is going to be on a ASBR that is doing redistribution, when we’re generating either an External 1 or 2, or and N1 or N2 route. The N routes – are if we’re inside a not so stubby area.

Example:

From the topology – I have a redist router that is redist EIGRP into OSPF.

router ospf 10
 router-id 192.168.33.10
 log-adjacency-changes
 redistribute eigrp 10 subnets
 network 192.168.33.0 0.0.0.255 area 0

This now means that R3 will be generating a type 5 LSA or the External LSA describing the EIGRP subnets.

R3#sh ip route ospf
O E2    150.5.5.0 [110/20] via 192.168.33.10, 00:02:53, FastEthernet1/0
O E2    150.5.50.0 [110/20] via 192.168.33.10, 00:02:53, FastEthernet1/0
R3#

To verify the redistribution is actually working we can look at the # Sh ip ospf database, and look for Type 5 External routes. And we are.

This is the external LSA for the EIGRP destinations. These are either the E1 or E2 routers.

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
150.5.5.0       192.168.33.10   371         0x80000001 0x009ECC 0
150.5.50.0      192.168.33.10   371         0x80000001 0x00AD90 0

            OSPF Router with ID (30.30.30.3) (Process ID 50)         

You can read this like this:
192.168.33.10   is the origination router of the 150.5.x.x (eigrp routes) 150.5 .x.x are the xatual prefixes.

R3# sh ip ospf database external 150.5.5.0

            OSPF Router with ID (3.3.3.3) (Process ID 10)

                Type-5 AS External Link States

  Routing Bit Set on this LSA
  LS age: 604
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 150.5.5.0 (External Network Number )
  Advertising Router: 192.168.33.10 –Advertising router
  LS Seq Number: 80000001
  Checksum: 0x9ECC
  Length: 36
  Network Mask: /24
        Metric Type: 2 (Larger than any link state path) – Metric type is 2 – means an E2 route (bt default)
        TOS: 0
        Metric: 20  - Default metric for redistribution
        Forward Address: 0.0.0.0 – This mean that for anyone in my area that wants to route to this destination – thy should route the same path that they use to reach my router-ID (192.168.33.10)
        External Route Tag: 0

            OSPF Router with ID (30.30.30.3) (Process ID 50)
R3#

From Router 4 ‘s perspective

R4#sh ip route 150.5.5.0
Routing entry for 150.5.5.0/24
  Known via "ospf 10", distance 110, metric 20, type extern 2, forward metric 3 –Metric of 20, external route  - the forward metric is the Intra-area SPF cost that the local router is using the reach the ASBR
  Last update from 10.1.24.2 on FastEthernet0/0, 00:14:16 ago
  Routing Descriptor Blocks:
    10.1.24.2, from 192.168.33.10, 00:14:16 ago, via FastEthernet0/0
      Route metric is 20, traffic share count is 1
  * 10.1.14.1, from 192.168.33.10, 00:14:16 ago, via FastEthernet0/1 – learned from
      Route metric is 20, traffic share count is 1

Note: if I have two paths to the destination we would use the forward metric to look at what was the best path to the ASBR. The forward metric is the cost inside the local area.

The LSA 5 will basically go everywhere in the OSPF area.

Note: now that we have the Type 5 LSA- is we don’t have an entry in the local DB about the ASB for that prefix – we will use the LSA type 4 – This assumes that the SPT has reachability to the ABR for the external route and it will forward them to ABR (1.1.1.1 or 2.2.2.2) and assume they can reach the destination.

Type 4 LSA’s
               Summary ASB Link States (Area 10)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.33.10   1.1.1.1         1400        0x80000001 0x00EEB2
192.168.33.10   2.2.2.2         1400        0x80000001 0x00D0CC

Key – Is you want to apply Traffic Engineering the External destinations you do need to take into account the transit path along the way  - not just the redistribution metric. The only case that the redistribution metric will not matter, is if there are multiple ASBR’s originating the same route.

So – if I wanted to summarize the 150.5.x.x router to a /16 on the ABR is could simply add the sum address to the process on the ABR.

R3(config)#router ospf 10
R3(config-router)#summary-address 150.5.0.0 255.255.0.0

Then Sh ip route for Null – I should see the summary address is routed to Null0 and the summary command created the Null route.

REDIST-R1#sh ip route | i Null

O       150.5.0.0/16 is a summary, 00:00:09, Null0

No comments:

Post a Comment