1、小结:容器的跨主机通信的需求ARP的广播增加网络负担Gossip协议的运维复杂度多种docker网络环境(aliyun经典VM/VPC 混合云)高性能网络业务(带宽延迟)CNM模型插件架构和开发Docker网络插件开发CNM 模型Sandbox:一个隔离的网络配置环境Endpoint:隶属于某一个network的通讯端口。Network:一个唯一的、可识别的endpoint组,组内endpoint可以相互通讯。你可以创建一个Frontend和Backend network,然后这两个network是完全隔离的。插件架构和开发/var/run/docker/plugins.sock/.spec/
2、.jsonDocker plugin APIhttps:/ plugin的利器https:/ represent the interface a driver must fulfill.type Driver interface GetCapabilities()(*CapabilitiesResponse,error)CreateNetwork(*CreateNetworkRequest)errorCreateEndpoint(*CreateEndpointRequest)(*CreateEndpointResponse,error)EndpointInfo(*InfoRequest)(*I
3、nfoResponse,error)Join(*JoinRequest)(*JoinResponse,error)Leave(*LeaveRequest)errorDiscoverNew(*DiscoveryNotification)errorDiscoverDelete(*DiscoveryNotification)errorVlan/SRIOV DriverVPC DriverVxlan Driver(Smartnic)蚂蚁金服网络插件Vlan Driver宿主机的管控流量和容器的流量隔离在两个不同的vlanARP广播风暴,交换机PPS压力(ARP 带回)大二层,交换机MAC表象有限(MA
4、CNAT)最适配现有物理网络,对业务影响最小(企业内部,物理机)SRIOV DriverVF/PF 不同vlan隔离容器和宿主机流量VF 直接assign给Container,低延迟高带宽PF Lacp bonding,VF XOR 双活bonding适用于对网络带宽,延迟有较高要求的业务场景(DB等)VPC Driver自定义路由的方式实现网络可达,阿里云openapi支持利用专线可以实现和用户中心的Docker互联适用于在阿里云的VPC上使用docker(公有云业务,公司业务上云)Vxlan Driver网络拓扑静态独立的IPAM,支持SubnetMAC NAT,ARP 带回阿里云经典VM
5、运行多Docker内部测试网络,CICD环境docker network create-d vxlan-ipam-driver=vxlan-gateway=192.168.0.1-subnet=192.168.0.0/24-opt VxlanId=110-ipam-opt VxlanId=110 vxlan11.1docker network create-d vxlan-ipam-driver=vxlan-gateway=192.168.1.1-subnet=192.168.1.0/24-opt VxlanId=110-ipam-opt VxlanId=110 vxlan11.0多Subnet示例:Smart Nic Driver性能损耗(Vxlan卸载,流表查询)万兆网络普及统一调度,资源整合SRIOVQos 功能,离在线业务混部Fastpath offloadBonding/Session/NAT