-
Notifications
You must be signed in to change notification settings - Fork 23
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
Tunnel Termination ACL VPP Plugin #114
Open
AkeelAli
wants to merge
9
commits into
sonic-net:main
Choose a base branch
from
yue-fred-gao:tunterm_acl_plugin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
32f5e00
First Version of VPP Tunnel Termination Plugin
AkeelAli 1ce65b3
Add UT
AkeelAli f9f7d45
Add Tunterm ACL Plugin documentation + Cleanup
AkeelAli 58a8236
Merge branch 'main' into tunterm_acl_plugin
AkeelAli 935bb79
Move plugins to vppbld
AkeelAli dfcca0f
Bug fixes + README update
AkeelAli b9a4ec7
Add missing newline in README.rst
AkeelAli 97b8360
Merge branch 'main' into tunterm_acl_plugin
AkeelAli aefb387
Classification and Formatting changes
AkeelAli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) 2024 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. | ||
|
||
include_directories(${CMAKE_SOURCE_DIR}) | ||
|
||
# for generated API headers: | ||
include_directories(${CMAKE_BINARY_DIR}) | ||
|
||
add_vpp_plugin(tunterm_acl | ||
SOURCES | ||
tunterm_acl_api.c | ||
tunterm_acl_cli.c | ||
tunterm_acl_decap.c | ||
tunterm_acl_redirect.c | ||
tunterm_acl_node.c | ||
|
||
API_FILES | ||
tunterm_acl.api | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
name: Tunnel Termination ACL | ||
maintainer: Akeel Ali <[email protected]> | ||
features: | ||
- Applies ACL after Tunnel Decap | ||
- Current support is limited to a specific use-case | ||
- Tunnel: IPv4 VxLAN Tunnel Termination | ||
- Fields: DST IPv4/6 Classification | ||
- Action: Redirect (ip4/6-rewrite) | ||
description: "Tunnel Termination ACL plugin" | ||
state: experimental | ||
properties: [CLI, API] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
======================= | ||
Tunterm ACL Plugin README | ||
======================= | ||
|
||
Overview | ||
-------- | ||
The Tunterm ACL plugin is a self-contained plugin that applies ACL after Tunnel Decapsulation. | ||
|
||
It is currently designed to support a single specific use-case: | ||
|
||
IPv4 VxLAN tunnel termination and classification based on inner DST IPv4/6 fields, followed by a redirect action using ip4/6-rewrite. | ||
|
||
Plugin API | ||
---------- | ||
The Tunterm ACL plugin provides an API similar to the acl plugin API: | ||
|
||
1. `tunterm_acl_add_replace`: Create or replace an existing tunterm acl in-place. | ||
|
||
2. `tunterm_acl_del`: Delete a tunterm acl. | ||
|
||
3. `tunterm_acl_interface_add_del`: Add/remove a tunterm acl index to/from an interface. | ||
|
||
Plugin Structure | ||
---------------- | ||
The Tunterm ACL plugin consists of the following main parts: | ||
|
||
1. `tunterm_acl.api/tunterm_acl_api.c`: This file contains the tunterm-acl ACL API and handlers to setup and attach the classifier/sessions using an ACL-like API. | ||
|
||
2. `tunterm_acl_node.c`: This file contains the tunterm-acl node that performs the classification and redirect logic. Please note that at this point, there are no performance considerations implemented. | ||
|
||
3. `tunterm_acl_decap.c`: This file is a copy of the ip4-vxlan-bypass node, but instead of forwarding to vxlan4-input, it forwards to tunterm-acl. | ||
|
||
4. `tunterm_acl_redirect.c`: This file is a copy of the ip-session-redirect functions, augmented with additional functionality required for the plugin. | ||
|
||
5. `tunterm_acl_cli.c`: This file provides CLI capability, allowing you to see which interfaces have tunterm-acl enabled. | ||
|
||
6. `test_tunterm_acl.py`: This file contains unit tests that cover various positive and negative use-cases. | ||
|
||
Requirements | ||
------------ | ||
In order to use the Tunterm ACL plugin, the `vxlan_main` structure from the `vxlan` plugin must be exported: | ||
|
||
.. code-block:: c | ||
|
||
__clib_export vxlan_main_t vxlan_main; | ||
|
||
Functionality | ||
------------- | ||
The plugin introduces the following nodes and functionality: | ||
|
||
.. image:: tunterm_acl.png | ||
:target: tunterm_acl.png | ||
|
||
Enhancements | ||
----------------------------- | ||
Following are some enhancements that can be made to the plugin: | ||
|
||
1. Add multi-path redirect support | ||
|
||
2. Add multi-v4/v6 tunterm ACL support on a single interface | ||
|
||
3. Add VPP performance optimizations to tunterm-acl node | ||
|
||
4. Add v6 outer vxlan bypass support | ||
|
||
5. Expose tunterm-acl stats via API |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any limitation on the redirect action (redirect to NH IP only, IP has to be in default VRF, etc)? If yes, let's put them here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarified that this is a redirect via a VPP Fib path (as declared in the API using vl_api_fib_path_t)