Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rsvp auto ero generation based on learned TE topology from IGP #299

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

SouravSinhaRoy
Copy link
Contributor

@SouravSinhaRoy SouravSinhaRoy commented Feb 7, 2023

This is the proposal to add auto ero support to RSVP-TE in the OTG model based on the issue #298. The redocly view of the changes (https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/open-traffic-generator/models/rsvp_ero/artifacts/openapi.yaml&nocors#tag/Configuration/operation/set_config)

In this example, there are two test ports connected to a System Under Test with multiple routers.
Test port1 is acting as the ingress for two uni-directional tunnels. Both the tunnels are originating from the loopback
interface on the device on port1 and terminating in the loopback of the device on port2 , which is also a test port. In between there
is a collection of routers under test which allow creation of LSPs to the same destination via multiple paths. One LSP is created with
auto ero enabled while the other LSP carries a static user configured ERO.

                        |---------Rtr2 (11.11.11.1)--------
                        |                                 |
(Ingress) p1 ------rtr1                                  rtr4-----p2 (Egress)
  7.7.7.7/auto ero            |                                    |           8.8.8.8
                        |---------Rtr3 (12.12.12.1)--------
    
   
# python snappi
#Creating Ports
import otg

api = otg.api(location="https://localhost")
config = api.config()
p1 = config.ports.port(name='p1', location='172.17.0.2:50071')[-1]
p2 = config.ports.port(name='p2', location='172.17.0.3:50071')[-1]

#Create RSVP running on connected interface.

p1_d1 = config.devices.device(name='p1_d1')[-1]
p2_d1 = config.devices.device(name='p2_d1')[-1]

p1_eth1 = p1_d1.ethernets.ethernet()[-1]
p2_eth1 = p2_d1.ethernets.ethernet()[-1]

p1_eth1.connection.choice = 1
p1_eth1.connection.port_name = p1.name

p2_eth1.connection.choice = 1
p2_eth1.connection.port_name = p2.name

p1_eth1.name ='p1_eth1'
p1_eth1.mac = '00:11:00:00:00:01'
p1_ip1 = p1_eth1.ipv4_addresses.ipv4(name = 'p1_ip1', address = '20.20.20.2', gateway = '20.20.20.1')[-1]
p1_lo1 = p1_d1.ipv4_loopbacks.ipv4loopback(eth_name = p1_eth1.name,name = 'p1_lo1', address = '7.7.7.7')[-1]

p2_eth1.name='p2_eth1'
p2_eth1.mac = '00:12:00:00:00:01'
p2_ip1 = p2_eth1.ipv4_addresses.ipv4(name='p2_ip1', address = '30.30.30.2', gateway = '30.30.30.1')[-1]
p2_lo1 = p2_d1.ipv4_loopbacks.ipv4loopback(eth_name = p2_eth1.name,name='p2_lo1', address = '8.8.8.8')[-1]

p1_rsvpRtr1 = p1_d1.rsvp
p2_rsvpRtr1 = p2_d1.rsvp

p1_rsvpRtr1.name='p1_d1_rsvp'
p2_rsvpRtr1.name='p2_d1_rsvp'

p1_rsvpInf1 = p1_rsvpRtr1.ipv4_interfaces.ipv4interface(ipv4_name=p1_ip1.name,neighbor_ip = '20.20.20.1',enable_refresh_reduction = True, send_bundle = True)[-1]
p2_rsvpInf1 = p2_rsvpRtr1.ipv4_interfaces.ipv4interface(ipv4_name=p2_ip1.name,neighbor_ip = '21.21.21.1',enable_refresh_reduction = True, send_bundle = True)[-1]

#egress lsp port 2
p2_rsvpLspInf1 = p2_rsvpRtr1.lsp_ipv4_interfaces.lspipv4interface(ipv4_name=p2_lo1.name)[-1]
p2_rsvpLspInf1.p2p_egress_ipv4_lsps.name = "egress1"
p2_rsvpLspInf1.p2p_egress_ipv4_lsps.enable_fixed_label = True
# setting ipv4 explicit null label
p2_rsvpLspInf1.p2p_egress_ipv4_lsps.fixed_label_value = 0

#here we are creating 2 tunnels, each with 1 lsp(with default lsp_id = 1),to an egress endpoint 8.8.8.8.
#The 1st tunnel configured via DUT 10.10.10.1 and the 2nd one through different DUT 20.20.20.1
#The 1st tunnel is also configured to use a non zero traffic bandwidth by configuring token bucket rate

#port 1 ingress lsp 1
p1_rsvpLspInf1 = p1_rsvpRtr1.lsp_ipv4_interfaces.lspipv4interface(ipv4_name=p1_lo1.name)[-1]
p1_rsvpIngressLsp1 = p1_rsvpLspInf1.p2p_ingress_ipv4_lsps.p2pingressipv4lsp(remote_address = '8.8.8.8',name = "lsp1", tunnel_id = 1)[-1]
p1_rsvpIngressLsp1.tspec.token_bucket_rate = 100000
p1_rsvpIngressLsp1.tspec.peak_data_rate = 10000
p1_rsvpIngressLsp1.tspec.token_bucket_size = 10000
p1_rsvpIngressLsp1.session_attribute.auto_generate_session_name = False
p1_rsvpIngressLsp1.session_attribute.session_name = 'tunnel1'
p1_rsvpIngressLsp1.session_attribute.resource_affinities.exclude_any = 'F000'
p1_rsvpIngressLsp1.ero.choice = "auto"

#port 1 ingress lsp 2
p1_rsvpIngressLsp2 = p1_rsvpLspInf1.p2p_ingress_ipv4_lsps.p2pingressipv4lsp(remote_address = '8.8.8.8',name = "lsp2",tunnel_id = 2)[-1]
p1_rsvpIngressLsp2.ero.prepend_neighbor_ip = 'prepend_strict'
p1_rsvpIngressLsp2.session_attribute.resource_affinities.include_any = '7000000A'
p1_rsvpIngressLsp2.ero.choice = "manual"
p1_rsvpIngressLsp2.ero.prepend_neighbor_ip = 'dont_prepend'
p1_rsvpIngressLsp2.ero.subobjects.subobject(ipv4_address = '12.12.12.1')[-1]

print(config.serialize())
{
  "devices": [
    {
      "ethernets": [
        {
          "connection": {
            "choice": "port_name",
            "port_name": "p1"
          },
          "ipv4_addresses": [
            {
              "address": "20.20.20.2",
              "gateway": "20.20.20.1",
              "name": "p1_ip1",
              "prefix": 24
            }
          ],
          "mac": "00:11:00:00:00:01",
          "mtu": 1500,
          "name": "p1_eth1"
        }
      ],
      "ipv4_loopbacks": [
        {
          "address": "7.7.7.7",
          "eth_name": "p1_eth1",
          "name": "p1_lo1"
        }
      ],
      "name": "p1_d1",
      "rsvp": {
        "ipv4_interfaces": [
          {
            "bundle_threshold": 50,
            "enable_hello": false,
            "enable_refresh_reduction": true,
            "hello_interval": 9,
            "ipv4_name": "p1_ip1",
            "label_space_end": 100000,
            "label_space_start": 1000,
            "neighbor_ip": "20.20.20.1",
            "send_bundle": true,
            "summary_refresh_interval": 30,
            "timeout_multiplier": 3
          }
        ],
        "lsp_ipv4_interfaces": [
          {
            "ipv4_name": "p1_lo1",
            "p2p_ingress_ipv4_lsps": [
              {
                "backup_lsp_id": 2,
                "ero": {
                  "choice": "auto",
                  "prefix_length": 32,
                  "prepend_neighbor_ip": "prepend_loose"
                },
                "lsp_id": 1,
                "lsp_switchover_delay": 0,
                "name": "lsp1",
                "refresh_interval": 30,
                "remote_address": "8.8.8.8",
                "session_attribute": {
                  "auto_generate_session_name": false,
                  "bandwidth_protection_desired": false,
                  "holding_priority": 7,
                  "label_recording_desired": false,
                  "local_protection_desired": false,
                  "node_protection_desired": false,
                  "resource_affinities": {
                    "exclude_any": "F000",
                    "include_all": "0",
                    "include_any": "0"
                  },
                  "se_style_desired": false,
                  "session_name": "tunnel1",
                  "setup_priority": 7
                },
                "timeout_multiplier": 3,
                "tspec": {
                  "maximum_policed_unit": 0,
                  "minimum_policed_unit": 0,
                  "peak_data_rate": 10000,
                  "token_bucket_rate": 100000,
                  "token_bucket_size": 10000
                },
                "tunnel_id": 1
              },
              {
                "backup_lsp_id": 2,
                "ero": {
                  "choice": "manual",
                  "prefix_length": 32,
                  "prepend_neighbor_ip": "dont_prepend",
                  "subobjects": [
                    {
                      "as_number": 0,
                      "hop_type": "loose",
                      "ipv4_address": "12.12.12.1",
                      "prefix_length": 32,
                      "type": "ipv4"
                    }
                  ]
                },
                "lsp_id": 1,
                "lsp_switchover_delay": 0,
                "name": "lsp2",
                "refresh_interval": 30,
                "remote_address": "8.8.8.8",
                "session_attribute": {
                  "auto_generate_session_name": true,
                  "bandwidth_protection_desired": false,
                  "holding_priority": 7,
                  "label_recording_desired": false,
                  "local_protection_desired": false,
                  "node_protection_desired": false,
                  "resource_affinities": {
                    "exclude_any": "0",
                    "include_all": "0",
                    "include_any": "7000000A"
                  },
                  "se_style_desired": false,
                  "setup_priority": 7
                },
                "timeout_multiplier": 3,
                "tunnel_id": 2
              }
            ]
          }
        ],
        "name": "p1_d1_rsvp"
      }
    },
    {
      "ethernets": [
        {
          "connection": {
            "choice": "port_name",
            "port_name": "p2"
          },
          "ipv4_addresses": [
            {
              "address": "30.30.30.2",
              "gateway": "30.30.30.1",
              "name": "p2_ip1",
              "prefix": 24
            }
          ],
          "mac": "00:12:00:00:00:01",
          "mtu": 1500,
          "name": "p2_eth1"
        }
      ],
      "ipv4_loopbacks": [
        {
          "address": "8.8.8.8",
          "eth_name": "p2_eth1",
          "name": "p2_lo1"
        }
      ],
      "name": "p2_d1",
      "rsvp": {
        "ipv4_interfaces": [
          {
            "bundle_threshold": 50,
            "enable_hello": false,
            "enable_refresh_reduction": true,
            "hello_interval": 9,
            "ipv4_name": "p2_ip1",
            "label_space_end": 100000,
            "label_space_start": 1000,
            "neighbor_ip": "21.21.21.1",
            "send_bundle": true,
            "summary_refresh_interval": 30,
            "timeout_multiplier": 3
          }
        ],
        "lsp_ipv4_interfaces": [
          {
            "ipv4_name": "p2_lo1",
            "p2p_egress_ipv4_lsps": {
              "enable_fixed_label": true,
              "fixed_label_value": 0,
              "name": "egress1",
              "refresh_interval": 30,
              "reservation_style": "shared_explicit",
              "timeout_multiplier": 3
            }
          }
        ],
        "name": "p2_d1_rsvp"
      }
    }
  ],
  "ports": [
    {
      "location": "172.17.0.2:50071",
      "name": "p1"
    },
    {
      "location": "172.17.0.3:50071",
      "name": "p2"
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants