Cloud Native应用交付

  • 首页
  • 关于本站
  • 个人介绍
  • Downloads
  • Repo
    • Github
    • Container
  • F5
    • F5 Python SDK
    • F5-container
    • F5-LBaaS
  • 社交
    • 联系我
    • 微信/微博
    • 公众号
    • 打赏赞助
行至水穷处 坐看云起时
Cloud Native Application Services: cnadn.net
  1. 首页
  2. 化云为雨/Openstack
  3. 正文

观察openstack中VXLAN的flows(Icehouse,ubuntu14.04)

2015年05月13日 8055点热度 0人点赞 0条评论

首先观察一下br-tun的接口,可以看到

-接口1是与br-int互联的口

-接口2是到10.1.1.145的tunnel接口

-接口3是到10.1.1.5的tunnel接口

最后一个local是内部接口

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
root@compute:/home/gavin# ovs-ofctl show br-tun
OFPT_FEATURES_REPLY (xid=0x2): dpid:00007e03ccc4c742
n_tables:254, n_buffers:256
capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
1(patch-int): addr:42:a8:d1:42:4f:86
     config:     0
     state:      0
     speed: 0 Mbps now, 0 Mbps max
2(vxlan-0a010191): addr:4a:e5:c9:4f:d9:63
     config:     0
     state:      0
     speed: 0 Mbps now, 0 Mbps max
3(vxlan-0a010105): addr:0a:28:d8:87:c5:65
     config:     0
     state:      0
     speed: 0 Mbps now, 0 Mbps max
LOCAL(br-tun): addr:7e:03:cc:c4:c7:42
     config:     0
     state:      0
     speed: 0 Mbps now, 0 Mbps max
OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0

再观察没有流量时候的flows rule:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
root@compute:/home/gavin# ovs-ofctl dump-flows br-tun
NXST_FLOW reply (xid=0x4):
cookie=0x0, duration=7697.984s, table=0, n_packets=1049, n_bytes=100884, idle_age=719, priority=1,in_port=3 actions=resubmit(,3)
cookie=0x0, duration=7699.315s, table=0, n_packets=1316, n_bytes=114034, idle_age=719, priority=1,in_port=1 actions=resubmit(,1)
cookie=0x0, duration=48.361s, table=0, n_packets=0, n_bytes=0, idle_age=48, priority=1,in_port=2 actions=resubmit(,3)
cookie=0x0, duration=7699.239s, table=0, n_packets=6, n_bytes=480, idle_age=7690, priority=0 actions=drop
cookie=0x0, duration=7699.162s, table=1, n_packets=1039, n_bytes=98474, idle_age=719, priority=1,dl_dst=00:00:00:00:00:00/01:00:00:00:00:00 actions=resubmit(,20)
cookie=0x0, duration=7699.085s, table=1, n_packets=277, n_bytes=15560, idle_age=1674, priority=1,dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=resubmit(,21)
cookie=0x0, duration=7699.008s, table=2, n_packets=0, n_bytes=0, idle_age=7699, priority=0 actions=drop
cookie=0x0, duration=7695.356s, table=3, n_packets=1034, n_bytes=99054, idle_age=719, priority=1,tun_id=0x10002 actions=mod_vlan_vid:1,resubmit(,10)
cookie=0x0, duration=6476.471s, table=3, n_packets=15, n_bytes=1830, idle_age=6371, priority=1,tun_id=0x10001 actions=mod_vlan_vid:2,resubmit(,10)
cookie=0x0, duration=7698.932s, table=3, n_packets=0, n_bytes=0, idle_age=7698, priority=0 actions=drop
cookie=0x0, duration=7698.857s, table=10, n_packets=1049, n_bytes=100884, idle_age=719, priority=1 actions=learn(table=20,hard_timeout=300,priority=1,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],load:0->NXM_OF_VLAN_TCI[],load:NXM_NX_TUN_ID[]->NXM_NX_TUN_ID[],output:NXM_OF_IN_PORT[]),output:1
cookie=0x0, duration=7698.781s, table=20, n_packets=0, n_bytes=0, idle_age=7698, priority=0 actions=resubmit(,21)
cookie=0x0, duration=6476.547s, table=21, n_packets=82, n_bytes=4346, idle_age=6385, hard_age=48, dl_vlan=2 actions=strip_vlan,set_tunnel:0x10001,output:2,output:3
cookie=0x0, duration=7695.433s, table=21, n_packets=170, n_bytes=9164, idle_age=1674, hard_age=48, dl_vlan=1 actions=strip_vlan,set_tunnel:0x10002,output:2,output:3
cookie=0x0, duration=7698.705s, table=21, n_packets=25, n_bytes=2050, idle_age=6476, priority=0 actions=drop

上述rule分为table 0 1  2 3 10 20 21,每一行最后的括弧中的数字表示接下来将数据包交给哪个table,数据包将从上到下顺序去匹配这些rule

table 0 中的 in port对应于上面的br-tun中的接口,可以看到 如果in port=3 即数据从接口3(与10.1.1.5的tunnel接口)进来,数据交给table 3,而table 3所做的事情是将数据包的tunnel id去除,并修改添加对应的vlan id,然后交给 table 10, 或者table 3做丢弃动作

1
2
3
cookie=0x0, duration=7695.356s, table=3, n_packets=1034, n_bytes=99054, idle_age=719, priority=1,tun_id=0x10002 actions=mod_vlan_vid:1,resubmit(,10)
cookie=0x0, duration=6476.471s, table=3, n_packets=15, n_bytes=1830, idle_age=6371, priority=1,tun_id=0x10001 actions=mod_vlan_vid:2,resubmit(,10)
cookie=0x0, duration=7698.932s, table=3, n_packets=0, n_bytes=0, idle_age=7698, priority=0 actions=drop

table 10在接到数据包后做数据处理,并传给output:1这个接口1,接口1是与br-int交换机互联的接口,因此数据包被送到了br-int交换机,从而交给了相关目的地址。

而如果一开始数据从in port=1 进来,表示数据从br-int进来,数据包经由table 0 匹配后,交给table 1,table 1交给 table 20或者21, table 20根据学习到的mac 与tunnel id等的映射转发数据,而table 21则负责进行复制广播类数据。

因而如果从compute上得一个vm 去ping 网络节点的dhcp接口,获得如下实际结果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
root@compute:/home/gavin# ovs-ofctl dump-flows br-tun
NXST_FLOW reply (xid=0x4):
cookie=0x0, duration=9042.763s, table=0, n_packets=1122, n_bytes=107758, idle_age=0, priority=1,in_port=3 actions=resubmit(,3)
cookie=0x0, duration=9044.094s, table=0, n_packets=1389, n_bytes=120908, idle_age=0, priority=1,in_port=1 actions=resubmit(,1)
cookie=0x0, duration=152.391s, table=0, n_packets=0, n_bytes=0, idle_age=152, priority=1,in_port=2 actions=resubmit(,3)
cookie=0x0, duration=9044.018s, table=0, n_packets=6, n_bytes=480, idle_age=9035, priority=0 actions=drop
cookie=0x0, duration=9043.941s, table=1, n_packets=1111, n_bytes=105306, idle_age=0, priority=1,dl_dst=00:00:00:00:00:00/01:00:00:00:00:00 actions=resubmit(,20)
cookie=0x0, duration=9043.864s, table=1, n_packets=278, n_bytes=15602, idle_age=67, priority=1,dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=resubmit(,21)
cookie=0x0, duration=9043.787s, table=2, n_packets=0, n_bytes=0, idle_age=9043, priority=0 actions=drop
cookie=0x0, duration=9040.135s, table=3, n_packets=1107, n_bytes=105928, idle_age=0, priority=1,tun_id=0x10002 actions=mod_vlan_vid:1,resubmit(,10)
cookie=0x0, duration=7821.25s, table=3, n_packets=15, n_bytes=1830, idle_age=7716, priority=1,tun_id=0x10001 actions=mod_vlan_vid:2,resubmit(,10)
cookie=0x0, duration=9043.711s, table=3, n_packets=0, n_bytes=0, idle_age=9043, priority=0 actions=drop
cookie=0x0, duration=9043.636s, table=10, n_packets=1122, n_bytes=107758, idle_age=0, priority=1 actions=learn(table=20,hard_timeout=300,priority=1,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],load:0->NXM_OF_VLAN_TCI[],load:NXM_NX_TUN_ID[]->NXM_NX_TUN_ID[],output:NXM_OF_IN_PORT[]),output:1
cookie=0x0, duration=67.627s, table=20, n_packets=72, n_bytes=6832, hard_timeout=300, idle_age=0, hard_age=0, priority=1,vlan_tci=0x0001/0x0fff,dl_dst=fa:16:3e:e2:90:6c actions=load:0->NXM_OF_VLAN_TCI[],load:0x10002->NXM_NX_TUN_ID[],output:3
cookie=0x0, duration=9043.56s, table=20, n_packets=0, n_bytes=0, idle_age=9043, priority=0 actions=resubmit(,21)
cookie=0x0, duration=7821.326s, table=21, n_packets=82, n_bytes=4346, idle_age=7730, hard_age=152, dl_vlan=2 actions=strip_vlan,set_tunnel:0x10001,output:2,output:3
cookie=0x0, duration=9040.212s, table=21, n_packets=171, n_bytes=9206, idle_age=67, hard_age=152, dl_vlan=1 actions=strip_vlan,set_tunnel:0x10002,output:2,output:3
cookie=0x0, duration=9043.484s, table=21, n_packets=25, n_bytes=2050, idle_age=7821, priority=0 actions=drop

参考资料

http://www.opencloudblog.com/?p=300

相关文章

  • Mitaka Openstack 排错备忘
  • Icehouse Vxlan 配置
  • openstack heat模板之配置基本LB到F5 BIGIP
  • Openstack Mitaka 在Centos7上的自动化安装
  • Neutron/DVR L2 Agent
本作品采用 知识共享署名-非商业性使用 4.0 国际许可协议 进行许可
标签: openstack vxlan
最后更新:2015年05月13日

纳米

linjing.io

打赏 点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理。

页面AI聊天助手

纳米

linjing.io

☁️迈向Cloud Native ADC ☁️

认证获得:
TOGAF: ID 152743
Kubernetes: CKA #664
Microsoft: MCSE MCDBA
Cisco: CCNP
Juniper: JNCIS
F5:
F5 Certified Solution Expert, Security
F5 Certified Technology Specialist, LTM/GTM/APM/ASM
F5 Certified BIG-IP Administrator
  • 点击查看本博技术要素列表
  • 归档
    分类
    • AI
    • Automation
    • Avi Networks
    • Cisco ACI
    • CISCO资源
    • F5 with ELK
    • F5-Tech tips
    • F5技术
    • Juniper
    • Linux
    • NGINX
    • SDN
    • ServiceMesh
    • WEB编程
    • WINDOWS相关
    • 业界文章
    • 交换机技术
    • 化云为雨/Openstack
    • 协议原理
    • 容器/k8s
    • 我的工作
    • 我的生活
    • 网站技术
    • 路由器技术
    • 项目案例
    标签聚合
    nginx F5 envoy k8s neutron openstack DNS network docker istio gtm irule api bigip flannel
    最近评论
    汤姆 发布于 8 个月前(09月10日) 嗨,楼主,里面的json怎么下载啊,怎么收费啊?
    汤姆 发布于 8 个月前(09月09日) 大佬,kib的页面可以分享下吗?谢谢
    zhangsha 发布于 1 年前(05月12日) 资料发给我下,谢谢纳米同志!!!!lyx895@qq.com
    李成才 发布于 1 年前(01月02日) 麻烦了,谢谢大佬
    纳米 发布于 1 年前(01月02日) 你好。是的,因为以前下载系统插件在一次升级后将所有的下载生成信息全弄丢了。所以不少文件无法下载。DN...
    浏览次数
    • Downloads - 183,756 views
    • 联系我 - 118,966 views
    • 迄今为止最全最深入的BIGIP-DNS/GTM原理及培训资料 - 116,489 views
    • Github - 103,645 views
    • F5常见log日志解释 - 79,768 views
    • 从传统ADC迈向CLOUD NATIVE ADC - 下载 - 74,619 views
    • Sniffer Pro 4 70 530抓包软件 中文版+视频教程 - 74,320 views
    • 迄今为止最全最深入的BIGIP-DNS/GTM原理及培训资料 - 67,770 views
    • 关于本站 - 60,888 views
    • 这篇文档您是否感兴趣 - 55,491 views
    链接表
    • F5SE创新
    • Jimmy Song‘s Blog
    • SDNlab
    • Service Mesh社区
    • 三斗室
    • 个人profile
    • 云原生社区

    COPYRIGHT © 2023 Cloud Native 应用交付. ALL RIGHTS RESERVED.

    Theme Kratos Made By Seaton Jiang

    京ICP备14048088号-1

    京公网安备 11010502041506号