Showing posts with label Route Reflector. Show all posts
Showing posts with label Route Reflector. Show all posts

Friday, 22 June 2012

MPLS: Inter–AS Option C : Route Reflector Issues

MPLS: Inter–AS Option C : Route Reflector Issues

This is in continuation from the previous post MPLS: Inter-AS VPNs: Option C: Multi-hop peering with remote PE

·         Sometimes there might be a situation, where the remote neighbor is peering with our RR, rather than the PE.

·         In such cases, let’s see what problems will arise???

·         Let’s assume P2 is RR for AS 200

·         Now, PE1 is peering with P2 instead of PE2.
·         So, I need to advertise P2’s loopback also into BGP so that PE1 can reach P2.

ASBR2(config)#router bgp 200
ASBR2(config-router)#network 3.3.3.3 mask 255.255.255.255
ASBR2(config-router)#

ASBR1(config)#do show run | i prefix-list PE2-LOOP
!
ip prefix-list PE2-LOOP seq 5 permit 4.4.4.4/32
!
ASBR1(config)#ip prefix-list PE2-LOOP seq 10 permit 3.3.3.3/32
ASBR1(config)#

PE1#show ip route 3.3.3.3
Routing entry for 3.3.3.3/32
  Known via "ospf 1", distance 110, metric 1
  Tag 200, type extern 2, forward metric 128
  Last update from 100.1.12.2 on Serial1/1, 00:01:52 ago
  Routing Descriptor Blocks:
  * 100.1.12.2, from 7.7.7.7, 00:01:52 ago, via Serial1/1
      Route metric is 1, traffic share count is 1
      Route tag 200

PE1#ping 3.3.3.3 source 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 76/112/152 ms
PE1#

P2(config-router)#do ping 1.1.1.1 source 3.3.3.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 3.3.3.3
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 92/128/156 ms
P2(config-router)#

Configuring EBGP VPN4 between PE1 and P2 (which is RR for AS 200):

PE1(config)#do show run | i neighbor
 bgp log-neighbor-changes
 neighbor 4.4.4.4 remote-as 200
 neighbor 4.4.4.4 ebgp-multihop 255
 neighbor 4.4.4.4 update-source Loopback0
  neighbor 4.4.4.4 activate
  neighbor 4.4.4.4 send-community extended
PE1(config)#router bgp 100
PE1(config-router)#no  neighbor 4.4.4.4 remote-as 200
PE1(config-router)#
*Jun 22 13:34:58.757: %BGP-5-ADJCHANGE: neighbor 4.4.4.4 Down Neighbor deleted
PE1(config-router)#neighbor 3.3.3.3 remote-as 200
PE1(config-router)#neighbor 3.3.3.3  ebgp-multihop 255
PE1(config-router)#neighbor 3.3.3.3 update-source Loopback0
PE1(config-router)#address vpnv4 uni
PE1(config-router-af)#neighbor 3.3.3.3 activate
PE1(config-router-af)#
PE1(config-router-af)#

P2(config-router-af)#do show run | begin router bgp 200
router bgp 200
 bgp router-id 3.3.3.3
 no bgp default ipv4-unicast
 no bgp default route-target filter
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 100
 neighbor 1.1.1.1 ebgp-multihop 255
 neighbor 1.1.1.1 update-source Loopback0
 neighbor 4.4.4.4 remote-as 200
 neighbor 4.4.4.4 update-source Loopback0
 !
 address-family vpnv4
  neighbor 1.1.1.1 activate
  neighbor 1.1.1.1 send-community extended
  neighbor 4.4.4.4 activate
  neighbor 4.4.4.4 send-community extended
 exit-address-family
!
PE2(config)#do show run | i neighbor
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 100
 neighbor 1.1.1.1 ebgp-multihop 255
 neighbor 1.1.1.1 update-source Loopback0
  neighbor 1.1.1.1 activate
  neighbor 1.1.1.1 send-community extended
PE2(config)#router bgp 200
PE2(config-router)#no neighbor 1.1.1.1 remote-as 100
PE2(config-router)#neighbor 3.3.3.3 remote-as 200
PE2(config-router)#neighbor 3.3.3.3 update-source loopback 0
PE2(config-router)#add vpnv4 uni
PE2(config-router-af)#neighbor 3.3.3.3 activate
PE2(config-router-af)#
PE2(config-router-af)#

PE1#show ip bgp vpnv4 all
BGP table version is 15, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 100:1 (default for vrf VPN_A)
*> 10.1.15.0/24     0.0.0.0                  0         32768 ?
*> 10.1.46.0/24     3.3.3.3                                0 200 ?
*> 11.11.11.11/32   10.1.15.5               65         32768 ?
*> 12.12.12.12/32   3.3.3.3                                0 200 ?
PE1#

P2(config-router)#do show ip bgp vpnv4 all
BGP table version is 5, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 100:1
*> 10.1.15.0/24     1.1.1.1                  0             0 100 ?
*>i10.1.46.0/24     4.4.4.4                  0    100      0 ?
*> 11.11.11.11/32   1.1.1.1                 65             0 100 ?
*>i12.12.12.12/32   4.4.4.4                 65    100      0 ?
P2(config-router)#

PE2#show ip bgp vpnv4 all
BGP table version is 15, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 100:1 (default for vrf VPN_A)
*>i10.1.15.0/24     1.1.1.1                  0    100      0 100 ?
*> 10.1.46.0/24     0.0.0.0                  0         32768 ?
*>i11.11.11.11/32   1.1.1.1                 65    100      0 100 ?
*> 12.12.12.12/32   10.1.46.6               65         32768 ?
PE2#

Observations:

·         In PE2, next-hop for the routes advertised by PE1, is PE1’s loopback 1.1.1.1 as Route-Reflector P2 didn’t change the next-hop address (EBGP à IBGP : next-hop will not be changed)

·         In PE1, next-hop for the routes advertised by PE2, is RR’s loopback 3.3.3.3 as P2 changes the next-hop while passing IBGP update to EBGP neighbor.

CE1#traceroute 12.12.12.12

Type escape sequence to abort.
Tracing the route to 12.12.12.12

  1 10.1.15.1 84 msec 12 msec 32 msec
  2 100.1.12.2 [MPLS: Labels 19/20 Exp 0] 212 msec 204 msec 236 msec
  3 100.1.27.7 [MPLS: Labels 21/20 Exp 0] 192 msec 228 msec 248 msec
  4 100.1.78.8 [MPLS: Labels 17/20 Exp 0] 252 msec 188 msec 184 msec
  5 100.1.38.3 [MPLS: Label 20 Exp 0] 188 msec 292 msec 236 msec
  6 10.1.46.4 [MPLS: Label 21 Exp 0] 156 msec 172 msec 136 msec
  7 10.1.46.6 268 msec *  244 msec
CE1#

Observation:

·         CE1 – PE1 – P1 – ASBR1 – ASBR2 – P2 – PE2 – CE2
·         This seems to be fine

·         But what If I have another path to reach PE2 from ASBR2 (Just the control information is received from the Route Reflector and the actual traffic need not go through Route Reflector)

Let me add one more link between ASBR2 – PE2

ASBR2 : Ser1/2 – ASBR2 : Ser1/2

PE2(config-if)#do show run int ser1/2
Building configuration...

Current configuration : 88 bytes
!
interface Serial1/2
 ip address 100.1.48.4 255.255.255.0
 serial restart-delay 0
end

PE2(config-if)#

ASBR2(config-if)#do show run int ser1/2
Building configuration...

Current configuration : 88 bytes
!
interface Serial1/2
 ip address 100.1.48.8 255.255.255.0
 serial restart-delay 0
end

ASBR2(config-if)#

ASBR2(config-if)#int ser1/0
ASBR2(config-if)#ip ospf cost 60000
ASBR2(config-if)#router ospf 1
ASBR2(config-router)#network 100.1.48.8 0.0.0.0 area 0
ASBR2(config-router)#

PE2(config-if)#router ospf 1
PE2(config-router)#net
PE2(config-router)#network 100.1.48.4 0.0.0.0 area 0
PE2(config-router)#

ASBR2(config-router)#do show ip route ospf
     100.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O       100.1.34.0/24 [110/128] via 100.1.48.4, 00:00:01, Serial1/2
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/129] via 100.1.48.4, 00:00:01, Serial1/2
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/65] via 100.1.48.4, 00:00:01, Serial1/2
ASBR2(config-router)#

·         Now, ASBR2 is going through PE2 to reach P2 (which is RR)

Let’s see the traceroute now


CE1#
CE1#traceroute 12.12.12.12

Type escape sequence to abort.
Tracing the route to 12.12.12.12

  1 10.1.15.1 72 msec 32 msec 28 msec
  2 100.1.12.2 [MPLS: Labels 19/20 Exp 0] 192 msec 200 msec 220 msec
  3 100.1.27.7 [MPLS: Labels 21/20 Exp 0] 188 msec 144 msec 200 msec
  4 100.1.78.8 [MPLS: Labels 17/20 Exp 0] 188 msec 244 msec 160 msec
  5 100.1.48.4 [MPLS: Labels 17/20 Exp 0] 184 msec 204 msec 220 msec
  6 100.1.34.3 [MPLS: Label 20 Exp 0] 244 msec 268 msec 192 msec
  7 10.1.46.4 [MPLS: Label 21 Exp 0] 188 msec 184 msec 172 msec
  8 10.1.46.6 204 msec *  268 msec
CE1#

Observations:

·         Traffic went through one unnecessary loop between PE2 – P2(RR)
·         Actually traffic should go to PE2, which is the original last-hop for 12.12.12.12/32, But RR has changed the next-hop to it-self while forwarding it to PE1.
·         That’s why PE1 is sending the data first to P2 (RR) and then RR is sending the data to PE2, which is the actual last-hop for 12.12.12.12/32

·         I have just one redundant connection, but think about multiple paths that can exist in the Service Provider Network.
·         If something goes wrong, troubleshooting would be a night mare!

·         Solution: change the settings on P2(RR), so that it won’t change the next-hop value while forwarding the update to PE1.

P2(config-router)#router bgp 200
P2(config-router)#address-family vpnv4 unicast
P2(config-router-af)#neighbor 1.1.1.1 next-hop-?
next-hop-self  next-hop-unchanged

P2(config-router-af)#neighbor 1.1.1.1 next-hop-unchanged
P2(config-router-af)#

PE1#show ip bgp vpnv4 all
BGP table version is 17, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 100:1 (default for vrf VPN_A)
*> 10.1.15.0/24     0.0.0.0                  0         32768 ?
*> 10.1.46.0/24     4.4.4.4                                0 200 ?
*> 11.11.11.11/32   10.1.15.5               65         32768 ?
*> 12.12.12.12/32   4.4.4.4                                0 200 ?
PE1#

CE1#traceroute 12.12.12.12

Type escape sequence to abort.
Tracing the route to 12.12.12.12

  1 10.1.15.1 68 msec 80 msec 0 msec
  2 100.1.12.2 [MPLS: Labels 18/21 Exp 0] 208 msec 168 msec 204 msec
  3 100.1.27.7 [MPLS: Labels 20/21 Exp 0] 156 msec 184 msec 200 msec
  4 100.1.78.8 [MPLS: Labels 18/21 Exp 0] 208 msec 220 msec 156 msec
  5 10.1.46.4 [MPLS: Label 21 Exp 0] 104 msec 200 msec 108 msec
  6 10.1.46.6 204 msec *  160 msec
CE1#

Observation:

·         Now, we observe that the extra looping is not happening and the traffic is directly going to the last-hop PE2.

·         Router Reflector need not come in the actual data path, it exist only in the control path.
·         It is very essential to remember the above mentioned point while designing the Route Reflector in any network.

Friday, 15 June 2012

BGP: Route Reflector

BGP: Route Reflector


R4-------iBGP-------R1------iBGP-------R2------eBGP-------R3

·         AS 100: R4, R1 and R2
·         AS200: R3

·         eBGP between R2 & R3
·         iBGP between R2 & R1
·         iBGP between R1 & R4
·         Advertised 3.3.3.3/32 in R3

Let me take a scenario without configuring Route Reflector and see what problems I get:

BGP Configuration:

R3#show run | begin router bgp
router bgp 200
 no synchronization
 bgp log-neighbor-changes
 network 3.3.3.3 mask 255.255.255.255
 neighbor 20.1.1.2 remote-as 100
 no auto-summary
!

R2#show run | begin router bgp
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 100
 neighbor 1.1.1.1 update-source Loopback0
 neighbor 1.1.1.1 next-hop-self
 neighbor 20.1.1.3 remote-as 200
 no auto-summary
!

R1#show run | begin router bgp
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 2.2.2.2 remote-as 100
 neighbor 2.2.2.2 update-source Loopback0
 neighbor 4.4.4.4 remote-as 100
 neighbor 4.4.4.4 update-source Loopback0
 no auto-summary
!

R4#show run | begin router bgp
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 100
 neighbor 1.1.1.1 update-source Loopback0
 no auto-summary
!

R3#show ip bgp sum
BGP router identifier 133.133.133.133, local AS number 200
BGP table version is 8, main routing table version 8
1 network entries using 117 bytes of memory
1 path entries using 52 bytes of memory
2/1 BGP path/bestpath attribute entries using 248 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 417 total bytes of memory
BGP activity 4/3 prefixes, 4/3 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
20.1.1.2        4   100     321     314        8    0    0 05:10:58        0
R3#

R2#show ip bgp sum
BGP router identifier 22.22.22.22, local AS number 100
BGP table version is 12, main routing table version 12
1 network entries using 117 bytes of memory
1 path entries using 52 bytes of memory
2/1 BGP path/bestpath attribute entries using 248 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 441 total bytes of memory
BGP activity 4/3 prefixes, 4/3 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4   100      21      20       12    0    0 00:15:49        0
20.1.1.3        4   200     315     322       12    0    0 05:11:18        1
R2#

R1#show ip bgp sum
BGP router identifier 111.111.111.111, local AS number 100
BGP table version is 10, main routing table version 10
1 network entries using 117 bytes of memory
1 path entries using 52 bytes of memory
2/1 BGP path/bestpath attribute entries using 248 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 441 total bytes of memory
BGP activity 4/3 prefixes, 4/3 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2.2.2.2         4   100      21      22       10    0    0 00:16:04        1
4.4.4.4         4   100      19      21       10    0    0 00:15:29        0
R1#

R4#show ip bgp sum
BGP router identifier 4.4.4.4, local AS number 100
BGP table version is 3, main routing table version 3

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4   100      21      19        3    0    0 00:15:46        0
R4#

R3#show ip bgp
BGP table version is 8, local router ID is 133.133.133.133
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 3.3.3.3/32       0.0.0.0                  0         32768 i
R3#

R2#show ip bgp
BGP table version is 12, local router ID is 22.22.22.22
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 3.3.3.3/32       20.1.1.3                 0             0 200 i
R2#

R1#show ip bgp
BGP table version is 10, local router ID is 111.111.111.111
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i3.3.3.3/32       2.2.2.2                  0    100      0 200 i
R1#

R4#show ip bgp

R4#
Observation:

·         R3 advertised 3.3.3.3/32 into BGP
·         R2 got it as an eBGP update from R3 and has it in its BGP table
·         R1 got it as an iBGP update from R2 and has it in its BGP table
·         R4 doesn’t have the prefix???

Let’s see the routes each router advertising:

R3#show ip bgp neighbor 20.1.1.2 advertised-routes
BGP table version is 8, local router ID is 133.133.133.133
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 3.3.3.3/32       0.0.0.0                  0         32768 i

Total number of prefixes 1
R3#


R2#show ip bgp neighbor 1.1.1.1 advertised-routes
BGP table version is 12, local router ID is 22.22.22.22
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 3.3.3.3/32       20.1.1.3                 0             0 200 i

Total number of prefixes 1
R2#

R1#show ip bgp neighbor 4.4.4.4 advertised-routes

Total number of prefixes 0
R1#

Observation:

·         R3 is sending an eBGP update to R2 about 3.3.3.3/32
·         R2 is sending an iBGP update to R1 about 3.3.3.3/32
·         But R1 is not advertising this route to R4???

·         Actually this is expected-behaviour.
·         As per the BGP RFC, any BGP Router cannot pass updates received from one iBGP neighbor to another iBGP neighbor.
·         This is what is called BGP-Split-Horizon Rule.

·         In our scenario, R1 can pass the update to R4 if it is acting as Route-Reflector for R4.

Route-Reflector:

·         Route Reflector is used to avoid the full-mesh requirement an iBGP.
·         Route Reflector can have clients, non-clients or eBGP neighbors
·         Route Reflector work on the following 3 rules:
1.  Route from a non-client peer: reflect to all the client peers with in the cluster.
2.  Route from a client peer: reflect to other clients and non-client peers.
3.  Route from an external BGP peer: reflect the update to all clients and non-client peers. 

Let’s configure R1 as the Route-Reflector for R4 and see what happens:

R1(config)#router bgp 100
R1(config-router)#neighbor 4.4.4.4 route-reflector-client
R1(config-router)#
*Jun 15 22:20:15.765: %BGP-5-ADJCHANGE: neighbor 4.4.4.4 Down RR client config change
R1(config-router)#
*Jun 15 22:20:17.897: %BGP-5-ADJCHANGE: neighbor 4.4.4.4 Up
R1(config-router)#

R1#show ip bgp neighbor 4.4.4.4 advertised-routes
BGP table version is 10, local router ID is 111.111.111.111
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i3.3.3.3/32       2.2.2.2                  0    100      0 200 i

Total number of prefixes 1
R1#

** R1 is sending the update to R4 now

R4#show ip bgp
BGP table version is 4, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i3.3.3.3/32       2.2.2.2                  0    100      0 200 i
R4#

** R4 got the update and its also the best route as Next-hop is reachable via IGP.

Lets see some more details on this newly learned route on R4:

R4#show ip bgp 3.3.3.3
BGP routing table entry for 3.3.3.3/32, version 4
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
  Not advertised to any peer
  200
    2.2.2.2 (metric 129) from 1.1.1.1 (111.111.111.111)
      Origin IGP, metric 0, localpref 100, valid, internal, best
      Originator: 22.22.22.22, Cluster list: 111.111.111.111
R4#

Observations:

·         Originator: The router who originated this route initially
·         R2 is the one who originated this route into AS100
·         22.22.22.22 is the BGP router-ID of R2

·         Cluster-list: list of the RRs this route has passed through
·         111.111.111.111 is the Route-ID of R1

·         These attributes are used to avoid loops inside an AS