dmzlink-bw

BGP dmzlink-bw


BGP dmzlink-bw permits to load-balance outgoing traffic through different eBGP links.

In the following topology, R2-R3 and R4-R5 are eBGP peers. We want to balance traffic from R1 to prefix 10.0.35/0 through the two external links and based on the bandwidth of the two links.

So if R2-R3 link has ten times bw than R4/R5 link we take that in consideration when balancing.


bgp_dmz

The basic configuration of peering is simple, let's look only the dmzlink-bw part;

1) neighbor x.x.x.x dmzlink-bw to eBGP peers

On R2 and R4 we declare neighbors R3 and R5 as dmzlink-bw:

R2(config)#router bgp 100
R2(config-router)#neighbor 10.0.23.3 dmzlink-bw

R4(config)#router bgp 100
R4(config-router)#neighbor 10.0.45.5 dmzlink-bw

2) Community

Since dmzlink-bw information is sent via a community, make sure we send communities to R1 from both R2 and R4:

neighbor IBGP send-community both

3) enable dmzlink-bw and iBGP multipath on R1:

R1(config)#router bgp 100
R1(config-router)#bgp dmzlink-bw
R1(config-router)#maximum-paths ibgp 2


The output on R1 shows that traffic is equally load balanced between the two available links:

Routing entry for 10.0.35.0/24
Known via "bgp 100", distance 200, metric 0
Tag 200, type internal
Last update from 10.0.23.3 00:01:06 ago
Routing Descriptor Blocks:
* 10.0.45.5, from 4.4.4.4, 00:01:06 ago
Route metric is 0, traffic share count is 1
AS Hops 1
Route tag 200
10.0.23.3, from 2.2.2.2, 00:01:06 ago
Route metric is 0, traffic share count is 1
AS Hops 1
Route tag 200

What happens if we set R2-R3 bandwidth ten times bigger than R4-R5?

R2(config)#inte s1/1
R2(config-if)#ban
R2(config-if)#bandwidth 100000

R4(config)#inte s1/1
R4(config-if)#bana
R4(config-if)#band
R4(config-if)#bandwidth 10000

Check again the output on R1:

Routing entry for 10.0.35.0/24
Known via "bgp 100", distance 200, metric 0
Tag 200, type internal
Last update from 10.0.23.3 00:00:46 ago
Routing Descriptor Blocks:
* 10.0.45.5, from 4.4.4.4, 00:00:46 ago
Route metric is 0, traffic share count is 1
AS Hops 1
Route tag 200
10.0.23.3, from 2.2.2.2, 00:00:46 ago
Route metric is 0, traffic share count is 10
AS Hops 1
Route tag 200

Now traffic should be load balanced taking in consideration the link bandwidth.

Verification:

R1#ping 10.0.35.1 repeat 10 timeout 1

Type escape sequence to abort.
Sending 10, 100-byte ICMP Echos to 10.0.35.1, timeout is 1 seconds:

*Mar 1 01:51:27.307: %SYS-5-CONFIG_I: Configured from console by console.
*Mar 1 01:51:28.935: IP: tableid=0, s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), routed via RIB
*Mar 1 01:51:28.939: IP: s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), len 100, sending
*Mar 1 01:51:29.935: IP: tableid=0, s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), routed via RIB
*Mar 1 01:51:29.935: IP: s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), len 100, sending..
*Mar 1 01:51:30.935: IP: tableid=0, s=10.0.14.1 (local), d=10.0.35.1 (Serial1/1), routed via RIB
*Mar 1 01:51:30.935: IP: s=10.0.14.1 (local), d=10.0.35.1 (Serial1/1), len 100, sending

*Mar 1 01:51:31.935: IP: tableid=0, s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), routed via RIB
*Mar 1 01:51:31.935: IP: s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), len 100, sending..
*Mar 1 01:51:32.935: IP: tableid=0, s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), routed via RIB
*Mar 1 01:51:32.935: IP: s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), len 100, sending
*Mar 1 01:51:33.935: IP: tableid=0, s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), routed via RIB
*Mar 1 01:51:33.935: IP: s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), len 100, sending..
*Mar 1 01:51:34.935: IP: tableid=0, s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), routed via RIB
*Mar 1 01:51:34.935: IP: s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), len 100, sending
*Mar 1 01:51:35.935: IP: tableid=0, s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), routed via RIB
*Mar 1 01:51:35.935: IP: s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), len 100, sending..
*Mar 1 01:51:36.935: IP: tableid=0, s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), routed via RIB
*Mar 1 01:51:36.935: IP: s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), len 100, sending
*Mar 1 01:51:37.935: IP: tableid=0, s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), routed via RIB
*Mar 1 01:51:37.935: IP: s=10.0.12.1 (local), d=10.0.35.1 (Serial1/0), len 100, sending.
Success rate is 0 percent (0/10)

Great! One ping every ten goes through R4 since it has 1/10 the bw of R3 for that prefix.

Note: this proportion can be broken if interface bw is changed, for example for a QoS task later of the lab.

TIP: if CEF is enabled traffic is not load-balanced since it keeps coherence on the traffic flow. Disable it to get an output like the one above:


R1(config)#no ip cef


Another option is to modify the load sharing on the interface, setting per-packet.

R1(config-if)#ip load-sharing ?
per-destination Deterministic distribution
per-packet Random distribution


Disabling CEF can be a wrong choice, it's needed for many functions of the router, first of all MPLS.