Skip to content

GitLab

  • Menu
项目 Groups 代码片段
    • 正在加载...
  • 帮助
    • 帮助
    • 支持
    • 社区论坛
    • 提交反馈
  • 登录/注册
  • P p4-learning
  • Project information
    • Project information
    • 动态
    • 标记
    • 成员
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • 议题 0
    • 议题 0
    • 列表
    • 看板
    • 服务台
    • 里程碑
  • 合并请求 0
    • 合并请求 0
  • CI/CD
    • CI/CD
    • 流水线
    • 作业
    • 计划
  • Deployments
    • Deployments
    • 环境
    • 发布
  • Monitor
    • Monitor
    • 事件
  • 软件包与镜像库
    • 软件包与镜像库
    • 软件包注册表
    • Infrastructure Registry
  • 分析
    • 分析
    • CI/CD
    • 仓库
    • Value stream
  • Wiki
    • Wiki
  • 代码片段
    • 代码片段
  • 动态
  • 分支图
  • 创建新议题
  • 作业
  • 提交
  • 议题看板
收起侧边栏
  • p4git
  • p4-learning
  • Wiki
  • Control Plane

Control Plane · 变更

页面历史
Updated Control Plane (markdown) 编辑于 7月 23, 2021 作者: Jurij Nota's avatar Jurij Nota
Hide whitespace changes
Inline Side-by-side
Showing with 11 addition and 15 deletion
+11 -15
  • Control-Plane.md Control-Plane.md +11 -15
  • 未找到文件。
Control-Plane.md
查看页面@ 01a2e917
......@@ -12,17 +12,14 @@ To get the switch CLI simply run:
simple_switch_CLI --thrift-port <port>
```
The CLI connect to the Thrift RPC server running in each switch process.
9090 is the default value but of course if you are running several devices
on your machine, you will need to provide a different port for each.
One CLI instance can only connect to one switch device.
The CLI connect to the *Thrift* server running in each switch process. `9090` is the default value but of course if you are running several devices on your machine, you will need to provide a different port for each. One CLI instance can only connect to one switch device.
#### Filling tables
The most used commands to modify table contents are:
The most used commands to modify table contents are the following.
* table_set_default <table_name> <action_name> <action_parameters>
* table_add <table_name> <action_name> <match_fields> => <action_parameters>
- `table_set_default <table_name> <action_name> <action_parameters>` is used to set the default action (i.e. the action executed when no match is found) of a table.
- `table_add <table_name> <action_name> <match_fields> => <action_parameters>` is used to set the action related to a specific match in a table.
For example if we have the following table:
......@@ -58,7 +55,7 @@ The first command would set the default action, and action parameters (none in t
using the `table_name` table if there is no match, the drop action will be called.
In the second example command adds an entry that matches if the `standard_metadata.ingress_port` is equal to 1 and executes the
action `action_name` with `action_parameter` set to 5.
action `action_name` with `action_parameter` set to `5`.
#### Writing the CLI input in a file
......@@ -68,10 +65,10 @@ You can also populate the table writing the commands directly in a text file and
simple_switch_CLI --thrift-port <port> < command_file.txt
```
#### Using P4 utils configuration file
#### Using *P4-Utils* configuration file
Alternatively, you can use the p4-utils configuration file (i.e `p4app.json`) to set a `cli` configuration
file for each switch. When creating the topology, or rebooting switches, p4-utils will automatically use
Alternatively, you can use the *P4-Utils* configuration file (i.e `p4app.json`) to set a `cli` configuration
file for each switch. When creating the topology, or rebooting switches, *P4-Utils* will automatically use
the file to populate and configure switches.
To set default `cli` configuration files you need to define your switches like:
......@@ -84,10 +81,9 @@ To set default `cli` configuration files you need to define your switches like:
}
```
You can find all the documentation about `p4app.json` in the `p4-utils` [documentation](https://github.com/nsg-ethz/p4-utils#topology-description).
You can find all the documentation about `p4app.json` in the [*P4-Utils* documentation](https://github.com/nsg-ethz/p4-utils#topology-description).
### P4 Utils Control Plane API
### *P4-Utils* Control Plane API
You can find a wrapper of the Control Plane CLI as one of the features of p4-utils. It basically allows you to do the same but instead of using text sent to
the CLI you can use the power of a scripting language such as python. You can read more about this API [here](https://github.com/nsg-ethz/p4-utils#control-plane-api).
\ No newline at end of file
You can find a wrapper of the Control Plane CLI as one of the features of p4-utils. It basically allows you to do the same but instead of using text sent to the CLI you can use the power of a scripting language such as python. You can read more about this API [here](https://github.com/nsg-ethz/p4-utils#control-plane-api).
\ No newline at end of file
克隆仓库
  • BMv2 Simple Switch
  • Control Plane
  • Debugging and Troubleshooting
  • FAQ
  • Getting Started
  • Home
  • Migrate to the new version
  • Scapy
  • Useful Scripts

沪ICP备19002739号