TH3_CINT_Summary.csv (147518B)
1 File,Summary,Description - Test Setup,Description - Configuration,Description - Verification,Expected Result 2 ./tomahawk3/rtag7/rtag7_udf_trunk.c," This cint example configures RTAG7 UDF hashing on the egress trunk using 3 BCM APIs. The UDF is created for the Src and Dst port of the UDP header 4 "," a) Select one ingress port and three egress ports and configure them in Loopback mode. 5 "," a) Create a VLAN(12) and add ingress port and egress port as members. 6 b) Create a trunk with id 1 and add all the egress ports to this trunk. Set the port 7 selection criteria to BCM_TRUNK_PSC_PORTFLOW (RTAG7). 8 c) Configure the destination MAC address of the test packet statically in the L2 table 9 in order to make the test packet a unicast packet. 10 d) Set the switch controls required for UDF hashing. 11 e) Create 2 UDFs for the UDP Src and Dst port and add them to the hashing list 12 "," a) Transmit 10 packets with incremental L4 SrcPort and L4 DstPort on the ingress port 13 and verify that packets are load balanced across the egress ports using ""show counters"" 14 Packets 15 ======= 16 DA 0x00000000AAAA 17 SA 0x000000002222 18 VLAN 12 19 DIP 10.10.2.0 SIP 10.10.1.0 20 Src Port 5000 Dst Port 80 21 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 22 08 00 45 00 00 51 00 01 00 00 40 11 63 88 0A 0A 23 01 00 0A 0A 02 00 13 88 00 50 00 3D CE 40 28 20 24 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 25 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 26 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 27 00 20 FF 28 DA 0x00000000AAAA 29 SA 0x000000002222 30 VLAN 12 31 DIP 10.10.2.0 SIP 10.10.1.0 32 Src Port 5001 Dst Port 81 33 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 34 08 00 45 00 00 51 00 01 00 00 40 11 63 86 0A 0A 35 01 01 0A 0A 02 01 13 89 00 51 00 3D CE 3C 28 20 36 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 37 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 38 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 39 00 20 FF 40 DA 0x00000000AAAA 41 SA 0x000000002222 42 VLAN 12 43 DIP 10.10.2.0 SIP 10.10.1.0 44 Src Port 5002 Dst Port 82 45 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 46 08 00 45 00 00 51 00 01 00 00 40 11 63 84 0A 0A 47 01 02 0A 0A 02 02 13 8A 00 52 00 3D CE 38 28 20 48 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 49 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 50 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 51 00 20 FF 52 DA 0x00000000AAAA 53 SA 0x000000002222 54 VLAN 12 55 DIP 10.10.2.0 SIP 10.10.1.0 56 Src Port 5003 Dst Port 83 57 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 58 08 00 45 00 00 51 00 01 00 00 40 11 63 82 0A 0A 59 01 03 0A 0A 02 03 13 8B 00 53 00 3D CE 34 28 20 60 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 61 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 62 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 63 00 20 FF 64 DA 0x00000000AAAA 65 SA 0x000000002222 66 VLAN 12 67 DIP 10.10.2.0 SIP 10.10.1.0 68 Src Port 5004 Dst Port 84 69 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 70 08 00 45 00 00 51 00 01 00 00 40 11 63 80 0A 0A 71 01 04 0A 0A 02 04 13 8C 00 54 00 3D CE 30 28 20 72 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 73 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 74 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 75 00 20 FF 76 DA 0x00000000AAAA 77 SA 0x000000002222 78 VLAN 12 79 DIP 10.10.2.0 SIP 10.10.1.0 80 Src Port 5005 Dst Port 85 81 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 82 08 00 45 00 00 51 00 01 00 00 40 11 63 7E 0A 0A 83 01 05 0A 0A 02 05 13 8D 00 55 00 3D CE 2C 28 20 84 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 85 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 86 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 87 00 20 FF 88 DA 0x00000000AAAA 89 SA 0x000000002222 90 VLAN 12 91 DIP 10.10.2.0 SIP 10.10.1.0 92 Src Port 5006 Dst Port 86 93 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 94 08 00 45 00 00 51 00 01 00 00 40 11 63 7C 0A 0A 95 01 06 0A 0A 02 06 13 8E 00 56 00 3D CE 28 28 20 96 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 97 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 98 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 99 00 20 FF 100 DA 0x00000000AAAA 101 SA 0x000000002222 102 VLAN 12 103 DIP 10.10.2.0 SIP 10.10.1.0 104 Src Port 5007 Dst Port 87 105 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 106 08 00 45 00 00 51 00 01 00 00 40 11 63 7A 0A 0A 107 01 07 0A 0A 02 07 13 8F 00 57 00 3D CE 24 28 20 108 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 109 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 110 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 111 00 20 FF 112 DA 0x00000000AAAA 113 SA 0x000000002222 114 VLAN 12 115 DIP 10.10.2.0 SIP 10.10.1.0 116 Src Port 5008 Dst Port 88 117 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 118 08 00 45 00 00 51 00 01 00 00 40 11 63 78 0A 0A 119 01 08 0A 0A 02 08 13 90 00 58 00 3D CE 20 28 20 120 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 121 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 122 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 123 00 20 FF 124 DA 0x00000000AAAA 125 SA 0x000000002222 126 VLAN 12 127 DIP 10.10.2.0 SIP 10.10.1.0 128 Src Port 5009 Dst Port 89 129 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 130 08 00 45 00 00 51 00 01 00 00 40 11 63 76 0A 0A 131 01 09 0A 0A 02 09 13 91 00 59 00 3D CE 1C 28 20 132 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 133 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 134 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 135 00 20 FF 136 "," The packets should be load balanced across all the trunk member ports. This can be 137 checked using ""show counters"" 138 " 139 ./tomahawk3/rtag7/l3_rtag7_trunk.c," CINT script to show L3 routing using Trunk as egress port, 140 RTAG7 is used as hashing for trunking. 141 "," a) Selects Four ports and configure them in Loopback mode. Out of these Four ports, 142 one port is used as Ingress port and the other as Egress port. Install a rule 143 to copy incoming packets to CPU and start packet watcher. 144 "," a) Create the trunk using Three port and Configure RTAG7 setting on the trunk. 145 This is done in config_l3_trunk_rtag7(). 146 "," a) For checking RTAG7 setting on the trunk. send the below packet on ingress port. 147 Send traffic with incrementing DIP and SIP addresses to the ingress port, 148 observe the routed traffic distributed among the outgoing trunk ports. 149 SAMPLE-1 150 ========= 151 DA 0x00000000AAAA 152 SA 0x000000002222 153 VLAN 12 154 DIP=192.168.10.1 155 SIP =10.10.10.1 156 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 157 08 00 45 00 00 2E 00 00 00 00 40 FF 9B 1D 0A 0A 158 0A 01 C0 A8 0A 01 00 01 02 03 04 05 06 07 08 09 159 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 160 1D BB 9F BE 161 SAMPLE-2 162 ========= 163 DA 0x00000000AAAA 164 SA 0x000000002222 165 VLAN 12 166 DIP=192.168.10.2 167 SIP =10.10.10.2 168 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 169 08 00 45 00 00 2E 00 00 00 00 40 FF 9B 1B 0A 0A 170 0A 02 C0 A8 0A 02 00 01 02 03 04 05 06 07 08 09 171 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 172 DE D5 F4 D2 173 SAMPLE-3 174 ========= 175 DA 0x00000000AAAA 176 SA 0x000000002222 177 VLAN 12 178 DIP=192.168.10.3 179 SIP =10.10.10.3 180 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 181 08 00 45 00 00 2E 00 00 00 00 40 11 9C 07 0A 0A 182 0A 03 C0 A8 0A 03 00 3F 00 3F 00 1A D8 32 00 01 183 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 184 CC 5A D2 87 185 "," NOTE: Below is the snipet of show c output to illustrate packets are loadbalanced 186 Across all egress ports 187 For validating the RTAG7 setting on the trunk. Below is the counters output 188 CDMIB_RPKT.cd0 3 +3 1/s 189 CDMIB_RPKT.cd1 1 +1 1/s 190 CDMIB_RPKT.cd2 1 +1 191 CDMIB_RPKT.cd3 1 +1 192 CDMIB_TPKT.cd0 3 +3 1/s 193 CDMIB_TPKT.cd1 1 +1 1/s 194 CDMIB_TPKT.cd2 1 +1 195 CDMIB_TPKT.cd3 1 +1 196 " 197 ./tomahawk3/rtag7/l3_rtag7_ecmp_trunk.c," CINT script to show L3 routing using both ECMP and Trunk, 198 there are two ECMP paths, each of which is on a trunk of three physical ports: 199 RTAG7 is used as hashing for ECMP and trunking. 200 this example demonstrates how to configure the RTAG7 to support both 201 ECMP and trunk simultaneously. 202 "," a) Selects Seven ports and configure them in Loopback mode. Out of these Seven ports, 203 one port is used as Ingress port and the other as Egress port. Install a rule 204 to copy incoming packets to CPU and start packet watcher. 205 "," a) Create the trunk using Three port and Configure RTAG7 setting on the trunk. 206 Here we use three physical ports each to configure two trunks. 207 Which in turn configured as two ECMP paths. RTAG7 is used as hashing for ECMP and trunking. 208 This is done in config_l3_trunk_ecmp_rtag7() 209 "," a) For checking RTAG7 setting on the trunk and ECMP. send the below packet on ingress port. 210 SAMPLE-1 211 ========= 212 DA 0x00000000AAAA 213 SA 0x000000002222 214 VLAN 12 215 DIP=192.168.10.1 216 SIP =10.10.10.1 217 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 218 08 00 45 00 00 2E 00 00 00 00 40 FF 9B 1D 0A 0A 219 0A 01 C0 A8 0A 01 43 03 1F E5 B2 9E CF 90 C1 81 220 3A 56 99 BD 78 02 A6 9E FB 49 9E 95 BA 5A BF 76 221 C3 48 74 7B 222 SAMPLE-2 223 ========= 224 DA 0x00000000AAAA 225 SA 0x000000002222 226 VLAN 12 227 DIP=192.168.10.24 228 SIP =10.10.10.24 229 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 230 08 00 45 00 00 2E 00 00 00 00 40 FF 9A EF 0A 0A 231 0A 18 C0 A8 0A 18 3A 10 1D 7B 40 01 84 D9 B1 55 232 D1 50 6C FE 82 7B 76 83 4F 3C F7 F6 55 50 85 26 233 FA 5E 7E 81 234 SAMPLE-3 235 ========= 236 DA 0x00000000AAAA 237 SA 0x000000002222 238 VLAN 12 239 DIP=192.168.10.33 240 SIP =10.10.10.33 241 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 242 08 00 45 00 00 2E 00 00 00 00 40 FF 9A DD 0A 0A 243 0A 21 C0 A8 0A 21 C4 65 87 43 14 45 B9 76 63 DB 244 AB C3 4F DF 83 CD BC 36 E5 B5 1A 20 5D EA E7 B3 245 B8 B4 B1 75 246 SAMPLE-4 247 ========= 248 DA 0x00000000AAAA 249 SA 0x000000002222 250 VLAN 12 251 DIP=192.168.10.51 252 SIP =10.10.10.51 253 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 254 08 00 45 00 00 2E 00 00 00 00 40 FF 9A B9 0A 0A 255 0A 33 C0 A8 0A 33 B8 94 D7 BC 72 CE 32 C9 2D 38 256 60 3C 1D C9 CA E9 9C 03 3B 7C 6F 25 44 54 4B A1 257 32 1E 69 5D 258 SAMPLE-5 259 ========= 260 DA 0x00000000AAAA 261 SA 0x000000002222 262 VLAN 12 263 DIP=192.168.10.66 264 SIP =10.10.10.66 265 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 266 08 00 45 00 00 2E 00 00 00 00 40 FF 9A 9B 0A 0A 267 0A 42 C0 A8 0A 42 57 62 6D F6 D1 8E 57 2A 98 49 268 37 9B 54 2A 94 C3 64 A5 65 C9 22 3A 79 55 68 EC 269 CD 72 66 8F 270 SAMPLE-6 271 ========= 272 DA 0x00000000AAAA 273 SA 0x000000002222 274 VLAN 12 275 DIP=192.168.10.87 276 SIP =10.10.10.87 277 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 278 08 00 45 00 00 2E 00 00 00 00 40 FF 9A 71 0A 0A 279 0A 57 C0 A8 0A 57 EE E4 EF B9 8A BC A1 34 A4 08 280 32 69 93 D1 52 D3 34 92 63 E0 8C 4B 38 A5 AF D1 281 E5 1F A4 DC 282 "," NOTE: Below is the snipet of show c output to illustrate packets are loadbalanced 283 Across all egress ports 284 For validating the RTAG7 setting on the ecmp and trunk. Below is the counters output 285 CDMIB_RPKT.cd0 6 +6 1/s 286 CDMIB_RPKT.cd1 1 +1 287 CDMIB_RPKT.cd2 1 +1 288 CDMIB_RPKT.cd3 1 +1 289 CDMIB_RPKT.cd4 1 +1 1/s 290 CDMIB_RPKT.cd5 1 +1 291 CDMIB_RPKT.cd6 1 +1 292 CDMIB_TPKT.cd0 6 +6 1/s 293 CDMIB_TPKT.cd1 1 +1 294 CDMIB_TPKT.cd2 1 +1 295 CDMIB_TPKT.cd3 1 +1 296 CDMIB_TPKT.cd4 1 +1 1/s 297 CDMIB_TPKT.cd5 1 +1 298 CDMIB_TPKT.cd6 1 +1 299 " 300 ./tomahawk3/rtag7/l3_rtag7_ecmp.c," CINT script to show L3 routing using ECMP nexthop. 301 there are two ECMP paths, RTAG7 is used as hashing for ECMP. 302 "," a) Selects Three ports and configure them in Loopback mode. Out of these Three ports, 303 one port is used as Ingress port and the other as Egress port. Install a rule 304 to copy incoming packets to CPU and start packet watcher. 305 "," a) Create the ECMP path using Two port and Configure RTAG7 setting on the ECMP path. 306 This is done in config_ecmp_rtag7(). 307 "," a) For checking RTAG7 setting on the ECMP Path. send the below packet on ingress port. 308 SAMPLE-1 309 ========= 310 DA 0x00000000AAAA 311 SA 0x000000002222 312 VLAN 12 313 DIP=192.168.10.1 314 SIP =10.10.10.1 315 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 316 08 00 45 00 00 2E 00 00 00 00 40 FF 9B 1D 0A 0A 317 0A 01 C0 A8 0A 01 00 01 02 03 04 05 06 07 08 09 318 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 319 1D BB 9F BE 320 SAMPLE-2 321 ========= 322 DA 0x00000000AAAA 323 SA 0x000000002222 324 VLAN 12 325 DIP=192.168.10.2 326 SIP =10.10.10.2 327 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 328 08 00 45 00 00 2E 00 00 00 00 40 FF 9B 1B 0A 0A 329 0A 02 C0 A8 0A 02 00 01 02 03 04 05 06 07 08 09 330 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 331 DE D5 F4 D2 332 "," NOTE: Below is the snipet of show c output to illustrate packets are loadbalanced 333 Across all egress ports 334 For validating the RTAG7 setting on the trunk. Below is the counters output 335 CDMIB_RPKT.cd0 : 2 +2 2/s 336 CDMIB_RPKT.cd1 : 1 +1 1/s 337 CDMIB_RPKT.cd2 : 1 +1 1/s 338 CDMIB_TPKT.cd0 : 2 +2 2/s 339 CDMIB_TPKT.cd1 : 1 +1 1/s 340 CDMIB_TPKT.cd2 : 1 +1 1/s 341 " 342 ./tomahawk3/rtag7/random_lb_trunk.c," This cint example configures randomized load balancing on the egress trunk using 343 BCM APIs 344 "," a) Select one ingress port and three egress ports and configure them in Loopback mode. 345 "," a) Create a VLAN(12) and add ingress port and egress port as members. 346 b) Create a trunk with id 1 and add all the egress ports to this trunk. Set the port 347 selection criteria to BCM_TRUNK_PSC_RANDOMIZED (randomized load balancing). 348 c) Configure the destination MAC address of the test packet statically in the L2 table 349 in order to make the test packet a unicast packet. 350 d) Set the load-balancing randomizer value to 3 for the ingress port. 351 "," a) Transmit 50 copies of the below packet on the ingress port and verify that packets 352 are load balanced across the egress ports using ""show counters"" 353 Packet 354 ====== 355 DA 0x00000000AAAA 356 SA 0x000000002222 357 VLAN 12 358 DIP 192.168.10.1 359 SIP 10.10.10.1 360 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 361 08 00 45 00 00 3C 00 00 00 00 40 FF 9B 0F 0A 0A 362 0A 01 C0 A8 0A 01 00 01 02 03 04 05 06 07 08 09 363 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 364 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 2E CB 365 F6 84 366 "," The packets should be load balanced across all the trunk member ports. This can be 367 checked using ""show counters"" 368 " 369 ./tomahawk3/rtag7/l2_rtag7_trunk.c," CINT script to show L2 switching using Trunk as egress port, 370 RTAG7 is used as hashing for trunk selection. 371 "," a) Selects Four ports and configure them in Loopback mode. Out of these Four ports, 372 one port is used as Ingress port and the other as Egress port. Install a rule 373 to copy incoming packets to CPU and start packet watcher. 374 "," a) Create the trunk using Three port and Configure RTAG7 setting on the trunk. 375 This is done in config_l2_trunk_rtag7(). 376 "," a) For checking RTAG7 setting on the trunk. send the below packet on ingress port. 377 Send traffic with incrementing SA addresses to the ingress port, 378 observe the routed traffic distributed among the outgoing trunk ports. 379 SAMPLE-1 380 ========= 381 DA 0x00000000AAAA 382 SA 0x000000002222 383 VLAN 12 384 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 385 08 00 45 00 00 3C 00 00 00 00 40 FF 9B 0F 0A 0A 386 0A 01 C0 A8 0A 01 00 01 02 03 04 05 06 07 08 09 387 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 388 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 2E CB 389 F6 84 390 SAMPLE-2 391 ========= 392 DA 0x00000000AAAA 393 SA 0x000000002224 394 VLAN 12 395 00 00 00 00 AA AA 00 00 00 00 22 24 81 00 00 0C 396 08 00 45 00 00 3C 00 00 00 00 40 FF 9B 0F 0A 0A 397 0A 01 C0 A8 0A 01 00 01 02 03 04 05 06 07 08 09 398 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 399 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 2E CB 400 F6 84 401 SAMPLE-3 402 ========= 403 DA 0x00000000AAAA 404 SA 0x000000002226 405 VLAN 12 406 00 00 00 00 AA AA 00 00 00 00 22 26 81 00 00 0C 407 08 00 45 00 00 3C 00 00 00 00 40 FF 9B 0F 0A 0A 408 0A 01 C0 A8 0A 01 00 01 02 03 04 05 06 07 08 09 409 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 410 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 2E CB 411 F6 84 412 "," NOTE: Below is the snipet of show c output to illustrate packets are loadbalanced 413 Across all egress ports 414 For validating the RTAG7 setting on the trunk. Below is the counters output 415 CDMIB_RPKT.cd0 3 +3 1/s 416 CDMIB_RPKT.cd1 1 +1 417 CDMIB_RPKT.cd2 1 +1 418 CDMIB_RPKT.cd3 1 +1 1/s 419 CDMIB_TPKT.cd0 3 +3 1/s 420 CDMIB_TPKT.cd1 1 +1 421 CDMIB_TPKT.cd2 1 +1 422 CDMIB_TPKT.cd3 1 +1 1/s 423 " 424 ./tomahawk3/rtag7/random_lb_ecmp.c," This cint example configures randomized load balancing on the ECMP group using 425 BCM APIs 426 "," a) Select one ingress port and two egress ports and configure them in Loopback mode. 427 "," a) Create vlans 12, 13 and 14 and ingress_port, egress_port_1 and egress_port_2 as 428 members, respectively. 429 b) Create two L3 interfaces - on vlan13(egr_l3_if_1) and vlan14(egr_l3_if_2). 430 c) Create two egress objects - egr_obj_1(associated with egr_l3_if_1) and egr_obj_2 431 (associated with egr_l3_if_2). 432 d) Create an ECMP group with egress objects egr_obj_1 and egr_obj_2. Configure this 433 ECMP group to use randomized load balancing for next hop resolution. 434 e) Create an L3 route to reach 192.168.10.1 via this ECMP group 435 "," a) Transmit 50 copies of the below packet on the ingress port and verify that packets 436 are load balanced across the egress objects/ports using ""show counters"" 437 Packet 438 ====== 439 DA 0x00000000AAAA 440 SA 0x000000002222 441 VLAN 12 442 DIP 192.168.10.1 443 SIP 10.10.10.1 444 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 445 08 00 45 00 00 3C 00 00 00 00 40 FF 9B 0F 0A 0A 446 0A 01 C0 A8 0A 01 00 01 02 03 04 05 06 07 08 09 447 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 448 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 2E CB 449 F6 84 450 "," The packets should be load balanced across the egress object/ports. This can be 451 checked using ""show counters"". 452 " 453 ./tomahawk3/trunk/trunk_basic.c," This cint example details basic trunk configurations like trunk creation, adding ports 454 to the trunk, removing ports from the trunk, changing the selection policy, configuring 455 RTAG7 hashing based on the L4 ports. 456 "," a) Select one ingress port and three egress ports and configure them in Loopback mode. 457 "," a) Create a trunk and add ports egress_port_1 and egress_port_2 as members. Set the 458 selection criteria to BCM_TRUNK_PSC_RANDOMIZED (randomized load balancing). 459 b) Add another port (egress_port_3) to the trunk. 460 c) Remove the port (egress_port_3) from the trunk. 461 d) Change the selection criteria to BCM_TRUNK_PSC_PORTFLOW (RTAG7). 462 e) Configure RTAG7 hashing based on L4 Src and Dst ports 463 "," a) Transmit 10 packets with incremental L4 SrcPort and L4 DstPort on the ingress port 464 and verify that packets are load balanced across the egress ports using ""show counters"" 465 Packets 466 ======= 467 DA 0x00000000AAAA 468 SA 0x000000002222 469 VLAN 12 470 DIP 10.10.2.0 SIP 10.10.1.0 471 Src Port 5000 Dst Port 80 472 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 473 08 00 45 00 00 51 00 01 00 00 40 11 63 88 0A 0A 474 01 00 0A 0A 02 00 13 88 00 50 00 3D CE 40 28 20 475 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 476 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 477 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 478 00 20 FF 479 DA 0x00000000AAAA 480 SA 0x000000002222 481 VLAN 12 482 DIP 10.10.2.0 SIP 10.10.1.0 483 Src Port 5001 Dst Port 81 484 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 485 08 00 45 00 00 51 00 01 00 00 40 11 63 86 0A 0A 486 01 01 0A 0A 02 01 13 89 00 51 00 3D CE 3C 28 20 487 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 488 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 489 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 490 00 20 FF 491 DA 0x00000000AAAA 492 SA 0x000000002222 493 VLAN 12 494 DIP 10.10.2.0 SIP 10.10.1.0 495 Src Port 5002 Dst Port 82 496 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 497 08 00 45 00 00 51 00 01 00 00 40 11 63 84 0A 0A 498 01 02 0A 0A 02 02 13 8A 00 52 00 3D CE 38 28 20 499 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 500 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 501 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 502 00 20 FF 503 DA 0x00000000AAAA 504 SA 0x000000002222 505 VLAN 12 506 DIP 10.10.2.0 SIP 10.10.1.0 507 Src Port 5003 Dst Port 83 508 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 509 08 00 45 00 00 51 00 01 00 00 40 11 63 82 0A 0A 510 01 03 0A 0A 02 03 13 8B 00 53 00 3D CE 34 28 20 511 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 512 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 513 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 514 00 20 FF 515 DA 0x00000000AAAA 516 SA 0x000000002222 517 VLAN 12 518 DIP 10.10.2.0 SIP 10.10.1.0 519 Src Port 5004 Dst Port 84 520 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 521 08 00 45 00 00 51 00 01 00 00 40 11 63 80 0A 0A 522 01 04 0A 0A 02 04 13 8C 00 54 00 3D CE 30 28 20 523 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 524 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 525 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 526 00 20 FF 527 DA 0x00000000AAAA 528 SA 0x000000002222 529 VLAN 12 530 DIP 10.10.2.0 SIP 10.10.1.0 531 Src Port 5005 Dst Port 85 532 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 533 08 00 45 00 00 51 00 01 00 00 40 11 63 7E 0A 0A 534 01 05 0A 0A 02 05 13 8D 00 55 00 3D CE 2C 28 20 535 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 536 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 537 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 538 00 20 FF 539 DA 0x00000000AAAA 540 SA 0x000000002222 541 VLAN 12 542 DIP 10.10.2.0 SIP 10.10.1.0 543 Src Port 5006 Dst Port 86 544 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 545 08 00 45 00 00 51 00 01 00 00 40 11 63 7C 0A 0A 546 01 06 0A 0A 02 06 13 8E 00 56 00 3D CE 28 28 20 547 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 548 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 549 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 550 00 20 FF 551 DA 0x00000000AAAA 552 SA 0x000000002222 553 VLAN 12 554 DIP 10.10.2.0 SIP 10.10.1.0 555 Src Port 5007 Dst Port 87 556 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 557 08 00 45 00 00 51 00 01 00 00 40 11 63 7A 0A 0A 558 01 07 0A 0A 02 07 13 8F 00 57 00 3D CE 24 28 20 559 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 560 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 561 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 562 00 20 FF 563 DA 0x00000000AAAA 564 SA 0x000000002222 565 VLAN 12 566 DIP 10.10.2.0 SIP 10.10.1.0 567 Src Port 5008 Dst Port 88 568 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 569 08 00 45 00 00 51 00 01 00 00 40 11 63 78 0A 0A 570 01 08 0A 0A 02 08 13 90 00 58 00 3D CE 20 28 20 571 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 572 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 573 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 574 00 20 FF 575 DA 0x00000000AAAA 576 SA 0x000000002222 577 VLAN 12 578 DIP 10.10.2.0 SIP 10.10.1.0 579 Src Port 5009 Dst Port 89 580 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 581 08 00 45 00 00 51 00 01 00 00 40 11 63 76 0A 0A 582 01 09 0A 0A 02 09 13 91 00 59 00 3D CE 1C 28 20 583 DB 20 00 20 00 20 45 20 00 20 00 20 54 20 00 20 584 00 20 40 20 00 20 40 20 00 20 5E 20 A5 20 CA 20 585 0B 20 28 20 9E 20 C0 20 A8 20 28 20 B2 20 08 20 586 00 20 FF 587 "," The packets should be load balanced across all the trunk member ports. This 588 can be checked using ""show counters"" 589 " 590 ./tomahawk3/mmu/bst/bst.c," This cint example illustrates configuration of Buffer Statistics Tracking (BST) mechanism 591 to aid in resource monitoring and buffer allocation tuning. 592 ","a) Select one egress port on which bst has to be enabled. 593 "," a) Enable device level BST, BST tracking mode and snapshot view for 594 THDO, THDI and CFAP using switch controls - bst_global_setup 595 b) Set BST profile for specified mmu resource - bcmBstStatIdEgrPool in this 596 example 597 "," a) Check the Bst stats for the specified BST object - bcmBstStatIdEgrPool 598 "," If profile threshold is exceeded we see non-zero stats in value1 and value2 599 (It is assumed that traffic path setup between ingress and egress port and egress port is 600 congested so that shared buffer usage exceeds the profile threshold in this example) 601 " 602 ./tomahawk3/mmu/wred/wred_ecn.c," This cint example illustrates configuration of WRED and ECN feature 603 "," a) Select one ingress and one egress port 604 "," a) data_path_setup - sets up required data path for traffic 605 b) set_responsive_protocol_indication - sets IP Protocol's Responsive indication setting 606 c) ip_to_int_cn_mapping - maps IP header ECN bits to INT_CN value 607 d) int_cn_to_mmuif_mapping - INT_CN value to WRED_RESPONSIVE and MARK_ELIGIBLE configuration 608 e) mmu_wred_ecn_setup - MMU wred and ecn profile Settings 609 f) egr_int_cn_update - configure outgoing INT_CN value based on congestion status in MMU 610 g) egr_ecn_mark - Mark outgoing IP header ECN bits based on final INT_CN value 611 "," a) Transmit ICMP packets at line rate through Ixia connected to cd0 612 b) Transmit IGMP packets at line rate through Ixia connected to cd0 613 "," For ICMP packets - In case of congestion we should see ECN marking (ECN bits=11) 614 for packets egressing cd1. If no congestion, ECN marking will not happen (ECN bits=10) 615 FOR IGMP packets - In case of congestion, WRED drops will be seen on cd1. 616 This can be verified by WRED_PKT_GRE.cd1' in 'show c' output 617 If no congestion, No wred drops will be seen. 618 " 619 ./tomahawk3/mmu/sched/sched_profile.c," This cint example demonstrate creating a scheduler profile and attach it to a port 620 "," a) Select one egress port on which new scheduler profile has to be applied 621 "," a) Create scheduler profile with queue to COS mapping, scheduler mode for 622 each COS and attach created scheduler profile to port. 623 "," a) Verify the profile attachment to port using 'dump sw cosq' 624 "," In 'dump sw cosq' output 625 - UCQ0-7 should be mapped to COS0-7 626 - MCQ0-3 should be mapped to COS0-3 627 " 628 ./tomahawk3/mmu/flow_control/pause.c," This cint example demonstrates pause feature on TH3 629 "," a) Select one ingress and one egress port 630 "," a) Sets up required data path for traffic and sets up Tx and Rx Pause on 631 ports 632 "," a) Transmit l2 packet with dmac=0x1, vlan=1 at linerate to from Ixia 633 to cd0(Port-1) 634 b) Along with a), Transmit Pause frame(dmac=0x0180C2000001 smac=0x1 type=0x8808 opcode=0x0001) 635 at linerate to cd1 (Port-2) 636 (Pause frame: dmac=0x0180C2000001, smac=0x1, type=0x8808, opcode=0x0001) 637 "," For test case mentioned in a) 638 On cd0 (Port-1): verify that Pause frames should be transmitted at regular intervals as 639 egress port is congested. 640 In 'show c' output Pause frame Tx should be seen on cd0 (port-1) 641 On cd1 (Port-2): verify that packets egress at configured rate 642 For test case mentioned in b) 643 On cd1(Port-2): verify that Port does not egress any packets as pause frames are being 644 received. In 'show c' output, there should not be any Tx on on cd1 (port-2) 645 " 646 ./tomahawk3/mmu/flow_control/pfc.c," This cint example demonstrates PFC feature on TH3 647 "," a) Select one ingress and one egress port 648 "," a) Sets up required data path for traffic and enables PFC Tx and Rx on 649 ports 650 "," a) send at linerate to cd0 L2 learnt packets (vlan=1 prio=2 dmac=0x1 smac=0x2) 651 b) Along with a), send at linerate to cd1 PFC frames with pause-control class 2 enabled 652 "," For test case mentioned in a) 653 On cd0 (Port-1): verify that PFC frames should be transmitted at regular intervals as 654 egress port is congested. 655 In 'show c' output, PFC frame Tx should be seen on cd0 (port-1) 656 On cd1 (Port-2): packets should egress at configured rate 657 For test case mentioned in b) 658 Port cd1 should not egress any packets as pfc pasue frames are being 659 received. In 'show c' output, there should not be any Tx on on cd1 (port-2) 660 " 661 ./tomahawk3/L2/l2_mc.c," This CINT configures L2 multicast using BCM APIs. 662 This example shows the steps to set up L2 multicast along with Port 663 Filtering Mode(PFM) on a per Vlan basis. The PFM controls the forwarding of 664 known and unknown multicast packets. 665 PFM 666 === 667 0 - All multicast packets are flooded to the entire Vlan 668 1 - Known multicast packets are forwarded only to the ports in the 669 multicast group. Unknown multicast packets are flooded to the Vlan. 670 2 - Known multicast packets are forwarded only to the ports in the 671 multicast group. Unknown multicast packets are dropped. 672 "," a) Select one ingress and three egress ports and configure them in 673 Loopback mode. Install a rule to copy incoming packets to CPU and 674 additional action to drop the packets when it loops back on egress 675 ports. Start packet watcher. 676 "," a) Create a VLAN(2) and add egress_port1, egress_port2 and egress_port3 677 as members. 678 b) Create a L2 multicast group and add egress_port1, egress_port2 and egress_port3 to 679 this L2 multicast group. 680 c) Configure the PFM mode as BCM_VLAN_MCAST_FLOOD_NONE(mode 2) for VLAN(2). 681 d) Add ingress_port as member of vlan(2) and add an entry into L2 table 682 specifying the L2 multicast group as destination for the multicast MAC 683 address. 684 "," a) Transmit the below known multicast packet on ingress_port. 685 Packet: 686 ====== 687 Ethernet II, Src: Xerox_00:00:00 (00:00:04:00:00:00), Dst: Xerox_00:01:00 (01:00:04:00:01:00) 688 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 2 689 0100 0400 0100 0000 0400 0000 8100 0002 690 0800 0001 0203 0405 0607 0809 0a0b 0c0d 691 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 692 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 693 8e0b ec9e 1cdf 4421 694 b) Transmit the below unknown multicast packet on ingress_port and verify that the 695 packet is dropped as PFM for VLAN(2) is set to 2. 696 Packet: 697 ====== 698 Ethernet II, Src: Xerox_00:00:00 (00:00:04:00:00:00), Dst: Xerox_00:01:00 (01:00:03:00:01:00) 699 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 2 700 0100 0300 0100 0000 0400 0000 8100 0002 701 0800 0001 0203 0405 0607 0809 0a0b 0c0d 702 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 703 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 704 5ca6 4d2a 1cdf 4421 705 "," After Step 3.a, the packet egresses out of egress_port1, egress_port2 and egress_port3. 706 This can be observed using ""show counters"" and/or packet watcher dump on console. 707 After step 3.b, it can be observed that packet is dropped as PFM for VLAN(2) is set to 708 BCM_VLAN_MCAST_FLOOD_NONE(mode 2) 709 " 710 ./tomahawk3/L2/vlan_port_flex_ctr.c," This CINT example configures flex counters using BCM APIs. 711 Flex counters provide common counter resource that can be assigned for 712 different modules.The packet attributes on which the counters can be 713 configured are also flexible.They can be configured either in Fixed mode 714 or Custom mode. The following example shows Vlan flex stats in custom 715 mode and Port flex stats in fixed mode. 716 vlan flex stats [custom mode] 717 =============================== 718 Accountung object : Vlan [5] 719 Attributes : Outer tag [offset 0] and untag [offset 1] 720 Stage : Ingress specified through flag BCM_STAT_GROUP_MODE_INGRESS 721 of bcm_stat_group_mode_id_create 722 port flex stats [fixed mode] 723 =============================== 724 Accounting object : ingress_port2 725 GroupMode : TrafficType [unicast counter at offset 0 726 multicast counter at offset 1 727 broadcast counter at offset 2] 728 "," a) Selects two ingress ports and configure them in Loopback mode. 729 Install a rule to copy incoming packets to CPU and start packet watcher. 730 "," a) Creates a VLAN(5). 731 b) Create a custom stat group mode and create a stat group using the 732 created ""custom stat group mode"". 733 c) Attach the stat group to VLAN. 734 d) Create another stat group using existing fixed group and attach it to port. 735 Step 3 - Verification(Done in verify()) 736 ======================================= 737 a) Send 3 outer tagged packet, retrieve vlan flex counters and print them. 738 b) Send 2 untagged packets, retrieve vlan flex counters and print them. 739 c) Send 2 broadcast packets onto ingress_port2, retrieve port 740 flex counters and print them. 741 d) Send 3 multicast packets onto ingress_port2, retrieve port 742 flex counters and print them. 743 e) Send 4 unicast packets onto ingress_port2, retrieve port 744 flex counters and print them. 745 f) Expected Result: 746 =================== 747 After step 3.a, verify(from generated console log) that packet counter 748 at offset 0 (outer tagged packets) is 3. 749 After step 3.b, verify(from generated console log) that packet counter 750 at offset 1 (untagged packets) is 2. 751 After step 3.c, verify(from generated console log) that packet counter 752 at offset 2 (broadcast packets) is 2. 753 After step 3.d, verify(from generated console log) that packet counter 754 at offset 1 (multicast packets) is 3. 755 After step 3.e, verify(from generated console log) that packet counter 756 at offset 0 (unicast packets) is 4. 757 / 758 cint_reset(); 759 bcm_port_t ingress_port1, ingress_port2; 760 /* This function is written so that hardcoding of port 761 numbers in Cint scripts is removed. This function gives 762 required number of ports 763 */ 764 port_list, int num_ports) 765 { 766 int i=0,port=0,rv=0; 767 bcm_port_config_t configP; 768 bcm_pbmp_t ports_pbmp; 769 rv = bcm_port_config_get(unit,&configP); 770 if(BCM_FAILURE(rv)) { 771 printf(""\nError in retrieving port configuration: %s.\n"",bcm_errmsg(rv)); 772 return rv; 773 } 774 ports_pbmp = configP.e; 775 for (i= 1; i < BCM_PBMP_PORT_MAX; i++) { 776 if (BCM_PBMP_MEMBER(&ports_pbmp,i)&& (port < num_ports)) { 777 port_list[port]=i; 778 port++; 779 } 780 } 781 if (( port == 0 ) || ( port != num_ports )) { 782 printf(""portNumbersGet() failed \n""); 783 return -1; 784 } 785 return BCM_E_NONE; 786 } 787 /* 788 Configures the port in loopback mode and installs 789 an IFP rule. This IFP rule copies the packets ingressing 790 on the specified port to CPU. 791 / 792 bcm_error_t ingress_port_setup(int unit, bcm_port_t port) 793 { 794 bcm_field_qset_t qset; 795 bcm_field_group_t group; 796 bcm_field_entry_t entry; 797 BCM_IF_ERROR_RETURN(bcm_port_loopback_set(unit, port, BCM_PORT_LOOPBACK_PHY)); 798 BCM_FIELD_QSET_INIT(qset); 799 BCM_FIELD_QSET_ADD(qset, bcmFieldQualifyInPort); 800 BCM_IF_ERROR_RETURN(bcm_field_group_create(unit, qset, 0, &group)); 801 BCM_IF_ERROR_RETURN(bcm_field_entry_create(unit, group, &entry)); 802 BCM_IF_ERROR_RETURN(bcm_field_qualify_InPort(unit, entry, port, BCM_FIELD_EXACT_MATCH_MASK)); 803 BCM_IF_ERROR_RETURN(bcm_field_action_add(unit, entry, bcmFieldActionCopyToCpu, 0, 0)); 804 BCM_IF_ERROR_RETURN(bcm_field_entry_install(unit, entry)); 805 return BCM_E_NONE; 806 } 807 /* 808 Configures the port in loopback mode and installs 809 an IFP rule. This IFP rule copies the packets ingressing 810 on the specified port to CPU and drop the packets. This is 811 to avoid continuous loopback of the packet. 812 / 813 bcm_error_t egress_port_setup(int unit, bcm_port_t port) 814 { 815 bcm_field_qset_t qset; 816 bcm_field_group_t group; 817 bcm_field_entry_t entry; 818 BCM_IF_ERROR_RETURN(bcm_port_loopback_set(unit, port, BCM_PORT_LOOPBACK_PHY)); 819 BCM_IF_ERROR_RETURN(bcm_port_discard_set(unit, port, BCM_PORT_DISCARD_ALL)); 820 BCM_FIELD_QSET_INIT(qset); 821 BCM_FIELD_QSET_ADD(qset, bcmFieldQualifyInPort); 822 BCM_IF_ERROR_RETURN(bcm_field_group_create(unit, qset, 0, &group)); 823 BCM_IF_ERROR_RETURN(bcm_field_entry_create(unit, group, &entry)); 824 BCM_IF_ERROR_RETURN(bcm_field_qualify_InPort(unit, entry, port, BCM_FIELD_EXACT_MATCH_MASK)); 825 BCM_IF_ERROR_RETURN(bcm_field_action_add(unit, entry, bcmFieldActionCopyToCpu, 0, 0)); 826 BCM_IF_ERROR_RETURN(bcm_field_action_add(unit, entry, bcmFieldActionDrop, 0, 0)); 827 BCM_IF_ERROR_RETURN(bcm_field_entry_install(unit, entry)); 828 return BCM_E_NONE; 829 } 830 /* 831 This functions gets the port numbers and sets up ingress and 832 egress ports. Check ingress_port_setup() and egress_port_setup(). 833 / 834 bcm_error_t test_setup(int unit) 835 { 836 int port_list[2], i; 837 if (BCM_E_NONE != portNumbersGet(unit, port_list, 2)) { 838 printf(""portNumbersGet() failed\n""); 839 return -1; 840 } 841 ingress_port1 = port_list[0]; 842 ingress_port2 = port_list[1]; 843 for (i = 0; i < 2; i++) { 844 if (BCM_E_NONE != ingress_port_setup(unit, port_list[i])) { 845 printf(""ingress_port_setup() failed for port %d\n"", port_list[i]); 846 return -1; 847 } 848 } 849 bshell(unit, ""pw start report +raw +decode""); 850 return BCM_E_NONE; 851 } 852 / 853 int 854 configure_vlan(int unit, bcm_vlan_t vlan, bcm_port_t port) 855 { 856 bcm_error_t rv; 857 bcm_pbmp_t pbmp, ubmp; 858 BCM_PBMP_CLEAR(ubmp); 859 BCM_PBMP_CLEAR(pbmp); 860 BCM_PBMP_PORT_ADD(pbmp, port); 861 rv = bcm_vlan_create(unit, vlan); 862 if ((BCM_FAILURE(rv)) & (rv != BCM_E_EXISTS)) { 863 printf(""Error in creating vlan : %s.\n"", bcm_errmsg(rv)); 864 return rv; 865 } 866 rv = bcm_vlan_port_add(unit, vlan, pbmp, ubmp); 867 if(BCM_FAILURE(rv)) { 868 printf(""\nError executing bcm_vlan_port_add(): %s.\n"",bcm_errmsg(rv)); 869 return rv; 870 } 871 return BCM_E_NONE; 872 } 873 /* Configure flex counters for Vlan in Custom mode*/ 874 int 875 configure_vlan_flex_ctr(int unit, bcm_vlan_t vlan) 876 { 877 uint32 mode_id; 878 bcm_stat_group_mode_attr_selector_t attr_sel[2]; 879 uint32 num_sel = 2; 880 uint32 vlan_counters = 2; 881 uint32 stat_id; 882 uint32 num_entries; 883 bcm_error_t rv; 884 /* 885 Customized group mode is defined using a set of bcm_stat_group_mode_attr_selectors. 886 To uniquely specify a counter, below three properties are needed 887 Attribute selector[in this case bcmStatGroupModeAttrVlan], 888 Attribute Value to match [Outer tag and untagged] 889 and Offset [Outer tag at offset '0' and untag at offset '1'] 890 / 891 bcm_stat_group_mode_attr_selector_t_init(&attr_sel[0]); 892 attr_sel[0].counter_offset = 0; 893 attr_sel[0].attr = bcmStatGroupModeAttrVlan; 894 attr_sel[0].attr_value = bcmStatGroupModeAttrVlanOuterTag; 895 bcm_stat_group_mode_attr_selector_t_init(&attr_sel[1]); 896 attr_sel[1].counter_offset = 1; 897 attr_sel[1].attr = bcmStatGroupModeAttrVlan; 898 attr_sel[1].attr_value = bcmStatGroupModeAttrVlanUnTagged; 899 / 900 rv = bcm_stat_group_mode_id_create(unit, BCM_STAT_GROUP_MODE_INGRESS, 901 vlan_counters, num_sel, attr_sel, &mode_id); 902 if(BCM_FAILURE(rv)) { 903 printf(""\nError in creating stat group mode: %s.\n"",bcm_errmsg(rv)); 904 return rv; 905 } 906 / 907 rv = bcm_stat_custom_group_create(unit, mode_id, bcmStatObjectIngVlan, 908 &stat_id, &num_entries); 909 if(BCM_FAILURE(rv)) { 910 printf(""\nError in creating stat group : %s.\n"",bcm_errmsg(rv)); 911 return rv; 912 } 913 / 914 rv = bcm_vlan_stat_attach(unit, vlan, stat_id); 915 if(BCM_FAILURE(rv)) { 916 printf(""\nError in vlan stat attach %s.\n"", bcm_errmsg(rv)); 917 return rv; 918 } 919 return BCM_E_NONE; 920 } 921 / 922 int 923 configure_port_flex_ctr(int unit, bcm_port_t port) 924 { 925 bcm_error_t rv; 926 uint32 stat_id; 927 uint32 num_entries; 928 bcm_gport_t gport; 929 / 930 rv = bcm_stat_group_create(unit, bcmStatObjectIngPort, bcmStatGroupModeTrafficType, 931 &stat_id, &num_entries); 932 if(BCM_FAILURE(rv)) { 933 printf(""\nError in stat group creation %s.\n"", bcm_errmsg(rv)); 934 return rv; 935 } 936 printf(""Counter Id is %d\n"", stat_id); 937 rv = bcm_port_gport_get(unit,port, &gport); 938 if(BCM_FAILURE(rv)) { 939 printf(""\nError in gport get %s.\n"", bcm_errmsg(rv)); 940 return rv; 941 } 942 / 943 rv = bcm_port_stat_attach(unit, gport, stat_id); 944 if(BCM_FAILURE(rv)) { 945 printf(""\nError in port stat attach %s.\n"", bcm_errmsg(rv)); 946 return rv; 947 } 948 return BCM_E_NONE; 949 } 950 int 951 vlan_flex_stat_get(bcm_vlan_t vlan) 952 { 953 int unit = 0; 954 int i; 955 uint32 index[2] = {0, 1}; 956 bcm_stat_value_t value[2]; 957 uint32 num_entries = 2; 958 bcm_vlan_stat_t stat[2] = {bcmVlanStatIngressPackets, bcmVlanStatIngressBytes}; 959 uint64 val; 960 bcm_error_t rv; 961 /* 962 COMPILER_64_HI and COMPILER_64_LO for 64-32 bit conversion 963 / 964 / 965 for(i=0; i<2; i++) { 966 rv = bcm_vlan_stat_counter_get(unit, vlan, stat[i], num_entries, index, value); 967 if(BCM_FAILURE(rv)) { 968 printf(""\nError executing bcm_vlan_stat_counter_get(): %s.\n"",bcm_errmsg(rv)); 969 return rv; 970 } 971 switch(stat[i]) { 972 case bcmVlanStatIngressPackets : 973 printf(""Packet counter at offset 0 (outer tagged packets) is 0x%x%x\n"", 974 COMPILER_64_HI(value[0].packets64), 975 COMPILER_64_LO(value[0].packets64)); 976 printf(""Packet counter at offset 1 (untag packets) is 0x%x%x\n"", 977 COMPILER_64_HI(value[1].packets64), 978 COMPILER_64_LO(value[1].packets64)); 979 break; 980 case bcmVlanStatIngressBytes : 981 printf(""Byte counter at offset 0 (for outer tagged packets) is 0x%x%x\n"", 982 COMPILER_64_HI(value[0].bytes), 983 COMPILER_64_LO(value[0].bytes)); 984 printf(""Byte counter at offset 1 (for untag packets) is 0x%x%x\n"", 985 COMPILER_64_HI(value[1].bytes), 986 COMPILER_64_LO(value[1].bytes)); 987 break; 988 } 989 } 990 return BCM_E_NONE; 991 } 992 int 993 port_flex_stat_get(bcm_port_t port) 994 { 995 int unit = 0; 996 int i,j; 997 bcm_gport_t gport; 998 uint32 index[3] = {0, 1, 2}; 999 bcm_stat_value_t value[3]; 1000 uint32 num_entries = 3; 1001 bcm_port_stat_t stat[2] = {bcmPortStatIngressPackets, bcmPortStatIngressBytes}; 1002 uint64 val; 1003 bcm_error_t rv; 1004 rv = bcm_port_gport_get(0, port, &gport); 1005 if(BCM_FAILURE(rv)) { 1006 printf(""\nError in gport get: %s.\n"",bcm_errmsg(rv)); 1007 return rv; 1008 } 1009 /* 1010 COMPILER_64_HI and COMPILER_64_LO for 64-32 bit conversion 1011 / 1012 / 1013 for(i = 0; i < 2; i++) { 1014 rv = bcm_port_stat_counter_get(unit, gport, stat[i], num_entries, 1015 index, value); 1016 if(BCM_FAILURE(rv)) { 1017 printf(""\nError in port counter get: %s.\n"",bcm_errmsg(rv)); 1018 return rv; 1019 } 1020 switch(stat[i]) { 1021 case bcmVlanStatIngressPackets : 1022 printf(""Packet counter at offset 0 (unicast packets) is 0x%x%x\n"", 1023 COMPILER_64_HI(value[0].packets64), 1024 COMPILER_64_LO(value[0].packets64)); 1025 printf(""Packet counter at offset 1 (multicast packets) is 0x%x%x\n"", 1026 COMPILER_64_HI(value[1].packets64), 1027 COMPILER_64_LO(value[1].packets64)); 1028 printf(""Packet counter at offset 2 (broadcast packets) is 0x%x%x\n"", 1029 COMPILER_64_HI(value[2].packets64), 1030 COMPILER_64_LO(value[2].packets64)); 1031 break; 1032 case bcmVlanStatIngressBytes : 1033 printf(""Byte counter at offset 0 (for unicast packets) is 0x%x%x\n"", 1034 COMPILER_64_HI(value[0].bytes), 1035 COMPILER_64_LO(value[0].bytes)); 1036 printf(""Byte counter at offset 1 (for multicast packets) is 0x%x%x\n"", 1037 COMPILER_64_HI(value[1].bytes), 1038 COMPILER_64_LO(value[1].bytes)); 1039 printf(""Byte counter at offset 2 (for broadcast packets) is 0x%x%x\n"", 1040 COMPILER_64_HI(value[2].bytes), 1041 COMPILER_64_LO(value[2].bytes)); 1042 break; 1043 } 1044 } 1045 return BCM_E_NONE; 1046 } 1047 void verify(int unit) 1048 { 1049 char str[512]; 1050 bshell(unit, ""hm ieee""); 1051 /* Send 3 outer tagged packet. 1052 Ethernet header: DA=00:00:00:00:00:02, SA=00:00:00:00:00:01 1053 Vlan Header: TPID0x8100, VLAN=5, Priority=0, CFI=0 1054 000000000002 000000000001 1055 8100 1056 0005 1057 0800080045000062000000004011A4D7C0A801010A0A0A01003F2118004E000008000000012345000000000011AA00006DBAC047 1058 / 1059 printf(""Sending 3 outer tagged packets.\n""); 1060 snprintf(str, 512, ""tx 3 pbm=%d data=0x000000000002000000000001810000050800080045000062000000004011A4D7C0A801010A0A0A01003F2118004E000008000000012345000000000011AA00006DBAC047; sleep 1"", ingress_port1); 1061 bshell(unit, str); 1062 /*Retrieve vlan flex counters and print them.*/ 1063 printf(""Retrieving vlan flex counters and displaying them\n""); 1064 vlan_flex_stat_get(5); 1065 /* Send 2 untagged packets. 1066 Ethernet header: DA=00:00:00:00:00:02, SA=00:00:00:00:00:01 1067 000000000002 000000000001 1068 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2FDF52E538 1069 / 1070 printf(""Sending 2 untagged packets.\n""); 1071 snprintf(str, 512, ""tx 2 pbm=%d data=0x000000000002000000000001000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2FDF52E538; sleep 1"", ingress_port1); 1072 bshell(unit, str); 1073 /*Retrieve vlan flex counters and print them.*/ 1074 printf(""Retrieving vlan flex counters and displaying them\n""); 1075 vlan_flex_stat_get(5); 1076 /* Send 2 broadcast packets onto ingress_port2. 1077 Ethernet header: DA=FF:FF:FF:FF:FF:FF, SA=00:00:00:00:00:10 1078 Vlan Header: TPID0x8100, VLAN=2, Priority=1, CFI=0 1079 FFFFFFFFFFFF 000000000010 1080 8100 1081 2002 1082 0800000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D58093531 1083 / 1084 printf(""Sending 2 broadcast packets onto ingress_port2:%d\n"", ingress_port2); 1085 snprintf(str, 512, ""tx 2 pbm=%d data=0xFFFFFFFFFFFF000000000010810020020800000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D58093531; sleep 1"", ingress_port2); 1086 bshell(unit, str); 1087 /*Retrieve port flex counters and print them.*/ 1088 printf(""Retrieving port flex counters and displaying them\n""); 1089 port_flex_stat_get(ingress_port2); 1090 /* Sending 3 multicast packets onto ingress_port2. 1091 Ethernet header: DA=01:00:04:00:01:00, SA=00:00:04:00:00:00 1092 Vlan Header: TPID0x8100, VLAN=2, Priority=0, CFI=0 1093 010004000100 000004000000 1094 8100 1095 0002 1096 0800000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D8E0BEC9E 1097 / 1098 printf(""Sending 3 multicast packets onto ingress_port2:%d\n"", ingress_port2); 1099 snprintf(str, 512, ""tx 3 pbm=%d data=0x010004000100000004000000810000020800000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D8E0BEC9E; sleep 1"", ingress_port2); 1100 bshell(unit, str); 1101 /*Retrieve port flex counters and print them.*/ 1102 printf(""Retrieving port flex counters and displaying them\n""); 1103 port_flex_stat_get(ingress_port2); 1104 /* Sending 4 unicast packets onto ingress_port2. 1105 Ethernet header: DA=00:00:00:00:00:02, SA=00:00:00:00:00:01 1106 Vlan Header: TPID0x8100, VLAN=2, Priority=6, CFI=0 1107 000000000002 000000000001 1108 8100 1109 C002 1110 08004500002E0000000040FF63BC010101010A0A0A0A000102030405060708090A0B0C0D0E0F101112131415161718194FA8E232 1111 / 1112 printf(""Sending 4 unicast packets onto ingress_port2:%d\n"", ingress_port2); 1113 snprintf(str, 512, ""tx 4 pbm=%d data=0x0000000000020000000000018100C00208004500002E0000000040FF63BC010101010A0A0A0A000102030405060708090A0B0C0D0E0F101112131415161718194FA8E232; sleep 1"", ingress_port2); 1114 bshell(unit, str); 1115 /*Retrieve port flex counters and print them.*/ 1116 printf(""Retrieving port flex counters and displaying them\n""); 1117 port_flex_stat_get(ingress_port2); 1118 } 1119 /* Creates a VLAN(5) and attaches a flex counter to it. 1120 Attaches a flex counter to ingress_port2. 1121 / 1122 int 1123 vlan_port_flex_ctr(int unit) 1124 { 1125 bcm_error_t rv; 1126 / 1127 bcm_vlan_t vlan1 = 2; 1128 bcm_port_t vlan_port = ingress_port1; 1129 rv = configure_vlan(unit, vlan, ingress_port1); 1130 if(BCM_FAILURE(rv)) { 1131 printf(""\nError in configuring vlan: %s.\n"",bcm_errmsg(rv)); 1132 return rv; 1133 } 1134 rv = bcm_port_untagged_vlan_set(unit, ingress_port1, vlan); 1135 if(BCM_FAILURE(rv)) { 1136 printf(""\nError in configuring port_untagged_vlan: %s.\n"",bcm_errmsg(rv)); 1137 return rv; 1138 } 1139 rv = configure_vlan_flex_ctr(unit, vlan); 1140 if(BCM_FAILURE(rv)) { 1141 printf(""\nError in configuring flex counter for vlan: %s.\n"", 1142 bcm_errmsg(rv)); 1143 return rv; 1144 } 1145 rv = configure_vlan(unit, vlan1, ingress_port2); 1146 if(BCM_FAILURE(rv)) { 1147 printf(""\nError in configuring vlan: %s.\n"",bcm_errmsg(rv)); 1148 return rv; 1149 } 1150 rv = configure_port_flex_ctr(unit, ingress_port2); 1151 if(BCM_FAILURE(rv)) { 1152 printf(""\nError in configuring flex counter for port: %s.\n"", 1153 bcm_errmsg(rv)); 1154 return rv; 1155 } 1156 return BCM_E_NONE; 1157 } 1158 /* 1159 This functions does the following 1160 a)test setup 1161 b)actual configuration (Done in vlan_port_flex_ctr()) 1162 c)demonstrates the functionality(done in verify()). 1163 / 1164 bcm_error_t execute() 1165 { 1166 bcm_error_t rv; 1167 int unit =0; 1168 bshell(unit, ""config show; a ; version""); 1169 if (BCM_FAILURE((rv = test_setup(unit)))) { 1170 printf(""test_setup() failed.\n""); 1171 return -1; 1172 } 1173 printf(""Completed test setup successfully.\n""); 1174 if (BCM_FAILURE((rv = vlan_port_flex_ctr(unit)))) { 1175 printf(""vlan_port_flex_ctr() failed.\n""); 1176 return -1; 1177 } 1178 printf(""Completed configuration(i.e executing vlan_port_flex_ctr()) successfully.\n""); 1179 verify(unit); 1180 return BCM_E_NONE; 1181 } 1182 print execute(); 1183 ",, 1184 ./tomahawk3/ip_tunnel/l3_tunnel_ipgre_4in6.c," This cint example demonstrates L3 Ipv4 in Ipv6 GRE Tunnel initiation and termination 1185 using BCM APIs. 1186 "," a) Selects two ports and configure them in Loopback mode. Out of these two ports, 1187 one port is used as access_port and the other as network port. Install a rule 1188 to copy incoming packets to CPU and start packet watcher. 1189 "," a) Create an access_vlan(21) and add access_port as member. 1190 b) Create network_vlan(22) and add network_port as member. 1191 c) Create two L3 interfaces one each for access side and network side. 1192 d) Create two L3 egress objects one each for access side and network side. 1193 e) Configure tunnel initiator(type = bcmTunnelTypeGre4In6) 1194 on network side L3 interface. 1195 f) Configure tunnel terminator(type = bcmTunnelTypeGre4In6) 1196 to match on packet's tunnel header contents. 1197 g) For tunnel initiation, add a L3 route pointing to network side egress object. 1198 h) For tunnel termination, add a L3 route pointing to access side egress object. 1199 "," a) For Ipv4 in Ipv6 GRE tunnel initiation, send the below IPv4 packet on access_port. 1200 Ethernet II, Src: 00:00:00_00:11:11 (00:00:00:00:11:11), Dst: 00:00:00_00:00:01 (00:00:00:00:00:01) 1201 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 21 1202 Internet Protocol Version 4, Src: 2.2.2.2, Dst: 1.1.1.1 1203 Data (26 bytes) 1204 0000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ................ 1205 0010 10 11 12 13 14 15 16 17 18 19 .......... 1206 0000 0000 0001 0000 0000 1111 8100 0015 1207 0800 4500 002e 0000 0000 40ff 73cc 0202 1208 0202 0101 0101 0001 0203 0405 0607 0809 1209 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1210 b)For Ipv4 in IPv6 GRE Tunnel Termination, send the below packet on network_port. 1211 Ethernet II, Src: 00:00:00_00:22:22 (00:00:00:00:22:22), Dst: 00:00:00_00:00:02 (00:00:00:00:00:02) 1212 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 22 1213 Internet Protocol Version 6, Src: cc00::1, Dst: dd00::1 1214 Generic Routing Encapsulation (IP) 1215 Internet Protocol Version 4, Src: 1.1.1.1, Dst: 2.2.2.2 1216 0000 0000 0002 0000 0000 2222 8100 0016 1217 86dd 6030 0000 0018 2fff cc00 0000 0000 1218 0000 0000 0000 0000 0001 dd00 0000 0000 1219 0000 0000 0000 0000 0001 0000 0800 4500 1220 0014 0000 0000 40ff 73e6 0101 0101 0202 1221 0202 9d9c b928 1222 "," After step 3.a, verify that the below IP-GRE tunnel packet egresses out 1223 of network_port. 1224 Ethernet II, Src: 00:00:00_00:00:02 (00:00:00:00:00:02), Dst: 00:00:00_00:22:22 (00:00:00:00:22:22) 1225 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 22 1226 Internet Protocol Version 6, Src: ee00::1, Dst: ff00::1 1227 Generic Routing Encapsulation (IP) 1228 Internet Protocol Version 4, Src: 2.2.2.2, Dst: 1.1.1.1 1229 Data (26 bytes) 1230 0000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ................ 1231 0010 10 11 12 13 14 15 16 17 18 19 .......... 1232 0000 0000 2222 0000 0000 0002 8100 0016 1233 86dd 6000 0000 0032 2f0a ee00 0000 0000 1234 0000 0000 0000 0000 0001 ff00 0000 0000 1235 0000 0000 0000 0000 0001 0000 0800 4500 1236 002e 0000 0000 3fff 74cc 0202 0202 0101 1237 0101 0001 0203 0405 0607 0809 0a0b 0c0d 1238 0e0f 1011 1213 1415 1617 1819 fb82 e0b2 1239 After step 3.b, verify that the below packet egresses out of access_port. 1240 Ethernet II, Src: 00:00:00_00:00:01 (00:00:00:00:00:01), Dst: 00:00:00_00:11:11 (00:00:00:00:11:11) 1241 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 21 1242 Internet Protocol Version 4, Src: 1.1.1.1, Dst: 2.2.2.2 1243 0000 0000 1111 0000 0000 0001 8100 0015 1244 0800 4500 0014 0000 0000 feff b5e5 0101 1245 0101 0202 0202 9d9c b928 1246 " 1247 ./tomahawk3/ip_tunnel/l3_tunnel_ipgre.c," This cint example demonstrates IP-GRE tunnel initiation and termination 1248 using BCM APIs. 1249 "," a) Selects two ports and configure them in Loopback mode. Out of these two ports, 1250 one port is used as access_port and the other as network port. Install a rule 1251 to copy incoming packets to CPU and start packet watcher. 1252 "," a) Create an access_vlan(21) and add access_port as member. 1253 b) Create network_vlan(22) and add network_port as member. 1254 c) Create two L3 interfaces one each for access side and network side. 1255 d) Create two L3 egress objects one each for access side and network side. 1256 e) Configure tunnel initiator(type = bcmTunnelTypeGre4In4) 1257 on network side L3 interface. 1258 f) Configure tunnel terminator(type = bcmTunnelTypeGre4In4) 1259 to match on packet's tunnel header contents. 1260 g) For tunnel initiation, add a L3 route pointing to network side egress object. 1261 h) For tunnel termination, add a L3 route pointing to access side egress object. 1262 "," a) For IP-GRE tunnel initiation, send the below packet on access_port. 1263 Ethernet II, Src: 00:00:00_00:00:01 (00:00:00:00:00:01), Dst: 00:00:00_00:11:11 (00:00:00:00:11:11) 1264 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 21 1265 Internet Protocol Version 4, Src: 2.2.2.2, Dst: 1.1.1.1 1266 User Datagram Protocol, Src Port: 63, Dst Port: 63 1267 Data (14 bytes) 1268 0000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d .............. 1269 0000 0000 1111 0000 0000 0001 8100 0015 1270 0800 4500 002a 0000 0000 4011 74be 0202 1271 0202 0101 0101 003f 003f 0016 cf0d 0001 1272 0203 0405 0607 0809 0a0b 0c0d f971 7221 1273 b)For IP-GRE Tunnel Termination, send the below packet on network_port 1274 Ethernet II, Src: 00:00:00_00:00:02 (00:00:00:00:00:02), Dst: 00:00:00_00:22:22 (00:00:00:00:22:22) 1275 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 22 1276 Internet Protocol Version 4, Src: 9.9.9.9, Dst: 10.10.10.10 1277 Generic Routing Encapsulation (IP) 1278 Internet Protocol Version 4, Src: 1.1.1.1, Dst: 2.2.2.2 1279 User Datagram Protocol, Src Port: 63, Dst Port: 63 1280 0000 0000 2222 0000 0000 0002 8100 0016 1281 0800 4500 0034 0000 0000 402f 5476 0909 1282 0909 0a0a 0a0a 0000 0800 4500 001c 0000 1283 0000 4011 74cc 0101 0101 0202 0202 003f 1284 003f 0008 f95a 0e73 0ded 1285 "," After step 3.a, verify that the below IP-GRE tunnel packet egresses out 1286 of network_port. 1287 Ethernet II, Src: 00:00:00_00:22:22 (00:00:00:00:22:22), Dst: 00:00:00_00:00:02 (00:00:00:00:00:02) 1288 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 22 1289 Internet Protocol Version 4, Src: 10.10.10.10, Dst: 9.9.9.9 1290 Generic Routing Encapsulation (IP) 1291 Flags and Version: 0x0000 1292 Protocol Type: IP (0x0800) 1293 Internet Protocol Version 4, Src: 2.2.2.2, Dst: 1.1.1.1 1294 User Datagram Protocol, Src Port: 63, Dst Port: 63 1295 Data (14 bytes) 1296 0000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d .............. 1297 0000 0000 0002 0000 0000 2222 8100 0016 1298 0800 4500 0042 0000 0000 162f 7e68 0a0a 1299 0a0a 0909 0909 0000 0800 4500 002a 0000 1300 0000 3f11 75be 0202 0202 0101 0101 003f 1301 003f 0016 cf0d 0001 0203 0405 0607 0809 1302 0a0b 0c0d f971 7221 1303 After step 3.b, verify that the below packet egresses out of access_port. 1304 Ethernet II, Src: 00:00:00_00:11:11 (00:00:00:00:11:11), Dst: 00:00:00_00:00:01 (00:00:00:00:00:01) 1305 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 21 1306 Internet Protocol Version 4, Src: 1.1.1.1, Dst: 2.2.2.2 1307 User Datagram Protocol, Src Port: 63, Dst Port: 63 1308 0000 0000 0001 0000 0000 1111 8100 0015 1309 0800 4500 001c 0000 0000 3f11 75cc 0101 1310 0101 0202 0202 003f 003f 0008 f95a 0e73 1311 0ded 1312 " 1313 ./tomahawk3/ip_tunnel/l3_tunnel_mcast_ipgre.c," This cint example demonstrates multicast IP-GRE tunnel initiation and termination 1314 using BCM APIs. 1315 "," a) Selects two ports and configure them in Loopback mode. Out of these two ports, 1316 one port is used as access_port and the other as network port. Install a rule 1317 to copy incoming packets to CPU and start packet watcher. 1318 "," a) Create an access_vlan(21) and add access_port as member. 1319 b) Create network_vlan(22) and add network_port as member. 1320 c) Create two L3 interfaces one each for access side and network side. 1321 d) Create two L3 egress objects one each for access side and network side. 1322 e) Configure tunnel initiator(type = bcmTunnelTypeGre4In4) 1323 on network side L3 interface. 1324 f) Configure tunnel terminator(type = bcmTunnelTypeGre4In4) 1325 to match on packet's tunnel header contents. 1326 g) For tunnel initiation, add a L3 route pointing to network side egress object. 1327 h) For tunnel termination, add a L3 route pointing to access side egress object. 1328 "," a) For multicast IP-GRE tunnel initiation, send the below packet on access_port. 1329 Ethernet II, Src: 00:00:00_00:00:01 (00:00:00:00:00:01), Dst: IPv4mcast_01:01:01 (01:00:5e:01:01:01) 1330 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 21 1331 Internet Protocol Version 4, Src: 1.1.1.1, Dst: 225.1.1.1 1332 Data (26 bytes) 1333 0000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ................ 1334 0010 10 11 12 13 14 15 16 17 18 19 .......... 1335 0100 5e01 0101 0000 0000 0001 8100 0015 1336 0800 4500 002e 0000 0000 40ff 95cd 0101 1337 0101 e101 0101 0001 0203 0405 0607 0809 1338 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1339 * 1340 b)For IP-GRE Tunnel Termination, send the below packet on network_port 1341 Ethernet II, Src: 00:00:00_00:00:02 (00:00:00:00:00:02), Dst: 00:00:00_00:22:22 (00:00:00:00:22:22) 1342 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 22 1343 Internet Protocol Version 4, Src: 9.9.9.9, Dst: 10.10.10.10 1344 Generic Routing Encapsulation (IP) 1345 Internet Protocol Version 4, Src: 2.2.2.2, Dst: 225.1.1.1 1346 Data (2 bytes) 1347 0000 00 01 .. 1348 0000 0000 2222 0000 0000 0002 8100 0016 1349 0800 4500 002e 0000 0000 402f 547c 0909 1350 0909 0a0a 0a0a 0000 0800 4500 0016 0000 1351 0000 40ff 93e3 0202 0202 e101 0101 0001 1352 0d44 1651 1cdf 4421 1353 "," After step 3.a, verify that the below IP-GRE tunnel packet egresses out 1354 of network_port. 1355 Ethernet II, Src: 00:00:00_00:22:22 (00:00:00:00:22:22), Dst: 00:00:00_00:00:02 (00:00:00:00:00:02) 1356 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 22 1357 Internet Protocol Version 4, Src: 10.10.10.10, Dst: 9.9.9.9 1358 Generic Routing Encapsulation (IP) 1359 Internet Protocol Version 4, Src: 1.1.1.1, Dst: 225.1.1.1 1360 Data (26 bytes) 1361 0000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ................ 1362 0010 10 11 12 13 14 15 16 17 18 19 .......... 1363 0000 0000 0002 0000 0000 2222 8100 0016 1364 0800 4500 0046 9f30 0000 162f df33 0a0a 1365 0a0a 0909 0909 0000 0800 4500 002e 0000 1366 0000 3fff 96cd 0101 0101 e101 0101 0001 1367 0203 0405 0607 0809 0a0b 0c0d 0e0f 1011 1368 1213 1415 1617 1819 4e14 86f2 93a9 64fc 1369 After step 3.b, verify that the below packet egresses out of access_port. 1370 Ethernet II, Src: 00:00:00_00:11:11 (00:00:00:00:11:11), Dst: IPv4mcast_01:01:01 (01:00:5e:01:01:01) 1371 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 21 1372 Internet Protocol Version 4, Src: 2.2.2.2, Dst: 225.1.1.1 1373 Data (2 bytes) 1374 0000 00 01 .. 1375 0100 5e01 0101 0000 0000 1111 8100 0015 1376 0800 4500 0016 0000 0000 3fff 94e3 0202 1377 0202 e101 0101 0001 0d44 1651 1cdf 4421 1378 0000 0000 0000 0000 0000 0000 f3f2 8a9c 1379 " 1380 ./tomahawk3/ip_tunnel/l3_tunnel_ip4in4.c," This cint example configures L3 Ipv4 in Ipv4 Tunnel initiation and termination 1381 using BCM APIs. 1382 "," a) Selects two ports and configure them in Loopback mode. Out of these two ports, 1383 one port is used as access_port and the other as network port. Install a rule 1384 to copy incoming packets to CPU and start packet watcher. 1385 "," a) Create an access_vlan(21) and add access_port as member. 1386 b) Create network_vlan(22) and add network_port as member. 1387 c) Create two L3 interfaces one each for access side and network side. 1388 d) Create two L3 egress objects one each for access side and network side. 1389 e) Configure tunnel initiator(type = bcmTunnelTypeIp4In4) 1390 on network side L3 interface. 1391 f) Configure tunnel terminator(type = bcmTunnelTypeIp4In4) 1392 to match on packet's tunnel header contents. 1393 g) For tunnel initiation, add a L3 route pointing to network side egress object. 1394 h) For tunnel termination, add a L3 route pointing to access side egress object. 1395 "," a) For IPv4 tunnel initiation, send the below packet on access_port. 1396 DA 0x1111 1397 SA 0x1 1398 VLAN 21 1399 DIP 1.1.1.1 1400 SIP 2.2.2.2 1401 00 00 00 00 11 11 00 00 00 00 00 01 81 00 00 15 1402 08 00 45 00 00 2E 00 00 00 00 40 FF 73 CC 02 02 1403 02 02 01 01 01 01 00 00 00 00 00 00 00 00 00 00 1404 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1405 58 86 3E CA 1406 b)For IPv4 Tunnel Termination, send the below packet on network_port 1407 DA 0x2222 1408 SA 0x2 1409 VLAN 22 1410 Tunnel Termination DIP 10.10.10.10 1411 Tunnel Termination SIP 9.9.9.9 1412 Inner Payload DIP 2.2.2.2 1413 Inner Payload SIP 1.1.1.1 1414 00 00 00 00 22 22 00 00 00 00 00 02 81 00 00 16 1415 08 00 45 00 00 42 00 00 00 00 40 04 54 93 09 09 1416 09 09 0A 0A 0A 0A 45 00 00 2E 00 00 00 00 40 FF 1417 73 CC 01 01 01 01 02 02 02 02 00 00 00 00 00 00 1418 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1419 00 00 00 00 88 56 EE F7 1420 "," After step 3.a, verify that the below Tunnel packet egresses out 1421 of network_port. 1422 DA 0x02 1423 SA 0x2222 1424 VLAN 22 1425 Tunnel Initiation DIP 9.9.9.9 1426 Tunnel initiation SIP 10.10.10.10 1427 Inner Payload DIP 1.1.1.1 1428 Inner Payload SIP 2.2.2.2 1429 00 00 00 00 00 02 00 00 00 00 22 22 81 00 00 16 1430 08 00 45 00 00 42 00 01 00 00 16 04 7E 92 0A 0A 1431 0A 0A 09 09 09 09 45 00 00 2E 00 00 00 00 3F FF 1432 74 CC 02 02 02 02 01 01 01 01 00 00 00 00 00 00 1433 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1434 00 00 00 00 31 2B 7B 65 1435 After step 3.b, verify that the below packet egresses out of access_port. 1436 DA 0x1 1437 SA 0x11 1438 VLAN 21 1439 DIP 2.2.2.2 1440 SIP 1.1.1.1 1441 00 00 00 00 00 01 00 00 00 00 11 11 81 00 00 15 1442 08 00 45 00 00 2E 00 00 00 00 3F FF 74 CC 01 01 1443 01 01 02 02 02 02 00 00 00 00 00 00 00 00 00 00 1444 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1445 3A 50 39 5D 1446 " 1447 ./tomahawk3/ip_tunnel/l3_tunnel_ip6in4.c," This cint example demonstrates L3 Ipv6 in Ipv4 Tunnel initiation and termination 1448 using BCM APIs. 1449 "," a) Selects two ports and configure them in Loopback mode. Out of these two ports, 1450 one port is used as access_port and the other as network port. Install a rule 1451 to copy incoming packets to CPU and start packet watcher. 1452 "," a) Create an access_vlan(21) and add access_port as member. 1453 b) Create network_vlan(22) and add network_port as member. 1454 c) Create two L3 interfaces one each for access side and network side. 1455 d) Create two L3 egress objects one each for access side and network side. 1456 e) Configure tunnel initiator(type = bcmTunnelTypeIp6In4) 1457 on network side L3 interface. 1458 f) Configure tunnel terminator(type = bcmTunnelTypeIp6In4) 1459 to match on packet's tunnel header contents. 1460 g) For tunnel initiation, add a L3 route pointing to network side egress object. 1461 h) For tunnel termination, add a L3 route pointing to access side egress object. 1462 "," a) For IPv4 tunnel initiation, send the below IPv6 packet on access_port. 1463 DA 0x1111 1464 SA 0x1 1465 VLAN 21 1466 DIP AA00:0:0:0:0:0:0:1 1467 SIP BB00:0:0:0:0:0:0:1 1468 00 00 00 00 11 11 00 00 00 00 00 01 81 00 00 15 1469 86 DD 60 30 00 00 00 06 3B FF BB 00 00 00 00 00 1470 00 00 00 00 00 00 00 00 00 01 AA 00 00 00 00 00 1471 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 1472 11 4C 3F 26 1473 b)For IPv4 Tunnel Termination, send the below packet on network_port. 1474 DA 0x2222 1475 SA 0x2 1476 VLAN 22 1477 Tunnel Termination DIP 10.10.10.10 1478 Tunnel Termination SIP 9.9.9.9 1479 Inner Payload DIP BB00:0:0:0:0:0:0:1 1480 Inner Payload SIP AA00:0:0:0:0:0:0:1 1481 00 00 00 00 22 22 00 00 00 00 00 02 81 00 00 16 1482 08 00 45 00 00 42 00 00 00 00 40 29 54 6E 09 09 1483 09 09 0A 0A 0A 0A 60 30 00 00 00 06 3B FF AA 00 1484 00 00 00 00 00 00 00 00 00 00 00 00 00 01 BB 00 1485 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 1486 00 00 00 00 01 4B 4D 98 1487 "," After step 3.a, verify that the below Tunnel packet egresses out 1488 of network_port. 1489 DA 0x02 1490 SA 0x2222 1491 VLAN 22 1492 Tunnel Initiation DIP 9.9.9.9 1493 Tunnel initiation SIP 10.10.10.10 1494 Inner Payload DIP AA00:0:0:0:0:0:0:1 1495 Inner Payload SIP BB00:0:0:0:0:0:0:1 1496 00 00 00 00 00 02 00 00 00 00 22 22 81 00 00 16 1497 08 00 45 03 00 42 00 00 00 00 0A 29 8A 6B 0A 0A 1498 0A 0A 09 09 09 09 60 30 00 00 00 06 3B FE BB 00 1499 00 00 00 00 00 00 00 00 00 00 00 00 00 01 AA 00 1500 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 1501 00 00 00 00 E9 1F 2F 47 1502 After step 3.b, verify that below packet egresses out of access_port. 1503 DA 0x1 1504 SA 0x11 1505 VLAN 21 1506 DIP BB00:0:0:0:0:0:0:1 1507 SIP AA00:0:0:0:0:0:0:1 1508 00 00 00 00 00 01 00 00 00 00 11 11 81 00 00 15 1509 86 DD 60 00 00 00 00 06 3B 3F AA 00 00 00 00 00 1510 00 00 00 00 00 00 00 00 00 01 BB 00 00 00 00 00 1511 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 1512 47 7A A4 0A 1513 " 1514 ./tomahawk3/ip_tunnel/l3_tunnel_ip4in6.c," This cint example demonstrates L3 Ipv4 in Ipv6 Tunnel initiation and termination 1515 using BCM APIs. 1516 "," a) Selects two ports and configure them in Loopback mode. Out of these two ports, 1517 one port is used as access_port and the other as network port. Install a rule 1518 to copy incoming packets to CPU and start packet watcher. 1519 "," a) Create an access_vlan(21) and add access_port as member. 1520 b) Create network_vlan(22) and add network_port as member. 1521 c) Create two L3 interfaces one each for access side and network side. 1522 d) Create two L3 egress objects one each for access side and network side. 1523 e) Configure tunnel initiator(type = bcmTunnelTypeIp4In6) 1524 on network side L3 interface. 1525 f) Configure tunnel terminator(type = bcmTunnelTypeIp4In6) 1526 to match on packet's tunnel header contents. 1527 g) For tunnel initiation, add a L3 route pointing to network side egress object. 1528 h) For tunnel termination, add a L3 route pointing to access side egress object. 1529 "," a) For IPv6 tunnel initiation, send the below IPv4 packet on access_port. 1530 DA 0x1 1531 SA 0x1111 1532 VLAN 21 1533 DIP 1.1.1.1 1534 SIP 2.2.2.2 1535 0000 0000 0001 0000 0000 1111 8100 0015 1536 0800 4500 002e 0000 0000 40ff 73cc 0202 1537 0202 0101 0101 0001 0203 0405 0607 0809 1538 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1539 fb82 e0b2 0000 0000 1540 b)For IPv6 Tunnel Termination, send the below packet on network_port. 1541 DA 0x2 1542 SA 0x2222 1543 VLAN 22 1544 Tunnel Termination DIP DD00:0:0:0:0:0:0:1 1545 Tunnel Termination SIP CC00:0:0:0:0:0:0:1 1546 Inner Payload DIP 2.2.2.2 1547 Inner Payload SIP 1.1.1.1 1548 0000 0000 0002 0000 0000 2222 8100 0016 1549 86dd 6030 0000 0014 04ff cc00 0000 0000 1550 0000 0000 0000 0000 0001 dd00 0000 0000 1551 0000 0000 0000 0000 0001 4500 0014 0000 1552 0000 40ff 73e6 0101 0101 0202 0202 8537 1553 f178 0000 0000 1554 "," After step 3.a, verify that the below Tunnel packet egresses out 1555 of network_port. 1556 DA 0x2222 1557 SA 0x2 1558 VLAN 22 1559 Tunnel Initiation DIP FF00:0:0:0:0:0:0:1 1560 Tunnel initiation SIP EE00:0:0:0:0:0:0:1 1561 Inner Payload DIP 1.1.1.1 1562 Inner Payload SIP 2.2.2.2 1563 0000 0000 2222 0000 0000 0002 8100 0016 1564 86dd 6000 0000 002e 040a ee00 0000 0000 1565 0000 0000 0000 0000 0001 ff00 0000 0000 1566 0000 0000 0000 0000 0001 4500 002e 0000 1567 0000 3fff 74cc 0202 0202 0101 0101 0001 1568 0203 0405 0607 0809 0a0b 0c0d 0e0f 1011 1569 1213 1415 1617 1819 fb82 e0b2 0000 0000 1570 After step 3.b, verify that below packet egresses out of access_port. 1571 SA 0x01 1572 DA 0x1111 1573 VLAN 21 1574 SIP 1.1.1.1 1575 DIP 2.2.2.2 1576 0000 0000 1111 0000 0000 0001 8100 0015 1577 0800 4500 0014 0000 0000 feff b5e5 0101 1578 0101 0202 0202 8537 f178 0000 0000 0000 1579 0000 0000 0000 0000 0000 0000 0000 0000 1580 " 1581 ./tomahawk3/ip_tunnel/l3_tunnel_isatap.c," ISATAP (Intra-Site Automatic Tunnel Addressing Protocol) is an IPv6 transition mechanism meant to 1582 transmit IPv6 packets between dual-stack nodes on top of an IPv4 network. 1583 +----------------+--------------+--------------------------------+ 1584 | | | | 1585 | 32bits | 32bits | 64 bits | 1586 +----------------+--------------+--------------------------------+ 1587 | IPV6 prefix | 0x5EFE | IPV4 address | 1588 | | | | 1589 +----------------+--------------+--------------------------------+ 1590 This cint example demonstrates L3 ISATAP auto Tunnel initiation and termination 1591 using BCM APIs. 1592 "," a) Selects two ports and configure them in Loopback mode. Out of these two ports, 1593 one port is used as access_port and the other as network port. Install a rule 1594 to copy incoming packets to CPU and start packet watcher. 1595 "," a) Create an access_vlan(21) and add access_port as member. 1596 b) Create network_vlan(22) and add network_port as member. 1597 c) Create two L3 interfaces one each for access side and network side. 1598 d) Create two L3 egress objects one each for access side and network side. 1599 e) Configure tunnel initiator(type = bcmTunnelTypeIsatap) 1600 on network side L3 interface. 1601 f) Configure tunnel terminator(type = bcmTunnelTypeIsatap) 1602 to match on packet's tunnel header contents. 1603 g) For tunnel initiation, add a L3 route pointing to network side egress object. 1604 h) For tunnel termination, add a L3 route pointing to access side egress object. 1605 "," a) For ISATAP auto tunnel initiation, send the below IPv6 packet on access_port. 1606 DA 0x1111 1607 SA 0x1 1608 VLAN 21 1609 DIP 0:0:0:0:0:5EFE:C0A8:0101 1610 SIP 0:0:0:0:0:5EFE:C0A8:0201 1611 0000 0000 1111 0000 0000 0001 8100 0015 1612 86dd 6030 0000 0006 3bff 0000 0000 0000 1613 0000 0000 5efe c0a8 0201 0000 0000 0000 1614 0000 0000 5efe c0a8 0101 0000 0000 0000 1615 8f88 ec61 0000 0000 1616 b)For IPv4 Tunnel Termination, send the below packet on network_port. 1617 DA 0x2222 1618 SA 0x2 1619 VLAN 22 1620 Tunnel Termination DIP 192.168.2.1 1621 Tunnel Termination SIP 192.168.1.1 1622 Inner Payload DIP 0:0:0:0:0:5EFE:C0A8:0201 1623 Inner Payload SIP 0:0:0:0:0:5EFE:C0A8:0101 1624 0000 0000 2222 0000 0000 0002 8100 0016 1625 0800 4500 003c 0000 0000 4029 f646 c0a8 1626 0101 c0a8 0201 6030 0000 0000 3bff 0000 1627 0000 0000 0000 0000 5efe c0a8 0101 0000 1628 0000 0000 0000 0000 5efe c0a8 0201 b484 1629 afb5 1630 "," After step 3.a, verify that the below Tunnel packet egresses out 1631 of network_port. 1632 DA 0x02 1633 SA 0x2222 1634 VLAN 22 1635 Tunnel Initiation DIP 192.168.1.1 1636 Tunnel initiation SIP 192.168.2.1 1637 Inner Payload DIP 0:0:0:0:0:5EFE:C0A8:0101 1638 Inner Payload SIP 0:0:0:0:0:5EFE:C0A8:0201 1639 0000 0000 0002 0000 0000 2222 8100 0016 1640 0800 4503 0042 0000 0000 0a29 2c3e c0a8 1641 0201 c0a8 0101 6030 0000 0006 3bfe 0000 1642 0000 0000 0000 0000 5efe c0a8 0201 0000 1643 0000 0000 0000 0000 5efe c0a8 0101 0000 1644 0000 0000 8f88 ec61 0000 0000 1645 * 1646 After step 3.b, verify that below packet egresses out of access_port. 1647 DA 0x01 1648 SA 0x1111 1649 VLAN 21 1650 DIP 0:0:0:0:0:5EFE:C0A8:0201 1651 SIP 0:0:0:0:0:5EFE:C0A8:0101 1652 0000 0000 0001 0000 0000 1111 8100 0015 1653 86dd 6030 0000 0000 3b3f 0000 0000 0000 1654 0000 0000 5efe c0a8 0101 0000 0000 0000 1655 0000 0000 5efe c0a8 0201 b484 afb5 0000 1656 0000 1657 " 1658 ./tomahawk3/ip_tunnel/l3_tunnel_ip6in6.c," This cint example demonstrates L3 Ipv6 in Ipv6 Tunnel initiation and termination 1659 using BCM APIs. 1660 "," a) Selects two ports and configure them in Loopback mode. Out of these two ports, 1661 one port is used as access_port and the other as network port. Install a rule 1662 to copy incoming packets to CPU and start packet watcher. 1663 "," a) Create an access_vlan(21) and add access_port as member. 1664 b) Create network_vlan(22) and add network_port as member. 1665 c) Create two L3 interfaces one each for access side and network side. 1666 d) Create two L3 egress objects one each for access side and network side. 1667 e) Configure tunnel initiator(type = bcmTunnelTypeIp6In6) 1668 on network side L3 interface. 1669 f) Configure tunnel terminator(type = bcmTunnelTypeIp6In6) 1670 to match on packet's tunnel header contents. 1671 g) For tunnel initiation, add a L3 route pointing to network side egress object. 1672 h) For tunnel termination, add a L3 route pointing to access side egress object. 1673 "," a) For IPv6 tunnel initiation, send the below IPv6 packet on access_port. 1674 DA 0x1 1675 SA 0x1111 1676 VLAN 21 1677 DIP BB00:0:0:0:0:0:0:1 1678 SIP AA00:0:0:0:0:0:0:1 1679 0000 0000 0001 0000 0000 1111 8100 0015 1680 86dd 6030 0000 0002 3bff aa00 0000 0000 1681 0000 0000 0000 0000 0001 bb00 0000 0000 1682 0000 0000 0000 0000 0001 0001 0cb1 f608 1683 0000 0000 1684 b)For IPv6 Tunnel Termination, send the below packet on network_port. 1685 DA 0x2 1686 SA 0x2222 1687 VLAN 22 1688 Tunnel Termination DIP DD00:0:0:0:0:0:0:1 1689 Tunnel Termination SIP CC00:0:0:0:0:0:0:1 1690 Inner Payload DIP AA00:0:0:0:0:0:0:1 1691 Inner Payload SIP BB00:0:0:0:0:0:0:1 1692 0000 0000 0002 0000 0000 2222 8100 0016 1693 86dd 6030 0000 002e 290a cc00 0000 0000 1694 0000 0000 0000 0000 0001 dd00 0000 0000 1695 0000 0000 0000 0000 0001 6030 0000 0006 1696 3bfe bb00 0000 0000 0000 0000 0000 0000 1697 0001 aa00 0000 0000 0000 0000 0000 0000 1698 0001 0000 0000 0000 114c 3f26 0000 0000 1699 0000 0000 1700 "," After step 3.a, verify that the below Tunnel packet egresses out 1701 of network_port. 1702 * 1703 DA 0x2222 1704 SA 0x2 1705 VLAN 22 1706 Tunnel Initiation DIP FF00:0:0:0:0:0:0:1 1707 Tunnel initiation SIP EE00:0:0:0:0:0:0:1 1708 Inner Payload DIP AA00:0:0:0:0:0:0:1 1709 Inner Payload SIP BB00:0:0:0:0:0:0:1 1710 0000 0000 2222 0000 0000 0002 8100 0016 1711 86dd 6030 0000 002a 290a ee00 0000 0000 1712 0000 0000 0000 0000 0001 ff00 0000 0000 1713 0000 0000 0000 0000 0001 6030 0000 0002 1714 3bfe aa00 0000 0000 0000 0000 0000 0000 1715 0001 bb00 0000 0000 0000 0000 0000 0000 1716 0001 0001 0cb1 f608 0000 0000 1717 After step 3.b, below packet egresses out of access_port. 1718 SA 0x01 1719 DA 0x1111 1720 VLAN 21 1721 Inner Payload DIP AA00:0:0:0:0:0:0:1 1722 Inner Payload SIP BB00:0:0:0:0:0:0:1 1723 0000 0000 1111 0000 0000 0001 8100 0015 1724 86dd 6030 0000 0006 3b09 bb00 0000 0000 1725 0000 0000 0000 0000 0001 aa00 0000 0000 1726 0000 0000 0000 0000 0001 0000 0000 0000 1727 114c 3f26 0000 0000 0000 0000 1728 " 1729 ./tomahawk3/ip_tunnel/l3_tunnel_ip6to4.c," The 6to4 automatic tunneling encapsulates incoming IPv6 packets with an IPv4 tunnel header and 1730 routes the packets as IPv4 packets across the core. At the end of the tunnel, the XGS switches 1731 removes the IPv4 header and forwards the original IP based on its own header. The IPv6 address 1732 format must be the format as 2002:V4ADDR::/48 which illustrated as below. 1733 | 3 | 13 | 32 | 16 | 64 bits | 1734 +---+------+-----------+--------+--------------------------------+ 1735 |FP | TLA | V4ADDR | SLA ID | Interface ID | 1736 |001|0x0002| | | | 1737 +---+------+-----------+--------+--------------------------------+ 1738 This cint example demonstrates L3 IP6TO4 Tunnel initiation and termination 1739 using BCM APIs. 1740 "," a) Selects two ports and configure them in Loopback mode. Out of these two ports, 1741 one port is used as access_port and the other as network port. Install a rule 1742 to copy incoming packets to CPU and start packet watcher. 1743 "," a) Create an access_vlan(21) and add access_port as member. 1744 b) Create network_vlan(22) and add network_port as member. 1745 c) Create two L3 interfaces one each for access side and network side. 1746 d) Create two L3 egress objects one each for access side and network side. 1747 e) Configure tunnel initiator(type = bcmTunnelTypeIp6In4) 1748 on network side L3 interface. 1749 f) Configure tunnel terminator(type = bcmTunnelTypeIp6In4) 1750 to match on packet's tunnel header contents. 1751 g) For tunnel initiation, add a L3 route pointing to network side egress object. 1752 h) For tunnel termination, add a L3 route pointing to access side egress object. 1753 "," a) For IP6TO4 Tunnel initiation, send the below IPv6 packet on access_port. 1754 DA 0x1111 1755 SA 0x1 1756 VLAN 21 1757 DIP 2002:c0a8:0101:0:0:0:0:0 1758 SIP 2002:c0a8:0201:0:0:0:0:0 1759 0000 0000 1111 0000 0000 0001 8100 0015 1760 86dd 6030 0000 0006 3bff 2002 c0a8 0201 1761 0000 0000 0000 0000 0000 2002 c0a8 0101 1762 0000 0000 0000 0000 0000 0000 0000 0000 1763 d738 8cf0 0000 0000 1764 b)For IPv4 Tunnel Termination, send the below packet on network_port. 1765 DA 0x2222 1766 SA 0x2 1767 VLAN 22 1768 Tunnel Termination DIP 192.168.2.1 1769 Tunnel Termination SIP 192.168.1.1 1770 Inner Payload DIP 2002:c0a8:0201:0:0:0:0:0 1771 Inner Payload SIP 2002:c0a8:0101:0:0:0:0:0 1772 0000 0000 2222 0000 0000 0002 8100 0016 1773 0800 4500 0042 0000 0000 4029 f640 c0a8 1774 0101 c0a8 0201 6030 0000 0006 3bff 2002 1775 c0a8 0101 0000 0000 0000 0000 0000 2002 1776 c0a8 0201 0000 0000 0000 0000 0000 0000 1777 0000 0000 4b3e 8e53 0000 0000 1778 "," After step 3.a, verify that the below Tunnel packet egresses out 1779 of network_port. 1780 DA 0x02 1781 SA 0x2222 1782 VLAN 22 1783 Tunnel Initiation DIP 192.168.1.1 1784 Tunnel initiation SIP 192.168.2.1 1785 Inner Payload DIP 2002:c0a8:0101:0:0:0:0:0 1786 Inner Payload SIP 2002:c0a8:0201:0:0:0:0:0 1787 0000 0000 0002 0000 0000 2222 8100 0016 1788 0800 4503 0042 0000 0000 0a29 2c3e c0a8 1789 0201 c0a8 0101 6030 0000 0006 3bfe 2002 1790 c0a8 0201 0000 0000 0000 0000 0000 2002 1791 c0a8 0101 0000 0000 0000 0000 0000 0000 1792 0000 0000 d738 8cf0 0000 0000 1793 After step 3.b, verify that below packet egresses out of access_port. 1794 DA 0x01 1795 SA 0x1111 1796 VLAN 21 1797 DIP 2002:c0a8:0201:0:0:0:0:0 1798 SIP 2002:c0a8:0101:0:0:0:0:0 1799 0000 0000 0001 0000 0000 1111 8100 0015 1800 86dd 6030 0000 0006 3b3f 2002 c0a8 0101 1801 0000 0000 0000 0000 0000 2002 c0a8 0201 1802 0000 0000 0000 0000 0000 0000 0000 0000 1803 4b3e 8e53 0000 0000 1804 " 1805 ./tomahawk3/mirroring/mirror_payload_wiping_sFlow_PSAMP_th3.c," MIRRORING with Payload wiping of the payload packet 1806 "," a) Put required ports in loopback so that test can be performed 1807 using CPU generated traffic. 1808 b) Install IFP entries to catch the ingress and egress packets 1809 for visibility. 1810 "," a) Configure Payload wiping HW to match and choose wiping begin offset 1811 UDP Dest port is selected to match on. 1812 b) Configure Mirror Port with Tunnel. Either sFlow and ERSPAN can 1813 be selected. 1814 "," a) Send any L3 packet with matching dest UDP port to Port0/Port1 or None. 1815 "," Payload content is wiped right after the Dest IP from 1816 an offset as specified in the corresponding UDP match. 1817 SAMPLE DECODE OF PSAMP PACKET: 1818 {000000445566}->(Tunnel DMAC) {000000112233}->(Tunnel SMAC) 1819 {8100 006f}->(VLAN TAG) 1820 {86dd}->(Ether type IPv6) 6000 0000 0068 1140 {fe80 0000 0000 1821 0000 0000 0000 0000 2d6e}->(Src IP6) {ff02 0000 0000 1822 0000 0000 0000 0000 0005}-(Dst IP6) {2b67}-(Src L4 Port) {56ce}->(Dst L4 Port) 1823 {0068}->(Len) 1824 {0000}->(UDP Chksm, always 0) {{000a}->(IPFIX Version) {0060}->(IPFIX Len) 1825 {0000 0000}->(Export Time) {0000 0000}->(Seq Num) {0000 1826 0000}->(Observation Domain ID) {0000}->(Template ID) {0050}->(PSAMP Len) 1827 {0000 0000 0000 0000}->(Observation time ns) {00ff}->(PAD + FF) 1828 {0044}->(PSAMP Sampled Len)}->(PSAMP Hdr) {0000 0000 00c4 0001 0203 0405 8100 1829 00c8 002e 0000 0000 0000 0000 1234 5678 1830 1234 5679 1234 567a 1234 567b 1234 567c 1831 1234 567d 1234 567e 1234 567f 1234 5680 1832 1234 0000 0000}->(Payload Packet) 1833 SAMPLE DECODE OF SFLOW PACKET: 1834 {000000445566}->(Tunnel DMAC) {000000112233}->(Tunnel SMAC) 1835 {8100 006f}->(VLAN TAG) 1836 {0800 4500 0068 0000 0000 4011 7480 0101 1837 0101 0202 0202 2b67 56ce 0054 0000 }->(IP+UDP Header) 1838 { {2900}->(Source Port+ModID) 1839 {2a00}->(Dest Port+ModID) {8080}->(sFLow Flags) {0000}->(Metadata) 1840 {0000 0000}->(Seq Num) }->(sFlow HDR) {0000 0000 00c4 1841 0001 0203 0405 8100 00c8 002e 0000 0000 1842 0000 0000 1234 5678 1234 5679 1234 567a 1843 1234 567b 1234 567c 1234 567d 1234 567e 1844 1234 567f 1234 5680 1234 0000 0000}->(Payload Packet) 1845 NOTE: Use opt_* variables to change the test variant 1846 return BCM_E_NONE; 1847 } 1848 bcm_error_t execute() 1849 { 1850 if( (rrv = test_setup(unit)) != BCM_E_NONE ) 1851 { 1852 printf(""Creating the test setup failed %d\n"", rrv); 1853 return rrv; 1854 } 1855 if( (rrv = ConfigureMirror()) != BCM_E_NONE ) 1856 { 1857 printf(""Configuring mirror failed with %d\n"", rrv); 1858 return rrv; 1859 } 1860 if( (rrv = verify()) != BCM_E_NONE ) 1861 { 1862 printf(""Verify mirror failed with %d\n"", rrv); 1863 return rrv; 1864 } 1865 return BCM_E_NONE; 1866 } 1867 print execute(); 1868 " 1869 ./tomahawk3/bcm_tx/bcm_tx_sobmh.c," This CINT script demonstrates how to send packets from application to particular 1870 port bypassing the ingress pipeline. 1871 This example shows how application can send packets using bcm_tx() API 1872 "," a) Select three egress port and configure them in loopback mode. 1873 b) Add static L2 entry on cpu port with mac=80:80:80:11:22:33 and vlan=1 1874 c) start Packet Watcher diag app (PW start) 1875 "," a) There is nothing to be done in tx_setup 1876 "," a) Transmit 2 packets per egress port using bcm_tx() API 1877 "," The packets are looped back on egress ports and are received by CPU port 1878 PW will dump the recieved packets on console. 1879 " 1880 ./tomahawk3/bcm_tx/bcm_tx.c," This CINT script demonstrates how to send packets from application which will 1881 go through the ingress pipeline and pipeline decides the egress port to send out the packet. 1882 This example shows how application can send packets using bcm_tx() API 1883 "," a) Select three egress port and configure them in loopback mode. 1884 b) Create Vlan 10 and add egress port 1 and CPU port to vlan 10. 1885 c) Create Vlan 20 and add egress port 2 and CPU port to vlan 20. 1886 d) Create Vlan 30 and add egress port 3 and CPU port to vlan 30. 1887 e) start Packet Watcher diag app (PW start) 1888 "," a) There is nothing to be done in tx_setup 1889 "," a) Transmit one packet with vlan=10 using bcm_tx() API 1890 b) Transmit one packet with vlan=20 using bcm_tx() API 1891 c) Transmit one packet with vlan=30 using bcm_tx() API 1892 "," The packets are looped back on egress ports and are received by CPU port. 1893 PW will dump the recieved packets on console. 1894 " 1895 ./tomahawk3/linkscan/linkscan.c," The link scan feature enables to monitor the status of ports and links. 1896 If the link status changes, the driver calls the callback routine. 1897 "," a) Select 3 ports on the switch 1898 "," a) Start linkscan 1899 b) Register linkscan callback 1900 c) Add one port in software linkscan 1901 d) Add two ports in a bitmap and enable software linkscan on this bitmap 1902 "," a) Enable loopback on port1 1903 b) Enable loopback on port2 and register port callback on port2 1904 "," Check that linkscan callback is seen on the console 1905 " 1906 ./tomahawk3/bcm_rx/bcm_rx.c," This CINT script registers RX callback using BCM APIs. 1907 This exampls hsows how application can register RX callback function 1908 and process the packets received by CPU port. 1909 "," a) Select one ingress port and configure it in loopback mode. 1910 b) Add static L2 entry on cpu port with mac=00:00:00:00:00:03 and vlan=1 1911 "," a) Check if RX is active, if not then Init RX and start RX thread 1912 b) Register RX callback function which will print the received packet along 1913 with the metadata of the packet. 1914 "," a) Transmit multiple packets with different vlan_prio and mac=00:00:00:00:00:03 1915 "," The packets are looped back on ingress port and received by CPU port 1916 The RX callback registered in step#4 will dump the packet along with metadata 1917 on console 1918 " 1919 ./tomahawk3/bcm_rx/bcm_rx_cpu_cosq_mapping.c," This CINT script demonstrate how to map cpu cos queues to RX DMA channels 1920 BCM APIs. 1921 This exampls hsows how application can register RX callback function 1922 and process the packets received by CPU port. 1923 "," a) Stop packet watcher application 1924 b) Start packet watchher application with all 7 RX DMA channels 1925 "," a) Build cpu cosq mapping by calling bcm_cosq_gport_traverse() API 1926 "," a) Remap cpu cosq to different RX DMA channels as below and 1927 dump cmic_cmc0_pktdma_ch(x)_cos_ctrl_rx_[0..1] register 1928 Map 0-6 cos to RX DMA channel 0 1929 Map 7-13 cos to RX DMA channel 1 1930 Map 14-20 cos to RX DMA channel 2 1931 Map 21-27 cos to RX DMA channel 3 1932 Map 28-34 cos to RX DMA channel 4 1933 Map 35-41 cos to RX DMA channel 5 1934 Map 42-47 cos to RX DMA channel 6 1935 "," RX DMA channel cos control registers values should matc as per 1936 the above mapping done in step# a) 1937 " 1938 ./tomahawk3/pstats/pstats_all_elements_test.c," Tomahawk3 supports a feature packetized statistics (PSTATS) which allows software 1939 to read out MMU buffer use counts over SBUS and send this data via packets into the 1940 Tomahawk2 switch to any destination in the network in a timely manner. 1941 PSTATS related config variables: 1942 buffer_stats_collect_mode 1943 Flags to denote pstats and oob stats mode. 1944 0x0 Instantaneous mode 1945 0x1 Max use count mode with HW clear on Read 1946 buffer_stats_collect_type 1947 Flags to enable pstats or oob stats, only one can be enabled at a time. 1948 0x0 None: disable both oob stats and pstats 1949 0x1 OOB STATS: only enable out-of-band stats 1950 0x2 PSTATS: only enable packetized statistic 1951 bcm_num_cos 1952 Initial number of CoS queues, by default is 8 1953 "," a) Put required ports in loopback so that test can be performed 1954 using CPU generated traffic. 1955 b) Install IFP entries to catch the ingress and egress packets 1956 for visibility. 1957 "," a) Detect how many cosqs are present for each port and find out number of unicast cosqs, 1958 multicast cosqs and port scheduler level cosqs. This will be used in case pstats are 1959 required for gport which represents cosqs (instead of port + cosqs). This is done by 1960 registering a callout function to bcm_cosq_gport_traverse. 1961 b) Calculate the buffer size rewuired to hold the pstats data for ingress, egress and port 1962 cosq levels. 1963 c) Create a PSTAT session, sync and then get the PSTAT data in the preallocated buffers. 1964 d) Send the captured data from the CPU by encapsulating it in a tunnelled packet. 1965 e) Do cleanup by destroying the session. 1966 "," a) CPU sends the encapsulated packet with the proper PSTATS header and the payload data. 1967 "," Encalsulated packet is seen egressing from the egress port with the PSTATS data of 1968 ingress, egress and gport levels. 1969 NOTE: Use opt_* variables to change the test variant 1970 return BCM_E_NONE; 1971 } 1972 bcm_error_t execute() 1973 { 1974 if( (rrv = test_setup(unit)) != BCM_E_NONE ) 1975 { 1976 printf(""Creating the test setup failed %d\n"", rrv); 1977 return rrv; 1978 } 1979 if( (rrv = do_pstats_config(0)) != BCM_E_NONE ) 1980 { 1981 printf(""Configuring pstats failed with %d\n"", rrv); 1982 return rrv; 1983 } 1984 if( (rrv = verify()) != BCM_E_NONE ) 1985 { 1986 printf(""Verify mirror failed with %d\n"", rrv); 1987 return rrv; 1988 } 1989 return BCM_E_NONE; 1990 } 1991 print execute(); 1992 " 1993 ./tomahawk3/field/ifp_presel.c," IFP Logical Table Selection [LTS]/Presel demonstration using BCM APIs. 1994 It demonstrates either in PIPE LOCAL or GLOBAL mode. 1995 "," a) Select one ingress and three egress ports and configure them in 1996 Loopback mode. Install a rule to copy incoming packets to CPU and 1997 additional action to drop the packets when it loops back on egress 1998 ports. Start packet watcher. 1999 "," a) Create Presel entry with qualifier as 2000 QSET: IpTypeIpv4Any and 2001 QSET: StageIngress (for IFP presel). 2002 b) Create IFP Entry with 2003 QSET: SrcIp 2004 QSET: InPort 2005 QSET: Presel (presel_id) 2006 ACTION: DscpNew 2007 ACTION: CopyToCpu 2008 STAT: main_ifp_statid = 1 2009 c) Create an L3 interface so that L3 packet gets recognised as L3. 2010 DMAC: 0xDD (test_dmac) 2011 VLAN: 100 (test_vid) 2012 d) Create L3 egress object and set above interface (OPTIONAL) 2013 e) Create a route entry for dest ip = 0x0A0A0A0B (OPTIONAL) 2014 "," a) Send a packet with 2015 test_dmac = 0xDD | any srcmac | test_vid = 100 | 2016 fp_cfg.src_ip = 0x0A0A0A14 | dest_ip = 0x0A0A0A0B | 2017 b) STAT with ID = 1 incremented by 1. 2018 "," Final STAT count should be 1. 2019 NOTE: Use opt_* variables to change the test variant 2020 " 2021 ./tomahawk3/field/ifp_flex_stat_policer.c," IFP flex stat and policer demonstration using BCM APIs. 2022 From TH2 not much has changed in this area. 2023 "," a) Select one ingress and three egress ports and configure them in 2024 Loopback mode. Install a rule to copy incoming packets to CPU and 2025 additional action to drop the packets when it loops back on egress 2026 ports. Start packet watcher. 2027 "," a) Create entry 2028 QUAL : InPort and DstMac 2029 ACTION : None 2030 POLICER : TrTcm with cir+cbs and eir+ebs 2031 STAT : Counter for 2032 GREEN 2033 YELLOW if opt_IncludeYellowStat = 1 2034 RED if opt_IncludeRedStat = 1 2035 "," a) Goal is to see 2036 a) if green counter is incrementing 2037 b) if yellow counter is incrementing 2038 c) if red counter is incrementing 2039 b) Send traffic in such a way that packets are collored according to 2040 their ingress rate. 2041 c) Send 1 packet in a burst from CPU to get GREEN only hit 2042 d) Send 500 packets in a burst from CPU to get GREEN+YELLOW hit 2043 To some extent Red also hits 2044 e) Send 100000 packets in a burst from CPU to get GREEN+YELLOW+RED hit 2045 f) Call fp_flex_stat_get() to get the stat values. 2046 g) To get a better result, you can integrate the sample code snippet 2047 pasted at the bottom of this file. 2048 "," You will see that Green, Yellow and RED STAT counter should increment 2049 NOTE: Use opt_* variables to change the test variant 2050 " 2051 ./tomahawk3/field/ifp_range_checker.c," Cint example to show configuration of Range Checker and IFP in 2052 Tomahawk3 using BCM APIs. 2053 The following example shows the usage of Range Checker and IFP TCAM in 2054 Pipe global mode [entries installed in all of the four pipes]. Range 2055 Module in Pipe global Mode and IFP TCAM in Global mode is a miss 2056 configuration and should never be done. But both the modules Operating 2057 in same mode and Range in Global mode and Field in Pipe Global mode are 2058 allowed configurations. 2059 "," a) Select one ingress and three egress ports and configure them in 2060 Loopback mode. Install a rule to copy incoming packets to CPU and 2061 additional action to drop the packets when it loops back on egress 2062 ports. Start packet watcher. 2063 "," a) Create Two Ranges of of type bcmRangeTypeOuterVlan with VID values 2064 Range1 = [101-105] 2065 Range2 = [111-115] 2066 c) Create entry in Main IFP - TCAM 2067 Qualifier1 : SrcMac - 0x202 2068 Qualifier2 : RangeCheckGroup with range_bmp = Range1 OR Range2 2069 Action : CopyToCpu with match = 200 2070 d) Create STAT with main_ifp_statid = 1 2071 "," a) Send packets with VID from 101 to 120 2072 "," i) VID within Range1 and Range2: Match occurs. STAT 1 increases 2073 ii) VID outside Range1 and Range2: Match does NOT occurs. STAT 1 unchanged. 2074 NOTE: Use opt_* variables to change the test variant 2075 " 2076 ./tomahawk3/field/ifp_delayed_actions.c," IFP Delayed action demonstration using BCM APIs. 2077 TH3 is optimized for residency of the packet in the chip. Due to 2078 which many pipeline stages are folded. Packet resolution is one of them. 2079 Due to this, at IFP stage port resolution is not known. Hence, the 2080 qualifier MatchPbmpRedirect is introduced to apply delayed action of 2081 legacy PortRedirect. 2082 "," a) Select one ingress and three egress ports and configure them in 2083 Loopback mode. Install a rule to copy incoming packets to CPU and 2084 additional action to drop the packets when it loops back on egress 2085 ports. Start packet watcher. 2086 "," a) Create a VLAN(100) and add ing_port1, ing_port2, egr_port1, 2087 egr_port2, egr_nhop_redirect_port and egr_match_redirect_port as 2088 members. Where, 2089 egr_port1 : is the routed next hop dest port for 2090 ip_subnet_1 2091 egr_nhop_redirect_port : is the RedirectEgrNextHop dest port 2092 overriddedn by IFP 2093 egr_match_redirect_port: is the MatchPbmpRedirect dest port in 2094 case resolved port is any of egr_port1 2095 OR egr_port2 OR egr_nhop_redirect_port 2096 b) Configure MPLS pop action so that terminated packet should go to 2097 egr_obj_1 from l3_intf_1. (LOCALMAC:0xDD, REMOTEMAC=0xEE 2098 VLAN=100, EGR_PORT=egr_port1) 2099 c) Create another next hop as 'redirected_nh_index'. 2100 (LOCAL_MAC:0xCE, REMOTE_MAC=0xCD 2101 VLAN=100, EGR_PORT=egr_nhop_redirect_port) 2102 d) Create entry: 2103 QSET: Ingress, InPort 2104 ACTION: MatchPbmpRedirect 2105 ACTION: RedirectEgrNextHop 2106 "," a) Send an IPv4 packet: 2107 DMAC : local_mac_1 2108 VLAN : test_vid 2109 MPLS LABEL : rx_label 2110 DIP : ip_subnet_1 2111 b) You will see that packets are egressing from the redirected port 2112 egr_match_redirect_port if opt_EnableMatchPbmpRedirect = 1. 2113 "," Please see the ""TEST CONFIGURATIONS SUMMARY"" section below. 2114 LOG SUMMARY: 2115 PACKET1: 2116 MACDA:0xDD, MACSA: 0xCC, VLANID: 0x0064, MPLS LABEL: 1000, 2117 SIP: 10.10.10.11, DIP: 20.20.20.21 2118 PACKET2: 2119 MACDA:0xEE, MACSA: 0xDD, VLANID: 0x0064, MPLS LABEL: 1000, 2120 SIP: 10.10.10.11, DIP: 20.20.20.21 2121 PACKET3: 2122 MACDA:0xCD, MACSA: 0xCE, VLANID: 0x0064, SIP: 10.10.10.11, 2123 DIP: 20.20.20.21 2124 Summary: 2125 In simple statement: If NHOP egress port falls in any of the 2126 given PBMP, redirect it to a given port. 2127 Test case: 2128 #. PACKET1 ingresses 2129 #. 2 nexthop entries are created. 2130 NHOOP_a. Makes PACKET2 to egress from egr_port1 2131 NHOOP_b. Makes PACKET3 to egress from egr_nhop_redirect_port 2132 Kind of NHOOP_b_. Makes PACKET3 to egress from 2133 egr_match_redirect_port 2134 TEST CONFIGURATIONS SUMMARY of egressing packet 2135 A] opt_EnableMatchPbmpRedirect = 0 (0x0) 2136 opt_EnableNhopRedirect = 0 (0x0) 2137 DMAC: 0xEE 2138 SMAC: 0xDD 2139 EGR port: egr_port1 2140 B] opt_EnableMatchPbmpRedirect = 0 (0x0) 2141 opt_EnableNhopRedirect = 1 (0x1) 2142 DMAC: 0xCD 2143 SMAC: 0xCE 2144 EGR port: egr_nhop_redirect_port 2145 C] opt_EnableMatchPbmpRedirect = 1 (0x1) 2146 [Match PBMP=egr_nhop_redirect_port] 2147 opt_EnableNhopRedirect = 1 (0x1) 2148 DMAC: 0xCD 2149 SMAC: 0xCE 2150 EGR port: egr_match_redirect_port 2151 D] opt_EnableMatchPbmpRedirect = 1 (0x1) [Match PBMP=egr_port1] 2152 opt_EnableNhopRedirect = 0 (0x0) 2153 DMAC: 0xEE 2154 SMAC: 0xDD 2155 EGR port: egr_match_redirect_port 2156 NOTE: Use opt_* variables to change the test variant 2157 " 2158 ./tomahawk3/field/opaque_tag.c," Opaque TAG usage demonstration using BCM APIs. 2159 TH3 does not support double tagged packets. If a double tagged 2160 packets enters the pipeline it treats everything beyong 1st tag 2161 as data. E.g. a double tagged L3 packet will not be recognised as 2162 an IP packet. This CINT excercises the processing of opaque tag in 2163 TH3. To do this we are sending double tag packet to qualify on 2164 fields beyond the double tag field. You have to use Opaque TAG 2165 to successfully parse the fields beyond 2nd tag. 2166 "," a) Select one ingress and three egress ports and configure them in 2167 Loopback mode. Install a rule to copy incoming packets to CPU and 2168 additional action to drop the packets when it loops back on egress 2169 ports. Start packet watcher. 2170 "," a) Create entry 2171 QUAL : OpaqueTagHigh and OpaqueTagLow 2172 OpaqueTag == 0x91000064 2173 OpaqueTag_Extn == 0xAABBCCDD 2174 ACTION : CopyToCpu 2175 STAT : Counter with STAT ID = 1 2176 "," a) Send packet with 2177 a) Matched OpaqueTag, Unmatched OpaqueTag_Extn 2178 b) Unmatched OpaqueTag, Unmatched OpaqueTag_Extn 2179 c) Matched OpaqueTag, Matched OpaqueTag_Extn 2180 d) Unmatched OpaqueTag, Matched OpaqueTag_Extn 2181 "," The final stat should be 1 because as per the IFP entry, both tag + extn parts 2182 should match. (opt_OpaqueTagLen = 2) 2183 NOTE: Use opt_* variables to change the test variant 2184 " 2185 ./tomahawk3/field/udf_hints_hw_sharing_TH3.c," Opaque TAG usage demonstration using BCM APIs. 2186 TH3 does not support double tagged packets. If a double tagged 2187 packets enters the pipeline it treats everything beyong 1st tag 2188 as data. E.g. a double tagged L3 packet will not be recognised as 2189 an IP packet. This CINT excercises the processing of opaque tag in 2190 TH3. To do this we are sending double tag packet to qualify on 2191 fields beyond the double tag field. You have to use Opaque TAG 2192 to successfully parse the fields beyond 2nd tag. 2193 "," a) Select one ingress and three egress ports and configure them in 2194 Loopback mode. Install a rule to copy incoming packets to CPU and 2195 additional action to drop the packets when it loops back on egress 2196 ports. Start packet watcher. 2197 "," a) Create L3 interface MAC=0xDD, VID=100 2198 b) Create L3 egress object DMAC=0xEE, VID=100, Interface as above. 2199 c) Configure MPLS POP action for label=1000. After POP, 2200 applicable egress object as above. 2201 d) Create 1st UDF extraction for 1 label MPLS packets 2202 OFFSET to fetch TTL from mpls label 2203 e) Create 2nd UDF extraction for 2 labels MPLS packets 2204 OFFSET to fetch TTL from INNER mpls label (HW SHARED) 2205 f) Create IFP Entry 2206 QUAL : UDF1 and UDF2 2207 ACTION : None 2208 STAT : Counter with STAT ID = 1 2209 "," a) Send PACKET1, STAT UP (See below) 2210 b) Send PACKET2, STAT SAME 2211 c) Send PACKET3, STAT UP 2212 d) Send PACKET4, STAT SAME 2213 "," The final STAT count should be 2 2214 PACKET1: 2215 MACDA: 0xDD, VID: 100, MPLS ONE label: 1000(h3E8), 7(h7), 39(h27) 2216 PACKET2: 2217 MACDA: 0xDD, VID: 100, MPLS ONE label: 1000(h3E8), 7(h7), 33(h21) 2218 PACKET3: 2219 MACDA: 0xDD, VID: 100, MPLS TWO label: 1000(h3E8), 7(h7), 33(h21) 2220 2000(h7D0), 6(h6), 39(h27) 2221 PACKET4: 2222 MACDA: 0xDD, VID: 100, MPLS TWO label: 1000(h3E8), 7(h7), 33(h21) 2223 2000(h7D0), 6(h6), 33(h21) 2224 NOTE: Use opt_* variables to change the test variant 2225 " 2226 ./tomahawk3/field/vfp_termination_override.c," Due to pipeline optimizations, TH3 stages now behave differently. 2227 Some of the HW signals are not available to the stages which were 2228 available in earlier chips. E.g. VID change done by VFP is not 2229 visible to MY_STATION_TCAM. Hence MY_STATION_TCAM will not recognize 2230 the changed packet, which may result into the lookup failure. To solve 2231 this, VFP has introduced a set of dedicated actions. 2232 Goal is to change the VID of a packet at the lookup stage. Then, 2233 this changed VID, should hit one of L3 interfaces (programmed in 2234 MY_STATION_TCAM) and go for tunnel termination. But in TH3 this 2235 won't work due to pipeline optimizations. Hence VFP itself has to 2236 play the role of initiating route lookup 2237 "," a) Select one ingress and three egress ports and configure them in 2238 Loopback mode. Install a rule to copy incoming packets to CPU and 2239 additional action to drop the packets when it loops back on egress 2240 ports. Start packet watcher. 2241 "," a) Create L3 interface 2242 b) Create L3 egress object and associate it with the above L3 interface 2243 c) Create entry in the route table for dip = 0x0A0A0A0B 2244 d) Create MPLS POP action and add tunnel initiation for DMAC=0xDD, 2245 VID=0x64. 2246 e) Add tunnel initiation for DMAC=0xDD, VID=0xC8. Here 0xC8 is the new VID 2247 that will be assigned by VFP. 2248 f) Create entry in VFP: 2249 QUAL: InPort -> ing_port1 2250 ACTION: VlanNew -> vid_new (0xC8) 2251 STAT : Counter with STAT ID = 1 2252 ",," i) Send PACKET1. Expected is that PACKET2 should egress from egr_port. 2253 IF opt_ChangeVlanInVfp == 0. 2254 ii) Expected Result: Send PACKET1. Expected is that PACKET3 should egress from egr_port. 2255 IF opt_ChangeVlanInVfp == 1. 2256 PACKET1: 2257 DMAC = 0xDD 2258 VID = 0x64 2259 MPLS label = 1000 2260 DIP = 0x0A0A0A0B 2261 PACKET2: 2262 DMAC = 0xDD 2263 VID = 0x64 2264 DIP = 0x0A0A0A0B 2265 PACKET3: 2266 DMAC = 0xDD 2267 VID = 0xC8 (200) 2268 DIP = 0x0A0A0A0B 2269 NOTE: Use opt_* variables to change the test variant 2270 " 2271 ./tomahawk3/field/ifp_compression_ttl.c," Compression using BCM APIs. 2272 It compresses a range of TTL values into 1 class value. In this way 2273 user will require only 1 entry in IFP to qualify for a range of TTL, 2274 but at the expense of equivalent number of entries in the ExactMatch 2275 stage/table. The following example shows the compression configuration 2276 for TTL in Global mode - entries installed on all the four pipes. The 2277 same can be applied to per pipe mode - entries installed in one of the 2278 four pipes. Use opt_* variables to change the test variant 2279 "," a) Select one ingress and three egress ports and configure them in 2280 Loopback mode. Install a rule to copy incoming packets to CPU and 2281 additional action to drop the packets when it loops back on egress 2282 ports. Start packet watcher. 2283 "," a) Create a VLAN(100) and add ing_port1, ing_port2 and egr_port 2284 as members. Makes packet with dmac=0xDD to go to ing_port2. 2285 b) Create multiple ExactMatch entries for a range of TTL to match 2286 QSET: IpTunnelTtl 2287 ASET: ClassZero -> Set value == compress_cfg.ttl_class_data 2288 c) Create 1 main IFP entry to match on the above class value from 2289 ExactMatch 2290 QSET: IpTunnelTtlClassZero. 2291 Match value == compress_cfg.ttl_class_data 2292 Action: CopyToCpu 2293 "," a) Send any IPv4 packet with TTL values changing between ttl_data_from 2294 and ttl_data_to and some packets beyond the range also. You will see 2295 that packets within the TTL range hits the IFP entry. Rest do not. 2296 "," Final stat count should be 10 (0x0000000A) 2297 NOTE: Use opt_* variables to change the test variant 2298 " 2299 ./tomahawk3/L3/ipmc_mpls_term.c," This Cint example to show configuration of the IPv4 multicast scenario 2300 with MPLS Tunnel Termination using BCM APIs. Replication of IPMC packet to a set 2301 of MPLS tunnels for the given (S, G)/(*, G) 2302 "," a) Select one ingress and two egress ports and configure them in 2303 Loopback mode. 2304 b) Install an IFP rule to copy incoming packets to CPU and start 2305 packet watcher. 2306 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2307 nothing to do with an actual functional test. 2308 "," a) Configure a basic IPv4 multicast functional scenario. This adds the 2309 host in l3 table[host] and does the necessary configurations of vlan, 2310 interface and next hop. 2311 b) Configure MPLS Tunnel Termination and associate with multicast egress 2312 object. 2313 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2314 'l3 egress show','multicast show', 'l2 show' and 'ipmc table show' 2315 b) Transmit the MPLS packet with IPMC payload. The contents of the packet 2316 are printed on screen. The packet used matches the route configured 2317 through script. 2318 "," We can see that terminates the MPLS Packet & see IPMC payload 2319 (no change in dmac, smac) and vlan changed as the packet is 2320 routed through the egress ports based on multicast table. 2321 Also run the 'ipmc table show' to check the HIT bit status (y i.e Yes) 2322 and 'show c' to check the Tx/Rx packet stats/counters. 2323 " 2324 ./tomahawk3/L3/hierarchical_ecmp.c," This Cint example to show configuration of the IPv4 unicast H-ECMP scenario 2325 using BCM APIs. 2326 "," a) Select one ingress and three egress ports and configure them in 2327 Loopback mode. 2328 b) Install an IFP rule to copy incoming packets to CPU and start 2329 packet watcher. 2330 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2331 nothing to do with an actual functional test. 2332 "," a) Configure a basic IPv4 unicast with hirarchical ECMP functional 2333 scenario. This adds the entry in l3 table[defip/LPM] and does 2334 the necessary configurations of vlan, interface and next hop. 2335 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2336 'l3 egress show', 'l3 defip show', 'l3 multipath show', 'l2 show' 2337 and 'l3 ecmp egress show' 2338 b) Transmit the known IPv4 multicast packet. The contents of the packet 2339 are printed on screen. The packet used matches the route configured 2340 through script. 2341 "," We can see that dmac, smac and vlan are all changed as the packet is 2342 routed through the egress port. Also run the 'l3 defip show' to 2343 check the HIT bit status (y i.e Yes) and 'show c' to check the Tx/Rx 2344 packet stats/counters. Each time, the outgoing packet use a different 2345 path or egress-port or next-hop via ECMP. 2346 " 2347 ./tomahawk3/L3/ipv6_host.c," This Cint example to show configuration of the IPv6 host entry using 2348 BCM APIs. 2349 "," a) Selects two ports and configure them in Loopback mode. Out of these 2350 two ports, one port is used as ingress_port and the other as 2351 egress_port. 2352 b) Install an IFP rule to copy incoming packets to CPU and start 2353 packet watcher. 2354 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2355 nothing to do with an actual functional test. 2356 "," a) Configure a basic IPv6 host/entry functional scenario. This adds the 2357 host in l3 table[host] and does the necessary configurations of vlan, 2358 interface and next hop. 2359 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2360 'l3 egress show' and 'l3 ip6host show' 2361 b) Transmit the known IPv6 unicast packet. The contents of the packet 2362 are printed on screen. The packet used matches the route configured 2363 through script. 2364 "," We can see that dmac, smac and vlan are all changed as the packet is 2365 routed through the egress port. Also run the 'l3 ip6host show' to 2366 check the HIT bit status (y i.e Yes) and 'show c' to check the Tx/Rx 2367 packet stats/counters. 2368 " 2369 ./tomahawk3/L3/l3_route_ingress_mode.c," This Cint example to show configuration of the IPv4 route entry with 2370 ingress mode using BCM APIs. 2371 "," a) Selects two ports and configure them in Loopback mode. Out of these 2372 two ports, one port is used as ingress_port and the other as 2373 egress_port. 2374 b) Install an IFP rule to copy incoming packets to CPU and start 2375 packet watcher. 2376 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2377 nothing to do with an actual functional test. 2378 "," a) Configure a basic IPv4 route/entry with ingress mode functional 2379 scenario. This adds the route in l3 table[route] and does the 2380 necessary configurations of vlan, interface and next hop. 2381 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2382 'l3 egress show' and 'l3 defip show' 2383 b) Transmit the known IPv4 unicast packet. The contents of the packet 2384 are printed on screen. The packet used matches the route configured 2385 through script. 2386 "," We can see that dmac, smac and vlan are all changed as the packet is 2387 routed through the egress port. Also run the 'l3 defip show' to 2388 check the HIT bit status (y i.e Yes) and 'show c' to check the Tx/Rx 2389 packet stats/counters. 2390 " 2391 ./tomahawk3/L3/dscp_queuing_remark_qos_map.c," This Cint example to show configuration of the L3 IPv4 DSCP classification 2392 and remark QoS mapping using BCM APIs. 2393 "," a) Selects two ports and configure them in Loopback mode. Out of these 2394 two ports, one port is used as ingress_port and the other as 2395 egress_port. 2396 b) Install an IFP rule to copy incoming packets to CPU and start 2397 packet watcher. 2398 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2399 nothing to do with an actual functional test. 2400 "," a) Configure a basic IPv4 DSCP Queuing and remark QoS mapping functional 2401 scenario. This adds the route in l3 table[route] and does the 2402 necessary configurations of vlan, interface and next hopi. 2403 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2404 'l3 egress show' and 'l3 defip show' 2405 b) Transmit the known IPv4 unicast packet with DSCP. The contents of the packet 2406 are printed on screen. The packet used matches the route configured 2407 through script. 2408 "," We can see that dmac, smac and vlan are all changed as the packet is 2409 routed through the egress port and priority as 4. Also run the 'l3 defip show' to 2410 check the HIT bit status (y i.e Yes) and 'show c' to check the Tx/Rx 2411 packet stats/counters. 2412 " 2413 ./tomahawk3/L3/ipmc_mpls_init.c," This Cint example to show configuration of the IPv4 multicast scenario 2414 with MPLS Tunnel Initiation using BCM APIs. Replication of IPMC packet 2415 to a set of MPLS tunnels for the given (S, G)/(*, G) 2416 "," a) Select one ingress and two egress ports and configure them in 2417 Loopback mode. 2418 b) Install an IFP rule to copy incoming packets to CPU and start 2419 packet watcher. 2420 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2421 nothing to do with an actual functional test. 2422 "," a) Configure a basic IPv4 multicast functional scenario. This adds the 2423 host in l3 table[host] and does the necessary configurations of vlan, 2424 interface and next hop. 2425 b) Configure MPLS Tunnel Initiation and associate with multicast egress 2426 object. 2427 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2428 'l3 egress show','multicast show', 'l2 show' and 'ipmc table show' 2429 b) Transmit the known IPv4 multicast packet. The contents of the packet 2430 are printed on screen. The packet used matches the route configured 2431 through script. 2432 "," We can see that dmac, smac and vlan are all changed as the packet is 2433 routed through the egress port. Also run the 'ipmc table show' to 2434 check the HIT bit status (y i.e Yes) and 'show c' to check the Tx/Rx 2435 packet stats/counters. 2436 Packet replicate to egress_port1 & egress_port2 in below format 2437 L2 + MPLS + L3 MC + Payload 2438 " 2439 ./tomahawk3/L3/ipmc.c," This Cint example to show configuration of the IPv4 multicast scenario 2440 using BCM APIs. 2441 "," a) Select one ingress and three egress ports and configure them in 2442 Loopback mode. 2443 b) Install an IFP rule to copy incoming packets to CPU and start 2444 packet watcher. 2445 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2446 nothing to do with an actual functional test. 2447 "," a) Configure a basic IPv4 multicast functional scenario. This adds the 2448 host in l3 table[host] and does the necessary configurations of vlan, 2449 interface and next hop. 2450 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2451 'l3 egress show','multicast show', 'l2 show' and 'ipmc table show' 2452 b) Transmit the known IPv4 multicast packet. The contents of the packet 2453 are printed on screen. The packet used matches the route configured 2454 through script. 2455 "," We can see that smac and vlan are all changed as the packet is routed 2456 through the egress por, but dmac is not changed as its a mcast 2457 replication flow. Also run the 'ipmc table show' to check the HIT 2458 bit status (y i.e Yes) and 'show c' to check the Tx/Rx packet 2459 stats/counters. 2460 " 2461 ./tomahawk3/L3/l3_route_frr.c," This Cint example to show configuration of the IPv4 route with failover 2462 scenario using BCM APIs. 2463 "," a) Selects three ports and configure them in Loopback mode. Out of these 2464 three ports, one port is used as ingress_port and the other as 2465 egress_ports(primary & backup). 2466 b) Install an IFP rule to copy incoming packets to CPU and start 2467 packet watcher. 2468 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2469 nothing to do with an actual functional test. 2470 "," a) Configure a basic IPv4 route/entry with failover functional scenario. 2471 This adds the route in l3 table[route] and does the necessary 2472 configurations of vlan, interface and next hop. 2473 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2474 'l3 egress show' and 'l3 defip show' 2475 b) Transmit the known IPv4 unicast packet. The contents of the packet 2476 are printed on screen. The packet used matches the route configured 2477 through script. 2478 "," We can see that dmac, smac and vlan are all changed as the packet is 2479 routed through the egress port. Also run the 'l3 defip show' to 2480 check the HIT bit status (y i.e Yes) and 'show c' to check the Tx/Rx 2481 packet stats/counters. 2482 " 2483 ./tomahawk3/L3/ipv4_host.c," This Cint example to show configuration of the IPv4 host entry using 2484 BCM APIs. 2485 "," a) Selects two ports and configure them in Loopback mode. Out of these 2486 two ports, one port is used as ingress_port and the other as 2487 egress_port. 2488 b) Install an IFP rule to copy incoming packets to CPU and start 2489 packet watcher. 2490 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2491 nothing to do with an actual functional test. 2492 "," a) Configure a basic IPv4 host/entry functional scenario. This adds the 2493 host in l3 table[host] and does the necessary configurations of vlan, 2494 interface and next hop. 2495 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2496 'l3 egress show' and 'l3 l3table show' 2497 b) Transmit the known IPv4 unicast packet. The contents of the packet 2498 are printed on screen. The packet used matches the route configured 2499 through script. 2500 "," We can see that dmac, smac and vlan are all changed as the packet is 2501 routed through the egress port. Also run the 'l3 l3table show' to 2502 check the HIT bit status (y i.e Yes) and 'show c' to check the Tx/Rx 2503 packet stats/counters. 2504 " 2505 ./tomahawk3/L3/ipv4_route.c," This Cint example to show configuration of the IPv4 route entry using 2506 BCM APIs. 2507 "," a) Selects two ports and configure them in Loopback mode. Out of these 2508 two ports, one port is used as ingress_port and the other as 2509 egress_port. 2510 b) Install an IFP rule to copy incoming packets to CPU and start 2511 packet watcher. 2512 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2513 nothing to do with an actual functional test. 2514 "," a) Configure a basic IPv4 route/entry functional scenario. This adds the 2515 route in l3 table[route] and does the necessary configurations of vlan, 2516 interface and next hop. 2517 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2518 'l3 egress show' and 'l3 defip show' 2519 b) Transmit the known IPv4 unicast packet. The contents of the packet 2520 are printed on screen. The packet used matches the route configured 2521 through script. 2522 "," We can see that dmac, smac and vlan are all changed as the packet is 2523 routed through the egress port. Also run the 'l3 defip show' to 2524 check the HIT bit status (y i.e Yes) and 'show c' to check the Tx/Rx 2525 packet stats/counters. 2526 " 2527 ./tomahawk3/L3/ipv6_route.c," This Cint example to show configuration of the IPv6 route entry using 2528 BCM APIs. 2529 "," a) Selects two ports and configure them in Loopback mode. Out of these 2530 two ports, one port is used as ingress_port and the other as 2531 egress_port. 2532 b) Install an IFP rule to copy incoming packets to CPU and start 2533 packet watcher. 2534 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2535 nothing to do with an actual functional test. 2536 "," a) Configure a basic IPv6 route/entry functional scenario. This adds the 2537 route in l3 table[route] and does the necessary configurations of vlan, 2538 interface and next hop. 2539 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2540 'l3 egress show' and 'l3 ip6route show' 2541 b) Transmit the known IPv6 unicast packet. The contents of the packet 2542 are printed on screen. The packet used matches the route configured 2543 through script. 2544 "," We can see that dmac, smac and vlan are all changed as the packet is 2545 routed through the egress port. Also run the 'l3 ip6route show' to 2546 check the HIT bit status (y i.e Yes) and 'show c' to check the Tx/Rx 2547 packet stats/counters. 2548 " 2549 ./tomahawk3/L3/ipv4_route_dscp_queuing_remarking.c," This Cint example to show configuration of the IPv4 route with DSCP queuing 2550 and remarking using BCM APIs. 2551 "," a) Selects two ports and configure them in Loopback mode. Out of these 2552 two ports, one port is used as ingress_port and the other as 2553 egress_port. 2554 b) Install an IFP rule to copy incoming packets to CPU and start 2555 packet watcher. 2556 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2557 nothing to do with an actual functional test. 2558 "," a) Configure a basic IPv4 DSCP Queuing and remark QoS mapping functional 2559 scenario. This adds the route in l3 table[route] and does the 2560 necessary configurations of vlan, interface and next hopi. 2561 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2562 'l3 egress show' and 'l3 defip show' 2563 b) Transmit the known IPv4 unicast packet with DSCP. The contents of the 2564 packet are printed on screen. The packet used matches the route 2565 configured through script. 2566 "," We can see that dmac, smac and vlan are all changed as the packet is 2567 routed through the egress port and priority as 3. Also run the 2568 'l3 defip show' to check the HIT bit status (y i.e Yes) and 'show c' 2569 to check the Tx/Rx packet stats/counters. 2570 " 2571 ./tomahawk3/pkt_trace/ptrace_lag_ecmp.c," This CINT example shows how to trace a packet using BCM APIs. 2572 The BCM API to trace a packet is bcm_switch_pkt_trace_info_get(). 2573 This API returns the captured traced information. This example 2574 parses the traced information, maps returned values to corresponding 2575 software objects, and prints the traced information in readable form. 2576 The packet trace results are determined by how the switch processes the 2577 packet specified in the API call. As such, for a desired behavior, 2578 the switch should be configured how to forward the packet before 2579 tracing the packet. In this example, L3 routing flow with destination 2580 as ecmp and trunk is configured and the packet is sent to match the 2581 configured L3 routing flow. 2582 "," a) Select one ingress and six egress ports and configure them in 2583 Loopback mode. 2584 b) Configure RTAG7 settings for ECMP and trunk application. 2585 c) Create two trunks each having three members. 2586 d) Create an ecmp groups with two ecmp members where each ecmp member 2587 uses one of the two trunks created in step 1.c. 2588 ",," a) Transmit the below trace packet on ingress_port. 2589 Packet: 2590 ======= 2591 DA 0x00000000AAAA 2592 SA 0x000000002222 2593 VLAN 12 2594 DIP=192.168.10.33 2595 SIP =10.10.10.33 2596 00 00 00 00 AA AA 00 00 00 00 22 22 81 00 00 0C 2597 08 00 45 00 00 2E 00 00 00 00 40 FF 9A DD 0A 0A 2598 0A 21 C0 A8 0A 21 C4 65 87 43 14 45 B9 76 63 DB 2599 AB C3 4F DF 83 CD BC 36 E5 B5 1A 20 5D EA E7 B3 2600 B8 B4 B1 75 2601 "," Verify that lookup status results, packet resolution result, ecmp resolution result 2602 and trunk resolution result are displayed as below. 2603 Lookup Status Results: 2604 ForwardingVlanValid 2605 L3DestRouteHit 2606 MystationHit 2607 Packet Resolution Result: 2608 KnownL3UcPkt 2609 Source port STP state: Forward 2610 Hash resolution: ECMP1 2611 EMCP egress object=200000 2612 Number of egress objects in ecmp group:2 2613 Egress Object 0: 100002 2614 Egress Object 1: 100003 2615 Egress object selected for the packet is 100002 2616 trunk=1, L3 interface=0, mac=00:00:00:00:11:11, vlan=13 2617 Hash resolution: Trunk 2618 Trunk: 1 2619 Rtag: 9 2620 Members: 3 ports 2621 modport(0, 2) 2622 modport(0, 3) 2623 modport(0, 4) 2624 Trunk member selected for the packet: modport(0, 4) 2625 " 2626 ./tomahawk3/mpls/l3_mpls_init_frr.c," This Cint example to show configuration of the L3 MPLS VPN initiation with 2627 failover scenario using BCM APIs. 2628 "," a) Selects three ports and configure them in Loopback mode. Out of these 2629 three ports, one port is used as ingress_port and the other as 2630 egress_ports (primary & backup). 2631 b) Install an IFP rule to copy incoming packets to CPU and start 2632 packet watcher. 2633 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2634 nothing to do with an actual functional test. 2635 "," a) Configure a basic L3 MPLS Tunnel Initiation functional scenario with 2636 failover and does the necessary configurations of vlan, interface, 2637 next hop and Tunnel + VC labels. 2638 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2639 'l3 egress show' and 'l3 defip show' 2640 b) Transmit the known IPv4 unicast packet. The contents of the packet 2641 are printed on screen. The packet used matches the route configured 2642 through script. 2643 "," We can see that dmac, smac and vlan are all changed as the packet is 2644 routed through the egress port and also Tunnel + VC labels are PUSHed 2645 as part of tunnel initiation on egress port. Also run the 2646 'l3 defip show' to check the HIT bit status (y i.e Yes) and 'show c' 2647 to check the Tx/Rx packet stats/counters. And also, we can see failover 2648 _failover_set or 2649 _failover_egress_status_set and observe that packet is routed to 2650 backup path/tunnel. 2651 " 2652 ./tomahawk3/mpls/lsr_trunk.c," This Cint example to show configuration of L3 MPLS tunnel LSR with trunk 2653 using BCM APIs. 2654 "," a) Selects five ports and configure them in Loopback mode. Out of these 2655 five ports, one port is used as ingress_port and the other as 2656 egress_ports(trunk egress members). 2657 b) Install an IFP rule to copy incoming packets to CPU and start 2658 packet watcher. 2659 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2660 nothing to do with an actual functional test. 2661 "," a) Configure a basic L3 MPLS Tunnel Swap with Trunk functional scenario and 2662 does the necessary configurations of vlan, interface and next hop. 2663 "," a) Check the configurations by 'vlan show', 'l3 intf show' and 2664 'l3 egress show'. 2665 b) Transmit the MPLS packet. The contents of the packet are printed on screen. 2666 "," We can see that dmac, smac and vlan are all changed as the packet is 2667 routed through the egress port and observe that each time, the outgoing 2668 packet use a different trunk member port. Also run the 'show c' 2669 to check the Tx/Rx packet stats/counters. 2670 " 2671 ./tomahawk3/mpls/l3_mpls_init.c," This Cint example to show configuration of L3 MPLS tunnel initiation using 2672 BCM APIs. 2673 "," a) Selects two ports and configure them in Loopback mode. Out of these 2674 two ports, one port is used as ingress_port and the other as 2675 egress_port. 2676 b) Install an IFP rule to copy incoming packets to CPU and start 2677 packet watcher. 2678 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2679 nothing to do with an actual functional test. 2680 "," a) Configure a basic L3 MPLS Tunnel Initiation functional scenario and 2681 does the necessary configurations of vlan, interface, next hop and 2682 Tunnel + VC labels. 2683 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2684 'l3 egress show' and 'l3 defip show' 2685 b) Transmit the known IPv4 unicast packet. The contents of the packet 2686 are printed on screen. The packet used matches the route configured 2687 through script. 2688 "," We can see that dmac, smac and vlan are all changed as the packet is 2689 routed through the egress port and also Tunnel + VC labels are pushed 2690 as part of tunnel initiation on egress port. Also run the 2691 'l3 defip show' to check the HIT bit status (y i.e Yes) and 'show c' 2692 to check the Tx/Rx packet stats/counters. 2693 " 2694 ./tomahawk3/mpls/l3_mpls_vpn_pop_qos.c," This Cint example to show configuration of L3 MPLS tunnel termination 2695 with QoS using BCM APIs. 2696 "," a) Selects two ports and configure them in Loopback mode. Out of these 2697 two ports, one port is used as ingress_port and the other as 2698 egress_port. 2699 b) Install an IFP rule to copy incoming packets to CPU and start 2700 packet watcher. 2701 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2702 nothing to do with an actual functional test. 2703 "," a) Configure a basic L3 MPLS Tunnel termination functional scenario and 2704 does the necessary configurations of vlan, interface, next hop and 2705 Tunnel + VC labels with POP action. 2706 b) COnfigure a QoS remapping from incoming packet EXP to internal priority. 2707 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2708 'l3 egress show' and 'l3 defip show' 2709 b) Transmit the MPLS packet with TWO labels & EXP as 3. The contents 2710 of the packet are printed on screen. 2711 "," We can see that dmac, smac and vlan are all changed as the packet is 2712 routed through the egress port after Tunnel + VC labels are POPed 2713 as part of tunnel termination on ingress port. We can observe that 2714 exp is mapped to CoS 3 and int_proi as 6 on egress side. Also run the 2715 'l3 defip show' to check the HIT bit status (y i.e Yes) and 'show c' 2716 to check the Tx/Rx packet stats/counters. 2717 " 2718 ./tomahawk3/mpls/lsr_swap_frr.c," This Cint example to show configuration of the L3 MPLS LSR swap with 2719 failover scenario using BCM APIs. 2720 "," a) Selects three ports and configure them in Loopback mode. Out of these 2721 three ports, one port is used as ingress_port and the other as 2722 egress_ports (primary & backup). 2723 b) Install an IFP rule to copy incoming packets to CPU and start 2724 packet watcher. 2725 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2726 nothing to do with an actual functional test. 2727 "," a) Configure a basic L3 MPLS Tunnel swap functional scenario with 2728 failover and does the necessary configurations of vlan, interface, 2729 next hop and swap labels. 2730 "," a) Check the configurations by 'vlan show', 'l3 intf show' and 2731 'l3 egress show'. 2732 b) Transmit the MPLS Label packet. The contents of the packet 2733 are printed on screen. 2734 "," We can see that dmac, smac and vlan are all changed as the packet is 2735 routed through the egress port and also MPLS Labels are swapped 2736 as part of tunnel switching on egress port. Also run the 'show c' 2737 to check the Tx/Rx packet stats/counters. 2738 _failover_set or 2739 _failover_egress_status_set and observe that packet is switched/routed 2740 to backup path/tunnel. 2741 " 2742 ./tomahawk3/mpls/lsr_push.c," This Cint example to show configuration of L3 MPLS tunnel LSR label Swap & 2743 Push label using BCM APIs. 2744 "," a) Selects two ports and configure them in Loopback mode. Out of these 2745 two ports, one port is used as ingress_port and the other as 2746 egress_port. 2747 b) Install an IFP rule to copy incoming packets to CPU and start 2748 packet watcher. 2749 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2750 nothing to do with an actual functional test. 2751 "," a) Configure a basic L3 MPLS Tunnel LSR with push+swap functional scenario and 2752 does the necessary configurations of vlan, interface and next hop. 2753 "," a) Check the configurations by 'vlan show', 'l3 intf show' and 2754 'l3 egress show'. 2755 b) Transmit the MPLS packet. The contents of the packet are printed on 2756 screen. The packet used matches the route configured through script. 2757 "," We can see that dmac, smac and vlan are all changed as the packet is 2758 routed through the egress port and observe that one Label is pushed and other 2759 label is swapped. 2760 " 2761 ./tomahawk3/mpls/l3_mpls_term.c," This Cint example to show configuration of L3 MPLS tunnel termination using 2762 BCM APIs. 2763 "," a) Selects two ports and configure them in Loopback mode. Out of these 2764 two ports, one port is used as ingress_port and the other as 2765 egress_port. 2766 b) Install an IFP rule to copy incoming packets to CPU and start 2767 packet watcher. 2768 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2769 nothing to do with an actual functional test. 2770 "," a) Configure a basic L3 MPLS Tunnel termination functional scenario and 2771 does the necessary configurations of vlan, interface, next hop and 2772 Tunnel + VC labels with POP action. 2773 "," a) Check the configurations by 'vlan show', 'l3 intf show', 2774 'l3 egress show' and 'l3 defip show' 2775 b) Transmit the MPLS packet with IP unicast payload. The contents of the packet 2776 are printed on screen. The packet used matches the route configured 2777 through script. 2778 "," We can see that dmac, smac and vlan are all changed as the packet is 2779 routed through the egress port after Tunnel + VC labels are POPed 2780 as part of tunnel termination on ingress port. Also run the 2781 'l3 defip show' to check the HIT bit status (y i.e Yes) and 'show c' 2782 to check the Tx/Rx packet stats/counters. 2783 " 2784 ./tomahawk3/mpls/lsr_qos.c," This Cint example to show configuration of L3 MPLS tunnel LSR label Swap with QoS 2785 using BCM APIs. 2786 "," a) Selects two ports and configure them in Loopback mode. Out of these 2787 two ports, one port is used as ingress_port and the other as 2788 egress_port. 2789 b) Install an IFP rule to copy incoming packets to CPU and start 2790 packet watcher. 2791 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2792 nothing to do with an actual functional test. 2793 "," a) Configure a basic L3 MPLS LSR with QoS functional scenario and 2794 does the necessary configurations of vlan, interface and next hop. 2795 "," a) Check the configurations by 'vlan show', 'l3 intf show' and 2796 'l3 egress show' 2797 b) Transmit the MPLS packet. The contents of the packet are printed 2798 on screen. The packet used matches the route configured through script. 2799 "," We can see that dmac, smac and vlan are all changed as the packet is 2800 routed through the egress port and observe that EXP is marked for 2801 MPLS Label. Also run the 'show c' to check the Tx/Rx packet stats/counters. 2802 " 2803 ./tomahawk3/mpls/lsr_multi_segment.c," This Cint example to show configuration of L3 MPLS tunnel switching for 2804 MS-PW scenario using BCM APIs. 2805 A multi-segment pseudowire (MS-PW) is a set of two or more PW segments that 2806 function as a single PW, as shown in the figure below. It is also known as 2807 switched PW. MS-PWs span multiple cores or autonomous systems of the same or 2808 different carrier networks. 2809 Segmenting the pseudowires is also referred to as pseudowire switching. 2810 The following occurs in a pseudowire-switching at S-PE: 2811 - The service receives vc-encapsulated traffic from one pseudowire segment. 2812 - The service performs a de-encapsulation, followed by another vc-encapsulation. 2813 - The service sends the traffic out over another pseudowire segment. 2814 In this scenario, the vc-label has been swapped, and traffic is switched from 2815 one pseudowire segment to another. 2816 "," a) Selects two ports and configure them in Loopback mode. Out of these 2817 two ports, one port is used as ingress_port and the other as 2818 egress_port. 2819 b) Install an IFP rule to copy incoming packets to CPU and start 2820 packet watcher. 2821 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2822 nothing to do with an actual functional test. 2823 "," a) Configure a basic L3 MPLS Tunnel switching/swapping functional 2824 scenario and does the necessary configurations of vlan, interface, 2825 next hop and Tunnel + VC labels. 2826 "," a) Check the configurations by 'vlan show', 'l3 intf show',and 2827 'l3 egress show' 2828 b) Transmit the MPLS packet with TWO labes. The contents of the packet 2829 are printed on screen. 2830 "," We can see that dmac, smac and vlan are all changed as the packet is 2831 routed through the L3 egress object/port and also the vc-label has 2832 been swapped, and traffic is switched from one pseudowire segment to 2833 another. 2834 " 2835 ./tomahawk3/mpls/lsr_php.c," This Cint example to show configuration of L3 MPLS tunnel LSR with PHP 2836 using BCM APIs. 2837 "," a) Selects two ports and configure them in Loopback mode. Out of these 2838 two ports, one port is used as ingress_port and the other as 2839 egress_port. 2840 b) Install an IFP rule to copy incoming packets to CPU and start 2841 packet watcher. 2842 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2843 nothing to do with an actual functional test. 2844 "," a) Configure a basic L3 MPLS LSR with PHP functional scenario and 2845 does the necessary configurations of vlan, interface, next hop and 2846 Tunnel Label with PHP action. 2847 "," a) Check the configurations by 'vlan show', 'l3 intf show' and 2848 'l3 egress show'. 2849 b) Transmit the MPLS packet. The contents of the packet are printed 2850 on screen. The packet used matches the route configured through script. 2851 "," We can see that dmac, smac and vlan are all changed as the packet is 2852 routed through the egress port after Tunnel label POPed(PHP) 2853 as part of tunnel termination on ingress port and observe that 2854 no change in Bos(VC) label if TWO label packet is ingressed. 2855 " 2856 ./tomahawk3/mpls/lsr_swap_1.c," This Cint example to show configuration of L3 MPLS tunnel LSR label Swap 2857 using BCM APIs. 2858 "," a) Selects two ports and configure them in Loopback mode. Out of these 2859 two ports, one port is used as ingress_port and the other as 2860 egress_port. 2861 b) Install an IFP rule to copy incoming packets to CPU and start 2862 packet watcher. 2863 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2864 nothing to do with an actual functional test. 2865 "," a) Configure a basic L3 MPLS Tunnel swap/switching functional scenario and 2866 does the necessary configurations of vlan, interface and next hop. 2867 "," a) Check the configurations by 'vlan show', 'l3 intf show' and 2868 'l3 egress show'. 2869 b) Transmit the MPLS with One / Two Label with different TTL packet. 2870 The contents of the packet are printed on screen. 2871 "," We can see that dmac, smac and vlan are all changed as the packet is 2872 routed through the egress port and observe that MPLS Label is swapped 2873 for different trails and covered with TTL checks as well. Also run the 'show c' 2874 to check the Tx/Rx packet stats/counters. 2875 " 2876 ./tomahawk3/mpls/lsr_swap.c," This Cint example to show configuration of L3 MPLS tunnel LSR label Swap 2877 using BCM APIs. 2878 "," a) Selects two ports and configure them in Loopback mode. Out of these 2879 two ports, one port is used as ingress_port and the other as 2880 egress_port. 2881 b) Install an IFP rule to copy incoming packets to CPU and start 2882 packet watcher. 2883 Note: IFP rule is meant for a testing purpose only (Internal) and it is 2884 nothing to do with an actual functional test. 2885 "," a) Configure a basic L3 MPLS Tunnel swap/switching functional scenario and 2886 does the necessary configurations of vlan, interface and next hop. 2887 "," a) Check the configurations by 'vlan show', 'l3 intf show' and 2888 'l3 egress show'. 2889 b) Transmit the MPLS with One / Two Label with different TTL packet. 2890 The contents of the packet are printed on screen. 2891 "," We can see that dmac, smac and vlan are all changed as the packet is 2892 routed through the egress port and observe that MPLS Label is swapped 2893 for different trails and covered with TTL checks as well. Also run the 'show c' 2894 to check the Tx/Rx packet stats/counters. 2895 " 2896 ./tomahawk3/flex_cnt/flex_cnt_l3_ingress_new_api.c," This cint example configures L3 ingress interface and attaches a flex counter 2897 to the L3 interface. It also demonstrates how to retrieve these counters. 2898 "," a) Selects one ingress port and one egress port and configure them in Loopback mode. 2899 Install a rule to copy incoming packets to CPU and start packet watcher. 2900 "," a) Create an ingress_vlan(21) and add ingress_port as it member. 2901 b) Create an egress_vlan(22) and add egress_port as it member. 2902 c) Create two L3 interfaces one for ingress side and the other for egress side. 2903 d) Create two egress objects one for ingress side and the other for egress side. 2904 e) Create a route entry and attach flex counters to ingress L3 interface(L3_IIF). 2905 Three flex counters are attached to the same ingress L3 interface. 2906 Counter at offset 0 is for KNOWN_L3UC_PKT. 2907 Counter at offset 1 is for UNKNOWN_L3UC_PKT 2908 Counter at offset 2 is for L2_BC. 2909 "," a) Send 3 KNOWN_L3_UNICAST packets. Below are the packet contents. 2910 Ethernet: dst<00:00:00:00:11:11> src<00:00:00:00:00:01> Tagged Packet ProtID<0x8100> Ctrl<0x0015> Internet Protocol (IP) 2911 IP: V(4) src<2.2.2.2> dst<1.1.1.1> hl<5> service-type<0> tl<46> id<0> frg-off<0> ttl<64> > chk-sum<0x73cc> 2912 Retrieve L3IIF flex counters and print them. 2913 b) Send another 2 KNOWN_L3_UNICAST packets. Packet contents are same as in step 3.a 2914 Retrieve L3IIF flex counters and print them. 2915 c) Send 2 UNKNOWN_L3_UNICAST packets. Below are the packet contents. 2916 Ethernet: dst<00:00:00:00:11:11> src<00:00:00:00:00:01> Tagged Packet ProtID<0x8100> Ctrl<0x0015> Internet Protocol (IP) 2917 IP: V(4) src<2.2.2.2> dst<1.1.1.2> hl<5> service-type<0> tl<46> id<0> frg-off<0> ttl<64> > chk-sum<0x73cb> 2918 Retrieve L3IIF flex counters and print them. 2919 d) Send 2 L2_BC packets. Below are the packet contents. 2920 Ethernet: dst<ff:ff:ff:ff:ff:ff> src<00:00:05:00:01:00> Tagged Packet ProtID<0x8100> Ctrl<0x0015> 802.3 Packet 2921 IP: V(0) src<14.15.16.17> dst<18.19.20.21> hl<2> service-type<3> tl<1029> id<1543> frg-off<2057> ttl<10> > chk-sum<0x0c0d> 2922 Retrieve L3IIF flex counters and print them. 2923 "," After step 3.a, verify that counter at offset 0 is 3. 2924 After step 3.b, verify that counter at offset 0 is 5. 2925 After step 3.c, verify that counter at offset 1 is 2. 2926 After step 3.d, verify that counter at offset 2 is 2. 2927 " 2928 ./tomahawk3/flex_cnt/flex_cnt_l3_egress_new_api.c," This cint example configures and attaches a flex counter to a EGR L3 nexthop. 2929 It also demonstrates how to retrieve these counters. 2930 "," a) Selects one ingress port and one egress port and configure them in Loopback mode. 2931 Install a rule to copy incoming packets to CPU on egress port 2932 and start packet watcher. 2933 "," a) Create an ingress_vlan(21) and add ingress_port as it member. 2934 b) Create an egress_vlan(22) and add egress_port as it member. 2935 c) Create two L3 interfaces one for ingress side and the other for egress side. 2936 d) Create two egress objects one for ingress side and the other for egress side. 2937 e) Create a route entry and attach flex counter to egress L3 nexthop. Three counters 2938 are attached to the same egress L3 nexthop. 2939 Counter at offset 1 to count packets with outer tag priority 0 2940 Counter at offset 2 to count packets with outer tag priority 1 2941 Counter at offset 3 to count packets with outer tag priority 2 2942 "," a) Send 3 packets with outertag priority 0. Below are the packet contents. 2943 Ethernet: dst<00:00:00:00:11:11> src<00:00:00:00:00:01> Tagged Packet ProtID<0x8100> Ctrl<0x0015> Internet Protocol (IP) 2944 IP: V(4) src<2.2.2.2> dst<1.1.1.1> hl<5> service-type<0> tl<46> id<0> frg-off<0> ttl<64> > chk-sum<0x73cc> 2945 Retrieve Egress L3 Nexthop flex counters and print them. 2946 b) Send another 2 packets with outertag priority 0. Packet contents are same as in step 3. 2947 Retrieve Egress L3 Nexthop flex counters and print them. 2948 c) Send 2 packets with outertag priority 1. Below are the packet contents. 2949 Ethernet: dst<00:00:00:00:11:11> src<00:00:00:00:00:01> Tagged Packet ProtID<0x8100> Ctrl<0x2015> Internet Protocol (IP) 2950 IP: V(4) src<2.2.2.2> dst<1.1.1.1> hl<5> service-type<0> tl<46> id<0> frg-off<0> ttl<64> > chk-sum<0x73cc> 2951 Retrieve Egress L3 Nexthop flex counters and print them. 2952 d) Send 2 packets with outertag priority 2. Below are the packet contents. 2953 Ethernet: dst<00:00:00:00:11:11> src<00:00:00:00:00:01> Tagged Packet ProtID<0x8100> Ctrl<0x4015> Internet Protocol (IP) 2954 IP: V(4) src<2.2.2.2> dst<1.1.1.1> hl<5> service-type<0> tl<46> id<0> frg-off<0> ttl<64> > chk-sum<0x73cc> 2955 Retrieve Egress L3 Nexthop flex counters and print them. 2956 "," After step 3.a, verify that counter at offset 0 is 3. 2957 After step 3.b, verify that counter at offset 0 is 5. 2958 After step 3.c, verify that counter at offset 1 is 2. 2959 After step 3.d, verify that counter at offset 2 is 2. 2960 * 2961 " 2962 ./tomahawk3/flex_cnt/flex_cnt_l3_egress.c," This cint example configures and attaches a flex counter to a EGR L3 nexthop. 2963 It also demonstrates how to retrieve these counters. 2964 "," a) Selects one ingress port and one egress port and configure them in Loopback mode. 2965 Install a rule to copy incoming packets to CPU on egress port 2966 and start packet watcher. 2967 "," a) Create an ingress_vlan(21) and add ingress_port as it member. 2968 b) Create an egress_vlan(22) and add egress_port as it member. 2969 c) Create two L3 interfaces one for ingress side and the other for egress side. 2970 d) Create two egress objects one for ingress side and the other for egress side. 2971 e) Create a route entry and attach flex counter to egress L3 nexthop. 2972 "," a) Send 3 packets that hit the egress L3 netxhop, retrieve the counters and print them. 2973 Packet 2974 ====== 2975 Ethernet: dst<00:00:00:00:11:11> src<00:00:00:00:00:01> Tagged Packet ProtID<0x8100> Ctrl<0x0015> Internet Protocol (IP) 2976 IP: V(4) src<2.2.2.2> dst<1.1.1.1> hl<5> service-type<0> tl<46> id<0> frg-off<0> ttl<64> > chk-sum<0x73cc> 2977 b) Send another 2 packets(same packet content as above), retrieve the counters and print them. 2978 "," After step 3.a, verify that the counter value is 3. 2979 After step 3.b, verify that the counter value is 5. 2980 * 2981 " 2982 ./tomahawk3/flex_cnt/flex_cnt_l3_ingress.c," This cint example configures L3 ingress interface and attaches a flex counter 2983 to the L3 interface. It also demonstrates how to retrieve these counters. 2984 "," a) Selects one ingress port and one egress port and configure them in Loopback mode. 2985 Install a rule to copy incoming packets to CPU and start packet watcher. 2986 "," a) Create an ingress_vlan(21) and add ingress_port as it member. 2987 b) Create an egress_vlan(22) and add egress_port as it member. 2988 c) Create two L3 interfaces one for ingress side and the other for egress side. 2989 d) Create two egress objects one for ingress side and the other for egress side. 2990 e) Create a route entry and attach flex counter to ingress L3 interface ( L3IIF ). 2991 "," a) Send 3 packets that hit the ingress L3 interface, retrieve the counters and print them. 2992 Packet 2993 ====== 2994 Ethernet: dst<00:00:00:00:11:11> src<00:00:00:00:00:01> Tagged Packet ProtID<0x8100> Ctrl<0x0015> Internet Protocol (IP) 2995 IP: V(4) src<2.2.2.2> dst<1.1.1.1> hl<5> service-type<0> tl<46> id<0> frg-off<0> ttl<64> > chk-sum<0x73cc> 2996 b) Send another 2 packets(same packet content as above), retrieve the counters and print them. 2997 "," After step 3.a, verify that the counter value is 3. 2998 After step 3.b, verify that the counter value is 5. 2999 " 3000 ./tomahawk3/vlan/l2_qos.c," This cint example configures mapping between {L2 packet Priority + CFI bit} and 3001 {internal priority and CNG} using BCM APIs. It also shows how internal priority 3002 and CNG can be used to remark out going packet's priority and CFI fields. 3003 "," a) Selects one ingress port and one egress port and configure them in Loopback mode. 3004 Install a rule to copy incoming packets to CPU and start packet watcher. 3005 "," a) Creates a VLAN(20) and add ingress port and egress port as members. 3006 b) Configure ingress port's default VLAN as 20, default packet priority as 4 and CFI as 1. 3007 c) Configure ingress QoS mapping as below and attach it to ingress_port. 3008 {packet priority(4) + CFI(1)} is mapped to {internal_priority(10) + CNG(Yellow)}. 3009 d) Configure egress QoS mapping as below and attach it to egress_port. 3010 {{internal_priority(10) + CNG(Yellow)} is mapped {packet priority(2) + CFI(0)}. 3011 "," a) Send the below untagged packet on ingress port. 3012 Packet: 3013 ======= 3014 Ethernet header: DA=00:00:00:00:00:02, SA=00:00:00:00:00:01 3015 0000 0000 0002 0000 0000 0001 0001 0203 3016 0405 0607 0809 0A0B 0C0D 0E0F 1011 1213 3017 1415 1617 1819 1A1B 1C1D 1E1F 2021 2223 3018 2425 2627 2829 2A2B 2C2D 2E2F DF52 E538 3019 "," The packet going out of egress_port has packet priority as ""2"" and CFI as ""0"". 3020 Below is the packet that egresses out of egress_port. 3021 Packet: 3022 ======= 3023 Ethernet II, Src: 00:00:00_00:00:01 (00:00:00:00:00:01), Dst: 00:00:00_00:00:02 (00:00:00:00:00:02) 3024 802.1Q Virtual LAN, PRI: 2, CFI: 0, ID: 20 3025 010. .... .... .... = Priority: Spare (2) 3026 ...0 .... .... .... = CFI: Canonical (0) 3027 .... 0000 0001 0100 = ID: 20 3028 0000 0000 0002 0000 0000 0001 8100 4014 3029 0001 0203 0405 0607 0809 0a0b 0c0d 0e0f 3030 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 3031 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3032 df52 e538 3033 " 3034 ./tomahawk3/vlan/stg.c," This cint example demonstrates Spanning tree group state management for 3035 physical ports using BCM APIs. This script also demonstrates how to set up 3036 default STG on the device. It displays the STGs present in the system with 3037 respect to ports and VLANs. 3038 "," a) Select three ports port1, port2 and port3. 3039 "," a) Creates two vlans 10 and 20 add port1, port2 and port3 as members. 3040 b) Create a new default STG and print it. 3041 c) Create another STG(25) and add vlan 10 and 20. 3042 d) Set STP state for vlan 10 for port1, port2, port3 as FORWARD. 3043 "," a) Execute ""stg show"" and display the VLAN_STG, EGR_VLAN_STG HW tables. 3044 "," In VLAN_STG[25], field SP_TREE_PORT<portnum> is set to 3 (i.e FORWARD) 3045 In EGR_VLAN_STG[25], field SP_TREE_PORT<portnum> is set to 3 (i.e FORWARD) 3046 ""stg show"" displays all the STG ids and the corresponding port's STP state. 3047 " 3048 ./tomahawk3/vlan/private_vlan.c," CINT scripts for demonstrating the learning based on the private vlan 3049 using BCM api's 3050 "," a) Selects all five port and configure them in Loop back mode. 3051 Install a rule to copy incoming packets to CPU and start packet watcher. 3052 "," a) configure isolated port1 and isolated port2 with isolated vlan 102 3053 b) configure community port1 and community port2 with community vlan 101 3054 c) configure promiscuous port with promiscuous vlan 100 3055 "," a) Send the below packet on isolated port_1. 3056 Packet: 3057 ====== 3058 DA=00:00:00:00:11:11 3059 SA=00:00:00:00:AA:AA 3060 Vlan=102 3061 00 00 00 00 11 11 00 00 00 00 AA AA 81 00 00 3062 66 FF FF 88 E7 00 00 FA CE 00 00 00 00 11 22 3063 00 00 00 00 AA AA 81 00 0F A0 00 01 02 03 04 3064 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 3065 14 15 16 17 6B 53 25 A9 3066 b) Send the below packet on promiscuous port. 3067 Packet: 3068 ====== 3069 DA=00:00:00:00:AA:AA 3070 SA=00:00:00:00:11:11 3071 Vlan=100 3072 00 00 00 00 AA AA 00 00 00 00 11 11 81 00 00 3073 64 08 00 00 01 02 03 04 05 06 07 08 09 0A 0B 3074 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 3075 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 3076 2A 2B 2C 2D 4B 25 17 6E 3077 c) Send the below packet on Community port_1. 3078 Packet: 3079 ====== 3080 DA=00:00:00:00:11:11 3081 SA=00:00:00:00:AA:AA 3082 Vlan=101 3083 00 00 00 00 11 11 00 00 00 00 AA AA 81 00 00 3084 65 FF FF 88 E7 00 00 FA CE 00 00 00 00 11 22 3085 00 00 00 00 AA AA 81 00 0F A0 00 01 02 03 04 3086 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 3087 14 15 16 17 6B 53 25 A9 3088 "," The below packet egresses on promiscuous port for step 3.a. 3089 Packet: 3090 ====== 3091 DA=00:00:00:00:11:11 3092 SA=00:00:00:00:AA:AA 3093 Vlan=100 3094 00 00 00 00 11 11 00 00 00 00 AA AA 81 00 00 3095 64 FF FF 88 E7 00 00 FA CE 00 00 00 00 11 22 3096 00 00 00 00 AA AA 81 00 0F A0 00 01 02 03 04 3097 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 3098 14 15 16 17 0C 0B E4 6C 3099 The below packet egresses on all ports for step 3.b. 3100 Packet: 3101 ====== 3102 DA=00:00:00:00:AA:AA 3103 SA=00:00:00:00:11:11 3104 00 00 00 00 AA AA 00 00 00 00 11 11 81 00 00 3105 66 08 00 00 01 02 03 04 05 06 07 08 09 0A 0B 3106 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 3107 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 3108 2A 2B 2C 2D 2C 7D D6 AB 3109 The below packet egresses on promiscuous port and Community port_2 for set 3.c. 3110 Packet: 3111 ====== 3112 DA=00:00:00:00:11:11 3113 SA=00:00:00:00:AA:AA 3114 Vlan=100 3115 00 00 00 00 11 11 00 00 00 00 AA AA 81 00 00 3116 64 FF FF 88 E7 00 00 FA CE 00 00 00 00 11 22 3117 00 00 00 00 AA AA 81 00 0F A0 00 01 02 03 04 3118 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 3119 14 15 16 17 0C 0B E4 6C 3120 Packet: 3121 ====== 3122 DA=00:00:00:00:11:11 3123 SA=00:00:00:00:AA:AA 3124 Vlan=101 3125 00 00 00 00 11 11 00 00 00 00 AA AA 81 00 00 3126 65 FF FF 88 E7 00 00 FA CE 00 00 00 00 11 22 3127 00 00 00 00 AA AA 81 00 0F A0 00 01 02 03 04 3128 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 3129 14 15 16 17 6B 53 25 A9 3130 The below packet egresses on promiscuous port. 3131 Packet: 3132 ====== 3133 DA=00:00:00:00:11:11 3134 SA=00:00:00:00:AA:AA 3135 Vlan=100 3136 00 00 00 00 11 11 00 00 00 00 AA AA 81 00 00 3137 64 FF FF 88 E7 00 00 FA CE 00 00 00 00 11 22 3138 00 00 00 00 AA AA 81 00 0F A0 00 01 02 03 04 3139 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 3140 14 15 16 17 0C 0B E4 6C 3141 c) Send the below packet on promiscuous port. 3142 Packet: 3143 ====== 3144 DA=00:00:00:00:AA:AA 3145 SA=00:00:00:00:11:11 3146 Vlan=100 3147 00 00 00 00 AA AA 00 00 00 00 11 11 81 00 00 3148 64 08 00 00 01 02 03 04 05 06 07 08 09 0A 0B 3149 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 3150 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 3151 2A 2B 2C 2D 4B 25 17 6E 3152 d)Expected Result 3153 ================== 3154 The below packet egresses on all ports. 3155 Packet: 3156 ====== 3157 DA=00:00:00:00:AA:AA 3158 SA=00:00:00:00:11:11 3159 00 00 00 00 AA AA 00 00 00 00 11 11 81 00 00 3160 66 08 00 00 01 02 03 04 05 06 07 08 09 0A 0B 3161 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 3162 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 3163 2A 2B 2C 2D 2C 7D D6 AB 3164 e) Send the below packet on Community port_1. 3165 Packet: 3166 ====== 3167 DA=00:00:00:00:11:11 3168 SA=00:00:00:00:AA:AA 3169 Vlan=101 3170 00 00 00 00 11 11 00 00 00 00 AA AA 81 00 00 3171 65 FF FF 88 E7 00 00 FA CE 00 00 00 00 11 22 3172 00 00 00 00 AA AA 81 00 0F A0 00 01 02 03 04 3173 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 3174 14 15 16 17 6B 53 25 A9 3175 f)Expected Result 3176 ================== 3177 The below packet egresses on promiscuous port and Community port_2. 3178 Packet: 3179 ====== 3180 DA=00:00:00:00:11:11 3181 SA=00:00:00:00:AA:AA 3182 Vlan=100 3183 00 00 00 00 11 11 00 00 00 00 AA AA 81 00 00 3184 64 FF FF 88 E7 00 00 FA CE 00 00 00 00 11 22 3185 00 00 00 00 AA AA 81 00 0F A0 00 01 02 03 04 3186 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 3187 14 15 16 17 0C 0B E4 6C 3188 Packet: 3189 ====== 3190 DA=00:00:00:00:11:11 3191 SA=00:00:00:00:AA:AA 3192 Vlan=101 3193 00 00 00 00 11 11 00 00 00 00 AA AA 81 00 00 3194 65 FF FF 88 E7 00 00 FA CE 00 00 00 00 11 22 3195 00 00 00 00 AA AA 81 00 0F A0 00 01 02 03 04 3196 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 3197 14 15 16 17 6B 53 25 A9 3198 " 3199 ./tomahawk3/vlan/general_vlan.c," This cint example is to demonstrate L2 VLAN management activities like 3200 add/create/delete vlan using BCM APIs. This script also demonstrates how 3201 to set up default VLAN on the device. 3202 "," a) Selects two ingress ports. 3203 "," a) Create a vlan 20 and add two ports to the vlan. 3204 b) Create a vlan 10 and make it new default vlan. 3205 "," a) Display the vlan configuration using ""vlan show"" 3206 and display default vlan using ""vlan default"". 3207 "," Default vlan should be 10. 3208 Default Vlan 10 should have all ports as it members. 3209 Vlan 20 should have ingress_port1 and ingressport2 as it members. 3210 ""vlan show"" output 3211 ================== 3212 vlan 10 ports cpu,cd,xe (0x0000000000000000000000000000f0000f4000f0000f0000f0000f4000f0001f), untagged cd,xe (0x0000000000000000000000000000f0000f4000f0000f0000f0000f4000f0001e) MCAST_FLOOD_UNKNOWN 3213 vlan 20 ports cd0-cd1 (0x0000000000000000000000000000000000000000000000000000000000000006), untagged none (0x0000000000000000000000000000000000000000000000000000000000000000) MCAST_FLOOD_UNKNOWN 3214 ""vlan default"" output 3215 ===================== 3216 Default VLAN ID is 10 3217 " 3218 ./tomahawk3/vlan/shared_vlan_learning.c," This is a an example script shows how to enable shared vlan learning(SVL) feature. 3219 "," a) Select two ports ingress_port and egress_port. 3220 "," a) Creates two vlans 100 and 200 add ingress_port and egress_port as members. 3221 b) Enable shared VLAN learning on switch. 3222 c) Set 300 as forwarding ID for both vlans 100 & 200. 3223 "," a) Send vlan 100 and 200 tagged packets. 3224 "," Verify that mac is learnt based on forwarding ID 300 using ""l2 show"". 3225 " 3226 ./tomahawk3/knet/knet_tx.c,,,,, 3227 ./tomahawk3/knet/knet_rx.c,,,,, 3228 ./tomahawk3/knet/knet.c," This CINT script demonstrate how to send and receive packets over KNET interface 3229 This exampls shows how application can create KNET interface 3230 and send/receive packets over it. 3231 Prerequistes: 3232 ============= 3233 a) Build SDK with KNET feature enabled 3234 b) Build $SDK/src/examples/xgs/tomahawk3/knet/knet_tx.c and knet_rx.c 3235 source files for customer target CPU 3236 c) Insert knet kernel module before launching SDK. 3237 "," a) Enable siwtch control ""ArpReplyToCpu"" and ""ArpRequestCpu"" 3238 b) Enable BCM RX module and register Rx Callback 3239 c) Add IFP rules to copy protocol and data packets to CPU 3240 "," a) Create Knet interface of type BCM_KNET_NETIF_T_TX_CPU_INGRESS 3241 b) Create Knet filter to divert packets to Knet interface 3242 "," a) Provided steps to user for sending and receiving packets 3243 through knet interface 3244 "," knet_tx executable will send 5 packets over knet interface 3245 knet_rx executable will receive 5 packets over knet interface and display 3246 "