BIER midpoint
(self, hdr_len_id, n_bytes, max_bp)
| 90 | super(TestBier, self).tearDown() |
| 91 | |
| 92 | def bier_midpoint(self, hdr_len_id, n_bytes, max_bp): |
| 93 | """BIER midpoint""" |
| 94 | |
| 95 | # |
| 96 | # Add a BIER table for sub-domain 0, set 0, and BSL 256 |
| 97 | # |
| 98 | bti = VppBierTableID(0, 0, hdr_len_id) |
| 99 | bt = VppBierTable(self, bti, 77) |
| 100 | bt.add_vpp_config() |
| 101 | |
| 102 | # |
| 103 | # A packet with no bits set gets dropped |
| 104 | # |
| 105 | p = ( |
| 106 | Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) |
| 107 | / MPLS(label=77, ttl=255) |
| 108 | / BIER(length=hdr_len_id) |
| 109 | / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.remote_ip6) |
| 110 | / UDP(sport=1234, dport=1234) |
| 111 | / Raw() |
| 112 | ) |
| 113 | pkts = [p] |
| 114 | |
| 115 | self.send_and_assert_no_replies(self.pg0, pkts, "Empty Bit-String") |
| 116 | |
| 117 | # |
| 118 | # Add a BIER route for each bit-position in the table via a different |
| 119 | # next-hop. Testing whether the BIER walk and replicate forwarding |
| 120 | # function works for all bit posisitons. |
| 121 | # |
| 122 | nh_routes = [] |
| 123 | bier_routes = [] |
| 124 | for i in range(1, max_bp + 1): |
| 125 | nh = "10.0.%d.%d" % (i / 255, i % 255) |
| 126 | nh_routes.append( |
| 127 | VppIpRoute( |
| 128 | self, |
| 129 | nh, |
| 130 | 32, |
| 131 | [ |
| 132 | VppRoutePath( |
| 133 | self.pg1.remote_ip4, |
| 134 | self.pg1.sw_if_index, |
| 135 | labels=[VppMplsLabel(2000 + i)], |
| 136 | ) |
| 137 | ], |
| 138 | ) |
| 139 | ) |
| 140 | nh_routes[-1].add_vpp_config() |
| 141 | |
| 142 | bier_routes.append( |
| 143 | VppBierRoute( |
| 144 | self, |
| 145 | bti, |
| 146 | i, |
| 147 | [VppRoutePath(nh, 0xFFFFFFFF, labels=[VppMplsLabel(100 + i)])], |
| 148 | ) |
| 149 | ) |
no test coverage detected