CN109005088B - Method and device for detecting repeated messages in parallel redundant network - Google Patents

Method and device for detecting repeated messages in parallel redundant network Download PDF

Info

Publication number
CN109005088B
CN109005088B CN201811136858.5A CN201811136858A CN109005088B CN 109005088 B CN109005088 B CN 109005088B CN 201811136858 A CN201811136858 A CN 201811136858A CN 109005088 B CN109005088 B CN 109005088B
Authority
CN
China
Prior art keywords
message
serial number
packet
data
data message
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
CN201811136858.5A
Other languages
Chinese (zh)
Other versions
CN109005088A (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.)
Kyland Technology Co Ltd
Original Assignee
Kyland 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 Kyland Technology Co Ltd filed Critical Kyland Technology Co Ltd
Priority to CN201811136858.5A priority Critical patent/CN109005088B/en
Publication of CN109005088A publication Critical patent/CN109005088A/en
Application granted granted Critical
Publication of CN109005088B publication Critical patent/CN109005088B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a method and a device for detecting repeated messages in a parallel redundant network. The method comprises the steps of receiving a data message and a management message sent by a first local area network, wherein the transmission delay of the first local area network is far longer than that of a second local area network, and acquiring a source MAC address of the data message, a serial number of the data message and a serial number of an adjacent management message; and performing repeated message detection on the received data message based on the source MAC address of the received data message, the serial number of the data message and the serial number of the corresponding adjacent management message recorded in the stored node information table, and determining whether the data message corresponding to the information is the repeated message by detecting whether the acquired information exists in the node information table. The storage time length of the node information table is not more than the non-reversal time length of the serial number of the management message, and the sending interval between two adjacent management messages is less than the non-reversal time length of the serial number of the data message, so that the accuracy of repeated message detection is improved.

Description

Method and device for detecting repeated messages in parallel redundant network
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for detecting a duplicate packet in a parallel redundant network.
Background
With the advance of industrial technologies, in order to further improve the reliability of the packet redundancy backup technology, a Parallel Redundancy Protocol (PRP) network is developed, and the network is applied in an application layer. As shown in fig. 1, the PRP network depends on two network devices supporting the PRP protocol, such as a network device 1 and a network device 2, which are dual-connection nodes supporting the PRP protocol, each network device has two ports, such as a port 1 and a port 2, operating independently, and the two ports are connected to two independent local area networks, such as a local area network a and a local area network B, operating in parallel. The network device 1 copies each data packet to be sent to obtain two identical data packets, and sends the two identical data packets to the network device 2 through the two ports, the local area network a and the local area network B. After receiving the data message, the network device 2 performs repeated message detection, specifically: determining whether the data message is a repeated message according to a Media Access Control (MAC) address and a serial number in the data message, if the MAC address and the serial number are not recorded in a stored node information table, determining that the data message is not the repeated message, and storing the MAC address and the serial number of the data message to update the table; if the MAC address and the serial number are recorded in the stored node information table, the data message is determined to be a repeated message, and the data message is deleted. The sequence number identifies repeated data packets in increasing order for the network device 1.
However, the inventor finds that there is a certain limitation on the sizes of two lans in the PRP network, when the network of the lan a is larger and the network of the lan B is smaller, for example, the lan a has only one switch and the lan B has tens of switches, the transmission delay of the lan a is much smaller than that of the lan B, and the time difference between the same data packet sent from two ports of the network device 1 and arriving at the network device 2 exceeds the storage time (or "aging time") of the node information table stored in the network device 2, so that the network device 2 may repeatedly receive the same data packet.
If the network delay difference between the local area network A and the local area network B is 2 milliseconds, the storage time (or called as "storage duration") of the node information table is 1 millisecond; at the time t (unit millisecond) of a receiving end, receiving a data message with the serial number of 1 through a local area network A, and recording the serial number and a source MAC address in a node information table; at the moment of t +1, receiving a data message with the serial number of 2 through the local area network A, and recording the serial number and the source MAC address in a node information table; since the storage duration of the node information table is exceeded after the time t +1, the sequence number and the source MAC address of the data packet with the sequence number 1 and the sequence number and the source MAC address of the data packet with the sequence number 2 are both deleted. At the time of t +3, the data message with the sequence number of 3 is received through the local area network A, the sequence number and the source MAC address of the data message are recorded in the node information table, the data message with the sequence number of 1 is received through the local area network A, and the information is recorded in the node information table due to the fact that the sequence number and the source MAC address do not exist in the node information table, and repeated messages are received.
The storage time of the node information table is determined according to the bit number of the serial number in the data message and the transmission interval between the adjacent data messages. The shorter the number of bits of the sequence number and the shorter the transmission interval, the shorter the determined saving time period, and the longer the number of bits of the sequence number and the longer the transmission interval, the longer the determined saving time period. If the number of bits of the serial number is only 16 bits (range 0-65536), and the transmission interval is short (negligible), the determined storage duration is only tens of milliseconds, that is, under the condition that the storage duration of the node information table is not changed, when the network delay difference between two local area networks in the PRP network is large and the network delay is greater than the storage duration of the node information table, the accuracy of the detection of the repeated message is low.
Disclosure of Invention
The embodiment of the application provides a method and a device for detecting repeated messages in a parallel redundant network, and the method is used for solving the problems in the prior art and improving the accuracy of repeated message detection.
In a first aspect, a method for detecting a duplicate packet in a parallel redundant network is provided, where a first port of a first network device in the parallel redundant network sends a data packet and a management packet to a second network device through a first local area network, and a second port of the first network device sends the data packet and the management packet to the second network device through a second local area network, the method including:
a first port of a second network device receives a data message and a management message sent by a first local area network, wherein the transmission delay of the first local area network is far longer than that of the second local area network;
acquiring message information of a data message and a management message, wherein the message information comprises a source MAC address of the data message, a serial number of the data message and a serial number of an adjacent management message; the adjacent management message is the management message received by the first port of the second network device for the last time before receiving the data message;
performing repeated message detection on the received data message based on the source MAC address of the data message which is recorded in the stored node information table and received through the second port of the second network equipment, the serial number of the data message and the serial number of the corresponding adjacent management message; the storage duration of the source MAC address of the received data message, the serial number of the data message and the serial number of the corresponding adjacent management message in the node information table is not more than the non-reversal duration of the serial number of the management message, and the sending interval between the two adjacent management messages is less than the non-reversal duration of the serial number of the data message;
when the acquired message information does not exist in the node information table, determining that the data message corresponding to the message information is a non-repeated message;
and when the acquired message information exists in the node information table, determining that the data message corresponding to the message information is a repeated message.
Compared with the prior art, the method of the application identifies whether the repeated message is received or not through the message information of the data message and the serial number of the corresponding management message, thereby improving the accuracy of the detection of the repeated message.
In an optional implementation, performing duplicate packet detection on a received data packet based on a source MAC address of the data packet recorded in a stored node information table and received through a second port of a second network device, a sequence number of the data packet, and a sequence number of a corresponding adjacent management packet, includes:
and identifying whether the source MAC address and the serial number of the received data message consistent with the acquired message information and the serial number of the corresponding adjacent management message exist in the node information table at the same time.
The method further describes that the detection of the repeated message is realized by inquiring whether the message information of the data message in the node information table and the serial number of the management message adjacent to the data message are consistent with the message information of the received data message and the serial number of the management message.
In an optional implementation, after determining that the data packet corresponding to the packet information is a non-duplicate packet, the method further includes:
and sending the data message corresponding to the message information to the target network equipment, and recording the message information in the node information table so as to realize the transmission of the data message.
In an optional implementation, after determining that the data packet corresponding to the deleted packet information is a duplicate packet, the method further includes:
and deleting the data message corresponding to the message information.
In a second aspect, there is provided a detection apparatus, the apparatus comprising: the device comprises a receiving unit, an acquisition unit, a detection unit and a confirmation unit;
a receiving unit, configured to receive a data packet and a management packet sent through a first local area network, where a transmission delay of the first local area network is much longer than a transmission delay of a second local area network;
the device comprises an acquisition unit, a processing unit and a management unit, wherein the acquisition unit is used for acquiring message information of a data message and a management message, and the message information comprises a source MAC address of the data message, a serial number of the data message and a serial number of an adjacent management message; the adjacent management message is the management message received by the first port of the second network device for the last time before receiving the data message;
a detection unit, configured to perform duplicate packet detection on a received data packet based on a source MAC address of the data packet recorded in the stored node information table and received through a second port of the second network device, a serial number of the data packet, and a serial number of a corresponding adjacent management packet; the storage duration of the source MAC address of the received data message, the serial number of the data message and the serial number of the corresponding adjacent management message in the node information table is not more than the non-reversal duration of the serial number of the management message, and the sending interval between the two adjacent management messages is less than the non-reversal duration of the serial number of the data message;
a confirming unit, configured to confirm that a data packet corresponding to the packet information is a non-duplicate packet when the acquired packet information does not exist in the node information table;
and when the acquired message information exists in the node information table, determining that the data message corresponding to the message information is a repeated message.
In an optional implementation, the detecting unit is specifically configured to identify whether a source MAC address of a received data packet, a sequence number of the data packet, and a sequence number of a corresponding adjacent management packet, which are consistent with the acquired packet information, coexist in the node information table.
In an alternative implementation, the apparatus further comprises a recording unit and a transmitting unit;
the sending unit is used for sending the data message corresponding to the message information to the target network equipment after confirming that the data message corresponding to the message information is a non-repeated message;
and the recording unit is used for recording the message information in the node information table.
In an alternative implementation, the apparatus further comprises a deletion unit;
and the deleting unit is also used for deleting the data message corresponding to the message information after the data message corresponding to the deleted message information is confirmed to be a repeated message.
In a third aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor adapted to perform the method steps of any of the above first aspects when executing a program stored in the memory.
In a fourth aspect, a computer-readable storage medium is provided, having stored therein a computer program which, when executed by a processor, performs the method steps of any of the above first aspects.
According to the technical scheme, when a data message and a management message sent by a first local area network are received, the transmission delay of the first local area network is far longer than that of a second local area network, and a source MAC address of the data message, a serial number of the data message and a serial number of an adjacent management message are obtained; and performing repeated message detection on the received data message based on the source MAC address of the received data message, the serial number of the data message and the serial number of the corresponding adjacent management message recorded in the stored node information table, and determining whether the data message corresponding to the information is the repeated message by detecting whether the acquired information exists in the node information table. The storage time length of the node information table is not more than the non-reversal time length of the serial number of the management message, and the sending interval between two adjacent management messages is less than the non-reversal time length of the serial number of the data message, so that the accuracy of repeated message detection is improved.
Drawings
Fig. 1 is a schematic structural diagram of a PRP network;
fig. 2 is a schematic structural diagram of a communication network to which a method for detecting a duplicate packet in a parallel redundant network according to an embodiment of the present invention is applied;
fig. 3 is a schematic flowchart of a method for detecting a duplicate packet in a parallel redundant network according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a format of a PRP packet;
fig. 5 is a schematic diagram of a format of a PTP management packet;
fig. 6 is a schematic flowchart of another method for detecting a duplicate packet in a parallel redundant network according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a detection apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
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 obtained by a person of ordinary skill in the art based on the embodiments of the present application without any creative effort belong to the protection scope of the present application.
The method for detecting the repeated messages in the parallel redundant network provided by the embodiment of the invention can be applied to the communication network shown in figure 2. The network includes a first network device, a second network device, a first local area network, a second local area network, and a target network device.
The first network device supports the PRP protocol with the second network device, the first network device including a local receive port and first and second ports, such as port a1 and port B1, the second network device including a local transmit port and first and second ports, such as port a2 and port B2. The first local area network and the second local area network are two independent local area networks which work in parallel, namely, have different IP addresses, such as IP1 address and IP2 address. In the transmission of the same message to the same network device, the transmission time difference between the first local area network and the second local area network is greater than the preset time length. The target network device is used for receiving the message. The first network device, the second network device and the target network device may be terminals or servers. The terminal may be a User Equipment (UE) supporting a PRP protocol, a handheld device having a wireless communication function, a vehicle-mounted device, a wearable device, a computing device or other processing device connected to a wireless modem, a Mobile Station (MS), and the like, and the server may be an application server or a cloud server, and the like.
A local receiving port of the first network device is configured to receive a data packet, both the port a1 and the port B1 are configured to send the data packet and a management packet, a local sending port of the second network device is configured to send a data packet after repeated packet detection to the target network device, the port a2 is configured to receive the data packet and the management packet sent by the port B1 through the first local area network, and the port B2 is configured to receive the data packet and the management packet sent by the port a1 through the second local area network.
The preferred embodiments of the present application will be described below with reference to the accompanying drawings of the specification, it being understood that the preferred embodiments described herein are merely for illustrating and explaining the present invention and are not intended to limit the present invention, and that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
The following describes embodiments of the present invention in detail with reference to the network framework shown in fig. 2.
Fig. 3 is a schematic flowchart of a method for detecting a duplicate packet in a parallel redundant network according to an embodiment of the present invention. As shown in fig. 3, the method may include:
step 310, a first port of the second network device receives the data packet and the management packet sent through the first lan.
The transmission delay of the first local area network is far larger than that of the second local area network.
Before executing the step, after receiving a data message, the local interface of the first network device duplicates the data message into two identical data messages, adds a Redundancy Control Tag (RCT) of 6 bytes at the end of the two identical data messages, and encapsulates the data messages into data messages in a PRP frame format through a TCP/IP protocol layer.
Alternatively, the format of the PRP packet (or "Frame") is as shown in fig. 4, where the Frame includes a Frame header, a DATA part (DATA), AN RCT and a Frame Check Sequence (FCS), where the Frame header includes a 6-bit (byte) destination physical (MAC) address, a 6yte source MAC address and a 2-byte Frame type, the RCT includes a 16-bit Sequence Number (SeqNr), a 4-bit lan identifier L AN ID, a 12-bit DATA length L SDU, a 16-bit type suffix PRP suffix, and the Number of occupied bits can be determined according to the size of the DATA to be transmitted.
It can be understood that, in order to achieve time and frequency synchronization, the second network device also needs to send the management message to the first network device through the local area network.
Alternatively, the PTP management message (or "frame") format is shown in fig. 5, and includes a message header, a message body, and an extension field.
The first network device configures a management packet of a clock synchronization Protocol (PTP) and copies two identical management packets, where the identical management packets have identical packet information. PTP is a protocol for time and frequency synchronization of standard ethernet devices. The basic principle of synchronization involves recording time issue and receive time information and adding a "time stamp" to each piece of information. The transmission period of the management packet may be preset.
The first network device can send out a PRP data message and a management message from the first local area network through a first port of the first network device, and send out another PRP data message and another management message from the second local area network through a second port of the first network device.
It should be noted that, the local area networks corresponding to the first port and the second port of the first network device and the local area networks corresponding to the first port and the second port of the second network device may be preset, for example, the first ports of the first network device and the second network device both correspond to the first local area network with the IP1 address, and the second ports of the first network device and the second network device both correspond to the second local area network with the IP2 address.
Further, the data packet of the PRP and the management packet of the PTP both set a reverse time length of the serial number, the reverse time length of the serial number of the data packet and the serial number of the management packet is a time length for reordering the serial numbers, otherwise, the non-reverse time length of the serial number of the data packet and the serial number of the management packet is a time length for not reordering the serial numbers. The sending interval between two adjacent management messages is smaller than the non-reversal duration of the serial number of the data message, the non-reversal duration of the serial number of the data message is the duration that the serial number of the data message is not reordered, and the non-reversal duration of the serial number of the management message is the duration that the serial number of the management message is not reordered.
Taking the sequence number of the data packet of the PRP as an example, the sequence number of the data packet of the PRP is preset to be 1-100. When the first network device sends the data message with the serial number of 1 to the data message with the serial number of 100, the serial numbers of the data messages are reordered, and then the first network device sends the data message with the serial number of 1, namely the time length of the data message with the serial numbers of 1-100, which is completely sent, is the non-reversal time length of the serial numbers.
Step 320, obtaining message information of the data message and the management message, wherein the message information includes a source MAC address of the data message, a serial number of the data message, and a serial number of an adjacent management message.
The adjacent management packet is a management packet received by the first port of the second network device for the last time before receiving the data packet.
The adjacent management packet in this step is a management packet received last time before the first port of the second network device receives the data packet. That is, the adjacent management packet is a management packet adjacent to the data packet at a previous time. For example, the first port of the second network device may obtain the following table 1 based on the receiving time of the management packet and the data packet.
TABLE 1
Figure GDA0002445395320000091
In table 1, the first management packet is received at time t1, the second management packet is received at time t2, the first data packet is received at time t3, the second data packet is received at time t4, and the third management packet is received at time t 5. Based on table 1, the adjacent management packet of the first data packet is the second management packet, the adjacent management packet of the second data packet is the second management packet, and the adjacent management packet of the third data packet is the third management packet, so that the source MAC address of the first data packet is MAC1, the serial number is 001B, the serial number of the second management packet is 002A, the source MAC address of the second data packet is MAC1, the serial number is 002B, the serial number of the second management packet is 002A, the source MAC address of the third data packet is MAC1, the serial number is 003B, and the serial number of the third management packet is 003A can be obtained.
It can be understood that, since the transmission delay of the first lan is much longer than that of the second lan, the receiving time of the second port of the second network device through the second lan can be obtained by subtracting the transmission delay from the receiving time of the first port of the second network device through the first lan in table 1, and it can be understood that the sequence of the management packet and the data packet received by the first port and the second port of the second network device is the same as that in table 1, but the receiving time is different.
For example, for the same data packet, if the transmission delay of the first lan is much longer than that of the second lan and the transmission delay difference is T, the management packet and the data packet received by the second port of the second network device through the second lan are shown in table 2, and after the time T, the management packet and the data packet received by the first port of the second network device through the first lan are shown in table 3. Wherein Mac represents a source MAC address of the data packet, seq represents a management frame of the data packet, and the management frame represents a management packet.
TABLE 2
Figure GDA0002445395320000101
TABLE 3
Figure GDA0002445395320000102
As can be seen from table 2 and table 3, the management message and the data message received by the two are the same, but the receiving time is different.
Step 330, performing duplicate packet detection on the received data packet based on the source MAC address of the data packet, the serial number of the data packet, and the serial number of the corresponding adjacent management packet, which are recorded in the stored node information table and have been received through the second port of the second network device.
The stored node information table is used for recording the serial number of the management message, the source MAC address of the data message, the serial number of the data message and the storage duration which are received through the second port of the second network device.
The storage duration is the maximum duration for storing the serial number of the received adjacent management message, the source MAC address of the data message and the serial number of the data message. If the serial number of the received management message, the source MAC address of the data message and the serial number of the data message recorded in the node information table reach the storage duration, the information is deleted. The storage time length of the source MAC address of the received data message, the serial number of the data message and the serial number of the corresponding adjacent management message in the node information table is not more than the non-reversal time length of the serial number of the management message, namely, the source MAC address of the data message received firstly in the node information table, the serial number of the data message and the serial number of the corresponding adjacent management message reach the storage time length, and the serial number of the management message is always within the non-reversal time length.
Optionally, the source MAC address of the data packet, the sequence number of the data packet, and the sequence of the corresponding neighbor management packet in the node information tableMaximum time duration T for storing numberSFor managing the reversal duration T of a messageFThe receiving time T of the current data message1And the receiving time T of the adjacent management message2The difference of the time difference of (a) can be expressed as: t isS=TF-(T1-T2) (formula one).
The stored node information table is shown in table 4.
TABLE 4
Figure GDA0002445395320000111
In table 4, the node information table includes data packets whose source MAC addresses are the MAC1 address of the first network device and whose serial number is 0, and neighboring management packets whose serial number is 0, and the remaining storage duration of the information is T1; the data message with the sequence number of 1 and the adjacent management message with the sequence number of 0, and the remaining storage time of the information is T2; the data message with the sequence number of 2 and the adjacent management message with the sequence number of 0, and the remaining storage time of the information is T3; the remaining storage time of the data packet with the sequence number of 3 and the adjacent management packet with the sequence number of 1 is T4.
The second network device receives the data messages according to the sequence numbers in the sequence numbers of the data messages and the sequence numbers in the sequence numbers of the management messages, so that the remaining storage time of the data messages with the sequence number of 0 and the adjacent management messages in the node information table is less than the remaining storage time of the data messages with the sequence number of 1 and the adjacent management messages, and so on, the remaining storage time of the data messages with the sequence number of N and the adjacent management messages is less than the remaining storage time of the data messages with the sequence number of N +1 and the management messages, and N is not less than an integer of zero, so that T1 is less than T2 and less than T3 and less than T4. If the remaining storage time period T1 is zero, all information in the row in which T1 exists is deleted.
For example, the node information table has a storage time of 60s for each piece of information, and each piece of information includes a sequence number of a received adjacent management packet, a source MAC address of a data packet, and a sequence number of the data packet.
The current receiving time of the data message with the serial number of 0 is t +0, the serial number of the adjacent management message of the data message is 0, and at the moment, the residual storage time corresponding to the data message is 60 s;
the current receiving time of the data message with the sequence number of 1 is t +20, the sequence number of the adjacent management message of the data message is 0, at this time, the remaining storage time corresponding to the data message with the sequence number of 0 is 40s, and the remaining storage time corresponding to the data message with the sequence number of 1 is 60 s;
the current receiving time of the data packet with the sequence number of 2 is t +40, the sequence number of the adjacent management packet of the data packet is 0, at this time, the remaining storage time corresponding to the data packet with the sequence number of 0 is 0s, the remaining storage time corresponding to the data packet with the sequence number of 1 is 20s, and the remaining storage time corresponding to the data packet with the sequence number of 2 is 60 s.
Returning to step 330, duplicate packet detection is performed on the data packet received from the first network device.
For the same data packet, if the transmission delay of the first lan is much longer than that of the second lan, the source MAC address of the data packet, the serial number of the data packet, and the management packet and the data packet corresponding to the serial number of the adjacent management packet in the node information table are received by the second port corresponding to the second lan, and the packet information obtained in step 320 is received by the first port corresponding to the first lan.
And inquiring the node information table, and identifying whether the source MAC address and the serial number of the received data message consistent with the acquired message information and the serial number of the adjacent management message exist in the node information table at the same time.
When the acquired message information does not exist in the node information table, determining that the data message corresponding to the message information is a non-repeated message; and then, sending the data message corresponding to the message information to the target network equipment, and recording the message information in a node information table so as to realize normal transmission of the data message.
And when the acquired message information exists in the node information table, determining that the data message corresponding to the message information is a repeated message. At this time, the data packet is discarded.
Therefore, compared with the prior art, the method of the application identifies whether the repeated message is received or not through the source MAC address and the serial number of the data message and the serial number of the adjacent management message, namely, the source MAC address and the serial number of the data message received in the node information table are inquired, and the serial number of the adjacent management message of the data message is also inquired, so that the accuracy of detecting the repeated message is improved.
Next, for the same data packet, the transmission delay of the first lan is far longer than that of the second lan.
Fig. 6 is a flowchart illustrating another method for detecting a duplicate packet in a parallel redundant network according to an embodiment of the present invention. As shown in fig. 6, the method may include:
step 610, the first network device copies the received data packet and the pre-configured management packet into two identical RCT-added data packets and two identical management packets.
Step 620, the first network device sends the RCT-added data packet and the RCT-added management packet to the first local area network through the first port and sends the RCT-added data packet and the RCT-added management packet to the second local area network through the second port.
Step 630, the second network device receives the RCT-added data message and the management message sent by the second local area network through its own second port.
Step 640, the second network device generates a node information table based on the source MAC address of the RCT-added data packet received by the second port, the serial number of the data packet, and the serial number of the management packet.
Step 650, the second network device receives the RCT-added data message and the management message sent by the first local area network through its own first port.
Step 660, the second network device obtains the message information based on the source MAC address of the RCT-added data message received by the first port, the serial number of the data message, and the serial number of the management message.
The message information includes a source MAC address of the data message, a sequence number of the data message, and a sequence number of an adjacent management message.
Step 670, when the acquired message information does not exist in the node information table, determining that the data message corresponding to the message information is a non-repetitive message, and recording the message information in the node information table.
Step 680, sending the data message corresponding to the message information to the target network device.
Step 690, when the obtained message information exists in the node information table, determining that the data message corresponding to the message information is a repeated message, and discarding the data message.
The method of the embodiment of the invention receives the data message and the management message sent by the first local area network, and after the transmission delay of the first local area network is far longer than that of the second local area network, the message information of the data message and the management message is obtained, wherein the message information comprises the source MAC address of the data message, the serial number of the data message and the serial number of the adjacent management message; based on the source MAC address of the data packet that has been received via the second port of the second network device, the sequence number of the data packet and the sequence number of the corresponding neighboring management packet recorded in the stored node information table, performing duplicate packet detection on the received data packet, and determining whether the data packet corresponding to the packet information is a duplicate packet by detecting whether the acquired packet information exists in the node information table, in the method, when the storage duration of the node information table is not more than the non-reversal duration of the management message serial number, and the transmission interval between two adjacent management messages is less than the non-reversal time length of the data message serial number, whether the repeated message is received or not is identified through the source MAC address of the data message, the serial number of the data message and the serial number of the corresponding adjacent management message, and the accuracy of repeated message detection is improved.
Corresponding to the above method, an embodiment of the present invention further provides a detection apparatus, as shown in fig. 7, where the detection apparatus includes: a receiving unit 710, an obtaining unit 720, a detecting unit 730 and a confirming unit 740;
a receiving unit 710, configured to receive a data packet and a management packet sent through a first local area network, where a transmission delay of the first local area network is much longer than a transmission delay of a second local area network;
an obtaining unit 720, configured to obtain message information of the data message and the management message, where the message information includes a source MAC address of the data message, a serial number of the data message, and a serial number of an adjacent management message; the adjacent management message is the management message received by the first port of the second network device for the last time before receiving the data message;
a detecting unit 730, configured to perform repeated packet detection on a received data packet based on a source MAC address of the data packet, a serial number of the data packet, and a serial number of a corresponding adjacent management packet, which are recorded in the stored node information table and have been received through a second port of the second network device; the source MAC address of a received data message, the serial number of the data message and the storage duration of the serial number of a corresponding adjacent management message in the node information table are not more than the non-reversal duration of the serial number of the management message, and the sending interval between two adjacent management messages is less than the non-reversal duration of the serial number of the data message;
a confirming unit 740, configured to confirm that the data packet corresponding to the packet information is a non-duplicate packet when the acquired packet information does not exist in the node information table;
and when the acquired message information exists in the node information table, determining that the data message corresponding to the message information is a repeated message.
In an optional implementation, the detecting unit 730 is specifically configured to identify whether a source MAC address of a received data packet, a sequence number of the data packet, and a sequence number of a corresponding adjacent management packet, which are consistent with the acquired packet information, exist in the node information table at the same time.
In an alternative implementation, the apparatus further comprises a recording unit 750 and a sending unit 760;
a sending unit 760, configured to send a data packet corresponding to the message information to a target network device after determining that the data packet corresponding to the message information is a non-duplicate packet;
a recording unit 750, configured to record the message information in a node information table.
In an alternative implementation, the apparatus further comprises a deletion unit 770;
the deleting unit 770 is further configured to delete the data packet corresponding to the message information after determining that the data packet corresponding to the deleted message information is a duplicate packet.
The functions of the functional units of the detection apparatus provided in the above embodiment of the present invention may be implemented by the above method steps, and therefore, detailed working processes and beneficial effects of the units in the detection apparatus provided in the embodiment of the present invention are not described herein again.
An embodiment of the present invention further provides an electronic device, as shown in fig. 8, including a processor 810, a communication interface 820, a memory 830, and a communication bus 840, where the processor 810, the communication interface 820, and the memory 830 complete mutual communication through the communication bus 840.
A memory 830 for storing a computer program;
the processor 810, when executing the program stored in the memory 830, implements the following steps:
receiving a data message and a management message sent by a first local area network, wherein the transmission delay of the first local area network is far longer than that of a second local area network;
acquiring message information of the data message and the management message, wherein the message information comprises a source MAC address of the data message, a serial number of the data message and a serial number of an adjacent management message; the adjacent management message is the management message received by the first port of the second network device for the last time before receiving the data message;
performing repeated message detection on the received data message based on the source MAC address of the data message which is recorded in the stored node information table and received through the second port of the second network equipment, the serial number of the data message and the serial number of the corresponding adjacent management message; the source MAC address of a received data message, the serial number of the data message and the storage duration of the serial number of a corresponding adjacent management message in the node information table are not more than the non-reversal duration of the serial number of the management message, and the sending interval between two adjacent management messages is less than the non-reversal duration of the serial number of the data message;
when the acquired message information does not exist in the node information table, determining that the data message corresponding to the message information is a non-repeated message;
and when the acquired message information exists in the node information table, determining that the data message corresponding to the message information is a repeated message.
In an optional implementation, performing duplicate packet detection on a received data packet based on a source MAC address of the data packet, a serial number of the data packet, and a serial number of a corresponding adjacent management packet, which are recorded in a stored node information table and have been received through a second port of a second network device, includes:
and identifying whether the source MAC address of the received data message, the serial number of the data message and the serial number of the corresponding adjacent management message which are consistent with the acquired message information exist in the node information table or not.
In an optional implementation, after the data packet corresponding to the packet information is determined to be a non-duplicate packet, the data packet corresponding to the packet information is sent to the target network device, and the packet information is recorded in the node information table.
In an optional implementation, after the data packet corresponding to the deleted packet information is determined to be a duplicate packet, the data packet corresponding to the packet information is deleted.
The aforementioned communication bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
Since the implementation and the beneficial effects of the problem solving of each device of the electronic device in the above embodiment can be realized by referring to each step in the embodiment shown in fig. 3, detailed working processes and beneficial effects of the electronic device provided by the embodiment of the present invention are not described herein again.
In another embodiment of the present invention, a computer-readable storage medium is further provided, which stores instructions that, when executed on a computer, cause the computer to perform the method for detecting a duplicate packet according to any one of the above embodiments.
In another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method for detecting duplicate messages described in any of the above embodiments.
As will be appreciated by one of skill in the art, the embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the true scope of the embodiments of the present application.
It is apparent that those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims of the embodiments of the present application and their equivalents, the embodiments of the present application are also intended to include such modifications and variations.

Claims (8)

1. A method for detecting repeated messages in a parallel redundant network, wherein a first port of a first network device in the parallel redundant network sends a data message and a management message to a second network device through a first local area network, and a second port of the first network device sends the data message and the management message to the second network device through a second local area network, is characterized by comprising the following steps:
a first port of the second network device receives the data message and the management message sent through the first local area network, and the transmission delay of the first local area network is much longer than that of the second local area network;
acquiring message information of the data message and the management message, wherein the message information comprises a source MAC address of the data message, a serial number of the data message and a serial number of an adjacent management message; the adjacent management message is a management message received last time before the first port of the second network device receives the data message;
performing repeated message detection on the received data message based on the source MAC address of the data message which is recorded in the stored node information table and received through the second port of the second network device, the serial number of the data message and the serial number of the corresponding adjacent management message; the node information table stores the source MAC address of the received data message, the serial number of the data message and the serial number of the corresponding adjacent management message, wherein the storage time length of the source MAC address, the serial number of the data message and the serial number of the corresponding adjacent management message is not more than the non-reversal time length of the serial number of the management message, and the sending interval between the two adjacent management messages is less than the non-reversal time length of the serial number of the data message; the storage duration is the maximum duration for storing the serial number of the received adjacent management message, the source MAC address of the data message and the serial number of the data message;
when the acquired message information does not exist in the node information table, determining that the data message corresponding to the message information is a non-repeated message;
when the acquired message information exists in the node information table, determining that the data message corresponding to the message information is a repeated message;
wherein, the repeated message detection of the received data message includes:
and identifying whether a source MAC address of the received data message, a serial number of the data message and a serial number of a corresponding adjacent management message consistent with the acquired message information exist in the node information table at the same time.
2. The method of claim 1, wherein after determining that the data packet corresponding to the packet information is a non-duplicate packet, the method further comprises:
and sending the data message corresponding to the message information to target network equipment, and recording the message information in the node information table.
3. The method of claim 1, wherein after confirming that the data packet corresponding to the packet information is a duplicate packet, the method further comprises:
and deleting the data message corresponding to the message information.
4. A detection apparatus, wherein the apparatus is located in a parallel redundant network, a first port of a first network device in the parallel redundant network sends a data packet and a management packet to the apparatus through a first local area network, and a second port of the first network device sends the data packet and the management packet to the apparatus through a second local area network, the apparatus comprising: the device comprises a receiving unit, an acquisition unit, a detection unit and a confirmation unit;
the receiving unit is configured to receive the data packet and the management packet sent through the first local area network, where a transmission delay of the first local area network is much longer than a transmission delay of the second local area network;
the acquiring unit is configured to acquire message information of the data message and the management message, where the message information includes a source MAC address of the data message, a serial number of the data message, and a serial number of an adjacent management message; the adjacent management message is a management message received last time before the first port of the device receives the data message;
the detection unit is used for carrying out repeated message detection on the received data message based on the source MAC address of the data message which is recorded in the stored node information table and received through the second port of the device, the serial number of the data message and the serial number of the corresponding adjacent management message; the node information table stores the source MAC address of the received data message, the serial number of the data message and the serial number of the corresponding adjacent management message, wherein the storage time length of the source MAC address, the serial number of the data message and the serial number of the corresponding adjacent management message is not more than the non-reversal time length of the serial number of the management message, and the sending interval between the two adjacent management messages is less than the non-reversal time length of the serial number of the data message; the storage duration is the maximum duration for storing the serial number of the received adjacent management message, the source MAC address of the data message and the serial number of the data message;
the determining unit is configured to determine that the data packet corresponding to the packet information is a non-duplicate packet when the acquired packet information does not exist in the node information table;
when the acquired message information exists in the node information table, determining that the data message corresponding to the message information is a repeated message;
the detection unit is specifically configured to identify whether a source MAC address of a received data packet, a sequence number of the data packet, and a sequence number of a corresponding adjacent management packet, which are consistent with the acquired packet information, coexist in the node information table.
5. The apparatus of claim 4, wherein the apparatus further comprises a recording unit and a transmitting unit;
the sending unit is configured to send the data packet corresponding to the packet information to a target network device after determining that the data packet corresponding to the packet information is a non-duplicate packet;
the recording unit is configured to record the message information in the node information table.
6. The apparatus of claim 4, wherein the apparatus further comprises a deletion unit;
the deleting unit is further configured to delete the data packet corresponding to the packet information after determining that the data packet corresponding to the packet information is a duplicate packet.
7. An electronic device, characterized in that the electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-3 when executing a program stored on a memory.
8. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-3.
CN201811136858.5A 2018-09-28 2018-09-28 Method and device for detecting repeated messages in parallel redundant network Active CN109005088B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811136858.5A CN109005088B (en) 2018-09-28 2018-09-28 Method and device for detecting repeated messages in parallel redundant network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811136858.5A CN109005088B (en) 2018-09-28 2018-09-28 Method and device for detecting repeated messages in parallel redundant network

Publications (2)

Publication Number Publication Date
CN109005088A CN109005088A (en) 2018-12-14
CN109005088B true CN109005088B (en) 2020-07-17

Family

ID=64588958

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811136858.5A Active CN109005088B (en) 2018-09-28 2018-09-28 Method and device for detecting repeated messages in parallel redundant network

Country Status (1)

Country Link
CN (1) CN109005088B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109981479B (en) * 2019-02-27 2022-06-28 西安微电子技术研究所 PRP network-oriented single-window dynamic sliding and redundancy management system and method
CN110912655B (en) * 2019-12-24 2023-01-20 瑞斯康达科技发展股份有限公司 Data redundancy backup method, device, equipment and medium
CN111935243B (en) * 2020-07-17 2023-06-30 杭州海康机器人股份有限公司 Data information transmission method, device, system and equipment
US11303568B1 (en) 2021-04-05 2022-04-12 Honeywell International Inc. Method and system for parallel redundancy protocol in connected networks
CN115102673B (en) * 2022-04-29 2023-11-03 中国船舶集团有限公司第七一六研究所 PRP protocol repeated frame discrimination processing method and system based on frame memory pool
CN115378816B (en) * 2022-08-02 2024-02-23 深信服科技股份有限公司 Network configuration detection method, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523108A (en) * 2011-12-07 2012-06-27 中国航空无线电电子研究所 Aviation electronic management system based on avionics full-duplex switched Ethernet (AFDX)
CN103684852A (en) * 2013-11-26 2014-03-26 中国电子科技集团公司第三十二研究所 Redundancy removing method and system in AFDX (avionics full Duplex switched Ethernet) network redundancy management module
CN106789425A (en) * 2016-12-22 2017-05-31 北京东土科技股份有限公司 A kind of method and device for determining duplicate message
CN107257301A (en) * 2017-08-10 2017-10-17 北京东土科技股份有限公司 The detection method and device of duplicate message and failure in a kind of parallel redundancy network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523108A (en) * 2011-12-07 2012-06-27 中国航空无线电电子研究所 Aviation electronic management system based on avionics full-duplex switched Ethernet (AFDX)
CN103684852A (en) * 2013-11-26 2014-03-26 中国电子科技集团公司第三十二研究所 Redundancy removing method and system in AFDX (avionics full Duplex switched Ethernet) network redundancy management module
CN106789425A (en) * 2016-12-22 2017-05-31 北京东土科技股份有限公司 A kind of method and device for determining duplicate message
CN107257301A (en) * 2017-08-10 2017-10-17 北京东土科技股份有限公司 The detection method and device of duplicate message and failure in a kind of parallel redundancy network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"The Parallel Redundancy Protocol for industrial IP networks";Markus Rentschler等,;《 2013 IEEE International Conference on Industrial Technology (ICIT)》;20130412;全文 *
"基于并行冗余网络的数字化变电站通信网络构架";陈原子,;《电力自动化设备》;20110131;第31卷(第1期);第105-108页 *

Also Published As

Publication number Publication date
CN109005088A (en) 2018-12-14

Similar Documents

Publication Publication Date Title
CN109005088B (en) Method and device for detecting repeated messages in parallel redundant network
US11374848B2 (en) Explicit routing with network function encoding
CN113285863B (en) Transmitting multiple copies of encrypted packets via multiple tunnels
US10791051B2 (en) System and method to bypass the forwarding information base (FIB) for interest packet forwarding in an information-centric networking (ICN) environment
CN107342939B (en) Method and device for transmitting data
US20220393908A1 (en) Message Encapsulation Method and Apparatus, and Message Decapsulation Method and Apparatus
CN110545229B (en) Message sending method and device in VXLAN axis networking mode
CN110730143B (en) Fragment data packet processing method and device
JP2023530994A (en) IN-SITU FLOW DETECTION METHOD AND ELECTRONIC DEVICE
CN111193756B (en) VXLAN tunnel load balancing method and related equipment
CN109039918B (en) Message sending method and device
CN111614580A (en) Data forwarding method, device and equipment
CN104247339A (en) Home network packet delivery
JP6631232B2 (en) System and method for determining routing information
CN107948217B (en) Switch system and communication method
CN112737995B (en) Method, device and equipment for processing Ethernet frame and storage medium
CN113612723B (en) Efficient encryption and decryption of duplicate packets communicated via a virtual private network
CN107483369B (en) Message processing method and virtual switch
CN110235417B (en) SDN and message forwarding method and device thereof
CN117041393A (en) Redundant message processing method and device and redundant bridge network
CN107231249B (en) Method for acquiring physical topology information of forwarding node, controller and forwarding node
CN114793210B (en) Method, device and system for transmitting and receiving data message in multiple-transmission and selective-reception manner
EP4425839A1 (en) Packet processing
US8583822B2 (en) Method and system for minimum frame size support for a communication protocol encapsulated over Ethernet
CN114079640B (en) Data processing method, user plane function and device

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