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

Feat(eos_cli_config_gen): Add support for mpls tunnel termination settings #4888

Open
wants to merge 5 commits into
base: devel
Choose a base branch
from

Conversation

ccsnw
Copy link
Contributor

@ccsnw ccsnw commented Jan 16, 2025

Change Summary

Add knobs to configure tunnel termination settings for MPLS

Related Issue(s)

Fixes #<N/A>

Component(s) name

arista.avd.eos_cli_config_gen

Proposed changes

  tunnel:
    description: Configure tunnel termination model.
    type: dict
    keys:
      termination_model:
        type: str
        description: |
          TTL and DSCP configuration as a string.
          Example:
          - "ttl pipe dscp pipe"
        valid_values:
          - "ttl pipe dscp pipe"
          - "ttl uniform dscp pipe"
          - "ttl uniform dscp uniform"
      termination_php_model:
        type: str
        description: |
          TTL and DSCP configuration as a string.
          Example:
          - "ttl pipe dscp pipe"
        valid_values:
          - "ttl pipe dscp pipe"
          - "ttl uniform dscp pipe"

How to test

added molecule test
cli command order was tested on EOS 4.30.5 - Please let me know if newer version sort differently

Checklist

User Checklist

  • N/A

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

@ccsnw ccsnw requested review from a team as code owners January 16, 2025 09:47
Copy link

Review docs on Read the Docs

To test this pull request:

# Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-4888
# Activate the virtual environment
source test-avd-pr-4888/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/ccsnw/ansible-avd.git@add_mpls_tunnel_termination#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/ccsnw/ansible-avd.git#/ansible_collections/arista/avd/,add_mpls_tunnel_termination --force
# Optional: Install AVD examples
cd test-avd-pr-4888
ansible-playbook arista.avd.install_examples

@github-actions github-actions bot added role: eos_cli_config_gen issue related to eos_cli_config_gen role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated labels Jan 16, 2025
@Vibhu-gslab Vibhu-gslab force-pushed the add_mpls_tunnel_termination branch from 361877d to 2a534aa Compare January 20, 2025 10:49
@ccsnw ccsnw force-pushed the add_mpls_tunnel_termination branch from 363a696 to ad6a3c4 Compare January 21, 2025 07:36
@gmuloc gmuloc added the one approval This PR has one approval and is only missing one more. label Jan 22, 2025
Copy link
Contributor

@ClausHolbechArista ClausHolbechArista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like a more elaborate data model instead of all these valid values in a multi-word string. I do not know the CLI here in detail, so @ccsnw if you could provide a suggestion, we can take a look. Otherwise we can investigate more and get back.

@ccsnw
Copy link
Contributor Author

ccsnw commented Jan 23, 2025

I would like a more elaborate data model instead of all these valid values in a multi-word string. I do not know the CLI here in detail, so @ccsnw if you could provide a suggestion, we can take a look. Otherwise we can investigate more and get back.

Hi @ClausHolbechArista

Not an expert on that CLI either. Colleagues are needing it on some WAN routers.

But I noticed that the modes (php vs no php) are not mutually exclusive, so we can have sth like:

mpls tunnel termination model ttl pipe dscp pipe
mpls tunnel termination php model ttl pipe dscp pipe

in the same config.

Hence I'd suggest a model like this:

tunnel:
  termination:
    - php: < true | false >
      model:   
        ttl: < pipe | uniform >
        dscp: < pipe | uniform >

We can leave it up to the user to decide with model config makes sense (and actually is supported).

What do you think?

@gmuloc gmuloc requested a review from MaheshGSLAB January 24, 2025 08:43
@gmuloc gmuloc removed the one approval This PR has one approval and is only missing one more. label Jan 24, 2025
@alexeygorbunov
Copy link
Contributor

alexeygorbunov commented Jan 28, 2025

tunnel:
  termination:
    - php: < true | false >
      model:   
        ttl: < pipe | uniform >
        dscp: < pipe | uniform >

Or something explicit like this:

      tunnel:
        description: Configure MPLS tunnel.
        type: dict
        keys:
          termination:
            description: Controls selection of the TTL/DSCP values by LER when decapsulating MPLS packets.
            type: dict
            keys:
              model:
                type: dict
                keys:
                  ttl:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
                  dscp:
                    type: str
                    required: true
                    valid_values:
                      - pipe
              php_model:
                description: Used on PHP router in the absence of any VPN routes and explicit null VRF labels.
                type: dict
                keys:
                  ttl:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
                  dscp:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform

I was not able to identify any specific platforms which support dscp uniform when configuring mpls tunnel termination model ttl. I'll try to figure this out . If not - we may need to only permit pipe under mpls.tunnel.termination.model.dscp.

Update: I got a confirmation that dscp uniform mode is not supported in non-PHP use case.

@ccsnw
Copy link
Contributor Author

ccsnw commented Jan 29, 2025

tunnel:
  termination:
    - php: < true | false >
      model:   
        ttl: < pipe | uniform >
        dscp: < pipe | uniform >

Or something explicit like this:

      tunnel:
        description: Configure MPLS tunnel.
        type: dict
        keys:
          termination:
            description: Controls selection of the TTL/DSCP values by LER when decapsulating MPLS packets.
            type: dict
            keys:
              model:
                type: dict
                keys:
                  ttl:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
                  dscp:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform # support needs to be confirmed
              php_model:
                description: Used on PHP router in the absence of any VPN routes and explicit null VRF labels.
                type: dict
                keys:
                  ttl:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
                  dscp:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform

I was not able to identify any specific platforms which support dscp uniform when configuring mpls tunnel termination model ttl. I'll try to figure this out . If not - we may need to only permit pipe under mpls.tunnel.termination.model.dscp.

Hi Alexey,

The explicit version also looks fine to me.

Regarding compatibility. Check this:

X(config-s-test)#mpls tunnel termination model ttl pipe dscp ?
  pipe     Preserve the inner value
  uniform  Propagate value from outer header

X(config-s-test)#mpls tunnel termination model ttl pipe dscp uniform
% ttl model pipe is not supported with dscp model uniform

X(config-s-test)#sh version
Arista DCS-7280CR2A-30-F
Hardware version: 21.00
<snip>
Software image version: 4.26.3M

On 4.26.3 the "dscp uniform" was suggested by eos, but couldn't be configured (not supported)

When i check on a newer EOS:

X(s1)(config-s-test)#mpls tunnel termination model ttl pipe dscp ?
  pipe  Preserve the inner value

X(s1)(config-s-test)#sh ver
Arista 7289-F
<snip>
Software image version: 4.31.4M

not suggesting dscp > uniform anymore.

@MaheshGSLAB
Copy link
Contributor

tunnel:
        description: Configure MPLS tunnel.
        type: dict
        keys:
          termination:
            description: Controls selection of the TTL/DSCP values by LER when decapsulating MPLS packets.
            type: dict
            keys:
              model:
                type: dict
                keys:
                  ttl:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
                  dscp:
                    type: str
                    required: true
                    valid_values:
                      - pipe
              php_model:
                description: Used on PHP router in the absence of any VPN routes and explicit null VRF labels.
                type: dict
                keys:
                  ttl:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
                  dscp:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
tunnel:
  termination:
    - php: < true | false >
      model:   
        ttl: < pipe | uniform >
        dscp: < pipe | uniform >

Or something explicit like this:

tunnel:
    description: Configure MPLS tunnel.
    type: dict
    keys:
      termination:
        description: Controls selection of the TTL/DSCP values by LER when decapsulating MPLS packets.
        type: dict
        keys:
          model:
            type: dict
            keys:
              ttl:
                type: str
                required: true
                valid_values:
                  - pipe
                  - uniform
              dscp:
                description: DSCP model `uniform` supported with ttl model `uniform` on some platforms.
                type: str
                required: true
                valid_values:
                  - pipe
                  - uniform
          php_model:
            description: Used on PHP router in the absence of any VPN routes and explicit null VRF labels.
            type: dict
            keys:
              ttl:
                type: str
                required: true
                valid_values:
                  - pipe
                  - uniform
              dscp:
                type: str
                required: true
                valid_values:
                  - pipe


    
      
    

      
    

    
  
I was not able to identify any specific platforms which support `dscp uniform` when configuring `mpls tunnel termination model ttl`. I'll try to figure this out . If not - we may need to only permit `pipe` under `mpls.tunnel.termination.model.dscp`.

Hi Alexey,

The explicit version also looks fine to me.

Regarding compatibility. Check this:

X(config-s-test)#mpls tunnel termination model ttl pipe dscp ?
  pipe     Preserve the inner value
  uniform  Propagate value from outer header

X(config-s-test)#mpls tunnel termination model ttl pipe dscp uniform
% ttl model pipe is not supported with dscp model uniform

X(config-s-test)#sh version
Arista DCS-7280CR2A-30-F
Hardware version: 21.00
<snip>
Software image version: 4.26.3M

On 4.26.3 the "dscp uniform" was suggested by eos, but couldn't be configured (not supported)

When i check on a newer EOS:

X(s1)(config-s-test)#mpls tunnel termination model ttl pipe dscp ?
  pipe  Preserve the inner value

X(s1)(config-s-test)#sh ver
Arista 7289-F
<snip>
Software image version: 4.31.4M

not suggesting dscp > uniform anymore.

Hi @alexeygorbunov and @ccsnw
Added minor changes.

  1. Added uniform as valid values in model dscp as command mpls tunnel termination model ttl uniform dscp uniform supported on some platforms.
  2. Removed uniform as valid value from php dscp model.
    tunnel:
        description: Configure MPLS tunnel.
        type: dict
        keys:
          termination:
            description: Controls selection of the TTL/DSCP values by LER when decapsulating MPLS packets.
            type: dict
            keys:
              model:
                type: dict
                keys:
                  ttl:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
                  dscp:
                    description: DSCP model `uniform` supported with ttl model `uniform` on some platforms.
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
              php_model:
                description: Used on PHP router in the absence of any VPN routes and explicit null VRF labels.
                type: dict
                keys:
                  ttl:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
                  dscp:
                    type: str
                    required: true
                    valid_values:
                      - pipe

@ccsnw
Copy link
Contributor Author

ccsnw commented Jan 30, 2025

tunnel:
        description: Configure MPLS tunnel.
        type: dict
        keys:
          termination:
            description: Controls selection of the TTL/DSCP values by LER when decapsulating MPLS packets.
            type: dict
            keys:
              model:
                type: dict
                keys:
                  ttl:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
                  dscp:
                    type: str
                    required: true
                    valid_values:
                      - pipe
              php_model:
                description: Used on PHP router in the absence of any VPN routes and explicit null VRF labels.
                type: dict
                keys:
                  ttl:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
                  dscp:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
tunnel:
  termination:
    - php: < true | false >
      model:   
        ttl: < pipe | uniform >
        dscp: < pipe | uniform >

Or something explicit like this:

tunnel:
    description: Configure MPLS tunnel.
    type: dict
    keys:
      termination:
        description: Controls selection of the TTL/DSCP values by LER when decapsulating MPLS packets.
        type: dict
        keys:
          model:
            type: dict
            keys:
              ttl:
                type: str
                required: true
                valid_values:
                  - pipe
                  - uniform
              dscp:
                description: DSCP model `uniform` supported with ttl model `uniform` on some platforms.
                type: str
                required: true
                valid_values:
                  - pipe
                  - uniform
          php_model:
            description: Used on PHP router in the absence of any VPN routes and explicit null VRF labels.
            type: dict
            keys:
              ttl:
                type: str
                required: true
                valid_values:
                  - pipe
                  - uniform
              dscp:
                type: str
                required: true
                valid_values:
                  - pipe


    
      
    

      
    

    
  
I was not able to identify any specific platforms which support `dscp uniform` when configuring `mpls tunnel termination model ttl`. I'll try to figure this out . If not - we may need to only permit `pipe` under `mpls.tunnel.termination.model.dscp`.

Hi Alexey,
The explicit version also looks fine to me.
Regarding compatibility. Check this:

X(config-s-test)#mpls tunnel termination model ttl pipe dscp ?
  pipe     Preserve the inner value
  uniform  Propagate value from outer header

X(config-s-test)#mpls tunnel termination model ttl pipe dscp uniform
% ttl model pipe is not supported with dscp model uniform

X(config-s-test)#sh version
Arista DCS-7280CR2A-30-F
Hardware version: 21.00
<snip>
Software image version: 4.26.3M

On 4.26.3 the "dscp uniform" was suggested by eos, but couldn't be configured (not supported)
When i check on a newer EOS:

X(s1)(config-s-test)#mpls tunnel termination model ttl pipe dscp ?
  pipe  Preserve the inner value

X(s1)(config-s-test)#sh ver
Arista 7289-F
<snip>
Software image version: 4.31.4M

not suggesting dscp > uniform anymore.

Hi @alexeygorbunov and @ccsnw Added minor changes.

  1. Added uniform as valid values in model dscp as command mpls tunnel termination model ttl uniform dscp uniform supported on some platforms.
  2. Removed uniform as valid value from php dscp model.
    tunnel:
        description: Configure MPLS tunnel.
        type: dict
        keys:
          termination:
            description: Controls selection of the TTL/DSCP values by LER when decapsulating MPLS packets.
            type: dict
            keys:
              model:
                type: dict
                keys:
                  ttl:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
                  dscp:
                    description: DSCP model `uniform` supported with ttl model `uniform` on some platforms.
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
              php_model:
                description: Used on PHP router in the absence of any VPN routes and explicit null VRF labels.
                type: dict
                keys:
                  ttl:
                    type: str
                    required: true
                    valid_values:
                      - pipe
                      - uniform
                  dscp:
                    type: str
                    required: true
                    valid_values:
                      - pipe

Sure! Is this final? Then I can redo the rest accordingly.

Thanks!!

@ccsnw ccsnw force-pushed the add_mpls_tunnel_termination branch from 903a8ed to 9b4a043 Compare January 30, 2025 15:40
@ccsnw
Copy link
Contributor Author

ccsnw commented Jan 30, 2025

@alexeygorbunov & @MaheshGSLAB

updated as discussed :-)

let me know if this looks ok or if more changes are needed!

@MaheshGSLAB
Copy link
Contributor

@alexeygorbunov & @MaheshGSLAB

updated as discussed :-)

let me know if this looks ok or if more changes are needed!

Since the DSCP uniform supported combinations depends on the hardware platform i requested some changes in description and valid values

@ccsnw ccsnw force-pushed the add_mpls_tunnel_termination branch from 2a48792 to 6d78c23 Compare February 5, 2025 09:14
Copy link

sonarqubecloud bot commented Feb 5, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
role: eos_cli_config_gen issue related to eos_cli_config_gen role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants