Advanced Search
Turn off MathJax
Article Contents
TU Huaqing, WANG Yuanhong, XU Qi, ZHU Jun, ZOU Tao, LONG Keping. A Polymorphic Network Backend Compiler for Domestic Switching Chips[J]. Journal of Electronics & Information Technology. doi: 10.11999/JEIT250132
Citation: TU Huaqing, WANG Yuanhong, XU Qi, ZHU Jun, ZOU Tao, LONG Keping. A Polymorphic Network Backend Compiler for Domestic Switching Chips[J]. Journal of Electronics & Information Technology. doi: 10.11999/JEIT250132

A Polymorphic Network Backend Compiler for Domestic Switching Chips

doi: 10.11999/JEIT250132 cstr: 32379.14.JEIT250132
Funds:  National Key Research and Development Project of China (No. 2022YFB2901503), National Natural Science Foundation of China (No. U22A2005), Key R&D Program of Zhejiang (2024SSYS0001), China Postdoctoral Science Foundation (No. 2024M75986).
  • Received Date: 2025-03-05
  • Accepted Date: 2025-11-03
  • Rev Recd Date: 2025-11-03
  • Available Online: 2025-11-08
  •   Objective  The P4 language and programmable switching chips provide a feasible solution for the deployment of polymorphic networks. However, polymorphic network packets written in P4 cannot be directly executed on the domestically produced TsingMa.MX programmable switching chip from Centec, necessitating the design of a specialized compiler to translate and deploy P4 language onto this chip. Existing backend compilers are primarily designed and optimized for software-programmable switches such as BMv2, FPGAs, and Intel Tofino series chips, making them unsuitable for compiling polymorphic network programs on the TsingMa.MX chip. To address this issue, this paper proposes p4c-TsingMa, a backend compiler tailored for the TsingMa.MX switching chip. This compiler enables the translation of high-level network programming languages into executable formats for the TsingMa.MX chip, allowing it to simultaneously support the parsing and forwarding of multiple types of network modal packets.  Methods  p4c-TsingMa first employs a preorder traversal method to extract key information such as protocol types, protocol fields, and actions from the Intermediate Representation (IR). Then performs instruction translation, ultimately generating control commands for the TsingMa.MX chip. Additionally, p4c-TsingMa adopts a UDF entry merging method to consolidate matching instructions from different network modalities into a single lookup table, enabling the extraction of multiple modal matching entries in one operation and significantly improving the utilization of chip resources.  Results and Discussions  This paper implements the p4c-TsingMa compiler using C++, which maps network modal programs written in P4 language into chip configurations for the TsingMa.MX switching chip. A polymorphic network packet testing environment (Fig. 7) is established, where multiple types of network data packets are simultaneously sent to the same port of the switch. The chip, following the flow table configuration, successfully identifies polymorphic network data packets and forwards them to their corresponding ports (Fig. 9). Additionally, the table entry merging algorithm improves register resource utilization by 37.5% to 75%, enabling the chip to process more than two types of modal data packets in parallel.  Conclusions  This paper designs a polymorphic network backend compiler, p4c-TsingMa, specifically for domestic switching chip. By leveraging the FlexParser and FlexEdit capabilities of the TsingMa chip, the compiler translates polymorphic network programs into TsingMa.MX chip commands, enabling the chip to parse and edit polymorphic data packets. Experimental results demonstrate that p4c-TsingMa achieves high compilation efficiency and improves register resource utilization by 37.5% to 75%.
  • loading
  • [1]
    凃化清, 廖君虎, 朱俊, 等. 多模态网络环境下网络模态共存与优化部署方法[J]. 电子学报, 2025, 53(5): 1650–1660. doi: 10.12263/DZXB.20250015.

    TU Huaqing, LIAO Junhu, ZHU Jun, et al. Network modal coexistence and optimal deployment method in polymorphic network environment[J]. Acta Electronica Sinica, 2025, 53(5): 1650–1660. doi: 10.12263/DZXB.20250015.
    [2]
    WU Jiangxing, LI Junfei, SUN Penghao, et al. Theoretical framework for a polymorphic network environment[J]. Engineering, 2024, 39: 222–234. doi: 10.1016/j.eng.2024.01.018.
    [3]
    邬江兴, 胡宇翔. 网络技术体系与支撑环境分离的发展范式[J]. 信息通信技术与政策, 2021, 47(8): 1–11. doi: 10.12267/j.issn.2096-5931.2021.08.001.

    WU Jiangxing and HU Yuxiang. The development paradigm of separation between network technical system and supporting environment[J]. Information and Communications Technology and Policy, 2021, 47(8): 1–11. doi: 10.12267/j.issn.2096-5931.2021.08.001.
    [4]
    HU Yuxiang, LI Dan, SUN Penghao, et al. Polymorphic smart network: An open, flexible and universal architecture for future heterogeneous networks[J]. IEEE Transactions on Network Science and Engineering, 2020, 7(4): 2515–2525. doi: 10.1109/tnse.2020.3006249.
    [5]
    BOSSHART P, DALY D, GIBB G, et al. P4: Programming protocol-independent packet processors[J]. ACM SIGCOMM Computer Communication Review, 2014, 44(3): 87–95. doi: 10.1145/2656877.2656890.
    [6]
    Tofino[EB/OL]. https://www.barefootnetworks.com/products/brief-tofino, 2025. (查阅网上资料,请核对网址与文献是否相符).
    [7]
    Centec. CTC8180[EB/OL]. https://www.centec.com/silicon/26, 2025. (查阅网上资料,请核对网址与文献是否相符).
    [8]
    HAUSER F, HÄBERLE M, MERLING D, et al. A survey on data plane programming with P4: Fundamentals, advances, and applied research[J]. Journal of Network and Computer Applications, 2023, 212: 103561. doi: 10.1016/j.jnca.2022.103561.
    [9]
    YANG Y Fifan, HE Lin, ZHOU Jiasheng, et al. P4runpro: Enabling runtime programmability for RMT programmable switches[C]. Proceedings of the ACM SIGCOMM 2024 Conference, Sydney, Australia, 2024: 921–937. doi: 10.1145/3651890.3672230.
    [10]
    CHEN Zhikang, FENG Yong, LIU Shuxin, et al. OptimusPrime: Unleash dataplane programmability through a transformable architecture[C]. Proceedings of the ACM SIGCOMM 2024 Conference, Sydney, Australia, 2024: 904–920. doi: 10.1145/3651890.3672214.
    [11]
    WANG Tao, YANG Xiangrui, ANTICHI G, et al. Isolation mechanisms for high-speed packet-processing pipelines[C]. Proceedings of the 19th USENIX Symposium on Networked Systems Design and Implementation, Renton, USA, 2022: 1289–1305.
    [12]
    LU Chenyunfei, TANG Zhu, PENG Wei, et al. Running P4 programs on general programmable network interconnection chips[C]. Proceedings of 2023 Fourth International Conference on Frontiers of Computers and Communication Engineering, Xiamen, China, 2023: 1–6. doi: 10.1109/fcce58525.2023.00008.
    [13]
    DA ROBIN D and KHAN J I. An open-source P416 compiler backend for reconfigurable match-action table switches: Making networking innovation accessible[J]. Computer Networks, 2024, 242: 110246. doi: 10.1016/j.comnet.2024.110246.
    [14]
    GAO Jiaqi, ZHAI Ennan, LIU H H, et al. Lyra: A cross-platform language and compiler for data plane programming on heterogeneous ASICs[C]. Proceedings of the Annual Conference of the ACM Special Interest Group on Data Communication on the Applications, Technologies, Architectures, and Protocols for Computer Communication, 2020: 435–450. doi: 10.1145/3387514.3405879. (查阅网上资料,未找到对应的出版地信息,请确认).
    [15]
    LI Yifan, GAO Jiaqi, ZHAI Ennan, et al. Cetus: Releasing P4 programmers from the chore of trial and error compiling[C]. Proceedings of the 19th USENIX Symposium on Networked Systems Design and Implementation, Renton, USA, 2022: 371–385.
    [16]
    DANGETI T K, KEERTHY S V, and UPADRASTA R. P4LLVM: An LLVM based P4 compiler[C]. Proceedings of the 26th International Conference on Network Protocols, Cambridge, UK, 2018: 424–429. doi: 10.1109/icnp.2018.00059.
    [17]
    GAO Xiangyu, KIM T, WONG M D, et al. Switch code generation using program synthesis[C]. Proceedings of the Annual Conference of the ACM Special Interest Group on Data Communication on the Applications, Technologies, Architectures, and Protocols for Computer Communication, 2020: 44–61. doi: 10.1145/3387514.3405852. (查阅网上资料,未找到对应的出版地信息,请确认).
    [18]
    WANG Han, SOULÉ R, DANG H T, et al. P4FPGA: A rapid prototyping framework for P4[C]. Proceedings of the Symposium on SDN Research, Santa Clara, USA, 2017: 122–135. doi: 10.1145/3050220.3050234.
    [19]
    p4c, a reference compiler for P4 programming language[EB/OL]. https://github.com/p4lang/p4c, 2025. (查阅网上资料,请核对网址与文献是否相符).
    [20]
    HARKOUS H, PAPAGIANNI C, DE SCHEPPER K, et al. Virtual queues for P4: A poor man’s programmable traffic manager[J]. IEEE Transactions on Network and Service Management, 2021, 18(3): 2860–2872. doi: 10.1109/tnsm.2021.3077051.
    [21]
    VENKATAKEERTHY S, ANDALURI Y, DEY S, et al. Packet processing algorithm identification using program embeddings[C]. Proceedings of the 6th Asia-Pacific Workshop on Networking, Fuzhou, China, 2022: 76–82. doi: 10.1145/3542637.3542649.
    [22]
    VENKATAKEERTHY S, AGGARWAL R, JAIN S, et al. IR2VEC: LLVM IR based scalable program embeddings[J]. ACM Transactions on Architecture and Code Optimization (TACO), 2020, 17(4): 32. doi: 10.1145/3418463.
  • 加载中

Catalog

    通讯作者: 陈斌, bchen63@163.com
    • 1. 

      沈阳化工大学材料科学与工程学院 沈阳 110142

    1. 本站搜索
    2. 百度学术搜索
    3. 万方数据库搜索
    4. CNKI搜索

    Figures(8)  / Tables(5)

    Article Metrics

    Article views (17) PDF downloads(3) Cited by()
    Proportional views
    Related

    /

    DownLoad:  Full-Size Img  PowerPoint
    Return
    Return