ptf/sainexthopgroup.py [3947:4012]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            count = [0, 0, 0, 0, 0, 0, 0, 0]
            dst_ip = int(binascii.hexlify(socket.inet_aton('10.10.10.1')), 16)
            src_mac_start = '00:22:22:22:{0}:{1}'
            for i in range(0, MAX_ITRS):
                dst_ip_addr = socket.inet_ntoa(
                    binascii.unhexlify(hex(dst_ip)[2:].zfill(8)))
                src_mac = src_mac_start.format(
                    str(i).zfill(4)[:2],
                    str(i).zfill(4)[2:])
                src_mac = '00:22:22:22:22:22'
                pkt = simple_tcp_packet(eth_dst=ROUTER_MAC,
                                        eth_src=src_mac,
                                        ip_dst=dst_ip_addr,
                                        ip_src='192.168.8.1',
                                        ip_id=106,
                                        ip_ttl=64)

                exp_pkt1 = simple_tcp_packet(eth_dst='00:11:11:11:11:11',
                                             eth_src=ROUTER_MAC,
                                             ip_dst=dst_ip_addr,
                                             ip_src='192.168.8.1',
                                             ip_id=106,
                                             ip_ttl=63)
                exp_pkt2 = simple_tcp_packet(eth_dst='00:22:22:22:22:22',
                                             eth_src=ROUTER_MAC,
                                             ip_dst=dst_ip_addr,
                                             ip_src='192.168.8.1',
                                             ip_id=106,
                                             ip_ttl=63)
                exp_pkt3 = simple_tcp_packet(eth_dst='00:33:33:33:33:33',
                                             eth_src=ROUTER_MAC,
                                             ip_dst=dst_ip_addr,
                                             ip_src='192.168.8.1',
                                             ip_id=106,
                                             ip_ttl=63)
                exp_pkt4 = simple_tcp_packet(eth_dst='00:44:44:44:44:44',
                                             eth_src=ROUTER_MAC,
                                             ip_dst=dst_ip_addr,
                                             ip_src='192.168.8.1',
                                             ip_id=106,
                                             ip_ttl=63)

                send_packet(self, self.dev_port15, pkt)
                ports_to_verify = [
                    self.dev_port11,
                    self.dev_port12,
                    self.dev_port4,  # LAG1 ports
                    self.dev_port5,
                    self.dev_port6,
                    self.dev_port7,  # LAG2 ports
                    self.dev_port8,
                    self.dev_port9
                ]
                rcv_idx = verify_any_packet_any_port(
                    self, [exp_pkt1, exp_pkt2, exp_pkt3, exp_pkt4],
                    ports_to_verify)
                count[rcv_idx] += 1
                dst_ip += 1

            print("PORT lb counts:", count)
            ecmp_count = [
                count[0],
                count[1],
                (count[2] + count[3] + count[4]),
                (count[5] + count[6] + count[7])]
            print("ECMP count:", ecmp_count)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



ptf/sainexthopgroup.py [4055:4120]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            count = [0, 0, 0, 0, 0, 0, 0, 0]
            dst_ip = int(binascii.hexlify(socket.inet_aton('10.10.10.1')), 16)
            src_mac_start = '00:22:22:22:{0}:{1}'
            for i in range(0, MAX_ITRS):
                dst_ip_addr = socket.inet_ntoa(
                    binascii.unhexlify(hex(dst_ip)[2:].zfill(8)))
                src_mac = src_mac_start.format(
                    str(i).zfill(4)[:2],
                    str(i).zfill(4)[2:])
                src_mac = '00:22:22:22:22:22'
                pkt = simple_tcp_packet(eth_dst=ROUTER_MAC,
                                        eth_src=src_mac,
                                        ip_dst=dst_ip_addr,
                                        ip_src='192.168.8.1',
                                        ip_id=106,
                                        ip_ttl=64)

                exp_pkt1 = simple_tcp_packet(eth_dst='00:11:11:11:11:11',
                                             eth_src=ROUTER_MAC,
                                             ip_dst=dst_ip_addr,
                                             ip_src='192.168.8.1',
                                             ip_id=106,
                                             ip_ttl=63)
                exp_pkt2 = simple_tcp_packet(eth_dst='00:22:22:22:22:22',
                                             eth_src=ROUTER_MAC,
                                             ip_dst=dst_ip_addr,
                                             ip_src='192.168.8.1',
                                             ip_id=106,
                                             ip_ttl=63)
                exp_pkt3 = simple_tcp_packet(eth_dst='00:33:33:33:33:33',
                                             eth_src=ROUTER_MAC,
                                             ip_dst=dst_ip_addr,
                                             ip_src='192.168.8.1',
                                             ip_id=106,
                                             ip_ttl=63)
                exp_pkt4 = simple_tcp_packet(eth_dst='00:44:44:44:44:44',
                                             eth_src=ROUTER_MAC,
                                             ip_dst=dst_ip_addr,
                                             ip_src='192.168.8.1',
                                             ip_id=106,
                                             ip_ttl=63)

                send_packet(self, self.dev_port15, pkt)
                ports_to_verify = [
                    self.dev_port11,
                    self.dev_port12,
                    self.dev_port4,  # LAG1 ports
                    self.dev_port5,
                    self.dev_port6,
                    self.dev_port7,  # LAG2 ports
                    self.dev_port8,
                    self.dev_port9
                ]
                rcv_idx = verify_any_packet_any_port(
                    self, [exp_pkt1, exp_pkt2, exp_pkt3, exp_pkt4],
                    ports_to_verify)
                count[rcv_idx] += 1
                dst_ip += 1

            print("PORT lb counts:", count)
            ecmp_count = [
                count[0],
                count[1],
                (count[2] + count[3] + count[4]),
                (count[5] + count[6] + count[7])]
            print("ECMP count:", ecmp_count)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



