简体   繁体   English

带有POX的mininet:使用flow_mod时获取事件

[英]mininet with POX: get event when flow_mod is used

I am not sure I understand mininet and POX well so my question might be stupid, 我不确定我对mininetPOX理解mininet很好,所以我的问题可能很愚蠢,
However, I want to know when packets are forwarded by flow_mod rule. 但是,我想知道何时通过flow_mod规则转发数据包。

I don't want to send all the packets to the controller because they might be big so I use flow_mods , but I do want to know that a packet was sent on the specific link and its size (I don't need the data itself, only this metadata) 我不想将所有数据包发送到控制器,因为它们可能很大,所以我使用flow_mods ,但是我想知道某个数据包是在特定链接上发送的,并且它的大小是(我不需要数据本身,仅此元数据)
it can be metadata for several packets together, like a summery each 10 seconds for example. 它可以是几个数据包在一起的元数据,例如每10秒钟的夏天。

Is there a way to do it or I have to send the packets to the controller and gather the statistics myself ? 有没有办法做到这一点,或者我必须将数据包发送到控制器并自己收集统计信息?

Thanks. 谢谢。

You can get write a python script and run it with pox for example, you write a script statistics.py , you can run it with pox using the command ./pox.py forwarding.l2_learning statistics assuming that statistics.py is placed in the same folder. 您可以编写一个python脚本并使用pox运行它,例如,编写一个脚本statistics.py ,并可以使用命令./pox.py forwarding.l2_learning statistics来运行pox, ./pox.py forwarding.l2_learning statistics是假定statistics.py位于同一文件夹。

In the script, you can ping the switches with a Flow level statistics request every 10 seconds. 在脚本中,您可以每隔10秒对具有流量级别统计信息请求的交换机执行ping操作。 You can find a tutorial on achieving the desired result here . 您可以在此处找到有关实现所需结果的教程。

By default though, only the first packet of a flow invokes a flow_mod message. 但是,默认情况下,仅流的第一个数据包会调用flow_mod消息。 You can print the details of the packet by altering your forwarding.l2_learning . 您可以通过改变您的打印数据包的细节forwarding.l2_learning

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM