利用Mininet平台搭建下图所示网络拓扑,并连接OpenDaylight控制器
通过Postman工具调用OpenDaylight提供的下发流表,实现拓扑内主机h1和h3网络中断10s
- Postman 清除旧的流规则
DELETE http://127.0.0.1:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/
- 先在Mininet CLl中运行h1 ping h3,再在Postman处选择动作PUT
PUT http://127.0.0.1:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/flow-node-inventory:table/0/flow/1
{
"flow": [
{
"id": "1",
"match": {
"in-port": "1",
"ethernet-match": {
"ethernet-type": {
"type": "0x0800"
}
},
"ipv4-destination": "10.0.0.3/32"
},
"instructions": {
"instruction": [
{
"order": "0",
"apply-actions": {
"action": [
{
"order": "0",
"drop-action": {}
}
]
}
}
]
},
"flow-name": "flow1",
"priority": "65535",
"hard-timeout": "10",
"cookie": "2",
"table_id": "0"
}
]
}
运行结果