summaryrefslogtreecommitdiffstats
path: root/src/vat
AgeCommit message (Expand)AuthorFilesLines
2019-04-02IPSEC: tunnel scaling - don't stack the inbould SANeale Ranns1-46/+127
2019-03-29IPSEC-GRE: fixes and API update to common types.Neale Ranns1-28/+42
2019-03-28ipsec: USE_EXTENDED_SEQ_NUM -> USE_ESNDamjan Marion1-2/+1
2019-03-28vat:ignore SIGWINCH signalezkexma1-0/+1
2019-03-21ipsec: add ipv6 support for ipsec tunnel interfaceKingwel Xie1-6/+8
2019-03-15Revert "API: Cleanup APIs interface.api"Ole Trøan2-46/+35
2019-03-15API: Cleanup APIs interface.apiJakub Grajciar2-35/+46
2019-02-25IKEv2 to pluginNeale Ranns1-708/+0
2019-02-18IPSEC: move SA counters into the stats segmentNeale Ranns1-5/+2
2019-02-07IPSEC: no second lookup after tunnel encapNeale Ranns1-55/+59
2019-02-05sock api: allow to start client with no rx_threadTomasz Kulasek1-1/+1
2019-02-05IPSEC: SPD counters in the stats sgementNeale Ranns1-1/+0
2019-01-31IPSEC: API modernisationNeale Ranns1-225/+144
2019-01-30Use IP and MAC API types for neighborsNeale Ranns1-129/+71
2019-01-25deprecate tapcliDamjan Marion1-360/+0
2019-01-22virtio: Add api support in vatMohsin Kazmi1-0/+299
2019-01-20Rework of debian packagingDamjan Marion1-0/+34
2019-01-13bonding: support custom interface IDsAlexander Chernavin1-1/+6
2019-01-07tapv2: add "tap_flags" field to the TAPv2 interface APIAndrew Yourtchenko1-2/+3
2019-01-07L2 BD API to flush all IP-MAC entries in the specified BDJohn Lo1-1/+38
2018-12-22bapi/vat: fix socket transport for vatFlorin Coras1-2/+8
2018-12-18PAPI: Add MACAddress object wrapper for vl_api_mac_address_tOle Troan1-9/+1
2018-12-17stats: Deprecate old stats frameworkOle Troan1-536/+1
2018-12-17String type: Not include \0 in show_versionOle Troan1-11/+23
2018-12-14String type: Fix off by one errorOle Troan1-1/+1
2018-12-13API: Use string type instead of u8.Ole Troan1-13/+33
2018-12-11Fix vat dependenciesjuraj.linkes1-0/+2
2018-12-07VPP-1506: dump local punts and registered punt socketsPavel Kotucek1-9/+9
2018-12-04MPLS: buffer over-run with incorrectly init'd vector. fix VAT dumpNeale Ranns1-2/+2
2018-11-12IPv6: Make link-local configurable per-interface (VPP-1446)Juraj Sloboda1-54/+0
2018-11-06BD ARP entry use common API typesNeale Ranns1-15/+9
2018-11-05Genric API types format/unformat support for VAT and custom dumpNeale Ranns3-0/+13
2018-10-23c11 safe string handling supportDave Barach5-51/+51
2018-10-17fix ip6 prefix check for tap_v2Michal Cmarada1-1/+1
2018-10-04Fix handling of mpls_tunnel_add_del APIJohn Lo1-14/+41
2018-10-01vat: fix coverity warning for show_threadsMohsin Kazmi1-3/+7
2018-10-01thread: Add show threads apiMohsin Kazmi1-0/+72
2018-09-29vom: Fix the l2 port type in bridge domainMohsin Kazmi1-4/+5
2018-09-27Trivial: Cleanup some typos.Paul Vinciguerra1-3/+3
2018-09-26MPLS tunnel dump: use sw_if_index not tunnel_indexNeale Ranns1-8/+5
2018-09-26itf: dump interface rx-placementMohsin Kazmi1-0/+79
2018-09-25L2 BD: introduce a BD interface on which to send UU packetsNeale Ranns1-10/+14
2018-09-21Add more CLI options to vpp_api_test for calling ip_add_del_routeJohn Lo1-2/+14
2018-09-20Route counters in the stats segmentNeale Ranns1-4/+4
2018-09-20vhost-user: Add disable feature support in apiMohsin Kazmi1-0/+10
2018-09-14Ehnance and fix vpp_api_test and custom_dump to support SR-MPLSJohn Lo1-25/+176
2018-09-11vat: remove the endiness for u8Mohsin Kazmi1-1/+1
2018-09-10cmake: put vpp_api_test back to packagingDamjan Marion1-1/+1
2018-09-07cmake: set packaging component for different filesDamjan Marion1-3/+7
2018-08-30Fix array bound failure in api_sr_localsid_add_delLijian Zhang1-2/+2
class="p">(TestL2bd, self).tearDown() if not self.vpp_dead: self.logger.info(self.vapi.ppcli("show l2fib verbose")) self.logger.info(self.vapi.ppcli("show bridge-domain %s detail" % self.bd_id)) @classmethod def create_hosts_and_learn(cls, count): """ Create required number of host MAC addresses and distribute them among interfaces. Create host IPv4 address for every host MAC address. Create L2 MAC packet stream with host MAC addresses per interface to let the bridge domain learn these MAC addresses. :param count: Integer number of hosts to create MAC/IPv4 addresses for. """ n_int = len(cls.pg_interfaces) macs_per_if = count / n_int i = -1 for pg_if in cls.pg_interfaces: i += 1 start_nr = macs_per_if * i end_nr = count if i == (n_int - 1) else macs_per_if * (i + 1) cls.hosts_by_pg_idx[pg_if.sw_if_index] = [] hosts = cls.hosts_by_pg_idx[pg_if.sw_if_index] packets = [] for j in range(start_nr, end_nr): host = Host( "00:00:00:ff:%02x:%02x" % (pg_if.sw_if_index, j), "172.17.1%02x.%u" % (pg_if.sw_if_index, j)) packet = (Ether(dst="ff:ff:ff:ff:ff:ff", src=host.mac)) hosts.append(host) if hasattr(pg_if, 'sub_if'): packet = pg_if.sub_if.add_dot1_layer(packet) packets.append(packet) pg_if.add_stream(packets) cls.logger.info("Sending broadcast eth frames for MAC learning") cls.pg_start() def create_stream(self, src_if, packet_sizes, packets_per_burst): """ Create input packet stream for defined interface. :param object src_if: Interface to create packet stream for. :param list packet_sizes: List of required packet sizes. :param int packets_per_burst: Number of packets in burst. :return: Stream of packets. """ pkts = [] for i in range(0, packets_per_burst): dst_if = self.flows[src_if][i % 2] dst_host = random.choice(self.hosts_by_pg_idx[dst_if.sw_if_index]) src_host = random.choice(self.hosts_by_pg_idx[src_if.sw_if_index]) pkt_info = self.create_packet_info(src_if, dst_if) payload = self.info_to_payload(pkt_info) p = (Ether(dst=dst_host.mac, src=src_host.mac) / IP(src=src_host.ip4, dst=dst_host.ip4) / UDP(sport=1234, dport=1234) / Raw(payload)) pkt_info.data = p.copy() if hasattr(src_if, 'sub_if'): p = src_if.sub_if.add_dot1_layer(p) size = random.choice(packet_sizes) self.extend_packet(p, size) pkts.append(p) return pkts def verify_capture(self, pg_if, capture): """ Verify captured input packet stream for defined interface. :param object pg_if: Interface to verify captured packet stream for. :param list capture: Captured packet stream. """ last_info = dict() for i in self.pg_interfaces: last_info[i.sw_if_index] = None dst_sw_if_index = pg_if.sw_if_index for packet in capture: payload_info = self.payload_to_info(str(packet[Raw])) src_sw_if_index = payload_info.src src_if = None for ifc in self.pg_interfaces: if ifc != pg_if: if ifc.sw_if_index == src_sw_if_index: src_if = ifc break if hasattr(src_if, 'sub_if'): # Check VLAN tags and Ethernet header packet = src_if.sub_if.remove_dot1_layer(packet) self.assertTrue(Dot1Q not in packet) try: ip = packet[IP] udp = packet[UDP] packet_index = payload_info.index self.assertEqual(payload_info.dst, dst_sw_if_index) self.logger.debug("Got packet on port %s: src=%u (id=%u)" % (pg_if.name, payload_info.src, packet_index)) next_info = self.get_next_packet_info_for_interface2( payload_info.src, dst_sw_if_index, last_info[payload_info.src]) last_info[payload_info.src] = next_info self.assertTrue(next_info is not None) self.assertEqual(packet_index, next_info.index) saved_packet = next_info.data # Check standard fields self.assertEqual(ip.src, saved_packet[IP].src) self.assertEqual(ip.dst, saved_packet[IP].dst) self.assertEqual(udp.sport, saved_packet[UDP].sport) self.assertEqual(udp.dport, saved_packet[UDP].dport) except: self.logger.error(ppp("Unexpected or invalid packet:", packet)) raise for i in self.pg_interfaces: remaining_packet = self.get_next_packet_info_for_interface2( i, dst_sw_if_index, last_info[i.sw_if_index]) self.assertTrue( remaining_packet is None, "Port %u: Packet expected from source %u didn't arrive" % (dst_sw_if_index, i.sw_if_index)) def run_l2bd_test(self, pkts_per_burst): """ L2BD MAC learning test """ # Create incoming packet streams for packet-generator interfaces for i in self.pg_interfaces: packet_sizes = self.sub_if_packet_sizes if hasattr(i, 'sub_if') \ else self.pg_if_packet_sizes pkts = self.create_stream(i, packet_sizes, pkts_per_burst) i.add_stream(pkts) # Enable packet capture and start packet sending self.pg_enable_capture(self.pg_interfaces) self.pg_start() # Verify outgoing packet streams per packet-generator interface for i in self.pg_interfaces: capture = i.get_capture() self.logger.info("Verifying capture on interface %s" % i.name) self.verify_capture(i, capture) def test_l2bd_sl(self): """ L2BD MAC learning single-loop test Test scenario: 1.config MAC learning enabled learn 100 MAC enries 3 interfaces: untagged, dot1q, dot1ad (dot1q used instead of dot1ad in the first version) 2.sending l2 eth pkts between 3 interface 64B, 512B, 1518B, 9200B (ether_size) burst of 2 pkts per interface """ self.run_l2bd_test(self.sl_pkts_per_burst) def test_l2bd_dl(self): """ L2BD MAC learning dual-loop test Test scenario: 1.config MAC learning enabled learn 100 MAC enries 3 interfaces: untagged, dot1q, dot1ad (dot1q used instead of dot1ad in the first version) 2.sending l2 eth pkts between 3 interface 64B, 512B, 1518B, 9200B (ether_size) burst of 257 pkts per interface """ self.run_l2bd_test(self.dl_pkts_per_burst) if __name__ == '__main__': unittest.main(testRunner=VppTestRunner)