sdn - Project Floodlight - 侦听 openflow 消息
问题描述
我正在使用项目 Floodlight 来了解我个人项目的软件定义网络。我的自定义模块使用 FloodlightProvider 控制器模块和 IOFMessageListener 来监听 openflow 消息。我可以成功收听 PACKET_IN openflow 消息,但是我无法收听任何同步的 openflow 消息(HELLO、EQHO_REQUEST 等)。我按照文档进行了操作,如果我没记错的话,可以使用 FloodlightProvider 控制器模块来监听 openflow 消息。任何人都可以帮助我,因为我很好奇。监听消息的程序在“如何编写模块”下的 Floodlight 教程中给出。但是,我正在编辑启动方法和接收方法。这些如下:
@Override
public void startUp(FloodlightModuleContext context) {
floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this);
floodlightProvider.addOFMessageListener(OFType.HELLO, this);
}
@Override
public net.floodlightcontroller.core.IListener.Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
switch(msg.getType()){
case PACKET_IN:
// print the openflow message in console
break;
case HELLO:
// print the openflow message in console
break;
default:
break;
}
return Command.CONTINUE;
}
解决方案
推荐阅读
- javascript - 将javascript值传递给jsp
- r - 如何使用变量 contentType 实现 R Shiny downloadHandler?
- python - 在 VSCode 中运行任何 Python 脚本的“&”语法错误?
- amazon-web-services - AWS Windows Server 托管:80 以外的端口不起作用
- c++ - 什么更快?对 int 取模,还是将 int 除以 MAX_INT 得到浮点数,然后乘以所需的模值并转换回 int?
- java - 有没有办法在类中声明泛型类型并将其与方法中的泛型参数一起使用?
- javascript - 为什么 (-2.4492935982947064e-16).toFixed(5) 等于“-0.00000”?
- javascript - 如何使用 npm 发布客户端脚本?
- c++ - 将堆栈对象等同于对象C ++中的另一个对象
- python - 在 Django 中访问本地 html 文件