[Reprint] calico and flannel network principles and contrast

calico and flannel network principles and contrast

https://blog.csdn.net/ganpuzhong42/article/details/77853131

 

Recently engaged paas content, but also new to the kubernetes, are related to the content network coverage, that is, communication between hosts across the container itself docker have native cross-host communication program, but poor efficiency. So a series of open source components, such as flannel, calico, weave and so on. Here mainly introduce calico and fannel

A calico architecture

First Look calico organization chart, as shown below.

 

 

calico important component comprising: Felix, etcd, BGP Client, BGP Route Reflector. The following illustrate how these components.

Felix: responsible for routing configuration, and configuration rules and ACLS issued, it exists on every node node.

etcd: a distributed key-value store, is mainly responsible for network metadata consistency, to ensure the accuracy of Calico network status , may kubernetes share;

 

BGPClient (BIRD), is mainly responsible for the  Felix writes  routing information distributed to the kernel of the current  Calico network to ensure  the effectiveness of communication between workload;

BGPRoute Reflector(BIRD), 大规模部署时使用,摒弃所有节点互联的mesh模式,通过一个或者多个 BGPRoute Reflector 来完成集中式的路由分发;

二 calico原理

如下图所示,描述了从源容器经过源宿主机,经过数据中心的路由,然后到达目的宿主机最后分配到目的容器的过程。

 

整个过程中始终都是根据iptables规则进行路由转发,并没有进行封包,解包的过程,这和flannel比起来效率就会快多了。

 

三 flannel原理

四 对比

从上述的原理可以看出,flannel在进行路由转发的基础上进行了封包解包的操作,这样浪费了CPU的计算资源。下图是从网上找到的各个开源网络组件的性能对比。可以看出无论是带宽还是网络延迟,calico和主机的性能是差不多的。

 

原理已经搞得差不多了,那么就应该搭建calico的网络环境了,我基于kubernetes,整合了calico网络,具体的部署方法请见下一篇:kubernetes整合calico网络部署方法。

Guess you like

Origin www.cnblogs.com/jinanxiaolaohu/p/11271641.html