routes - How to handle invalid TTL packets with flow mods? RYU OpenFlow 1.3
问题描述
I want to forward packets with invalid TTL to the controller. Is there any way to set a flow mod for that?
解决方案
答案是肯定的,你可以做到。根据这个 Ryu 控制器文档页面,您可以在您的 sdn 应用程序的 packet_in_handler 函数中获取具有无效 TTL 的数据包:
@set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
def packet_in_handler(self, ev):
msg = ev.msg
dp = msg.datapath
ofp = dp.ofproto
if msg.reason == ofp.OFPR_NO_MATCH:
reason = 'NO MATCH'
elif msg.reason == ofp.OFPR_ACTION:
reason = 'ACTION'
elif msg.reason == ofp.OFPR_INVALID_TTL:
reason = 'INVALID TTL'
else:
reason = 'unknown'
self.logger.debug('OFPPacketIn received: '
'buffer_id=%x total_len=%d reason=%s '
'table_id=%d cookie=%d match=%s data=%s',
msg.buffer_id, msg.total_len, reason,
msg.table_id, msg.cookie, msg.match,
utils.hex_array(msg.data))
有关 OpenFlow 的更多信息,Packet_in 消息请阅读OpenFlow 规范 1.3。
推荐阅读
- angular - Jhipster 启动非常慢 - 启动空白引导应用程序需要 2 小时
- python - 使用 Pandas(Python) 从 Google Drive 读取非常大的 csv 文件
- sql - 如何在sql中找到count的最大值和最小值
- javascript - 如何在 Selenium Webdriver Javascript 中保存为网页?
- flutter - Flutter - 如何在多个地方重用一些代码
- elasticsearch - 如何在弹性搜索中匹配两个索引之间的数据
- amazon-web-services - 如何引用 AWS CDK 中的现有 VPC 终端节点?
- syntax-error - Pine 脚本问题第 10 行:输入“行尾没有续行”时出现语法错误
- python - Python PIP 卡在已卸载的 python 版本中
- angular - ngx-admin NbDummyAuthStrategy 登录后重定向