summaryrefslogtreecommitdiffstats
path: root/build
AgeCommit message (Expand)AuthorFilesLines
2019-04-23Bump to intel-ipsec-mb version 0.52Damjan Marion1-10/+10
2019-04-17crypto-ipsecmb: enable GCMNeale Ranns1-1/+2
2019-04-10cmake: fix errors in external when building past point-releaseAndrew Yourtchenko1-1/+1
2019-04-09rdma-core: add debug build optionBenoît Ganne1-1/+8
2019-04-08rdma: fix DPDK MLX driver conflictBenoît Ganne2-3/+2
2019-04-05rdma: more batching, compile rdma-core in release modeBenoît Ganne1-1/+1
2019-04-05QUIC: Build cleanupDave Wallace1-6/+0
2019-04-03Fix problem building rdma-core.Thomas F Herbert2-2/+8
2019-04-03QUIC: Build system updateAloys Augustin3-1/+109
2019-04-02dpdk 19.02: fixed speed capability error issueChenmin Sun1-0/+101
2019-03-29revert quicly related build/external changesDamjan Marion4-134/+4
2019-03-29Integrate first QUIC protocol implementationNathan Skrzypczak4-4/+134
2019-03-28Add RDMA ibverb driver pluginBenoît Ganne5-51/+94
2019-03-22dpdk: add ENIC PMD patch to untag default vlanHyong Youb Kim1-0/+31
2019-03-01dpdk: update mlx[45] linking optionsMatthew Smith1-3/+2
2019-02-14make install-ext-deps broken.Paul Vinciguerra1-1/+1
2019-02-02dpdk: bump to dpdk 19.02Damjan Marion10-1233/+2
2018-12-12dpdk: net/bonding: fix buffer corruption in packetsIgor Mikhailov (imichail)1-0/+203
2018-11-29dpdk: bump to DPDK 18.11Damjan Marion1-2/+2
2018-11-05dpdk: enable gso when the tap PMD is enabledMatthew Smith1-1/+1
2018-10-26dpdk: fix mlx5 build on SUSEStephen Hemminger1-0/+39
2018-10-26dpdk: ENA PMD patch for failure on port restartMatthew Smith1-0/+359
2018-10-25Address "is already installed" Jenkins issueMarco Varlese1-1/+1
2018-10-24dpdk: disable unused rxtx callbacks in ethdevStephen Hemminger1-0/+1
2018-10-20dpdk: turn off unused DPDK componentsStephen Hemminger1-0/+17
2018-10-15dpdk: drop no longer used config optionsStephen Hemminger1-6/+0
2018-10-11Fix vpp-ext-deps package version in stable branchDamjan Marion1-1/+1
2018-10-01dpdk: updated makefile to enable QAT cryptodevRadu Nicolau1-0/+1
2018-09-27dpdk_plugin: fix mlx5 build and runtime issuesSirshak Das1-1/+2
2018-09-27fix typo in vpp-ext-deps rpm packagingDamjan Marion1-1/+1
2018-09-25dpdk: add patch to fix 25G AOC cable detectionDamjan Marion1-0/+30
2018-09-21add: nasm and ipsec-mb into vpp-ext-deps packagingDamjan Marion16-397/+547
2018-09-20rename vpp-dpdk-dev to vpp-ext-depsDamjan Marion14-0/+1233
ICMPv4/ICMPv6 packets traffic and check if it is divided into two paths.""" import sys import ipaddress from scapy.all import Ether from scapy.layers.inet import ICMP, IP from scapy.layers.inet6 import IPv6, ICMPv6EchoRequest, ICMPv6ND_NS from resources.libraries.python.PacketVerifier import RxQueue, TxQueue from resources.libraries.python.TrafficScriptArg import TrafficScriptArg def valid_ipv4(ip): try: ipaddress.IPv4Address(unicode(ip)) return True except (AttributeError, ipaddress.AddressValueError): return False def valid_ipv6(ip): try: ipaddress.IPv6Address(unicode(ip)) return True except (AttributeError, ipaddress.AddressValueError): return False def main(): """Send 100 IP ICMP packets traffic and check if it is divided into two paths.""" args = TrafficScriptArg( ['src_ip', 'dst_ip', 'tg_if1_mac', 'dut_if1_mac', 'dut_if2_mac', 'path_1_mac', 'path_2_mac']) src_ip = args.get_arg('src_ip') dst_ip = args.get_arg('dst_ip') tg_if1_mac = args.get_arg('tg_if1_mac') dut_if1_mac = args.get_arg('dut_if1_mac') dut_if2_mac = args.get_arg('dut_if2_mac') path_1_mac = args.get_arg('path_1_mac') path_2_mac = args.get_arg('path_2_mac') tx_if = args.get_arg('tx_if') rx_if = args.get_arg('rx_if') path_1_counter = 0 path_2_counter = 0 rxq = RxQueue(rx_if) txq = TxQueue(tx_if) sent_packets = [] ip_format = '' pkt_raw = '' separator = '' if valid_ipv4(src_ip): separator = '.' elif valid_ipv6(src_ip): separator = ':' else: raise ValueError("Source address not in correct format") src_ip_base = (src_ip.rsplit(separator, 1))[0] + separator for i in range(1, 101): if valid_ipv4(src_ip) and valid_ipv4(dst_ip): pkt_raw = (Ether(src=tg_if1_mac, dst=dut_if1_mac) / IP(src=src_ip_base+str(i), dst=dst_ip) / ICMP()) ip_format = 'IP' elif valid_ipv6(src_ip) and valid_ipv6(dst_ip): pkt_raw = (Ether(src=tg_if1_mac, dst=dut_if1_mac) / IPv6(src=src_ip_base+str(i), dst=dst_ip) / ICMPv6EchoRequest()) ip_format = 'IPv6' else: raise ValueError("IP not in correct format") sent_packets.append(pkt_raw) txq.send(pkt_raw) while True: ether = rxq.recv(2) if ether is None: raise RuntimeError('ICMPv6 echo reply Rx timeout') if ether.haslayer(ICMPv6ND_NS): # read another packet in the queue in case of ICMPv6ND_NS packet continue else: # otherwise process the current packet break if ether is None: raise RuntimeError("ICMP echo Rx timeout") if not ether.haslayer(ip_format): raise RuntimeError("Not an IP packet received {0}". format(ether.__repr__())) if ether[Ether].src != dut_if2_mac: raise RuntimeError("Source MAC address error") if ether[Ether].dst == path_1_mac: path_1_counter += 1 elif ether[Ether].dst == path_2_mac: path_2_counter += 1 else: raise RuntimeError("Destination MAC address error") if (path_1_counter + path_2_counter) != 100: raise RuntimeError("Packet loss: recevied only {} packets of 100 ". format(path_1_counter + path_2_counter)) if path_1_counter == 0: raise RuntimeError("Path 1 error!") if path_2_counter == 0: raise RuntimeError("Path 2 error!") print "Path_1 counter: {}".format(path_1_counter) print "Path_2 counter: {}".format(path_2_counter) sys.exit(0) if __name__ == "__main__": main()