问题导读

1.br-int、br-ethx的作用是什么?
2.安全组策略是如何实现的?
3.VLAN 模式与GRE模式有哪些不同点?流量上有哪些不同?
4.L3 agent实现了什么功能?

接上篇深入理解 Neutron -- OpenStack 网络实现(1)

Vlan模式下的系统架构跟GRE模式下类似,如下图所示。
需要注意的是,在vlan模式下,vlan tag的转换需要在br-int和br-ethx两个网桥上进行相互配合。即br-int负责从int-br-ethX过来的包(带外部vlan)转换为内部vlan,而br-ethx负责从phy-br-ethx过来的包(带内部vlan)转化为外部的vlan。
(个人对vlan tag的理解,应该是对vlan的一个人为标记,起到识别的作用)
 
<ignore_js_op>
下面进行一些细节的补充讨论,以Vlan作为物理网络隔离的实现。假如要实现同一个租户下两个子网,如下图所示:
 
<ignore_js_op>

计算节点

<ignore_js_op>
查看网桥信息,主要包括两个网桥:br-int和br-eth1:
[Bash shell] 纯文本查看 复制代码
01 [root@Compute ~]# ovs-vsctl show
02 f758a8b8-2fd0-4a47-ab2d-c49d48304f82
03     Bridge "br-eth1"
04         Port "phy-br-eth1"
05             Interface "phy-br-eth1"
06         Port "br-eth1"
07             Interface "br-eth1"
08                 type: internal
09         Port "eth1"
10             Interface "eth1"
11     Bridge br-int
12         Port "qvoXXX"
13             tag: 1
14             Interface "qvoXXX"
15         Port "qvoYYY"
16             tag: 1
17             Interface "qvoYYY"
18         Port "qvoZZZ"
19              tag: 2
20              Interface "qvoZZZ"
21         Port "qvoWWW"
22              tag: 2
23              Interface "qvoWWW"
24         Port "int-br-eth1"
25             Interface "int-br-eth1"
26         Port br-int
27             Interface br-int
28                 type: internal
类似GRE模式下,br-int负责租户隔离,br-eth1负责跟计算节点外的网络通信。 在Vlan模式下,租户的流量隔离是通过vlan来进行的,因此此时包括两种vlan,虚拟机在Compute Node内流量带有的local vlan和在Compute Node之外物理网络上隔离不同租户的vlan。
 
br-int和br-eth1分别对从端口int-br-eth1和phy-br-eth1上到达的网包进行vlan tag的处理。此处有两个网,分别带有两个vlan tag(内部tag1对应外部tag101,内部tag2对应外部tag102)。 其中,安全组策略仍然在qbr相关的iptables上实现。
 

br-int

与GRE模式不同的是,br-int完成从br-eth1上过来流量(从口int-br-eth1到达)的vlan tag转换,可能的规则为
[Bash shell] 纯文本查看 复制代码
01 #ovs-ofctl dump-flows br-int
02  cookie=0x0, duration=100.795s, table=0, n_packets=6, n_bytes=468, idle_age=90, priority=2,in_port=3 actions=drop
03  cookie=0x0, duration=97.069s, table=0, n_packets=22, n_bytes=6622, idle_age=31, priority=3,in_port=3,dl_vlan=101 actions=mod_vlan_vid:1,NORMAL
04  cookie=0x0, duration=95.781s, table=0, n_packets=8, n_bytes=1165, idle_age=11, priority=3,in_port=3,dl_vlan=102 actions=mod_vlan_vid:2,NORMAL
05  cookie=0x0, duration=103.626s, table=0, n_packets=47, n_bytes=13400, idle_age=11, priority=1 actions=NORMAL

br-eth1

br-eth1上负责从br-int上过来的流量(从口phy-br-eth1到达),实现local vlan到外部vlan的转换。
[Bash shell] 纯文本查看 复制代码
01 #ovs-ofctl dump-flows br-eth0
02 NXST_FLOW reply (xid=0x4):
03  cookie=0x0, duration=73.461s, table=0, n_packets=51, n_bytes=32403, idle_age=2, hard_age=65534, priority=4,in_port=4,dl_vlan=1 actions=mod_vlan_vid:101,NORMAL
04  cookie=0x0, duration=83.461s, table=0, n_packets=51, n_bytes=32403, idle_age=2, hard_age=65534, priority=4,in_port=4,dl_vlan=2 actions=mod_vlan_vid:102,NORMAL
05  cookie=0x0, duration=651.538s, table=0, n_packets=72, n_bytes=3908, idle_age=2574, hard_age=65534, priority=2,in_port=4 actions=drop
06  cookie=0x0, duration=654.002s, table=0, n_packets=31733, n_bytes=6505880, idle_age=2, hard_age=65534, priority=1 actions=NORMAL

网络节点

<ignore_js_op>
类似GRE模式下,br-eth1收到到达的网包,int-br-eth1和phy-br-eth1上分别进行vlan转换,保证到达br-int上的网包都是带有内部vlan tag,到达br-eth1上的都是带有外部vlan tag。br-ex则完成到OpenStack以外网络的连接。 查看网桥信息,包括三个网桥,br-eth1、br-int和br-ex。
[Bash shell] 纯文本查看 复制代码
01 #ovs
02 3bd78da8-d3b5-4112-a766-79506a7e2801
03     Bridge br-ex
04         Port "qg-VVV"
05             Interface "qg-VVV"
06                 type: internal
07         Port br-ex
08             Interface br-ex
09                 type: internal
10         Port "eth0"
11             Interface "eth0"
12     Bridge br-int
13         Port br-int
14             Interface br-int
15                 type: internal
16         Port "int-br-eth1"
17             Interface "int-br-eth0"
18         Port "tapXXX"
19             tag: 1
20             Interface "tapXXX"
21                 type: internal
22 Port "tapWWW"
23             tag: 2
24             Interface "tapWWW"
25                 type: internal
26         Port "qr-YYY"
27             tag: 1
28             Interface "qr-YYY"
29                 type: internal
30         Port "qr-ZZZ"
31             tag: 2
32             Interface "qr-ZZZ"
33                 type: internal
34     Bridge "br-eth1"
35         Port "phy-br-eth1"
36             Interface "phy-br-eth1"
37         Port "br-eth1"
38             Interface "br-eth1"
39                 type: internal
40         Port "eth1"
41             Interface "eth1"

br-eth1

br-eth1主要负责把物理网络上外部vlan转化为local vlan。
[Bash shell] 纯文本查看 复制代码
01 #ovs-ofctl dump-flows br-eth1
02 NXST_FLOW reply (xid=0x4):
03  cookie=0x0, duration=144.33s, table=0, n_packets=13, n_bytes=28404, idle_age=24, hard_age=65534, priority=4,in_port=5,dl_vlan=101 actions=mod_vlan_vid:1,NORMAL
04  cookie=0x0, duration=144.33s, table=0, n_packets=13, n_bytes=28404, idle_age=24, hard_age=65534, priority=4,in_port=5,dl_vlan=102 actions=mod_vlan_vid:2,NORMAL
05  cookie=0x0, duration=608.373s, table=0, n_packets=23, n_bytes=1706, idle_age=65534, hard_age=65534, priority=2,in_port=5 actions=drop
06  cookie=0x0, duration=675.373s, table=0, n_packets=58, n_bytes=10625, idle_age=24, hard_age=65534, priority=1 actions=NORMAL

br-int

br-int上挂载了大量的agent来提供各种网络服务,另外负责对发往br-eth1的流量,实现local vlan转化为外部vlan。
[Bash shell] 纯文本查看 复制代码
01 #ovs-ofctl dump-flows br-int
02 NXST_FLOW reply (xid=0x4):
03  cookie=0x0, duration=147294.121s, table=0, n_packets=224, n_bytes=33961, idle_age=13, hard_age=65534, priority=3,in_port=4,dl_vlan=1 actions=mod_vlan_vid:101,NORMAL
04  cookie=0x0, duration=603538.84s, table=0, n_packets=19, n_bytes=2234, idle_age=18963, hard_age=65534, priority=2,in_port=4 actions=drop
05  cookie=0x0, duration=603547.134s, table=0, n_packets=31901, n_bytes=6419756, idle_age=13, hard_age=65534, priority=1 actions=NORMAL
dnsmasq负责提供DHCP服务,绑定到某个特定的名字空间上,每个需要DHCP服务的租户网络有自己专属隔离的DHCP服务(图中的tapXXX和tapWWW上各自监听了一个dnsmasq)。
路由是L3 agent来实现,每个子网在br-int上有一个端口(qr-YYY和qr-ZZZ,已配置IP,分别是各自内部子网的网关),L3 agent绑定到上面。要访问外部的公共网络,需要通过L3 agent发出,而不是经过int-br-ex到phy-br-ex(实际上并没有网包从这个veth pair传输)。如果要使用外部可见的floating IP,L3 agent仍然需要通过iptables来进行NAT。
每个L3 agent或dnsmasq都在各自独立的名字空间中,如下图所示,其中同一租户的两个子网都使用了同一个路由器。
 
<ignore_js_op>
对于子网使用不同路由器的情况,多个路由器会在自己独立的名字空间中。例如要实现两个租户的两个子网的情况,如下图所示。
<ignore_js_op>
这种情况下,网络节点上的名字空间如下图所示。
<ignore_js_op>

br-ex

br-ex要做的事情很简单,只需要正常转发即可。
[Bash shell] 纯文本查看 复制代码
01 #ovs-ofctl dump-flows br-ex
02 NXST_FLOW reply (xid=0x4):
03  cookie=0x0, duration=6770.969s, table=0, n_packets=5411, n_bytes=306944, idle_age=0, hard_age=65534, priority=0 actions=NORMAL

深入理解 Neutron -- OpenStack 网络实现(2):VLAN 模式的更多相关文章

  1. 深入理解 Neutron -- OpenStack 网络实现(3):VXLAN 模式

    问题导读1.VXLAN 模式下,网络的架构跟 GRE 模式类似,他们的不同点在什么地方?2.网络节点的作用是什么?3.tap-xxx.qr-xxx是指什么? 接上篇:深入理解 Neutron -- O ...

  2. 深入理解 Neutron -- OpenStack 网络实现(4):网络名字空间

    问题导读1.如何查看网络名字空间?2.网络名字空间开头的名字有什么规律?3.dhcp服务是如何实现的?4.router的实现是通过iptables进行的是否正确?5.SNAT和DNAT规则有什么作用? ...

  3. 深入理解 Neutron -- OpenStack 网络实现(1):GRE 模式

    问题导读1.什么是VETH.qvb.qvo?2.qbr的存在的作用是什么?3.router服务的作用是什么? 如果不具有Linux网络基础,比如防火墙如何过滤ip.端口或则对openstack ovs ...

  4. Openstack的nova-network的vlan模式扩展

    openstack的nova-network的vlan模式是可以在安装的时候,将网络划分为多个子网,每个项目一个或者多个子网进行虚拟机创建.但是他现在代码级别上不支持:如果一开始安装的环境的vlan网 ...

  5. Openstack的nova-network的vlan模式扩展2

    接上一篇,上一篇我们使用的是nova-manage命令来创建的网络,这里就有一些知识需要了解 遇到的问题 控制节点的前面的BUG已经按官方解决BUG方式解决了,但是在开发dashboard,使用nov ...

  6. 理解 neutron(15):Neutron Linux Bridge + VLAN/VXLAN 虚拟网络

    学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GR ...

  7. OpenStack neutron vlan 模式下的网络包流向

    时间:2015-01-15 18:09:41 1.什么是Neutron? Neutron是OpenStack的network project ,是NaaS(networking-as-a-servic ...

  8. 深入理解openstack网络架构(4)-----连接到public network

    原文地址: https://blogs.oracle.com/ronen/entry/diving_into_openstack_network_architecture3 译文转自:http://b ...

  9. 深入理解openstack网络架构(2)----Basic Use Cases

    原文地址: https://blogs.oracle.com/ronen/entry/diving_into_openstack_network_architecture1 译文转自: http:// ...

随机推荐

  1. 嵌入式开发之zynq---Zynq PS侧DMA驱动

    http://xilinx.eetrend.com/blog/10760 http://xilinx.eetrend.com/blog/10787

  2. Java线程创建的两种方式

    java多线程总结一:线程的两种创建方式及优劣比较 (一)---之创建线程的两种方式 java实现多线程的两种方法的比较

  3. 手机web——自适应网页设计(html/css控制)http://mobile.51cto.com/ahot-409516.htm

    http://mobile.51cto.com/ahot-409516.htm 一. 允许网页宽度自动调整: "自适应网页设计"到底是怎么做到的? 其实并不难. 首先,在网页代码的 ...

  4. Python——eventlet.hubs

    Hub构成了 Eventlet 的事件循环,它分发 I/O 事件.调度 greenthread.Hub的存在使得协程被提升为 greenthreads. Eventlet 有多种hub的实现,所以在使 ...

  5. SQLException: Column count doesn't match value count at row 1

    INSERT INTO table_name(col_name1, col_name2, col_name3) VALUES('value1','value2'); 语句中,前后列数不等造成的 转自: ...

  6. js 操作json对象增删改

    //将表单序列化成字符串 $.fn.serializeObject = function () { var obj = {}; var count = 0; $.each(this.serialize ...

  7. C# 在EF中直接运行SQL命令

    相信不少使用EF的同志们已经知道如何在EF中运行SQL命令了.我在这里简单总结下,希望对大家学习EF有所帮助! 在 EF第一个版本(.NET 3.5 SP1)中,我们只能通过将ObjectContex ...

  8. gradle 的安装

    前言: 我不是一个勤奋好学的人,奔着新技术就跑去尝试学习.但是在工作或者学习的过程中,遇到了的技术,还是得一个坎一个坎的迈过去.把今天遇到的坎变成明天的垫脚石. 想学习一下 spring 的源码,然后 ...

  9. 8.1 shell介绍 8.2 命令历史 8.3 命令补全和别名 8.4 通配符 8.5 输入输出重定向 

    8.1 shell介绍 8.2 命令历史 8.3 命令补全和别名 8.4 通配符 8.5 输入输出重定向 什么是shell? shell是一个命令解释器,提供用户和及其之间的交互 致辞特定语法,比如逻 ...

  10. IE10假死/未响应是为什么?

    不知道大家在使用IE10的时候会不会有像是假死一样的情况发生,在打开网页或者进行任何操作都会变得奇慢无比.随着最近在网上看视频的次数越来越多,这个问题越来越突出,越来越频发.于是分析进程的等待链,看看 ...