diff options
Diffstat (limited to 'GPL/traffic_profiles')
170 files changed, 4276 insertions, 2886 deletions
diff --git a/GPL/traffic_profiles/trex/profile_trex_astf_base_class.py b/GPL/traffic_profiles/trex/profile_trex_astf_base_class.py index 2c97201689..55aedd0543 100644 --- a/GPL/traffic_profiles/trex/profile_trex_astf_base_class.py +++ b/GPL/traffic_profiles/trex/profile_trex_astf_base_class.py @@ -135,7 +135,7 @@ class TrafficProfileBaseClass: self.framesize = kwargs[u"framesize"] self.n_data_frames = kwargs[u"n_data_frames"] self._pcap_dir = kwargs.get( - u"pcap_dir", u"/opt/trex-core-2.97/scripts/avl" + u"pcap_dir", u"/opt/trex-core-3.03/scripts/avl" ) return self.create_profile() diff --git a/GPL/traffic_profiles/trex/profile_trex_stateless_scale_class.py b/GPL/traffic_profiles/trex/profile_trex_stateless_scale_class.py new file mode 100644 index 0000000000..33cf090da2 --- /dev/null +++ b/GPL/traffic_profiles/trex/profile_trex_stateless_scale_class.py @@ -0,0 +1,196 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Base class for stream profiles for T-rex traffic generator. +""" + +import socket +import struct + +from random import choice +from string import ascii_letters + +from trex.stl.api import * + + +class TrafficStreamsScaleClass: + """Base class for stream profiles for T-rex traffic generator.""" + + STREAM_TABLE = { + "IMIX_v4": [ + {"size": 60, "pps": 28, "isg": 0}, + {"size": 590, "pps": 20, "isg": 0.1}, + {"size": 1514, "pps": 4, "isg": 0.2} + ], + "IMIX_v4_1": [ + {"size": 64, "pps": 28, "isg": 0}, + {"size": 570, "pps": 16, "isg": 0.1}, + {"size": 1518, "pps": 4, "isg": 0.2} + ] + } + + def __init__(self): + # Default value of frame size, it will be overwritten by the value of + # "framesize" parameter of "get_streams" method. + self.framesize = 64 + + # If needed, add your own parameters. + + def _gen_payload(self, length): + """Generate payload. + + If needed, implement your own algorithm. + + :param length: Length of generated payload. + :type length: int + :returns: The generated payload. + :rtype: str + """ + payload = "" + for _ in range(length): + payload += choice(ascii_letters) + + return payload + + def _get_start_end_ipv6(self, start_ip, end_ip): + """Get start host and number of hosts from IPv6 as integer. + + :param start_ip: Start IPv6. + :param end_ip: End IPv6. + :type start_ip: string + :type end_ip: string + :return: Start host, number of hosts. + :rtype tuple of int + :raises: ValueError if start_ip is greater then end_ip. + :raises: socket.error if the IP addresses are not valid IPv6 addresses. + """ + try: + ip1 = socket.inet_pton(socket.AF_INET6, start_ip) + ip2 = socket.inet_pton(socket.AF_INET6, end_ip) + + hi1, lo1 = struct.unpack("!QQ", ip1) + hi2, lo2 = struct.unpack("!QQ", ip2) + + if ((hi1 << 64) | lo1) > ((hi2 << 64) | lo2): + raise ValueError("IPv6: start_ip is greater then end_ip") + + return lo1, abs(int(lo1) - int(lo2)) + + except socket.error as err: + print(err) + raise + + def define_packets(self): + """Define the packets to be sent from the traffic generator. + + This method MUST return: + + return base_pkt_a, base_pkt_b, vm1, vm2 + + vm1 and vm2 CAN be None. + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + raise NotImplementedError + + def create_streams(self): + """Create traffic streams. + + Implement your own traffic streams. + + :returns: Traffic streams. + :rtype: list + """ + pkts, vms = self.define_packets() + + # Frame size is defined as an integer, e.g. 64, 1518: + if isinstance(self.framesize, int): + pkt_streams = list() + lat_streams = list() + for i in range(len(pkts)): + payload_len = max(0, self.framesize - len(pkts[i]) - 4) + + pkt = STLPktBuilder( + pkt=pkts[i] / self._gen_payload(payload_len), + vm=vms[i] + ) + pkt_lat = STLPktBuilder( + pkt=pkts[i] / self._gen_payload(payload_len), + vm=vms[i] + ) + pkt_streams.append( + STLStream( + packet=pkt, + isg=10.0 * (i // (len(pkts) // 2)), + mode=STLTXCont(pps=9000) + ) + ) + lat_streams.append( + STLStream( + packet=pkt_lat, + isg=10.0 * (i // (len(pkts) // 2)), + flow_stats=STLFlowLatencyStats(pg_id=i), + mode=STLTXCont(pps=9000) + ) + ) + + streams = list() + streams.extend(pkt_streams) + streams.extend(lat_streams) + return streams + + # Frame size is defined as a string, e.g.IMIX_v4_1: + elif isinstance(self.framesize, str): + pkt_streams = list() + for i in range(len(pkts)): + for stream in self.STREAM_TABLE[self.framesize]: + payload_len = max(0, stream["size"] - len(pkts[i]) - 4) + + pkt = STLPktBuilder( + pkt=pkts[i] / self._gen_payload(payload_len), + vm=vms[i] + ) + pkt_streams.append( + STLStream( + packet=pkt, + isg=stream["isg"], + mode=STLTXCont(pps=stream["pps"]) + ) + ) + return pkt_streams + + def get_streams(self, **kwargs): + """Get traffic streams created by "create_streams" method. + + If needed, add your own parameters. + + :param kwargs: Key-value pairs used by "create_streams" method while + creating streams. + :returns: Traffic streams. + :rtype: list + """ + self.framesize = kwargs["framesize"] + self.rate = kwargs["rate"] + + return self.create_streams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4src253.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4src253.py deleted file mode 100644 index e1741f98e9..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4src253.py +++ /dev/null @@ -1,136 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.10.10.2 - 10.10.10.254 - - Destination IP address range: 20.20.20.2 - - Direction 1 --> 0: - - Source IP address range: 20.20.20.2 - 20.20.20.254 - - Destination IP address range: 10.10.10.2 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.2" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.2" - - self.p2_src_start_ip = u"20.20.20.2" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.2" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc10kip4src10k.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc10kip4src10k.py deleted file mode 100644 index 2882027f4c..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc10kip4src10k.py +++ /dev/null @@ -1,171 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: | ETH | IP | - - Direction 0 --> 1: - - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:27:0f - - Source IP address range: 10.0.0.2 - 10.0.39.17 - - Destination IP address range: 20.0.0.1 - - Direction 1 --> 0: - - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:27:0f - - Source IP address range: 20.0.0.2 - 20.0.39.17 - - Destination IP address range: 10.0.0.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.clients = 10000 - - # MACs used in packet headers. - self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.2" - self.p1_src_end_ip = u"10.0.39.17" - self.p1_dst_start_ip = u"20.0.0.1" - - self.p2_src_start_ip = u"20.0.0.2" - self.p2_src_end_ip = u"20.0.39.17" - self.p2_dst_start_ip = u"10.0.0.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - src=self.p1_src_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - src=self.p2_src_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset=8 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset=8 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :returns: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc5kdst5k.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc5kdst5k.py deleted file mode 100644 index a9039fa49f..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc5kdst5k.py +++ /dev/null @@ -1,225 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:13:87 - - Destination MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:13:87 - - Source IP address range: 10.0.0.0 - 10.0.19.135 - - Destination IP address range: 20.0.0.0 - 20.0.19.135 - - Direction 1 --> 0: - - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:13:87 - - Destination MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:13:87 - - Source IP address range: 20.0.0.0 - 20.0.19.135 - - Destination IP address range: 10.0.0.0 - 10.0.19.135 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.clients = 5000 - - # MACs used in packet headers. - self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.0" - self.p1_src_end_ip = u"10.0.19.135" - - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.19.135" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.0.19.135" - - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.19.135" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - src=self.p1_src_start_mac, - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - src=self.p2_src_start_mac, - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset=8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset=8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst100000.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst100000.py deleted file mode 100644 index e1ef224a6b..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst100000.py +++ /dev/null @@ -1,136 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.1.134.159 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.1.134.159 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.1.134.159" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.1.134.159" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000000.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000000.py deleted file mode 100644 index 139cccd561..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000000.py +++ /dev/null @@ -1,136 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.15.66.63 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.15.66.63 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.15.66.63" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.15.66.63" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4src254.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4src254.py deleted file mode 100644 index 8afc3b6fd5..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4src254.py +++ /dev/null @@ -1,136 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc500kdst500k.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc500kdst500k.py deleted file mode 100644 index 1cbbffdb2a..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc500kdst500k.py +++ /dev/null @@ -1,225 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:07:a1:1f - - Destination MAC address range: fa:ce:00:00:00:00 - fa:ce:00:07:a1:1f - - Source IP address range: 10.0.0.0 - 10.7.161.31 - - Destination IP address range: 20.0.0.0 - 20.7.161.31 - - Direction 1 --> 0: - - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:07:a1:1f - - Destination MAC address range: ca:fe:00:00:00:00 - ca:fe:00:07:a1:1f - - Source IP address range: 20.0.0.0 - 20.7.161.31 - - Destination IP address range: 10.0.0.0 - 10.7.161.31 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.clients = 500000 - - # MACs used in packet headers. - self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.0" - self.p1_src_end_ip = u"10.7.161.31" - - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.7.161.31" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.7.161.31" - - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.7.161.31" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - src=self.p1_src_start_mac, - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - src=self.p2_src_start_mac, - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset=8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset=8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc50kdst50k.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc50kdst50k.py deleted file mode 100644 index e56576ae11..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc50kdst50k.py +++ /dev/null @@ -1,225 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:c3:4f - - Destination MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:c3:4f - - Source IP address range: 10.0.0.0 - 10.0.195.79 - - Destination IP address range: 20.0.0.0 - 20.0.195.79 - - Direction 1 --> 0: - - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:c3:4f - - Destination MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:c3:4f - - Source IP address range: 20.0.0.0 - 20.0.195.79 - - Destination IP address range: 10.0.0.0 - 10.0.195.79 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.clients = 50000 - - # MACs used in packet headers. - self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.0" - self.p1_src_end_ip = u"10.0.195.79" - - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.195.79" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.0.195.79" - - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.195.79" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - src=self.p1_src_start_mac, - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - src=self.p2_src_start_mac, - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset= 8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset= 2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset= 8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset= 2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1000u15p.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1000u15p.py deleted file mode 100644 index 32ed9c08f7..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1000u15p.py +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 20.0.0.0 - 20.0.3.231 - - Destination IP address range: 12.0.0.2 - - Source UDP port range: 1024 - 1038 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 12.0.0.2 - - Destination IP address range: 200.0.0.0 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 16023 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"20.0.0.0" - self.p1_src_end_ip = u"20.0.3.231" - self.p1_dst_start_ip = u"12.0.0.2" - - self.p2_src_start_ip = u"12.0.0.2" - self.p2_src_end_ip = u"12.0.0.2" - self.p2_dst_start_ip = u"200.0.0.0" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1038 - self.p1_dst_start_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 16023 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p1_src_start_ip, - ip_max=self.p1_src_end_ip, - port_min=self.p1_src_start_udp_port, - port_max=self.p1_src_end_udp_port, - name=u"tuple" - ), - STLVmWrFlowVar( - fv_name=u"tuple.ip", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple.port", - pkt_offset=u"UDP.sport" - ) - ] - ) - # Direction 0 --> 1 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dport", - pkt_offset=u"UDP.dport" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u1000p-conc.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u1000p-conc.py deleted file mode 100644 index 25dddb7de2..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u1000p-conc.py +++ /dev/null @@ -1,199 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 10.10.10.2 - 10.10.10.11 - - Destination IP address range: 20.20.20.2 - 20.20.20.11 - - Source UDP port range: 1001 - 2000 - - Destination UDP port range: 2001 - 3000 - - Direction 1 --> 0: - - Source IP address range: 20.20.20.2 - 20.20.20.11 - - Destination IP address range: 10.10.10.2 - 10.10.10.11 - - Source UDP port range: 2001 - 3000 - - Destination UDP port range: 1001 - 2000 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.2" - self.p1_src_end_ip = u"10.10.10.11" - self.p1_dst_start_ip = u"20.20.20.2" - self.p1_dst_end_ip = u"20.20.20.11" - - self.p2_src_start_ip = u"20.20.20.2" - self.p2_src_end_ip = u"20.20.20.11" - self.p2_dst_start_ip = u"10.10.10.2" - self.p2_dst_end_ip = u"10.10.10.11" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1001 - self.p1_src_end_udp_port = 2000 - self.p1_dst_start_udp_port = 2001 - self.p1_dst_end_udp_port = 3000 - - self.p2_src_start_udp_port = 2001 - self.p2_src_end_udp_port = 3000 - self.p2_dst_start_udp_port = 1001 - self.p2_dst_end_udp_port = 2000 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p1_src_start_ip, - ip_max=self.p1_src_end_ip, - port_min=self.p1_src_start_udp_port, - port_max=self.p1_src_end_udp_port, - name=u"tuple1_src" - ), - STLVmTupleGen( - ip_min=self.p1_dst_start_ip, - ip_max=self.p1_dst_end_ip, - port_min=self.p1_dst_start_udp_port, - port_max=self.p1_dst_end_udp_port, - name=u"tuple1_dst" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_src.ip", - pkt_offset=u"IP.src" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_dst.ip", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_src.port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_dst.port", - pkt_offset=u"UDP.dport" - ) - ] - ) - # Direction 0 --> 1 - vm2 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p2_src_start_ip, - ip_max=self.p2_src_end_ip, - port_min=self.p2_src_start_udp_port, - port_max=self.p2_src_end_udp_port, - name=u"tuple2_src" - ), - STLVmTupleGen( - ip_min=self.p2_dst_start_ip, - ip_max=self.p2_dst_end_ip, - port_min=self.p2_dst_start_udp_port, - port_max=self.p2_dst_end_udp_port, - name=u"tuple2_dst" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_src.ip", - pkt_offset=u"IP.src" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_dst.ip", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_src.port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_dst.port", - pkt_offset=u"UDP.dport" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6src253.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6src253.py deleted file mode 100644 index 124f57e2be..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6src253.py +++ /dev/null @@ -1,139 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IPv6 / - - Direction 0 --> 1: - - Source IP address range: 2001:1::2 - 2001:1::FE - - Destination IP address range: 2001:2::2 - - Direction 1 --> 0: - - Source IP address range: 2001:2::2 - 2001:2::FE - - Destination IP address range: 2001:1::2 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::2" - self.p1_src_end_ip = u"2001:1::FE" - self.p1_dst_start_ip = u"2001:2::2" - - self.p2_src_start_ip = u"2001:2::2" - self.p2_src_end_ip = u"2001:2::FE" - self.p2_dst_start_ip = u"2001:1::2" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_src_start_ip, - self.p1_src_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_src_start_ip, - self.p2_src_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_src", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_src", - pkt_offset=u"IPv6.src", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_src", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_src", - pkt_offset=u"IPv6.src", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan100ip4src254ip4dst254.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan100ip4src254ip4dst254.py index ae8d9ea112..45f2f6c9e9 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan100ip4src254ip4dst254.py +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan100ip4src254ip4dst254.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan10ip4src254ip4dst254.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan10ip4src254ip4dst254.py index 9ed8f69817..5b8afc3336 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan10ip4src254ip4dst254.py +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan10ip4src254ip4dst254.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan1ip4src254ip4dst254.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254-2.py index 4e28f32c4c..f5a8050ae2 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan1ip4src254ip4dst254.py +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254-2.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py index fcd4067be6..54e4c6470e 100644 --- a/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254.py index a4ffecf3d4..3561850068 100644 --- a/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254.py +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan1kip4src254ip4dst254.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1kip4src254ip4dst254.py index 3ba51899a4..58aab36e26 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan1kip4src254ip4dst254.py +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1kip4src254ip4dst254.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-dot1qip4asym-ip4src254.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4asym-ip4src254.py index 91df41eba7..f95ebc371b 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-dot1qip4asym-ip4src254.py +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4asym-ip4src254.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src10udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src10udpsrcrnd.py index 03328fcfaa..ed2181ef3e 100644 --- a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src10udpsrcrnd.py +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src10udpsrcrnd.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src1udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src1udpsrcrnd.py index e4e6f75e34..077b866b2b 100644 --- a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src1udpsrcrnd.py +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src1udpsrcrnd.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src2udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src2udpsrcrnd.py index 121c0a82c0..2aff7fa867 100644 --- a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src2udpsrcrnd.py +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src2udpsrcrnd.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src4udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src4udpsrcrnd.py index 10739c335a..763c56bd0a 100644 --- a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src4udpsrcrnd.py +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src4udpsrcrnd.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src6udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src6udpsrcrnd.py index 9723941150..54af270c63 100644 --- a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src6udpsrcrnd.py +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src6udpsrcrnd.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src8udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src8udpsrcrnd.py index 0e2ac5ecaf..0874a5efd6 100644 --- a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src8udpsrcrnd.py +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src8udpsrcrnd.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-dot1qip6asym-ip6src253.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip6asym-ip6src253.py index a126e7a678..d8c0aa3fdd 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-dot1qip6asym-ip6src253.py +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip6asym-ip6src253.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-geneve-1024t.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-geneve-1024t.py index 42c015272d..4613283605 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-geneve-1024t.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-geneve-1024t.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-geneve-16t.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-geneve-16t.py index 151ae505c8..48c4e75401 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-geneve-16t.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-geneve-16t.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-geneve-1t.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-geneve-1t.py index a62577e292..23a32f5177 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-geneve-1t.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-geneve-1t.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-geneve-256t.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-geneve-256t.py index 8098f919d5..4d53ea5140 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-geneve-256t.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-geneve-256t.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-geneve-4t.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-geneve-4t.py index 975d204d7d..06616e18ec 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-geneve-4t.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-geneve-4t.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-geneve-64t.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-geneve-64t.py index fd1fa88a52..704ceb84b5 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-geneve-64t.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-geneve-64t.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd10000-2p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd10000-2p.py new file mode 100644 index 0000000000..1149a0403b --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd10000-2p.py @@ -0,0 +1,113 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IP / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "10.0.0.1", + "dst_start_ip": "20.0.0.0", + "dst_end_ip": "20.0.39.15", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "20.0.0.1", + "dst_start_ip": "10.0.0.0", + "dst_end_ip": "10.0.39.15", + "seed": 2 + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Base packets to be sent and transformation function. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + self.pkt_base.append( + Ether() / + IP( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"], + proto=61 + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name="dst", + min_value=self.pkt_data[i]["dst_start_ip"], + max_value=self.pkt_data[i]["dst_end_ip"], + size=4, + seed=self.pkt_data[i]["seed"], + limit=(2**24 - 1) + ), + STLVmWrFlowVar( + fv_name="dst", + pkt_offset="IP.dst" + ), + STLVmFixIpv4( + offset="IP" + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-Rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd10000-6p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd10000-6p.py new file mode 100644 index 0000000000..34ca59fe84 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd10000-6p.py @@ -0,0 +1,141 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IP / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "10.0.0.1", + "dst_start_ip": "20.0.0.0", + "dst_end_ip": "20.0.39.15", + "seed": 1 + }, + # Direction W --> E: + { + "src_start_ip": "30.0.0.1", + "dst_start_ip": "40.0.0.0", + "dst_end_ip": "40.0.39.15", + "seed": 2 + }, + # Direction W --> E: + { + "src_start_ip": "50.0.0.1", + "dst_start_ip": "60.0.0.0", + "dst_end_ip": "60.0.39.15", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "20.0.0.1", + "dst_start_ip": "10.0.0.0", + "dst_end_ip": "10.0.39.15", + "seed": 2 + }, + # Direction E --> W: + { + "src_start_ip": "40.0.0.1", + "dst_start_ip": "30.0.0.0", + "dst_end_ip": "30.0.39.15", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "60.0.0.1", + "dst_start_ip": "50.0.0.0", + "dst_end_ip": "50.0.39.15", + "seed": 2 + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Base packets to be sent and transformation function. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + self.pkt_base.append( + Ether() / + IP( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"], + proto=61 + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name="dst", + min_value=self.pkt_data[i]["dst_start_ip"], + max_value=self.pkt_data[i]["dst_end_ip"], + size=4, + seed=self.pkt_data[i]["seed"], + limit=(2**24 - 1) + ), + STLVmWrFlowVar( + fv_name="dst", + pkt_offset="IP.dst" + ), + STLVmFixIpv4( + offset="IP" + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-Rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd10000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd10000.py index ef2dcde696..b9a8eb22f8 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd10000.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd10000.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd100000-2p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd100000-2p.py new file mode 100644 index 0000000000..955e394c56 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd100000-2p.py @@ -0,0 +1,113 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IP / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "10.0.0.1", + "dst_start_ip": "20.0.0.0", + "dst_end_ip": "20.1.134.159", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "20.0.0.1", + "dst_start_ip": "10.0.0.0", + "dst_end_ip": "10.1.134.159", + "seed": 2 + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Base packets to be sent and transformation function. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + self.pkt_base.append( + Ether() / + IP( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"], + proto=61 + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name="dst", + min_value=self.pkt_data[i]["dst_start_ip"], + max_value=self.pkt_data[i]["dst_end_ip"], + size=4, + seed=self.pkt_data[i]["seed"], + limit=(2**24 - 1) + ), + STLVmWrFlowVar( + fv_name="dst", + pkt_offset="IP.dst" + ), + STLVmFixIpv4( + offset="IP" + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-Rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd100000-6p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd100000-6p.py new file mode 100644 index 0000000000..23de4e48a3 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd100000-6p.py @@ -0,0 +1,141 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IP / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "10.0.0.1", + "dst_start_ip": "20.0.0.0", + "dst_end_ip": "20.1.134.159", + "seed": 1 + }, + # Direction W --> E: + { + "src_start_ip": "30.0.0.1", + "dst_start_ip": "40.0.0.0", + "dst_end_ip": "40.1.134.159", + "seed": 2 + }, + # Direction W --> E: + { + "src_start_ip": "50.0.0.1", + "dst_start_ip": "60.0.0.0", + "dst_end_ip": "60.1.134.159", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "20.0.0.1", + "dst_start_ip": "10.0.0.0", + "dst_end_ip": "10.1.134.159", + "seed": 2 + }, + # Direction E --> W: + { + "src_start_ip": "40.0.0.1", + "dst_start_ip": "30.0.0.0", + "dst_end_ip": "30.1.134.159", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "60.0.0.1", + "dst_start_ip": "50.0.0.0", + "dst_end_ip": "50.1.134.159", + "seed": 2 + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Base packets to be sent and transformation function. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + self.pkt_base.append( + Ether() / + IP( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"], + proto=61 + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name="dst", + min_value=self.pkt_data[i]["dst_start_ip"], + max_value=self.pkt_data[i]["dst_end_ip"], + size=4, + seed=self.pkt_data[i]["seed"], + limit=(2**24 - 1) + ), + STLVmWrFlowVar( + fv_name="dst", + pkt_offset="IP.dst" + ), + STLVmFixIpv4( + offset="IP" + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-Rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd100000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd100000.py index ff9077192f..927f4cd07c 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd100000.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd100000.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd1000000-2p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd1000000-2p.py new file mode 100644 index 0000000000..3a03303e60 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd1000000-2p.py @@ -0,0 +1,113 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IP / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "10.0.0.1", + "dst_start_ip": "20.0.0.0", + "dst_end_ip": "20.15.66.63", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "20.0.0.1", + "dst_start_ip": "10.0.0.0", + "dst_end_ip": "10.15.66.63", + "seed": 2 + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Base packets to be sent and transformation function. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + self.pkt_base.append( + Ether() / + IP( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"], + proto=61 + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name="dst", + min_value=self.pkt_data[i]["dst_start_ip"], + max_value=self.pkt_data[i]["dst_end_ip"], + size=4, + seed=self.pkt_data[i]["seed"], + limit=(2**24 - 1) + ), + STLVmWrFlowVar( + fv_name="dst", + pkt_offset="IP.dst" + ), + STLVmFixIpv4( + offset="IP" + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-Rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd1000000-6p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd1000000-6p.py new file mode 100644 index 0000000000..141a5f2123 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd1000000-6p.py @@ -0,0 +1,141 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IP / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "10.0.0.1", + "dst_start_ip": "20.0.0.0", + "dst_end_ip": "20.15.66.63", + "seed": 1 + }, + # Direction W --> E: + { + "src_start_ip": "30.0.0.1", + "dst_start_ip": "40.0.0.0", + "dst_end_ip": "40.15.66.63", + "seed": 2 + }, + # Direction W --> E: + { + "src_start_ip": "50.0.0.1", + "dst_start_ip": "60.0.0.0", + "dst_end_ip": "60.15.66.63", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "20.0.0.1", + "dst_start_ip": "10.0.0.0", + "dst_end_ip": "10.15.66.63", + "seed": 2 + }, + # Direction E --> W: + { + "src_start_ip": "40.0.0.1", + "dst_start_ip": "30.0.0.0", + "dst_end_ip": "30.15.66.63", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "60.0.0.1", + "dst_start_ip": "50.0.0.0", + "dst_end_ip": "50.15.66.63", + "seed": 2 + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Base packets to be sent and transformation function. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + self.pkt_base.append( + Ether() / + IP( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"], + proto=61 + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name="dst", + min_value=self.pkt_data[i]["dst_start_ip"], + max_value=self.pkt_data[i]["dst_end_ip"], + size=4, + seed=self.pkt_data[i]["seed"], + limit=(2**24 - 1) + ), + STLVmWrFlowVar( + fv_name="dst", + pkt_offset="IP.dst" + ), + STLVmFixIpv4( + offset="IP" + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-Rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd1000000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd1000000.py index 4a315c72ed..a60ec87d8d 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd1000000.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd1000000.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst1-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1-udir.py index 48b15333b7..1a52b30510 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst1-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1.py index 371323ea4e..d73c8519ea 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst100.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst100.py index 3b0594e293..fb45774007 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst100.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst100.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000-1cnf.py index 615ca88bb4..d11f5d5d9b 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-1cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000-1cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000-2cnf.py index 5f9a9d6b68..28756f3a16 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-2cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000-2cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000-4cnf.py index 04cfa5f2fb..6249612fc4 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-4cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000-4cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000-8cnf.py index 2b43760b05..2e7d4d6f44 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-8cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000-8cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst1000-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000-udir.py index 7cd74e9b12..fbba5d4c3b 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst1000-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000.py index ffc53930dd..554eb0bca4 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-1cnf.py index a997d8f5bc..97ea55a72b 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-1cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-1cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-2cnf.py index db49cb73bc..8fc52f134e 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-2cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-2cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-2p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-2p.py new file mode 100644 index 0000000000..2dda26ddaf --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-2p.py @@ -0,0 +1,110 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IP / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "10.0.0.1", + "dst_start_ip": "20.0.0.0", + "dst_end_ip": "20.0.39.15" + }, + # Direction E --> W: + { + "src_start_ip": "20.0.0.1", + "dst_start_ip": "10.0.0.0", + "dst_end_ip": "10.0.39.15" + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Base packets to be sent and transformation function. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + self.pkt_base.append( + Ether() / + IP( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"], + proto=61 + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVar( + name="dst", + min_value=self.pkt_data[i]["dst_start_ip"], + max_value=self.pkt_data[i]["dst_end_ip"], + size=4, + op="inc" + ), + STLVmWrFlowVar( + fv_name="dst", + pkt_offset="IP.dst" + ), + STLVmFixIpv4( + offset="IP" + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-Rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-4cnf.py index 749258b8c5..c2a537a638 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-4cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-4cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-6p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-6p.py new file mode 100644 index 0000000000..94a47a8bb6 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-6p.py @@ -0,0 +1,134 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IP / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "10.0.0.1", + "dst_start_ip": "20.0.0.0", + "dst_end_ip": "20.0.39.15" + }, + # Direction W --> E: + { + "src_start_ip": "30.0.0.1", + "dst_start_ip": "40.0.0.0", + "dst_end_ip": "40.0.39.15" + }, + # Direction W --> E: + { + "src_start_ip": "50.0.0.1", + "dst_start_ip": "60.0.0.0", + "dst_end_ip": "60.0.39.15" + }, + # Direction E --> W: + { + "src_start_ip": "20.0.0.1", + "dst_start_ip": "10.0.0.0", + "dst_end_ip": "10.0.39.15" + }, + # Direction E --> W: + { + "src_start_ip": "40.0.0.1", + "dst_start_ip": "30.0.0.0", + "dst_end_ip": "30.0.39.15" + }, + # Direction E --> W: + { + "src_start_ip": "60.0.0.1", + "dst_start_ip": "50.0.0.0", + "dst_end_ip": "50.0.39.15" + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Base packets to be sent and transformation function. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + self.pkt_base.append( + Ether() / + IP( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"], + proto=61 + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVar( + name="dst", + min_value=self.pkt_data[i]["dst_start_ip"], + max_value=self.pkt_data[i]["dst_end_ip"], + size=4, + op="inc" + ), + STLVmWrFlowVar( + fv_name="dst", + pkt_offset="IP.dst" + ), + STLVmFixIpv4( + offset="IP" + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-Rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-8cnf.py index a5ae2e2b55..9b3d280f4a 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-8cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-8cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst10000-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-udir.py index 6fc948fab0..f643f3e3cc 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst10000-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst10000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000.py index fc6ac6ef57..29ebf97b80 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst10000.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst10000.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst100000-2p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst100000-2p.py new file mode 100644 index 0000000000..a8d223b854 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst100000-2p.py @@ -0,0 +1,110 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IP / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "10.0.0.1", + "dst_start_ip": "20.0.0.0", + "dst_end_ip": "20.1.134.159" + }, + # Direction E --> W: + { + "src_start_ip": "20.0.0.1", + "dst_start_ip": "10.0.0.0", + "dst_end_ip": "10.1.134.159" + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Base packets to be sent and transformation function. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + self.pkt_base.append( + Ether() / + IP( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"], + proto=61 + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVar( + name="dst", + min_value=self.pkt_data[i]["dst_start_ip"], + max_value=self.pkt_data[i]["dst_end_ip"], + size=4, + op="inc" + ), + STLVmWrFlowVar( + fv_name="dst", + pkt_offset="IP.dst" + ), + STLVmFixIpv4( + offset="IP" + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-Rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst100000-6p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst100000-6p.py new file mode 100644 index 0000000000..76042447ca --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst100000-6p.py @@ -0,0 +1,134 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IP / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "10.0.0.1", + "dst_start_ip": "20.0.0.0", + "dst_end_ip": "20.1.134.159" + }, + # Direction W --> E: + { + "src_start_ip": "30.0.0.1", + "dst_start_ip": "40.0.0.0", + "dst_end_ip": "40.1.134.159" + }, + # Direction W --> E: + { + "src_start_ip": "50.0.0.1", + "dst_start_ip": "60.0.0.0", + "dst_end_ip": "60.1.134.159" + }, + # Direction E --> W: + { + "src_start_ip": "20.0.0.1", + "dst_start_ip": "10.0.0.0", + "dst_end_ip": "10.1.134.159" + }, + # Direction E --> W: + { + "src_start_ip": "40.0.0.1", + "dst_start_ip": "30.0.0.0", + "dst_end_ip": "30.1.134.159" + }, + # Direction E --> W: + { + "src_start_ip": "60.0.0.1", + "dst_start_ip": "50.0.0.0", + "dst_end_ip": "50.1.134.159" + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Base packets to be sent and transformation function. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + self.pkt_base.append( + Ether() / + IP( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"], + proto=61 + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVar( + name="dst", + min_value=self.pkt_data[i]["dst_start_ip"], + max_value=self.pkt_data[i]["dst_end_ip"], + size=4, + op="inc" + ), + STLVmWrFlowVar( + fv_name="dst", + pkt_offset="IP.dst" + ), + STLVmFixIpv4( + offset="IP" + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-Rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst100000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst100000.py index a16e26c335..312deccbc8 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst100000.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst100000.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000000-2p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000000-2p.py new file mode 100644 index 0000000000..f2e7938ff2 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000000-2p.py @@ -0,0 +1,110 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IP / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "10.0.0.1", + "dst_start_ip": "20.0.0.0", + "dst_end_ip": "20.15.66.63" + }, + # Direction E --> W: + { + "src_start_ip": "20.0.0.1", + "dst_start_ip": "10.0.0.0", + "dst_end_ip": "10.15.66.63" + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Base packets to be sent and transformation function. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + self.pkt_base.append( + Ether() / + IP( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"], + proto=61 + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVar( + name="dst", + min_value=self.pkt_data[i]["dst_start_ip"], + max_value=self.pkt_data[i]["dst_end_ip"], + size=4, + op="inc" + ), + STLVmWrFlowVar( + fv_name="dst", + pkt_offset="IP.dst" + ), + STLVmFixIpv4( + offset="IP" + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-Rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000000-6p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000000-6p.py new file mode 100644 index 0000000000..6474b43470 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000000-6p.py @@ -0,0 +1,134 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IP / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "10.0.0.1", + "dst_start_ip": "20.0.0.0", + "dst_end_ip": "20.15.66.63" + }, + # Direction W --> E: + { + "src_start_ip": "30.0.0.1", + "dst_start_ip": "40.0.0.0", + "dst_end_ip": "40.15.66.63" + }, + # Direction W --> E: + { + "src_start_ip": "50.0.0.1", + "dst_start_ip": "60.0.0.0", + "dst_end_ip": "60.15.66.63" + }, + # Direction E --> W: + { + "src_start_ip": "20.0.0.1", + "dst_start_ip": "10.0.0.0", + "dst_end_ip": "10.15.66.63" + }, + # Direction E --> W: + { + "src_start_ip": "40.0.0.1", + "dst_start_ip": "30.0.0.0", + "dst_end_ip": "30.15.66.63" + }, + # Direction E --> W: + { + "src_start_ip": "60.0.0.1", + "dst_start_ip": "50.0.0.0", + "dst_end_ip": "50.15.66.63" + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Base packets to be sent and transformation function. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + self.pkt_base.append( + Ether() / + IP( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"], + proto=61 + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVar( + name="dst", + min_value=self.pkt_data[i]["dst_start_ip"], + max_value=self.pkt_data[i]["dst_end_ip"], + size=4, + op="inc" + ), + STLVmWrFlowVar( + fv_name="dst", + pkt_offset="IP.dst" + ), + STLVmFixIpv4( + offset="IP" + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-Rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst1000000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000000.py index 37bc69d366..909da92426 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst1000000.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst1000000.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst2-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst2-udir.py index 1d126056ed..f86306295b 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst2-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst2-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst2.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst2.py index 90290b4890..864ad19f4e 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst2.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst2.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst20000-1cnf.py index 10e6a50d95..f8caca1181 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-1cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst20000-1cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst20000-2cnf.py index 65f9d18ee0..dc7c0ebc9e 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-2cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst20000-2cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst20000-4cnf.py index ff02a2b811..84a920463a 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-4cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst20000-4cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst20000-8cnf.py index ce85e17c5e..f4e9820091 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-8cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst20000-8cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst20000-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst20000-udir.py index 0840be65c0..a076477d5f 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst20000-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst20000-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst20000.py index 713a826366..7bedccf9a5 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst20000.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst253.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst253.py index 1a129cc82b..b32433f817 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst253.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst253.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst253_l3fwd.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst253_l3fwd.py index 736e739da4..54ff7aba29 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst253_l3fwd.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst253_l3fwd.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst4-1cnf.py index 66e0980e58..e03627113c 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-1cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst4-1cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst4-2cnf.py index b34518f4b9..1f8a8398ae 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-2cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst4-2cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst4-4cnf.py index 3e941b98bd..ced715c16b 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-4cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst4-4cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst4-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst4-udir.py index 89e09cb26e..5f293a32ec 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst4-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst4-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst4.py index 2a763b8fa7..ecec1bf353 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst4.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40-1cnf.py index 0acbfb701d..7c3f6698af 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-1cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40-1cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40-2cnf.py index e58d437753..8b76f33152 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-2cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40-2cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40-4cnf.py index 6fce1ed791..21768e9ef0 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-4cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40-4cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40-8cnf.py index 7a65d7ccad..47f087e11b 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-8cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40-8cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst40-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40-udir.py index 5a81fc0eba..b76c9e1698 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst40-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40.py index 7ba4012694..d30d357bc9 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst400-1cnf.py index 8b0df91ba5..6ac54334f8 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-1cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst400-1cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst400-2cnf.py index a40792ad0c..882675afae 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-2cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst400-2cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst400-4cnf.py index 0553e6faeb..35ea970656 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-4cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst400-4cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst400-8cnf.py index 9ee65eb354..1ece5c3e2a 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-8cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst400-8cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst400-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst400-udir.py index 6320e2fa43..68543c8f7e 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst400-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst400-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst400.py index 72ed46e7f5..9bd7737be6 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst400.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40000-1cnf.py index 7da9933da0..5e0fe7d9b0 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-1cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40000-1cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40000-2cnf.py index 518e4b0d2d..784539c830 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-2cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40000-2cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40000-4cnf.py index d9dade68d0..f478e7001d 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-4cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40000-4cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40000-8cnf.py index 7dc9410fd7..e31ad2bc74 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-8cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40000-8cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst40000-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40000-udir.py index 2983546d56..4e6f271ed4 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst40000-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40000-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40000.py index ac9fc74bb2..5a51902642 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst40000.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst5000-1cnf.py index 367624ea07..a895626c82 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-1cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst5000-1cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst5000-2cnf.py index c528be7a31..e73426590e 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-2cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst5000-2cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst5000-4cnf.py index 9df1f4da36..4461963314 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-4cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst5000-4cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst5000-8cnf.py index 4d062b4573..d7d2e2d1ec 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-8cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst5000-8cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst5000-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst5000-udir.py index ef9df96579..1d0d52a0a7 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst5000-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst5000-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst5000.py index 5677878102..1fe61837d4 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst5000.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst500000.py index e8041098f7..051d566b20 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst500000.py @@ -1,4 +1,5 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Intel and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # @@ -28,10 +29,10 @@ Stream profile: - Packet: ETH / IP / - Direction 0 --> 1: - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.39.15 + - Destination IP address range: 20.0.0.0 - 20.7.161.31 - Direction 1 --> 0: - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.39.15 + - Destination IP address range: 10.0.0.0 - 10.7.161.31 """ from trex.stl.api import * @@ -49,11 +50,11 @@ class TrafficStreams(TrafficStreamsBaseClass): # IPs used in packet headers. self.p1_src_start_ip = u"10.0.0.1" self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.39.15" + self.p1_dst_end_ip = u"20.7.161.31" self.p2_src_start_ip = u"20.0.0.1" self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.39.15" + self.p2_dst_end_ip = u"10.7.161.31" def define_packets(self): """Defines the packets to be sent from the traffic generator. diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst60000-1cnf.py index 76cb46592b..49d35f1da0 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-1cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst60000-1cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst60000-2cnf.py index f8d84c7696..a673b0bd98 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-2cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst60000-2cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst60000-4cnf.py index c97f1ca176..d9fc1a4718 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-4cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst60000-4cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst60000-8cnf.py index 3d225f8ce3..3674818810 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-8cnf.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst60000-8cnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst60000-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst60000-udir.py index 8bbfcc6102..e037734f15 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst60000-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst60000-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst60000.py index 53cef6b1ab..e6e13343bb 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst60000.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst8-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst8-udir.py index 95286ce221..c6d383cfd8 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst8-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst8-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst8.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst8.py index 33452c18c0..7cbe1f9573 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst8.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst8.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src1000ip4dst1000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src1000ip4dst1000.py new file mode 100644 index 0000000000..8a79cdd7f5 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src1000ip4dst1000.py @@ -0,0 +1,165 @@ +# Copyright (c) 2023 Intel and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.0 - 10.3.231.0 + - Destination IP address range: 20.0.0.0 - 20.3.231.0 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.0 - 20.3.231.0 + - Destination IP address range: 10.0.0.0 - 10.3.231.0 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.0" + self.p1_src_end_ip = u"10.3.231.0" + + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.3.231.0" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.3.231.0" + + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.3.231.0" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :returns: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src100ip4dst100.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src100ip4dst100.py new file mode 100644 index 0000000000..681e594136 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src100ip4dst100.py @@ -0,0 +1,165 @@ +# Copyright (c) 2023 Intel and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.0 - 10.0.99.0 + - Destination IP address range: 20.0.0.0 - 20.0.99.0 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.0 - 20.0.99.0 + - Destination IP address range: 10.0.0.0 - 10.0.99.0 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.0" + self.p1_src_end_ip = u"10.0.99.0" + + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.99.0" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.99.0" + + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.99.0" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :returns: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1u1p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src1ip4dst1.py index 3c2ae8f023..9a33b33522 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1u1p.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src1ip4dst1.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Intel and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # @@ -25,17 +25,13 @@ Stream profile: - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP + - Packet: ETH / IP / - Direction 0 --> 1: - - Source IP address range: 20.0.0.0 - - Destination IP address range: 12.0.0.2 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 + - Source IP address range: 10.0.0.0 + - Destination IP address range: 20.0.0.0 - Direction 1 --> 0: - - Source IP address range: 12.0.0.2 - - Destination IP address range: 200.0.0.0 - - Source UDP port range: 1024 - - Destination UDP port range: 1028 + - Source IP address range: 20.0.0.0 + - Destination IP address range: 10.0.0.0 """ from trex.stl.api import * @@ -51,23 +47,16 @@ class TrafficStreams(TrafficStreamsBaseClass): super(TrafficStreamsBaseClass, self).__init__() # IPs used in packet headers. - self.p1_src_ip = u"20.0.0.0" - self.p1_dst_ip = u"12.0.0.2" - - self.p2_src_ip = u"12.0.0.2" - self.p2_dst_ip = u"200.0.0.0" - - # UDP ports used in packet headers. - self.p1_src_udp_port = 1024 - self.p1_dst_udp_port = 1024 + self.p1_src_ip = u"10.0.0.0" + self.p1_dst_ip = u"20.0.0.0" - self.p2_src_udp_port = 1024 - self.p2_dst_udp_port = 1028 + self.p2_src_ip = u"20.0.0.0" + self.p2_dst_ip = u"10.0.0.0" def define_packets(self): """Defines the packets to be sent from the traffic generator. - Packet definition: | ETH | IP | UDP | + Packet definition: | ETH | IP | :returns: Packets to be sent from the traffic generator. :rtype: tuple @@ -79,11 +68,7 @@ class TrafficStreams(TrafficStreamsBaseClass): IP( src=self.p1_src_ip, dst=self.p1_dst_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_udp_port, - dport=self.p1_dst_udp_port + proto=61 ) ) # Direction 1 --> 0 @@ -92,11 +77,7 @@ class TrafficStreams(TrafficStreamsBaseClass): IP( src=self.p2_src_ip, dst=self.p2_dst_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_udp_port, - dport=self.p2_dst_udp_port + proto=61 ) ) diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4src253.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src253.py index e1741f98e9..bb287474f7 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4src253.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src253.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4src254.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src254.py index 8afc3b6fd5..ce0c04f2e7 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4src254.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src254.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src2ip4dst2.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src2ip4dst2.py new file mode 100644 index 0000000000..58d2c0a499 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src2ip4dst2.py @@ -0,0 +1,165 @@ +# Copyright (c) 2023 Intel and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.0 - 10.0.1.0 + - Destination IP address range: 20.0.0.0 - 20.0.1.0 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.0 - 20.0.1.0 + - Destination IP address range: 10.0.0.0 - 10.0.1.0 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.0" + self.p1_src_end_ip = u"10.0.1.0" + + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.1.0" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.1.0" + + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.1.0" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :returns: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src4ip4dst4.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src4ip4dst4.py new file mode 100644 index 0000000000..4f517a77ce --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src4ip4dst4.py @@ -0,0 +1,165 @@ +# Copyright (c) 2023 Intel and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.0 - 10.0.3.0 + - Destination IP address range: 20.0.0.0 - 20.0.3.0 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.0 - 20.0.3.0 + - Destination IP address range: 10.0.0.0 - 10.0.3.0 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.0" + self.p1_src_end_ip = u"10.0.3.0" + + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.3.0" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.3.0" + + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.3.0" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :returns: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src8ip4dst8.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src8ip4dst8.py new file mode 100644 index 0000000000..d11a7b50b5 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4src8ip4dst8.py @@ -0,0 +1,165 @@ +# Copyright (c) 2023 Intel and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.0 - 10.0.7.0 + - Destination IP address range: 20.0.0.0 - 20.0.7.0 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.0 - 20.0.7.0 + - Destination IP address range: 10.0.0.0 - 10.0.7.0 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.0" + self.p1_src_end_ip = u"10.0.7.0" + + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.7.0" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.7.0" + + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.7.0" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + step=256, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :returns: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc100ip4src100.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-macsrc100ip4src100.py index f668e2ad19..8ec4a4b35d 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc100ip4src100.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-macsrc100ip4src100.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc100kip4src100k.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-macsrc100kip4src100k.py index d3f10fc8ff..9a3c15de6d 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc100kip4src100k.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-macsrc100kip4src100k.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc10kip4src10k.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-macsrc10kip4src10k.py index 2882027f4c..4968fc718b 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc10kip4src10k.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-macsrc10kip4src10k.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc500kdst500k.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-macsrc500kdst500k.py index 73c36ef2a1..36d1a08e1e 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc500kdst500k.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-macsrc500kdst500k.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc50kdst50k.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-macsrc50kdst50k.py index 535aa73e4f..6d41e67b0d 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc50kdst50k.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-macsrc50kdst50k.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc5kdst5k.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-macsrc5kdst5k.py index a9039fa49f..0b053795d9 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc5kdst5k.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-macsrc5kdst5k.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-1000u15p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1000u15p.py index b8abc8a069..6e07b5175d 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-1000u15p.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1000u15p.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-100u1000p-conc.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-100u1000p-conc.py index 081531bd91..4e860edf46 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-100u1000p-conc.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-100u1000p-conc.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-100u15p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-100u15p.py index b870ce11d0..8f31e90d99 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-100u15p.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-100u15p.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1024u63p-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1024u63p-udir.py index 210313f66a..30c6440dd8 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1024u63p-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1024u63p-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1024u63p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1024u63p.py index c104605d50..3b920cd3c8 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1024u63p.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1024u63p.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1048576u63p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1048576u63p.py index db9e317faf..a99d78e78d 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1048576u63p.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1048576u63p.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-10u1000p-conc.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-10u1000p-conc.py index 6ba4c34340..aecef71d4c 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-10u1000p-conc.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-10u1000p-conc.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u10p-conc.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-10u10p-conc.py index ba7fbc874d..406bce919f 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u10p-conc.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-10u10p-conc.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u15p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-10u15p.py index c84838d2f9..7506012069 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u15p.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-10u15p.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-16384u63p-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-16384u63p-udir.py index 7d9d4c6f4c..da826809f8 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-16384u63p-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-16384u63p-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-16384u63p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-16384u63p.py index 54d115e104..1c5d69fcda 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-16384u63p.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-16384u63p.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1u15p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1u15p.py index a58842b022..7fba7c4b85 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1u15p.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1u15p.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-1u1p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1u1p.py index 9a88d7fcea..229ea2218c 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-1u1p.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1u1p.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-2000u15p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-2000u15p.py index 60b43b5e0b..1100bdd3ed 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-2000u15p.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-2000u15p.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-262144u63p-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-262144u63p-udir.py index b499842dca..09f8e88f13 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-262144u63p-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-262144u63p-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-262144u63p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-262144u63p.py index 5277189148..406321b7cf 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-262144u63p.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-262144u63p.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-4000u15p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-4000u15p.py index 0e259992b6..7257dcc62d 100644 --- a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-4000u15p.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-4000u15p.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-4096u63p-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-4096u63p-udir.py index 202c123abb..7d441bf1e2 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-4096u63p-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-4096u63p-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-4096u63p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-4096u63p.py index 7c90dbe7ae..0c4613b93f 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-4096u63p.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-4096u63p.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-65536u63p-udir.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-65536u63p-udir.py index d678517f78..9f3a1172d4 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-65536u63p-udir.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-65536u63p-udir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-65536u63p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-65536u63p.py index e2ef21e047..be5e990c4e 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-65536u63p.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-65536u63p.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-lb.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-lb.py index f11b476aa6..850149fc61 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-lb.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-lb.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Intel and/or its affiliates. +# Copyright (c) 2023 Intel and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4vxlan-ip4src1udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-stl-ethip4vxlan-ip4src1udpsrcrnd.py index 6c277c18bf..56a1ee3321 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4vxlan-ip4src1udpsrcrnd.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4vxlan-ip4src1udpsrcrnd.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd10000-2p.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd10000-2p.py new file mode 100644 index 0000000000..e3d39cc31e --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd10000-2p.py @@ -0,0 +1,115 @@ +# Copyright (c) 2024 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Single parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IPv6 / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "2100::1", + "dst_start_ip": "2200::0", + "dst_end_ip": "2200::270F", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "2200::1", + "dst_start_ip": "2100::0", + "dst_end_ip": "2100::270F", + "seed": 2 + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + base, count = self._get_start_end_ipv6( + self.pkt_data[i]["dst_start_ip"], + self.pkt_data[i]["dst_end_ip"] + ) + + self.pkt_base.append( + Ether() / + IPv6( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"] + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name="ipv6_dst", + min_value=base, + max_value=base + count, + size=8, + seed=self.pkt_data[i]["seed"], + limit=(2**24 - 1) + ), + STLVmWrFlowVar( + fv_name="ipv6_dst", + pkt_offset="IPv6.dst", + offset_fixup=8 + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd10000-6p.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd10000-6p.py new file mode 100644 index 0000000000..564ffbb83d --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd10000-6p.py @@ -0,0 +1,143 @@ +# Copyright (c) 2024 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IPv6 / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "2100::1", + "dst_start_ip": "2200::0", + "dst_end_ip": "2200::270F", + "seed": 1 + }, + # Direction W --> E: + { + "src_start_ip": "2300::1", + "dst_start_ip": "2400::0", + "dst_end_ip": "2400::270F", + "seed": 2 + }, + # Direction W --> E: + { + "src_start_ip": "2500::1", + "dst_start_ip": "2600::0", + "dst_end_ip": "2600::270F", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "2200::1", + "dst_start_ip": "2100::0", + "dst_end_ip": "2100::270F", + "seed": 2 + }, + # Direction E --> W: + { + "src_start_ip": "2400::1", + "dst_start_ip": "2300::0", + "dst_end_ip": "2300::270F", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "2600::1", + "dst_start_ip": "2500::0", + "dst_end_ip": "2500::270F", + "seed": 2 + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + base, count = self._get_start_end_ipv6( + self.pkt_data[i]["dst_start_ip"], + self.pkt_data[i]["dst_end_ip"] + ) + + self.pkt_base.append( + Ether() / + IPv6( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"] + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name="ipv6_dst", + min_value=base, + max_value=base + count, + size=8, + seed=self.pkt_data[i]["seed"], + limit=(2**24 - 1) + ), + STLVmWrFlowVar( + fv_name="ipv6_dst", + pkt_offset="IPv6.dst", + offset_fixup=8 + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd100000-2p.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd100000-2p.py new file mode 100644 index 0000000000..8948e785a4 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd100000-2p.py @@ -0,0 +1,115 @@ +# Copyright (c) 2024 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Single parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IPv6 / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "2100::1", + "dst_start_ip": "2200::0", + "dst_end_ip": "2200::1:869F", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "2200::1", + "dst_start_ip": "2100::0", + "dst_end_ip": "2100::1:869F", + "seed": 2 + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + base, count = self._get_start_end_ipv6( + self.pkt_data[i]["dst_start_ip"], + self.pkt_data[i]["dst_end_ip"] + ) + + self.pkt_base.append( + Ether() / + IPv6( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"] + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name="ipv6_dst", + min_value=base, + max_value=base + count, + size=8, + seed=self.pkt_data[i]["seed"], + limit=(2**24 - 1) + ), + STLVmWrFlowVar( + fv_name="ipv6_dst", + pkt_offset="IPv6.dst", + offset_fixup=8 + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd100000-6p.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd100000-6p.py new file mode 100644 index 0000000000..374be384ef --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd100000-6p.py @@ -0,0 +1,143 @@ +# Copyright (c) 2024 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IPv6 / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "2100::1", + "dst_start_ip": "2200::0", + "dst_end_ip": "2200::1:869F", + "seed": 1 + }, + # Direction W --> E: + { + "src_start_ip": "2300::1", + "dst_start_ip": "2400::0", + "dst_end_ip": "2400::1:869F", + "seed": 2 + }, + # Direction W --> E: + { + "src_start_ip": "2500::1", + "dst_start_ip": "2600::0", + "dst_end_ip": "2600::1:869F", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "2200::1", + "dst_start_ip": "2100::0", + "dst_end_ip": "2100::1:869F", + "seed": 2 + }, + # Direction E --> W: + { + "src_start_ip": "2400::1", + "dst_start_ip": "2300::0", + "dst_end_ip": "2300::1:869F", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "2600::1", + "dst_start_ip": "2500::0", + "dst_end_ip": "2500::1:869F", + "seed": 2 + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + base, count = self._get_start_end_ipv6( + self.pkt_data[i]["dst_start_ip"], + self.pkt_data[i]["dst_end_ip"] + ) + + self.pkt_base.append( + Ether() / + IPv6( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"] + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name="ipv6_dst", + min_value=base, + max_value=base + count, + size=8, + seed=self.pkt_data[i]["seed"], + limit=(2**24 - 1) + ), + STLVmWrFlowVar( + fv_name="ipv6_dst", + pkt_offset="IPv6.dst", + offset_fixup=8 + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd1000000-2p.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd1000000-2p.py new file mode 100644 index 0000000000..735888d265 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd1000000-2p.py @@ -0,0 +1,115 @@ +# Copyright (c) 2024 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Single parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IPv6 / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "2100::1", + "dst_start_ip": "2200::0", + "dst_end_ip": "2200::F:423F", + "seed": 1 + }, + # Direction E --> W: + { + "src_start_ip": "2200::1", + "dst_start_ip": "2100::0", + "dst_end_ip": "2100::F:423F", + "seed": 2 + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + base, count = self._get_start_end_ipv6( + self.pkt_data[i]["dst_start_ip"], + self.pkt_data[i]["dst_end_ip"] + ) + + self.pkt_base.append( + Ether() / + IPv6( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"] + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name="ipv6_dst", + min_value=base, + max_value=base + count, + size=8, + seed=self.pkt_data[i]["seed"], + limit=(2**24 - 1) + ), + STLVmWrFlowVar( + fv_name="ipv6_dst", + pkt_offset="IPv6.dst", + offset_fixup=8 + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd1000000-6p.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd1000000-6p.py new file mode 100644 index 0000000000..5cc32159e5 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst-rnd1000000-6p.py @@ -0,0 +1,136 @@ +# Copyright (c) 2024 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IPv6 / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "2100::1", + "dst_start_ip": "2200::0", + "dst_end_ip": "2200::F:423F" + }, + # Direction W --> E: + { + "src_start_ip": "2300::1", + "dst_start_ip": "2400::0", + "dst_end_ip": "2400::F:423F" + }, + # Direction W --> E: + { + "src_start_ip": "2500::1", + "dst_start_ip": "2600::0", + "dst_end_ip": "2600::F:423F" + }, + # Direction E --> W: + { + "src_start_ip": "2200::1", + "dst_start_ip": "2100::0", + "dst_end_ip": "2100::F:423F" + }, + # Direction E --> W: + { + "src_start_ip": "2400::1", + "dst_start_ip": "2300::0", + "dst_end_ip": "2300::F:423F" + }, + # Direction E --> W: + { + "src_start_ip": "2600::1", + "dst_start_ip": "2500::0", + "dst_end_ip": "2500::F:423F" + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + base, count = self._get_start_end_ipv6( + self.pkt_data[i]["dst_start_ip"], + self.pkt_data[i]["dst_end_ip"] + ) + + self.pkt_base.append( + Ether() / + IPv6( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"] + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name="ipv6_dst", + min_value=base, + max_value=base + count, + size=8, + op="inc" + ), + STLVmWrFlowVar( + fv_name="ipv6_dst", + pkt_offset="IPv6.dst", + offset_fixup=8 + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst10000-2p.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst10000-2p.py new file mode 100644 index 0000000000..7a02aac9f8 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst10000-2p.py @@ -0,0 +1,112 @@ +# Copyright (c) 2024 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Single parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IPv6 / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "2100::1", + "dst_start_ip": "2200::0", + "dst_end_ip": "2200::270F" + }, + # Direction E --> W: + { + "src_start_ip": "2200::1", + "dst_start_ip": "2100::0", + "dst_end_ip": "2100::270F" + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + base, count = self._get_start_end_ipv6( + self.pkt_data[i]["dst_start_ip"], + self.pkt_data[i]["dst_end_ip"] + ) + + self.pkt_base.append( + Ether() / + IPv6( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"] + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVar( + name="ipv6_dst", + min_value=base, + max_value=base + count, + size=8, + op="inc" + ), + STLVmWrFlowVar( + fv_name="ipv6_dst", + pkt_offset="IPv6.dst", + offset_fixup=8 + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst10000-6p.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst10000-6p.py new file mode 100644 index 0000000000..f72bc2365e --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst10000-6p.py @@ -0,0 +1,136 @@ +# Copyright (c) 2024 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IPv6 / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "2100::1", + "dst_start_ip": "2200::0", + "dst_end_ip": "2200::270F" + }, + # Direction W --> E: + { + "src_start_ip": "2300::1", + "dst_start_ip": "2400::0", + "dst_end_ip": "2400::270F" + }, + # Direction W --> E: + { + "src_start_ip": "2500::1", + "dst_start_ip": "2600::0", + "dst_end_ip": "2600::270F" + }, + # Direction E --> W: + { + "src_start_ip": "2200::1", + "dst_start_ip": "2100::0", + "dst_end_ip": "2100::270F" + }, + # Direction E --> W: + { + "src_start_ip": "2400::1", + "dst_start_ip": "2300::0", + "dst_end_ip": "2300::270F" + }, + # Direction E --> W: + { + "src_start_ip": "2600::1", + "dst_start_ip": "2500::0", + "dst_end_ip": "2500::270F" + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + base, count = self._get_start_end_ipv6( + self.pkt_data[i]["dst_start_ip"], + self.pkt_data[i]["dst_end_ip"] + ) + + self.pkt_base.append( + Ether() / + IPv6( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"] + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVar( + name="ipv6_dst", + min_value=base, + max_value=base + count, + size=8, + op="inc" + ), + STLVmWrFlowVar( + fv_name="ipv6_dst", + pkt_offset="IPv6.dst", + offset_fixup=8 + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst10000-rnd.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst10000-rnd.py deleted file mode 100644 index 0e335909f4..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst10000-rnd.py +++ /dev/null @@ -1,142 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IPv6 / - - Direction 0 --> 1: - - Source IP address range: 2001:1::1 - - Destination IP address range: 2001:2::0 - 2001:2::270F - - Direction 1 --> 0: - - Source IP address range: 2001:2::1 - - Destination IP address range: 2001:1::0 - 2001:1::270F -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::1" - self.p1_dst_start_ip = u"2001:2::0" - self.p1_dst_end_ip = u"2001:2::270F" - - self.p2_src_start_ip = u"2001:2::1" - self.p2_dst_start_ip = u"2001:1::0" - self.p2_dst_end_ip = u"2001:1::270F" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_dst_start_ip, - self.p1_dst_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_dst_start_ip, - self.p2_dst_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVarRepeatableRandom( - name=u"ipv6_dst", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, - seed=1, - # Cycle length. TRex does not allow any higher value. - limit=(2**24 - 1) - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVarRepeatableRandom( - name=u"ipv6_dst", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, - seed=2, - limit=(2**24 - 1) - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst10000.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst10000.py deleted file mode 100644 index 9aa4fd5ee4..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst10000.py +++ /dev/null @@ -1,139 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IPv6 / - - Direction 0 --> 1: - - Source IP address range: 2001:1::1 - - Destination IP address range: 2001:2::0 - 2001:2::270F - - Direction 1 --> 0: - - Source IP address range: 2001:2::1 - - Destination IP address range: 2001:1::0 - 2001:1::270F -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::1" - self.p1_dst_start_ip = u"2001:2::0" - self.p1_dst_end_ip = u"2001:2::270F" - - self.p2_src_start_ip = u"2001:2::1" - self.p2_dst_start_ip = u"2001:1::0" - self.p2_dst_end_ip = u"2001:1::270F" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_dst_start_ip, - self.p1_dst_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_dst_start_ip, - self.p2_dst_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst100000-2p.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst100000-2p.py new file mode 100644 index 0000000000..11279216a0 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst100000-2p.py @@ -0,0 +1,112 @@ +# Copyright (c) 2024 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Single parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IPv6 / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "2100::1", + "dst_start_ip": "2200::0", + "dst_end_ip": "2200::1:869F" + }, + # Direction E --> W: + { + "src_start_ip": "2200::1", + "dst_start_ip": "2100::0", + "dst_end_ip": "2100::1:869F" + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + base, count = self._get_start_end_ipv6( + self.pkt_data[i]["dst_start_ip"], + self.pkt_data[i]["dst_end_ip"] + ) + + self.pkt_base.append( + Ether() / + IPv6( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"] + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVar( + name="ipv6_dst", + min_value=base, + max_value=base + count, + size=8, + op="inc" + ), + STLVmWrFlowVar( + fv_name="ipv6_dst", + pkt_offset="IPv6.dst", + offset_fixup=8 + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst100000-6p.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst100000-6p.py new file mode 100644 index 0000000000..f1e0e4c9c7 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst100000-6p.py @@ -0,0 +1,136 @@ +# Copyright (c) 2024 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IPv6 / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "2100::1", + "dst_start_ip": "2200::0", + "dst_end_ip": "2200::1:869F" + }, + # Direction W --> E: + { + "src_start_ip": "2300::1", + "dst_start_ip": "2400::0", + "dst_end_ip": "2400::1:869F" + }, + # Direction W --> E: + { + "src_start_ip": "2500::1", + "dst_start_ip": "2600::0", + "dst_end_ip": "2600::1:869F" + }, + # Direction E --> W: + { + "src_start_ip": "2200::1", + "dst_start_ip": "2100::0", + "dst_end_ip": "2100::1:869F" + }, + # Direction E --> W: + { + "src_start_ip": "2400::1", + "dst_start_ip": "2300::0", + "dst_end_ip": "2300::1:869F" + }, + # Direction E --> W: + { + "src_start_ip": "2600::1", + "dst_start_ip": "2500::0", + "dst_end_ip": "2500::1:869F" + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + base, count = self._get_start_end_ipv6( + self.pkt_data[i]["dst_start_ip"], + self.pkt_data[i]["dst_end_ip"] + ) + + self.pkt_base.append( + Ether() / + IPv6( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"] + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVar( + name="ipv6_dst", + min_value=base, + max_value=base + count, + size=8, + op="inc" + ), + STLVmWrFlowVar( + fv_name="ipv6_dst", + pkt_offset="IPv6.dst", + offset_fixup=8 + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst100000-rnd.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst100000-rnd.py deleted file mode 100644 index daa160d53a..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst100000-rnd.py +++ /dev/null @@ -1,142 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IPv6 / - - Direction 0 --> 1: - - Source IP address range: 2001:1::1 - - Destination IP address range: 2001:2::0 - 2001:2::1:869F - - Direction 1 --> 0: - - Source IP address range: 2001:2::1 - - Destination IP address range: 2001:1::0 - 2001:1::1:869F -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::1" - self.p1_dst_start_ip = u"2001:2::0" - self.p1_dst_end_ip = u"2001:2::1:869F" - - self.p2_src_start_ip = u"2001:2::1" - self.p2_dst_start_ip = u"2001:1::0" - self.p2_dst_end_ip = u"2001:1::1:869F" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_dst_start_ip, - self.p1_dst_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_dst_start_ip, - self.p2_dst_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVarRepeatableRandom( - name=u"ipv6_dst", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, - seed=1, - # Cycle length. TRex does not allow any higher value. - limit=(2**24 - 1) - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVarRepeatableRandom( - name=u"ipv6_dst", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, - seed=2, - limit=(2**24 - 1) - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst100000.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst100000.py deleted file mode 100644 index f78d98c64f..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst100000.py +++ /dev/null @@ -1,139 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IPv6 / - - Direction 0 --> 1: - - Source IP address range: 2001:1::1 - - Destination IP address range: 2001:2::0 - 2001:2::1:869F - - Direction 1 --> 0: - - Source IP address range: 2001:2::1 - - Destination IP address range: 2001:1::0 - 2001:1::1:869F -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::1" - self.p1_dst_start_ip = u"2001:2::0" - self.p1_dst_end_ip = u"2001:2::1:869F" - - self.p2_src_start_ip = u"2001:2::1" - self.p2_dst_start_ip = u"2001:1::0" - self.p2_dst_end_ip = u"2001:1::1:869F" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_dst_start_ip, - self.p1_dst_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_dst_start_ip, - self.p2_dst_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst1000000-2p.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst1000000-2p.py new file mode 100644 index 0000000000..0057c8b4b9 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst1000000-2p.py @@ -0,0 +1,112 @@ +# Copyright (c) 2024 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Single parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IPv6 / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "2100::1", + "dst_start_ip": "2200::0", + "dst_end_ip": "2200::F:423F" + }, + # Direction E --> W: + { + "src_start_ip": "2200::1", + "dst_start_ip": "2100::0", + "dst_end_ip": "2100::F:423F" + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + base, count = self._get_start_end_ipv6( + self.pkt_data[i]["dst_start_ip"], + self.pkt_data[i]["dst_end_ip"] + ) + + self.pkt_base.append( + Ether() / + IPv6( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"] + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVar( + name="ipv6_dst", + min_value=base, + max_value=base + count, + size=8, + op="inc" + ), + STLVmWrFlowVar( + fv_name="ipv6_dst", + pkt_offset="IPv6.dst", + offset_fixup=8 + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst1000000-6p.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst1000000-6p.py new file mode 100644 index 0000000000..4a1307c510 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst1000000-6p.py @@ -0,0 +1,136 @@ +# Copyright (c) 2024 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Three parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IPv6 / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "2100::1", + "dst_start_ip": "2200::0", + "dst_end_ip": "2200::F:423F" + }, + # Direction W --> E: + { + "src_start_ip": "2300::1", + "dst_start_ip": "2400::0", + "dst_end_ip": "2400::F:423F" + }, + # Direction W --> E: + { + "src_start_ip": "2500::1", + "dst_start_ip": "2600::0", + "dst_end_ip": "2600::F:423F" + }, + # Direction E --> W: + { + "src_start_ip": "2200::1", + "dst_start_ip": "2100::0", + "dst_end_ip": "2100::F:423F" + }, + # Direction E --> W: + { + "src_start_ip": "2400::1", + "dst_start_ip": "2300::0", + "dst_end_ip": "2300::F:423F" + }, + # Direction E --> W: + { + "src_start_ip": "2600::1", + "dst_start_ip": "2500::0", + "dst_end_ip": "2500::F:423F" + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + base, count = self._get_start_end_ipv6( + self.pkt_data[i]["dst_start_ip"], + self.pkt_data[i]["dst_end_ip"] + ) + + self.pkt_base.append( + Ether() / + IPv6( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"] + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVar( + name="ipv6_dst", + min_value=base, + max_value=base + count, + size=8, + op="inc" + ), + STLVmWrFlowVar( + fv_name="ipv6_dst", + pkt_offset="IPv6.dst", + offset_fixup=8 + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst1000000-rnd.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst1000000-rnd.py deleted file mode 100644 index a372e1ae3b..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst1000000-rnd.py +++ /dev/null @@ -1,142 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IPv6 / - - Direction 0 --> 1: - - Source IP address range: 2001:1::1 - - Destination IP address range: 2001:2::0 - 2001:2::F:423F - - Direction 1 --> 0: - - Source IP address range: 2001:2::1 - - Destination IP address range: 2001:1::0 - 2001:1::F:423F -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::1" - self.p1_dst_start_ip = u"2001:2::0" - self.p1_dst_end_ip = u"2001:2::F:423F" - - self.p2_src_start_ip = u"2001:2::1" - self.p2_dst_start_ip = u"2001:1::0" - self.p2_dst_end_ip = u"2001:1::F:423F" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_dst_start_ip, - self.p1_dst_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_dst_start_ip, - self.p2_dst_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVarRepeatableRandom( - name=u"ipv6_dst", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, - seed=1, - # Cycle length. TRex does not allow any higher value. - limit=(2**24 - 1) - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVarRepeatableRandom( - name=u"ipv6_dst", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, - seed=2, - limit=(2**24 - 1) - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst1000000.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst1000000.py deleted file mode 100644 index 572eed4256..0000000000 --- a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst1000000.py +++ /dev/null @@ -1,139 +0,0 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# -# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later -# -# Licensed under the Apache License 2.0 or -# GNU General Public License v2.0 or later; you may not use this file -# except in compliance with one of these Licenses. You -# may obtain a copy of the Licenses at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# Note: If this file is linked with Scapy, which is GPLv2+, your use of it -# must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose -# Apache 2. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IPv6 / - - Direction 0 --> 1: - - Source IP address range: 2001:1::1 - - Destination IP address range: 2001:2::0 - 2001:2::F:423F - - Direction 1 --> 0: - - Source IP address range: 2001:2::1 - - Destination IP address range: 2001:1::0 - 2001:1::F:423F -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::1" - self.p1_dst_start_ip = u"2001:2::0" - self.p1_dst_end_ip = u"2001:2::F:423F" - - self.p2_src_start_ip = u"2001:2::1" - self.p2_dst_start_ip = u"2001:1::0" - self.p2_dst_end_ip = u"2001:1::F:423F" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_dst_start_ip, - self.p1_dst_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_dst_start_ip, - self.p2_dst_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst500000-2p.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst500000-2p.py new file mode 100644 index 0000000000..d85f9a5f54 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6dst500000-2p.py @@ -0,0 +1,111 @@ +# Copyright (c) 2024 Cisco and/or its affiliates. +# +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# +# Licensed under the Apache License 2.0 or +# GNU General Public License v2.0 or later; you may not use this file +# except in compliance with one of these Licenses. You +# may obtain a copy of the Licenses at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# Note: If this file is linked with Scapy, which is GPLv2+, your use of it +# must be under GPLv2+. If at any point in the future it is no longer linked +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Single parallel bi-directional streams sent as W --> E and E --> W + at the same time. + - Packet: ETH / IPv6 / +""" + +from trex.stl.api import * +from profile_trex_stateless_scale_class import TrafficStreamsScaleClass + + +class TrafficStreams(TrafficStreamsScaleClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsScaleClass, self).__init__() + + self.pkt_data = [ + # Direction W --> E: + { + "src_start_ip": "2100::1", + "dst_start_ip": "2200::0", + "dst_end_ip": "2200::7:a11f" + }, + # Direction E --> W: + { + "src_start_ip": "2200::1", + "dst_start_ip": "2100::0", + "dst_end_ip": "2100::7:a11f" + } + ] + self.pkt_base = [] + self.pkt_vm = [] + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + for i in range(len(self.pkt_data)): + base, count = self._get_start_end_ipv6( + self.pkt_data[i]["dst_start_ip"], + self.pkt_data[i]["dst_end_ip"] + ) + + self.pkt_base.append( + Ether() / + IPv6( + src=self.pkt_data[i]["src_start_ip"], + dst=self.pkt_data[i]["dst_start_ip"] + ) + ) + self.pkt_vm.append( + STLScVmRaw( + [ + STLVmFlowVar( + name="ipv6_dst", + min_value=base, + max_value=base + count, + size=8 + ), + STLVmWrFlowVar( + fv_name="ipv6_dst", + pkt_offset="IPv6.dst", + offset_fixup=8 + ) + ] + ) + ) + + return self.pkt_base, self.pkt_vm + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6src253.py b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6src253.py index d67a4ab18c..3763a0977a 100644 --- a/GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6src253.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip6-ip6src253.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # |