VXLAN与EVPN控制平面:MP-BGP分发MAC

一、VXLAN概述:解决传统网络扩展性问题

随着数据中心规模的不断扩大,传统的VLAN(Virtual Local Area Network)技术面临着严重的扩展性瓶颈,主要表现为VLAN ID数量有限(仅4096个)以及二层网络覆盖范围受限。VXLAN(Virtual Extensible LAN)作为一种网络虚拟化技术,应运而生,旨在解决这些问题。

VXLAN通过将原始的二层以太网帧封装在UDP报文中,利用三层IP网络进行传输,从而突破了VLAN的限制,实现了跨越物理网络边界的二层网络扩展。这种"MAC-in-UDP"的封装方式,使得我们可以创建多达1600万个(2^24)的虚拟网络,极大地提升了网络的可扩展性。

VXLAN的工作原理可以概括为以下流程图所示:

#publish-mermaid-0-1793896519536{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-0-1793896519536 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-0-1793896519536 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-0-1793896519536 .error-icon{fill:#552222;}#publish-mermaid-0-1793896519536 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-0-1793896519536 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-0-1793896519536 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-0-1793896519536 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-0-1793896519536 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-0-1793896519536 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-0-1793896519536 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-0-1793896519536 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-0-1793896519536 .marker.cross{stroke:#333333;}#publish-mermaid-0-1793896519536 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-0-1793896519536 p{margin:0;}#publish-mermaid-0-1793896519536 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#publish-mermaid-0-1793896519536 .cluster-label text{fill:#333;}#publish-mermaid-0-1793896519536 .cluster-label span{color:#333;}#publish-mermaid-0-1793896519536 .cluster-label span p{background-color:transparent;}#publish-mermaid-0-1793896519536 .label text,#publish-mermaid-0-1793896519536 span{fill:#333;color:#333;}#publish-mermaid-0-1793896519536 .node rect,#publish-mermaid-0-1793896519536 .node circle,#publish-mermaid-0-1793896519536 .node ellipse,#publish-mermaid-0-1793896519536 .node polygon,#publish-mermaid-0-1793896519536 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-0-1793896519536 .rough-node .label text,#publish-mermaid-0-1793896519536 .node .label text,#publish-mermaid-0-1793896519536 .image-shape .label,#publish-mermaid-0-1793896519536 .icon-shape .label{text-anchor:middle;}#publish-mermaid-0-1793896519536 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#publish-mermaid-0-1793896519536 .rough-node .label,#publish-mermaid-0-1793896519536 .node .label,#publish-mermaid-0-1793896519536 .image-shape .label,#publish-mermaid-0-1793896519536 .icon-shape .label{text-align:center;}#publish-mermaid-0-1793896519536 .node.clickable{cursor:pointer;}#publish-mermaid-0-1793896519536 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#publish-mermaid-0-1793896519536 .arrowheadPath{fill:#333333;}#publish-mermaid-0-1793896519536 .edgePath .path{stroke:#333333;stroke-width:1px;}#publish-mermaid-0-1793896519536 .flowchart-link{stroke:#333333;fill:none;}#publish-mermaid-0-1793896519536 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-0-1793896519536 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-0-1793896519536 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-0-1793896519536 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#publish-mermaid-0-1793896519536 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#publish-mermaid-0-1793896519536 .cluster text{fill:#333;}#publish-mermaid-0-1793896519536 .cluster span{color:#333;}#publish-mermaid-0-1793896519536 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#publish-mermaid-0-1793896519536 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#publish-mermaid-0-1793896519536 rect.text{fill:none;stroke-width:0;}#publish-mermaid-0-1793896519536 .icon-shape,#publish-mermaid-0-1793896519536 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-0-1793896519536 .icon-shape p,#publish-mermaid-0-1793896519536 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#publish-mermaid-0-1793896519536 .icon-shape .label rect,#publish-mermaid-0-1793896519536 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-0-1793896519536 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#publish-mermaid-0-1793896519536 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#publish-mermaid-0-1793896519536 .node .neo-node{stroke:#9370DB;}#publish-mermaid-0-1793896519536 data-look="neo".node rect,#publish-mermaid-0-1793896519536 data-look="neo".cluster rect,#publish-mermaid-0-1793896519536 data-look="neo".node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-0-1793896519536 data-look="neo".swimlane.cluster rect{filter:none;}#publish-mermaid-0-1793896519536 data-look="neo".node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-0-1793896519536 data-look="neo".node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-0-1793896519536 data-look="neo".node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-0-1793896519536 data-look="neo".node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-0-1793896519536 data-look="neo".node circle .state-start{fill:#000000;}#publish-mermaid-0-1793896519536 data-look="neo".icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-0-1793896519536 data-look="neo".icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-0-1793896519536 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 原始以太网帧
VXLAN封装
添加VNI

(24位虚拟网络ID)
添加UDP头

(目的端口4789)
添加IP头

(外层源/目的IP)
添加MAC头

(外层源/目的MAC)
物理网络传输
VXLAN解封装
提取原始以太网帧

该图清晰地展示了VXLAN如何通过封装原始以太网帧,利用UDP/IP网络进行传输,并在接收端进行解封装,从而实现跨三层网络的二层扩展。然而,仅有封装机制是不够的,VXLAN本身不包含任何控制平面来管理这些虚拟网络的成员关系和MAC地址学习,这便引出了对EVPN控制平面的需求。

1.1 VXLAN的局限性

虽然VXLAN解决了扩展性问题,但它本身是一个"哑"的网络隧道技术。VXLAN网关(VTEP, VXLAN Tunnel Endpoint)之间如何知道彼此的存在?一个VTEP如何学习到其他VTEP下主机的MAC地址?这些关键问题都需要一个智能的控制平面来解决。传统的静态配置方式不仅繁琐,而且无法适应动态变化的网络环境,因此,业界普遍采用EVPN作为VXLAN的控制平面。

二、EVPN控制平面:VXLAN的智能大脑

EVPN(Ethernet VPN)是一种基于BGP的控制平面协议,专为在IP/MPLS网络上提供二层和三层VPN服务而设计。当应用于VXLAN场景时,EVPN为VXLAN提供了自动发现、MAC地址学习、主机移动性支持等关键功能,使其成为一个完整的、可扩展的解决方案。

EVPN的核心思想是将二层VPN信息(如MAC地址、IP地址)作为BGP的路由属性进行通告。每个VTEP都运行一个EVPN实例(EVI, EVPN Instance),该实例对应一个VXLAN的VNI。EVPN通过在VTEP之间建立BGP对等体关系,将本地学习到的MAC/IP信息分发给所有其他VTEP,从而构建一个分布式的、全局的MAC地址表。

EVPN为VXLAN带来的价值在于:

  1. 自动化: 自动发现VTEP和主机,无需手动配置。
  2. 可扩展性: 支持大规模的二层网络扩展。
  3. 多归属: 支持主机多归属到不同VTEP,提供高可用性。
  4. 精确转发: 通过控制平面学习,实现已知单播流量的精确转发,避免不必要的泛洪。

三、MP-BGP:EVPN的"信使"协议

EVPN使用多协议BGP(MP-BGP)作为其控制平面协议。MP-BGP是标准BGP的扩展,允许BGP在单一会话中承载多种类型的路由信息。在EVPN中,MP-BGP被用来通告特定于以太网VPN的路由,这些路由被称为"EVPN路由"。

EVPN通过定义新的BGP地址家族(Address Family)来实现其功能,主要包括:

  • L2VPN EVPN: 用于二层VPN信息,如MAC/IP通告路由。
  • IPv4/IPv6 Unicast: 用于三层VPN信息。

EVPN路由包含一个或多个路由目标(Route Target, RT),用于控制路由的导入和导出。只有具有相同或匹配RT的EVPN实例才会交换和接收特定的路由信息,这实现了虚拟网络的隔离。

四、MP-BGP分发MAC地址详解

MP-BGP在EVPN中分发MAC地址是其最核心的功能。当一个VTEP在其本地VXLAN网络中学习到一个新的MAC地址时,它会创建一个"MAC/IP Advertisement Route"(MAC/IP通告路由),并通过MP-BGP会话将该路由通告给所有对等VTEP。这个过程确保了网络中所有VTEP都拥有一个一致且最新的MAC地址表。

4.1 MAC地址学习流程

一个典型的MAC地址学习流程如下:

  1. 主机A(MAC: AA:AA:AA:AA:AA:AA, IP: 10.1.1.10)连接到VTEP1。
  2. VTEP1在其本地MAC表中学习到主机A的MAC地址,并将其关联到VNI 10001和入站接口。
  3. VTEP1创建一个MAC/IP通告路由,包含主机A的MAC和IP信息,以及RT 10001:10001。
  4. VTEP1通过MP-BGP会话将此路由通告给VTEP2和VTEP3。
  5. VTEP2和VTEP3收到路由后,将其导入自己的EVPN实例,并在各自的MAC表中添加主机A的条目,指向VTEP1的VTEP IP。

这个过程可以用时序图来表示:

VTEP3 VTEP2 VTEP1 主机A VTEP3 VTEP2 VTEP1 主机A #publish-mermaid-1-1793896519611{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-1-1793896519611 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-1-1793896519611 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-1-1793896519611 .error-icon{fill:#552222;}#publish-mermaid-1-1793896519611 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-1-1793896519611 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-1-1793896519611 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-1-1793896519611 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-1-1793896519611 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-1-1793896519611 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-1-1793896519611 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-1-1793896519611 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-1-1793896519611 .marker.cross{stroke:#333333;}#publish-mermaid-1-1793896519611 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-1-1793896519611 p{margin:0;}#publish-mermaid-1-1793896519611 .actor{stroke:#9370DB;fill:#ECECFF;stroke-width:1;}#publish-mermaid-1-1793896519611 rect.actor.outer-pathdata-look="neo"{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1-1793896519611 rect.notedata-look="neo"{stroke:#aaaa33;fill:#fff5ad;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1-1793896519611 text.actor>tspan{fill:black;stroke:none;}#publish-mermaid-1-1793896519611 .actor-line{stroke:#9370DB;}#publish-mermaid-1-1793896519611 .innerArc{stroke-width:1.5;stroke-dasharray:none;}#publish-mermaid-1-1793896519611 .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#publish-mermaid-1-1793896519611 .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#publish-mermaid-1-1793896519611 id$="-arrowhead" path{fill:#333;stroke:#333;}#publish-mermaid-1-1793896519611 .sequenceNumber{fill:white;}#publish-mermaid-1-1793896519611 id$="-sequencenumber"{fill:#333;}#publish-mermaid-1-1793896519611 id$="-crosshead" path{fill:#333;stroke:#333;}#publish-mermaid-1-1793896519611 .messageText{fill:#333;stroke:none;}#publish-mermaid-1-1793896519611 .labelBox{stroke:#9370DB;fill:#ECECFF;filter:none;}#publish-mermaid-1-1793896519611 .labelText,#publish-mermaid-1-1793896519611 .labelText>tspan{fill:black;stroke:none;}#publish-mermaid-1-1793896519611 .loopText,#publish-mermaid-1-1793896519611 .loopText>tspan{fill:black;stroke:none;}#publish-mermaid-1-1793896519611 .sectionTitle,#publish-mermaid-1-1793896519611 .sectionTitle>tspan{fill:black;stroke:none;}#publish-mermaid-1-1793896519611 .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:#9370DB;fill:#9370DB;}#publish-mermaid-1-1793896519611 .note{stroke:#aaaa33;fill:#fff5ad;}#publish-mermaid-1-1793896519611 .noteText,#publish-mermaid-1-1793896519611 .noteText>tspan{fill:black;stroke:none;font-weight:normal;}#publish-mermaid-1-1793896519611 .activation0{fill:#f4f4f4;stroke:#666;}#publish-mermaid-1-1793896519611 .activation1{fill:#f4f4f4;stroke:#666;}#publish-mermaid-1-1793896519611 .activation2{fill:#f4f4f4;stroke:#666;}#publish-mermaid-1-1793896519611 .actorPopupMenu{position:absolute;}#publish-mermaid-1-1793896519611 .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}#publish-mermaid-1-1793896519611 .actor-man circle,#publish-mermaid-1-1793896519611 line{fill:#ECECFF;stroke-width:2px;}#publish-mermaid-1-1793896519611 g rect.rect{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));stroke:#9370DB;}#publish-mermaid-1-1793896519611 .node .neo-node{stroke:#9370DB;}#publish-mermaid-1-1793896519611 data-look="neo".node rect,#publish-mermaid-1-1793896519611 data-look="neo".cluster rect,#publish-mermaid-1-1793896519611 data-look="neo".node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1-1793896519611 data-look="neo".swimlane.cluster rect{filter:none;}#publish-mermaid-1-1793896519611 data-look="neo".node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1-1793896519611 data-look="neo".node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1-1793896519611 data-look="neo".node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-1-1793896519611 data-look="neo".node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1-1793896519611 data-look="neo".node circle .state-start{fill:#000000;}#publish-mermaid-1-1793896519611 data-look="neo".icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1-1793896519611 data-look="neo".icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1-1793896519611 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 学习到MAC AA:AA:AA:AA:AA:AA 在MAC表中添加条目MAC AA:AA:AA:AA:AA:AA -> VTEP1 发送数据包通告MAC/IP路由 (AA:AA:AA:AA:AA:AA, 10.1.1.10)通告MAC/IP路由 (AA:AA:AA:AA:AA:AA, 10.1.1.10)

该时序图展示了VTEP1如何通过MP-BGP将本地学习到的主机A的MAC/IP信息分发给远端VTEP2和VTEP3,从而实现全网MAC地址的同步。

4.2 EVPN路由类型与MAC条目状态

EVPN定义了多种路由类型,其中与MAC分发最相关的是Type 2(MAC/IP Advertisement Route)。这些路由的生命周期管理是EVPN高效运行的关键。VTEP上的MAC条目通常有以下几种状态:

#publish-mermaid-2-1793896519645{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-2-1793896519645 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-2-1793896519645 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-2-1793896519645 .error-icon{fill:#552222;}#publish-mermaid-2-1793896519645 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-2-1793896519645 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-2-1793896519645 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-2-1793896519645 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-2-1793896519645 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-2-1793896519645 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-2-1793896519645 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-2-1793896519645 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-2-1793896519645 .marker.cross{stroke:#333333;}#publish-mermaid-2-1793896519645 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-2-1793896519645 p{margin:0;}#publish-mermaid-2-1793896519645 defs id$="-barbEnd"{fill:#333333;stroke:#333333;}#publish-mermaid-2-1793896519645 g.stateGroup text{fill:#9370DB;stroke:none;font-size:10px;}#publish-mermaid-2-1793896519645 g.stateGroup text{fill:#333;stroke:none;font-size:10px;}#publish-mermaid-2-1793896519645 g.stateGroup .state-title{font-weight:bolder;fill:#131300;}#publish-mermaid-2-1793896519645 g.stateGroup rect{fill:#ECECFF;stroke:#9370DB;}#publish-mermaid-2-1793896519645 g.stateGroup line{stroke:#333333;stroke-width:1;}#publish-mermaid-2-1793896519645 .transition{stroke:#333333;stroke-width:1;fill:none;}#publish-mermaid-2-1793896519645 .stateGroup .composit{fill:white;border-bottom:1px;}#publish-mermaid-2-1793896519645 .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px;}#publish-mermaid-2-1793896519645 .state-note{stroke:#aaaa33;fill:#fff5ad;}#publish-mermaid-2-1793896519645 .state-note text{fill:black;stroke:none;font-size:10px;}#publish-mermaid-2-1793896519645 .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#publish-mermaid-2-1793896519645 .edgeLabel .label rect{fill:#ECECFF;opacity:0.5;}#publish-mermaid-2-1793896519645 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-2-1793896519645 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-2-1793896519645 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-2-1793896519645 .edgeLabel .label text{fill:#333;}#publish-mermaid-2-1793896519645 .label div .edgeLabel{color:#333;}#publish-mermaid-2-1793896519645 .stateLabel text{fill:#131300;font-size:10px;font-weight:bold;}#publish-mermaid-2-1793896519645 .node circle.state-start{fill:#333333;stroke:#333333;}#publish-mermaid-2-1793896519645 .node .fork-join{fill:#333333;stroke:#333333;}#publish-mermaid-2-1793896519645 .node circle.state-end{fill:#9370DB;stroke:white;stroke-width:1.5;}#publish-mermaid-2-1793896519645 .end-state-inner{fill:white;stroke-width:1.5;}#publish-mermaid-2-1793896519645 .node rect{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-2-1793896519645 .node polygon{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-2-1793896519645 id$="-barbEnd"{fill:#333333;}#publish-mermaid-2-1793896519645 .statediagram-cluster rect{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-2-1793896519645 .cluster-label,#publish-mermaid-2-1793896519645 .nodeLabel{color:#131300;}#publish-mermaid-2-1793896519645 .statediagram-cluster rect.outer{rx:5px;ry:5px;}#publish-mermaid-2-1793896519645 .statediagram-state .divider{stroke:#9370DB;}#publish-mermaid-2-1793896519645 .statediagram-state .title-state{rx:5px;ry:5px;}#publish-mermaid-2-1793896519645 .statediagram-cluster.statediagram-cluster .inner{fill:white;}#publish-mermaid-2-1793896519645 .statediagram-cluster.statediagram-cluster-alt .inner{fill:#f0f0f0;}#publish-mermaid-2-1793896519645 .statediagram-cluster .inner{rx:0;ry:0;}#publish-mermaid-2-1793896519645 .statediagram-state rect.basic{rx:5px;ry:5px;}#publish-mermaid-2-1793896519645 .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#f0f0f0;}#publish-mermaid-2-1793896519645 .note-edge{stroke-dasharray:5;}#publish-mermaid-2-1793896519645 .statediagram-note rect{fill:#fff5ad;stroke:#aaaa33;stroke-width:1px;rx:0;ry:0;}#publish-mermaid-2-1793896519645 .statediagram-note rect{fill:#fff5ad;stroke:#aaaa33;stroke-width:1px;rx:0;ry:0;}#publish-mermaid-2-1793896519645 .statediagram-note text{fill:black;}#publish-mermaid-2-1793896519645 .statediagram-note .nodeLabel{color:black;}#publish-mermaid-2-1793896519645 .statediagram .edgeLabel{color:red;}#publish-mermaid-2-1793896519645 id$="-dependencyStart",#publish-mermaid-2-1793896519645 id$="-dependencyEnd"{fill:#333333;stroke:#333333;stroke-width:1;}#publish-mermaid-2-1793896519645 .statediagramTitleText{text-anchor:middle;font-size:18px;fill:#333;}#publish-mermaid-2-1793896519645 data-look="neo".statediagram-cluster rect{fill:#ECECFF;stroke:#9370DB;stroke-width:1;}#publish-mermaid-2-1793896519645 data-look="neo".statediagram-cluster rect.outer{rx:5px;ry:5px;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-2-1793896519645 .node .neo-node{stroke:#9370DB;}#publish-mermaid-2-1793896519645 data-look="neo".node rect,#publish-mermaid-2-1793896519645 data-look="neo".cluster rect,#publish-mermaid-2-1793896519645 data-look="neo".node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-2-1793896519645 data-look="neo".swimlane.cluster rect{filter:none;}#publish-mermaid-2-1793896519645 data-look="neo".node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-2-1793896519645 data-look="neo".node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-2-1793896519645 data-look="neo".node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-2-1793896519645 data-look="neo".node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-2-1793896519645 data-look="neo".node circle .state-start{fill:#000000;}#publish-mermaid-2-1793896519645 data-look="neo".icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-2-1793896519645 data-look="neo".icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-2-1793896519645 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 收到MAC/IP路由 本地学习或从BGP学习 路由被撤销或老化 条目被删除 Learned
Advertised
Withdrawn

  • Learned (已学习): VTEP通过本地ARP/ND学习或从BGP对等体学习到MAC地址。
  • Advertised (已通告): VTEP已将该MAC地址通过BGP通告出去。
  • Withdrawn (已撤销): VTEP收到撤销该MAC地址的路由,或本地条目因老化而被删除。

这种状态机确保了MAC地址信息的准确性和时效性。

4.3 EVPN路由结构

EVPN路由本身是一个BGP NLRI(Network Layer Reachability Information),其结构可以用ER图表示,突显EVPN实例与MAC/IP路由之间的包含关系:

#publish-mermaid-3-1793896519707{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-3-1793896519707 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-3-1793896519707 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-3-1793896519707 .error-icon{fill:#552222;}#publish-mermaid-3-1793896519707 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-3-1793896519707 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-3-1793896519707 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-3-1793896519707 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-3-1793896519707 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-3-1793896519707 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-3-1793896519707 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-3-1793896519707 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-3-1793896519707 .marker.cross{stroke:#333333;}#publish-mermaid-3-1793896519707 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-3-1793896519707 p{margin:0;}#publish-mermaid-3-1793896519707 .entityBox{fill:#ECECFF;stroke:#9370DB;}#publish-mermaid-3-1793896519707 .relationshipLabelBox{fill:hsl(80, 100%, 96.2745098039%);opacity:0.7;background-color:hsl(80, 100%, 96.2745098039%);}#publish-mermaid-3-1793896519707 .relationshipLabelBox rect{opacity:0.5;}#publish-mermaid-3-1793896519707 .labelBkg{background-color:rgba(248.6666666666, 255, 235.9999999999, 0.5);}#publish-mermaid-3-1793896519707 .edgeLabel{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-3-1793896519707 .edgeLabel .label rect{fill:rgba(232,232,232, 0.8);}#publish-mermaid-3-1793896519707 .edgeLabel .label text{fill:#333;}#publish-mermaid-3-1793896519707 .edgeLabel .label{fill:#9370DB;font-size:14px;}#publish-mermaid-3-1793896519707 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#publish-mermaid-3-1793896519707 .edge-pattern-dashed{stroke-dasharray:8,8;}#publish-mermaid-3-1793896519707 .node rect,#publish-mermaid-3-1793896519707 .node circle,#publish-mermaid-3-1793896519707 .node ellipse,#publish-mermaid-3-1793896519707 .node polygon{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-3-1793896519707 .relationshipLine{stroke:#333333;stroke-width:1px;fill:none;}#publish-mermaid-3-1793896519707 .marker{fill:none!important;stroke:#333333!important;stroke-width:1;}#publish-mermaid-3-1793896519707 data-look=neo.labelBkg{background-color:rgba(248.6666666666, 255, 235.9999999999, 0.5);}#publish-mermaid-3-1793896519707 .node .neo-node{stroke:#9370DB;}#publish-mermaid-3-1793896519707 data-look="neo".node rect,#publish-mermaid-3-1793896519707 data-look="neo".cluster rect,#publish-mermaid-3-1793896519707 data-look="neo".node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-3-1793896519707 data-look="neo".swimlane.cluster rect{filter:none;}#publish-mermaid-3-1793896519707 data-look="neo".node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-3-1793896519707 data-look="neo".node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-3-1793896519707 data-look="neo".node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-3-1793896519707 data-look="neo".node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-3-1793896519707 data-look="neo".node circle .state-start{fill:#000000;}#publish-mermaid-3-1793896519707 data-look="neo".icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-3-1793896519707 data-look="neo".icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-3-1793896519707 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} contains EVPN Instance (EVI)
string
evi_id
string
rd
MAC/IP Advertisement Route
string
mac_address
string
ip_address
string
rd
string
rt

该图展示了EVPN实例(EVI)如何通过包含MAC/IP通告路由来管理其内部的MAC地址信息。每个路由都携带了路由区分符(RD)和路由目标(RT),用于全局唯一性和路由控制。

4.4 未知单播流量的处理:泛洪与学习

当VTEP1收到一个目的MAC为BB:BB:BB:BB:BB:BB的未知单播流量时,由于本地MAC表中没有该条目,VXLAN会执行"泛洪与学习"机制:

  1. VTEP1检查本地MAC表,发现目的MAC未知。
  2. VTEP1将该数据包封装成VXLAN报文,并泛洪到所有其他VTEP(VTEP2, VTEP3)。
  3. VTEP2和VTEP3收到泛洪的报文后,学习到源MAC(AA:AA:AA:AA:AA:AA)与VTEP1的关联,并更新自己的MAC表。
  4. 如果VTEP2或VTEP3知道目的MAC BB:BB:BB:BB:BB:BB,它们会将报文解封装并转发给目的主机。否则,它们会继续泛洪,直到找到目的主机或TTL超时。

这个过程确保了即使在没有精确MAC信息的情况下,数据包也能到达目的地,同时完成MAC地址的分布式学习。

#publish-mermaid-4-1793896519763{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-4-1793896519763 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-4-1793896519763 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-4-1793896519763 .error-icon{fill:#552222;}#publish-mermaid-4-1793896519763 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-4-1793896519763 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-4-1793896519763 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-4-1793896519763 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-4-1793896519763 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-4-1793896519763 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-4-1793896519763 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-4-1793896519763 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-4-1793896519763 .marker.cross{stroke:#333333;}#publish-mermaid-4-1793896519763 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-4-1793896519763 p{margin:0;}#publish-mermaid-4-1793896519763 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#publish-mermaid-4-1793896519763 .cluster-label text{fill:#333;}#publish-mermaid-4-1793896519763 .cluster-label span{color:#333;}#publish-mermaid-4-1793896519763 .cluster-label span p{background-color:transparent;}#publish-mermaid-4-1793896519763 .label text,#publish-mermaid-4-1793896519763 span{fill:#333;color:#333;}#publish-mermaid-4-1793896519763 .node rect,#publish-mermaid-4-1793896519763 .node circle,#publish-mermaid-4-1793896519763 .node ellipse,#publish-mermaid-4-1793896519763 .node polygon,#publish-mermaid-4-1793896519763 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-4-1793896519763 .rough-node .label text,#publish-mermaid-4-1793896519763 .node .label text,#publish-mermaid-4-1793896519763 .image-shape .label,#publish-mermaid-4-1793896519763 .icon-shape .label{text-anchor:middle;}#publish-mermaid-4-1793896519763 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#publish-mermaid-4-1793896519763 .rough-node .label,#publish-mermaid-4-1793896519763 .node .label,#publish-mermaid-4-1793896519763 .image-shape .label,#publish-mermaid-4-1793896519763 .icon-shape .label{text-align:center;}#publish-mermaid-4-1793896519763 .node.clickable{cursor:pointer;}#publish-mermaid-4-1793896519763 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#publish-mermaid-4-1793896519763 .arrowheadPath{fill:#333333;}#publish-mermaid-4-1793896519763 .edgePath .path{stroke:#333333;stroke-width:1px;}#publish-mermaid-4-1793896519763 .flowchart-link{stroke:#333333;fill:none;}#publish-mermaid-4-1793896519763 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-4-1793896519763 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-4-1793896519763 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-4-1793896519763 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#publish-mermaid-4-1793896519763 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#publish-mermaid-4-1793896519763 .cluster text{fill:#333;}#publish-mermaid-4-1793896519763 .cluster span{color:#333;}#publish-mermaid-4-1793896519763 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#publish-mermaid-4-1793896519763 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#publish-mermaid-4-1793896519763 rect.text{fill:none;stroke-width:0;}#publish-mermaid-4-1793896519763 .icon-shape,#publish-mermaid-4-1793896519763 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-4-1793896519763 .icon-shape p,#publish-mermaid-4-1793896519763 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#publish-mermaid-4-1793896519763 .icon-shape .label rect,#publish-mermaid-4-1793896519763 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-4-1793896519763 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#publish-mermaid-4-1793896519763 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#publish-mermaid-4-1793896519763 .node .neo-node{stroke:#9370DB;}#publish-mermaid-4-1793896519763 data-look="neo".node rect,#publish-mermaid-4-1793896519763 data-look="neo".cluster rect,#publish-mermaid-4-1793896519763 data-look="neo".node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-4-1793896519763 data-look="neo".swimlane.cluster rect{filter:none;}#publish-mermaid-4-1793896519763 data-look="neo".node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-4-1793896519763 data-look="neo".node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-4-1793896519763 data-look="neo".node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-4-1793896519763 data-look="neo".node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-4-1793896519763 data-look="neo".node circle .state-start{fill:#000000;}#publish-mermaid-4-1793896519763 data-look="neo".icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-4-1793896519763 data-look="neo".icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-4-1793896519763 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 未知 是 是 否 未知单播流量

目的MAC: BB:BB:BB:BB:BB:BB
VTEP1

检查MAC表
泛洪到所有VTEP?
VTEP2, VTEP3
学习源MAC

AA:AA:AA:AA:AA:AA -> VTEP1
VTEP2/VTEP3知道目的MAC?
解封装并转发
继续泛洪或丢弃

4.5 已知单播流量的处理:精确转发

一旦MAC地址通过MP-BGP分发并在所有VTEP上学习完成,网络就进入了精确转发阶段。当VTEP1收到一个目的MAC为BB:BB:BB:BB:BB:BB的已知单播流量时:

  1. VTEP1在其MAC表中查找目的MAC BB:BB:BB:BB:BB:BB。
  2. 找到对应的VTEP IP(例如VTEP2的IP)。
  3. VTEP1将数据包封装成VXLAN报文,目的IP为VTEP2的IP。
  4. 通过IP网络将报文直接发送给VTEP2。
  5. VTEP2收到报文后,解封装并转发给目的主机。

这个过程避免了不必要的网络泛洪,大大提高了网络效率。

#publish-mermaid-5-1793896519824{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-5-1793896519824 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-5-1793896519824 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-5-1793896519824 .error-icon{fill:#552222;}#publish-mermaid-5-1793896519824 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-5-1793896519824 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-5-1793896519824 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-5-1793896519824 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-5-1793896519824 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-5-1793896519824 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-5-1793896519824 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-5-1793896519824 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-5-1793896519824 .marker.cross{stroke:#333333;}#publish-mermaid-5-1793896519824 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-5-1793896519824 p{margin:0;}#publish-mermaid-5-1793896519824 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#publish-mermaid-5-1793896519824 .cluster-label text{fill:#333;}#publish-mermaid-5-1793896519824 .cluster-label span{color:#333;}#publish-mermaid-5-1793896519824 .cluster-label span p{background-color:transparent;}#publish-mermaid-5-1793896519824 .label text,#publish-mermaid-5-1793896519824 span{fill:#333;color:#333;}#publish-mermaid-5-1793896519824 .node rect,#publish-mermaid-5-1793896519824 .node circle,#publish-mermaid-5-1793896519824 .node ellipse,#publish-mermaid-5-1793896519824 .node polygon,#publish-mermaid-5-1793896519824 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-5-1793896519824 .rough-node .label text,#publish-mermaid-5-1793896519824 .node .label text,#publish-mermaid-5-1793896519824 .image-shape .label,#publish-mermaid-5-1793896519824 .icon-shape .label{text-anchor:middle;}#publish-mermaid-5-1793896519824 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#publish-mermaid-5-1793896519824 .rough-node .label,#publish-mermaid-5-1793896519824 .node .label,#publish-mermaid-5-1793896519824 .image-shape .label,#publish-mermaid-5-1793896519824 .icon-shape .label{text-align:center;}#publish-mermaid-5-1793896519824 .node.clickable{cursor:pointer;}#publish-mermaid-5-1793896519824 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#publish-mermaid-5-1793896519824 .arrowheadPath{fill:#333333;}#publish-mermaid-5-1793896519824 .edgePath .path{stroke:#333333;stroke-width:1px;}#publish-mermaid-5-1793896519824 .flowchart-link{stroke:#333333;fill:none;}#publish-mermaid-5-1793896519824 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-5-1793896519824 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-5-1793896519824 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-5-1793896519824 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#publish-mermaid-5-1793896519824 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#publish-mermaid-5-1793896519824 .cluster text{fill:#333;}#publish-mermaid-5-1793896519824 .cluster span{color:#333;}#publish-mermaid-5-1793896519824 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#publish-mermaid-5-1793896519824 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#publish-mermaid-5-1793896519824 rect.text{fill:none;stroke-width:0;}#publish-mermaid-5-1793896519824 .icon-shape,#publish-mermaid-5-1793896519824 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-5-1793896519824 .icon-shape p,#publish-mermaid-5-1793896519824 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#publish-mermaid-5-1793896519824 .icon-shape .label rect,#publish-mermaid-5-1793896519824 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-5-1793896519824 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#publish-mermaid-5-1793896519824 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#publish-mermaid-5-1793896519824 .node .neo-node{stroke:#9370DB;}#publish-mermaid-5-1793896519824 data-look="neo".node rect,#publish-mermaid-5-1793896519824 data-look="neo".cluster rect,#publish-mermaid-5-1793896519824 data-look="neo".node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-5-1793896519824 data-look="neo".swimlane.cluster rect{filter:none;}#publish-mermaid-5-1793896519824 data-look="neo".node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-5-1793896519824 data-look="neo".node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-5-1793896519824 data-look="neo".node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-5-1793896519824 data-look="neo".node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-5-1793896519824 data-look="neo".node circle .state-start{fill:#000000;}#publish-mermaid-5-1793896519824 data-look="neo".icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-5-1793896519824 data-look="neo".icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-5-1793896519824 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 已知 是 已知单播流量

目的MAC: BB:BB:BB:BB:BB:BB
VTEP1

检查MAC表
找到目的VTEP IP?
VXLAN封装

目的IP: VTEP2_IP
发送到VTEP2
VTEP2

解封装并转发

五、总结与展望

VXLAN与EVPN控制平面的结合,通过MP-BGP分发MAC地址,为现代数据中心网络提供了一个强大、可扩展且自动化的解决方案。MP-BGP作为控制协议,不仅解决了VXLAN的控制平面缺失问题,还带来了精确转发、主机移动性支持等高级功能。

通过本文的讲解和图表展示,我们可以清晰地看到,EVPN通过将MAC/IP信息作为BGP路由进行通告,实现了VTEP之间的自动化发现和MAC地址的分布式学习。这种机制使得构建大规模、多租户的二层 Overlay 网络成为可能,为云原生应用和微服务架构提供了坚实的网络基础。

未来,随着网络技术的不断发展,EVPN将继续演进,支持更丰富的功能,如IPv6、组播优化等,进一步推动数据中心网络的智能化和自动化。

相关推荐
gwf2161 个月前
国产RDMA网卡驱动现状、挑战与未来:从内核上游到数据中心实践
rdma·rocev2·linuxkernel·数据中心网络·devicedriver·auxiliarybus·erdma
茶乡浪子5 个月前
基于IPv4网络分布式网关动态VXLAN配置示例
网络·数据中心·vxlan·华为vxlan·华为数据中心网络·bgp evpn·数据中心网络工程师
茶乡浪子6 个月前
同子网基于IPv4网络静态VXLAN配置示例(下)
运维·网络·数据中心·vxlan·evpn·华为vxlan·华为数据中心网络
qhqh3108 个月前
华为设备上配置EVPN over vxlan实验
vxlan·evpn
高铭杰8 个月前
QEMU网络配置1
qemu·vxlan
河码匠10 个月前
VXLAN 简介、实现虚拟机跨物理机通信和网络隔离
网络·vxlan
apple_ttt1 年前
为 CPU 减负:数据中心网络卸载技术的演进
网络·dpdk·数据平面·数据中心网络·toe
apple_ttt1 年前
融合:迈向 “一台计算机” 的终极架构
网络·架构·cxl·数据中心网络