CN112261060A - Repeated data packet detection method for reliable communication transmission - Google Patents
Repeated data packet detection method for reliable communication transmission Download PDFInfo
- Publication number
- CN112261060A CN112261060A CN202011192360.8A CN202011192360A CN112261060A CN 112261060 A CN112261060 A CN 112261060A CN 202011192360 A CN202011192360 A CN 202011192360A CN 112261060 A CN112261060 A CN 112261060A
- Authority
- CN
- China
- Prior art keywords
- data packet
- red
- node
- black
- black tree
- 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
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/004—Arrangements for detecting or preventing errors in the information received by using forward error control
- H04L1/0056—Systems characterized by the type of code used
- H04L1/0061—Error detection codes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/06—Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/50—Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate
Abstract
The invention discloses a method for detecting repeated data packets for reliable communication transmission, which comprises the following steps: defining a blank red-black tree and a structure/object; s2: filling the IP address and the port number of each received data packet sender and the SN number of the data packet into a structure body/object; s3: generating CRC codes of the structures/objects, and searching nodes of the red and black trees by using the CRC codes as key values; s4: searching for a node, and if the node exists, executing S5, and if the node does not exist, executing S6; s5: the existing node deletes the current data packet; s6: and if no node exists, keeping the current data packet, adding the node to the red and black tree, and finishing receiving the current data packet. The invention has the beneficial effects that: the development and implementation workload is small, and the implementation cost is low; the extremely simple CRC algorithm and the high-efficiency red and black tree are adopted, the operation efficiency is higher, and the occupied computing resources are less; the data packet transmission delay is obviously shortened; by adopting the red and black trees, the occupied storage resources are less compared with the three-level table.
Description
Technical Field
The invention relates to the field of communication, in particular to a repeated data packet detection method applied to a connectionless reliable communication mechanism.
Background
In the field of communications, the TCP/UDP protocol is commonly used. However, both TCP and UDP have suitable application scenarios. The TCP protocol is a connection-oriented reliable communication protocol designed to use bandwidth as efficiently as possible, but its latency does not perform well; the UDP protocol is a connection-less reliable communication protocol, but its latency performance is significantly better than the TCP protocol.
Based on this, we often do not directly use the TCP/UDP protocol in actual network communication, and more often develop a reliable communication protocol without connection state based on the UDP protocol, which is generally called as the RUDP, and has both bandwidth utilization and delay performance.
In developing reliable communication protocols such as the RUDP, we must guarantee the integrity, correctness and uniqueness of the data packets at the same time. Generally, a data packet check and acknowledgement retransmission mechanism can be adopted to ensure the integrity and correctness of the data packet, and the guarantee of the uniqueness of the data packet is a more complicated problem. This is because the acknowledgement retransmission mechanism of the data packet inevitably generates some repeatedly transmitted data packets, which should be detected and discarded.
In a connection-oriented communication protocol such as TCP, each data packet has a session ID number to which the data packet belongs, and the uniqueness of the data packet can be easily and uniquely identified through a data packet SN number. However, the RUDP protocol is connectionless, and has no session ID number, and it cannot simply determine whether a packet is duplicated by the SN number of the packet. To ensure the uniqueness of the data packet in the RUDP protocol, we conventionally construct a three-level table.
The first level in the third-level table is an equipment IP address or an equipment ID number for distinguishing different equipment; the second level is a port number for distinguishing different programs or tasks; the third level is a data packet SN number used for distinguishing different data packets. And when a data packet is received, acquiring a first-stage index in a third-stage table according to the IP address/equipment ID number of the data packet, then acquiring a second-stage index according to the port number of the data packet, and finally acquiring a third-stage index according to the SN number of the data packet. At this point, it can be determined whether the currently received data packet is a duplicate data packet. However, the above entire process is too cumbersome. The conference from the perspective of code implementation consumes a lot of work time of developers, and the conference from the perspective of program operation consumes a lot of computing resources and storage resources.
Disclosure of Invention
The present invention is directed to a method for detecting duplicate packets for reliable communication transmission.
A method for duplicate packet detection for reliable communication transmission, comprising the steps of:
s1: defining a blank red-black tree and a structure/object;
s2: filling the IP address and the port number of each received data packet sender and the SN number of the data packet into a structure body/object;
s3: generating CRC codes of the structures/objects, and searching nodes of the red and black trees by using the CRC codes as key values;
s4: searching for a node, and if the node exists, executing S5, and if the node does not exist, executing S6;
s5: the existing node deletes the current data packet;
s6: and if no node exists, reserving the current data packet, adding the node to the red and black tree, and finishing receiving the current data packet.
The members of the structure/object in the step S1 include: IP address, port number, and SN number.
Preferably, the blank red and black tree records a globally unique key value of each data packet.
Preferably, the life cycle of the nodes in the red and black tree is greater than or equal to the maximum life cycle of any data.
The invention has the beneficial effects that: the development and implementation workload is small, and the implementation cost is low; the extremely simple CRC algorithm and the high-efficiency red and black tree are adopted, the operation efficiency is higher, and the occupied computing resources are less; the data packet transmission delay is obviously shortened; by adopting the red and black trees, the occupied storage resources are less compared with the three-level table.
Drawings
FIG. 1 is a flow chart of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
As shown in fig. 1, a method for detecting duplicate packets for reliable communication transmission includes the following steps:
step 1: defining a structure/object as dgram _ info _ t, whose members include: IP address, port number, and SN number;
step 2: defining a blank red and black tree rbtree, and recording a globally unique key value of each data packet;
and step 3: when a data packet is received, the IP address of the data packet is stored in dgram _ info _ t.s _ addr, the port number is stored in dgram _ info _ t.sin _ port, and the SN number of the data packet is stored in dgram _ info _ t.sn, so that a dgram _ info structure which can globally and uniquely identify the current data packet is obtained.
And 4, step 4: generating a CRC (cyclic redundancy check) coding key of dgram _ info by adopting a cyclic redundancy check code algorithm, and searching nodes of a red and black tree rbtree by taking the key as a key value;
and 5: if the retrieval result shows that the current node exists, discarding the current data packet;
step 6: and if the retrieval result shows that the current node does not exist, retaining the current data packet, and adding the key value at the moment to the red and black tree rbtree.
It should be noted that, if the life cycle of a node in the red and black rbtree exceeds the maximum life cycle of any data packet, the node should be deleted, so as to avoid that the number of nodes in the red and black rbtree continuously increases to affect the system efficiency.
Claims (4)
1. A method for duplicate packet detection for reliable communication transmissions, comprising the steps of:
s1: defining a blank red-black tree and a structure/object;
s2: filling the IP address and the port number of each received data packet sender and the SN number of the data packet into a structure body/object;
s3: generating CRC codes of the structures/objects, and searching nodes of the red and black trees by using the CRC codes as key values;
s4: searching for a node, and if the node exists, executing S5, and if the node does not exist, executing S6;
s5: the existing node deletes the current data packet;
s6: and if no node exists, reserving the current data packet, adding the node to the red and black tree, and finishing receiving the current data packet.
2. The method for duplicate packet detection for reliable communication transmission according to claim 1, wherein the membership of the structure/object in the step S1 includes: IP address, port number, and SN number.
3. The method of claim 1, wherein the blank red and black tree records a globally unique key value for each packet.
4. The method according to claim 1, wherein the lifetime of the nodes in the red and black tree is greater than or equal to the maximum lifetime of any packet.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011192360.8A CN112261060B (en) | 2020-10-30 | 2020-10-30 | Repeated data packet detection method for reliable communication transmission |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011192360.8A CN112261060B (en) | 2020-10-30 | 2020-10-30 | Repeated data packet detection method for reliable communication transmission |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112261060A true CN112261060A (en) | 2021-01-22 |
CN112261060B CN112261060B (en) | 2023-04-07 |
Family
ID=74268524
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011192360.8A Active CN112261060B (en) | 2020-10-30 | 2020-10-30 | Repeated data packet detection method for reliable communication transmission |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112261060B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080137542A1 (en) * | 2006-12-11 | 2008-06-12 | Inventec Corporation | Method for detecting abnormal network packets |
CN103812765A (en) * | 2014-02-14 | 2014-05-21 | 浙江大学 | CAN (Controller Area Network) to Ethernet gateway with filtering function and data transmission method based on gateway |
CN104717105A (en) * | 2015-02-11 | 2015-06-17 | 西安航天自动化股份有限公司 | Industrial sensor network data repeated detecting method based on standard ISA 100.11a |
CN109450492A (en) * | 2018-12-28 | 2019-03-08 | 深圳市力合微电子股份有限公司 | A kind of DMX512 data transmission method based on BPLC |
CN110149248A (en) * | 2019-06-06 | 2019-08-20 | 杭州商湾网络科技有限公司 | A kind of method of express statistic analysis router traffic |
CN110430103A (en) * | 2019-09-18 | 2019-11-08 | 光大兴陇信托有限责任公司 | A kind of message monitoring method |
CN110502391A (en) * | 2019-07-12 | 2019-11-26 | 苏宁云计算有限公司 | The grasping means and system of SQL information in a kind of MySQL database |
-
2020
- 2020-10-30 CN CN202011192360.8A patent/CN112261060B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080137542A1 (en) * | 2006-12-11 | 2008-06-12 | Inventec Corporation | Method for detecting abnormal network packets |
CN103812765A (en) * | 2014-02-14 | 2014-05-21 | 浙江大学 | CAN (Controller Area Network) to Ethernet gateway with filtering function and data transmission method based on gateway |
CN104717105A (en) * | 2015-02-11 | 2015-06-17 | 西安航天自动化股份有限公司 | Industrial sensor network data repeated detecting method based on standard ISA 100.11a |
CN109450492A (en) * | 2018-12-28 | 2019-03-08 | 深圳市力合微电子股份有限公司 | A kind of DMX512 data transmission method based on BPLC |
CN110149248A (en) * | 2019-06-06 | 2019-08-20 | 杭州商湾网络科技有限公司 | A kind of method of express statistic analysis router traffic |
CN110502391A (en) * | 2019-07-12 | 2019-11-26 | 苏宁云计算有限公司 | The grasping means and system of SQL information in a kind of MySQL database |
CN110430103A (en) * | 2019-09-18 | 2019-11-08 | 光大兴陇信托有限责任公司 | A kind of message monitoring method |
Also Published As
Publication number | Publication date |
---|---|
CN112261060B (en) | 2023-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112822276B (en) | Substation control layer communication method and system, electronic equipment and storage medium | |
CN109245955B (en) | Data processing method and device and server | |
CN109787722B (en) | Data transmission method and device and server | |
CN113835902B (en) | Data processing method, device, computer equipment and storage medium | |
CN107360177B (en) | A kind of message transmitting method and device based on UDP | |
CN112702235B (en) | Method for automatically and reversely analyzing unknown protocol | |
CN113596017B (en) | Protocol analysis method and device, soft gateway and storage medium | |
CN114362885A (en) | Internet of things data transmission method, device, equipment and medium | |
CN113452676A (en) | Detector allocation method and Internet of things detection system | |
CN116016351A (en) | eBPF-based UDP flow and packet loss observation method, system and medium | |
CN112261060B (en) | Repeated data packet detection method for reliable communication transmission | |
CN105577480A (en) | Monitoring method and device of network connection performances | |
CN112911024B (en) | Method and system for collecting data of Internet of things, electronic device and storage medium | |
CN114389792A (en) | WEB log NAT (network Address translation) front-back association method and system | |
WO2019223065A1 (en) | Data collection method, data sending method, data collection device, and network device | |
CN109743362B (en) | Data storage method applied to full-format data structure | |
CN113810349A (en) | Data transmission method and device and computer equipment | |
CN111405007A (en) | TCP session management method, device, storage medium and electronic equipment | |
CN113630442A (en) | Data transmission method, device and system | |
US9686221B2 (en) | Error correction for interactive message exchanges using summaries | |
CN113301049A (en) | Industrial control equipment auditing method, device, equipment and readable storage medium | |
CN114710237B (en) | Data processing method and device of communication interface, electronic equipment and storage medium | |
CN110232007A (en) | A kind of electric power enterprise information service monitoring method based on APM technology | |
CN114745415B (en) | Vehicle service communication data processing method, device, equipment and storage medium | |
CN113472748B (en) | Audit log system communication method based on non-blocking input and output |
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 |