summaryrefslogtreecommitdiffstats
path: root/docs
AgeCommit message (Expand)AuthorFilesLines
2018-08-27docs: Finish event logger, viewer and cleanup.John DeNisco17-142/+346
2018-08-17docs: Moved installing up a level, removed guides.John DeNisco14-98/+25
2018-08-17Update AArch64 CSIT machines into FD.io VPP docsLijian Zhang2-2/+11
2018-08-17docs: Rework the VPP progressive Tutorial.John DeNisco21-471/+394
2018-08-14DOCS: Moved multiarch and build system, Incorprated Scott's changesJohn DeNisco25-101/+130
2018-08-14DOCS: Updated startup.conf parametersandrew1-69/+174
2018-08-13DOCS: Cleanup Getting StartedJohn DeNisco11-253/+97
2018-08-10DOC-ONLY: document latest multi-arch support schemeDave Barach3-0/+172
2018-08-10DOC-ONLY: build system detailsDave Barach5-0/+382
2018-08-10docs: A little cleanup and added some gdb examples.andrew4-18/+210
2018-08-09DOCS: General cleanup (did not move any sections)andrew7-53/+60
2018-08-09DOCS: modified writing docs sectionjavierfernandezvalles1-1/+1
2018-08-09DOCS: Restructure EventsJohn DeNisco93-866/+270
2018-08-08DOC ONLY: Add a new doc for integrating a plugin with VPPandrew4-0/+710
2018-08-07docs: Cleaned up a little removed instructions for mac.andrew1-22/+89
2018-08-07DOC ONLY: document bihash table walker rulesDave Barach1-0/+35
2018-08-03Added missing fileJohn DeNisco13-1352/+1372
2018-08-03docs: Incororate Scott's overall reviewJohn DeNisco22-78/+146
2018-08-01docs: change code blocks from "shell" to "console"John DeNisco7-47/+47
2018-07-27Fix .gitignore so docs/Makefile is not ignored. Add README and Makefile. Fis ...John DeNisco3-11/+80
2018-07-26Initial commit of Sphinx docsJohn DeNisco237-56/+12729
2018-07-11Documentation: Placeholder directory and filesEd Kern1-0/+56
ld; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# Copyright (c) 2017 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# 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_lib.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 = '2001:1::1'
        self.p1_dst_start_ip = '2001:2::0'
        self.p1_dst_end_ip = '2001:2::270F'

        self.p2_src_start_ip = '2001:2::1'
        self.p2_dst_start_ip = '2001:1::0'
        self.p2_dst_end_ip = '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="ipv6_dst",
                                       min_value=base_p1,
                                       max_value=base_p1 + count_p1,
                                       size=8, op="inc"),
                          STLVmWrFlowVar(fv_name="ipv6_dst",
                                         pkt_offset="IPv6.dst",
                                         offset_fixup=8)],
                         split_by_field="ipv6_dst")
        # Direction 1 --> 0
        vm2 = STLScVmRaw([STLVmFlowVar(name="ipv6_dst",
                                       min_value=base_p2,
                                       max_value=base_p2 + count_p2,
                                       size=8, op="inc"),
                          STLVmWrFlowVar(fv_name="ipv6_dst",
                                         pkt_offset="IPv6.dst",
                                         offset_fixup=8)],
                         split_by_field="ipv6_dst")

        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()