openvswtich手册

上传人:第*** 文档编号:61701432 上传时间:2018-12-10 格式:PDF 页数:138 大小:5.17MB
返回 下载 相关 举报
openvswtich手册_第1页
第1页 / 共138页
openvswtich手册_第2页
第2页 / 共138页
openvswtich手册_第3页
第3页 / 共138页
openvswtich手册_第4页
第4页 / 共138页
openvswtich手册_第5页
第5页 / 共138页
点击查看更多>>
资源描述

《openvswtich手册》由会员分享,可在线阅读,更多相关《openvswtich手册(138页珍藏版)》请在金锄头文库上搜索。

1、Openvswitch Popsuper Software Defined NetworkSoftware Defined Network CPU Pool Storage Pool Virtual Infrastructure OpenFlowOpenFlow Switch Switch ComponentsComponents OpenFlow Channel负责同Controller的交互 Flow Table包含许多entry,每个entry是对packet 进行处理的规则 Group Table:处理更复杂的转发规则 包含一系列Group Entry 每个Entry包含一系列操作集合

2、(action buckets) 每个操作集合包含一系列action,以及参数 Match packets: ingress port Headers metadata Flow entries match packets in priority order 对packet处理: 转发 修改 交给Group Table 交给下个Table OpenFlowOpenFlow Packet ProcessingPacket Processing OpenFlowOpenFlow Packet ProcessingPacket Processing Actions: Output: 转发 Set-Q

3、ueue: QoS Drop Group Push/Pop tags OpenFlowOpenFlow Packet ProcessingPacket Processing Actions: Output: 转发 Set-Queue: QoS Drop Group Push/Pop tags OpenvswitchOpenvswitch简介简介 Openvswitch是一个virutal swtich, 支持Open Flow协议, 当然也有一些硬件Switch也支 持Open Flow协议,他们都可 以被统一的Controller管理, 从而实现物理机和虚拟机的 网络联通。 Openvswi

4、tchOpenvswitch简介简介 Match Field涵盖TCP/IP协议各层: Layer 1 Tunnel ID, In Port, QoS priority, skb mark Layer 2 MAC address, VLAN ID, Ethernet type Layer 3 IPv4/IPv6 fields, ARP Layer 4 TCP/UDP, ICMP, ND Action也主要包含下面的操作: Output to port (port range, flood, mirror) Discard, Resubmit to table x Packet Mangling

5、 (Push/Pop VLAN header, TOS, .) Send to controller, Learn OpenvswitchOpenvswitch简介简介 可以设置Tunnel 可以支持下列的框架来监控流量。 sFlow NetFlow Port Mirroring SPAN RSPAN ERSPAN 支持QoS Uses existing Traffic Control Layer Policer (Ingress rate limiter) HTB, HFSC (Egress traffic classes) Controller (Open Flow) can select

6、 Traffic Class OpenvswitchOpenvswitch架构架构 OpenvswitchOpenvswitch架构架构 实验一:查看实验一:查看OpenvswitchOpenvswitch的架构的架构 rootpopsuper1982:# ps aux | grep openvswitch root 985 0.0 0.0 21172 2120 ? S floodlight.log 2a=blob_plain;f=tutorial/Tutorial;hb=HEAD 创建一个Virtual Switch 包含下面四个Port: P1, truck port P2, VLAN 2

7、0 P3, P4 VLAN 30 包含五个flow table: Table 0: Admission control. Table 1: VLAN input processing. Table 2: Learn source MAC and VLAN for ingress port. Table 3: Look up learned port for destination MAC and VLAN. Table 4: Output processing OpenvswitchOpenvswitch: : 综合实例综合实例 创建一个bridge 创建四个veth pair 添加四个端口p

8、ort,ofport_request是指定端口号 ovs-vsctl add-br helloworld ip link add first_br type veth peer name first_if ip link add second_br type veth peer name second_if ip link add third_br type veth peer name third_if ip link add forth_br type veth peer name forth_if ovs-vsctl add-port helloworld first_br - set

9、Interface first_br ofport_request=1 ovs-vsctl add-port helloworld second_br - set Interface second_br ofport_request=2 ovs-vsctl add-port helloworld third_br - set Interface third_br ofport_request=3 ovs-vsctl add-port helloworld forth_br - set Interface forth_br ofport_request=4 OpenvswitchOpenvswi

10、tch: : 综合实例综合实例 新添加的port都是出于DOWN的状态,设成up ip link set first_if up ip link set first_br up ip link set second_br up ip link set second_if up ip link set third_if up ip link set third_br up ip link set forth_br up ip link set forth_if up OpenvswitchOpenvswitch: : 综合实例综合实例 实现第一个Table 0,Admission control

11、 包进入vswitch的时候首先进入Table 0,我们在这里可以设定规则,控制那些包可以进入, 那些包不可以进入。 multicast的不允许进入 STP的也不接受 添加最后一个flow,这个flow的priority低于default,如果上面两个不匹配,则我们进入 table 1 测试Table 0 不满足条件DROP 满足条件RESUBMIT ovs-ofctl add-flow helloworld “table=0, dl_src=01:00:00:00:00:00/01:00:00:00:00:00, actions=drop“ ovs-ofctl add-flow hellow

12、orld “table=0, dl_dst=01:80:c2:00:00:00/ff:ff:ff:ff:ff:f0, actions=drop“ ovs-ofctl add-flow helloworld “table=0, priority=0, actions=resubmit(,1)“ ovs-appctl ofproto/trace helloworld in_port=1,dl_dst=01:80:c2:00:00:05 ovs-appctl ofproto/trace helloworld in_port=1,dl_dst=01:80:c2:00:00:10 Openvswitch

13、Openvswitch: : 综合实例综合实例 实现第二个Table 1:VLAN Input Processing 添加一个最低优先级的DROP的规则 对于port 1,是trunk口,无论有没有VLAN Header都接受 对于port 2, 3, 4, 我们希望没有VLAN Tag,然后我们给打上VLAN Tag 测试Table 1 从port 1进入,tag为5 从port 2进入,没有打Tag的 从port 2进入,带Tag 5的 ovs-ofctl add-flow helloworld “table=1, priority=0, actions=drop“ ovs-ofctl a

14、dd-flow helloworld “table=1, priority=99, in_port=1, actions=resubmit(,2)“ ovs-ofctl add-flows helloworld - MAC VLAN Tag。 这样以后如果有需要发给这个MAC的包,不用ARP,switch自然之道应该发给哪个port, 应该打什么VLAN Tag。 OVS也要学习这个,并维护三个之间的mapping关系。 ovs-ofctl add-flow helloworld “table=2 actions=learn(table=10, NXM_OF_VLAN_TCI011, NXM_

15、OF_ETH_DST=NXM_OF_ETH_SRC, load:NXM_OF_IN_PORT-NXM_NX_REG0015), resubmit(,3)“ learn表示这是一个学习的action table 10,这是一个MAC learning table,学习的结果会放在这个table中。 NXM_OF_VLAN_TCI这个是VLAN Tag,在MAC Learning table中,每一个entry都是仅仅对某一个VLAN来说的,不同VLAN 的learning table是分开的。在学习的结果的entry中,会标出这个entry是对于哪个VLAN的。 NXM_OF_ETH_DST=NXM_OF_ETH_SRC这个的意思是当前包里面的MAC Source Address会被放在学习结果的entry里 面的dl_dst里面。这是因为每个switch都是通过Ingress包来学习,某个MAC从某个port进来,switch就应该记住以后发 往这个MAC的包要从这个port出去,因而MAC source address就被放在了Mac destination address里面,因为这是为发 送用的。 NXM_OF_IN_PORT-NXM_NX_REG0将portf放入register. 一般对于学习的entry还需要有hard_timeout,这是的每个学习结

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 解决方案

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号