Pages

Showing posts with label Stub. Show all posts
Showing posts with label Stub. Show all posts

Thursday, May 6, 2010

OSPF Route, Router and LSA type


we still use same network setup from the previous lab but with a little modification

remove area 50 and virtual link, advertise 50.50.50.x into area 20

R2

R2(config)#router os 1
R2(config-router)#no area 20 virtual-link 10.10.20.6

R6
R6(config)#router os 1
R6(config-router)#no area 20 virtual-link 172.16.2.1
R6(config-router)#no network 50.50.50.0 0.0.0.255 area 50
R6(config-router)#network 50.50.50.0 0.0.0.255 area 20

change area 20 to Stub area

R2
R2(config-router)#area 20 stub

R6
R6(config-router)#area 20 stub


3 Route type - O, O IA, O E1/E2


  • O - route to a destination where the area is connected to it

R2 is connected to area 20(in yellow), area 0(in green)

show ip route
     200.200.20.0/32 is subnetted, 1 subnets
O       200.200.20.1 [110/2] via 10.10.20.6, 00:03:56, FastEthernet0/0
     50.0.0.0/32 is subnetted, 1 subnets
O       50.50.50.1 [110/2] via 10.10.20.6, 00:03:56, FastEthernet0/0
     21.0.0.0/24 is subnetted, 1 subnets
O E2    21.21.21.0 [110/20] via 172.16.2.2, 00:03:56, Serial0/0
     172.16.0.0/30 is subnetted, 3 subnets
O       172.16.1.0 [110/128] via 172.16.2.2, 00:04:43, Serial0/0
C       172.16.2.0 is directly connected, Serial0/0
O       172.16.3.0 [110/128] via 172.16.2.2, 00:04:43, Serial0/0
     22.0.0.0/24 is subnetted, 1 subnets
O E2    22.22.22.0 [110/20] via 172.16.2.2, 00:03:56, Serial0/0
     10.0.0.0/24 is subnetted, 2 subnets
C       10.10.20.0 is directly connected, FastEthernet0/0
O IA    10.40.1.0 [110/129] via 172.16.2.2, 00:03:57, Serial0/0
     11.0.0.0/32 is subnetted, 1 subnets
O IA    11.11.11.1 [110/130] via 172.16.2.2, 00:03:57, Serial0/0
     12.0.0.0/32 is subnetted, 1 subnets
O IA    12.12.12.1 [110/130] via 172.16.2.2, 00:03:57, Serial0/0
O E2 192.168.1.0/24 [110/20] via 172.16.2.2, 00:03:57, Serial0/0




  • O IA - route to a destination in another OSPF area

from R2, area 40 suppose to be 'another area' for it, so, all the route to this destination should start with O IA

show ip route
     200.200.20.0/32 is subnetted, 1 subnets
O       200.200.20.1 [110/2] via 10.10.20.6, 00:03:56, FastEthernet0/0
     50.0.0.0/32 is subnetted, 1 subnets
O       50.50.50.1 [110/2] via 10.10.20.6, 00:03:56, FastEthernet0/0
     21.0.0.0/24 is subnetted, 1 subnets
O E2    21.21.21.0 [110/20] via 172.16.2.2, 00:03:56, Serial0/0
     172.16.0.0/30 is subnetted, 3 subnets
O       172.16.1.0 [110/128] via 172.16.2.2, 00:04:43, Serial0/0
C       172.16.2.0 is directly connected, Serial0/0
O       172.16.3.0 [110/128] via 172.16.2.2, 00:04:43, Serial0/0
     22.0.0.0/24 is subnetted, 1 subnets
O E2    22.22.22.0 [110/20] via 172.16.2.2, 00:03:56, Serial0/0
     10.0.0.0/24 is subnetted, 2 subnets
C       10.10.20.0 is directly connected, FastEthernet0/0
O IA    10.40.1.0 [110/129] via 172.16.2.2, 00:03:57, Serial0/0
     11.0.0.0/32 is subnetted, 1 subnets
O IA    11.11.11.1 [110/130] via 172.16.2.2, 00:03:57, Serial0/0
     12.0.0.0/32 is subnetted, 1 subnets
O IA    12.12.12.1 [110/130] via 172.16.2.2, 00:03:57, Serial0/0
O E2 192.168.1.0/24 [110/20] via 172.16.2.2, 00:03:57, Serial0/0



  • O E2/E1 - External route that learned from redistribution

in this case all route that learned from RIP

show ip route
     200.200.20.0/32 is subnetted, 1 subnets
O       200.200.20.1 [110/2] via 10.10.20.6, 00:03:56, FastEthernet0/0
     50.0.0.0/32 is subnetted, 1 subnets
O       50.50.50.1 [110/2] via 10.10.20.6, 00:03:56, FastEthernet0/0
     21.0.0.0/24 is subnetted, 1 subnets
O E2    21.21.21.0 [110/20] via 172.16.2.2, 00:03:56, Serial0/0
     172.16.0.0/30 is subnetted, 3 subnets
O       172.16.1.0 [110/128] via 172.16.2.2, 00:04:43, Serial0/0
C       172.16.2.0 is directly connected, Serial0/0
O       172.16.3.0 [110/128] via 172.16.2.2, 00:04:43, Serial0/0
     22.0.0.0/24 is subnetted, 1 subnets
O E2    22.22.22.0 [110/20] via 172.16.2.2, 00:03:56, Serial0/0
     10.0.0.0/24 is subnetted, 2 subnets
C       10.10.20.0 is directly connected, FastEthernet0/0
O IA    10.40.1.0 [110/129] via 172.16.2.2, 00:03:57, Serial0/0
     11.0.0.0/32 is subnetted, 1 subnets
O IA    11.11.11.1 [110/130] via 172.16.2.2, 00:03:57, Serial0/0
     12.0.0.0/32 is subnetted, 1 subnets
O IA    12.12.12.1 [110/130] via 172.16.2.2, 00:03:57, Serial0/0
O E2 192.168.1.0/24 [110/20] via 172.16.2.2, 00:03:57, Serial0/0


4 Router type - Internal, Backbone, ABR and ASBR

show ip ospf can show all the information regarding to router type


  • Internal - All interface in single area ; R0
check how many area it has
R0>sh ip os
 Routing Process "ospf 1" with ID 172.16.3.2
 ...
 Number of areas in this router is 1. 1 normal 0 stub 0 nssa
 External flood list length 0
    Area BACKBONE(0)
        Number of interfaces in this area is 3
        Area has no authentication
        SPF algorithm last executed 00:43:05.116 ago
..
        Number of DoNotAge LSA 4
        Flood list length 0



  • Backbone - at least one interface in area 0 ; R0, R1, R2 and R3
R1>sh ip os
 Routing Process "ospf 1" with ID 172.16.1.1
 Supports only single TOS(TOS0) routes
 ..
 External flood list length 0
    Area BACKBONE(0)
        Number of interfaces in this area is 1
        Area has no authentication
  ..
        Number of DoNotAge LSA 4
        Flood list length 0
    Area 40
        Number of interfaces in this area is 0
        It is a stub area
..
        Flood list length 0



  • ABR - at least one interface in area 0, other interface interface in another area
 - all ABR are Backbone ; R1, R2 and R3
 - Backbone may be ABR, may not (where all interface in area 0); R0 is no ABR only because all int in area 0
R2>sh ip os
 Routing Process "ospf 1" with ID 172.16.2.1
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Supports Link-local Signaling (LLS)
 It is an area border router
..



  • ASBR - where OSPF meet other routing protocol and perform route redistribution ; R1
R1>sh ip os
 Routing Process "ospf 1" with ID 172.16.1.1
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Supports Link-local Signaling (LLS)
 It is an autonomous system boundary router
 Redistributing External Routes from,
    rip, includes subnets in redistribution
 Initial SPF schedule delay 5000 msecs
..


LSA type

use show ip ospf database


  • LSA type 1 – Router LSAs are sent from a router to other routers in the same area. It contains information regarding the routers interfaces in the same area, relevant interfaces IPs, its adjacent routers on those interfaces and sub networks. 

In this case, R2 have 2 area

R2>sh ip os da

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

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
172.16.1.1      172.16.1.1      1456        0x8000003C 0x00248A 2
172.16.2.1      172.16.2.1      1723        0x80000040 0x00297E 2
172.16.3.1      172.16.3.1      7           0x8000003B 0x004365 2
172.16.3.2      172.16.3.2      1756        0x80000042 0x003DB0 6

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
...
200.200.20.1    172.16.2.1      1461        0x80000002 0x007261

                Router Link States (Area 20)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.10.20.6      10.10.20.6      1568        0x80000047 0x0018C2 3
172.16.2.1      172.16.2.1      1063        0x8000003F 0x009390 1

                Net Link States (Area 20)

Link ID         ADV Router      Age         Seq#       Checksum
..



  • LSA type 2 – Network LSAs are generated by the DR(on a broadcast network) on a multi access segment, and provides similar information to an LSA type 1 for the multi access segment and subnet which it belongs

in this broadcast 10.40.1.x only have 2 router, so R3 only show the other one on the database

R3>sh ip os da

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

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
172.16.1.1      172.16.1.1      1920        0x8000003C 0x00248A 2
..
172.16.3.1      172.16.3.1      232         0x80000040 0x0036D4 1

                Net Link States (Area 40)

Link ID         ADV Router      Age         Seq#       Checksum
10.40.1.1       172.16.3.1      232         0x8000003B 0x00F91D

                Summary Net Link States (Area 40)

Link ID         ADV Router      Age         Seq#       Checksum
0...


  • LSA type 3 – Network Summary LSAs are generated by ABRs and contain the subnets & costs but omit the topological data from all subnets in one area and sent to another area via the ABR

R3>sh ip os da

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

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
172.16.1.1      172.16.1.1      261         0x8000003D 0x00228B 2
172.16.2.1      172.16.2.1      496         0x80000041 0x00277F 2
172.16.3.1      172.16.3.1      821         0x8000003B 0x004365 2
172.16.3.2      172.16.3.2      581         0x80000043 0x003BB1 6

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.20.0      172.16.2.1      243         0x80000046 0x008A84
10.40.1.0       172.16.3.1      575         0x80000046 0x00EB17
11.11.11.1      172.16.3.1      575         0x8000002B 0x00042A
12.12.12.1      172.16.3.1      575         0x8000002B 0x00DF4B
50.50.50.1      172.16.2.1      243         0x80000003 0x00D908
200.200.20.1    172.16.2.1      243         0x80000003 0x007062

                Router Link States (Area 40)

..



  • LSA type 4 -ASBR summary LSAs are from ASBRs and are identical in structure to a type 3 LSA and sent when crossing an AS boundary

somehow I can't show this information, still can't figure out where's the trick, but it should start with 'summary ASB link states'



  • LSA type 5 -Are AS external LSAs which are originated by ASBRs and describe external networks

notice that the link ID are the one that learned from RIP


R2>sh ip os da

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

...
                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
21.21.21.0      172.16.1.1      1616        0x8000003A 0x00DE8A 0
22.22.22.0      172.16.1.1      1621        0x8000003A 0x00BAAB 0
192.168.1.0     172.16.1.1      1621        0x8000003A 0x001925 0

and you not gonna see this type on Stub and Totally Stubby area, try 'show ip ospf database' on R5 and R6


for type 6 and type 7, i can't show in this network setup yet... will continue soon ;)


Wednesday, May 5, 2010

OSPF Stub and Totally Stubby - GNS3

R0-------------------------------------------------------------------------------------------------


interface Serial0/1
 ip address 172.16.1.2 255.255.255.252
 clock rate 64000
!
interface Serial0/2
 ip address 172.16.2.2 255.255.255.252
 clock rate 64000
!
interface Serial0/3
 ip address 172.16.3.2 255.255.255.252
 clock rate 64000
!
router ospf 1
 log-adjacency-changes
 network 172.16.1.0 0.0.0.3 area 0
 network 172.16.2.0 0.0.0.3 area 0
 network 172.16.3.0 0.0.0.3 area 0


R1-------------------------------------------------------------------------------------------------


interface FastEthernet0/0
 ip address 192.168.1.1 255.255.255.0
 duplex auto
 speed auto




interface Serial0/0
 ip address 172.16.1.1 255.255.255.252
!
router ospf 1
 log-adjacency-changes
 redistribute rip subnets
 network 172.16.1.0 0.0.0.3 area 0
!
router rip
 version 2
 redistribute ospf 1 metric 1
 network 192.168.1.0
 no auto-summary


R2-------------------------------------------------------------------------------------------------


interface FastEthernet0/0
 ip address 10.10.20.1 255.255.255.0
 duplex auto
 speed auto
!
interface Serial0/0
 ip address 172.16.2.1 255.255.255.252
!
router ospf 1
 log-adjacency-changes
 area 20 virtual-link 10.10.20.6
 network 10.10.20.0 0.0.0.255 area 20
 network 172.16.2.0 0.0.0.3 area 0


R3-------------------------------------------------------------------------------------------------


interface FastEthernet0/0
 ip address 10.40.1.1 255.255.255.0
 duplex auto
 speed auto
!
interface Serial0/0
 ip address 172.16.3.1 255.255.255.252
!
router ospf 1
 log-adjacency-changes
 area 40 stub
 network 10.40.1.0 0.0.0.255 area 40
 network 172.16.3.0 0.0.0.3 area 0


R4-------------------------------------------------------------------------------------------------


interface Loopback21
 ip address 21.21.21.1 255.255.255.0
!
interface Loopback22
 ip address 22.22.22.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 192.168.1.2 255.255.255.0
 duplex auto
 speed auto


router rip
 version 2
 network 21.0.0.0
 network 22.0.0.0
 network 192.168.1.0
 no auto-summary


R5-------------------------------------------------------------------------------------------------


interface Loopback11
 ip address 11.11.11.1 255.255.255.0
!
interface Loopback12
 ip address 12.12.12.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 10.40.1.2 255.255.255.0
 duplex auto
 speed auto
!
router ospf 1
 log-adjacency-changes
 area 40 stub
 network 10.40.1.0 0.0.0.255 area 40
 network 11.11.11.0 0.0.0.255 area 40
 network 12.12.12.0 0.0.0.255 area 40


R6-------------------------------------------------------------------------------------------------


interface Loopback50
 ip address 50.50.50.1 255.255.255.0
!
interface Loopback200
 ip address 200.200.20.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 10.10.20.6 255.255.255.0
 duplex auto
 speed auto
!
router ospf 1
 log-adjacency-changes
 area 20 virtual-link 172.16.2.1
 network 10.10.20.0 0.0.0.255 area 20
 network 50.50.50.0 0.0.0.255 area 50
 network 200.200.20.0 0.0.0.255 area 20


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

This lab is focus on Stub and Totally Stubby configuration, you can check the detail on Virtual-Link and Redistribution on previous lab

as you can see, we configure area 40 to be the stub area, ok now let's remove those two line first to see the different

on R3 and R5


R3(config)#router os 1
R3(config-router)#no area 40 stub

R5(config)#router ospf 1
R5(config-router)#no area 40 stub

after you remove the Stub area on one of this site, the neighbor will down because one site is configured as Stub and the other is normal area

*Mar  1 08:13:41.341: %OSPF-5-ADJCHG: Process 1, Nbr 10.40.1.2 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Adjacency forced to reset

after you remove it on both, then both neighbor are form again

*Mar  1 08:15:17.629: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.3.1 on FastEthernet0/0 from LOADING to FULL, Loading Done

now check the routing table on R5

R5#sh 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

     200.200.20.0/32 is subnetted, 1 subnets
O IA    200.200.20.1 [110/131] via 10.40.1.1, 00:07:26, FastEthernet0/0
     50.0.0.0/32 is subnetted, 1 subnets
O IA    50.50.50.1 [110/131] via 10.40.1.1, 00:07:26, FastEthernet0/0
     21.0.0.0/24 is subnetted, 1 subnets
O E2    21.21.21.0 [110/20] via 10.40.1.1, 00:07:26, FastEthernet0/0
     172.16.0.0/30 is subnetted, 3 subnets
O IA    172.16.1.0 [110/129] via 10.40.1.1, 00:07:26, FastEthernet0/0
O IA    172.16.2.0 [110/129] via 10.40.1.1, 00:07:26, FastEthernet0/0
O IA    172.16.3.0 [110/65] via 10.40.1.1, 00:07:26, FastEthernet0/0
     22.0.0.0/24 is subnetted, 1 subnets
O E2    22.22.22.0 [110/20] via 10.40.1.1, 00:07:26, FastEthernet0/0
     10.0.0.0/24 is subnetted, 2 subnets
O IA    10.10.20.0 [110/130] via 10.40.1.1, 00:07:28, FastEthernet0/0
C       10.40.1.0 is directly connected, FastEthernet0/0
     11.0.0.0/24 is subnetted, 1 subnets
C       11.11.11.0 is directly connected, Loopback11
     12.0.0.0/24 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, Loopback12
O E2 192.168.1.0/24 [110/20] via 10.40.1.1, 00:07:28, FastEthernet0/0

as you can see, there are many type of route inside ( E2, IA.. etc) which mean all the route are being send to this area, but there are no more network beyond this router and do you think it is necessary for this router to have a full routing table and process everything ? after all they only have one gateway to outside. 

so this is the situation where Stub configuration become useful, we not just reduce the routing table size, also we can reduce the using of Router resources

just apply back everything that you remove a while ago.. then check the routing table again

     200.200.20.0/32 is subnetted, 1 subnets
O IA    200.200.20.1 [110/131] via 10.40.1.1, 00:01:41, FastEthernet0/0
     50.0.0.0/32 is subnetted, 1 subnets
O IA    50.50.50.1 [110/131] via 10.40.1.1, 00:01:41, FastEthernet0/0
     172.16.0.0/30 is subnetted, 3 subnets
O IA    172.16.1.0 [110/129] via 10.40.1.1, 00:01:41, FastEthernet0/0
O IA    172.16.2.0 [110/129] via 10.40.1.1, 00:01:41, FastEthernet0/0
O IA    172.16.3.0 [110/65] via 10.40.1.1, 00:01:41, FastEthernet0/0
     10.0.0.0/24 is subnetted, 2 subnets
O IA    10.10.20.0 [110/130] via 10.40.1.1, 00:01:41, FastEthernet0/0
C       10.40.1.0 is directly connected, FastEthernet0/0
     11.0.0.0/24 is subnetted, 1 subnets
C       11.11.11.0 is directly connected, Loopback11
     12.0.0.0/24 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, Loopback12
O*IA 0.0.0.0/0 [110/2] via 10.40.1.1, 00:01:42, FastEthernet0/0

notice that route type E2 no more in the routing table (in this case the route distribute from RIP), instead the route is replaced by default route (in yellow)

to know the theory and detail on type of route that not advertised into Stub and Totally Stub you can google for "OSPF LSA type"

now let's configure this area to be a Totally Stubby area, just replace the previous line with this new line on R3 and R5

R3(config)#router os 1
R3(config-router)#area 40 stub no-summary

R5(config)#router os 1
R5(config-router)#area 40 stub no-summary

check the routing table on R5

     10.0.0.0/24 is subnetted, 1 subnets
C       10.40.1.0 is directly connected, FastEthernet0/0
     11.0.0.0/24 is subnetted, 1 subnets
C       11.11.11.0 is directly connected, Loopback11
     12.0.0.0/24 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, Loopback12
O*IA 0.0.0.0/0 [110/2] via 10.40.1.1, 00:00:40, FastEthernet0/0

in Totally Stub area, all type of route are not advertised to him and it's only have one gateway to outside world, 

so it depend on your network topology when you want to use Stub or Totally Stubby configuration

I'll try to go more detail on LSA type on next lab.. Happy routing ;)

there'll be a big game later,  the race for fourth place! Manchester City face Tottenham in a must-win clash for both clubs' Champions League hopes