[Mark] openvswitch megaflow

Megaflow is an OpenVSwitch (OVS) feature than enables us to install flows for which some fields are wildcarded (the input port field is never wildcarded, as a totally wildcarded flow would be of little use). We do this by providing OVS with a flow mask upon creating a new flow. A mask is comprised of a subset of the flow‘s keys, where each field is either 0 or ~0, respectively specifying a wildcard or an exact match; the absence of a mask key is considered a total wildcard of all the fields in the flow‘s corresponding key.

We calculate the mask of a flow by keeping track throughout the simulation of which fields have contributed to that outcome and which have not. This last set of fields can be wildcarded while the previous requires an exact match. A field is considered seen, and thus an exact match in the flow mask, when we call the respective getter in the FlowMatch class. The mask is calculated by the FlowMask class and is triggered by the Flow class, before we serialize it to the datapath.

We don‘t store the flow mask in user space: flow deletion is done by specifying the flow‘s specific keys. The OVS module will apply all the masks it knows about to the specified flow and will remove all flows that match the result. This is also how flow lookup is performed. Note that the onus is on us to ensure we don‘t create overlapping, conflicting wildcarded flows: no guarantees are given as to which flow gets picked when different ones match an incoming packet.

We detect the version of the underlying OVS kernel module and suppress flow masks if megaflow is not supported.

时间: 2024-12-12 17:59:36

[Mark] openvswitch megaflow的相关文章

Openvswitch原理与代码分析(4):网络包的处理过程

? 在上一节提到,Openvswitch的内核模块openvswitch.ko会在网卡上注册一个函数netdev_frame_hook,每当有网络包到达网卡的时候,这个函数就会被调用. ? static struct sk_buff *netdev_frame_hook(struct sk_buff *skb) { ???if (unlikely(skb->pkt_type == PACKET_LOOPBACK)) ??????return skb; ? ???port_receive(skb)

Openvswitch手册(1)

Openvswitch是一个virutal swtich, 支持Open Flow协议,当然也有一些硬件Switch也支持Open Flow协议,他们都可以被统一的Controller管理,从而实现物理机和虚拟机的网络联通. Open Switch定义了一系列Flow Table,通过它来控制包的流向和结构. 根据Open Flow协议,Flow Table包含match field,如果匹配上了,则执行Action. 其中Match Field涵盖TCP/IP协议各层: Layer 1 – T

追踪openvswitch对特定数据报文的流表匹配与处理结果的实例

SDN环境中,每一个openvswitch的datapath实例中都会有大量的流表项,无论是使用各种关键字的grep手段或者是其他方法来确认是否由控制器下发了预期正确流表项,还是看关于特定数据包的匹配与最终action都是一件非常繁琐和头疼的事情.使用ovs-appctl工具结合linux自带的tcpdump抓包工具就可以很轻松直观的最终流表匹配情况,来完成自己繁琐的查找工作,还能避免自己的判断的错误. ?? 主要步骤如下:? ? 1.确认你需要跟踪的数据包的各项参数: ? ? 2.将其转化成o

Openvswitch手册(1): 架构,SSL, Manager, Bridge

Openvswitch是一个virutal swtich, 支持Open Flow协议,当然也有一些硬件Switch也支持Open Flow协议,他们都可以被统一的Controller管理,从而实现物理机和虚拟机的网络联通. Open Switch定义了一系列Flow Table,通过它来控制包的流向和结构. 根据Open Flow协议,Flow Table包含match field,如果匹配上了,则执行Action. 其中Match Field涵盖TCP/IP协议各层: Layer 1 – T

OpenvSwitch 流表转换

推荐看一下这篇文章,讲述了各个流表,我们这里着重讲流程和代码,对流表不再细说. 我们主要的关注点还是OVS-DPDK的流表转换,其实和OVS的转换差不多,只不过OVS的Datapath流表位于kernel,报文在Datapath找不到流表即通过netlink上传到Userspace,而OVS-DPDK则是Datapath流表依然位于Userspace,可以看做是一个缓存.查找不到的话直接继续调用其他接口查找Userspace的流表. controller会根据网络情况给ovs下发流表,或者命令o

swift pragma mark

众所周知,大家在OC中对代码进行逻辑组织 用的是#pragma mark - ,生成分隔线 用#pragma mark 函数说明,来生成一个函数的说明X 但在swift中,这个语法就不支持了,毕竟它是属于C的语法,于是就有了新的一些语法,如:// MARK: // FIXME // TODO: 等 // MARK: - 生成分隔线 // MARK: 说明 别忘了那个冒号... 参考 :http://stackoverflow.com/questions/24017316/pragma-mark-

openstack使用openvswitch实现vxlan组网

 openstack使用openvswitch实现vxlan openstack环境: 1 版本:ocata 2 系统:ubuntu16.04.2 3 控制节点 1个 + 计算节点 1个 4 控制节点网卡为ens33,ip = 172.171.5.200 ens34 manual模式 无IP 一 下载openswitch controller : apt-get install  neutron-openvswitch-agent compute : apt-get install neutro

洛谷P3112 [USACO14DEC]后卫马克Guard Mark

题目描述 Farmer John and his herd are playing frisbee. Bessie throws the frisbee down the field, but it's going straight to Mark the field hand on the other team! Mark has height H (1 <= H <= 1,000,000,000), but there are N cows on Bessie's team gathere

Openvswitch原理与代码分析(7): 添加一条流表flow

添加一个flow,调用的命令为 ovs-ofctl add-flow hello "hard_timeout=0 idle_timeout=0 priority=1 table=21 pkt_mark=0x55 tun_id=0x55 actions=mod_nw_dst:192.168.56.101,output:2" 这里调用的是调用ovs/utilities/ovs-ofctl.c的命令行工具 这个命令行工具支持的所有的命令及处理函数定义如下: static const stru