如何使用Postman控制ODL查看和下发流表(流表格式为JSON)
来源:互联网 发布:cfree软件 编辑:程序博客网 时间:2024/05/16 09:49
如何使用Postman控制ODL查看和下发流表
准备工作
Chrome浏览器安装Postman插件。
OpenDaylight (版本Boron-SR2)启动完毕,并安装好需要的插件
使用mininet创建网络拓扑:
sudo mn –controller=remote,ip=127.0.0.1 –topo linear,2
补充:
sudo mn –switch ovs,protocol=OpenFlow13 –controller=remote,ip=127.0.0.1,port=6653
使用该命令创建网络拓扑时,由于没有指定拓扑的结构,使用pingall命令时,无法进行通信。
下发流表:
URI:http://127.0.0.1:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/flow-node-inventory:table/0
选择“PUT”方法。
{ "table": [ { "id": "0", "flow": [ { "id": "0", "match": { "in-port": "1", "vlan-match": { "vlan-id": { "vlan-id-present": "true", "vlan-id": "20" } } }, "instructions": { "instruction": [ { "apply-actions": { "action": [ { "output-action": { "output-node-connector": "3", "max-length": "65535" }, "order": "1" }, { "pop-vlan-action": {}, "order": "0" } ] }, "order": "0" } ] }, "buffer_id": "65535", "installHw": "true", "barrier": "true", "strict": "true", "priority": "160", "idle-timeout": "0", "hard-timeout": "0", "table_id": "0" } ] } ]}
点击”Send”发送。
Postman返回的Http Status code信息:
查看OVS上流表是否添加成功:
输入查看流表信息的命令:
I:ovs-ofctl dump-flows s1
II:在web浏览器中输入:http://192.168.1.157:8181/restconf/operational/opendaylight-inventory:nodes
其中flow_id字段发生了变化,并非之前设定的值10。
再下发一条流表项:
Authorization
Type:Basic Auth
Headers:
Content-Type:application/json
Accept:application/json
Authorization:Basic
Body:
raw
JSON(application/json)
{ "table":[ { "id":"0", "flow":[ { "id":"0x13", "match":{ "ethernet-match": { "ethernet-type": { "type":2048 } } }, "instructions": { "instruction": { "apply-actions": { "action": [ { "dec-nw-ttl": { }, "order": "1" } ] }, "order": "0" } }, "buffer_id": "6553", "installHw": "true", "barrier": "true", "strict": "true", "priority": "164", "idle-timeout": "0", "hard-timeout": "0", "table_id": "0" } ] } ]}
在OVS中查看添加上的流表项:
流表已经添加成功!但是之前添加的流表项被覆盖掉了,原因未知!
参考资料:
http://www.sdnlab.com/16824.html
http://www.sdnlab.com/15173.html
- 如何使用Postman控制ODL查看和下发流表(流表格式为JSON)
- 如何用postman控制ODL设置端口的QoS, 并下发流表到交换机做限速配置
- 使用ONOS的REST API来下发流表
- SDN启蒙(1):Floodlight下发流表过程分析
- Floodlight下发流表过程分析
- 使用postman和editthiscookies
- springboot开发中使用postman 向后台传递json数据的时候,为空
- 如何高效的使用postman
- 使用jquery和json动态添加表格
- SDN启蒙(2):Floodlight 启动及下发流表流程分析
- Floodlight 启动及下发流表流程分析
- Java解析Excel表格(支持xls和xlsx格式),并转换为Json数据
- GOOGLE Gadgets 处理远程内容,如何提取和控制远程文本(通常为 HTML)、XML、JSON 和 RSS/Atom 供稿数据。
- postMan介绍和使用小结
- Postman下载安装和使用
- postman使用学习和总结
- postman测试post请求参数为json类型
- 【技能库】--postman json 请求(192)
- Tarjan 有向图
- JS关于Object定义的两种方式
- 动态规划测试3(test20170406)
- 产生数
- numpy通用函数之四则运算
- 如何使用Postman控制ODL查看和下发流表(流表格式为JSON)
- mongodb性能调优
- Redis-3.2.8的简易安装和主从配置
- 欢迎使用CSDN-markdown编辑器
- 修改Ubuntu终端提示 前缀
- 最小费用流的zkw算法
- 三羊献瑞
- Android Studio 官网教程
- Hibernate学习笔记(第一天)