Description

This article explains why load balancing implemented by the targeting algorithm does not balance subscribers equally across all Aggregated Ethernet (AE) interface members.

Symptoms

Consider the following VLANs:

  • VLAN: 128:[7-1006] - 1000 subscribers

  • VLAN: 129:[7] - 300 subscribers

  • VLAN: 130:[7] - 300 subscribers

  • VLAN: 131:[7] - 300 subscribers

  • VLAN: 132:[7] - 13000 subscribers

When you check the load balancing implemented by the targeting algorithm, you see the following:

> show interfaces targeting ae3
Aggregated interface: ae3
Targeting Type: Auto
Redundancy mode: Link Level Redundancy
Total number of distribution groups: 1
Total number of distributed interfaces: 15903

Distribution Group name: default
Number of distributed interfaces: 15903
Physical interface: ge-0/0/4, Link status: Up
  Number of primary distributions: 2602
  Number of backup  distributions: 13301
Physical interface: ge-2/0/4, Link status: Up
  Number of primary distributions: 13301
  Number of backup  distributions: 2602

As you can see, there are ~13.3k subscribers on one interface and 2.6k on another, even though targeted-distribution is enabled under demux0 and pp0 in dynamic-profiles:

> show configuration dynamic-profiles | display set | match targ | match target
set dynamic-profiles targ-pppv6p interfaces pp0 unit "$junos-interface-unit" targeted-distribution
set dynamic-profiles targ-vlan interfaces demux0 unit "$junos-interface-unit" targeted-distribution

Solution

The targeted balancing feature has an option "AE targeted max granularity," which represents the maximum number of subscribers per pseudo IFL. By default, this number is 500:

vty-bbe# show targeted ifd ae3 detail
Detailed IFD Info
IFD handle:              0xe8fad8c
IFD Name:                ae3
IFD Index:               228
IFD BBE Index:           68
IFD Seq num:             0
IFD Gen num:             231
IFD RefCnt:              1016
Installed on PFE:        TRUE
IFD Flags:               0x28
IFD Local Flags:         0x0
AE member count:                 2
AE targeted pair count:          2
AE targeted redundancy mode:     0
AE targeted max granularity:     500
AE targeted rebalance mode:      Modified
AE targeted max slots chassis:   6
AE targeted rebalance count:     0
AE targeted redistribute:        0
AE targeted generation number    0
AE targeted backup member valid: Yes
AE targeted client count         15903
AE targeted pseudo ifl count     6
AE targeted bucket count         6
AE targeted unliked count        0
AE targeted rebalance interval   0
AE targeted new db valid:        No
AE targeted new config pending:  No

Member IFD Name:
        ifd_index 169, ge-0/0/4, primary weight 2602, backup weight 13301, link state down 0, fpc slot 0, chassis 0, elig 1
        ifd_index 192, ge-2/0/4, primary weight 13301, backup weight 2602, link state down 0, fpc slot 2, chassis 0, elig 1

IFD Target Info:
        Target set 0, primary ifd_index 169, backup ifd_index 192, total_weight 2602, ref_count 2602, bucket_cnt 5, pseudo_cnt 5, elig 1
               Bucket Info: weight 602, ref_count 602, bucket_offset 0, pseudo_ifl_index 451
               Bucket Info: weight 508, ref_count 508, bucket_offset 1, pseudo_ifl_index 454
               Bucket Info: weight 512, ref_count 512, bucket_offset 2, pseudo_ifl_index 455
               Bucket Info: weight 504, ref_count 504, bucket_offset 3, pseudo_ifl_index 456
               Bucket Info: weight 476, ref_count 476, bucket_offset 4, pseudo_ifl_index 457
               Target set 0: delta weight 0, delta ref_count 0, passed verification.
        Target set 1, primary ifd_index 192, backup ifd_index 169, total_weight 13301, ref_count 13301, bucket_cnt 1, pseudo_cnt 1, elig 1
               Bucket Info: weight 13301, ref_count 13301, bucket_offset 0, pseudo_ifl_index 453
               Target set 1: delta weight 0, delta ref_count 0, passed verification.
        IFD Target db passed verification.

If you consider the earlier example, you have one pseudo IFL with 13k subscribers on ge-2/0/4, with all other pseudo IFLs on ge-0/0/4. And there is a huge difference in the number of subscribers on each IFL.

Consider the 13301 subscribers on this pseudo IFL:

> request pfe execute target fpc0 timeout 0 command "show vbf pseudo 453" | match ifl | count
Count: 13301 lines

This means that one VLAN with 300 subscribers and another VLAN with 13000 are assigned on this pseudo IFL. This could happen because of the following targeting algorithm logic:

  1. If this is the first subscriber on the AE interface, then a pseudo IFL will be created and all new subscribers will be assigned to this pseudo IFL until the "max granularity" value of subscribers is reached.

  2. Then a new pseudo IFL will be created on an AE interface member with a lower weight and the next set of subscribers will be assigned to this pseudo IFL.

  3. If the first subscriber is located on some VLAN, then all other subscribers from the same VLAN will be located on this pseudo IFL. This is how a pseudo IFL with more than 500 subscribers may exist.

  4. If there are two AE members with weight 100 and weight 200, a new subscriber will be connected to a member with lower weight and to a pseudo IFL with a lower number of subscribers; otherwise a new pseudo IFL will be created on this AE member.

  5. If there are PPPoE over QinQ subscribers with unique QinQ VLAN pairs per subscriber, the balancing will be done almost equally, because there would not be any VLAN locks on the same pseudo IFL.

Now if you have a few fat VLANs and many thin VLANs, but in total the sum of thin VLAN subscribers is still dramatically less than the sum of fat VLAN subscribers, you may try to remove the targeted-distribution option from the demux0 interface hierarchy as shown below:

[edit dynamic-profiles targ-vlan interfaces demux0 unit "$junos-interface-unit"]
!       inactive: targeted-distribution { ... }

In this case, the targeting algorithm will not take the VLAN ID into account:

> show interfaces targeting ae3
Aggregated interface: ae3
Targeting Type: Auto
Redundancy mode: Link Level Redundancy
Total number of distribution groups: 1
Total number of distributed interfaces: 14900

Distribution Group name: default
Number of distributed interfaces: 14900 <<< all subscribers from all vlans are connected
Physical interface: ge-0/0/4, Link status: Up
  Number of primary distributions: 7450
  Number of backup  distributions: 7450
Physical interface: ge-2/0/4, Link status: Up
  Number of primary distributions: 7450
  Number of backup  distributions: 7450

As you can see, it looks much better now. Targeting is still implemented but the subscribers are balanced. And if you take a look into the bbe-smgd shell, you can see that more pseudo IFLs have been created and on each of them, there are 500 subscribers or less:

Member IFD Name:
        ifd_index 169, ge-0/0/4, primary weight 7450, backup weight 7450, link state down 0, fpc slot 0, chassis 0, elig 1
        ifd_index 192, ge-2/0/4, primary weight 7450, backup weight 7450, link state down 0, fpc slot 2, chassis 0, elig 1

IFD Target Info:
        Target set 0, primary ifd_index 169, backup ifd_index 192, total_weight 7450, ref_count 7450, bucket_cnt 15, pseudo_cnt 15, elig 1
               Bucket Info: weight 500, ref_count 500, bucket_offset 0, pseudo_ifl_index 452
               Bucket Info: weight 500, ref_count 500, bucket_offset 1, pseudo_ifl_index 454
               Bucket Info: weight 500, ref_count 500, bucket_offset 2, pseudo_ifl_index 456
               Bucket Info: weight 500, ref_count 500, bucket_offset 3, pseudo_ifl_index 458
               Bucket Info: weight 500, ref_count 500, bucket_offset 4, pseudo_ifl_index 460
               Bucket Info: weight 500, ref_count 500, bucket_offset 5, pseudo_ifl_index 462
               Bucket Info: weight 500, ref_count 500, bucket_offset 6, pseudo_ifl_index 464
               Bucket Info: weight 500, ref_count 500, bucket_offset 7, pseudo_ifl_index 466
               Bucket Info: weight 500, ref_count 500, bucket_offset 8, pseudo_ifl_index 468
               Bucket Info: weight 500, ref_count 500, bucket_offset 9, pseudo_ifl_index 470
               Bucket Info: weight 500, ref_count 500, bucket_offset 10, pseudo_ifl_index 472
               Bucket Info: weight 500, ref_count 500, bucket_offset 11, pseudo_ifl_index 474
               Bucket Info: weight 500, ref_count 500, bucket_offset 12, pseudo_ifl_index 476
               Bucket Info: weight 500, ref_count 500, bucket_offset 13, pseudo_ifl_index 478
               Bucket Info: weight 450, ref_count 450, bucket_offset 14, pseudo_ifl_index 480
               Target set 0: delta weight 0, delta ref_count 0, passed verification.
        Target set 1, primary ifd_index 192, backup ifd_index 169, total_weight 7450, ref_count 7450, bucket_cnt 15, pseudo_cnt 15, elig 1
               Bucket Info: weight 500, ref_count 500, bucket_offset 0, pseudo_ifl_index 453
               Bucket Info: weight 500, ref_count 500, bucket_offset 1, pseudo_ifl_index 455
               Bucket Info: weight 500, ref_count 500, bucket_offset 2, pseudo_ifl_index 457
               Bucket Info: weight 500, ref_count 500, bucket_offset 3, pseudo_ifl_index 459
               Bucket Info: weight 500, ref_count 500, bucket_offset 4, pseudo_ifl_index 461
               Bucket Info: weight 500, ref_count 500, bucket_offset 5, pseudo_ifl_index 463
               Bucket Info: weight 500, ref_count 500, bucket_offset 6, pseudo_ifl_index 465
               Bucket Info: weight 500, ref_count 500, bucket_offset 7, pseudo_ifl_index 467
               Bucket Info: weight 500, ref_count 500, bucket_offset 8, pseudo_ifl_index 469
               Bucket Info: weight 500, ref_count 500, bucket_offset 9, pseudo_ifl_index 471
               Bucket Info: weight 500, ref_count 500, bucket_offset 10, pseudo_ifl_index 473
               Bucket Info: weight 500, ref_count 500, bucket_offset 11, pseudo_ifl_index 475
               Bucket Info: weight 500, ref_count 500, bucket_offset 12, pseudo_ifl_index 477
               Bucket Info: weight 500, ref_count 500, bucket_offset 13, pseudo_ifl_index 479
               Bucket Info: weight 450, ref_count 450, bucket_offset 14, pseudo_ifl_index 481
               Target set 1: delta weight 0, delta ref_count 0, passed verification.
        IFD Target db passed verification.

Modification History

11-06-2025: Minor, non-technical edit