Method, device and equipment for expanding network card equipment based on switch chip and medium

By expanding network card equipment on switch chip and increasing the number of MACs with software, the problem of high cost of increasing network card interfaces in the prior art is solved, and efficient data parallel processing and communication costs are achieved.

CN119484445APending Publication Date: 2025-02-18SHEN ZHOU SHU MA WANG LUO BEI JING YOU XIAN GONG SI +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411621145.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

When existing network communication devices process large amounts of data, they need multiple network card interfaces to ensure smooth data communication, but the hardware cost of adding multiple network card interfaces is higher.

Method used

By expanding network card devices on the switch chip, increasing the number of MACs through software coordination, and achieving parallel processing of multiple data, thereby reducing costs.

Benefits of technology

It realizes that the number of MACs is increased without increasing the hardware network card interface, reduces communication costs, and improves the efficiency of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484445A_ABST
    Figure CN119484445A_ABST
Patent Text Reader

Abstract

The invention discloses a method, device and equipment for expanding network card equipment based on a switch chip and a medium, and relates to the technical field of communication, and the method comprises the steps: obtaining a first message, determining a first port of the first message, finding a label corresponding to the first port, marking a first target label on the first message, obtaining a second message, and sending the second message to the switch chip; then, the second message is transmitted to the switching equipment through a physical interface, the switching equipment identifies a first target label in the second message, and a first target port corresponding to the first target label in the second message is determined according to a first corresponding relation between a pre-configured reference label and a reference port; and stripping the first target label in the second message to obtain a first message, and forwarding the first message through the first target port. According to the method, the number of MAC is increased by expanding the network card interface in a software matching mode, parallel processing of various data is achieved, and then the cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method, apparatus, device and medium for expanding a network card device based on a switch chip. Background Art

[0002] In the field of communication technology, for network communication equipment, the number of MACs integrated in the commonly used CPU or the number of MACs supported by expansion is relatively small. When a large amount of data needs to be processed simultaneously, some network communication equipment needs to have multiple network card interfaces for data communication. However, considering the cost of the hardware solution, the cost of equipping multiple network card interfaces is relatively high. Summary of the invention

[0003] The present application provides a method, device, equipment and medium for expanding network card devices based on a switch chip, which can expand the network card interface through software cooperation to increase the number of MACs, realize parallel processing of multiple data, and thus reduce costs.

[0004] In order to achieve the above objectives, this application adopts the following technical solutions: In a first aspect, the present application provides a method for expanding a network card device based on a switch chip, the method comprising: Obtaining a first message; Determine a first port of the first message, and find a label corresponding to the first port, naming it a first target label; Tagging the first message with the first target label to obtain a second message; Transmitting the second message to the switching device through the physical interface; Identifying a first target tag in the second message; Determine, according to a pre-configured first correspondence between a reference tag and a reference port, a first target port corresponding to a first target tag in the second message, and strip the first target tag in the second message to obtain a first message; The first message is forwarded through the first target port. In some possible implementations, the method further includes: receiving a third message through the second port, finding a label corresponding to the second port, naming it a second target label, and adding the second target label to the third message to obtain a fourth message; Transmitting the fourth message to the CPU through the physical interface; Identifying a second target tag in the fourth message; Determine, according to a pre-configured second correspondence between a reference tag and a reference port, a second target port corresponding to the second target tag in the fourth message, and then strip the second target tag in the fourth message to obtain a third message; The third message is forwarded through the second target port.

[0005] In some possible implementations, the step of adding the first target label to the first message includes: The first target label is identified, and the first target label is added to a header of the first message. In some possible implementations, the identifying the first target tag in the second message includes: The second message is received, header information of the second message is parsed, the first target tag is obtained, and data information of the first target tag is identified. In some possible implementations, the method further includes: The CPU and the switch are connected via MAC-MAC.

[0006] In a second aspect, the present application provides a device for expanding a network card device based on a switch chip, the device comprising: An acquisition module, used for acquiring a first message; A determination module, used to determine a first port of a first message, and find a label corresponding to the first port, and name it a first target label; an identification module, configured to add the first target label to the first message to obtain a second message; and transmit the second message to a switching device through a physical interface; An identification module, used to identify a first target tag in the second message; A sending module is used to determine the first target port corresponding to the first target label in the second message according to the first corresponding relationship between the pre-configured reference label and the reference port, strip the first target label in the second message to obtain the first message; and forward the first message through the first target port.

[0007] In a third aspect, the present application provides a computing device, including a memory and a processor; One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method as described in any one of the first aspects.

[0008] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method as described in any one of the first aspects.

[0009] It can be seen from the above technical solution that the present application has at least the following beneficial effects: In the present application, by obtaining the first message, determining the first port of the first message, and finding the label corresponding to the first port, the first message is marked with a first target label to obtain a second message, and then the second message is transmitted to the switching device through a physical interface, the switching device identifies the first target label in the second message, and determines the first target port corresponding to the first target label in the second message according to the first correspondence between the pre-configured reference label and the reference port, and then strips the first target label in the second message to obtain the first message, and forwards the first message through the first target port. In the traditional solution, it is necessary to increase the network card interface through hardware for receiving and sending messages, which increases the communication cost. It can be seen that the present application increases the number of MACs by expanding the network card interface in a software-coordinated manner, realizes parallel processing of multiple data, and thus reduces costs.

[0010] It should be understood that the description of technical features, technical solutions, beneficial effects or similar language in this application does not imply that all features and advantages can be realized in any single embodiment. On the contrary, it is understood that the description of features or beneficial effects means that specific technical features, technical solutions or beneficial effects are included in at least one embodiment. Therefore, the description of technical features, technical solutions or beneficial effects in this specification does not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and beneficial effects described in the present embodiment can also be combined in any appropriate manner. Those skilled in the art will understand that the embodiment can be realized without one or more specific technical features, technical solutions or beneficial effects of a specific embodiment. In other embodiments, additional technical features and beneficial effects can also be identified in a specific embodiment that does not embody all embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application; Figure 2 A flow chart of a method for expanding a network card device based on a switch chip provided in an embodiment of the present application; Figure 3 Another method for expanding a network card device based on a switch chip provided in an embodiment of the present application is a flowchart of the method; Figure 4 A schematic diagram of a device for extending a network card device based on a switch chip provided in an embodiment of the present application; Figure 5 A schematic diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0012] The terms "first", "second", "third", etc. in the specification of this application and the accompanying drawings are used to distinguish different objects rather than to limit a specific order.

[0013] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0014] Currently, for network communication devices, the number of MAC addresses integrated into commonly used CPUs or the number of additional MAC addresses supported is often limited. When faced with scenarios where a large amount of data needs to be processed simultaneously, some network communication devices need to be equipped with multiple network card interfaces to ensure smooth data communication. However, from the perspective of hardware cost, adding multiple network card interfaces for receiving and sending messages increases communication costs.

[0015] In view of this, an embodiment of the present application provides a method for expanding a network card device based on a switch chip, in which a first message is obtained, a first port of the first message is determined, and a label corresponding to the first port is found, a first target label is added to the first message, and a second message is obtained, and then the second message is transmitted to a switching device through a physical interface, the switching device identifies the first target label in the second message, and determines the first target port corresponding to the first target label in the second message according to a first correspondence between a pre-configured reference label and a reference port, and then strips off the first target label in the second message to obtain the first message, and forwards the first message through the first target port. It can be seen that the present application increases the number of MACs by expanding the network card interface in a software-coordinated manner, realizes parallel processing of multiple data, and thus reduces costs. In order to make the technical solution of the present application clearer and easier to understand, the application scenarios of the technical solution of the present application are introduced below in conjunction with the accompanying drawings. Figure 1 As shown, the figure is a schematic diagram of an application scenario provided by an embodiment of the present application.

[0016] In this application scenario, the CPU transmits messages to the switch through MAC0. The CPU includes 8 ports, namely G1, G2, G3, G4, G5, G6, G7 and G8. The messages in the CPU are transmitted through different ports, and the target VID tag is added to the message according to the port through which the message passes, and then transmitted to the switch.

[0017] The switch transmits messages with the CPU through a physical interface EXT0. The switch includes 8 output ports, namely UTP0, UTP1, UTP2, UTP3, UTP4, UTP5, UTP6 and UTP7. The switch will receive the message with the target VID label, identify the message, determine the output port corresponding to the message with the target VID label, then strip the target VID label on the message, and then forward it from the corresponding output port.

[0018] To this end, the CPU can transmit multiple messages from different ports to the switch, and then forward the multiple messages through the output port in the switch to achieve multiple data parallel processing. It can be seen that this application increases the number of MACs by expanding the network card interface in a software-coordinated manner, achieves multiple data parallel processing, and thus reduces costs.

[0019] In order to make the technical solution of the present application clearer and easier to understand, the following describes a method for expanding a network card device based on a switch chip provided by an embodiment of the present application in combination with the above application scenario. Figure 2 As shown in FIG. 1 , the figure is a flow chart of a method for expanding a network card device based on a switch chip provided in an embodiment of the present application. The method for expanding a network card device based on a switch chip includes: S201. Obtain a first message.

[0020] The central processing unit (CPU) is the computing and control core of the computer system and the final execution unit for information processing and program running. The CPU obtains the first message from the memory and transmits the first message to the switch through one of the CPU ports.

[0021] Among them, the CPU contains 8 ports, including G1, G2, G3, G4, G5, G6, G7 and G8, and the corresponding labels are 2, 3, 4, 5, 6, 7, 8 and 9 respectively.

[0022] In the embodiment of the present application, the tag refers to the VLAN ID, which is the abbreviation of Virtual Local Area Network Identifier, and is a digital identifier used to uniquely identify a VLAN (virtual local area network). The VLAN ID is an integer between 1 and 4094, used to distinguish different virtual local area networks. The tag protocol identifier of the tag is 0x8100.

[0023] In the embodiment of the present application, it is assumed that the first message is transmitted from the port G1.

[0024] S202: Determine a first port of the first message, and find a label corresponding to the first port, and name it as a first target label.

[0025] In the present application, it is determined that the port of the first message is G1, G1 is named as the first port, and it is found that the VID label corresponding to the first port G1 is 2.

[0026] S203: Add the first target label to the first message to obtain a second message.

[0027] In the present application, the first target label is 2, so the first message is marked with the first target label 2 to obtain the second message.

[0028] S204: Transmit the second message to the switching device through the physical interface.

[0029] There is MAC0 in the CPU, and data communication is performed with the switch through MAC0. The CPU transmits the second message with the target VID tag to the switching device switch.

[0030] MAC address is a unique identifier used by network devices (such as network cards, routers, etc.) below the network layer to locate devices in the network and transmit data. MAC address plays a vital role in network communication. When data is transmitted in the network, the MAC addresses of the source device and the destination device are included in the header of the data frame to ensure that the data can be accurately sent to the destination device.

[0031] The main function of a switch is to forward and filter packets, and to quickly transfer packets from one port to another through the internal switching matrix. At the same time, a switch also has functions such as address learning, forwarding / filtering, and loop avoidance.

[0032] The switch receives and analyzes data packets, learns and records the mapping relationship between the source MAC address and the corresponding port, and establishes a MAC address table. When the switch receives a data packet, it searches the MAC address table based on the destination MAC address and determines which port the data packet is forwarded from. If the destination MAC address is not in the MAC address table, it is forwarded to all ports. This process is called flooding.

[0033] Switching devices are widely used in various network environments, such as enterprise networks, campus networks, data centers, etc. In enterprise networks, switching devices are used to connect computers, printers and other devices in various departments to achieve information sharing and communication. In campus networks, switching devices are used to connect network devices in teaching buildings, libraries and other areas to provide network services. In data centers, switching devices are used to connect servers, storage devices, etc. to build a high-performance network architecture.

[0034] S205: Identify the first target tag in the second message.

[0035] The switching device switch receives the second message, identifies and parses the data information in the second message, and obtains the target VID tag.

[0036] S206: Determine a first destination port corresponding to the first destination label in the second message according to a pre-configured first correspondence between the reference label and the reference port, and strip the first destination label in the second message to obtain a first message.

[0037] The switching device switch has a first correspondence relationship between preconfigured reference labels and reference ports, wherein the reference ports include UTP0, UTP1, UTP2, UTP3, UTP4, UTP5, UTP6 and UTP7, and the corresponding VID labels are 2, 3, 4, 5, 6, 7, 8 and 9 respectively.

[0038] In the above steps, it can be known that the first target label is 2. According to the first correspondence between the reference label and the reference port, the port corresponding to the first target label 2 is UTP0. Therefore, it is determined that the first target port corresponding to the first target label in the second message is UTP0. The switching device switch strips the first target label in the second message to obtain the first message.

[0039] S207: Forward the first message through the first target port.

[0040] In S206, it is determined that the first target port is UTP0, and the first message is forwarded through the first target port UTP0.

[0041] Based on the above content, in the present application, by obtaining the first message, determining the first port of the first message, and finding the label corresponding to the first port, the first message is marked with the first target label to obtain the second message, and then the second message is transmitted to the switching device through the physical interface, the switching device identifies the first target label in the second message, and determines the first target port corresponding to the first target label in the second message according to the first correspondence between the pre-configured reference label and the reference port, and then strips the first target label in the second message to obtain the first message, and forwards the first message through the first target port. It can be seen that the present application increases the number of MACs by expanding the network card interface in software cooperation, realizes parallel processing of multiple data, and thus reduces costs.

[0042] The embodiment of the present application also provides a method for expanding a network card device based on a switch chip, such as Figure 3 As shown, the figure is a flowchart of another method for extending a network card device based on a switch chip provided by an embodiment of the present application. The method includes: S301. Receive a third message through a second port, find a label corresponding to the second port, name it as a second target label, and add the second target label to the third message to obtain a fourth message.

[0043] In the embodiment of the present application, the second port is set to G8, and the third message is transmitted from the G8 port. According to the label 9 corresponding to the G8 output port, it can be determined that the second target label is 9.

[0044] S302: Transmit the fourth message to the CPU through the physical interface.

[0045] S303: Identify the second target tag in the fourth message.

[0046] The CPU receives the fourth message, identifies and parses the data information in the fourth message, and obtains the second target tag.

[0047] S304: Determine the target port corresponding to the second target label in the fourth message according to the pre-configured second corresponding relationship between the reference label and the reference port, and then strip the second target label in the fourth message to obtain a third message.

[0048] The CPU determines the second target port corresponding to the second target label in the fourth message based on the second correspondence between the pre-configured reference label and the reference port. In the above text, the second target label is determined to be 9, so it can be determined that the second target port is UTP7. The second target label 9 in the fourth message is stripped to obtain the third message.

[0049] S305. Forward the third message through the second target port.

[0050] The CPU forwards the third message through the second target port UTP7.

[0051] In the present application, the switching device switch obtains the third message, determines the second port of the third message, finds the label corresponding to the second port, adds the second target label to the third message, obtains the fourth message, and then transmits the fourth message to the switching device through the physical interface. The CPU identifies the second target label in the fourth message, determines the second target port corresponding to the second target label in the fourth message according to the second correspondence between the pre-configured reference label and the reference port, and then strips the second target label in the fourth message to obtain the third message, and forwards the third message through the second target port. It can be seen that the present application increases the number of MACs by expanding the network card interface in software cooperation, realizes parallel processing of multiple data, and thus reduces costs.

[0052] The embodiment of the present application also provides a device for expanding a network card device based on a switch chip, such as Figure 4 As shown, the figure is a schematic diagram of a device for expanding a network card device based on a switch chip provided in an embodiment of the present application, the device comprising: an acquisition module 401, a determination module 402, an identification module 403, an identification module 404, and a sending module 405; An acquisition module 401 is used to acquire a first message; A determination module 402 is used to determine a first port of a first message, and find a label corresponding to the first port, which is named a first target label; The identification module 403 is used to add the first target label to the first message to obtain a second message; and transmit the second message to the switching device through the physical interface; An identification module 404, configured to identify a first target tag in the second message; The sending module 405 is used to determine the first target port corresponding to the first target label in the second message according to the first corresponding relationship between the pre-configured reference label and the reference port, strip the first target label in the second message to obtain the first message; and forward the first message through the first target port.

[0053] In some possible implementations, the device further includes: The second identification module is used to receive the third message through the second port, find the label corresponding to the second port, name it as a second target label, add the second target label to the third message, and obtain a fourth message; transmit the fourth message to the CPU through the physical interface; A second identification module, used to identify a second target tag in the fourth message; The second sending module is used to determine the second target port corresponding to the second target label in the fourth message according to the second corresponding relationship between the pre-configured reference label and the reference port, and then strip the second target label in the fourth message to obtain the third message; and forward the third message through the second target port. In some possible implementations, the device further includes: The CPU and the switch are connected via MAC-MAC.

[0054] The present application also provides a computing device. Figure 5 As shown, this figure is a schematic diagram of a computing device provided in an embodiment of the present application, and the computing device 500 includes a bus 501, a processor 502, a communication interface 503 and a memory 504. The processor 502, the memory 504 and the communication interface 503 communicate with each other through the bus 501.

[0055] The bus 501 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0056] The processor 502 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0057] The communication interface 503 is used for external communication. For example, when the computing device is a first switch, the communication interface 503 can be used for the first switch to communicate with the first user terminal, or for the first switch to communicate with the second switch.

[0058] The memory 504 may include a volatile memory, such as a random access memory (RAM). The memory 504 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0059] The memory 504 stores executable codes, and the processor 502 executes the executable codes to perform the aforementioned method for extending a network card device based on a switch chip.

[0060] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned method for expanding a network card device based on a switch chip.

[0061] The embodiment of the present application further provides a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part.

[0062] The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center via wired (e.g., coaxial cable, optical fiber) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0063] When the computer program product is executed by a computer, the computer executes any of the aforementioned methods for extending a network card device based on a switch chip. The computer program product may be a software installation package, and when any of the aforementioned methods for extending a network card device based on a switch chip is needed, the computer program product may be downloaded and executed on a computer.

[0064] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.

[0065] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application.

Claims

1. A method for expanding a network card device based on a switch chip, characterized in that: The method comprises: Obtaining a first message; Determine a first port of the first message, and find a label corresponding to the first port, naming it a first target label; Tagging the first message with the first target label to obtain a second message; Transmitting the second message to the switching device through the physical interface; Identifying a first target tag in the second message; Determine, according to a pre-configured first correspondence between a reference tag and a reference port, a first target port corresponding to a first target tag in the second message, and strip the first target tag in the second message to obtain a first message; The first message is forwarded through the first target port.

2. The method according to claim 1, characterized in that The method further comprises: receiving a third message through the second port, finding a label corresponding to the second port, naming it a second target label, and adding the second target label to the third message to obtain a fourth message; Transmitting the fourth message to the CPU through the physical interface; Identifying a second target tag in the fourth message; Determine, according to a pre-configured second correspondence between a reference tag and a reference port, a second target port corresponding to the second target tag in the fourth message, and then strip the second target tag in the fourth message to obtain a third message; The third message is forwarded through the second target port.

3. The method according to claim 1, characterized in that The step of adding the first target label to the first message includes: The first target label is identified, and the first target label is added to a header of the first message.

4. The method according to claim 2, characterized in that: The identifying the first target tag in the second message includes: The second message is received, header information of the second message is parsed, the first target tag is obtained, and data information of the first target tag is identified.

5. The method according to claim 1, characterized in that: The method further comprises: The CPU and the switch are connected via MAC-MAC.

6. A device for expanding a network card device based on a switch chip, characterized in that: The device comprises: An acquisition module, used for acquiring a first message; A determination module, used to determine a first port of a first message, and find a label corresponding to the first port, and name it a first target label; an identification module, configured to add the first target label to the first message to obtain a second message; and transmit the second message to a switching device through a physical interface; An identification module, used to identify a first target tag in the second message; A sending module is used to determine the first target port corresponding to the first target label in the second message according to the first corresponding relationship between the pre-configured reference label and the reference port, strip the first target label in the second message to obtain the first message; and forward the first message through the first target port.

7. The device according to claim 6, characterized in that The device also includes: The second identification module is used to receive the third message through the second port, find the label corresponding to the second port, name it as a second target label, add the second target label to the third message, and obtain a fourth message; transmit the fourth message to the CPU through the physical interface; A second identification module, used to identify a second target tag in the fourth message; The second sending module is used to determine the second target port corresponding to the second target label in the fourth message according to the second corresponding relationship between the pre-configured reference label and the reference port, and then strip the second target label in the fourth message to obtain the third message; and forward the third message through the second target port.

8. The device according to claim 6, characterized in that The device also includes: The CPU and the switch are connected via MAC-MAC.

9. A computing device, characterized in that including memory and processor; One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method as claimed in any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 5.