The ipip calico pattern analysis and bgp

1 Introduction

BGP operating modes:

bgp flannel operating mode and the mode is almost the same host-gw;

bird is bgd client to communicate with other nodes in the cluster bird, in order to exchange their routing information;

As the number of nodes N, these routing rules will be growing at an exponential scale, to create enormous pressure on the cluster network itself, the official suggested less than 100 nodes;

Limit: limit and the host-gw flannel same requirements for physical machine at Layer can be connected to, not cross-segment;

Route Reflector mode:

In larger clusters, the need for specialized create one or several special nodes Route Reflector mode, with all the BGP responsible for clients to connect, so learn the full global routing rules;

While other nodes, just keep up these special nodes exchange routing information, routing information can be obtained throughout the entire cluster

IPIP mode:

Scene: In the case with the inter-network communication, in BGP mode will not inter-network scenarios;

tunl0: create a virtual network card device, in which case the effect on the operating mode and VxLAN flannel-like (tun0 UDP mode tunl0 not here in flannel)

2, server information

1, ip and mac information

server ip mac gw_mac
172.22.108.11 172.22.108.11 b8:ca:3a:f2:74:fb 38:ad:8e:59:02:e7
172.22.108.12 172.22.108.12 08: 94: ef: 7b: 47: a7 38:ad:8e:59:02:e7
10.100.106.15 10.100.106.15 B8: 2: 72: EC: b0: 75 00:5e:ed:ff:00:01
172.22.108.11 172.32.31.151 ae: a3: 86: 58: 6c: 59
172.22.108.12 172.32.135.30 f2:bc:d7:00:3c:be
10.100.106.15 172.32.245.151 f6:a\b:e3:0f:ad:12

2, routing entries

Host 10.100.106.15

1569549056206

Host 172.22.108.12

1569549121848

Host 172.22.108.11

1569549137831

3, IPIP analysis

IPIP

1, the virtual NIC tunl0 message details

In the POD 10.100.106.15 on ping 172.22.108.12, while the capture command is executed (tcpdump -i tunl0 host 172.32.245.151 -w 108.12.pcap) on 172.22.108.11 (if grasping the physical NIC, a data packet is not caught because, it was the second package, arriving packets ip physical NIC is 10.100.106.15)

1569484191515

2, physical NIC packet details

10.100.106.15 capture on the machine, add filter information: ip.addr == 172.32.245.151

tcpdump -i em1 host 172.22.108.12 -w 106.15.pcap

1569485020433

The upper end of the capture 172.22.108.12

Add filter information: ip.addr == 172.32.245.151, can be found through the following capture, since the ipip mode, the outermost layer of the package information of the physical NIC.

1569485247501

4、calico cross-subnet

Although ipip realized the inter-network communication calico, but the communication between the host for the same segment, IP-in-IP is a bit redundant, because both host in the same broadcast domain, Layer 2 interworking, go directly to the host route It can be. At this point we need calico cross-subnet

$ calicoctl apply -f - << EOF
apiVersion: v1
kind: ipPool
metadata:
  cidr: 192.168.0.0/16
spec:
  ipip:
    enabled: true
    mode: cross-subnet
  nat-outgoing: true
EOF

For the consent of the author, prohibited reproduced, writing is not easy

Guess you like

Origin www.cnblogs.com/zqliu8/p/11605839.html
BGP