2 Star 2 Fork 2

唯品会 / TupleNet

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

TupleNet

Build Status License

TupleNet 是基于OVS提供网络虚拟化的系统,它利用Geneve tunnel技术在物理网络上建立虚拟网络。 使用TupleNet可以非常简便地建立一个高效灵活的虚拟网络。

TupleNet is a system was built base on OVS, it leverages Geneve tunneling to construct virtual networking on physical networking. Anyone can use TupleNet to run an efficient and agile virtual networking easily.

TupleNet和Flannel,Calico类似采用的基于数据库的架构方式。TupleNet中控模块由ETCD来担当,而TupleNet运行在每个compute-node节点,用于在该节点调用ovs来建立和提供虚拟网络。

Like Flannel and Calico the architecture of Tuplenet is base on Database. Etcd play a role of brain, and each compute-node has a TupleNet instance which utilizes OVS to construct virtual networking.

                                     +-----------------+
                                     |      ETCD       |
                                     |                 |
                                     +-----------------+
                                              |
                                +---------------------------+
                                |        Control-path       |
                          +----------+                +----------+
                          |          |                |          |  +-------------+
                 +-----+  |          |                |          +--+ Container   |
                 | VM  +--+ TupleNet |                | TupleNet |  +-------------+
                 +-----+  |          |                |          |         |
                    |     +----------+                +----------+         |
                    |     |   OVS    |                |   OVS    |         |
                    |     +----------+                +----------+         |
                    |          |       Phy-network          |              |
                    |          +----------------------------+              |
                    +------------------------------------------------------+
                                      Virtual-network

Why TupleNet

1. TupleNet 采用了及其简便的架构方式,没有中心控制节点,部署方便快捷

TupleNet 是stateless的,它没有中控节点,TupleNet相互之间只需要通过etcd就可以相互构建完整的虚拟网络。其中TupleNet的重要节点(Edge TupleNet)是可以多套部署,所以在TupleNet的网络中是可以避免单点故障。TupleNet实现了CNI,和CNM接口,可以直接为k8s和docker的容器集群提供虚拟网络。

2. TupleNet 的redirecting特性可以支持让其他TupleNet节点作为中间节点转发数据报文,减少网络故障带来的影响

在TupleNet网络中可能存在某个Edge节点不能和某些节点进行通信,开启了redirecting功能后Edge TupleNet节点发现和报文接收方之间存在网络问题(普通TupleNet节点和Edge TupleNet节点通过BFD进行健康探测)后可以将数据报文先转发到其他Edge节点,让这个Edge节点帮助转发数据报文。Redirecting可以减少网络故障带来的影响。

3. TupleNet采用on-demand方式生成flow,可以大幅降低control-plane的cpu使用率,而且可以完美解决传统on-demand方式出现的首包延迟问题

TupleNet 的所有ovs-flow都是在本地生成,不需要一个额外的controller来发送OpenFlow。Ovs-flow生成的方式可以选择是否on-demand方式生成(默认是ondemand方式生成ovs-flow),采用on-demand方式可以大大减少生成不必要的ovs-flow。由于采用on-demand后ovs-flow的生成总是要迟于数据流,当ovs-flow没有被及时生成时候TupleNet会将数据报文转发到特定节点帮忙转发,从而解决因为实时计算ovs-flow带来的网络数据报文延迟问题。

4. TupleNet使用ovs的BFD与Edge TupleNet节点进行健康探测,实时获知Edge节点存活状态,屏蔽单点故障。并且TupleNet支持ECMP,可以充分利用所有Edge节点的带宽,解决单个Edge性能瓶颈问题

虚拟网络里面的数据报文如果要和外部网络通信必须经过Edge节点,TupleNet支持同时部署和使用多台Edge TupleNet节点。普通的TupleNet节点通过ECMP方式可以将数据报文分发给不同的Edge节点,避免Edge节点成为物理网络和虚拟网络之间的瓶颈。 普通的TupleNet节点和Edge TupleNet节点使用BFD不间断进行健康探测,当普通的TupleNet节点发现某个Edge节点异常后可以自动切换,将发送数据报文给健康的Edge节点。

5. TupleNet支持虚拟路径的 + 物理节点的数据报文tracing,快速定位网络故障

在实际网络中很可能会出现某个网络链路出现问题,或者人为导致TupleNet配置错误,这些情况都会导致在虚拟网络中出现网路不可达。TupleNet提供了Packet tracing功能,可以通过pkt-trace工具从指定logical port发送被标记好的报文,报文所经过的TupleNet节点和虚拟网络中的虚拟节点(logical switch,logical router,logical port)都会被完整记录下来。这些信息可以帮助运维人员快速定位故障。

6. TupleNet支持Non-overlay DSR(Direct Server Return)报文传递

在物理网络上架设TupleNet虚拟网络后,虚拟网络的节点需要和外界物理网络通信时候可以采用overlay & non-overlay 混杂传递报文(从TupleNet node到外部物理网络的报文不经过Geneve封装,直接传递给宿主机协议栈,由宿主机协议栈发送出去,避免解封报文带来的性能损耗。从物理网络到虚拟网络节点的报文仍然经过Edge节点转发)。可以大大提升overlay 虚拟网络的性能,以及减轻Edge节点压力。

TupleNet目前支持以下特性:(TupleNet's features)

  • 分布式虚拟 Switch (distributed virtual switch)
  • 分布式或集中虚拟 Router (distributed virtual router)
  • Active-Active Edge(虚拟网络与外部网络交互Gateway)
  • Overlay & non-Overlay 混杂快速报文传递
  • Arp Proxy
  • ECMP to Edge(Gateway),BFD探测Edge,自动切换
  • Router 设置静态路由规则 (static routes)
  • Redirect,支持使用其他host帮助转发数据报文 (Redircte: other tuplenet node can help deliver traffic )
  • Pkt-tracing,支持发送“染色”探测报文,并分析出所经过的整条链路 (it send out packet which can be traced and print the whole path)
  • SNAT,DNAT, floating-ip
  • HostSwitch IPFIX
  • CNI for K8S, CNM for Docker

很快将会支持的特性 (Feature coming soon)

    • [ ]LoadBalance
    • [ ]ACL
    • [ ]Mirroring

TupleNet 概要 (What TupleNet is)

  • TupleNet的设计目标是尽量用最简单的方式建立一个支持2000物理节点,20000 虚拟节点的中型网络。所以整个TupleNet代码架构非常精简,其主要使用PyDatalog来根据目前的网络拓扑动态实时生成ovs-flow。 *TupleNet was designed to support a system which contains 500 physical node and 5000 virtual node at most. Therefore we simplify whole architecture and code in TupleNet to make it easy to be upgraded and understand. TupleNet consume pyDatalog to generate ovs-flows in run-time *
  • 同时TupleNet支持preprogrammed,ondemanded两种方式来生成ovs-flow,并支持将ondemand节点的packet offload给preprogrammed节点转发。 TupleNet has two ways(on-demand and preprogrammed) to generate ovs-flow. Besides of that, tuplenet(on-demaned node ) can deliver traffic to other host to help forwarding
  • 为了更好支持特性的添加,TupleNet目前只支持使用Geneve Tunnel进行网络虚拟化. TupleNet only support Geneve tunneling due to adding new feature easily
  • Want more details?

如何编译TupleNet (How to compile TupleNet)

TupleNet目前主要由三种语言编写,分别是

  • Python TupleNet的所有主要逻辑
  • C 编写的pkt_controller用于和ovs,tuplenet交互
  • Golang TupleNet的tpctl,tpcnm

TupleNet的主要逻辑都是由Python构建,只需要编译pkt_controller以及tpctl(用于将配置虚拟网络写入ETCD)和tpcnm(TupleNet虚拟网络的docker cnm接口实现)

如何使用TupleNet (Have fun with TupleNet)

  • on master-host:
  1. install ETCD
  2. config ETCD start ETCD cluster
  • on compute-host:
  1. install openvswitch(please install ovs which version above 2.10.0)
  2. pip install tuplenet-xxx.whl(generate whl by running python setup.py bdist_wheel in TupleNet folder)
  3. config & run tuplenet and enjoy it. For detail guide document, please visit tutorials

NOTE1: TupleNet还处于0.3.X的版本,还有很多不足也有很多工作要做。目前TupleNet使用在唯品会内网的测试开发云平台,经过小规模集群验证。如果你在使用中遇到问题,欢迎告诉我们。

NOTE2: You can download and consume latest pypy to speed up the control path to accerlate generating ovs-flow

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [2006-2012] [www.springside.org.cn] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

TupleNet 是基于OVS提供网络虚拟化的系统,它利用Geneve tunnel技术在物理网络上建立虚拟网络。 使用TupleNet可以非常简便地建立一个高效灵活的虚拟网络 展开 收起
Python 等 6 种语言
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/vipshop/TupleNet.git
git@gitee.com:vipshop/TupleNet.git
vipshop
TupleNet
TupleNet
master

搜索帮助