Thursday, August 28, 2014

Lab 18 - Bestpath Selection - DMZ Link Bandwidth

    The BGP Best path selection algorithm for BGP looks at several path attributes and evaluates them in the following order of preference:

    1. Highest Weight
    2. Highest Local preference
    3. Locally originated
    4. Shortest AS_Path
    5. Origin; prefer IGP, before EGP, before Incomplete
    6. Lowest MED
    7. eBGP paths over iBGP paths
    8. Lowest IGP metric to the next hop
    9. For eBGP prefixes prefer first received route
    10. Lowest router ID
    11. Shortest cluster list length
    12. Lowest neighbor address

    The feature DMZ link bandwidth in BGP is similar in functionality to EIGRPs unequal load balancing in that it can instruct the routers data plane to load share across unequal paths based on the links bandwidth. Today's lab will focus on a simple implementation of this feature.

    Tasks:
    -Establish iBGP peering between routers R1, R2, and R5 in AS 100
    -Establish iBGP peering between routers R3 and R4 in AS 200
    -Establish iBGP peering between R1 and R2 in AS 100 with R3 and R4 in AS 200
    -Advertise the loopbacks of R3 and R4 into BGP and ensure that all paths are used
     when existing AS 100 toward AS 200
    -Configure BGP such that R1,R2, and R5 learn of the multiple paths toward the AS 200
    loopback addresses and use the bandwidth of each path to evaluate how to load
    balance traffic across the multiple paths.


    Topology



    GNS3 files: Link


    Solution:

    Let's begin by establishing our peering per the labs requirements. Remember to verify your peering is correct before moving on to the next step; sh ip bgp sum…

    R1(config)#router bgp 100
    R1(config-router)#address-family ipv4
    R1(config-router-af)#neighbor 146.1.0.2 remote-as 100
    R1(config-router-af)#neighbor 146.1.0.2 next-hop-self
    R1(config-router-af)#neighbor 146.1.0.5 remote-as 100
    R1(config-router-af)#neighbor 146.1.0.5 next-hop-self
    R1(config-router-af)#neighbor 192.168.13.3 remote-as 200
    R1(config-router-af)#neighbor 192.168.14.4 remote-as 200

    R2(config)#router bgp 100
    R2(config-router)#address-family ipv4
    R2(config-router-af)#neighbor 146.1.0.1 remote-as 100
    R2(config-router-af)#neighbor 146.1.0.1 next-hop-self
    R2(config-router-af)#neighbor 146.1.0.5 remote-as 100
    R2(config-router-af)#neighbor 146.1.0.5 next-hop-self
    R2(config-router-af)#neighbor 192.168.24.4 remote-as 200

    R3(config)#router bgp 200
    R3(config-router)#address-family ipv4
    R3(config-router-af)#neighbor 192.168.13.1 remote-as 100
    R3(config-router-af)#neighbor 192.168.34.4 remote-as 200

    R4(config-router)#address-family ipv4
    R4(config-router-af)#neighbor 192.168.14.1 remote-as 100
    R4(config-router-af)#neighbor 192.168.24.2 remote-as 100
    R4(config-router-af)#neighbor 192.168.34.3 remote-as 200

    R5(config)#router bgp 100
    R5(config-router)#address-family ipv4
    R5(config-router-af)# neighbor 146.1.0.1 remote-as 100
    R5(config-router-af)# neighbor 146.1.0.2 remote-as 100

    Next we advertise the loopbacks per the lab requirements.

    R3(config-router)#address-family ipv4
    R3(config-router-af)#network 3.3.3.3 mask 255.255.255.255

    R4(config-router)#address-family ipv4
    R4(config-router-af)#network 4.4.4.4 mask 255.255.255.255

    Let's verify the networks are being advertised into BGP

    R5#sh ip bgp
    <snip>
         Network          Next Hop            Metric LocPrf Weight Path
     *>i 3.3.3.3/32       146.1.0.1                0    100      0 200 i
     * i                  192.168.24.4             0    100      0 200 i
     *>i 4.4.4.4/32       146.1.0.1                0    100      0 200 i
     * i                  192.168.24.4             0    100      0 200 i

    The next and final requirement involves several steps. The task asks us to enable BGP multipath using the bandwidth of each path as the load evaluator to the advertised prefixes. In BGP this feature is called BGP Link bandwidth and is used to advertise the bandwidth of an autonomous system exit link as an extended community and is used in conjunction with BGP multipath configuration. You enable the BGP link bandwidth feature by configuring the dmzlink-bw option on the neighbor command for a directly connected neighbor. When this feature is enabled the bandwidth can be propagated via extended community advertisement to iBGP peers. This feature when enabled along with other BGP multipath features allows unequal bandwidth load balancing.

    R1(config-router)#address-family ipv4
    R1(config-router-af)#neighbor 146.1.0.2 send-community extended
    R1(config-router-af)#neighbor 146.1.0.5 send-community extended
    R1(config-router-af)#neighbor 192.168.13.3 dmzlink-bw
    R1(config-router-af)#neighbor 192.168.14.4 dmzlink-bw

    R2(config-router)#address-family ipv4
    R2(config-router-af)#neighbor 146.1.0.1 send-community extended
    R2(config-router-af)#neighbor 146.1.0.2 send-community extended
    R2(config-router-af)#neighbor 146.1.0.5 send-community extended
    R2(config-router-af)#neighbor 192.168.24.4 dmzlink-bw

    With these command enabled we see the bandwidth being added as an extended community attribute to each participating prefix but multipath is still not enabled.

    R1(config-router-af)#do sh ip bgp 3.3.3.3
    BGP routing table entry for 3.3.3.3/32, version 14
    Paths: (2 available, best #2, table default)
      Advertised to update-groups:
         4          5
      Refresh Epoch 1
      200
        192.168.14.4 from 192.168.14.4 (4.4.4.4)
          Origin IGP, localpref 100, valid, external
          DMZ-Link Bw 96 kbytes
          rx pathid: 0, tx pathid: 0
      Refresh Epoch 1
      200
        192.168.13.3 from 192.168.13.3 (3.3.3.3)
          Origin IGP, metric 0, localpref 100, valid, external, best
          DMZ-Link Bw 64 kbytes
          rx pathid: 0, tx pathid: 0x0


    R5(config-router)#do sh ip bgp 3.3.3.3
    BGP routing table entry for 3.3.3.3/32, version 18
    Paths: (1 available, best #1, table default)
      Not advertised to any peer
      Refresh Epoch 2
      200
        192.168.13.3 (metric 5512192) from 146.1.0.1 (192.168.14.1)
          Origin IGP, metric 0, localpref 100, valid, internal, best
          DMZ-Link Bw 64 kbytes
          rx pathid: 0, tx pathid: 0x0

    To enable multipath two more commands are required. First maximum-paths is needed to enable multipath and sets the maximum number of multiple paths the system will allow. Second is maximum-paths ibgp 4, this command defines how many iBGP routes can been  entered into the IP routing table.

    R1(config-router)#address-family ipv4
    R1(config-router-af)#maximum-paths 4
    R1(config-router-af)#maximum-paths ibgp 4
    R1(config-router-af)#bgp dmzlink-bw


    R2(config-router)#address-family ipv4
    R2(config-router-af)#maximum-paths 4
    R2(config-router-af)#maximum-paths ibgp 4
    R2(config-router-af)#bgp dmzlink-bw

    R5(config)#router bgp 100
    R5(config-router)#address-family ipv4
    R5(config-router-af)#maximum-paths ibgp 4
    R5(config-router-af)#bgp dmzlink-bw

    Now we should confirm BGP see the multiple paths and that they have been added to the IP routing table.

    R1#sh ip bgp 3.3.3.3
    BGP routing table entry for 3.3.3.3/32, version 2
    Paths: (2 available, best #2, table default)
    Multipath: eBGP iBGP
      Advertised to update-groups:
         6          7
      Refresh Epoch 1
      200
        192.168.14.4 from 192.168.14.4 (4.4.4.4)
          Origin IGP, localpref 100, valid, external, multipath(oldest)
          DMZ-Link Bw 96 kbytes
          rx pathid: 0, tx pathid: 0
      Refresh Epoch 1
      200
        192.168.13.3 from 192.168.13.3 (3.3.3.3)
          Origin IGP, metric 0, localpref 100, valid, external, multipath, best
          DMZ-Link Bw 64 kbytes
          rx pathid: 0, tx pathid: 0x0

    Shown below we see that the IP routing table does indeed see two routes to the 3.3.3.3/32 network and load sharing is being done.

    R1#sh ip route 3.3.3.3
    Routing entry for 3.3.3.3/32
      Known via "bgp 100", distance 20, metric 0
      Tag 200, type external
      Last update from 192.168.13.3 00:01:49 ago
      Routing Descriptor Blocks:
        192.168.14.4, from 192.168.14.4, 00:01:49 ago
          Route metric is 0, traffic share count is 8
          AS Hops 1
          Route tag 200
          MPLS label: none
      * 192.168.13.3, from 192.168.13.3, 00:01:49 ago
          Route metric is 0, traffic share count is 5
          AS Hops 1
          Route tag 200
          MPLS label: none

    This can be further verified by looking at the CEF table to confirm that traffic is indeed being load shared and what interfaces the packets being forwarded out. The output below shows that for every 8 packets being sent out s1/1, 5 packets are sent out s1/0.

    R1#sh ip cef 3.3.3.3 internal
    3.3.3.3/32, epoch 0, flags rib only nolabel, rib defined all labels, RIB[B], refcount 5, per-destination sharing
      sources: RIB
      feature space:
       IPRM: 0x00018000
      ifnums:
       Serial1/0(5)
       Serial1/1(6)
      path 68714258, path list 686E5860, share 5/5, type recursive, for IPv4
      recursive via 192.168.13.3[IPv4:Default], fib 686E7468, 1 terminal fib, v4:Default:192.168.13.3/32
        path 687141E0, path list 68716754, share 1/1, type recursive, for IPv4, flags doesnt-source-via, cef-internal
        recursive via 192.168.13.0/24<nh:192.168.13.3>[IPv4:Default], fib 6726EDA4, 1 terminal fib, v4:Default:192.168.13.0/24
          path 677373D4, path list 677371AC, share 1/1, type connected prefix, for IPv4
          connected to Serial1/0, adjacency IP adj out of Serial1/0 672E6F40
      path 687142D0, path list 686E5860, share 8/8, type recursive, for IPv4
      recursive via 192.168.14.4[IPv4:Default], fib 686E74E4, 1 terminal fib, v4:Default:192.168.14.4/32
        path 68714348, path list 686E58AC, share 1/1, type recursive, for IPv4, flags doesnt-source-via, cef-internal
        recursive via 192.168.14.0/24<nh:192.168.14.4>[IPv4:Default], fib 6726EC30, 1 terminal fib, v4:Default:192.168.14.0/24
          path 686E6250, path list 686E5BF0, share 1/1, type connected prefix, for IPv4
          connected to Serial1/1, adjacency IP adj out of Serial1/1 672E6DE0
      output chain:
        loadinfo 6726D058, per-session, 2 choices, flags 0003, 6 locks
        flags: Per-session, for-rx-IPv4
        13 hash buckets
          < 0 > IP adj out of Serial1/0 672E6F40
          < 1 > IP adj out of Serial1/1 672E6DE0
          < 2 > IP adj out of Serial1/0 672E6F40
          < 3 > IP adj out of Serial1/1 672E6DE0
          < 4 > IP adj out of Serial1/0 672E6F40
          < 5 > IP adj out of Serial1/1 672E6DE0
          < 6 > IP adj out of Serial1/0 672E6F40
          < 7 > IP adj out of Serial1/1 672E6DE0
          < 8 > IP adj out of Serial1/0 672E6F40
          < 9 > IP adj out of Serial1/1 672E6DE0
          <10 > IP adj out of Serial1/1 672E6DE0
          <11 > IP adj out of Serial1/1 672E6DE0
          <12 > IP adj out of Serial1/1 672E6DE0
        Subblocks:
         None

    R5 receives the bandwidth information via the extended community value advertised from R1 and R2 and updates the IP routing table with the additional iBGP prefix.

    R5#sh ip bgp 3.3.3.3
    BGP routing table entry for 3.3.3.3/32, version 8
    Paths: (2 available, best #2, table default)
    Multipath: eBGP iBGP
      Not advertised to any peer
      200
        146.1.0.2 from 146.1.0.2 (192.168.24.2)
          Origin IGP, metric 0, localpref 100, valid, internal, multipath
          DMZ-Link Bw 193 kbytes
      200
        146.1.0.1 from 146.1.0.1 (192.168.14.1)
          Origin IGP, metric 0, localpref 100, valid, internal, multipath, best
          DMZ-Link Bw 160 kbytes

    R5#sh ip route 3.3.3.3
    Routing entry for 3.3.3.3/32
      Known via "bgp 100", distance 200, metric 0
      Tag 200, type internal
      Last update from 146.1.0.1 00:00:33 ago
      Routing Descriptor Blocks:
        146.1.0.2, from 146.1.0.2, 00:00:33 ago
          Route metric is 0, traffic share count is 6
          AS Hops 1
          Route tag 200
          MPLS label: none
      * 146.1.0.1, from 146.1.0.1, 00:00:33 ago
          Route metric is 0, traffic share count is 5
          AS Hops 1
          Route tag 200
          MPLS label: none

    Below the CEF table is load balancing traffic at a 6 to 5 packet ratio.

    R5#sh ip cef 3.3.3.3 internal
    3.3.3.3/32, epoch 0, flags rib only nolabel, rib defined all labels, RIB[B], refcount 5, per-destination sharing
      sources: RIB
      feature space:
       IPRM: 0x00018000
      ifnums:
       GigabitEthernet0/0(4): 146.1.0.1, 146.1.0.2
      path 686D156C, path list 686CFD54, share 4/5, type recursive, for IPv4
      recursive via 146.1.0.1[IPv4:Default], fib 686D2618, 1 terminal fib, v4:Default:146.1.0.1/32
        path 686D165C, path list 686CFDA0, share 1/1, type adjacency prefix, for IPv4
        attached to GigabitEthernet0/0, adjacency IP adj out of GigabitEthernet0/0, addr 146.1.0.1 672E6F80
      path 686D15E4, path list 686CFD54, share 6/6, type recursive, for IPv4
      recursive via 146.1.0.2[IPv4:Default], fib 686D259C, 1 terminal fib, v4:Default:146.1.0.2/32
        path 686D18B4, path list 686CFD08, share 1/1, type adjacency prefix, for IPv4
        attached to GigabitEthernet0/0, adjacency IP adj out of GigabitEthernet0/0, addr 146.1.0.2 672E6E20
      output chain:
        loadinfo 6726D098, per-session, 2 choices, flags 0003, 6 locks
        flags: Per-session, for-rx-IPv4
        11 hash buckets
          < 0 > IP adj out of GigabitEthernet0/0, addr 146.1.0.1 672E6F80
          < 1 > IP adj out of GigabitEthernet0/0, addr 146.1.0.2 672E6E20
          < 2 > IP adj out of GigabitEthernet0/0, addr 146.1.0.1 672E6F80
          < 3 > IP adj out of GigabitEthernet0/0, addr 146.1.0.2 672E6E20
          < 4 > IP adj out of GigabitEthernet0/0, addr 146.1.0.1 672E6F80
          < 5 > IP adj out of GigabitEthernet0/0, addr 146.1.0.2 672E6E20
          < 6 > IP adj out of GigabitEthernet0/0, addr 146.1.0.1 672E6F80
          < 7 > IP adj out of GigabitEthernet0/0, addr 146.1.0.2 672E6E20
          < 8 > IP adj out of GigabitEthernet0/0, addr 146.1.0.1 672E6F80
          < 9 > IP adj out of GigabitEthernet0/0, addr 146.1.0.2 672E6E20
          <10 > IP adj out of GigabitEthernet0/0, addr 146.1.0.2 672E6E20
        Subblocks:
         None

    That’s all there is to that.


    Sources:







No comments:

Post a Comment