电子科技 ›› 2024, Vol. 37 ›› Issue (1): 48-54.doi: 10.16180/j.cnki.issn1007-7820.2024.01.007

• • 上一篇    下一篇

基于FPGA的千兆以太网端口通信设计

兰唯1,2,韩延喆1,2,扈啸1   

  1. 1.国防科技大学 计算机学院,湖南 长沙 410073
    2.长沙人才集团有限公司,湖南 长沙 410073
  • 收稿日期:2022-09-08 出版日期:2024-01-15 发布日期:2024-01-11
  • 作者简介:兰唯(1986-),女,工程师。研究方向:电子与通信工程。|韩延喆(1986-),男,工程师。研究方向:无线网络与路由器体系结构。|扈啸(1977-),男,博士,研究员。研究方向:嵌入式系统。
  • 基金资助:
    国家科技重大专项(2017-V-0014-0066)

Design of Gigabit Ethernet Port Communication Based on FPGA

LAN Wei1,2,HAN Yanzhe1,2,HU Xiao1   

  1. 1. School of Computer,National University of Defense Technology,Changsha 410073,China
    2. Changsha Talent Group Co., Ltd.,Changsha 410073,China
  • Received:2022-09-08 Online:2024-01-15 Published:2024-01-11
  • Supported by:
    National Science and Technology Major Project(2017-V-0014-0066)

摘要:

针对嵌入式领域中以太网传输速率以及实时性问题,文中提出了一种基于FPGA(Field Programmable Gate Array)的千兆以太网端口通信的设计方案。设计了千兆以太网交换机的转发功能,基于标签转发实现了端对端数据通信。CPU(Central Processing Unit)发出带有标签的数据报文,通过千兆网口输出数据报文,经过RGMII(Reduced Gigabit Media Independent Interface)接口将带标签的数据报文发送给FPGA,FPGA通过内部逻辑判断标签中的输出端口号域并去除标签,从相应千兆网口向连接设备输出数据报文。外设通过千兆网端口输入数据报文,通过SGMII(Serial Gigabit Media Independent Interface)协议将数据报文发送给FPGA,FPGA通过内部逻辑添加标签并轮询输出给CPU,从而实现多个千兆网口连接设备互通。实验结果验证了FPGA逻辑的可行性和有效性,传输速率达到1 Gbit·s-1,报文转发延时小于100 μs,报文丢包率为0%,数据传输稳定性较高,满足现有项目的实际需求。

关键词: FPGA, 千兆以太网, 以太网交换机, 标签, CPU, 数据报文, RGMII接口, SGMII协议

Abstract:

In view of the problem of Ethernet transmission rate and real-time in embedded field, a design of Gigabit Ethernet port communication based on FPGA(Field Programmable Gate Array)is proposed. This study designs the forwarding function of Gigabit Ethernet switch, and implements end-to-end data communication based on label forwarding. Datagrams with label are sent by CPU(Central Processing Unit), and are outputted through Gigabit Ethernet interface, and are sent to FPGA through RGMII(Reduced Gigabit Media Independent Interface)port. FPGA judges output port number field in label through internal logic and removes label, and outputs datagrams to connecting device from corresponding Gigabit Ethernet interface. Peripherals input datagrams through Gigabit Ethernet ports, and send datagrams to FPGA through SGMII(Serial Gigabit Media Independent Interface) protocol. FPGA adds labels through internal logic and outputs them to CPU through polling, so as to realize interworking of connecting devices of multiple Gigabit Ethernet interface. The experimental results reveal the feasibility and effectiveness of the FPGA logic. The transmission rate reaches 1 Gbit·s-1, the datagrams forwarding delay is less than 100 μs, and the packet loss rate is 0%,which indicates that the data transmission stability is high, and the proposed design meets the actual needs of existing projects.

Key words: FPGA, Gigabit Ethernet, ethernet switch, label, CPU, datagram, RGMII interface, SGMII protocol

中图分类号: 

  • TN79