這一次要稍微提一下有關 P4 Switch以及相關的設計。
P4 Switch 這一個 repo 中其實整合了許多不同的元件,如下:
- Software switch(透過 switch.p4 產生)
- Resource Mgmt. API(透過 switch.p4 產生)
- Switch API
- Switch Abstraction Interface(SAI)
- Switchlink(Linux netlink listener)
下圖表示了他們的關係(取自官方 GitHub):
+-----+ +-----+ +-----+ +-----+
|App a| |App j| |App n| |App z|
| |...| |...| |...| |
+-----+ +-----+ +-----+ +-----+
| | | |
| | +----| |
+------------+ | |
| Switchlink | | |
| |<-----------------------------+
+------------------+ | |
| SAI | | |
| | | |
+-----------------------+ |
| Switch API | |
| | |
+-----------------------+---------+ |
| Resource Mgmt. API | |
| (auto-gen. from switch.p4) | | Netlink events
+---------------------------------+ |
| Soft Switch | |
| (compiled from switch.p4) | |
+---------------------------------+ |
|
|
+---------------------------------------------------+
| Kernel |
| |
+---------------------------------------------------+
其實 switch.p4 是來自於 DC.p4 這一篇論文,他明定了在 Data center 中的 Switch 該如何用 P4 去定義出來,後來就延伸成為了 switch.p4 這一個 repo。
switch.p4 包含了以下功能(取自官方 GitHub):
- Basic L2 Switching: Flooding, learning and STP
- L2 Multicast
- Basic L3 Routing (unicast): IPv4 and IPv6 and VRF
- L3 Multicast
- LAG
- ECMP
- Tunneling: VXLAN and NVGRE (including L2/L3 Gateway), Geneve, and GRE
- Basic ACL: MAC and IP ACLs
- Unicast RPF check
- MPLS: LER, LSR, IPVPN, VPLS, L2VPN
- Host interface
- Mirroring: Ingress and egress mirroring with ERSPAN
- Counters/Statistics
- Ingress Policers
- Inband Network Telemetry (INT)
接下來幾篇會依序介紹 Switch API、SAI 以及 Switch link 這三個元件
感谢博主,我刷完了你写的P4相关的文章,写得挺赞!!清晰明了!!看了你的Github也很赞!加油!!
谢谢您的支持
我在运行behavioral-model的时候,出现了这个错误,请问是怎么回事啊,
求指教
behbmi_port_interface_add(port_mgr, veth_name, n_veth, pcap_filename): ERROR -1 at main.c:430
您好,請問有其他的log或是你的執行script嗎?