CN115277879B - Message forwarding method and device, intelligent network card and storage medium - Google Patents

Message forwarding method and device, intelligent network card and storage medium Download PDF

Info

Publication number
CN115277879B
CN115277879B CN202210666834.0A CN202210666834A CN115277879B CN 115277879 B CN115277879 B CN 115277879B CN 202210666834 A CN202210666834 A CN 202210666834A CN 115277879 B CN115277879 B CN 115277879B
Authority
CN
China
Prior art keywords
switch
port
message
event
subscribed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210666834.0A
Other languages
Chinese (zh)
Other versions
CN115277879A (en
Inventor
彭剑远
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN202210666834.0A priority Critical patent/CN115277879B/en
Publication of CN115277879A publication Critical patent/CN115277879A/en
Application granted granted Critical
Publication of CN115277879B publication Critical patent/CN115277879B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a message forwarding method and device, an intelligent network card and a storage medium, wherein the message forwarding method comprises the following steps: receiving subscribed events sent by the switch, wherein the sending of the subscribed events is triggered by the change of the state of the switch; analyzing the subscribed event to obtain an analysis result of the subscribed event; the analysis result is used for representing the current state of the switch; and adjusting the mode of forwarding the message to the switch according to the analysis result. The intelligent network card can acquire the switch event at the first time in the event subscription mode, realize the quick identification of the switch event, and adjust the mode of forwarding the message to the switch in time according to the switch state determined by the switch event, so as to avoid the problem that the message is easy to be lost or invalid when the intelligent network card forwards the message to the switch to the greatest extent, and improve the reliability and the effectiveness of message forwarding.

Description

Message forwarding method and device, intelligent network card and storage medium
Technical Field
The invention relates to the technical field of intelligent network cards, in particular to a message forwarding method and device, an intelligent network card and a storage medium.
Background
At present, a method for acquiring an exchange event by an intelligent network card is generally based on a scheme of active detection of the intelligent network card, and specifically, the exchange event is actively identified through the intelligent network card. Taking the event of the switch fault as an example, identifying the event of the switch fault by a packet sending detection mode, such as socket (socket) packet sending, and if the event of the switch fault is found to be lost for a long time, determining that the switch has the fault; however, the packet sending detection mode has the problems of low accuracy, low time and the like, if only one packet is sent to judge whether the switch is faulty, the probability of misjudgment is very high, for example, the packet can be lost under the condition of poor network quality, but if a plurality of packets are continuously sent, the switch is judged to be faulty under the condition that the plurality of packets are lost, the consumed time is relatively long, and the method is not suitable for the service with high requirement on timeliness. The conventional scheme is based on the mode of actively detecting the switch event by the intelligent network card, and the switch event can not be accurately acquired at the first time, so that the problems of message loss or invalidation and the like easily occur when the intelligent network card forwards a message to the switch.
Disclosure of Invention
The invention provides a message forwarding method and device, an intelligent network card and a storage medium, which are used for solving the problems that the existing intelligent network card can not accurately acquire an event of a switch at the first time and a message is easy to lose or invalid when a message is forwarded to the switch, so that the intelligent network card can acquire the event of the switch in time, the problem that the message is lost or invalid when the message is forwarded by the intelligent network card is avoided to the greatest extent, and the technical purposes of improving the reliability of the message forwarded by the intelligent network card are achieved.
In order to achieve the technical purpose, the invention can provide a message forwarding method which is applied to an intelligent network card. The message forwarding method comprises the following steps: receiving subscribed events sent by the switch, wherein the sending of the subscribed events is triggered by the change of the state of the switch; analyzing the subscribed event to obtain an analysis result of the subscribed event; the analysis result is used for representing the current state of the switch; and adjusting the mode of forwarding the message to the switch according to the analysis result.
In at least one embodiment of the present invention, before the subscribed event sent by the receiving switch, the method further includes: sending event subscription messages to the switch; the event subscription message is used for notifying the switch to determine that the subscribed event occurs and reporting the subscribed event.
In at least one embodiment of the present invention, the subscribed event includes an event of a first port failure, and the parsing result of the subscribed event includes the first port failure. The method for forwarding the message to the switch is adjusted according to the analysis result, and comprises the following steps: when the analysis result is that the first port fails, stopping sending the message to the switch through the first port, and sending the message to the switch through the second port; the first port and the second port are ports which are arranged on the switch and are used for communicating with the intelligent network card.
In at least one embodiment of the present invention, the subscribed event includes an event that the first port is recovered from failure, and the parsing result of the subscribed event includes that the first port is recovered from failure. The method for forwarding the message to the switch is adjusted according to the analysis result, and further comprises the following steps: and when the analysis result is that the first port is recovered from the fault to be normal, the message is sent to the switch again through the first port.
In at least one embodiment of the present invention, the subscribed event includes an event in which both the first port and the second port fail, and the parsing result of the subscribed event includes both the first port and the second port fail.
The method for forwarding the message to the switch is adjusted according to the analysis result, and comprises the following steps: and when the analysis result shows that the first port and the second port are both in fault, sending a message to the switch through the standby link.
The first port and the second port are ports which are arranged on the switch and are used for communicating with the intelligent network card; the standby link is a standby link for communication between the switch and the intelligent network card.
In at least one embodiment of the present invention, a subscribed event sent by a receiving switch includes: and receiving a message based on a link layer discovery protocol sent by the switch, wherein the message based on the link layer discovery protocol contains subscribed events.
In at least one embodiment of the present invention, resolving a subscribed event includes: and carrying out decryption processing and/or authentication processing on the subscribed event.
In order to achieve the technical purpose, the invention can provide a message forwarding device which is applied to an intelligent network card; the message forwarding device comprises, but is not limited to, an event receiving module, an event analyzing module and a forwarding control module.
The event receiving module is used for receiving subscribed events sent by the switch, and the sending of the subscribed events is triggered by the change of the state of the switch.
The event analysis module is used for analyzing the subscribed event to obtain an analysis result of the subscribed event; the parsing result is used to characterize the current state of the switch.
And the forwarding control module is used for adjusting the mode of forwarding the message to the switch according to the analysis result.
In at least one embodiment of the present invention, the forwarding device further includes: the subscription notification module is used for sending event subscription messages to the switch; the event subscription message is used for notifying the switch to determine that the subscribed event occurs and reporting the subscribed event.
In at least one embodiment of the present invention, the subscribed event includes an event of a first port failure, and the parsing result of the subscribed event includes the first port failure. The forwarding control module is used for stopping sending the message to the switch through the first port when the analysis result is that the first port fails and sending the message to the switch through the second port; the first port and the second port are ports which are arranged on the switch and are used for communicating with the intelligent network card.
In at least one embodiment of the present invention, the subscribed event includes an event that the first port is recovered from failure, and the analysis result of the subscribed event includes that the first port is recovered from failure; and the forwarding control module is used for sending the message to the switch again through the first port when the analysis result is that the first port is recovered from the fault to be normal.
In at least one embodiment of the present invention, the subscribed event includes an event in which both the first port and the second port fail, and the parsing result of the subscribed event includes both the first port and the second port fail.
And the forwarding control module is used for sending a message to the switch through the standby link when the analysis result is that the first port and the second port are both in fault.
The first port and the second port are ports which are arranged on the switch and are used for communicating with the intelligent network card; the standby link is a standby link for communication between the switch and the intelligent network card.
In at least one embodiment of the present invention, the event receiving module is configured to receive a message based on a link layer discovery protocol sent by the switch, where the message based on the link layer discovery protocol includes a subscribed event.
In at least one embodiment of the present invention, the event parsing module is configured to decrypt and/or authenticate the subscribed event.
In order to achieve the above technical objective, the present invention also provides an intelligent network card, which includes a memory and a processor, wherein the memory stores computer readable instructions, and when the computer readable instructions are executed by the processor, the processor executes the steps of the message forwarding method in any embodiment of the present invention.
To achieve the above object, the present invention also provides a storage medium storing computer readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the method for forwarding a message in any of the embodiments of the present invention.
The beneficial effects of the invention include: based on the receiving and analyzing of subscribed events, the intelligent network card can accurately acquire the current state of the switch, and the intelligent network card forwards the message to the switch in a proper mode through the current state of the switch, so that the intelligent network card can acquire the switch event in the first time in the event subscription mode, realize the rapid identification of the switch event, adjust the mode of forwarding the message to the switch according to the switch state determined by the switch event in time, so as to furthest avoid the problem that the message is easy to be lost or invalid when the intelligent network card forwards the message to the switch, and improve the reliability and the effectiveness of the message forwarding.
Drawings
Fig. 1 is a flow diagram of a method for forwarding a message according to one or more embodiments of the present invention.
Fig. 2 is a flow diagram illustrating interaction of a smart network card with a physical switch in one or more embodiments of the invention.
Fig. 3 illustrates a network architecture diagram including an intelligent network card and a physical switch in one or more embodiments of the invention.
Fig. 4 is a schematic diagram of an interaction flow of negotiating passwords between a smart network card and a physical switch in one or more embodiments of the invention.
Fig. 5 is a schematic diagram illustrating a message composition of a link layer discovery protocol after encapsulation in one or more embodiments of the invention.
Fig. 6 is a schematic diagram of a packet forwarding device according to one or more embodiments of the present invention.
FIG. 7 illustrates a schematic diagram of the internal architecture of a smart network card involved in one or more embodiments of the present invention.
Detailed Description
The following describes and illustrates in detail a method and apparatus for forwarding a message, an intelligent network card, and a storage medium according to embodiments of the present invention with reference to the accompanying drawings.
The intelligent network card related to the embodiment of the invention specifically refers to Smart NIC (Smart Network Interface Card), the intelligent network card can be used for completely transferring the virtual switch function from a server CPU (Central Processing Unit ) to the intelligent network card so as to release the computing capacity of an expensive server CPU, and the intelligent network card can be used for returning the processing result to a corresponding application program so as to achieve better expansion of the network card function and further provide higher processing performance. The core of the intelligent network card is to assist the CPU to process network load and program network interface functions through FPGA (Field Programmable Gate Array ), and has the following characteristics: the customization of the functions of the data surface and the control panel is supported through FPGA localized programming, and the CPU is assisted to process network load; data is forwarded quickly through multiple ports and internal switches, and intelligent mapping to related applications can be based on network packets, application sockets, etc., and network traffic can be detected and managed. The intelligent network card can obviously improve the application program and virtualization performance, exert the advantages of software defined network (SDN, software Defined Network) and network function virtualization (NFV, network Functions Virtualization), and remove network virtualization, load balancing and some low-level functions from a server CPU so as to ensure that the maximum processing capacity is provided for the application program. In addition, the intelligent network card can also provide distributed computing resources, so that the user can independently develop personalized software or provide a software access service function, and the development of characteristic application programs can be accelerated.
Compared with the traditional scheme, at least one embodiment of the invention can provide a message forwarding method, which is applied to an intelligent network card and comprises the following steps: receiving subscribed events sent by the switch, wherein the sending of the subscribed events is triggered by the change of the state of the switch; analyzing the subscribed event to obtain an analysis result of the subscribed event; the analysis result is used for representing the current state of the switch; and adjusting the mode of forwarding the message to the switch according to the analysis result. It can be seen that the embodiment of the present invention may provide a manner for an intelligent network card to acquire a switch event, and in particular determine the switch event based on a subscribed event. Based on the receiving and analyzing of subscribed events, the intelligent network card can accurately acquire the current state of the switch, and the intelligent network card forwards the message to the switch in a proper mode through the current state of the switch, so that the intelligent network card can acquire the switch event in the first time in the event subscription mode, realize the rapid identification of the switch event, adjust the mode of forwarding the message to the switch according to the switch state determined by the switch event in time, so as to furthest avoid the problem that the message is easy to be lost or invalid when the intelligent network card forwards the message to the switch, and greatly improve the reliability and the effectiveness of message forwarding.
As shown in fig. 1, at least one embodiment of the present invention can provide a method for forwarding a message, where the method is applied to an intelligent network card. The forwarding method of the message may include, but is not limited to, steps S100 to S300.
Step S100, receiving a subscribed event sent by the switch, wherein the sending of the subscribed event is triggered by the change of the switch state. Subscribed events in one or more embodiments of the invention, e.g., switch port failure events, port congestion events, UP/DOWN (port on/off) events, forwarding chip failure events of the switch, etc. For example, if one port of the switch fails, a subscribed switch port failure event can be sent to the intelligent network card through other ports, and even if ports directly connected with the switch and the intelligent network card fail, the subscribed switch port failure event can be sent to the intelligent network card based on other standby links. When the subscribed event is sent out, the embodiment of the invention indicates that the state of the corresponding switch has changed, for example, the switch port is changed from normal to abnormal, and the corresponding subscribed switch port fault event is triggered to be sent out, so that the invention realizes that the switch immediately sends the subscribed event to the intelligent network card when the port fault occurs.
As shown in fig. 2, before the subscribed event sent by the receiving switch in at least one embodiment of the present invention further includes: sending event subscription messages to the switch; the event subscription reading message is used for notifying the switch to determine that the subscribed event occurs and reporting the event. The event subscription message in at least one embodiment of the present invention includes, for example, but not limited to, a switch port fault event subscription message, a port congestion event subscription message, an UP/DOWN event subscription message, a forwarding chip fault event subscription message of a switch, etc. It can be seen that the intelligent network card of the embodiment of the invention adopts a mode of subscribing the event to the switch, and the switch actively reports the intelligent network card and timely informs the intelligent network card when the corresponding event occurs.
Illustratively, when a network is built that includes the intelligent network card and switch of the present invention, the network architecture shown in fig. 3 may be formed, for example, using SNMP (Simple Network Management Protocol ). The simple network management protocol can be widely used for remote management and operation of network equipment, and the management end can manage managed ends of different manufacturers, different physical characteristics and different interconnection technologies on the network, such as state monitoring, data acquisition, fault processing and the like. The intelligent network card in the embodiment of the invention is used as a management end, the switch is used as a managed end, and the switch is a physical switch shown in fig. 2, for example. Based on the simple network management protocol, the management end can be used for providing a friendly man-machine interaction interface and acquiring and setting values of parameters on the managed end, so that most network management works are conveniently completed, and the managed end is responsible for receiving and processing the simple network management protocol messages from the management end. The managed terminal often has a plurality of managed objects, such as interface states related to the embodiment of the invention, and relevant files are compiled on the managed terminal to generate relevant information of the managed objects, and the relevant information can be sent to the managed terminal.
As shown in fig. 2, the subscribed event sent by the receiving switch in at least one embodiment of the present invention may include: and receiving a message based on a link layer discovery protocol sent by the switch, wherein the message based on the link layer discovery protocol contains subscribed events. In at least one embodiment of the present invention, the event subscription message is a message based on a link layer discovery protocol. The link layer discovery protocol, namely LLDP, is known as Link Layer Discovery Protocol, which is a standard link layer discovery mode, and the invention can enable the switch and the intelligent network card to mutually discover and interact respective system and configuration information and the like in the network based on the LLDP. The switch of the embodiment encapsulates the local information in a link layer discovery protocol data unit (LLDPDU, link Layer Discovery Protocol Data Unit) and distributes the local information to the directly connected intelligent network card for the intelligent network card to use; the local information of the embodiment includes subscribed events that may be triggered. As shown in connection with fig. 5, the link layer discovery protocol data unit is encapsulated in a message of the link layer discovery protocol. The messages of the link layer discovery protocol may include, but are not limited to, a destination media access control address (Destination MAC Address), a source media access control address (Source MAC Address), a Type (Type), a Link Layer Discovery Protocol Data Unit (LLDPDU), and a frame check sequence (FCS, frame Check Sequences), where the destination media access control address is used to distinguish LLDP messages sent and received by agents of different types under the same interface, and the LLDP protocol specifies different multicast MAC addresses as destination media access control addresses of the LLDP messages of agents of different types, and may specifically include: the LLDP messages of the nearest bridge agent type use multicast MAC addresses, e.g., 0x0180-c200-000e, the LLDP messages of the nearest customer bridge agent type use multicast MAC addresses, e.g., 0x0180-c200-0000, and the LLDP messages of the nearest non-TPMR (Two-Port MAC Relay) bridge agent type use multicast MAC addresses, e.g., 0x0180-c200-0003; the source media access control address is specifically a port MAC address; type, i.e., message type, e.g., 0x88CC; the link layer discovers the protocol data unit, namely the data content, and the content size can be 1500 bytes; the frame check sequence can be used to check the message.
More specifically, the link layer discovery protocol data unit in the embodiment of the present invention may include a plurality of TLVs (TYPE LENGTH VALUE ), for example, a passis ID (device identification) TLV, a Port ID (Port identification) TLV, and a Time To Live (survival Time of the present device information on the neighbor device) TLV, where the device encapsulates local information into a TLV format before composing the link layer discovery protocol data unit, and then composes a link layer discovery protocol data unit from a plurality of TLVs, and encapsulates the data portion of the LLDP message for transmission. Wherein, one link layer discovery protocol data unit can carry 32 TLVs at most.
For example, in the embodiment of the present invention, a TLV for notifying the switch of which events to subscribe to is newly added in the link layer discovery protocol data unit, which may include, but is not limited to, a TLV of a switch port failure event, a TLV of a port congestion event, a TLV of an UP/DOWN event, and a TLV of a forwarding chip failure event of the switch, and then in an event subscription message sent to the switch, the TLV of a subscription event required by the intelligent network card is carried.
In at least one embodiment of the present invention, sending the event subscription message to the switch may include: and sending the event to be subscribed to the switch through the newly added TLV, and encapsulating the newly added TLV in the event subscription message. The TYPE in the newly added TLV may be, for example, 100, 101 or 102, and take the event of a port failure as an example, where the TYPE in the newly added TLV corresponds to the port, for example, the TYPE of the time of the port failure is 100, and the event of subscribing to the port failure actually sends the TLV with the TYPE of 100 to the switch through an LLDP message, so that the switch determines that the corresponding port failure notifies the intelligent network card according to the TYPE of 100. Based on the newly added TLV, the event to be subscribed is sent to the switch, and the embodiment of the invention can report the port fault event of the received fault event subscription reading message to the intelligent network card, so that the non-subscribed port fault event of the embodiment does not inform the intelligent network card even if the non-subscribed port fault event occurs, and particularly the port which is not directly connected with the intelligent network card does not inform the intelligent network card which is directly connected with the current switch even if the non-subscribed port fault event occurs, thereby being capable of sending the subscribed event to the intelligent network card in a targeted manner and being beneficial to further improving the resource utilization rate of hardware equipment.
Step S200, analyzing the subscribed event to obtain an analysis result of the subscribed event; the parsing result is used to characterize the current state of the switch.
As shown in fig. 4, parsing the subscribed event in one or more embodiments of the present invention may include: and carrying out decryption processing and/or authentication processing on the subscribed event. The intelligent network card of the embodiment of the invention can send the certificate to the switch in advance, and the certificate can contain authentication information and/or encryption information. The subscribed event sent by the switch to the intelligent network card can comprise information such as a user name, an encryption algorithm and the like encrypted by a public key in the certificate, and the intelligent network card can perform processes such as decryption, authentication and the like to obtain an analysis result of the subscribed event. In the embodiment of the invention, the switch can encrypt the subscribed event to be sent so as to avoid interception, and the intelligent network card can decrypt the subscribed event; the intelligent network card can authenticate the subscribed event to verify the validity of the exchanger which sends the subscribed event, and avoid the access of illegal users. It can be seen that the embodiment of the present invention can improve the security of communication between the switch and the intelligent network card based on decryption processing and/or authentication processing on the subscribed event.
Illustratively, the switch sends credentials to the intelligent network card based on SNMP, e.g., using SNMPv3 (third version of simple network management protocol), SNMPv3 has a higher security to ensure password agreement between the intelligent network card and the switch. SNMPv3 employs a USM (User-Based Security Model based security model) authentication mechanism to configure authentication and encryption function related information on the intelligent network card, such as generating certificates to be sent to the switch.
Specifically, the embodiment of the present invention discovers a TLV (type length value) for negotiating a cipher in a link layer discovery protocol data unit, and may include two TLVs. The first type of TLV is used for a certificate sent to the switch by the intelligent network card, so that the switch acquires a public key from the certificate, and a private key is stored in the intelligent network card; the second TLV is used for the switch to encrypt the user role information (such as test), the authentication algorithm (such as SHA-1,Secure Hash Algorithm 1, secure hash algorithm 1), the authentication password (such as 123456TESTauth & ≡), the encryption algorithm (such as AES, advanced Encryption Standard, advanced encryption standard), the encryption password (such as 123456TESTencr ≡), and send the encrypted result to the intelligent network card, so that after the intelligent network card determines the encrypted result, the event information sent by the switch can be correctly decrypted to realize the analysis of the subscribed event.
Step S300, the mode of forwarding the message to the switch is adjusted according to the analysis result. Therefore, the method for forwarding the message to the switch is determined by analyzing the current state of the switch represented by the result, so that the problem of poor timeliness of the intelligent network card active query mode can be solved, the influence of the active query mode on the performance of the intelligent network card can be avoided, and the performance of the intelligent network card can be better exerted on the basis of improving timeliness.
The subscribed event in at least one embodiment of the present invention includes an event of a first port failure, and the parsing result of the subscribed event includes the first port failure. The method for forwarding the message to the switch is adjusted according to the analysis result, and comprises the following steps: when the analysis result is that the first port fails, stopping sending the message to the switch through the first port, and sending the message to the switch through the second port; the first port and the second port are ports which are arranged on the switch and are used for communicating with the intelligent network card. The intelligent network card can immediately stop sending the message to the switch through the first port under the condition that the received subscribed event is the event of the first port fault, so that the problem that the sent message is lost or invalid is effectively avoided, and the message can be sent to the switch through the second port, the link switching function is realized, and the effectiveness of message forwarding is improved; the embodiment of the invention realizes the redistribution and management of the forwarding flow on the basis of the improved scheme, and greatly improves the rationality and the effectiveness of forwarding flow distribution.
The subscribed event in at least one embodiment of the present invention includes an event that both the first port and the second port fail, and the parsing result of the subscribed event includes both the first port and the second port fail. The method for forwarding the message to the switch is adjusted according to the analysis result, and comprises the following steps: and when the analysis result shows that the first port and the second port are both in fault, sending a message to the switch through the standby link. The first port and the second port are ports which are arranged on the switch and are used for communicating with the intelligent network card; the standby link is a standby link for communication between the switch and the intelligent network card. Therefore, even in the extreme case of all faults of the first port and the second port, the embodiment of the invention can still send the message to the switch through the standby link, thereby realizing the technical purposes of greatly improving the message forwarding reliability and the like.
As shown in fig. 3, the switch may be, for example, a physical switch having a plurality of ports including a first port and a second port. The switch is connected with the intelligent network card through the first port and the second port, and the switch can be used for connecting an external network of the data center. The intelligent network card is arranged on a server, and the server can be a graphic super-fusion integrated machine; the super fusion all-in-one machine may include a host resource and a virtual machine, where the host resource may include a plurality of CPUs, for example. Specifically, a first port on the switch can be directly connected with a port 1 on the intelligent network card, and a second port on the switch can be directly connected with a port 2 on the intelligent network card; in this embodiment, the switch and the intelligent network card may be directly connected through an optical fiber or a network cable. The first port and the second port in the embodiment of the invention are aggregated together, and the port 1 and the port 2 are aggregated together; the advantage of port aggregation is not only that reliability is increased, e.g. one port may continue to operate in case of failure of another port, but also that bandwidth can be increased, more traffic can be forwarded in the same time period. The embodiment may perform hash calculation according to the MAC (Media Access Control Address, media access control) feature and the IP (Internet Protocol Address ) feature of the message to be sent to the switch, and allocate the forwarding traffic according to the hash calculation result, so as to share the forwarding traffic to the port 1 and the port 2 as much as possible, where the bandwidth of the aggregate port is equal to the sum of the bandwidth of the port 1 and the bandwidth of the port 2.
Taking a physical switch as an example, the port fault or the port blocking performance of the physical switch is various, the traditional intelligent network card actively judges whether the port of the physical switch has a plurality of problems according to the link signal, for example, even if the link signal is detected to be good, the problem that the message can not be continuously received and transmitted due to the blocking phenomenon of a message receiving and transmitting queue of the port of the physical switch is possible, and if the message is continuously transmitted to the blocked port, the problem that the message is continuously lost can be generated. Compared with the method, the intelligent network card can subscribe the event to the switch, and when the subscribed event occurs, the switch can immediately inform the intelligent network card, so that the problem that the prior art still sends a message to the blocked port is avoided; the second port sends the message to the switch, and the embodiment realizes that the message sent to the abnormal port in the aggregation port is quickly changed into the message sent to the normal port in the aggregation port, thereby avoiding the message loss, improving the reliability of message forwarding, and being better suitable for the service with high requirement on timeliness.
Optionally, the embodiment of the invention may further perform operations such as port isolation according to the analysis result, for example, isolating the first port according to the first port failure. Based on the port isolation mode, the embodiment of the invention can also ensure that the application sensitive to the link quality is not affected by the switch fault.
Optionally, the subscribed event in at least one embodiment of the present invention includes an event that the first port is recovered from failure, and the parsing result of the subscribed event includes that the first port is recovered from failure; the method for forwarding the message to the switch is adjusted according to the analysis result, and the method further comprises the following steps: and when the analysis result is that the first port is recovered from the fault to be normal, the message is sent to the switch again through the first port. If the first port is recovered from failure, for example, the previous port is congested and is not congested, the switch immediately sends a subscribed event of the first port recovered from failure to the intelligent network card, and the message is recovered to the switch through the first port, for example, the process of releasing the isolation of the first port can be included, so as to realize redistribution and management of the forwarding traffic, and the forwarding traffic can be distributed uniformly based on the mode of the invention.
As shown in fig. 6, the method for forwarding a message provided by the embodiment of the present invention is based on the same technical concept, and one or more embodiments of the present invention can also provide a device for forwarding a message, which is applied to an intelligent network card; the forwarding device comprises, but is not limited to, an event receiving module, an event analyzing module and a forwarding control module, wherein the event receiving module, the event analyzing module and the forwarding control module can be integrated on the intelligent network card.
The event receiving module is used for receiving subscribed events sent by the switch, and the sending of the subscribed events is triggered by the change of the state of the switch.
The event analysis module is used for analyzing the subscribed event to obtain an analysis result of the subscribed event; the parsing result is used to characterize the current state of the switch.
And the forwarding control module is used for adjusting the mode of forwarding the message to the switch according to the analysis result.
The message forwarding device of at least one embodiment of the invention further comprises a subscription notification module, wherein the subscription notification module is used for sending event subscription messages to the switch; the event subscription reading message is used for notifying the switch to determine that the subscribed event occurs and reporting the event.
In the forwarding device of the message of at least one embodiment of the present invention, the subscribed event includes an event of a first port failure, and the analysis result of the subscribed event includes the first port failure; the forwarding control module is used for stopping sending the message to the switch through the first port when the analysis result is that the first port fails and sending the message to the switch through the second port; the first port and the second port are ports which are arranged on the switch and are used for communicating with the intelligent network card.
In the forwarding device of the message of at least one embodiment of the present invention, the subscribed event includes an event that the first port is recovered from failure, and the analysis result of the subscribed event includes that the first port is recovered from failure; and the forwarding control module is used for sending the message to the switch again through the first port when the analysis result is that the first port is recovered from the fault to be normal.
In the forwarding device for a message according to at least one embodiment of the present invention, the subscribed event includes an event that both the first port and the second port fail, and the analysis result of the subscribed event includes that both the first port and the second port fail.
And the forwarding control module is used for sending a message to the switch through the standby link when the analysis result is that the first port and the second port are both in fault.
The first port and the second port are ports which are arranged on the switch and are used for communicating with the intelligent network card; the standby link is a standby link for communication between the switch and the intelligent network card.
In the message forwarding device according to at least one embodiment of the present invention, the event receiving module is configured to receive a message based on a link layer discovery protocol sent by the switch, where the message based on the link layer discovery protocol includes a subscribed event.
In the message forwarding device according to at least one embodiment of the present invention, the event parsing module is configured to decrypt and/or authenticate the subscribed event.
As shown in fig. 7, the method for forwarding a message according to the embodiment of the present invention is based on the same technical concept, and one or more embodiments of the present invention may further provide an intelligent network card, where the intelligent network card includes a memory and a processor, and the memory stores computer readable instructions, where the computer readable instructions when executed by the processor cause the processor to execute the steps of the method for forwarding a message according to any embodiment of the present invention. The detailed execution process of the message forwarding method is described in detail in the present specification, and will not be described herein.
As shown in fig. 7, the method for forwarding a packet according to the embodiment of the present invention is based on the same technical concept, and one or more embodiments of the present invention can also provide a storage medium storing computer readable instructions, where the computer readable instructions when executed by one or more processors cause the one or more processors to perform the steps of the method for forwarding a packet according to any of the embodiments of the present invention. The detailed execution process of the message forwarding method is described in detail in the present specification, and will not be described herein.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable storage medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable storage medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection (electronic device) with one or more wires, a portable computer cartridge (magnetic device), a random access Memory (RAM, random Access Memory), a Read-Only Memory (ROM), an erasable programmable Read-Only Memory (EPROM, erasable Programmable Read-Only Memory, or flash Memory), an optical fiber device, and a portable compact disc Read-Only Memory (CDROM, compact Disc Read-Only Memory). In addition, the computer-readable storage medium may even be paper or other suitable medium upon which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits with logic gates for implementing logic functions on data signals, application specific integrated circuits with appropriate combinational logic gates, programmable gate arrays (PGA, programmable Gate Array), field programmable gate arrays (FPGA, field Programmable Gate Array), and the like.
In the description of the present specification, a description referring to the terms "present embodiment," "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
The above description is only of the preferred embodiments of the present invention, and is not intended to limit the invention, but any modifications, equivalents, and simple improvements made within the spirit of the present invention should be included in the scope of the present invention.

Claims (16)

1. The message forwarding method is characterized by being applied to an intelligent network card; the method comprises the following steps:
receiving subscribed events sent by a switch, wherein the sending of the subscribed events is triggered by the change of the state of the switch;
analyzing the subscribed event to obtain an analysis result of the subscribed event; the analysis result is used for representing the current state of the switch;
and adjusting the mode of forwarding the message to the switch according to the analysis result.
2. The method for forwarding a message according to claim 1, wherein before the subscribed event sent by the receiving switch, the method further comprises:
sending an event subscription message to the switch;
the event subscription message is used for notifying the switch to determine that the subscribed event occurs and report the event.
3. The method for forwarding a message according to claim 1 or 2, wherein the subscribed event includes an event of a first port failure, and the parsing result of the subscribed event includes the first port failure;
the method for adjusting the message forwarding mode to the switch according to the analysis result comprises the following steps: when the analysis result is that the first port fails, stopping sending the message to the switch through the first port, and sending the message to the switch through the second port;
the first port and the second port are ports which are arranged on the switch and are used for communicating with the intelligent network card.
4. The method for forwarding a message according to claim 3, wherein the subscribed event includes an event that the first port is recovered from failure, and the parsing result of the subscribed event includes that the first port is recovered from failure;
the method for adjusting the message forwarding mode to the switch according to the analysis result further comprises: and when the analysis result is that the first port is recovered to be normal from the fault, the message is sent to the switch again through the first port.
5. The method for forwarding a message according to claim 1 or 2, wherein the subscribed event includes an event that both the first port and the second port fail, and the parsing result of the subscribed event includes that both the first port and the second port fail;
the method for adjusting the message forwarding mode to the switch according to the analysis result comprises the following steps: when the analysis result is that the first port and the second port are both in fault, sending a message to the switch through a standby link;
the first port and the second port are ports which are arranged on the switch and are used for communicating with the intelligent network card; the standby link is a standby link for communication between the switch and the intelligent network card.
6. The method for forwarding a message according to claim 1 or 2, wherein the subscribed event sent by the receiving switch includes:
and receiving a message based on a link layer discovery protocol sent by the switch, wherein the message based on the link layer discovery protocol contains the subscribed event.
7. The method for forwarding a message according to claim 1 or 2, wherein the parsing the subscribed event includes:
and carrying out decryption processing and/or authentication processing on the subscribed event.
8. The message forwarding device is characterized by being applied to an intelligent network card; the device comprises:
the event receiving module is used for receiving subscribed events sent by the switch, and the sending of the subscribed events is triggered by the change of the state of the switch;
the event analysis module is used for analyzing the subscribed event to obtain an analysis result of the subscribed event; the analysis result is used for representing the current state of the switch;
and the forwarding control module is used for adjusting the mode of forwarding the message to the switch according to the analysis result.
9. The apparatus for forwarding a message according to claim 8, wherein the apparatus further comprises:
the subscription notification module is used for sending event subscription messages to the switch;
the event subscription message is used for notifying the switch to determine that the subscribed event occurs and report the event.
10. The apparatus according to claim 8 or 9, wherein the subscribed event comprises an event of a first port failure, and the parsing result of the subscribed event comprises the first port failure;
the forwarding control module is used for stopping sending the message to the switch through the first port when the analysis result is that the first port fails, and sending the message to the switch through the second port;
the first port and the second port are ports which are arranged on the switch and are used for communicating with the intelligent network card.
11. The apparatus according to claim 10, wherein the subscribed event includes an event that the first port is recovered from failure, and the parsing result of the subscribed event includes that the first port is recovered from failure;
and the forwarding control module is used for sending the message to the switch again through the first port when the analysis result shows that the first port is recovered from the fault to be normal.
12. The apparatus according to claim 8 or 9, wherein the subscribed event includes an event that both the first port and the second port fail, and the parsing result of the subscribed event includes that both the first port and the second port fail;
the forwarding control module is configured to send a message to the switch through a standby link when the analysis result indicates that both the first port and the second port are faulty;
the first port and the second port are ports which are arranged on the switch and are used for communicating with the intelligent network card; the standby link is a standby link for communication between the switch and the intelligent network card.
13. The message forwarding device according to claim 8 or 9, wherein,
the event receiving module is configured to receive a message based on a link layer discovery protocol sent by the switch, where the message based on the link layer discovery protocol includes the subscribed event.
14. The message forwarding device according to claim 8 or 9, wherein,
and the event analysis module is used for carrying out decryption processing and/or authentication processing on the subscribed event.
15. An intelligent network card, comprising a memory and a processor, wherein the memory has stored therein computer readable instructions which, when executed by the processor, cause the processor to perform the steps of the method for forwarding a message according to any of claims 1 to 7.
16. A storage medium storing computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the method of forwarding a message according to any one of claims 1 to 7.
CN202210666834.0A 2022-06-13 2022-06-13 Message forwarding method and device, intelligent network card and storage medium Active CN115277879B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210666834.0A CN115277879B (en) 2022-06-13 2022-06-13 Message forwarding method and device, intelligent network card and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210666834.0A CN115277879B (en) 2022-06-13 2022-06-13 Message forwarding method and device, intelligent network card and storage medium

Publications (2)

Publication Number Publication Date
CN115277879A CN115277879A (en) 2022-11-01
CN115277879B true CN115277879B (en) 2023-05-30

Family

ID=83759204

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210666834.0A Active CN115277879B (en) 2022-06-13 2022-06-13 Message forwarding method and device, intelligent network card and storage medium

Country Status (1)

Country Link
CN (1) CN115277879B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111740911A (en) * 2020-06-30 2020-10-02 国电南瑞科技股份有限公司 Method for publishing service subscription relationship of intelligent substation based on LLDP
CN112636999A (en) * 2020-11-26 2021-04-09 新华三技术有限公司成都分公司 Port detection method and network monitoring system
CN112910802A (en) * 2021-01-13 2021-06-04 新华三大数据技术有限公司 Message processing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10868709B2 (en) * 2018-09-10 2020-12-15 Oracle International Corporation Determining the health of other nodes in a same cluster based on physical link information

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111740911A (en) * 2020-06-30 2020-10-02 国电南瑞科技股份有限公司 Method for publishing service subscription relationship of intelligent substation based on LLDP
CN112636999A (en) * 2020-11-26 2021-04-09 新华三技术有限公司成都分公司 Port detection method and network monitoring system
CN112910802A (en) * 2021-01-13 2021-06-04 新华三大数据技术有限公司 Message processing method and device

Also Published As

Publication number Publication date
CN115277879A (en) 2022-11-01

Similar Documents

Publication Publication Date Title
WO2019184924A1 (en) Identity management method, equipment, communication network, and storage medium
US20120311143A1 (en) System and method for supporting automatic disabling of degraded links in an infiniband (ib) network
US8713649B2 (en) System and method for providing restrictions on the location of peer subnet manager (SM) instances in an infiniband (IB) network
US20160014142A1 (en) Link discovery method and apparatus
JP5607655B2 (en) Unencrypted network operation solution
CN104601550B (en) Reverse isolation file transmission system and method based on cluster array
US10206131B2 (en) System and method for programmable native analytics in 5G mobile networks
Jia et al. Rapid detection and localization of gray failures in data centers via in-band network telemetry
US8789134B2 (en) Method for establishing trusted network connect framework of tri-element peer authentication
US20130305053A1 (en) Systems, methods, and apparatus to authenticate communications modules
US11683324B2 (en) Verification of in-situ network telemetry data in a packet-switched network
US20230269579A1 (en) Communication method, related apparatus, and system
CN108737183B (en) Method and device for monitoring forwarding table item
CN115277879B (en) Message forwarding method and device, intelligent network card and storage medium
CN109726564B (en) Information processing method and information processing system applied to encryption machine
CN112350859A (en) Method, device, equipment and storage medium for managing network function entity
WO2023197529A1 (en) Online monitoring system, method and apparatus for power transmission line, and master station
US11381391B2 (en) Pre-shared secret key capabilities in secure MAC layer communication protocols
WO2023227067A1 (en) Quantum network communication method and apparatus, electronic device and storage medium
CN108076021B (en) Service processing method and device
CN114978591B (en) Domain network data interaction system and method based on safety protection
CN107566473A (en) A kind of electric power secondary system equipment check method
CN116846874A (en) Address pool management method and device, nonvolatile storage medium and electronic equipment
CN117640261A (en) Data transmission method, data transfer device, data management equipment and system
CN116781248A (en) Encryption method, encryption device and key management system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant