BIER load-balance
(self)
| 240 | self.bier_midpoint(BIERLength.BIER_LEN_64, 8, 64) |
| 241 | |
| 242 | def test_bier_load_balance(self): |
| 243 | """BIER load-balance""" |
| 244 | |
| 245 | # |
| 246 | # Add a BIER table for sub-domain 0, set 0, and BSL 256 |
| 247 | # |
| 248 | bti = VppBierTableID(0, 0, BIERLength.BIER_LEN_64) |
| 249 | bt = VppBierTable(self, bti, 77) |
| 250 | bt.add_vpp_config() |
| 251 | |
| 252 | # |
| 253 | # packets with varying entropy |
| 254 | # |
| 255 | pkts = [] |
| 256 | for ii in range(257): |
| 257 | pkts.append( |
| 258 | ( |
| 259 | Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) |
| 260 | / MPLS(label=77, ttl=255) |
| 261 | / BIER( |
| 262 | length=BIERLength.BIER_LEN_64, |
| 263 | entropy=ii, |
| 264 | BitString=scapy.compat.chb(255) * 16, |
| 265 | ) |
| 266 | / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.remote_ip6) |
| 267 | / UDP(sport=1234, dport=1234) |
| 268 | / Raw() |
| 269 | ) |
| 270 | ) |
| 271 | |
| 272 | # |
| 273 | # 4 next hops |
| 274 | # |
| 275 | nhs = [ |
| 276 | {"ip": "10.0.0.1", "label": 201}, |
| 277 | {"ip": "10.0.0.2", "label": 202}, |
| 278 | {"ip": "10.0.0.3", "label": 203}, |
| 279 | {"ip": "10.0.0.4", "label": 204}, |
| 280 | ] |
| 281 | |
| 282 | for nh in nhs: |
| 283 | ipr = VppIpRoute( |
| 284 | self, |
| 285 | nh["ip"], |
| 286 | 32, |
| 287 | [ |
| 288 | VppRoutePath( |
| 289 | self.pg1.remote_ip4, |
| 290 | self.pg1.sw_if_index, |
| 291 | labels=[VppMplsLabel(nh["label"])], |
| 292 | ) |
| 293 | ], |
| 294 | ) |
| 295 | ipr.add_vpp_config() |
| 296 | |
| 297 | bier_route = VppBierRoute( |
| 298 | self, |
| 299 | bti, |
nothing calls this directly
no test coverage detected