CN111404827A - Data packet processing method and device, electronic equipment and storage medium - Google Patents
Data packet processing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111404827A CN111404827A CN202010159732.0A CN202010159732A CN111404827A CN 111404827 A CN111404827 A CN 111404827A CN 202010159732 A CN202010159732 A CN 202010159732A CN 111404827 A CN111404827 A CN 111404827A
- Authority
- CN
- China
- Prior art keywords
- data packet
- packet
- target
- target data
- processing
- 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.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
- H04L47/125—Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application discloses a data packet processing method, a device, an electronic device and a computer readable storage medium, wherein the method comprises the following steps: if the target data packet is received, determining a packet receiving network port of the target data packet, and judging whether the target data packet needs to be processed by the local computer or not based on the packet receiving network port and a data packet processing rule; if not, adding identification information for identifying the type of the data packet in the target data packet to obtain a forwarding data packet; the data packet types comprise a negotiation data packet, a heartbeat data packet and a transmission data packet, wherein the negotiation data packet is used for negotiating a data packet processing rule, the heartbeat data packet is used for detecting the survival state of the target equipment, and the transmission data packet is used for transmitting data; and sending the forwarding data packet to the opposite terminal equipment so that the opposite terminal equipment can process the forwarding data packet based on the type of the data packet. The data packet processing method provided by the application reduces the delay of load data packet processing of each device.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a data packet, an electronic device, and a computer-readable storage medium.
Background
In the case of a gateway or a network forwarding device in the dual-master mode, for the same request connection, a scenario in which a request packet and a reply packet randomly pass through different network devices is called asymmetric forwarding. The session management of the device data packet is synchronized between two devices based on the session synchronization delay mode method, when the new session of one device is not synchronized to the opposite end, the packet is cached, and the session is sent out after being synchronized. The above scheme may increase the equipment load and may increase the network delay.
Therefore, how to reduce the device load in the asymmetric forwarding scenario of the dual-master mode is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
The present application aims to provide a data packet processing method, an apparatus, an electronic device, and a computer-readable storage medium, which reduce the device load in an asymmetric forwarding scenario of a dual-master mode.
In order to achieve the above object, the present application provides a data packet processing method, applied to a target device, including:
if a target data packet is received, determining a packet receiving network port of the target data packet, and judging whether the target data packet needs to be processed by a local computer or not based on the packet receiving network port and a data packet processing rule;
if not, adding identification information for identifying the type of the data packet in the target data packet to obtain a forwarding data packet;
sending the forwarding data packet to opposite terminal equipment so that the opposite terminal equipment can process the forwarding data packet based on the type of the data packet; the target device and the opposite terminal device are two devices in a dual-host hot-standby system, and the dual-host hot-standby system is in a dual-master mode.
Wherein, said determining whether the target data packet needs local processing based on the packet receiving network port and the data packet processing rule comprises:
determining a communication network port of the target device and the opposite terminal device, and judging whether the communication network port is consistent with the packet receiving network port;
if so, judging that the target data packet is a data packet sent by the opposite terminal equipment, and processing the target data packet based on the data packet type of the target data packet;
if not, the target data packet is judged to be a transmission data packet sent to the dual-computer hot standby system by the upstream equipment, and whether the target data packet needs local processing is judged based on the communication information of the target data packet and the data packet processing rule.
Wherein the determining whether the target packet needs local processing based on the communication information of the target packet and the packet processing rule includes:
acquiring a source IP address and a destination IP address of the target data packet, and determining a target session to which the target data packet belongs based on the source IP address and the destination IP address;
and judging whether the target data packet needs local processing or not by judging whether the target session is the session processed by the local processing or not.
The identification information includes a first parameter for describing the packet receiving network port, a second parameter for describing whether the packet is a data packet sent by the opposite terminal device, and the type of the data packet.
The first parameter is specifically a hash value of the packet receiving network port.
The data packet types comprise a negotiation data packet, a heartbeat data packet and a transmission data packet;
the processing the target data packet based on the data packet type of the target data packet includes:
if the target data packet is the transmission data packet, removing the identification information in the target data packet, and sending the data packet with the identification information removed to downstream equipment of the dual-computer hot standby system;
and if the target data packet is the heartbeat data packet, updating a first parameter in the identification information corresponding to the target data packet, and returning the state information of the local machine to the opposite terminal equipment.
Wherein the determining the communication network port between the target device and the opposite device includes:
and acquiring a configuration file, and determining the opposite terminal device corresponding to the target device and the communication network ports of the target device and the opposite terminal device according to the configuration file.
In order to achieve the above object, the present application provides a packet processing apparatus, applied to a target device, including:
the judging module is used for determining a packet receiving network port of the target data packet if the target data packet is received, and judging whether the target data packet needs to be processed by the local computer or not based on the packet receiving network port and a data packet processing rule; if not, starting the working process of the adding module;
the adding module is used for adding identification information for identifying the type of the data packet in the target data packet to obtain a forwarding data packet;
a sending module, configured to send the forwarding packet to an opposite-end device, so that the opposite-end device processes the forwarding packet based on the packet type; the target device and the opposite terminal device are two devices in a dual-host hot-standby system, and the dual-host hot-standby system is in a dual-master mode.
To achieve the above object, the present application provides an electronic device including:
a memory for storing a computer program;
a processor for implementing the steps of the above-mentioned packet processing method when executing the computer program.
To achieve the above object, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when being executed by a processor, implements the steps of the above-mentioned packet processing method.
According to the above scheme, the data packet processing method provided by the application includes: if a target data packet is received, determining a packet receiving network port of the target data packet, and judging whether the target data packet needs to be processed by a local computer or not based on the packet receiving network port and a data packet processing rule; if not, adding identification information for identifying the type of the data packet in the target data packet to obtain a forwarding data packet; sending the forwarding data packet to opposite terminal equipment so that the opposite terminal equipment can process the forwarding data packet based on the type of the data packet; the target device and the opposite terminal device are two devices in a dual-host hot-standby system, and the dual-host hot-standby system is in a dual-master mode.
According to the data packet processing method, the two devices negotiate the data packet processing rule in advance in the dual-master mode, and the processing device corresponding to each data packet can be determined based on the data packet processing rule. Data packets passing through the dual-computer hot standby system are distributed to fixed equipment for processing, synchronous session management is not needed between the two equipment, and delay of processing the load data packets of each equipment is reduced. The application also discloses a data packet processing device, an electronic device and a computer readable storage medium, which can also realize the technical effects.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a flow diagram illustrating a method of packet processing according to an exemplary embodiment;
FIG. 2 is a flow diagram illustrating another method of packet processing according to an exemplary embodiment;
FIG. 3 is a diagram illustrating the format of an original data packet in accordance with an illustrative embodiment;
FIG. 4 is a diagram illustrating a format of a forwarded data packet in accordance with an illustrative embodiment;
FIG. 5 is a block diagram illustrating a packet processing device according to an exemplary embodiment;
FIG. 6 is a block diagram illustrating an electronic device in accordance with an exemplary embodiment.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application discloses a data packet processing method, which reduces equipment load under an asymmetric forwarding scene of a double-master mode.
Referring to fig. 1, a flow chart of a packet processing method according to an exemplary embodiment is shown, as shown in fig. 1, including:
s101: if a target data packet is received, determining a packet receiving network port of the target data packet, and judging whether the target data packet needs to be processed by a local computer or not based on the packet receiving network port and a data packet processing rule; if yes, entering S102; if not, the step S103 is entered;
the execution main body of this embodiment is a target device in a dual-host hot-standby system, the dual-host hot-standby system is in a dual-host mode, and the two host devices are the target device and an opposite device corresponding to the target device, respectively. In a specific implementation, the configuration file is loaded first, and the correctness of the configuration file is checked, so that information negotiation is performed between two devices based on the configuration file, a communication network port between the two devices and a packet processing rule are determined, and the packet processing rule defines characteristics of packets respectively processed by the two devices.
When the target device receives the target data packet, whether the target data packet needs local processing or not can be determined based on the packet receiving port of the target data packet and the data packet processing rule. It can be understood that, if the packet receiving port of the target data packet is the communication port between the target device and the opposite device, the target data packet is a data packet sent by the opposite device and needs to be processed by the local device. If the packet receiving port of the target data packet is other port, whether the packet receiving port needs local processing or not can be determined according to the characteristics of the target data packet and the data packet processing rule.
S102: processing the target data packet based on the data packet type of the target data packet;
in this step, if the target data packet needs to be processed by the local device, the target data packet is processed according to the type of the data packet, where the type of the data packet may include a negotiation data packet, a heartbeat data packet, and a transmission data packet, the negotiation data packet is used to negotiate the data packet processing rule, the heartbeat data packet is used to detect the survival state of the target device, and the transmission data packet is used to transmit data.
In a specific implementation, if the type of the data packet is a negotiation data packet, the target data packet is a data packet for negotiating a data packet processing rule sent by the peer device, and the negotiation data packet may be replied to complete negotiation of the data packet processing rule. And if the type of the data packet is a transmission data packet, the target data packet is a data packet which is sent to the dual-computer hot standby system by other equipment, and the data packet is forwarded after being processed. If the type of the data packet is a heartbeat data packet, the target data packet is a data packet which is sent by the opposite terminal device and used for detecting the survival state of the local machine, and the state information of the local machine can be replied so that the opposite terminal device can determine the survival state of the local machine.
It can be understood that the target device may detect whether the peer device is normal by sending a heartbeat packet to the peer device, and may also detect whether the local link is abnormal. If the abnormality is detected and the reply of the heartbeat data packet is received in the appointed time period, the data packet processing function is temporarily closed and the monitoring is continuously carried out until the opposite terminal equipment is normal or the normal recovery function of the local link is realized.
S103: adding identification information for identifying the type of the data packet into the target data packet to obtain a forwarding data packet, and sending the forwarding data packet to opposite-end equipment so that the opposite-end equipment can process the forwarding data packet based on the type of the data packet; the target device and the opposite terminal device are two devices in a dual-host hot-standby system, and the dual-host hot-standby system is in a dual-master mode.
In this step, for a data packet that needs to be sent to the peer device for processing, first, identification information for identifying the type of the data packet is added to the data packet, and then the data packet is sent to the peer device for processing through the communication network port between the devices.
In the data packet processing method provided in the embodiment of the present application, two devices negotiate a data packet processing rule in advance in a dual-master mode, and a processing device corresponding to each data packet can be determined based on the data packet processing rule. Data packets passing through the dual-computer hot standby system are distributed to fixed equipment for processing, synchronous session management is not needed between the two equipment, and delay of processing the load data packets of each equipment is reduced.
The embodiment of the present application discloses a data packet processing method, and compared with the previous embodiment, the present embodiment further describes and optimizes the technical solution. Specifically, the method comprises the following steps:
referring to fig. 2, a flow chart of another packet processing method according to an exemplary embodiment is shown, as shown in fig. 2, including:
s201: if a target data packet is received, determining a packet receiving network port of the target data packet;
s202: determining a communication network port of the target device and the opposite terminal device, and judging whether the communication network port is consistent with the packet receiving network port; if yes, the target data packet is judged to be the data packet sent by the opposite terminal equipment, and S204 is carried out; if not, the step S203 is entered;
in a specific implementation, the communication network interfaces of the target device and the peer device may be determined according to a configuration file, that is, the step of determining the communication network interface of the target device and the peer device may include: and acquiring a configuration file, and determining the opposite terminal device corresponding to the target device and the communication network ports of the target device and the opposite terminal device according to the configuration file.
S203: judging that the target data packet is a transmission data packet sent to the dual-computer hot standby system by the upstream equipment, and judging whether the target data packet needs local processing or not based on the communication information of the target data packet and the data packet processing rule; if yes, entering S204; if not, the process goes to S205;
in this embodiment, the packet processing rule may define the characteristics of the packet processed by each device based on the communication information of the packet. Namely, the step of determining whether the target packet requires local processing based on the communication information of the target packet and the packet processing rule includes: acquiring a source IP address and a destination IP address of the target data packet, and determining a target session to which the target data packet belongs based on the source IP address and the destination IP address; and judging whether the target data packet needs local processing or not by judging whether the target session is the session processed by the local processing or not. In a specific implementation, the packet processing rules define the sessions that each device needs to process, i.e. packets belonging to the same session are processed by the same device. When a target data packet is received, communication information such as a source IP address and a destination IP address of the target data packet can be extracted, a session identifier of a session to which the target data packet belongs is determined based on the source IP address and the destination IP address, processing equipment corresponding to the session can be determined according to the corresponding relation between the session identifier and the equipment identifier, and then processing equipment of the target data packet in the session is determined.
S204: processing the target data packet based on the data packet type of the target data packet;
in this step, if the packet receiving port of the target data packet is the communication port between the target device and the peer device, the target data packet is a data packet sent by the peer device, and is processed based on the type of the data packet.
S205: adding identification information for identifying the type of the data packet into the target data packet to obtain a forwarding data packet;
in this embodiment, the identification information may include a first parameter for describing the packet receiving network port, a second parameter for describing whether the packet is a data packet sent by the peer device, and the type of the data packet, where the first parameter may specifically be a hash value of the packet receiving network port.
In the specific implementation, the hash calculation is performed on the packet receiving port of the target data packet, the calculation result is the first parameter, the first parameter is written between the network layer and the link layer of the target data packet, the format and the length of the two-layer data header are modified, the offset value and the length of the data packet between the layers of the target data packet are modified, a forwarding data packet is generated, and the packet sending function of the communication port is called to send the forwarding data packet.
For example, the format of the original packet is as shown in fig. 3, the format of the forwarded packet is as shown in fig. 4, in fig. 3, the Type indicates the transmission mode of the packet, and may include IPV4 and IPV6, in fig. 4, the newly added Type is the second parameter, Key is the first parameter, and Type is the packet Type.
S206: sending the forwarding data packet to opposite terminal equipment so that the opposite terminal equipment can process the forwarding data packet based on the type of the data packet; the target device and the opposite terminal device are two devices in a dual-host hot-standby system, and the dual-host hot-standby system is in a dual-master mode.
The processing process of the opposite terminal device to the forwarding data packet is as follows: when receiving the forwarding data packet, analyzing the forwarding data packet, judging whether the forwarding data packet is the data packet sent by the opposite terminal equipment or not according to the identification information, and if so, correcting the forwarding data packet. And when the type of the data packet of the forwarded data packet is the transmission data packet, removing the identification information in the data packet, processing the data packet and then forwarding the data packet. When the type of the data packet of the forwarding data packet is the heartbeat data packet, modifying the packet receiving port of the forwarding data packet into a packet receiving port corresponding to the local machine, and replying the state information of the local machine to the target device.
It is understood that the processing procedure of the target device for the target data packet is similar to the above-mentioned type of procedure, i.e. step S204 may include: if the target data packet is the transmission data packet, removing the identification information in the target data packet, and sending the data packet with the identification information removed to downstream equipment of the dual-computer hot standby system; and if the target data packet is the heartbeat data packet, updating a first parameter in the identification information corresponding to the target data packet, and returning the state information of the local machine to the opposite terminal equipment.
In the following, a packet processing apparatus provided in an embodiment of the present application is introduced, and a packet processing apparatus described below and a packet processing method described above may be referred to each other.
Referring to fig. 5, a block diagram of a packet processing device according to an exemplary embodiment is shown, as shown in fig. 5, including:
a determining module 501, configured to determine, if a target data packet is received, a packet receiving port of the target data packet, and determine, based on the packet receiving port and a data packet processing rule, whether the target data packet needs to be processed by a local computer; if not, the workflow of the adding module 502 is started;
the adding module 502 is configured to add identification information for identifying a type of a data packet to the target data packet to obtain a forwarding data packet;
a sending module 503, configured to send the forwarding packet to an opposite end device, so that the opposite end device processes the forwarding packet based on the packet type; the target device and the opposite terminal device are two devices in a dual-host hot-standby system, and the dual-host hot-standby system is in a dual-master mode.
In the data packet processing apparatus provided in the embodiment of the present application, two devices negotiate a data packet processing rule in advance in a dual-master mode, and a processing device corresponding to each data packet can be determined based on the data packet processing rule. Data packets passing through the dual-computer hot standby system are distributed to fixed equipment for processing, synchronous session management is not needed between the two equipment, and delay of processing the load data packets of each equipment is reduced.
On the basis of the foregoing embodiment, as a preferred implementation manner, the determining module 501 includes:
the determining unit is used for determining a packet receiving network port of a target data packet when the target data packet is received;
a first judging unit, configured to determine a communication port of the target device and the opposite device, and judge whether the communication port is consistent with the packet receiving port; if yes, starting the working process of the processing unit; if not, starting the working process of the second judgment unit;
the processing unit is used for judging that the target data packet is a data packet sent by the opposite terminal equipment and processing the target data packet based on the data packet type of the target data packet;
and the second judging unit is used for judging that the target data packet is a transmission data packet sent to the dual-computer hot standby system by the upstream equipment, and judging whether the target data packet needs to be processed by a local computer or not based on the communication information of the target data packet and the data packet processing rule.
On the basis of the foregoing embodiment, as a preferred implementation manner, the second determining unit is specifically a unit that determines that the target packet is a transmission packet sent by an upstream device to the dual-computer hot-standby system, acquires a source IP address and a destination IP address of the target packet, determines a target session to which the target packet belongs based on the source IP address and the destination IP address, and determines whether the target packet needs to be processed by a local computer by determining whether the target session is a session processed by the local computer.
On the basis of the foregoing embodiment, as a preferred implementation, the identification information includes a first parameter for describing the packet receiving network port, a second parameter for describing whether the packet is a data packet sent by the peer device, and the type of the data packet.
On the basis of the foregoing embodiment, as a preferred implementation manner, the first parameter is specifically a hash value of the packet receiving port.
On the basis of the above embodiment, as a preferred implementation, the data packet type includes a negotiation data packet, a heartbeat data packet, and a transmission data packet;
the processing unit includes:
a determining subunit, configured to determine that the target data packet is a data packet sent by the peer device;
a sending subunit, configured to remove, if the target data packet is the transmission data packet, identification information in the target data packet, and send the data packet with the identification information removed to a downstream device of the dual-computer hot-standby system;
and the return subunit is configured to, if the target data packet is the heartbeat data packet, update a first parameter in identification information corresponding to the target data packet, and return state information of the local computer to the peer device.
On the basis of the above embodiment, as a preferred implementation, the first judging unit includes:
a determining subunit, configured to obtain a configuration file, and determine, according to the configuration file, an opposite-end device corresponding to the target device, and a communication port between the target device and the opposite-end device;
the judging subunit is used for judging whether the communication network port is consistent with the packet receiving network port; if yes, starting the working process of the processing unit; if not, the working process of the second judgment unit is started.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The present application further provides an electronic device, and referring to fig. 6, a structure diagram of an electronic device 600 provided in an embodiment of the present application may include a processor 11 and a memory 12, as shown in fig. 6. The electronic device 600 may also include one or more of a multimedia component 13, an input/output (I/O) interface 14, and a communication component 15.
The processor 11 is configured to control the overall operation of the electronic device 600, so as to complete all or part of the steps in the above-mentioned packet processing method. The memory 12 is used to store various types of data to support operation at the electronic device 600, such as instructions for any application or method operating on the electronic device 600 and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and so forth. The Memory 12 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia component 13 may include a screen and an audio component. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 12 or transmitted via the communication component 15. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 14 provides an interface between the processor 11 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication module 15 is used for wired or wireless communication between the electronic device 600 and other devices. Wireless communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so that the corresponding communication component 15 may include: Wi-Fi module, bluetooth module, NFC module.
In an exemplary embodiment, the electronic Device 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable logic devices (Programmable L ic devices, P L D), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components for performing the above-mentioned packet Processing method.
In another exemplary embodiment, there is also provided a computer readable storage medium including program instructions, which when executed by a processor, implement the steps of the above-described packet processing method. For example, the computer readable storage medium may be the memory 12 comprising program instructions executable by the processor 11 of the electronic device 600 to perform the packet processing method described above.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Claims (10)
1. A data packet processing method is applied to a target device and comprises the following steps:
if a target data packet is received, determining a packet receiving network port of the target data packet, and judging whether the target data packet needs to be processed by a local computer or not based on the packet receiving network port and a data packet processing rule;
if not, adding identification information for identifying the type of the data packet in the target data packet to obtain a forwarding data packet;
sending the forwarding data packet to opposite terminal equipment so that the opposite terminal equipment can process the forwarding data packet based on the type of the data packet; the target device and the opposite terminal device are two devices in a dual-host hot-standby system, and the dual-host hot-standby system is in a dual-master mode.
2. The method according to claim 1, wherein said determining whether the destination packet requires local processing based on the packet receiving port and the packet processing rule comprises:
determining a communication network port of the target device and the opposite terminal device, and judging whether the communication network port is consistent with the packet receiving network port;
if so, judging that the target data packet is a data packet sent by the opposite terminal equipment, and processing the target data packet based on the data packet type of the target data packet;
if not, the target data packet is judged to be a transmission data packet sent to the dual-computer hot standby system by the upstream equipment, and whether the target data packet needs local processing is judged based on the communication information of the target data packet and the data packet processing rule.
3. The method according to claim 2, wherein the determining whether the destination packet requires local processing based on the communication information of the destination packet and the packet processing rule comprises:
acquiring a source IP address and a destination IP address of the target data packet, and determining a target session to which the target data packet belongs based on the source IP address and the destination IP address;
and judging whether the target data packet needs local processing or not by judging whether the target session is the session processed by the local processing or not.
4. The method according to claim 2, wherein the identification information includes a first parameter for describing the packet receiving port, a second parameter for describing whether the packet is a packet sent by the peer device, and the packet type.
5. The method of claim 4, wherein the first parameter comprises a hash value of the receiving port.
6. The packet processing method according to claim 4, wherein the packet types include a negotiation packet, a heartbeat packet, and a transmission packet;
the processing the target data packet based on the data packet type of the target data packet includes:
if the target data packet is the transmission data packet, removing the identification information in the target data packet, and sending the data packet with the identification information removed to downstream equipment of the dual-computer hot standby system;
and if the target data packet is the heartbeat data packet, updating a first parameter in the identification information corresponding to the target data packet, and returning the state information of the local machine to the opposite terminal equipment.
7. The method according to claim 2, wherein the determining a communication port between the target device and the peer device comprises:
and acquiring a configuration file, and determining the opposite terminal device corresponding to the target device and the communication network ports of the target device and the opposite terminal device according to the configuration file.
8. A packet processing apparatus, applied to a target device, comprising:
the judging module is used for determining a packet receiving network port of the target data packet if the target data packet is received, and judging whether the target data packet needs to be processed by the local computer or not based on the packet receiving network port and a data packet processing rule; if not, starting the working process of the adding module;
the adding module is used for adding identification information for identifying the type of the data packet in the target data packet to obtain a forwarding data packet;
a sending module, configured to send the forwarding packet to an opposite-end device, so that the opposite-end device processes the forwarding packet based on the packet type; the target device and the opposite terminal device are two devices in a dual-host hot-standby system, and the dual-host hot-standby system is in a dual-master mode.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the data packet processing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the data packet processing method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010159732.0A CN111404827B (en) | 2020-03-09 | 2020-03-09 | Data packet processing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010159732.0A CN111404827B (en) | 2020-03-09 | 2020-03-09 | Data packet processing method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111404827A true CN111404827A (en) | 2020-07-10 |
CN111404827B CN111404827B (en) | 2023-09-08 |
Family
ID=71432346
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010159732.0A Active CN111404827B (en) | 2020-03-09 | 2020-03-09 | Data packet processing method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111404827B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112331133A (en) * | 2020-08-24 | 2021-02-05 | 浙江宇视科技有限公司 | Display control method, device, medium and system of LED screen |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103731294A (en) * | 2013-03-28 | 2014-04-16 | 深圳市金溢科技有限公司 | Method, device and system for two-machine hot-standby communication |
CN105827623A (en) * | 2016-04-26 | 2016-08-03 | 山石网科通信技术有限公司 | Data center system |
US20180121301A1 (en) * | 2016-10-17 | 2018-05-03 | Cboe Exchange, Inc. | Low latency system having high availability computer architecture |
CN110311868A (en) * | 2019-07-08 | 2019-10-08 | 新华三信息安全技术有限公司 | Method for processing business, device, member device and machine readable storage medium |
-
2020
- 2020-03-09 CN CN202010159732.0A patent/CN111404827B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103731294A (en) * | 2013-03-28 | 2014-04-16 | 深圳市金溢科技有限公司 | Method, device and system for two-machine hot-standby communication |
CN105827623A (en) * | 2016-04-26 | 2016-08-03 | 山石网科通信技术有限公司 | Data center system |
US20180121301A1 (en) * | 2016-10-17 | 2018-05-03 | Cboe Exchange, Inc. | Low latency system having high availability computer architecture |
CN110311868A (en) * | 2019-07-08 | 2019-10-08 | 新华三信息安全技术有限公司 | Method for processing business, device, member device and machine readable storage medium |
Non-Patent Citations (1)
Title |
---|
孙来平;: "CBTC热备冗余系统软件安全切换技术的研究与实现" * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112331133A (en) * | 2020-08-24 | 2021-02-05 | 浙江宇视科技有限公司 | Display control method, device, medium and system of LED screen |
Also Published As
Publication number | Publication date |
---|---|
CN111404827B (en) | 2023-09-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2008028801A (en) | Operation management system, mode, operation management method and program | |
JP6801409B2 (en) | Route search system, route search method and route search program | |
CN111510476B (en) | Communication method, communication device, computer equipment and computer readable storage medium | |
CN109379241B (en) | Path information determination method and device | |
CN109889411B (en) | Data transmission method and device | |
WO2016091156A1 (en) | Node fault judgement method and device | |
CN104539462B (en) | It is a kind of to switch to method and device of the calamity for application example | |
CN109039687A (en) | Load-balancing method, device, system, equipment and the storage medium of request | |
CN113507431B (en) | Message management method, device, equipment and machine-readable storage medium | |
CN111404827B (en) | Data packet processing method and device, electronic equipment and storage medium | |
CN112653699B (en) | BFD authentication method and device and electronic equipment | |
EP3185489A1 (en) | Communication device, communication system and communication method | |
CN110569987A (en) | Automatic operation and maintenance method, operation and maintenance equipment, storage medium and device | |
JP2016178494A (en) | Gateway device and communication method | |
CN117395195A (en) | Communication method, device, equipment and storage medium | |
JP2019531610A (en) | SIP information analysis method, apparatus, server, and medium | |
CN115996187A (en) | Routing information processing method and device, routing information interaction system and routing equipment | |
US20190268239A1 (en) | Bgp logical topology generation method, and device | |
CN107231309B (en) | Obtain method, controller and the purpose switching node of SDN the whole network view | |
CN111669320B (en) | Method for processing message and network equipment | |
CN111464395B (en) | Method and device for creating blockchain and readable storage medium | |
US9455911B1 (en) | In-band centralized control with connection-oriented control protocols | |
CN113271305B (en) | Attack detection method and device and web application level intrusion prevention system WAF | |
JP6497142B2 (en) | Communication monitoring device, communication monitoring program, and communication monitoring method | |
CN114338669B (en) | Block chain-based data transmission method, device, equipment and storage medium |
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 |