在 mininet-dashboard 中处理流记录

Handle flow records in mininet-dashboard

我正在尝试检测 mininet-dashboard 中的流量记录。 Elephant.js 文件:

setFlow('pair',
{'keys':'inputifindex,ipsource,ipdestination','value':'bytes','log':'true','activeTimeout':'2'});

setThreshold('elephant',
 {'metric':'pair','value':1000000/8,'byFlow':true,'timeout':1});

setEventHandler(function(evt) {
 var [inputifindex,ipsource,ipdestination] = evt.flowKey.split(',');
 var {node,port} = topologyInterfaceToPort(evt.agent,inputifindex);
 logInfo(port + " " + ipsource + " " + ipdestination);
},['elephant']);

setFlowHandler(function(flow) {
  logInfo(JSON.stringify(flow));
});

但是当我 运行 iperf h1 h2 时,我在控制台中没有得到任何关于流的信息。但我在 mininet-dashboard 应用程序中看到了这个流程。如何正确获取有关流的信息并登录到控制台?

我的拓扑结构:

sudo mn --custom extras/sflow.py --topo tree,depth=1,fanout=2 --controller remote --switch ovsk,protocols=OpenFlow13

你好吗defining flows?您需要在流程定义中设置 log=true 才能生成流程记录。此外,设置 activeTimeout 以限制接收流记录之前的延迟,或者设置 flowStart=true 如果您想要立即通知并且不不关心流量计数器值。