CN115801731B - Processing method and device of network message, electronic equipment and storage medium - Google Patents
Processing method and device of network message, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN115801731B CN115801731B CN202310083061.8A CN202310083061A CN115801731B CN 115801731 B CN115801731 B CN 115801731B CN 202310083061 A CN202310083061 A CN 202310083061A CN 115801731 B CN115801731 B CN 115801731B
- Authority
- CN
- China
- Prior art keywords
- request message
- domain name
- message
- shared software
- request
- 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
Links
- 238000003672 processing method Methods 0.000 title abstract description 12
- 238000000034 method Methods 0.000 claims abstract description 316
- 230000008569 process Effects 0.000 claims abstract description 253
- 238000012545 processing Methods 0.000 claims abstract description 129
- 230000004044 response Effects 0.000 claims abstract description 101
- 238000012367 process mapping Methods 0.000 claims abstract description 28
- 230000005540 biological transmission Effects 0.000 claims abstract description 16
- 238000013507 mapping Methods 0.000 claims description 74
- 238000004891 communication Methods 0.000 claims description 19
- 230000003139 buffering effect Effects 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 4
- 238000000605 extraction Methods 0.000 claims description 4
- 230000010365 information processing Effects 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 15
- FFBHFFJDDLITSX-UHFFFAOYSA-N benzyl N-[2-hydroxy-4-(3-oxomorpholin-4-yl)phenyl]carbamate Chemical compound OC1=C(NC(=O)OCC2=CC=CC=C2)C=CC(=C1)N1CCOCC1=O FFBHFFJDDLITSX-UHFFFAOYSA-N 0.000 description 6
- 230000000694 effects Effects 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 238000011161 development Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000012216 screening Methods 0.000 description 3
- 208000035217 Ring chromosome 1 syndrome Diseases 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000010076 replication Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 208000032826 Ring chromosome 3 syndrome Diseases 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/45—Network directories; Name-to-address mapping
- H04L61/4505—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
- H04L61/4511—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/58—Caching of addresses or names
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/566—Grouping or aggregating service requests, e.g. for unified processing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the invention provides a processing method, a device, electronic equipment and a storage medium of a network message, which relate to the technical field of information processing, and are used for acquiring a request message sent by a network end, if the IP layer protocol type and the transmission layer protocol type of the request message are designated protocol types and the request message contains a request domain name, extracting a second-level domain name from the request domain name, performing process mapping processing according to the second-level domain name, determining a target shared software cache queue corresponding to the request message, caching the request message to the target shared software cache queue, performing DNS response processing on the request message through a target service process corresponding to the target shared software cache queue, obtaining a corresponding response message, and returning the response message to the network end, so that the request message is distributed to different service processes according to the domain name through a distribution strategy and the process mapping processing aiming at the second-level domain name, the message processing efficiency is greatly improved, and the cache pressure of a rear-end server is reduced.
Description
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a method for processing a network packet, a device for processing a network packet, an electronic device, and a computer readable storage medium.
Background
DataPlane Development Kit, DPDK for short, is a data plane development tool set, different from most of the current operating systems with the purpose of general design, DPDK is dedicated to high-performance processing of data packets in network applications, and compared with traditional network programming, DPDK can realize network card driving and network message processing in a user mode, thereby greatly improving the performance of network applications. The Local DNS (Local DNS/DomainName System) can help the user to resolve from a domain name to an IP (internet protocol), which is equivalent to an entry for the user to access the network. LocalDNS-based web service applications may provide caching DNS (Domain NameSystem ) capabilities as well as recursive DNS capabilities.
With the continuous development of network technology, the number of netizens has also increased dramatically, which means that LocalDNS in CDN (Content DeliveryNetwork ) or LocalDNS of operators needs to bear huge DNS access services. In order to pursue the improvement of the system performance, a DPDK technology is currently adopted to realize the LocalDNS under a multi-process architecture, so as to achieve the purposes of eliminating the consumption of the synchronous lock under a multi-thread architecture, eliminating the data replication between a large number of kernel states and user states of system call and the like. Although the network service capability of the LocalDNS can be greatly improved by adopting the method, each process independently maintains the DNS cache, so that the total amount of the DNS cache is multiplied, the message processing efficiency is reduced, and the pressure of a back-end server is multiplied.
Disclosure of Invention
The embodiment of the invention provides a processing method, a processing device, electronic equipment and a computer readable storage medium for network messages, which are used for solving or partially solving the problem of pressure multiplication of a back-end server caused by low message processing efficiency in the existing message processing mode.
The embodiment of the invention discloses a processing method of a network message, which is applied to a local DNS system, wherein the local DNS system comprises a domain name load balancing module, the domain name load balancing module comprises at least one first shared software cache queue, and each first shared software cache queue corresponds to a service process, and the method comprises the following steps:
acquiring a request message sent by a network side and message information corresponding to the request message, wherein the message information at least comprises an IP layer protocol type and a transmission layer protocol type;
if the IP layer protocol type is IPv4 or IPv6 protocol type, the transport layer protocol type is UDP protocol type, and the request message contains a request domain name, extracting a secondary domain name corresponding to the request message from the request domain name;
performing process mapping processing according to the second-level domain name, determining a target shared software cache queue corresponding to the request message from the at least one first shared software cache queue, and caching the request message to the target shared software cache queue;
And performing DNS response processing on the request message through a target service process corresponding to the target shared software cache queue to obtain a corresponding response message, and returning the response message to the network side.
The embodiment of the invention also discloses a processing method and a device of the network message, which are applied to a local DNS system, wherein the local DNS system comprises a domain name load balancing module, the domain name load balancing module comprises at least one first shared software cache queue, each first shared software cache queue corresponds to a service process, and the device comprises:
the request message acquisition module is used for acquiring a request message sent by a network side and message information corresponding to the request message, wherein the message information at least comprises an IP layer protocol type and a transmission layer protocol type;
the second-level domain name extraction module is used for extracting a second-level domain name corresponding to the request message from the request domain name if the IP layer protocol type is an IPv4 or IPv6 protocol type, the transmission layer protocol type is a UDP protocol type and the request message contains the request domain name;
the process mapping processing module is used for performing process mapping processing according to the second-level domain name, determining a target shared software cache queue corresponding to the request message from the at least one first shared software cache queue, and caching the request message to the target shared software cache queue;
And the DNS response processing module is used for performing DNS response processing on the request message through a target service process corresponding to the target shared software cache queue to obtain a corresponding response message, and returning the response message to the network side.
The embodiment of the invention also discloses electronic equipment, which 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;
the memory is used for storing a computer program;
the processor is configured to implement the method according to the embodiment of the present invention when executing the program stored in the memory.
Embodiments of the present invention also disclose a computer-readable storage medium having instructions stored thereon, which when executed by one or more processors, cause the processors to perform the method according to the embodiments of the present invention.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, a network message processing method applied to a local DNS system is provided, a request message sent by a network end is obtained, if an IP layer protocol type and a transmission layer protocol type of the request message are designated protocol types and the request message contains a request domain name, a second-level domain name is extracted from the request domain name, then process mapping processing is carried out according to the second-level domain name, a target shared software cache queue corresponding to the request message is determined, the request message is cached to the target shared software cache queue, DNS response processing is carried out on the request message through a target service process corresponding to the target shared software cache queue, a corresponding response message is obtained, and the response message is returned to the network end, so that the request message is distributed to different service processes according to the domain name through a distribution strategy and the process mapping processing aiming at the second-level domain name, DNS load balancing is realized, the message processing efficiency is greatly improved, and the cache pressure of a rear-end server is reduced.
Drawings
FIG. 1 is a schematic diagram of a local DNS server system;
FIG. 2 is a schematic diagram of a multiprocessing framework of a local DNS system implemented directly using DPDK;
FIG. 3 is a schematic diagram of the effect of a prior art local DNS system using DPDK;
fig. 4 is a schematic diagram of a domain name load balancing framework of a local DNS system according to an embodiment of the present invention;
fig. 5 is a schematic diagram of DNS request effects of using DPDK by a local DNS system with increased domain name load balancing according to an embodiment of the present invention;
fig. 6 is a flowchart of a method for processing a network packet according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a shared software buffer queue structure implemented based on DPDKRing library according to an embodiment of the present invention;
fig. 8 is a flow chart of a processing method of a network packet according to an embodiment of the present invention;
fig. 9 is a block diagram of a processing device for a network packet according to an embodiment of the present invention;
fig. 10 is a block diagram of an electronic device provided in an embodiment of the invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
As an example, a Local DNS (Local DNS/Domain Name System, local domain name system) may help a user to resolve from a domain name to an IP (Internet Protocol ), a Local DNS-based network service application may provide a caching DNS (Domain Name System ) capability and a recursive DNS capability, referring to fig. 1, a schematic diagram of a Local DNS server system is shown, where a Local DNS server system 100 is shown in a dashed box, and the Local DNS server system 100 may include a Local DNS caching DNS module 101 and a Local DNS recursion DNS module 102, where the Local DNS caching DNS module 101 may receive a DNS request sent by the user and perform DNS response on the DNS request after resolving a user source IP, querying a domain name, querying a caching database, domain name resolving, and so on, and when querying the caching database fails, may send a DNS recursion request to the Local DNS recursion module 102, and send the DNS request to a backend server 103 by the Local recursion module 102, and perform processing on the DNS request to the DNS server system at each level 103 and return the DNS request to the Local DNS server module after processing the DNS request to the Local DNS server module and processing the DNS request.
With the continuous development of network technology, the number of netizens has also increased dramatically, which means that Local DNS in CDN (Content Delivery Network ) or Local DNS of operators needs to bear huge DNS access services. In order to pursue the improvement of the system performance, the Local DNS under the multi-process architecture is realized based on the DPDK technology, so that the purposes of eliminating the consumption of the synchronous lock under the multi-thread architecture, eliminating the data replication between a large number of kernel states and user states of system call and the like are achieved.
Referring to fig. 2, there is shown a schematic diagram of a multi-process architecture of a local DNS system implemented directly using DPDK, in which in the existing packet processing manner, a request packet with a DNS request is sent by Port0 and Port1 to a hardware buffer queue, where there are multiple RX (Receive) queues, such as RX0 and RX1, and multiple TX (Transmit) queues, such as TX0 and TX1, the request packet is received by the RX queue and sent to a main process process_0 or a sub process_1 for packet processing, and after processing, a response packet is sent by the main process process_0 or sub process_1 to the TX queue, and then returned by the TX queue to the corresponding Port.
As shown in fig. 3, a schematic diagram of a DNS request effect of a DPDK used in a conventional Local DNS system is shown, where a hardware receiving queue RX receives multiple DNS domains requested by a user, and transfers network messages corresponding to the multiple DNS domains to each process, such as a main process process_0 or a sub-process process_1, to process the messages, where each process needs to independently maintain a DNS cache, so that each process caches the multiple DNS domains requested by the user, and therefore, although the above method can greatly improve the network service capability of the Local DNS, each process independently maintains the DNS cache, so that the total amount of DNS caches is doubled, thereby not only reducing the message processing efficiency, but also causing the pressure multiplication of a backend server.
In this regard, one of the core inventions of the embodiments of the present invention is as follows: the method comprises the steps of obtaining a request message sent by a network end, extracting a second-level domain name from the request domain name if the IP layer protocol type and the transmission layer protocol type of the request message are the appointed protocol type and the request message contains the request domain name, performing process mapping processing according to the second-level domain name, determining a target shared software cache queue corresponding to the request message, caching the request message to the target shared software cache queue, performing DNS response processing on the request message through a target service process corresponding to the target shared software cache queue, obtaining a corresponding response message, and returning the response message to the network end, so that the request message is distributed to different service processes according to the domain name through a distribution strategy and the process mapping processing aiming at the second-level domain name, the DNS domain name load balancing is realized, the message processing efficiency is greatly improved, and the cache pressure of a back-end server is reduced.
Referring to fig. 4, a domain name load balancing framework schematic diagram of a local DNS system provided in the embodiment of the present invention is shown, where, compared with a multi-process architecture processing manner implemented by directly using DPDK in fig. 2, in the embodiment of the present invention, in a DPDK network message flow process, that is, after a network message is taken out from a hardware receiving queue RX, a layer of domain name load balancing module 401 is added, in the domain name load balancing module 401, an obtained DNS request message (i.e., a network message) can be secondarily distributed from a main process process_0 or a sub-process process_1 (which may also be referred to as a process corresponding to the process after the request message enters the load balancing module), for example, to a shared software buffer queue RX, for example, to the rx_ring0 or rx_ring1, then, corresponding network messages can be processed by service processes corresponding to each shared software buffer queue TX, so as to implement secondary distribution of the message, and without changing network message processing logic of subsequent processes, and when each network message processing logic of each subsequent processes is required, the network message processing logic is implemented, and when the network message is sent to the network message is processed to the corresponding to the TX queue, for implementing the processing, for the network processing, for example, the network message is quickly returned to the network processing to the network queue 0.
Referring to fig. 5, a schematic diagram of DNS request effects of DPDK used by a local DNS system with increased domain name load balancing provided in an embodiment of the present invention is shown, where the local DNS system includes a hardware receive queue RX module 501, a domain name load balancing sub-module 502, a shared software buffer queue module 503, and a service process packet processing module 504, where the hardware receive queue RX module 501 may include multiple hardware receive queues RX, such as RX0, RX1, and RX2, for receiving multiple DNS domain names requested by a user, the domain name load balancing sub-module 502 includes a main process process_0 and multiple sub-process processes_1, for secondarily distributing network packets corresponding to each DNS domain name to corresponding shared software buffer queues according to a distribution policy, the shared software buffer queue module 503 includes multiple shared software buffer queues RX, such as rx_ring0, rx_ring1, rx_ring3, etc., for buffering network messages after secondary distribution, the service process message processing module 504 includes a main process process_0 and a plurality of sub-processes process_1, for receiving network messages to be processed from the corresponding shared software buffer queue RX, and for performing response processing on the network messages, where a DNS domain name requested by a user includes a domain name 1"www.xxx.cn", a domain name 2"app.yyy.com", a domain name 3"www.zzz.com", a domain name 4 "ddd.com", a domain name 5 "www.aa.com", a domain name 6 "bbb.com", and after secondary distribution processing is performed by the domain name load balancing module provided by the embodiment of the present invention, each service process may correspond to a different network message, such as a domain name 1"www.xxx.cn" and a domain name 2 "app.ddd.com", a domain name 1 "www.ddd.com" and a domain name 4 "www.ddd.z.com", the other sub-process process_1 corresponds to domain name 5"www.aaa.com" and domain name 6"news.bbb.com".
It should be noted that the embodiments of the present invention include, but are not limited to, the foregoing examples, and it will be understood that those skilled in the art may also set the embodiments according to actual requirements under the guidance of the concepts of the embodiments of the present invention, which are not limited thereto.
In the embodiment of the invention, a local DNS system which can realize domain name load balancing and comprises a domain name load balancing module is provided, the local DNS system can be applied to the network message processing method provided by the embodiment of the invention, specifically, a request message sent by a network end can be obtained, if the IP layer protocol type and the transmission layer protocol type of the request message are designated protocol types and the request message contains a request domain name, a second-level domain name is extracted from the request domain name, then process mapping processing is carried out according to the second-level domain name, a target shared software cache queue corresponding to the request message is determined, the request message is cached to the target shared software cache queue, then DNS response processing is carried out on the request message through a target service process corresponding to the target shared software cache queue, a corresponding response message is obtained, and the response message is returned to the network end, so that the request message is distributed to different service processes according to domain names through a distribution strategy and the process mapping processing aiming at the second-level domain name, the request load balancing is realized, the message processing efficiency is greatly improved, and the cache pressure of a rear-end server is reduced.
Referring to fig. 6, a flowchart illustrating steps of a method for processing a network packet according to an embodiment of the present invention is applied to a local DNS system, where the local DNS system includes a domain name load balancing module, and the domain name load balancing module includes at least one first shared software buffer queue, where each first shared software buffer queue corresponds to a service process, and may specifically include the following steps:
specifically, a request message sent by a network end and message information corresponding to the request message can be obtained, where the message information at least includes an IP layer protocol type and a transport layer protocol type, further, when the request message is obtained, the request message to be processed can be obtained from a hardware receiving queue through a process instead of directly obtaining from the network end, where the process can be represented as a process corresponding to the request message after entering a load balancing module, and thus the local DNS system can further include a hardware receiving queue, and the domain name load balancing module can further include the process, and then obtaining the request message sent by the network end and the message information corresponding to the request message can be: and receiving a request message and message information corresponding to the request message sent by a network terminal through a hardware receiving queue, then distributing the request message and the message information corresponding to the request message to the process, and acquiring the request message and the message information corresponding to the request message from the process in the message processing process aiming at the request message, so that the request message is acquired to facilitate the subsequent secondary distribution and response processing of the request message.
Step 602, if the IP layer protocol type is an IPv4 or IPv6 protocol type, the transport layer protocol type is a UDP protocol type, and the request packet includes a request domain name, extracting a secondary domain name corresponding to the request packet from the request domain name;
after the request message to be processed is obtained from the hardware receiving queue through the process, a distribution policy (may also be referred to as a load balancing policy) may be adopted, and screening is performed according to the protocol types of the IP layer and the application layer in the request message, specifically, when the protocol type of the IP layer is an IPv4 (Internet Protocol version, internet protocol version 4) or an IPv6 (Internet Protocol version, internet protocol version 6) protocol type, and the protocol type of the transport layer is a UDP (User DatagramProtocol ) protocol type, and when the request message includes a request domain name (i.e., the request message is a DNS request message after being resolved by the application layer), a secondary domain name corresponding to the request message is extracted from the request domain name, so that screening of the request message is achieved through the protocol type of the request message, so that secondary distribution of the message is performed subsequently, and the message processing efficiency is improved.
Further, the domain name load balancing module may further include a present process and a second shared software cache queue corresponding to the present process, so when the IP layer protocol type is not an IPv4 protocol type or an IPv6 protocol type, that is, the IP layer protocol type of the request message is other than the IPv4 protocol type and the IPv6 protocol type, the request message may be cached to the second shared software cache queue corresponding to the present process, and DNS response processing is performed on the request message by the present process, so as to obtain a corresponding response message, and the response message is returned to the network side, so that, in a case that the IP layer protocol of the request message is not the specified protocol type, the request message may be directly cached to the shared software cache queue corresponding to the present process, and the request message is processed by the present process.
As an alternative embodiment, the IP layer protocol of the request packet is IPv4 or IPv6, but the application layer protocol type may not be a UDP protocol type, but a TCP (Transmission Control Protocol ) protocol type, where the request packet may be transferred to a service process specially processing a TCP protocol type packet for processing, a corresponding TCP shared buffer queue may be created for the request packet of the TCP protocol type, and a TCP service processing process, in a specific implementation, the local DNS system may further include a TCP service processing process and a TCP shared buffer queue corresponding to the TCP service processing process, when the transmission layer protocol type is a TCP protocol type, the request packet is buffered to the TCP shared buffer queue, and DNS response processing is performed on the request packet by the TCP service processing process to obtain a corresponding response packet, and the response packet is returned to the network end, so that, when the application layer protocol of the request packet is a TCP protocol type, the request packet may be buffered to a shared software specially processing the TCP protocol type packet, and the request packet is processed by the TCP shared buffer queue, and the service processing efficiency is accelerated.
In another possible case, the transport layer protocol type of the request message may not be a UDP protocol type or a TCP protocol type, where the request message may be cached in a second shared software cache queue corresponding to the process, specifically, if the transport layer protocol type is other than the UDP protocol type and the TCP protocol type, the request message is cached in the second shared software cache queue, and DNS response processing is performed on the request message through the process, so that a corresponding response message is obtained, and the response message is returned to the network, where the application layer protocol of the request message is not a specified protocol type, the request message may be directly cached in the shared software cache queue corresponding to the process, and the request message is processed through the process.
When the IP layer protocol of the request message is IPv4 or IPv6 protocol type, the transmission layer protocol type is UDP protocol type, the request message is analyzed by an application layer to be DNS request message, the request message comprises a request domain name, the request message can be continuously analyzed, the DNS message header content of the request message is extracted, the request message DNS request is determined whether legal or not, when the request message DNS request is legal, a domain name query field in the request domain name, namely a DNS QNAME field, is continuously analyzed, a secondary domain name is extracted from the domain name query field, the request message can comprise a DNS message header, the request domain name can comprise a domain name query field, and the secondary domain name corresponding to the request message is extracted from the request domain name, and can be: if the head of the DNS message represents that the DNS request of the request message is legal, extracting a secondary domain name corresponding to the request message from a domain name query field, judging whether the DNS request of the request message is legal or not, and carrying out corresponding processing according to the analysis result, thereby improving the message screening and processing efficiency.
In another possible case, the DNS request of the request message may not be legal, for example, the domain name address configuration error may cause unrecognization, etc., where the request message may be cached to a second shared software cache queue corresponding to the present process, specifically, if the DNS message header indicates that the DNS request of the request message is illegal, the request message is cached to the second shared software cache queue, and DNS response processing is performed on the request message through the present process, so as to obtain a corresponding response message, and return the response message to the network side, so that in the case that the DNS request of the request message is illegal, the request message may be directly cached to the shared software cache queue corresponding to the present process, and the request message is processed through the present process.
As an optional embodiment, the domain name query field may not have a second-level domain name, where the request message may be cached to a second shared software cache queue corresponding to the process, in a specific implementation, if the domain name query field does not have a second-level domain name corresponding to the request message, the request message is cached to the second shared software cache queue, DNS response processing is performed on the request message through the process, a corresponding response message is obtained, and the response message is returned to the network end, so that, if the domain name query field of the request message does not have a second-level domain name, the request message may be directly cached to the shared software cache queue corresponding to the process, and the request message is processed through the process.
Step 603, performing process mapping according to the second-level domain name, determining a target shared software buffer queue corresponding to the request message from the at least one first shared software buffer queue, and buffering the request message to the target shared software buffer queue;
after the second-level domain name is extracted from the domain name query field, process mapping processing can be performed according to the second-level domain name, a target shared software cache queue corresponding to the request message is determined from at least one first shared software cache queue, and the request message is cached to the target shared software cache queue, so that the corresponding target shared software cache queue is determined from a plurality of first shared software cache queues through the process mapping processing of the second-level domain name, and secondary distribution of the request message and DNS domain name load balancing are realized.
Further, the above process may specifically be: and performing mapping operation, namely hash operation, on the secondary domain name to obtain a mapping value corresponding to the secondary domain name, determining a target process number corresponding to the mapping value according to a preset mapping rule, extracting a target service process corresponding to the target process number from at least one service process, and selecting a target shared software cache queue corresponding to the target service process from at least one first shared software cache queue, so that the corresponding mapping value can be determined through the mapping operation on the secondary domain name, and secondary distribution of the request message and DNS domain name load balancing are realized through a process mapping means.
As an optional embodiment, mapping operation is performed on the secondary domain name to obtain a mapping value corresponding to the secondary domain name, and a target process number corresponding to the mapping value is determined according to a preset mapping rule, which may be: and obtaining a mapping table corresponding to at least one first shared software cache queue, performing mapping operation on the secondary domain name based on the mapping table to obtain a mapping value corresponding to the secondary domain name, then obtaining a process number queue corresponding to the business process, performing bitwise AND operation by adopting the mapping value, and matching a target process number corresponding to the mapping value from the process number queue based on an operation result.
The local DNS system may further include a main process, and before the mapping table is obtained, a mapping table corresponding to at least one first shared software buffer queue may be created by the main process through a DPDK mapping library method in an initialization process of the DPDK tool set, where the mapping table is used to perform a process mapping process on a second domain name in the requested domain name.
Illustratively, the master process may use a DPDK hash library approach: structrte_hash rte _hash_create (…) a mapping (hash) table is created during DPDK tool set initialization. The service process, i.e. the sub-process, may use the DPDK hash library method: struct rte_hash rte _hash_find_exist (…), and a mapping (hash) table created by a main process is queried and matched in the DPDK tool set initialization process, wherein, since each service process corresponds to one first shared software cache queue, the mapping (hash) table created by the main process can also correspond to at least one first shared software cache queue.
For the calculation of the mapping (hash) value, for example, a DPDK hash library method may be used: calculating a mapping (hash) value by using a hash_sig_t rte_hash_hash (constraint struct_hash) and recording the mapping (hash) value as a value, wherein the parameter h is a mapping (hash) table created in the process; the parameter key is the second-level domain name of the DNS request in the request message.
For example, for a mapping method of mapping (hash) values to processes, when creating a process number queue, it may be noted as index [ size ], where the queue length of the process number queue may be: an integer power of 2 (to ensure that bitwise and operation can be performed later) and large enough to promote mapping uniformity, e.g., 1024 x 1024, noted as size; for the queue content of the process number queue, the process number sequence may be adopted to perform cyclic arrangement, for example, 4 processes are adopted to process request messages of the UDP protocol type, that is, the number of the UDP request messages sharing buffer queues is 4, and the number of the UDP request messages sharing buffer queues is [0,1,2,3,0,1,2,3 … ], and the number of the UDP request messages sharing buffer queues is 0-3 in a repeated cycle in brackets, so that the number of the UDP request messages sharing buffer queues is equal to the number of the UDP request messages sharing buffer queues.
Illustratively, for the process number acquisition, which may be denoted index_p, a bitwise AND operation is employed: index_p=value & (size-1).
In the embodiment of the invention, the process of obtaining the process number does not adopt remainder calculation, and although the process of obtaining the process number adopts a mapping (hash) value to carry out remainder calculation on the UDP processing process number in the simplest mode, the value is large, the consumption of division operation is also large, and in order to avoid the influence on the load balancing performance, bit-wise and operation are adopted.
Illustratively, for the acquisition of process numbers, this may be noted as process_n: process_n=index_p, i.e. the process number to be allocated, and finally the request message can be distributed to a distributor_ring [ port_n ] [ process_n ], where port_n is consistent with the port used when receiving the request message from the hardware receive queue.
As an alternative embodiment, before the process number queue corresponding to the service process is obtained, at least one service process can be created through the main process, a corresponding first shared software buffer queue is created for each service process, then corresponding process numbers are respectively allocated for each service process, a process number queue is created, and each process number is sequentially stored in the process number queue.
As an example, referring to fig. 7, a schematic diagram of a shared software buffer queue structure implemented based on a DPDK Ring library according to an embodiment of the present invention is shown:
Wherein the master process is responsible for creating the shared software buffer queue, for example, a similar structure of a DPDK hardware buffer queue (hardware requests) can be referred, a DPDK Ring (Ring buffer) library is used for creating the shared software buffer queue, and in the process of initializing a DPDK tool set, a method in the DPDK Ring library is used: struct rte_ring rte _ring_create (…) creates a "per process-per port" corresponding to a respective shared software cache queue (software queue), the shared queue being denoted as distributor_ring [ port_num ] [ process_num ], i.e. hardware port M, process number N corresponding to the cache queue: distributor_ring [ M ] [ N ].
For the service process searching and matching process, in the DPDK tool set initializing process, a method in a DPDK Ring library can be used: structrte_ring rte _ring_lookup (…) looks up and matches the shared software cache queue created by the master process.
And step 604, performing DNS response processing on the request message through a target service process corresponding to the target shared software cache queue to obtain a corresponding response message, and returning the response message to the network side.
After caching the request message to the corresponding target shared software cache queue, performing DNS response processing on the request message through a target service process corresponding to the target shared software cache queue to obtain a corresponding response message, and returning the response message to the network side, where further, the local DNS system may further include a hardware sending queue, and returning the response message to the network side may be: the response message is returned to the network end through the hardware sending queue, so that after the request message is secondarily distributed by adopting the distribution strategy, DNS processing can be carried out on the request message through the corresponding target service process, the message processing efficiency is improved, and the cache pressure of the server is greatly reduced.
It should be noted that the embodiments of the present invention include, but are not limited to, the foregoing examples, and it will be understood that those skilled in the art may also set the embodiments according to actual requirements under the guidance of the concepts of the embodiments of the present invention, which are not limited thereto.
In the embodiment of the invention, a network message processing method applied to a local DNS system is provided, a request message sent by a network end is obtained, if an IP layer protocol type and a transmission layer protocol type of the request message are designated protocol types and the request message contains a request domain name, a second-level domain name is extracted from the request domain name, then process mapping processing is carried out according to the second-level domain name, a target shared software cache queue corresponding to the request message is determined, the request message is cached to the target shared software cache queue, DNS response processing is carried out on the request message through a target service process corresponding to the target shared software cache queue, a corresponding response message is obtained, and the response message is returned to the network end, so that the request message is distributed to different service processes according to the domain name through a distribution strategy and the process mapping processing aiming at the second-level domain name, DNS load balancing is realized, the message processing efficiency is greatly improved, and the cache pressure of a rear-end server is reduced.
In order to enable those skilled in the art to better understand the technical solutions of the embodiments of the present invention, the following explanation and description are given by way of example:
referring to fig. 8, a flow chart of a method for processing a network packet provided in an embodiment of the present invention is shown, where the method is applied to a local DNS system, where the local DNS system includes at least a domain name load balancing module, the domain name load balancing module includes a process and at least one first shared software buffer queue, where the process corresponds to a second shared software buffer queue, each first shared software buffer queue corresponds to a service process, the local DNS system further includes a TCP processing process, and the TCP shared buffer queues corresponding to the TCP processing process, and in this example, a request packet sent from a network end is received by the process as a starting step of a processing flow, and the local DNS system may receive, before that, a request packet sent by the network end and buffer the request packet to a hardware receiving queue.
1. Receiving a request message and message information corresponding to the request message sent from a network end from a hardware receiving queue through the process, wherein the message information at least comprises an IP layer protocol type, a transmission layer protocol type and a DNS message header;
2. If the IP layer protocol type is not IPv4 or IPv6, executing step 6, if the IP layer protocol type is IPv4 or IPv6, judging whether the transport layer protocol type is UDP or TCP protocol type, if the transport layer protocol type is not UDP or TCP protocol type, executing step 6, if the transport layer protocol type is UDP protocol type, and the request message contains a request domain name (the request domain name contains a domain name query field), executing step 3, and if the transport layer protocol type is TCP protocol type, executing step 7;
3. judging whether a request message (DNS) request in an application layer is legal or not according to the DNS message header, if the DNS request is illegal, executing step 6, if the DNS request is legal, judging whether a domain name query field contains a secondary domain name, if the domain name query field does not contain the secondary domain name, executing step 6, and if the domain name query field contains the secondary domain name, executing step 4;
4. performing mapping operation on the second-level domain name to obtain a mapping value, obtaining a target process number according to a preset mapping rule, determining a target shared software cache queue, specifically, extracting a target service process corresponding to the target process number from at least one service process, selecting a target shared software cache queue corresponding to the target service process from at least one first shared software cache queue, and executing step 5;
5. Caching the request message to a target shared software cache queue, and executing the step 8;
6. caching the request message to a second shared software cache queue corresponding to the process, and executing the step 8;
7. caching the request message to a TCP shared cache queue, and executing the step 8;
8. each process responds to the request message, obtains a response message and returns the response message to the network side, wherein the request message in the second shared software cache queue is responded by the process, and the request message in the target shared software cache queue is responded by the service process corresponding to the target shared software cache queue.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
Referring to fig. 9, a block diagram of a processing device for a network packet according to an embodiment of the present invention is shown and applied to a local DNS system, where the local DNS system includes a domain name load balancing module, and the domain name load balancing module includes at least one first shared software buffer queue, where each first shared software buffer queue corresponds to a service process, and the device specifically may include the following modules:
the request message obtaining module 901 is configured to obtain a request message sent by a network side and message information corresponding to the request message, where the message information at least includes an IP layer protocol type and a transport layer protocol type;
a second-level domain name extraction module 902, configured to extract a second-level domain name corresponding to the request packet from the request domain name if the IP layer protocol type is an IPv4 or IPv6 protocol type, the transport layer protocol type is a UDP protocol type, and the request packet includes the request domain name;
the process mapping processing module 903 is configured to perform process mapping processing according to the second domain name, determine a target shared software cache queue corresponding to the request packet from the at least one first shared software cache queue, and cache the request packet to the target shared software cache queue;
And the DNS response processing module 904 is configured to perform DNS response processing on the request packet by using a target service process corresponding to the target shared software cache queue, obtain a corresponding response packet, and return the response packet to the network side.
In an alternative embodiment, the process mapping processing module 903 includes:
the second-level domain name mapping operation module is used for carrying out mapping operation on the second-level domain name to obtain a mapping value corresponding to the second-level domain name, and determining a target process number corresponding to the mapping value according to a preset mapping rule;
and the target shared software cache queue determining module is used for extracting a target service process corresponding to the target process number from at least one service process and selecting a target shared software cache queue corresponding to the target service process from at least one first shared software cache queue.
In an alternative embodiment, the second-level domain name mapping operation module includes:
a second-level domain name mapping operation sub-module, configured to obtain a mapping table corresponding to the at least one first shared software cache queue, and perform mapping operation on the second-level domain name based on the mapping table, so as to obtain a mapping value corresponding to the second-level domain name;
The bitwise AND operation module is used for acquiring a process number queue corresponding to the service process, performing bitwise AND operation by adopting the mapping value, and matching a target process number corresponding to the mapping value from the process number queue based on an operation result.
In an alternative embodiment, the local DNS system includes a master process, and the apparatus further includes:
and the mapping table creating module is used for creating a mapping table corresponding to the at least one first shared software cache queue by adopting a DPDK mapping library method through the main process in the initialization process of the DPDK tool set, and the mapping table is used for carrying out process mapping processing on the secondary domain name in the request domain name.
In an alternative embodiment, the local DNS system includes a master process, and the apparatus further includes:
the first shared software cache queue creating module is used for creating at least one business process through the main process and creating corresponding first shared software cache queues for the business processes respectively;
the process number queue generating module is used for respectively distributing corresponding process numbers for the business processes, creating a process number queue, and storing the process numbers into the process number queue in sequence.
In an alternative embodiment, the request message includes a DNS message header, the request domain name includes a domain name query field, and the second level domain name extraction module 902 is specifically configured to:
and if the DNS message header indicates that the DNS request of the request message is legal, extracting a secondary domain name corresponding to the request message from the domain name query field.
In an optional embodiment, the domain name load balancing module includes a process, where the process is a process corresponding to the request packet after entering the load balancing module, and the main process corresponds to a second shared software cache queue, and the apparatus further includes:
the request message first caching module is used for caching the request message to the second shared software caching queue if the DNS message header indicates that the request message DNS request is illegal;
and the DNS response processing first sub-module is used for performing DNS response processing on the request message through the process to obtain a corresponding response message, and returning the response message to the network side.
In an optional embodiment, the domain name load balancing module includes a process, where the process is a process corresponding to the request packet after entering the load balancing module, and the process corresponds to a second shared software cache queue, and the apparatus further includes:
The second buffer module of the request message is used for buffering the request message to the second shared software buffer queue if the second-level domain name corresponding to the request message does not exist in the domain name query field;
and the DNS response processing second sub-module is used for performing DNS response processing on the request message through the process to obtain a corresponding response message, and returning the response message to the network side.
In an optional embodiment, the domain name load balancing module includes a process, where the process is a process corresponding to the request packet after entering the load balancing module, and the main process corresponds to a second shared software cache queue, and the apparatus further includes:
a request message third buffer module, configured to buffer the request message to the second shared software buffer queue if the IP layer protocol type is other than the IPv4 and IPv6 protocol types;
and the DNS response processing third sub-module is used for performing DNS response processing on the request message through the process to obtain a corresponding response message, and returning the response message to the network side.
In an alternative embodiment, the local DNS system further includes a TCP service processing process, and a TCP shared buffer queue corresponding to the TCP service processing process, and the apparatus further includes:
The TCP shared buffer queue buffer module is used for buffering the request message to the TCP shared buffer queue if the transmission layer protocol type is a TCP protocol type;
and the TCP service processing module is used for performing DNS response processing on the request message through the TCP service processing process to obtain a corresponding response message, and returning the response message to the network side.
In an optional embodiment, the domain name load balancing module includes a process, where the process is a process corresponding to the request packet after entering the load balancing module, and the process corresponds to a second shared software cache queue, and the apparatus further includes:
a fourth buffer module for buffering the request message to the second shared software buffer queue if the transport layer protocol type is other than the UDP protocol type and the TCP protocol type;
and the DNS response processing fourth sub-module is used for performing DNS response processing on the request message through the process to obtain a corresponding response message, and returning the response message to the network side.
In an optional embodiment, the local DNS system further includes a hardware receive queue and a hardware send queue, the domain name load balancing module includes the present process, and the request message obtaining module 901 is specifically configured to:
Receiving a request message sent by a network terminal and message information corresponding to the request message through the hardware receiving queue;
distributing the message information corresponding to the request message to the process;
in a message processing process aiming at a request message, acquiring the request message and message information corresponding to the request message from the process;
the DNS response processing module 904 includes:
and the response message return module is used for returning the response message to the network end through the hardware sending queue.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, realizes the processes of the above network message processing method embodiment, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here. Wherein the computer readable storage medium is selected from Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
The embodiment of the invention also provides an electronic device, as shown in fig. 10, which comprises a processor 1001, a communication interface 1002, a memory 1003 and a communication bus 1004, wherein the processor 1001, the communication interface 1002 and the memory 1003 complete communication with each other through the communication bus 1004.
The memory 1003 is used for storing a computer program;
the processor 1001 is configured to implement the steps of the processing method embodiment of the network packet when executing the program stored in the memory 1003, and achieve the same technical effects, so that repetition is avoided and no further description is given here.
The communication bus 1004 may be a Peripheral component interconnect standard (Peripheral ComponentInterconnect, PCI) bus, an extended industry standard architecture (Extended IndustryStandard Architecture, EISA) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface 1002 may also be used for communication between the processor 1001 or memory 1003 and other devices.
The memory 1003 may include a random access memory (Random Access Memory, RAM) or a nonvolatile memory (non-volatile memory), such as at least one magnetic disk memory. Optionally, the memory 1003 may also be at least one storage device located remotely from the aforementioned processor.
The processor 1001 may be a general-purpose processor, including a Central processing unit (Central ProcessingUnit, CPU), a network processor (Network Processor, NP), and the like; but also digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (Application SpecificIntegrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
It should be noted that, in this document, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.
Claims (14)
1. The method for processing the network message is characterized by being applied to a local DNS system, wherein the local DNS system comprises a domain name load balancing module, the domain name load balancing module comprises at least one first shared software cache queue, and each first shared software cache queue corresponds to a service process, and the method comprises the following steps:
acquiring a request message sent by a network side and message information corresponding to the request message, wherein the message information at least comprises an IP layer protocol type and a transmission layer protocol type;
if the IP layer protocol type is IPv4 or IPv6 protocol type, the transport layer protocol type is UDP protocol type, and the request message contains a request domain name, extracting a secondary domain name corresponding to the request message from the request domain name;
Performing process mapping processing according to the second-level domain name, determining a target shared software cache queue corresponding to the request message from the at least one first shared software cache queue, and caching the request message to the target shared software cache queue;
DNS response processing is carried out on the request message through a target service process corresponding to the target shared software cache queue, a corresponding response message is obtained, and the response message is returned to the network side;
the process mapping processing according to the second-level domain name, determining a target shared software buffer queue corresponding to the request message from the at least one first shared software buffer queue, and buffering the request message to the target shared software buffer queue, including:
performing mapping operation on the secondary domain name to obtain a mapping value corresponding to the secondary domain name, and determining a target process number corresponding to the mapping value according to a preset mapping rule;
and extracting a target business process corresponding to the target process number from at least one business process, and selecting a target shared software cache queue corresponding to the target business process from the at least one first shared software cache queue.
2. The method according to claim 1, wherein the performing mapping operation on the secondary domain name to obtain a mapping value corresponding to the secondary domain name, and determining the target process number corresponding to the mapping value according to a preset mapping rule, includes:
obtaining a mapping table corresponding to the at least one first shared software cache queue, and carrying out mapping operation on the secondary domain name based on the mapping table to obtain a mapping value corresponding to the secondary domain name;
and obtaining a process number queue corresponding to the service process, performing bitwise AND operation by adopting the mapping value, and matching a target process number corresponding to the mapping value from the process number queue based on an operation result.
3. The method of claim 2, wherein the local DNS system includes a master process, and wherein prior to said obtaining the mapping table corresponding to the at least one first shared software cache queue, the method further comprises:
and in the initialization process of the DPDK tool set, a mapping table corresponding to the at least one first shared software cache queue is created by adopting a DPDK mapping library method through the main process, and the mapping table is used for carrying out process mapping processing on a second domain name in the request domain name.
4. The method of claim 2, wherein the local DNS system comprises a master process, the method further comprising:
creating at least one business process through the main process, and creating a corresponding first shared software cache queue for each business process respectively;
and respectively distributing corresponding process numbers for the business processes, creating a process number queue, and sequentially storing the process numbers into the process number queue.
5. The method according to claim 1, wherein the request message includes a DNS message header, the request domain name includes a domain name query field, and the extracting the secondary domain name corresponding to the request message from the request domain name includes:
and if the DNS message header indicates that the DNS request of the request message is legal, extracting a secondary domain name corresponding to the request message from the domain name query field.
6. The method of claim 5, wherein the domain name load balancing module includes a present process, the present process being a process corresponding to the request message after entering the load balancing module, the present process corresponding to a second shared software cache queue, the method further comprising:
If the DNS message header indicates that the DNS request of the request message is illegal, caching the request message into the second shared software cache queue;
and performing DNS response processing on the request message through the process to obtain a corresponding response message, and returning the response message to the network side.
7. The method of claim 5, wherein the domain name load balancing module includes a present process, the present process being a process corresponding to the request message after entering the load balancing module, the present process corresponding to a second shared software cache queue, the method further comprising:
if the second-level domain name corresponding to the request message does not exist in the domain name query field, caching the request message into the second shared software cache queue;
and performing DNS response processing on the request message through the process to obtain a corresponding response message, and returning the response message to the network side.
8. The method of claim 1, wherein the domain name load balancing module includes a present process, the present process being a process corresponding to the request message after entering the load balancing module, the present process corresponding to a second shared software cache queue, the method further comprising:
If the IP layer protocol type is other protocol types except the IPv4 protocol type and the IPv6 protocol type, caching the request message into the second shared software cache queue;
and performing DNS response processing on the request message through the process to obtain a corresponding response message, and returning the response message to the network side.
9. The method of claim 1, wherein the local DNS system further comprises a TCP traffic processing process, and a TCP shared cache queue corresponding to the TCP traffic processing process, the method further comprising:
if the transport layer protocol type is a TCP protocol type, caching the request message into the TCP shared cache queue;
and performing DNS response processing on the request message through the TCP service processing process to obtain a corresponding response message, and returning the response message to the network side.
10. The method of claim 9, wherein the domain name load balancing module includes a present process, the present process being a process corresponding to the request message after entering the load balancing module, the present process corresponding to a second shared software cache queue, the method further comprising:
If the transport layer protocol type is other protocol types except the UDP protocol type and the TCP protocol type, caching the request message into the second shared software cache queue;
and performing DNS response processing on the request message through the process to obtain a corresponding response message, and returning the response message to the network side.
11. The method according to claim 1, wherein the local DNS system further includes a hardware receive queue and a hardware send queue, the domain name load balancing module includes a present process, and the obtaining the request message sent by the network side and the message information corresponding to the request message includes:
receiving a request message sent by a network terminal and message information corresponding to the request message through the hardware receiving queue;
distributing the message information corresponding to the request message to the process;
in a message processing process aiming at a request message, acquiring the request message and message information corresponding to the request message from the process;
the returning the response message to the network side includes:
and returning the response message to the network end through the hardware sending queue.
12. The utility model provides a processing apparatus of network message, its characterized in that is applied to local DNS system, local DNS system includes domain name load balancing module, domain name load balancing module includes at least one first shared software buffer queue, each first shared software buffer queue corresponds a business process, the device includes:
the request message acquisition module is used for acquiring a request message sent by a network side and message information corresponding to the request message, wherein the message information at least comprises an IP layer protocol type and a transmission layer protocol type;
the second-level domain name extraction module is used for extracting a second-level domain name corresponding to the request message from the request domain name if the IP layer protocol type is an IPv4 or IPv6 protocol type, the transmission layer protocol type is a UDP protocol type and the request message contains the request domain name;
the process mapping processing module is used for performing process mapping processing according to the second-level domain name, determining a target shared software cache queue corresponding to the request message from the at least one first shared software cache queue, and caching the request message to the target shared software cache queue;
The DNS response processing module is used for performing DNS response processing on the request message through a target service process corresponding to the target shared software cache queue to obtain a corresponding response message, and returning the response message to the network side;
wherein, the process mapping processing module comprises:
the second-level domain name mapping operation module is used for carrying out mapping operation on the second-level domain name to obtain a mapping value corresponding to the second-level domain name, and determining a target process number corresponding to the mapping value according to a preset mapping rule;
and the target shared software cache queue determining module is used for extracting a target service process corresponding to the target process number from at least one service process and selecting a target shared software cache queue corresponding to the target service process from at least one first shared software cache queue.
13. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
the memory is used for storing a computer program;
The processor being configured to implement the method of any of claims 1-11 when executing a program stored on a memory.
14. A computer-readable storage medium having instructions stored thereon, which when executed by one or more processors, cause the processors to perform the method of any of claims 1-11.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310083061.8A CN115801731B (en) | 2023-02-08 | 2023-02-08 | Processing method and device of network message, electronic equipment and storage medium |
PCT/CN2023/140002 WO2024164717A1 (en) | 2023-02-08 | 2023-12-19 | Network message processing method and apparatus, electronic device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310083061.8A CN115801731B (en) | 2023-02-08 | 2023-02-08 | Processing method and device of network message, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115801731A CN115801731A (en) | 2023-03-14 |
CN115801731B true CN115801731B (en) | 2023-06-23 |
Family
ID=85430488
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310083061.8A Active CN115801731B (en) | 2023-02-08 | 2023-02-08 | Processing method and device of network message, electronic equipment and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN115801731B (en) |
WO (1) | WO2024164717A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115801731B (en) * | 2023-02-08 | 2023-06-23 | 天翼云科技有限公司 | Processing method and device of network message, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108123888A (en) * | 2016-11-29 | 2018-06-05 | 中兴通讯股份有限公司 | Load-balancing method, the apparatus and system of message |
CN108173979A (en) * | 2017-12-25 | 2018-06-15 | 新华三信息安全技术有限公司 | A kind of message processing method, device, equipment and storage medium |
CN110381174A (en) * | 2019-07-06 | 2019-10-25 | 杭州安恒信息技术股份有限公司 | It is a kind of based on the high speed domain name analytic method statelessly scanned |
CN110784562A (en) * | 2019-10-25 | 2020-02-11 | 新华三信息安全技术有限公司 | Message forwarding method, domain name address query method, device, equipment and medium |
CN112333299A (en) * | 2021-01-04 | 2021-02-05 | 观脉科技(北京)有限公司 | Domain name resolution method, configuration method and equipment |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6907525B2 (en) * | 2001-08-14 | 2005-06-14 | Riverhead Networks Inc. | Protecting against spoofed DNS messages |
CN115801731B (en) * | 2023-02-08 | 2023-06-23 | 天翼云科技有限公司 | Processing method and device of network message, electronic equipment and storage medium |
-
2023
- 2023-02-08 CN CN202310083061.8A patent/CN115801731B/en active Active
- 2023-12-19 WO PCT/CN2023/140002 patent/WO2024164717A1/en unknown
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108123888A (en) * | 2016-11-29 | 2018-06-05 | 中兴通讯股份有限公司 | Load-balancing method, the apparatus and system of message |
CN108173979A (en) * | 2017-12-25 | 2018-06-15 | 新华三信息安全技术有限公司 | A kind of message processing method, device, equipment and storage medium |
CN110381174A (en) * | 2019-07-06 | 2019-10-25 | 杭州安恒信息技术股份有限公司 | It is a kind of based on the high speed domain name analytic method statelessly scanned |
CN110784562A (en) * | 2019-10-25 | 2020-02-11 | 新华三信息安全技术有限公司 | Message forwarding method, domain name address query method, device, equipment and medium |
CN112333299A (en) * | 2021-01-04 | 2021-02-05 | 观脉科技(北京)有限公司 | Domain name resolution method, configuration method and equipment |
Also Published As
Publication number | Publication date |
---|---|
CN115801731A (en) | 2023-03-14 |
WO2024164717A1 (en) | 2024-08-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111460460B (en) | Task access method, device, proxy server and machine-readable storage medium | |
EP2769307B1 (en) | Answer augmentation system for authoritative dns servers | |
US20120207167A1 (en) | Method of searching for host in ipv6 network | |
CA2947325A1 (en) | Protocol type identification method and apparatus | |
CN107580079B (en) | Message transmission method and device | |
CN106713144B (en) | Reading and writing method of message outlet information and forwarding engine | |
US20200382465A1 (en) | Client subnet efficiency by equivalence class aggregation | |
CN109525684B (en) | Message forwarding method and device | |
CN111431871B (en) | Processing method and device of TCP (Transmission control protocol) semi-transparent proxy | |
CN111010460A (en) | Domain name resolution method and device | |
CN115801731B (en) | Processing method and device of network message, electronic equipment and storage medium | |
US10404651B2 (en) | Domain name system network traffic management | |
US12069023B2 (en) | Domain name system services for variable-length address networks | |
CN109413224B (en) | Message forwarding method and device | |
CN109246024B (en) | Method, device, terminal equipment and storage medium for load sharing in networking | |
CN110932983B (en) | TCP load balancing method, device, equipment and medium | |
US20210243248A1 (en) | Cloud service load balancing | |
US20100238930A1 (en) | Router and method of forwarding ipv6 packets | |
WO2022078330A1 (en) | Domain name recursive query method and apparatus, and recursive server and dns system | |
CN113965367B (en) | Policy object upper limit control method, system, computer and storage medium | |
CN106254576B (en) | Message forwarding method and device | |
CN110601993B (en) | Multi-outlet load balancing method and device | |
US10958580B2 (en) | System and method of performing load balancing over an overlay network | |
CN107547687B (en) | Message transmission method and device | |
CN111935333B (en) | NAT type determination method, device, system 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 | ||
CP02 | Change in the address of a patent holder |
Address after: 100007 room 205-32, floor 2, building 2, No. 1 and No. 3, qinglonghutong a, Dongcheng District, Beijing Patentee after: Tianyiyun Technology Co.,Ltd. Address before: 100093 Floor 4, Block E, Xishan Yingfu Business Center, Haidian District, Beijing Patentee before: Tianyiyun Technology Co.,Ltd. |
|
CP02 | Change in the address of a patent holder |