Circuit structure of Ethernet switch and frame processing method
By using asynchronous buffering FIFO and hash tables to process MAC addresses in small Ethernet switches, combined with the sliced shared cache module, the problem of frame processing delay and unreliability is solved, more efficient frame synthesis and forwarding are achieved, and significantly improved Switch performance.
Patent Information
- Application Number
- CN202411005441.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-10-01
AI Technical Summary
Existing small Ethernet switches suffer from delays and unreliability in frame processing, especially when processing destination and source address information during frame synthesis, resulting in low frame synthesis efficiency.
Asynchronous buffer FIFO is used for data storage. The frame combining module uses absolute priority to read Ethernet frames. The frame processing module uses a hash table to process MAC addresses and create local headers. The shared cache module uses sliced shared cache to store data and send ports. The forwarding frame is synthesized based on the destination MAC address and cached packets to avoid adding destination MAC address information in the frame processing module.
It improves the stability and forwarding efficiency of frame synthesis, reduces time delay, significantly improves the processing speed and performance of Ethernet switches, and alleviates congestion pressure.
Smart Images

Figure CN118740765A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Ethernet switches, and in particular to a circuit structure and a frame processing method of an Ethernet switch. Background Art
[0002] In existing small Ethernet switches, due to the transmission characteristics specified by the IEEE802.3 protocol, frame header synthesis of forwarding frames is generally performed in a frame processing module or a sending port to meet the requirements of the Ethernet transmission protocol.
[0003] If you choose to synthesize the forwarding frame in the frame processing module, you need to process the destination MAC information and source address MAC information of the received frame, search and learn them respectively, and put the destination MAC information data on the bus, which will cause a considerable delay time. This delay increases the unreliability of frame synthesis. If you choose to synthesize the forwarding frame on the sending port, the synchronous cache of the destination MAC address information will become a new problem, which occupies a considerable area in the shared cache.
[0004] It can be seen that how to quickly complete the link layer data frame processing link and improve its forwarding efficiency is an urgent problem to be solved. Summary of the invention
[0005] The present application provides a circuit structure and frame processing method of an Ethernet switch, which can be applied to a small Ethernet switch to improve the stability of its frame synthesis and the time efficiency of frame forwarding, so that it can respond faster and process at a higher speed.
[0006] In order to achieve the above object, the present invention adopts the following technical scheme:
[0007] In a first aspect, the present invention provides a circuit structure of an Ethernet switch, comprising:
[0008] A receiving port for receiving Ethernet frames, which uses an asynchronous buffer FIFO for data storage;
[0009] A frame combining module, used for reading Ethernet frames of receiving ports with absolute priority, combining Ethernet frames, and then sending them to the frame processing module, which uses an anti-congestion mechanism. The anti-congestion mechanism is that when the FIFO of the receiving port with a low priority is full, one Ethernet frame is processed according to the priority.
[0010] A frame processing module, configured to process the MAC address of the Ethernet frame using a hash table, create a local header, combine the local header with the Ethernet frame to obtain a cache packet, send the cache packet to a shared cache module, and send the destination MAC address of the Ethernet frame to a sending port;
[0011] A shared cache module, used to store received data using a sliced shared cache and send the cache packet to a corresponding sending port;
[0012] The sending port is used to synthesize a forwarding frame that meets the target protocol based on the destination MAC address of the Ethernet frame and the cache packet, and send the forwarding frame.
[0013] In a preferred example of the present application, it can be further configured that the frame processing module further includes:
[0014] The aging mechanism is used to clean up table items that have not been used for a long time to prevent them from occupying the storage space of the hash table.
[0015] In a preferred example of the present application, it can be further set that the cache size of the shared cache module is set to be no less than 256kb.
[0016] In a preferred example of the present application, it can be further configured that the frame processing module further includes:
[0017] Used to expand the data of the cache packet to satisfy an integer multiple of 64 bytes.
[0018] In a preferred example of the present application, it can be further configured that the receiving port further includes:
[0019] Used for frame length counting, CRC check, CRC error statistics, frame length error statistics and physical layer reception error statistics.
[0020] In a preferred example of the present application, it can be further configured that the frame combining module further includes:
[0021] Used to discard the Ethernet frame with CRC check error, length error, and physical layer reception error.
[0022] In a preferred example of the present application, it can be further configured that the shared cache module uses a secondary linked list for caching, wherein the pointer logic of the primary linked list is a first-in-first-out queue.
[0023] In a preferred example of the present application, it can be further configured that the CRC check adopts the CRC32-MPEG2 standard.
[0024] In a preferred example of the present application, it can be further configured that the sending port uses an asynchronous buffer FIFO for data storage.
[0025] In a second aspect, the present application further provides a frame processing method of an Ethernet switch, based on the circuit structure of any one of the Ethernet switches, comprising:
[0026] Step 100: The receiving port module receives the Ethernet frame;
[0027] Step 200: The frame combining module uses absolute priority to read the Ethernet frames of the receiving port, combines the Ethernet frames, and then sends them to the frame processing module;
[0028] Step 300: The frame processing module processes the MAC address of the Ethernet frame using a hash table, creates a local header, combines the local header with the Ethernet frame to obtain a cache packet, sends the cache packet to the shared cache module, and sends the destination MAC address of the Ethernet frame to the sending port;
[0029] Step 400: The shared cache module uses the sliced shared cache to store the received data and sends the cache packet to the corresponding sending port;
[0030] Step 500: The sending port synthesizes a forwarding frame that meets the target protocol based on the destination MAC address of the Ethernet frame and the cache packet, and sends the forwarding frame.
[0031] In summary, compared with the prior art, the technical solution provided in the embodiment of the present application has at least the following beneficial effects:
[0032] The circuit structure of an Ethernet switch provided by the present application, first, receives Ethernet frames through a receiving port, uses an asynchronous buffer FIFO for data storage, and a frame combining module uses an absolute priority to read the Ethernet frames of the receiving port, combines the Ethernet frames, and can prevent data congestion and improve the time efficiency of receiving and processing Ethernet frames. Second, by creating a local header in the frame processing module, combining the local header and the Ethernet frame to obtain a cache packet, sending the cache packet to the shared cache module, sending the destination MAC address of the Ethernet frame to the sending port, and finally synthesizing a forwarding frame that meets the target protocol based on the destination MAC address of the Ethernet frame and the cache packet at the sending port, it is realized that there is no need to add the destination MAC address information in the frame processing module, that is, avoid synthesizing the forwarding frame in the frame processing module, reduce the time delay caused by frame processing, and improve the time efficiency and reliability of the Ethernet switch in processing data. Third, the circuit structure of the present application can avoid delaying the addition of destination address information in the sending port module, improve the time efficiency of Ethernet frame synthesis, and significantly improve the performance of the switch. A congestion mechanism is designed in the frame processing and combining module. When the low-level priority queue is congested, a complete data packet will be forced to be read in priority order, alleviating the congestion pressure. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A structural diagram of the circuit structure of an Ethernet switch provided by an embodiment of the present application.
[0034] Figure 2A data flow diagram of a circuit structure of an Ethernet switch provided by one embodiment of the present application. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0036] In one embodiment of the present application, a circuit structure of an Ethernet switch is provided. Figure 1 As shown, including:
[0037] The receiving port 100 is used to receive Ethernet frames, and uses an asynchronous buffer FIFO for data storage;
[0038] The frame combining module 200 is used to read the Ethernet frames of the receiving port with absolute priority, combine the Ethernet frames, and then send them to the frame processing module, which uses an anti-congestion mechanism. The anti-congestion mechanism is that when the FIFO of the low-priority receiving port is full, one of the Ethernet frames is processed according to the priority;
[0039] A frame processing module 300, configured to process the MAC address of the Ethernet frame using a hash table, create a local header, combine the local header with the Ethernet frame to obtain a cache packet, send the cache packet to a shared cache module, and send the destination MAC address of the Ethernet frame to a sending port;
[0040] The shared cache module 400 is used to store the received data using a slice-type shared cache and send the cache packet to a corresponding sending port;
[0041] The sending port 500 is used to synthesize a forwarding frame that meets the target protocol based on the destination MAC address of the Ethernet frame and the cache packet, and send the forwarding frame.
[0042] In a specific implementation, the Ethernet frame is an Ethernet data packet. The frame processing module and the frame combining module are both circuit structures, respectively including the frame processing circuit and the frame combining circuit of the switch. The receiving port and the sending port are both circuit modules in the switch. The shared cache module is a circuit structure for storing data. Figure 2As shown, the absolute priority is that the seven ports of the receiving port are the highest and the zero port is the lowest. The combining is the process of combining the eight data paths of the receiving end into one path according to the priority. The MAC address of the Ethernet frame is processed by a hash table, and the processing includes learning, searching and aging of the MAC address, wherein the designed hash table items mainly include valid information of the table items, length information, MAC address information and port mapping information. The local header mainly includes the port mapping information and the actual length information of the frame forwarding of the Ethernet frame. The storage structure of the shared cache module can be a two-level linked list, which can be broadcast, multicast and unicast based on the pointer copy principle, and can filter out the local header information and padding bytes. The sending port obtains and buffers the destination MAC information, and then adds the MAC information of the Ethernet switch, and synthesizes the forwarding frame that meets the IEEE 802.3 protocol together with the leading frame, the gap frame and the CRC check information, wherein the frame header of the forwarding frame at least includes the destination MAC address information of the Ethernet frame, the MAC address information of the switch and the Ethernet frame type information. The target protocol at least includes the IEEE 802.3 protocol.
[0043] The working process of the circuit structure is as follows:
[0044] like Figure 2 As shown, the circuit structure includes eight receiving ports, a frame combining circuit, a frame processing circuit, a shared cache module and eight sending ports. The Ethernet switch is mainly responsible for information transmission between systems. The receiving port and the sending port are connected to computer devices, wherein the receiving port is responsible for receiving Ethernet data packets sent from other systems, i.e., the collection of Ethernet frames, and performing CRC check and CRC error statistics, length statistics and length error statistics, and physical layer reception error statistics on the Ethernet data packets, and caching the length information and error statistics information together with the data information in the asynchronous FIFO of the port circuit at this level by packet.
[0045] The frame combining circuit schedules the data FIFO and status information FIFO of the eight receiving ports according to the absolute priority, such as Figure 2 As shown, receiving port 7 has the highest priority, and the priority decreases. Receiving port 0 has the lowest priority. In computer networks, congestion is generally scheduled at a higher level of the network layer. However, this module has designed a congestion mechanism. In the case of congestion in the low-level priority queue, a complete data packet will be forced to be read in priority order to relieve congestion pressure.
[0046] The frame processing circuit contains a table lookup module based on a hash algorithm for learning, searching and aging. The designed hash table items mainly include valid information, length information, MAC address information and port mapping information. When the Ethernet data packet arrives at the frame processing circuit module, the mapping learning of the source MAC address and the receiving port module is first performed. Further, the search work is performed. When the port information to be sent can be found, the port mapping information in the hash table item is read out and output, otherwise it is broadcast. The aging mechanism is mainly to prevent the table items that have not been used for a long time from occupying the storage space of the hash bucket inside the hash module. After the learning and searching are completed, the local header is created and the data is expanded. The local header contains the actual frame length and the sending mapping port information, together with the local header length, and the data packet length is extended to an integer multiple of 64 bytes. The local header and the Ethernet data packet are combined to create the cache packet. Among them, the 12-byte destination MAC address information and the source MAC address information are filtered in the frame processing circuit. The destination MAC address information enters the sending port in advance to wait for the arrival of the data packet.
[0047] The shared cache module uses static random access memory (SRAM) as a temporary cache memory, which contains an SRAM controller and a dual-port SRAM of at least 256kb. The SRAM controller processes Ethernet data packets in three modules. The first is the pre-processing module, which pre-processes Ethernet data packets with a 64-byte slice size and a 128-bit data bandwidth as the basic unit to improve the throughput of the internal memory, and then sends them to the SRAM area for storage. The post-processing module is mainly responsible for sending Ethernet data packets to the corresponding port, which only retains the Ethernet type information and data information, as well as the CRC check information.
[0048] The destination MAC address information is prepared in advance at the sending port, and the Ethernet data type information and data information obtained by polling the sending port are combined with the MAC address information of the local switch to synthesize the forwarding frame, and CRC check is performed at the same time to generate the final 4-byte check data of the Ethernet data packet. At this point, the packet caching and data exchange of the Ethernet data packet are completed.
[0049] In this embodiment, first, Ethernet frames are received through the receiving port, and asynchronous buffer FIFO is used for data storage. The frame combining module uses absolute priority to read the Ethernet frames of the receiving port, and combines the Ethernet frames, which can improve the prevention of data congestion and improve the time efficiency of receiving and processing Ethernet frames. Second, by creating a local header in the frame processing module, combining the local header and the Ethernet frame to obtain a cache packet, sending the cache packet to the shared cache module, sending the destination MAC address of the Ethernet frame to the sending port, and finally synthesizing a forwarding frame that meets the target protocol based on the destination MAC address of the Ethernet frame and the cache packet at the sending port, it is realized that there is no need to add the destination MAC address information in the frame processing module, that is, avoiding the synthesis of forwarding frames in the frame processing module, reducing the time delay caused by frame processing, and improving the time efficiency and reliability of Ethernet switch processing data. Third, the circuit structure of the present application can avoid delaying the addition of destination address information in the sending port module, improve the time efficiency of Ethernet frame synthesis, and significantly improve the performance of the switch. A congestion mechanism is designed in the frame processing combining module. In the case of congestion in the low-level priority queue, a complete data packet will be forced to be read in priority order, alleviating congestion pressure.
[0050] In some embodiments, the frame processing module further includes:
[0051] The aging mechanism is used to clean up table items that have not been used for a long time to prevent them from occupying the storage space of the hash table.
[0052] In this embodiment, the time efficiency of processing MAC addresses using a hash table is improved.
[0053] In some embodiments, the frame processing module further includes:
[0054] Used to expand the data of the cache packet to satisfy an integer multiple of 64 bytes.
[0055] In this embodiment, it is convenient for the shared cache module to cache the cache packet, thereby improving the performance of the circuit structure.
[0056] In some embodiments, the frame combining module further includes:
[0057] Used to discard the Ethernet frame with CRC check error, length error, and physical layer reception error.
[0058] In this embodiment, the reliability of the switch when performing frame synthesis is improved.
[0059] In some embodiments, the shared cache module uses a secondary linked list for caching, wherein the pointer logic of the primary linked list is a first-in-first-out queue.
[0060] In some embodiments, the CRC check adopts the CRC32-MPEG2 standard.
[0061] In some embodiments, the transmit port uses an asynchronous buffer FIFO for data storage.
[0062] The present application also provides a frame processing method of an Ethernet switch, the method comprising:
[0063] Step 100: The receiving port module receives the Ethernet frame;
[0064] Step 200: The frame combining module uses absolute priority to read the Ethernet frames of the receiving port, combines the Ethernet frames, and then sends them to the frame processing module;
[0065] Step 300: The frame processing module processes the MAC address of the Ethernet frame using a hash table, creates a local header, combines the local header with the Ethernet frame to obtain a cache packet, sends the cache packet to the shared cache module, and sends the destination MAC address of the Ethernet frame to the sending port;
[0066] Step 400: The shared cache module uses the sliced shared cache to store the received data and sends the cache packet to the corresponding sending port;
[0067] Step 500: The sending port synthesizes a forwarding frame that meets the target protocol based on the destination MAC address of the Ethernet frame and the cache packet, and sends the forwarding frame.
[0068] During specific implementation, the frame processing method is executed in sequence according to step 100 to step 500.
[0069] Each step in the frame processing method of the Ethernet switch implements a functional module based on the circuit structure of the Ethernet switch described in any one of the above items, and its execution process is not repeated here one by one.
[0070] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above-mentioned embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several deformations and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the patent of this application shall be based on the attached claims.
Claims
1. A circuit structure of an Ethernet switch, characterized in that: include: A receiving port for receiving Ethernet frames, which uses an asynchronous buffer FIFO for data storage; A frame combining module, used for reading Ethernet frames of receiving ports with absolute priority, combining Ethernet frames, and then sending them to the frame processing module, which uses an anti-congestion mechanism. The anti-congestion mechanism is that when the FIFO of the receiving port with a low priority is full, one Ethernet frame is processed according to the priority. A frame processing module, configured to process the MAC address of the Ethernet frame using a hash table, create a local header, combine the local header with the Ethernet frame to obtain a cache packet, send the cache packet to a shared cache module, and send the destination MAC address of the Ethernet frame to a sending port; A shared cache module, used to store received data using a sliced shared cache and send the cache packet to a corresponding sending port; The sending port is used to synthesize a forwarding frame that meets the target protocol based on the destination MAC address of the Ethernet frame and the cache packet, and send the forwarding frame.
2. The circuit structure of the Ethernet switch according to claim 1, characterized in that: The frame processing module further includes: The aging mechanism is used to clean up table items that have not been used for a long time to prevent them from occupying the storage space of the hash table.
3. The circuit structure of the Ethernet switch according to claim 1, characterized in that: The cache size of the shared cache module is set to be no less than 256kb.
4. The circuit structure of the Ethernet switch according to claim 1, characterized in that: The frame processing module further includes: Used to expand the data of the cache packet to satisfy an integer multiple of 64 bytes.
5. The circuit structure of the Ethernet switch according to claim 1, characterized in that: The receiving port further includes: Used for frame length counting, CRC check, CRC error statistics, frame length error statistics and physical layer reception error statistics.
6. The circuit structure of the Ethernet switch according to claim 1, characterized in that: The frame combining module further includes: Used to discard the Ethernet frame with CRC check error, length error, and physical layer reception error.
7. The circuit structure of the Ethernet switch according to claim 1, characterized in that: The shared cache module uses a secondary linked list for caching, wherein the pointer logic of the primary linked list is a first-in-first-out queue.
8. The circuit structure of the Ethernet switch according to claim 5, characterized in that: The CRC check adopts the CRC32-MPEG2 standard.
9. The circuit structure of the Ethernet switch according to claim 1, characterized in that: The sending port uses an asynchronous buffer FIFO for data storage.
10. A frame processing method for an Ethernet switch, characterized in that: The circuit structure of the Ethernet switch according to any one of claims 1 to 9 comprises: Step 100: The receiving port module receives the Ethernet frame; Step 200: The frame combining module uses absolute priority to read the Ethernet frames of the receiving port, combines the Ethernet frames, and then sends them to the frame processing module; Step 300: The frame processing module processes the MAC address of the Ethernet frame using a hash table, creates a local header, combines the local header with the Ethernet frame to obtain a cache packet, sends the cache packet to the shared cache module, and sends the destination MAC address of the Ethernet frame to the sending port; Step 400: The shared cache module uses the sliced shared cache to store the received data and sends the cache packet to the corresponding sending port; Step 500: The sending port synthesizes a forwarding frame that meets the target protocol based on the destination MAC address of the Ethernet frame and the cache packet, and sends the forwarding frame.
Citation Information
Cited By
Ultra-low time delay switching equipment and method for controlling forwarding action of ultra-low time delay switching equipment
CN119996353A
