CN115065649B - Method, device, equipment and storage medium for determining service message forwarding mode - Google Patents

Method, device, equipment and storage medium for determining service message forwarding mode Download PDF

Info

Publication number
CN115065649B
CN115065649B CN202210345828.5A CN202210345828A CN115065649B CN 115065649 B CN115065649 B CN 115065649B CN 202210345828 A CN202210345828 A CN 202210345828A CN 115065649 B CN115065649 B CN 115065649B
Authority
CN
China
Prior art keywords
port
network
network device
state
forwarding
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
CN202210345828.5A
Other languages
Chinese (zh)
Other versions
CN115065649A (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.)
Beijing Armyfly Technology Co Ltd
Original Assignee
Beijing Armyfly Technology 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 Beijing Armyfly Technology Co Ltd filed Critical Beijing Armyfly Technology Co Ltd
Priority to CN202210345828.5A priority Critical patent/CN115065649B/en
Publication of CN115065649A publication Critical patent/CN115065649A/en
Application granted granted Critical
Publication of CN115065649B publication Critical patent/CN115065649B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/20Support for services
    • H04L49/208Port mirroring
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • 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)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a method, a device, equipment and a storage medium for determining a service message forwarding mode. The method is applied to first network equipment and comprises the steps of acquiring the state of a network port of the first network equipment; acquiring a state of a network port of a second network device in communication connection with the first network device; acquiring a service message transmitted by a network system; and determining a forwarding mode for the service message according to the state of the network port of the first network device and the state of the network port of the second network device, wherein the forwarding mode comprises port mirror forwarding or port mirror pause forwarding. The technical scheme of the embodiment of the invention provides a novel method for controlling the message forwarding mode in the network system in real time based on the state change of the network port of the equipment, so as to achieve the aim of saving network resources.

Description

Method, device, equipment and storage medium for determining service message forwarding mode
Technical Field
The embodiment of the invention relates to the technical field of computer communication, in particular to a method, a device, equipment and a storage medium for determining a service message forwarding mode.
Background
Fig. 1a is a schematic diagram of a scenario of a message recording method in the prior art, where a recording device is used to record all messages passing through a network device a and a network device B. Connected to network device a and network device B are 3 network systems, represented by networks C, D and E, respectively. The connection line is a solid line indicating a link currently available for data transmission, and the connection line is a broken line indicating a link currently unavailable for data transmission (i.e., a blocked link). If the current link for data transmission fails, the network and the recording device can switch to another link to transmit data. In the figure, the networks C, D and E all have communication with each other, so that the communication between the networks D and E only passes through the network device a, and the communication between the networks D and C only passes through the network device a and the network device B, so that the recording device needs to mirror the messages on the network devices a and B to the port 10 of the network device B and the port 5 of the network device a at the same time when recording the messages of the whole network.
Referring to fig. 1a, ports 5, 1 and 2 on network device a and ports 3, 10 and 13 on network device B are scribed into virtual local area network N1, port 4 on network device a and port 14 on network device B are scribed into virtual local area network N2. The ports 6, 7 and 8 on the network device a are used as mirror sources and mirror the received/transmitted messages to the port 4, and the messages on the network device a are broadcast to the port 5 and the port 10 of the network device B in the virtual local area network N1 through the ports 4-2. Similarly, the ports 9, 11 and 12 on the network device B are used as mirror sources and mirror the received/transmitted messages to the port 14, so that the messages on the network device B reach the virtual local area network N1 through the link between the port 14 and the port 13 and are broadcast to the port 10 and the port 5 of the network device a in the virtual local area network N1. In fig. 1a, the link between the network device a and the recording device is not in operation, but in order to receive the entire network message after the link between the recording device and the network device is switched, the messages on the network devices a and B are still mirrored to the port 4 on the network device a in real time.
The inventor finds that the following defects exist in the prior art in the process of realizing the invention: since the links between the recording device and the two network devices are active at the same time and only one link is active, it is unnecessary to mirror the messages in the network to the device where the inactive link is located, which is not useful and wasteful of network resources until the link between the network device and the recording device is not switched.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for determining a service message forwarding mode, and provides a novel method for controlling the message forwarding mode in a network system in real time based on the state change of a network port of the equipment, so as to achieve the aim of saving network resources.
In a first aspect, an embodiment of the present invention provides a method for determining a service packet forwarding manner, where the method is applied to a first network device, and the method includes:
acquiring the state of a network port of first network equipment;
acquiring a state of a network port of second network equipment, wherein the second network equipment is in communication connection with the first network equipment, and redundancy backup is carried out between the second network equipment and the first network equipment;
acquiring a service message transmitted by a network system;
and determining a forwarding mode for the service message according to the state of the network port of the first network device and the state of the network port of the second network device, wherein the forwarding mode comprises port mirror forwarding or port mirror pause forwarding.
In a second aspect, an embodiment of the present invention further provides an apparatus for controlling a service packet forwarding manner, where the apparatus is applied to a first network device, and the apparatus includes:
the first network equipment port state acquisition module is used for acquiring the state of the first network equipment network port;
a second network device port state obtaining module, configured to obtain a state of a second network device network port, where the second network device is communicatively connected to the first network device, and perform redundancy backup between the second network device and the first network device;
the service message acquisition module is used for acquiring the service message transmitted by the network system;
and the forwarding mode determining module is used for determining a forwarding mode for the service message according to the state of the network port of the first network device and the state of the network port of the second network device, wherein the forwarding mode comprises port mirror forwarding or port mirror stopping forwarding.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
a storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement a method for determining a service message forwarding manner according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, where a computer program is stored, where the program when executed by a processor implements a method for determining a service packet forwarding manner according to any embodiment of the present invention.
The embodiment of the invention obtains the state of the network port of the first network equipment; acquiring a state of a network port of a second network device in communication connection with the first network device; acquiring a service message transmitted by a network system; determining a forwarding mode aiming at the service message according to the state of the network port of the first network device and the state of the network port of the second network device, wherein the forwarding mode comprises port mirror image forwarding or port mirror image suspension forwarding, so that the problem of network resource waste caused by mirror image of message data to equipment where an unworked link is located when the message in a network system is recorded and backed up in the prior art is solved, and a novel method for controlling the message forwarding mode in the network system in real time based on the state change of the network port of the device is provided, thereby achieving the aim of saving network resources.
Drawings
FIG. 1a is a schematic diagram of a message recording method in the prior art;
fig. 1b is a flowchart of a method for determining a service message forwarding manner according to a first embodiment of the present invention;
fig. 1c is a schematic diagram of a specific topology of a network system according to a first embodiment of the present invention;
fig. 1d is a flowchart of a specific application scenario of a method for determining a forwarding manner of a service packet according to a first embodiment of the present invention;
fig. 2 is a schematic structural diagram of a determining device for a service message forwarding manner according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1b is a flowchart of a method for determining a service packet forwarding manner according to a first embodiment of the present invention, where the method may be applied to a first network device, and the embodiment may be applicable to a case of determining a service packet forwarding manner in a network system, where the method may be performed by a device for determining a service packet forwarding manner, and the device may be implemented by software and/or hardware, and may generally be integrated in a network switching device. Referring to fig. 1b, the method specifically comprises the steps of:
s110, acquiring the state of the network port of the first network device.
In this embodiment, the state of the network port of the first network device may be obtained by detecting the network port of the first network device by means of periodic polling.
S120, acquiring a state of a network port of a second network device, wherein the second network device is in communication connection with the first network device, and redundancy backup is performed between the second network device and the first network device.
The first network device and the second network device may refer to switching devices in a network system, and may be used to forward a message transmitted in a communication process between other devices in the network system. The network system may include a first network device, a second network device, a recording device, and a plurality of networks. The recording device may be configured to record all messages passing through the first network device and the second network device. Each network may include a plurality of network devices, and the networks may communicate with each other, and the communication may be implemented by the first network device and/or the second network device.
The network port may refer to an outlet where the first network device and the second network device communicate with the outside world, and the network port may include a physical port and a virtual port, which is not limited in this embodiment of the present invention. The network ports may include backup ports, traffic ports, and link ports. The backup port may refer to a port where the first network device and the second network device are respectively connected with the recording device in a communication manner, the service port may refer to a port for receiving or sending a message transmitted during communication between other devices in the network system, and the link port may refer to a port where the first network device and the second network device are connected in a communication manner.
Fig. 1C is a schematic diagram of a specific topology of a network system according to a first embodiment of the present invention, where the network system includes a network device a, a network device B, a recording device, a network C, a network D, and a network E. The network equipment A is first network equipment and comprises a backup port 5, service ports 6, 7 and 8 and a link port 1; the network device B is a second network device comprising a backup port 10, traffic ports 9, 11 and 12, and a link port 3. Specifically, the recording device is respectively in communication connection with the network device A and the network device B through ports 5 and 10; communication between networks C, D and E may be achieved through ports 6, 7 and 8 of network device A and ports 9, 11 and 12 of network device B; network device a and network device B are communicatively coupled via port 1 and port 3.
In this embodiment, in the process of the recording device recording the service packet in the network system, the first network device may acquire the network port state of the second network device.
In an optional embodiment of the present invention, the acquiring the state of the network port of the second network device may include: receiving a first LLDP (Link Layer DiscoveryProtocol ) message sent by the second network device; and determining the state of the network port of the second network equipment according to the field value matched with the reserved field in the designated frame of the first link layer discovery protocol LLDP message.
The first LLDP packet may refer to a packet generated by each network port of the second network device by opening an LLDP protocol. The designated frame may refer to a frame in the first LLDP message that can determine a current processing network port status, and typically, the designated frame may refer to a link layer discovery protocol data unit LLDPDU. The reserved field may contain identification information of the current processing network port state, typically such as Up information or Down information. The states of the network ports may include an on state and an off state. Specifically, when the information is Up, it may indicate that the current processing network port may transmit a message, that is, the current processing network port state is an on state; and in the case of Down information, it may indicate that the current processing network port may not transmit a message, i.e., the current processing network port state is in a closed state.
In this embodiment, the first network device may receive the first LLDP packet sent by the second network device, and determine the state of the port of the second network device by identifying the identification information matched with the reserved field in the specified frame of the first LLDP packet.
S130, acquiring a service message transmitted by the network system.
The service message may refer to a message generated in a process that devices under multiple networks communicate with each other through the first network device and/or the second network device.
In this embodiment, the first network device may further obtain a service packet transmitted through the own service port. Wherein, the state of the self service port is an open state.
Correspondingly, when the first network device determines that the state of at least one self service port is the on state, the first network device can acquire the service message transmitted through the self service port in the network system.
And S140, determining a forwarding mode for the service message according to the state of the network port of the first network device and the state of the network port of the second network device.
The forwarding mode may include port mirror forwarding or port mirror suspension forwarding. If the backup port state of the first network device is closed and the backup port state of the second network device is open, in this embodiment, port mirror forwarding may refer to that the first network device sends a service message of itself to the second network device, and after mirror imaging, the video recording device realizes the recording backup of the service message through the backup port of the second network device. If the backup port state of the second network device is closed, in this embodiment, the port mirror image suspension forwarding may refer to that the first network device does not send the service message of itself to the second network device for mirror image and then recording and backup.
In an optional implementation manner of this embodiment, the determining, according to the state of the network port of the second network device, a forwarding manner for the service packet may include: when the state of the backup port of the first network device is in a closed state, and the state of the link port of the first network device and the state of the service port of at least one first network device are in an open state, acquiring the state of the backup port in the second network device; judging whether the state of the backup port in the second network equipment is an opening state, if so, determining that the forwarding mode for the service message is port mirror forwarding; otherwise, determining the forwarding mode aiming at the service message as port mirror image suspension forwarding.
The closed state can be determined by the Down information, which indicates that the backup port can not transmit the message. The on state may be determined by the Up information, which indicates that the own link port and at least one own service port may transmit a message.
Specifically, when the state of the backup port of the first network device is in the closed state, and the state of the link port of the first network device and the state of the service port of at least one first network device are in the open state, the first network device may determine, according to the first LLDP message sent by the second network device, whether the state of the backup port in the second network device is in the open state, that is, whether a message can be transmitted, if so, may determine that the forwarding manner of the acquired self service message is port mirror forwarding, or may determine that the forwarding manner of the acquired self service message is port mirror suspension forwarding.
Optionally, after determining the forwarding manner for the service packet according to the state of the first network device network port and the state of the second network device network port, the method further includes:
when the forwarding mode is determined to be port mirror image forwarding, the service message is sent to the link port of the second network device through the link port of the first network device, so that the second network device mirrors the message and then sends the message to the video device through the backup port of the second network device; the video recording device is in communication connection with the first network device and the second network device.
According to the technical scheme, the state of the network port of the first network equipment is obtained; acquiring a state of a network port of a second network device in communication connection with the first network device; acquiring a service message transmitted by a network system; determining a forwarding mode aiming at the service message according to the state of the network port of the first network device and the state of the network port of the second network device, wherein the forwarding mode comprises port mirror image forwarding or port mirror image suspension forwarding, so that the problem of network resource waste caused by mirror image of message data to equipment where an unworked link is located when the prior art is used for recording and backing up the message in a network system is solved, and a novel method for controlling the message forwarding mode in the network system in real time based on the state change of the network port of the device is provided, thereby achieving the aim of saving network resources.
On the basis of the above technical solution, after detecting the network port of the first network device by means of periodic polling, obtaining the state of the network port of the first network device may further include: storing the state of the network port of the first network device in a reserved field of the second LLDP message; and sending the second LLDP message to the second network device through a link port of the second LLDP message.
The advantage of this arrangement is that the second network device can be made to determine the status of each network port of the first network device, and thus determine the forwarding manner of the service message in the second network device.
Fig. 1d is a flowchart of a specific application scenario of a method for determining a forwarding manner of a service packet according to a first embodiment of the present invention. The network device may store Up/Down information of its own network port state in a reserved field in the LLDPDU, send the Up/Down information in the form of an LLDP message to an opposite network device matched with the network device, where the opposite network device determines a backup port state of the network device according to the received LLDP message, if the Up state is the Up state, the port mirror purpose may be forwarded, and if the Down state is the Down state, the port mirror purpose may be terminated.
The network device may be a first network device in the embodiment of the present invention, and the peer network device may be a second network device in the embodiment of the present invention. The port image purpose as forwarding may be port image forwarding of the embodiment of the present invention, and the port image purpose as suspension forwarding may be port image suspension forwarding of the embodiment of the present invention.
In order to enable those skilled in the art to better understand the method for determining the service message forwarding manner according to the embodiment of the present invention, a specific example is used to describe the following specific procedure with reference to fig. 1 c:
the recording device is used for recording all messages passing through the network device A and the network device B, the solid line connecting line represents a link which can currently carry out data transmission, the broken line connecting line represents a link which cannot currently carry out data transmission (namely a blocking link), and only one link is in operation at the same time between the recording device and the two network devices.
1. The network devices A and B start Up LLDP protocol of the port, add the status information of the device port Up/Down, and store it in reserved field of LLDPDU;
2. the method comprises the steps that network equipment A and B regularly poll the states of all ports and respectively send LLDP messages of all ports to matched opposite-end network equipment, wherein the opposite-end network equipment of the network equipment A is network equipment B, and the opposite-end network equipment of the network equipment B is network equipment A;
3. after receiving the LLDP message sent by the opposite party, the network devices A and B identify and process reserved fields of LLDPDU in the LLDP message, and determine Up/Down information of the port of the network device at the opposite end;
4. port 5 of network device a is Down information, port 10 of network device B is Up information,
5. the network equipment A broadcasts the mirror image data of the messages transmitted by the ports 6, 7 and 8 to the port 10 of the network equipment B through the ports 1 to 3; whereas network device B does not broadcast the mirrored data of its own ports 9, 11 and 12 through port 3 port-port 1 to port 5 which is sent to network device a.
6. At this time, the recording device may record the message of the whole network through the port 10 of the network device B.
Example two
Fig. 2 is a schematic structural diagram of a device for determining a service packet forwarding manner according to a second embodiment of the present invention, where the device may execute the method for determining a service packet forwarding manner according to the foregoing embodiments, and the device may be applied to a first network device. Referring to fig. 2, the apparatus may include: a first network device port status acquisition module 210, a second network device port status acquisition module 220, a service message acquisition module 230, and a forwarding mode determination module 240. Wherein:
a first network device port status acquisition module 210, configured to acquire a status of a first network device network port;
a second network device port status obtaining module 220, configured to obtain a status of a second network device network port, where the second network device is communicatively connected to the first network device, and perform redundancy backup between the second network device and the first network device;
a service message obtaining module 230, configured to obtain a service message transmitted by the network system;
and a forwarding manner determining module 240, configured to determine a forwarding manner for the service packet according to the state of the network port of the second network device, where the forwarding manner includes port mirror forwarding or port mirror suspension forwarding.
According to the technical scheme, the state of the network port of the first network equipment is obtained; acquiring a state of a network port of a second network device in communication connection with the first network device; acquiring a service message transmitted by a network system; determining a forwarding mode aiming at the service message according to the state of the network port of the first network device and the state of the network port of the second network device, wherein the forwarding mode comprises port mirror image forwarding or port mirror image suspension forwarding, so that the problem of network resource waste caused by mirror image of message data to equipment where an unworked link is located when the prior art is used for recording and backing up the message in a network system is solved, and a novel method for controlling the message forwarding mode in the network system in real time based on the state change of the network port of the device is provided, thereby achieving the aim of saving network resources.
In the foregoing apparatus, optionally, the first network device port status acquisition module 210 may be specifically configured to:
and detecting the network port of the first network equipment in a periodic polling mode to acquire the state of the network port of the first network equipment, wherein the network port comprises a backup port, a service port and a link port.
In the above apparatus, optionally, the second network device port status acquisition module 220 may be specifically configured to:
receiving a first link layer discovery protocol LLDP message sent by the second network device;
and determining the state of the network port of the second network equipment according to a field value matched with a reserved field in the first link layer discovery protocol LLDP message, wherein the reserved field comprises a link layer discovery protocol data unit LLDPDU.
In the above apparatus, optionally, the forwarding mode determining module 240 may be specifically configured to:
when the state of the backup port of the first network device is in a closed state, and the state of the link port of the first network device and the state of the service port of at least one first network device are in an open state, acquiring the state of the backup port in the second network device;
judging whether the state of the backup port in the second network equipment is an opening state, if so, determining that the forwarding mode for the service message is port mirror forwarding;
otherwise, determining the forwarding mode aiming at the service message as port mirror image suspension forwarding.
The above apparatus may optionally further include a service packet sending module, configured to, after determining a forwarding manner for the service packet according to the state of the first network device network port and the state of the second network device network port:
when the forwarding mode is determined to be port mirror image forwarding, the service message is sent to the link port of the second network device through the link port of the first network device, so that the second network device mirrors the message and then sends the message to the video device through the backup port of the second network device;
the video recording device is in communication connection with the first network device and the second network device.
In the above apparatus, optionally, the service message obtaining module 230 may be specifically configured to:
and acquiring the service message transmitted by the network system through a service port of the first network device, wherein the state of the service port is an opening state.
In the above apparatus, optionally, the device further includes an LLDP message sending module, configured to, after detecting the network port of the first network device by means of periodic polling, obtain a state of the network port of the first network device:
storing the state of the network port of the first network device in a reserved field of the second LLDP message;
and sending the second LLDP message to the second network device through a link port of the first network device.
The device for determining the service message forwarding mode provided by the embodiment of the invention can execute the method for determining the service message forwarding mode provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example III
Fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention, where, as shown in fig. 3, the device includes a processor 310, a storage device 320, an input device 330, and an output device 340; the number of processors 310 in the device may be one or more, one processor 310 being taken as an example in fig. 3; the processor 310, the storage 320, the input 330 and the output 340 in the device may be connected by a bus or other means, in fig. 3 by way of example.
The storage 320 is used as a computer readable storage medium, and may be used to store a software program, a computer executable program, and a module, such as program instructions/modules corresponding to a method for determining a service packet forwarding mode in an embodiment of the present invention (for example, the first network device port state obtaining module 210, the second network device port state obtaining module 220, the service packet obtaining module 230, and the forwarding mode determining module 240 in the determining device of the service packet forwarding mode). The processor 310 executes various functional applications of the device and data processing by executing software programs, instructions and modules stored in the storage 320, that is, implements the above-mentioned method for determining a service packet forwarding manner, and is applied to the first network device, where the method may include:
acquiring the state of a network port of first network equipment;
acquiring a state of a network port of second network equipment, wherein the second network equipment is in communication connection with the first network equipment, and redundancy backup is carried out between the second network equipment and the first network equipment;
acquiring a service message transmitted by a network system;
and determining a forwarding mode for the service message according to the state of the network port of the first network device and the state of the network port of the second network device, wherein the forwarding mode comprises port mirror forwarding or port mirror pause forwarding.
The storage device 320 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for functions; the storage data area may store data created according to the use of the terminal, etc. In addition, storage 320 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, storage 320 may further include memory located remotely from processor 310, which may be connected to the device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 330 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the apparatus. The output device 340 may include a display device such as a display screen.
Example IV
A fourth embodiment of the present invention further provides a computer readable storage medium having stored thereon a computer program, which when executed by a processor, is configured to perform a method for determining a service message forwarding manner, where the method is applied to a first network device, and the method may include:
acquiring the state of a network port of first network equipment;
acquiring a state of a network port of second network equipment, wherein the second network equipment is in communication connection with the first network equipment, and redundancy backup is carried out between the second network equipment and the first network equipment;
acquiring a service message transmitted by a network system;
and determining a forwarding mode for the service message according to the state of the network port of the first network device and the state of the network port of the second network device, wherein the forwarding mode comprises port mirror forwarding or port mirror pause forwarding.
Of course, the computer readable storage medium provided by the embodiment of the present invention stores a computer program thereon, where the computer program is not limited to the method operations described above, and may also perform related operations in the method for determining a service message forwarding manner provided by any embodiment of the present invention.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, etc., and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the determining device of the service message forwarding manner, each unit and module included are only divided according to the functional logic, but are not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (8)

1. The method for determining the service message forwarding mode is characterized by being applied to first network equipment and comprising the following steps:
acquiring the state of a network port of first network equipment;
acquiring a state of a network port of second network equipment, wherein the second network equipment is in communication connection with the first network equipment, and redundancy backup is carried out between the second network equipment and the first network equipment;
acquiring a service message transmitted by a network system; the network system comprises a first network device, a second network device, a recording device and a plurality of networks; the recording device is used for recording all messages passing through the first network device and the second network device; the first network device and the second network device refer to switching devices in a network system, and are used for forwarding messages transmitted in a communication process between other devices in the network system;
determining a forwarding mode aiming at the service message according to the state of the network port of the first network equipment and the state of the network port of the second network equipment, wherein the forwarding mode comprises port mirror forwarding or port mirror pause forwarding;
the obtaining the state of the network port of the first network device includes:
detecting a first network device network port in a periodic polling mode to acquire the state of the first network device network port, wherein the network port comprises a backup port, a service port and a link port;
the backup port is a port for communication connection between the first network device and the recording device; the service port is a port for receiving or transmitting a message transmitted during communication between other devices in the network system; the link port refers to a port for communication connection between the first network device and the second network device; the determining a forwarding manner for the service message according to the state of the network port of the first network device and the state of the network port of the second network device includes:
when the state of the backup port of the first network device is in a closed state, and the state of the link port of the first network device and the state of the service port of at least one first network device are in an open state, acquiring the state of the backup port in the second network device;
judging whether the state of the backup port in the second network equipment is an opening state, if so, determining that the forwarding mode for the service message is port mirror forwarding;
otherwise, determining that the forwarding mode aiming at the service message is port mirror image suspension forwarding;
the port mirror image forwarding means that the first network device sends the service message to the second network device, and the recording device realizes the recording backup of the service message through the backup port of the second network device after mirror image; the port mirror image suspension forwarding means that the first network device does not send the service message of the first network device to the second network device for mirror image and then recording and backup.
2. The method of claim 1, wherein the obtaining the status of the network port of the second network device comprises:
receiving a first link layer discovery protocol LLDP message sent by the second network device;
and determining the state of the network port of the second network equipment according to the field value matched with the reserved field in the specified frame of the first link layer discovery protocol LLDP message, wherein the specified frame comprises a link layer discovery protocol data unit LLDPDU.
3. The method according to claim 1, wherein after determining the forwarding manner for the service packet according to the state of the first network device network port and the state of the second network device network port, the method further comprises:
when the forwarding mode is determined to be port mirror image forwarding, the service message is sent to the link port of the second network device through the link port of the first network device, so that the second network device mirrors the message and then sends the message to the recording device through the backup port of the second network device;
wherein the admission device is communicatively connected with the first network device and the second network device.
4. The method of claim 1, wherein the obtaining the service packet transmitted by the network system comprises:
and acquiring the service message transmitted by the network system through a service port of the first network device, wherein the state of the service port is an open state.
5. The method according to claim 2, wherein detecting the first network device network port by means of periodic polling, after obtaining the state of the first network device network port, further comprises:
storing the state of the network port of the first network device in a designated frame of the second LLDP message;
and sending the second LLDP message to the second network device through a link port of the first network device.
6. The device for determining the service message forwarding mode is characterized by being applied to first network equipment and comprising the following components:
the first network equipment port state acquisition module is used for acquiring the state of the first network equipment network port;
a second network device port state obtaining module, configured to obtain a state of a second network device network port, where the second network device is communicatively connected to the first network device, and perform redundancy backup between the second network device and the first network device;
the service message acquisition module is used for acquiring the service message transmitted by the network system; the network system comprises a first network device, a second network device, a recording device and a plurality of networks; the recording device is used for recording all messages passing through the first network device and the second network device; the first network device and the second network device refer to switching devices in a network system, and are used for forwarding messages transmitted in a communication process between other devices in the network system;
a forwarding mode determining module, configured to determine a forwarding mode for the service packet according to a state of the network port of the first network device and a state of the network port of the second network device, where the forwarding mode includes port mirror forwarding or port mirror suspension forwarding;
the first network device port state acquisition module is specifically configured to:
detecting a first network device network port in a periodic polling mode to acquire the state of the first network device network port, wherein the network port comprises a backup port, a service port and a link port;
the backup port is a port for communication connection between the first network device and the recording device; the service port is a port for receiving or transmitting a message transmitted during communication between other devices in the network system; the link port refers to a port for communication connection between the first network device and the second network device;
the forwarding mode determining module is specifically configured to:
when the state of the backup port of the first network device is in a closed state, and the state of the link port of the first network device and the state of the service port of at least one first network device are in an open state, acquiring the state of the backup port in the second network device;
judging whether the state of the backup port in the second network equipment is an opening state, if so, determining that the forwarding mode for the service message is port mirror forwarding;
otherwise, determining that the forwarding mode aiming at the service message is port mirror image suspension forwarding;
the port mirror image forwarding means that the first network device sends the service message to the second network device, and the recording device realizes the recording backup of the service message through the backup port of the second network device after mirror image; the port mirror image suspension forwarding means that the first network device does not send the service message of the first network device to the second network device for mirror image and then recording and backup.
7. An electronic device, comprising:
one or more processors;
a storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement a method for determining a service message forwarding manner according to any one of claims 1 to 5.
8. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements a method of determining a manner of forwarding a service message according to any of claims 1-5.
CN202210345828.5A 2022-03-31 2022-03-31 Method, device, equipment and storage medium for determining service message forwarding mode Active CN115065649B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210345828.5A CN115065649B (en) 2022-03-31 2022-03-31 Method, device, equipment and storage medium for determining service message forwarding mode

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210345828.5A CN115065649B (en) 2022-03-31 2022-03-31 Method, device, equipment and storage medium for determining service message forwarding mode

Publications (2)

Publication Number Publication Date
CN115065649A CN115065649A (en) 2022-09-16
CN115065649B true CN115065649B (en) 2023-12-12

Family

ID=83196845

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210345828.5A Active CN115065649B (en) 2022-03-31 2022-03-31 Method, device, equipment and storage medium for determining service message forwarding mode

Country Status (1)

Country Link
CN (1) CN115065649B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102209035A (en) * 2011-05-25 2011-10-05 杭州华三通信技术有限公司 Traffic forwarding method and devices
CN111953786A (en) * 2020-08-14 2020-11-17 北京东土军悦科技有限公司 System, method and device for recording messages in whole network, network equipment and storage medium
WO2021088808A1 (en) * 2019-11-05 2021-05-14 中兴通讯股份有限公司 Method for dual-homing device access traffic forwarding, device, and storage medium
CN113938405A (en) * 2020-07-10 2022-01-14 北京华为数字技术有限公司 Data processing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102209035A (en) * 2011-05-25 2011-10-05 杭州华三通信技术有限公司 Traffic forwarding method and devices
WO2021088808A1 (en) * 2019-11-05 2021-05-14 中兴通讯股份有限公司 Method for dual-homing device access traffic forwarding, device, and storage medium
CN113938405A (en) * 2020-07-10 2022-01-14 北京华为数字技术有限公司 Data processing method and device
CN111953786A (en) * 2020-08-14 2020-11-17 北京东土军悦科技有限公司 System, method and device for recording messages in whole network, network equipment and storage medium

Also Published As

Publication number Publication date
CN115065649A (en) 2022-09-16

Similar Documents

Publication Publication Date Title
TW201944236A (en) Task processing method, apparatus, and system
US9049241B2 (en) Peer discovery and secure communication in failover schemes
CN109960634B (en) Application program monitoring method, device and system
CN109040295B (en) Method and device for determining abnormal disconnection, terminal and storage medium
CN112492030B (en) Data storage method, device, computer equipment and storage medium
CN115065649B (en) Method, device, equipment and storage medium for determining service message forwarding mode
CN111245660B (en) Network-based equipment upgrading self-adaptive transmission method
KR20150104435A (en) Method of performing transition of operation mode for a routing processor
JP3358567B2 (en) Automatic power-off device, network printer, and automatic power-off method
JP2002118570A (en) Method and equipment for packet communication
US11812487B2 (en) Method, device, extender, and computer medium for automatically restoring connection
CN111556043B (en) Message processing method, device, system, equipment and readable storage medium
US20100005197A1 (en) Network device and active control card detecting method
CN112995095B (en) Data processing method, device and computer readable storage medium
CN114553936A (en) Connection method, connection device, electronic equipment and computer-readable storage medium
CN114090342A (en) Storage disaster tolerance link management method, message execution node and storage control cluster
CN109818870B (en) Multicast routing method, device, service board and machine readable storage medium
CN110958128B (en) Alarm reporting scheduling method and device
CN110890989A (en) Channel connection method and device
CN112671549A (en) Data processing method, equipment and system
CN113904980B (en) Channel switching method, device, switch and storage medium
JPH0675258B2 (en) Network reconfiguration device and method
CN110912839B (en) Main and standby switch detection method, system, terminal and storage medium
CN112994918B (en) Equipment management method and device
KR100272841B1 (en) The structure and processing method for the transmission of message in process using message queue

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