A network traffic collection method and device for named data networking
By collecting interest packets and data packets in the named data network and performing hash operations, the problems of resource waste and low effectiveness caused by the sFlow protocol are solved, and efficient traffic collection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2026-04-10
AI Technical Summary
In named data networks, the existing sFlow protocol causes interest packets and data packets to not be matched one-to-one, resulting in a waste of storage space and network communication bandwidth resources during traffic collection, and low collection effectiveness.
When an interest packet is acquired, it is collected and marked as collected. When a data packet is acquired and the corresponding interest packet is marked as collected, it is collected. The content name of the collected data is hashed to encapsulate it into a fixed-length hash value, forming the traffic collection encapsulation result.
This reduces the storage space and network communication bandwidth required for traffic collection, thus improving the effectiveness of traffic collection.
Smart Images

Figure CN116684310B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of digital information transmission, and in particular to a network flow collection method and device for a named data network. BACKGROUND
[0002] The sFlow (Sampled Flow) protocol is a network flow monitoring technology based on packet sampling, and has excellent advantages in large-scale network applicability and operation cost. Therefore, the sFlow is widely used in network flow monitoring at present.
[0003] However, when network flow collection is performed on a named data network (NDN), the content name of a data packet in the NDN network is indefinite length, and the content name length has no explicit limitation. After being encapsulated into an sFlow data report, the content is prone to be missing and the space occupied is too large. Meanwhile, the data packet and the interest packet under the NDN network are associated, and the complete user session information is formed by the interest packet and the corresponding data packet. The bidirectional independent sampling mechanism of the sFlow causes the interest packet and the data packet to be unable to correspond one by one, thereby causing the storage space and network communication bandwidth resources to be wasted and the flow collection effectiveness to be low during flow collection.
[0004] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY
[0005] The main purpose of the present application is to provide a network flow collection method and device for a named data network, and aims to solve the technical problems of storage space and network communication bandwidth resource waste and low flow collection result effectiveness in the prior art.
[0006] To achieve the above purpose, the present application provides a network flow collection method for a named data network, which comprises the following steps:
[0007] When the obtained network packet is an interest packet, the interest packet is collected, and the interest packet is marked as collected;
[0008] When the obtained network packet is a data packet and the corresponding interest packet of the data packet is marked as collected, the data packet is collected;
[0009] Hash operation is performed on the content name of the obtained collection data, and the collection data is encapsulated according to the hash value to obtain a flow collection encapsulation result.
[0010] Optionally, before the collecting the interest packet and marking the interest packet as collected, the method further comprises:
[0011] determining whether the routing record in the network has been stored;
[0012] if not, performing a hash operation on a first content name of the routing record, obtaining a content name query interface and a content name data table composed of the first content name and a first hash value, and marking the routing record as stored.
[0013] Optionally, after the if not, performing a hash operation on a first content name of the routing record, obtaining a content name query interface and a content name data table composed of the first content name and a first hash value, the method further comprises:
[0014] when the network cache routing record is removed, determining whether the network cache routing record exists in the content name data table;
[0015] if not, receiving the network cache routing record and returning to the step of determining whether the network cache routing record has been stored.
[0016] Optionally, after the performing a hash operation on the content name of the obtained collection data and encapsulating the collection data according to the hash value to obtain a traffic collection encapsulation result, the method further comprises:
[0017] performing an analysis on the traffic collection encapsulation result to obtain a traffic collection result, and obtaining a first content name corresponding to the hash value in the traffic collection result according to the content name query interface and the content name data table.
[0018] Optionally, before the collecting the interest packet and marking the interest packet as collected, the method further comprises:
[0019] when the obtained network packet is an interest packet, determining whether the interest packet exists in a content cache table;
[0020] if not, determining whether the interest packet exists in a pending interest table;
[0021] if not, querying the interest packet in a forwarding information base table, collecting the interest packet, and marking the interest packet as collected in the forwarding information base table.
[0022] Optionally, before the if not, querying the interest packet in a forwarding information base table, collecting the interest packet, and marking the interest packet as collected in the forwarding information base table, the method further comprises:
[0023] If no, the interest packet is queried in a forwarding information base table, the interest packet is collected according to a preset collection rate, and the interest packet is marked as collected in the forwarding information base table.
[0024] Optionally, when the obtained network packet is a data packet and the interest packet corresponding to the data packet is marked as collected, the data packet is collected, including:
[0025] When the obtained network packet is a data packet, the interest packet corresponding to the data packet is queried in the pending interest table according to the content name of the data packet, and it is judged whether the interest packet has been collected;
[0026] If yes, the data packet is collected.
[0027] In addition, to achieve the above object, the application further provides a network traffic collection device for a named data network, which comprises:
[0028] An interest packet sampling module is configured to collect the interest packet when the obtained network packet is an interest packet, and mark the interest packet as collected.
[0029] A data packet sampling module is configured to collect the data packet when the obtained network packet is a data packet and the interest packet corresponding to the data packet is marked as collected.
[0030] A name conversion module is configured to perform a hash operation on the content name of the obtained collection data, and encapsulate the collection data according to the hash value to obtain a traffic collection encapsulation result.
[0031] In addition, to achieve the above object, the application further provides a network traffic collection device for a named data network, which comprises a memory, a processor and a network traffic collection program for a named data network stored in the memory and capable of running on the processor, wherein the network traffic collection program for a named data network is configured to implement the steps of the network traffic collection method for a named data network as described above.
[0032] In addition, to achieve the above object, the application further provides a storage medium, wherein the storage medium stores a network traffic collection program for a named data network, and the network traffic collection program for a named data network implements the steps of the network traffic collection method for a named data network as described above when executed by a processor.
[0033] In the present application, when the obtained network packet is an interest packet, the interest packet is collected and marked as collected; when the obtained network packet is a data packet and the interest packet corresponding to the data packet is marked as collected, the data packet is collected; the content name of the obtained collected data is subjected to a hash operation, and the collected data is encapsulated according to the hash value to obtain a traffic collection encapsulation result. Since the present application collects the interest packet and marks it as collected when the interest packet is obtained; collects the data packet when the data packet is obtained and the interest packet corresponding to the data packet is marked as collected, the complete user session information corresponding to the interest packet and the data packet can be collected; and the content name of the collected data is converted into a fixed-length hash value, thereby reducing the occupation of storage space and network communication bandwidth resources during traffic collection and improving the effectiveness of traffic collection. BRIEF DESCRIPTION OF DRAWINGS
[0034] Figure 1 is a structural schematic diagram of a network traffic collection device for a named data network of a hardware running environment related to the embodiment scheme of the present application.
[0035] Figure 2 is a flowchart of a first embodiment of the network traffic collection method for a named data network of the present application.
[0036] Figure 3 is a schematic diagram of an NDN network routing and forwarding model in the network traffic collection method for a named data network of the present application.
[0037] Figure 4 is a flowchart of a second embodiment of the network traffic collection method for a named data network of the present application.
[0038] Figure 5 is a schematic diagram of an extended field in the network traffic collection method for a named data network of the present application.
[0039] Figure 6 is a schematic diagram of a functional module logic architecture in the network traffic collection method for a named data network of the present application.
[0040] Figure 7 is a flowchart of a third embodiment of the network traffic collection method for a named data network of the present application.
[0041] Figure 8 is a structural block diagram of a first embodiment of the network traffic collection device for a named data network of the present application.
[0042] The implementation of the object of the present application, functional features and advantages will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION
[0043] It should be understood that the specific embodiments described herein are merely illustrative of the present application and should not be construed as limiting the present application.
[0044] With reference to Figure 1 , Figure 1 The network traffic collection device structure schematic diagram of the hardware running environment involved in the embodiment of the present application is shown in FIG. 1.
[0045] As Figure 1 shown, the network traffic collection device for the named data network can include a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between the components. The user interface 1003 can include a display screen, an input unit such as a keyboard, and can also include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a wireless fidelity (WI-FI) interface). The memory 1005 can be a high-speed random access memory (RAM), and can also be a stable non-volatile memory (NVM), such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0046] Those skilled in the art can understand Figure 1 that the structure shown in the foregoing is not a limitation on the network traffic collection device for the named data network, and can include more or fewer components than the diagram, or combine certain components, or different component arrangements.
[0047] As Figure 1 shown, the memory 1005 as a storage medium can include an operating system, a data storage module, a network communication module, a user interface module, and a network traffic collection program for the named data network.
[0048] In Figure 1The network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the network traffic collection device for the named data network can be arranged in the network traffic collection device for the named data network, the network traffic collection device for the named data network calls the network traffic collection program for the named data network stored in the memory 1005 through the processor 1001, and executes the network traffic collection method for the named data network provided in the embodiment of the application.
[0049] The embodiment of the application provides a network traffic collection method for a named data network. Figure 2 , Figure 2 The embodiment of the application provides a network traffic collection method for a named data network.
[0050] In the embodiment, the network traffic collection method for the named data network comprises the following steps.
[0051] Step S10: When the obtained network packet is an interest packet, the interest packet is collected, and the interest packet is marked as collected.
[0052] It should be noted that the execution subject of the method in the embodiment can be a computing service device with data processing, network communication and program running functions, for example, a mobile phone, a tablet computer, a personal computer and the like; or can be the network traffic collection device for the named data network with the same or similar functions. The network traffic collection device for the named data network will be taken as an example for description in the embodiment and the following embodiments.
[0053] It should be noted that the NDN network is a relatively mature one in the Information Center Networking (ICN) architecture system implementation project. The packet structure and table structure design of the NDN network are based on the publish / subscribe paradigm in the ICN, and information transmission is realized by using content. The NDN carries information required by a user through an interest packet, and performs forwarding based on the interest packet driving and routing rules.
[0054] For ease of understanding, the network traffic collection method for the named data network will be described below with reference to the accompanying drawings, but the description does not limit the present application. Figure 3 Figure 3 Fig. 1 is a schematic diagram of a routing and forwarding model for an NDN network. NDN can deliver signaling and store data through two packet structures, i.e., an interest packet (Interest) for requesting data information and a data packet (Data) for carrying data in the delivery process. It should be noted that the interest packet corresponds to the data packet, and if a target routing node receives an interest packet from a source routing node, when the target routing node has cached corresponding requested data, the routing encapsulates the corresponding data packet and returns the data packet to the requesting routing node along the path of the interest packet. The interest packet can be sent by the requester of data (i.e., the consumer), and thus NDN can be a consumer-driven communication architecture.
[0055] The routing mechanism in NDN can be based on three basic table structures: a content store (CS), a pending interest table (PIT), and a forwarding information base (FIB).
[0056] The CS table can be used to cache data information of users in the routing node.
[0057] The PIT table can be used to store the correspondence between received interest packets and interfaces, and the stored interest packets can be interest packets that have been forwarded but have not yet received corresponding data responses. When the corresponding response data is received, the corresponding interface can be obtained by querying the content name of the interest packet in the PIT table, which can be the interface that receives the request information, and then the response data packet is returned from the interface. If the routing node receives the same interest packet from the same node, only one interest packet information can be saved, so that repeated forwarding can be avoided. Through the pending interest table, the data packet can be transmitted in the reverse direction according to the forwarding path of the interest packet.
[0058] The FIB table can be used as a basis for routing and forwarding data packets. The FIB table identifies interest packets in the form of content name prefixes, and one content name prefix can correspond to one or more forwarding interfaces. The interest packet can query the potential location of the data packet according to the forwarding interface sequence in the FIB, and then the routing node forwards the interest packet from the interface, and along the corresponding path, the data packet can be forwarded to the router that caches the corresponding data packet. Since one content name prefix can correspond to multiple forwarding interfaces, one interest packet can be forwarded from multiple forwarding interfaces.
[0059] It can be understood that the CS table and the PIT table in the NDN routing can be extended, and the sFlow Flag collection field can be configured to indicate whether the data packet has been sampled by sFlow, wherein 0 can be used to represent that sFlow has not collected the data packet, and 1 can be used to represent that sFlow has collected the data packet. The field can be set to a default value of 0 to ensure that the initial state of any data packet is not collected, thereby avoiding collection omissions. Marking the interest packet as collected can be modifying the value of sFlow Flag to 1, setting the interface to which sFlow Flag is assigned, or calling a preset marking interface to modify the value of sFlow Flag to 1 after sampling the interest packet.
[0060] Step S20: When the obtained network packet is a data packet and the interest packet corresponding to the data packet is marked as collected, collecting the data packet.
[0061] It can be understood that, since the interest packet and the data packet are one-to-one corresponding, in order to ensure that complete user session records are collected, the interest packet can be directly collected, and if the received is a data packet, it can be judged according to the value of the sFlowFlag field whether the corresponding interest packet has been collected. If the corresponding interest packet has not been collected, the data packet is not collected, and if the corresponding interest packet has been collected, the data packet is collected.
[0062] Further, when collecting the data packet, considering the integrity of the session information, it is only necessary to query whether the corresponding interest packet is collected. In order to improve the efficiency of data collection, it is only necessary to query the pending interest table, and if the corresponding interest packet is collected, the data packet is collected. Therefore, the step S20 comprises: when the obtained network packet is a data packet, querying the interest packet corresponding to the data packet in the pending interest table according to the content name of the data packet, and judging whether the interest packet has been collected; if yes, collecting the data packet.
[0063] It can be understood that, since the interest packet recorded in the PIT table is an interest packet that has been forwarded but has not received a corresponding data response, when the data packet is received, it can be judged whether it is collected by querying the sFlow Flag value of the corresponding interest packet in the PIT table. If the sFlow Flag value is 1, the data packet is collected.
[0064] Step S30: Hashing the content name of the obtained collected data, and encapsulating the collected data according to the hash value to obtain a traffic collection encapsulation result.
[0065] It should be understood that the interest packet or data packet collected in the above steps can be parsed to obtain the corresponding content name. In the NDN network, the content name is the addressing method, and the content name is stored in the sFlow datagram to analyze user access behavior, but the content name can be short or long. Since the ICN network has rich content, the possibility of a long content name is greater. When sFlow expands the data field, if a certain field is too long and the length cannot be estimated, it will cause the related content name to be unable to be correctly intercepted. If the content name is truncated, the content name will be lost, and other random interception methods are not suitable for detailed traffic analysis work.
[0066] Therefore, the content name can be converted into a hash value by means of a hash function. Since the hash value converted by the hash function has the advantages of fixed length and short length, the collected data can be encapsulated according to the hash value, so as to save storage space and reduce network communication bandwidth when saving and transmitting data, and to balance the benefits and costs. The collected data can be encapsulated into an sFlow packet based on the sFlow protocol according to the pre-defined NDN Data data structure, to obtain a traffic collection encapsulation result. The traffic collection encapsulation result can also be sent to a traffic collection system for subsequent traffic analysis work.
[0067] In the embodiment, when the obtained network packet is an interest packet, the interest packet is collected and marked as collected; when the obtained network packet is a data packet and the interest packet corresponding to the data packet is marked as collected, the data packet is collected; the content name of the obtained collected data is subjected to a hash operation, and the collected data is encapsulated according to the hash value to obtain a traffic collection encapsulation result. Since the interest packet is collected and marked as collected when the interest packet is obtained in the embodiment, and the data packet is collected when the data packet is obtained and the interest packet corresponding to the data packet is marked as collected, complete user session information corresponding to the interest packet and the data packet can be collected; then the content name of the collected data is converted into a fixed-length hash value, thereby reducing the occupation of storage space and network communication bandwidth resources during traffic collection, and improving the effectiveness of traffic collection.
[0068] Reference Figure 4 , Figure 4 The flowchart of the second embodiment of the network traffic collection method for the named data network of the present application is shown.
[0069] Further, after converting the content name into a fixed-length hash value, the original content name also needs to be saved to avoid loss of the real content name. The content name in the NDN network that has not been collected by the routing record can be uniformly processed and saved. The content name and the hash value after hash processing are saved to the content name data table, and a content name query interface is provided to facilitate subsequent query of the real content name corresponding to the hash value of the collected data. Therefore, based on the first embodiment, before the step S10, the embodiment further includes:
[0070] Step S01: Determine whether the routing record in the network has been stored.
[0071] Step S02: If not, perform hash operation on the first content name of the routing record, obtain the content name query interface and the content name data table composed of the first content name and the first hash value, and mark the routing record as stored.
[0072] In order to avoid loss of the real content name in the collection process and save the original content name, a simple network management protocol (SNMP) combined with sFlow can be used for traffic collection.
[0073] It should be understood that the SNMP Flag field can be configured in the CS table and the PIT table, which is used to indicate whether the data packet is stored in the content name database table. The extension field of the CS table and the PIT table is referred to Figure 5 , Figure 5 The extension field of the network traffic collection method for the naming data network of the application is shown in the schematic diagram.
[0074] Among them, 0 can represent a newly added content name that is not stored in the content name database table, and the SNMP Agent has not sent the newly added content name. 1 can represent that the newly added name has been stored in the content name database table. The field can be set to a default value of 0 to ensure that the initial state of any data packet is not saved, avoiding saving omission.
[0075] Reference Figure 6 The traffic collection method of combining SNMP with sFlow is described, but does not constitute a limitation on the present scheme. Figure 6The figure is a schematic diagram of a logical architecture of a functional module in a network traffic collection method for a naming data network of the application. The original content name can be preserved using SNMP, and the SNMP routing collection process can be preset with a preset collection interval. In each preset collection interval, the SNMP Agent can collect the routing records in the CS table and the PIT table with an SNMP Flag of 0 (i.e., the newly added name routing table that has not been stored), and store the routing records in the SNMP manager information base (SNMP MIB). The SNMP Agent can also be provided with a marking module, which can include a marking interface for assigning a value to a newly added marking field.
[0076] It can be understood that a content name data table can be provided in the SNMP manager, which can store the content name and the converted hash value. In order to facilitate subsequent queries of the real content name according to the hash value, a content name query interface can also be provided, which can query the content name data table according to an input value and return the result, i.e., return the corresponding content name for the input hash value. The content name corresponding to the hash value can also be generated according to a preset hash function.
[0077] It should be understood that the SNMP manager can collect the newly added name routing table from the SNMP MIB, and perform an insertion operation of the content name data table for each routing record in the table. If the content name data table already stores the name, it is ignored; if it does not exist, a hash value corresponding to the content name is generated according to the preset hash function, and the content name and the hash value are stored in the table.
[0078] At the same time, the marking interface in the marking module described above can be called to modify the value of the SNMPFlag of the routing record in the CS table and the PIT table to 1, indicating that the routing record has been stored in the content name data table.
[0079] Further, considering that the NDN network may exist a case of removing the routing record in the cache, in order to avoid the routing record being removed before it is saved, it can be checked first whether the routing record exists in the content name data table. Therefore, after the step S02, the method further comprises: when the network cache routing record is removed, judging whether the network cache routing record exists in the content name data table; if not, receiving the network cache routing record, and returning to the step of judging whether the network cache routing record has been stored.
[0080] It can be understood that, when the cache record in the CS table is about to be removed but has not reached the time of the timed transmission, the value of the SNMP Flag of the routing record is checked, if the value is 0, the routing record is sent to the SNMP management station in the form of SNMP Trap, and the routing record is stored by the SNMP management station.
[0081] Further, after collecting network traffic, there is a need to query the real content name, such as interface display content name. Therefore, after obtaining the traffic collection result, the real content name corresponding to the hash value can be queried according to the content name data table. Therefore, after the step S02, the traffic collection encapsulation result is further parsed to obtain the traffic collection result, and the first content name corresponding to the hash value in the traffic collection result is obtained according to the content name query interface and the content name data table.
[0082] It can be understood that, after receiving the encapsulated traffic collection encapsulation result, the sFlow collector in the traffic collection system parses the traffic collection encapsulation result according to the above-mentioned pre-defined NDN Data structure, and obtains the traffic collection result including the hash value but not the real content name. When the traffic collection system needs the real content name, the content name query interface can be called according to the hash value, so that the content name query interface queries the real content name corresponding to the hash value according to the content name data table, and realizes the acquisition and storage of the content name.
[0083] In the embodiment, it is disclosed that whether the routing record in the network has been stored is judged, if not, the first content name of the routing record is subjected to a hash operation, the content name query interface and the content name data table composed of the first content name and the first hash value are obtained, and the routing record is marked as stored. Since the first content name of the routing record not collected is subjected to a hash operation in the embodiment, the content name query interface and the content name data table composed of the first content name and the first hash value are obtained, thereby saving the original content name and avoiding the loss of the real content name, so as to facilitate the subsequent query of the real content name corresponding to the hash value of the collected data.
[0084] Reference Figure 7 , Figure 7 The flowchart of the third embodiment of the network traffic collection method for the named data network of the present application is shown.
[0085] Further, in order to make the traffic collection more accurate, the interest packet can be sequentially queried according to the table structure of the NDN network, and the interest packet is marked as collected in the table where the interest packet is located, so as to determine whether the corresponding interest packet is sampled when the data packet is sampled, and the integrity and accuracy of the session are ensured. Therefore, based on the first embodiment, in the present embodiment, the step S10 further comprises:
[0086] Step 101: When the obtained network packet is an interest packet, it is determined whether the interest packet exists in the content cache table.
[0087] Step 102: If not, it is determined whether the interest packet exists in the pending interest table.
[0088] Step 103: If not, the interest packet is queried in the forwarding information base table, the interest packet is collected, and the interest packet is marked as collected in the forwarding information base table.
[0089] It can be understood that the interest packet sampling can be querying the CS table first, if the CS cache table has the content, the sFlow Flag of the routing record in the table is set to 1, indicating that it has been sampled; if the CS table does not have the content, the PIT table is queried, if the PIT table has the content, the sFlow Flag of the routing record in the PIT table is set to 1, indicating that it has been sampled; if the PIT table does not have the content, the FIB table is queried, if the FIB table has the forwarding path of the content, the forwarding path is added to the PIT table, and the sFlow Flag of the corresponding record in the PIT table is set to 1, indicating that it has been sampled.
[0090] Further, considering that if the interest packet and the data packet are not distinguished, and a collection rate is uniformly set, the following situation may occur: for example, the interest packet requesting content A is collected, but the data packet of content A is not collected, so that the traffic analysis cannot analyze the specific behavior of the user. Therefore, the collection rate can be set only for the interest packet, and not for the data packet, so as to ensure that complete user session information is collected, which is beneficial to effective traffic analysis results in the later period. Therefore, the step 103 further comprises: if not, the interest packet is queried in the forwarding information base table, the interest packet is collected according to the preset collection rate, and the interest packet is marked as collected in the forwarding information base table.
[0091] It should be understood that when the received packet is an interest packet, a collection rate S (S is an integer) can be set, and the initial value of the counter is set to S. The received interest packet is counted by the counter minus 1 operation, and when the counter is 0, the interest packet is sampled.
[0092] It should be noted that the collection rate can be set only when the interest packet is received, and the collection rate is not set when the data packet is received.
[0093] In the embodiment, when the obtained network packet is an interest packet, it is judged whether the interest packet exists in the content cache table; if not, it is judged whether the interest packet exists in the pending interest table; if not, the interest packet is queried in the forwarding information base table, and the interest packet is collected, and the interest packet is marked as collected in the forwarding information base table. Since the interest packet is collected according to the table structure of the NDN network in the embodiment, the interest packet is sequentially queried, and the interest packet is marked as collected in the table where the interest packet is located, thereby improving the accuracy of traffic collection.
[0094] In addition, the embodiment of the present application further provides a storage medium, and the storage medium stores a network traffic collection program for a named data network. The network traffic collection program for the named data network is executed by a processor to realize the steps of the network traffic collection method for the named data network.
[0095] Referring to Figure 8 , Figure 8 FIG. 1 is a structural block diagram of a network traffic collection device for a named data network according to a first embodiment of the present application.
[0096] As shown in Figure 8 , the network traffic collection device for the named data network comprises:
[0097] An interest packet sampling module 801 is configured to collect the interest packet when the obtained network packet is an interest packet, and mark the interest packet as collected.
[0098] A data packet sampling module 802 is configured to collect the data packet when the obtained network packet is a data packet and the interest packet corresponding to the data packet is marked as collected.
[0099] A name conversion module 803 is configured to perform a hash operation on the content name of the obtained collected data, and encapsulate the collected data according to the hash value to obtain a traffic collection encapsulation result.
[0100] The embodiment collects and marks the interest packet as collected when the interest packet is acquired; collects the data packet when the data packet is acquired and the interest packet corresponding to the data packet is marked as collected; performs a hash operation on the content name of the obtained collected data, and encapsulates the collected data according to the hash value to obtain a traffic collection encapsulation result. Since the embodiment collects the interest packet and marks the interest packet as collected when the interest packet is acquired; collects the data packet when the data packet is acquired and the interest packet corresponding to the data packet is marked as collected, the complete user session information corresponding to the interest packet and the data packet can be collected; and the content name of the collected data is converted into a fixed-length hash value, thereby reducing the occupation of storage space and network communication bandwidth resources during traffic collection, and improving the effectiveness of traffic collection.
[0101] Based on the first embodiment of the network traffic collection device for a named data network, the second embodiment of the network traffic collection device for a named data network is provided.
[0102] In the embodiment, the interest packet sampling module 801 is further configured to determine whether the routing record in the network has been stored; if not, perform a hash operation on the first content name of the routing record, obtain a content name query interface and a content name data table composed of the first content name and a first hash value, and mark the routing record as stored.
[0103] As an implementation form, the interest packet sampling module 801 is further configured to, when the network cache routing record is removed, determine whether the network cache routing record exists in the content name data table; if not, receive the network cache routing record, and return to the step of determining whether the network cache routing record has been stored.
[0104] As an implementation form, the interest packet sampling module 801 is further configured to analyze the traffic collection encapsulation result to obtain a traffic collection result, and obtain the first content name corresponding to the hash value in the traffic collection result according to the content name query interface and the content name data table.
[0105] As an implementation form, the interest packet sampling module 801 is further configured to, when the acquired network packet is an interest packet, determine whether the interest packet exists in the content cache table; if not, determine whether the interest packet exists in the pending interest table; if not, query the interest packet in the forwarding information base table, collect the interest packet, and mark the interest packet as collected in the forwarding information base table.
[0106] As an implementation form, the interest packet sampling module 801 is further configured to, if no, query the interest packet in a forwarding information base table, collect the interest packet according to a preset collection rate, and mark the interest packet as collected in the forwarding information base table.
[0107] As an implementation form, the data packet sampling module 803 is further configured to, when the obtained network packet is a data packet, query the interest packet corresponding to the data packet in the pending interest table according to the content name of the data packet, and determine whether the interest packet has been collected; if yes, collect the data packet.
[0108] Other embodiments or specific implementations of the network traffic collection device for named data networking can refer to the above-mentioned method embodiments, which will not be described here again.
[0109] It should be noted that in this document, the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such a process, method, article or system. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of another identical element in the process, method, article or system including the element.
[0110] The above-mentioned embodiment numbers of the present application are only for description, not representing the advantages and disadvantages of the embodiments.
[0111] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and necessary general hardware platforms, of course, they can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, an optical disk) as described above, and includes a plurality of instructions for making a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in various embodiments of the present application.
[0112] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent flow transformation made by using the content of the present application specification and drawings, or directly or indirectly applied to other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for collecting network traffic for named data networks, characterized in that, The method includes the following steps: When the acquired network packet is an interest packet, the interest packet is collected and marked as collected; When the obtained network packet is a data packet and the interest packet corresponding to the data packet is marked as collected, the data packet is collected; The content name of the acquired data is hashed, and the acquired data is encapsulated according to the hash value to obtain the traffic acquisition encapsulation result; The traffic collection encapsulation result is parsed to obtain the traffic collection result, and the first content name corresponding to the hash value in the traffic collection result is obtained according to the content name query interface and the content name data table; Before collecting the interest packet and marking it as collected when the acquired network packet is an interest packet, the method further includes: Determine whether routing records in the network have already been stored; If not, perform a hash operation on the first content name of the routing record to obtain a content name query interface and a content name data table consisting of the first content name and the first hash value, and mark the routing record as stored; When a network cached route record is removed, determine whether the network cached route record exists in the content name data table; If not, the network cached routing record is received, and the step of determining whether the network cached routing record has been stored is returned.
2. The method as described in claim 1, characterized in that, When the acquired network packet is an interest packet, the process of collecting the interest packet and marking it as collected includes: When the obtained network packet is an interest packet, determine whether the interest packet exists in the content cache table; If not, determine whether the interest package exists in the undetermined interest table; If not, then query the interest packet in the forwarding information database table, collect the interest packet, and mark the interest packet as collected in the forwarding information database table.
3. The method as described in claim 2, characterized in that, If not, then the interest packet is queried from the forwarding information database table, the interest packet is collected, and the interest packet is marked as collected in the forwarding information database table, including: If not, the interest packet is queried in the forwarding information database table, the interest packet is collected according to the preset collection rate, and the interest packet is marked as collected in the forwarding information database table.
4. The method as described in claim 1, characterized in that, When the acquired network packet is a data packet and the interest packet corresponding to the data packet is marked as collected, the data packet is collected, including: When the network packet obtained is a data packet, the interest packet corresponding to the data packet is queried in the pending interest table according to the content name of the data packet, and it is determined whether the interest packet has been collected. If so, the data packet is collected.
5. A network traffic acquisition device for named data networks, characterized in that, The device includes: The interest packet sampling module is used to collect the interest packet when the acquired network packet is an interest packet, and mark the interest packet as collected; The data packet sampling module is used to collect the data packet when the obtained network packet is a data packet and the interest packet corresponding to the data packet is marked as collected; The name conversion module is used to perform a hash operation on the content name of the acquired data and encapsulate the acquired data according to the hash value to obtain the traffic acquisition encapsulation result. The name conversion module is also used to parse the traffic collection encapsulation result to obtain the traffic collection result, and to obtain the first content name corresponding to the hash value in the traffic collection result according to the content name query interface and the content name data table; The interest packet sampling module is also used to determine whether a routing record in the network has been stored; if not, a hash operation is performed on the first content name of the routing record to obtain a content name query interface and a content name data table composed of the first content name and the first hash value, and the routing record is marked as stored. The interest packet sampling module is further configured to determine whether the network cached routing record exists in the content name data table when the network cached routing record is removed; if not, it receives the network cached routing record and returns to the step of determining whether the network cached routing record has been stored.
6. A network traffic acquisition device for named data networks, characterized in that, The device includes: a memory, a processor, and a network traffic acquisition program for named data networks stored in the memory and executable on the processor, the network traffic acquisition program for named data networks being configured to implement the steps of the network traffic acquisition method for named data networks as described in any one of claims 1 to 4.
7. A storage medium, characterized in that, The storage medium stores a network traffic acquisition program for named data networks, which, when executed by a processor, implements the steps of the network traffic acquisition method for named data networks as described in any one of claims 1 to 4.
Citation Information
Patent Citations
NDN routing table establishing and searching method based on Bloom filter
CN115967675A