CN114745440B - CCN cache replacement method and device - Google Patents

CCN cache replacement method and device Download PDF

Info

Publication number
CN114745440B
CN114745440B CN202210229532.7A CN202210229532A CN114745440B CN 114745440 B CN114745440 B CN 114745440B CN 202210229532 A CN202210229532 A CN 202210229532A CN 114745440 B CN114745440 B CN 114745440B
Authority
CN
China
Prior art keywords
node
content
data packet
nodes
cache
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210229532.7A
Other languages
Chinese (zh)
Other versions
CN114745440A (en
Inventor
郭永安
姚天辰
孙洪波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Posts and Telecommunications
Original Assignee
Nanjing University of Posts and Telecommunications
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing University of Posts and Telecommunications filed Critical Nanjing University of Posts and Telecommunications
Priority to CN202210229532.7A priority Critical patent/CN114745440B/en
Publication of CN114745440A publication Critical patent/CN114745440A/en
Application granted granted Critical
Publication of CN114745440B publication Critical patent/CN114745440B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions

Abstract

The invention provides a CCN cache replacement method and a device, which are characterized in that a DBSCAN clustering algorithm is improved, network nodes in the CCN are divided into different autonomous areas through three parameters of a scanning radius L, a minimum point number and a content cache diversity set value D, each autonomous area selects a core node, the obtained content name of a data packet is calculated through a hash algorithm, so that the position of the node cached in each autonomous area is determined, and whether the data packet is cached in a cache node is determined through comprehensive content popularity. The method can effectively solve the problem of more cache redundancy in the CCN, improves the cache diversity and avoids the replacement of high-popularity content by low-popularity content during cache replacement.

Description

CCN cache replacement method and device
Technical Field
The invention relates to a CCN cache replacement method and device, and belongs to the technical field of content center networks.
Background
The Internet (Internet), also known as the international network, is generally referred to as a vast network of networks connected by a set of common protocols, thereby forming a single, vast global network. It was one of the most historically great inventions for humans, originating from the apanet (Advanced Research Project Agency Network, ARPAnet) proposed in 1969 in the united states, originally applied to military scenarios, it was the first network to enable packet switching, but also the first network to use TCP/IP as a communication protocol. The TCP/IP protocol is based on the position of network topology to construct end-to-end connection, and transmits IP data packets through nodes in the network to realize data transmission on the physical links of the bottom layer, because the TCP/IP protocol has simple and standard unified characteristics on the design of data frames, and meanwhile, the model is simplified through the idea of network layering, the communication and interconnection are realized through the heterogeneous network, and furthermore, the TCP/IP network system architecture designed through the idea is very suitable for the requirement of network interconnection in that year, and has no fundamental change for over 50 years, thereby becoming the foundation stone of the current Internet.
Along with the influence of the internet on the daily life of people and the rapid development of scientific technology, the number and scale of applications in the internet are greatly beyond the estimated design time, and the current internet is full of various repeated contents such as pictures, audios and videos, files and the like, so that the link utilization rate of a framework with a host interconnection as a center is greatly reduced. With the rapid development of internet information services, the design concept of the internet just started is no longer suitable for the current upper application requirements. The internet was designed for the end-to-end application, and then only improves the network topology and the network scale, but does not deviate from the end-to-end connection framework, and only uses the IP address to distinguish the terminal, so as to complete the data forwarding without considering the transmitted content. Therefore, the communication architecture with the communication host as a center and the location as an addressing mode can no longer provide support for the internet service which is rapidly developed at present.
The content centric network (Content Centric Network, CCN) and the named data network (Named Data Network, NDN) are secure and reliable future network architectures proposed by the lack of security and reliability of data transmission of the current network.
The named data networking NDN project is related research performed on the basis of the network architecture of the content-centric networking CCN. Therefore, CCN and NDN are actually the same network architecture. The project is mainly to verify whether the network architecture can be used as a future internet architecture through network security, trust model, content distribution, expandability and other aspects. The network architecture is proposed according to the mismatch between the requirements of the current network, which mainly issue and request content information, and the current end-to-end network communication mode based on the TCP/IP protocol.
When a user requests a certain content information, the user only needs to request the name of the content, and does not need to know the specific position of the content information, so that the separation of the content information and the network address is completed, and the problem of mobility of the traditional TCP/IP protocol is solved. CCN is a mechanism that performs routing addressing by the name of content information, and has multiple interfaces for forwarding to the same content name, so that it also has multicast and broadcast functions. In addition, the nodes in the network can also cache the content information requested by the user, and when the user or other users have demands for the content, the content information can be directly obtained from the nodes in which the related content information is cached, so that the time delay of content acquisition is reduced to the greatest extent. The CCN may also sign the content in the data packet, thereby enhancing the security of the content information. In addition, the CCN can dynamically select communication connection in an unstable network environment, so that network congestion is reduced, and the advantage of multiple communication links is better exerted. Therefore, CCN has great advantages in terms of content acquisition delay, security, flow control, and security.
CCN is one of the most likely new network systems to replace TCP/IP by using a Content name instead of the address name of the host as a unique identifier, using a data block (Content Chunk) instead of the "thin waist" position of the IP protocol stack, and caching copies of the Content throughout the network. The content demander can acquire the needed content from the cache of any node in the network without requesting the content provider, so that the copy of the content cached in the network is fully utilized to improve the transmission efficiency. The network transmission of CCN is driven by a content request, a content demander requests Data from a content provider by sending an Interest packet (Interest), and the content provider or a node in the network that has cached the relevant content returns a Data packet (Data) to the content demander through a reverse path, thereby completing the communication of the Data.
In a content centric network, the cache placement algorithm employed by default is a ubiquitous cache algorithm (Leave Copy Everywhere, LCE) that caches copies of the content of a data packet in all nodes in the path that the data packet traverses back to the user. The implementation process of the algorithm is simpler, a plurality of nodes in the network are cached with copies of certain content, and the requirement on the certain content can be responded quickly. However, the repeated content copies cached in the same network become more, which results in a great amount of redundancy of the content in the network, and the increase of redundancy results in the increase of the user data acquisition delay and the decrease of the node cache hit rate, so that the cache which is a very important feature in the content center network cannot exert its function to the maximum extent. In addition, in the content centric network, the cache replacement algorithm employed by default is a least recently used replacement algorithm (Least Recently Used, LRU) whose replacement criteria is based on the time that a copy of content has elapsed since it was last requested, and if a copy of content in a node has not been requested longer, it is more easily replaced by a new copy of content cache. The algorithm evaluates the content cache copy through the concept of time, the implementation process is simpler, but if a certain content copy with high popularity is not requested for a period of time, the content copy with low popularity can be replaced, so that the cache hit rate is reduced.
Disclosure of Invention
The invention aims to overcome the defects in the prior art and provides a CCN cache replacement method and a CCN cache replacement device, which can reduce the time delay of a user content request, reduce the cache content redundancy among nodes and improve the cache hit rate.
In order to achieve the above purpose, the invention is realized by adopting the following technical scheme:
in a first aspect, the present invention provides a CCN cache replacement method, including the steps of:
clustering nodes in the network to form a plurality of autonomous areas; selecting a core node from the nodes of each autonomous region, wherein the core node is responsible for counting the content information cached in each node in the autonomous region, and uniformly caching content copies in each node in the autonomous region;
receiving an interest packet sent by a user, searching in each control area, generating a data packet when the interest packet reaches a source server or some other node which caches the content required by the interest packet, and processing the data packet;
and returning the data packet to the user, and performing buffer replacement of the data packet.
Further, the method of clustering nodes in a network to form a plurality of autonomous areas includes partitioning based on an improved DBSCAN clustering algorithm;
The method for dividing the nodes in the content center network into different autonomous areas based on the improved DBSCAN clustering algorithm comprises the following steps:
step 1, randomly selecting a node m from all nodes in a network;
step 2, acquiring set algorithm parameters, wherein the set algorithm parameters comprise a scanning radius L, minimum included point minPts and a content cache diversity set value D; judging the number of nodes with content cache diversity of other nodes within the range from the selected node m to the scanning radius L of the node m not more than D according to the set algorithm parameters, if the content cache diversity is not less than the minimum inclusion point minPts, the node is a core point, and then adding the core point and the nodes into an autonomous region;
step 3, calculating whether other nodes of the non-core points in the autonomous region are core points, and if the other nodes are the core points, adding the core points and the nodes meeting the conditions into the autonomous region above;
step 4, repeating the step 3 until no node is satisfied as a core point;
step 5, a node which is not accessed is selected randomly again, and the steps 2-4 are repeated;
step 6, after all nodes are accessed, if all nodes join an autonomous area, the clustering algorithm is ended; if nodes still remain and are not added into the autonomous region, the nodes which are not added into the autonomous region form a new sample data set;
And 7, updating new algorithm parameters, and repeating the steps 2-7 according to a new sample data set of the new algorithm parameters until all nodes are added into the autonomous region.
Further, the method for updating the new algorithm parameters comprises the following steps: the scan radius is set to be twice the original scan radius, the minimum inclusion point is set to be half of the original minimum inclusion point, and the content cache diversity setting value is set to be twice the original content cache diversity setting value.
Further, the method for selecting a core node from the nodes of each autonomous region includes: after the clustering is completed, the core node in each autonomous region selects a node located in the middle of the autonomous region as a core node.
Further, the method for receiving the interest packet sent by the user, searching in each control area, generating and processing the data packet when the interest packet arrives at the source server or some other node which caches the content required by the interest packet comprises the following steps:
receiving and reading an interest packet sent by a user, and acquiring a requested content object;
encapsulating the requested content object into a data packet;
calculating a Hash Value corresponding to the name of the requested content object through a Hash algorithm, and then writing the Hash Value into a Hash Value field in a data packet;
Inquiring a content Popularity record table CPRT of the node, finding out the comprehensive content Popularity of the current time period corresponding to the content, and writing the Value into a polarity Value field in a data packet;
and writing the name of the Core Node in the autonomous area to which the Node belongs into the Core Node field of the data packet.
Further, the method for sending the data packet back to the user and performing cache replacement of the data packet comprises the following steps: the data packet is returned to a user, whether cache replacement is carried out on the content in the data packet is determined by comprehensively calculating the popularity of the node content in the previous time period and the current time period, and the method comprises the following steps:
step A, forwarding the data packet to a user along port information recorded in a PIT table;
step B, the node which receives the data packet in the forwarding process checks whether the CN field of the node is the same as the CN field of the data packet to judge whether to enter a new autonomous area; if the two types of the images are different, the step C is carried out, otherwise, the step D is carried out;
step C, the node writes the CN field of the data packet into the CN field of the data packet, and inquires the area content cache table ACCT of the core node in the autonomous area where the node is located whether the content is cached by the node in the autonomous area, if yes, the data packet is forwarded to the user according to the PIT table, and the step B is entered, otherwise, the step E is entered;
Step D, forwarding the data packet to the user according to the PIT table, and entering the step B;
step E, calculating a caching sequence value C of the content name in the data packet in the autonomous region, finding out a node with the same sequence number field SN in the autonomous region, if the caching space of the node is still free, directly caching the content in the data packet in the node, then entering step D, and if the caching space is not free, entering step F;
step F, comparing the Value of the Value field of the polarity of the data packet with the Value of the lowest comprehensive content Popularity in the current time period in the content Popularity record table in the node, if the Value of the PV field of the data packet is higher than the Value of the lowest comprehensive content Popularity in the current time period, replacing the content in the data packet with the content corresponding to the lowest Value in the table in the cache space, otherwise, entering the step G;
and G, not caching the content in the node, orderly inquiring whether the cache replacement requirement is met according to the storage space utilization rate from small to large by all nodes in the one-hop range of the node, if so, carrying out the cache replacement, and if not, not caching the content in the autonomous region, and entering the step B.
In a second aspect, the present invention provides a CCN cache replacement apparatus, including the steps of:
clustering and partitioning module: the method comprises the steps of clustering nodes in a network to form a plurality of autonomous areas; selecting a core node from the nodes of each autonomous region, wherein the core node is responsible for counting the content information cached in each node in the autonomous region, and uniformly caching content copies in each node in the autonomous region;
and a search module: the method comprises the steps of receiving interest packets sent by users, searching in each control area, generating data packets when the interest packets arrive at a source server or some other node which caches the content required by the interest packets, and processing the data packets;
and a cache replacement module: and the data packet is returned and sent to the user, and the buffer memory of the data packet is replaced.
Further, the method for clustering nodes in the network by the clustering partition module to form a plurality of autonomous areas includes the following steps:
step 1, randomly selecting a node m from all nodes in a network;
step 2, acquiring set algorithm parameters, wherein the set algorithm parameters comprise a scanning radius L, minimum included point minPts and a content cache diversity set value D; judging the number of nodes with content cache diversity of other nodes within the range from the selected node m to the scanning radius L of the node m not more than D according to the set algorithm parameters, if the content cache diversity is not less than the minimum inclusion point minPts, the node is a core point, and then adding the core point and the nodes into an autonomous region;
Step 3, calculating whether other nodes of the non-core points in the autonomous region are core points, and if the other nodes are the core points, adding the core points and the nodes meeting the conditions into the autonomous region above;
step 4, repeating the step 3 until no node is satisfied as a core point;
step 5, a node which is not accessed is selected randomly again, and the steps 2-4 are repeated;
step 6, after all nodes are accessed, if all nodes join an autonomous area, the clustering algorithm is ended; if nodes still remain and are not added into the autonomous region, the nodes which are not added into the autonomous region form a new sample data set;
and 7, setting the scanning radius to be twice the original scanning radius, setting the minimum inclusion point to be half of the original minimum inclusion point, setting the content cache diversity setting value to be twice the original content cache diversity setting value, and repeating the steps 2-7 according to the new sample data set of the new algorithm parameter until all nodes are added into the autonomous region.
Further, the searching module receives an interest packet sent by a user, searches in each control area, and when the interest packet arrives at a source server or some other node which caches the content required by the interest packet, the method for generating and processing the data packet comprises the following steps:
Receiving and reading an interest packet sent by a user, and acquiring a requested content object;
encapsulating the requested content object into a data packet;
calculating a hash value corresponding to the name of the requested content object through a hash algorithm, and then writing the hash value into a HashValue field in a data packet;
inquiring a content Popularity record table CPRT of the node, finding out the comprehensive content Popularity of the current time period corresponding to the content, and writing the Value into a polarity Value field in a data packet;
and writing the name of the Core Node in the autonomous area to which the Node belongs into the Core Node field of the data packet.
Further, the method for cache replacement of the data packet by the cache replacement module returns the data packet to a user, and the method comprises the following steps: the data packet is returned to a user, whether cache replacement is carried out on the content in the data packet is determined by comprehensively calculating the popularity of the node content in the previous time period and the current time period, and the method comprises the following steps:
step A, forwarding the data packet to a user along port information recorded in a PIT table;
step B, the node which receives the data packet in the forwarding process checks whether the CN field of the node is the same as the CN field of the data packet to judge whether to enter a new autonomous area; if the two types of the images are different, the step C is carried out, otherwise, the step D is carried out;
Step C, the node writes the CN field of the data packet into the CN field of the data packet, and inquires the area content cache table ACCT of the core node in the autonomous area where the node is located whether the content is cached by the node in the autonomous area, if yes, the data packet is forwarded to the user according to the PIT table, and the step B is entered, otherwise, the step E is entered;
step D, forwarding the data packet to the user according to the PIT table, and entering the step B;
step E, calculating a caching sequence value C of the content name in the data packet in the autonomous region, finding out a node with the same sequence number field SN in the autonomous region, if the caching space of the node is still free, directly caching the content in the data packet in the node, then entering step D, and if the caching space is not free, entering step F;
step F, comparing the Value of the Value field of the polarity of the data packet with the Value of the lowest comprehensive content Popularity in the current time period in the content Popularity record table in the node, if the Value of the PV field of the data packet is higher than the Value of the lowest comprehensive content Popularity in the current time period, replacing the content in the data packet with the content corresponding to the lowest Value in the table in the cache space, otherwise, entering the step G;
And G, not caching the content in the node, orderly inquiring whether the cache replacement requirement is met according to the storage space utilization rate from small to large by all nodes in the one-hop range of the node, if so, carrying out the cache replacement, and if not, not caching the content in the autonomous region, and entering the step B.
In a third aspect, the present invention provides a CCN cache replacement apparatus, including a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method of the first aspect.
Compared with the prior art, the invention has the beneficial effects that: the algorithm firstly clusters nodes in a network according to minimum included points, path length and content diversity to form autonomous areas, then selects a core node from the nodes of each autonomous area, the core node is responsible for counting content information cached in each node in the autonomous area, in order to prevent a certain node in the autonomous area from constantly caching and replacing content, lightens the load of the node, uniformly caches content copies in each node in the autonomous area, performs hash calculation on the content name of a data packet, so as to select proper nodes in each autonomous area for caching, and comprehensively calculates the content popularity of the node in the previous time period and the current time period to determine whether to cache and replace the content in the data packet. The algorithm has good improvement in terms of reducing the time delay of user content request, reducing the redundancy of cache content among nodes and improving the cache hit rate. Compared with the prior art, the method has the following specific advantages:
(1) Reducing the time delay of the content request, namely the time interval from sending out interest packets to receiving corresponding data packets by a user;
(2) Cache content redundancy among nodes is reduced;
(3) The ratio of the hit rate of the cache, i.e. the hit content of the interesting package on the node cache and the quantity of the interesting package sent by the user, is improved.
Drawings
FIG. 1 is a diagram of a packet format according to the present invention;
FIG. 2 is a diagram illustrating a content popularity record table (Content popularity record table, CPRT) of the present invention;
FIG. 3 is a diagram illustrating an area content cache table (Area content cache table, ACCT) according to the present invention
FIG. 4 is a flowchart of a cache replacement algorithm according to the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings. The following examples are only for more clearly illustrating the technical aspects of the present invention, and are not intended to limit the scope of the present invention.
Embodiment one:
the present embodiment proposes a CCN cache replacement algorithm (Cache replacement based on comprehensive content popularity and hash calculation, NCPHC). In CCN, each network node has a Content Store (CS) for caching various copies of Content in the network, from which a user first queries when the user has a Content demand; each network node also has a pending interest table (Pending Interest Table, PIT) for recording the unresponsive interest packets and their corresponding forwarding ports, and for querying the table when the packets are returned; finally, each network node also has a forwarding information base (Forwarding Information Base, FIB) similar to the routing tables in TCP/IP networks for forwarding packets of interest. The caching mechanism is a very important function in CCN network architecture. After the CCN network node receives an interest packet of a certain content sent by a user, firstly checking whether a content object requested by the interest packet exists in a local content cache, and if the corresponding content object exists, packaging the content object into a data packet and sending the data packet to the user along a path, so that the time delay of the user for obtaining the content information can be reduced to the greatest extent; if there is no corresponding copy of the content in the CS table of the network node, the interest packet is forwarded to the next hop routing node according to the port information in the FIB table, and the step is continued until the requested content object is obtained. If the content needed by the interesting package in the node is available, the corresponding content is packaged into a data package and sent to the user in the original path according to the requested path. Each network node receiving the data packet can query whether the local CS table has the corresponding content object in the data packet, if so, the network node does not do any processing, otherwise, the network node caches the content object in the CS of the network node, so that the next incoming content request can be satisfied. So this caching mechanism is also referred to as a "pass-by-cache" mechanism, and will cache copies of content in its CS regardless of whether the copies of content cached by routing nodes in the network may bring gain to the network caching system. The cache replacement algorithm is used as a very important research point in the content center network, the quality of the cache replacement algorithm can greatly influence the data acquisition time delay of the content center network and the cache hit rate in the nodes, and whether resources in the network can be saved and whether the user experience is influenced is also determined.
The algorithm firstly clusters nodes in a network according to minimum included points, path length and content diversity to form autonomous areas, then selects a core node from the nodes of each autonomous area, the core node is responsible for counting content information cached in each node in the autonomous area, in order to prevent a certain node in the autonomous area from constantly caching and replacing content, lightens the load of the node, uniformly caches content copies in each node in the autonomous area, performs hash calculation on the content name of a data packet, so as to select proper nodes in each autonomous area for caching, and comprehensively calculates the content popularity of the node in the previous time period and the current time period to determine whether to cache and replace the content in the data packet. The algorithm has good improvement in terms of reducing the time delay of user content request, reducing the redundancy of cache content among nodes and improving the cache hit rate.
The clustering algorithm adopted in the NCPHC algorithm provided by the embodiment is an improvement on the DBSCAN clustering algorithm, and the improved algorithm needs three algorithm parameters, namely a scanning radius L, a content cache diversity set value D and a minimum inclusion point minPts. The application in the content center network is that firstly, randomly selecting a node and calculating the value of the content cache diversity from the node to other nodes in a scanning radius L, then counting the number of nodes which are not more than a content cache diversity set value D, if the number is not less than the minimum containing point minPts, the node is a core point, the nodes which meet the content cache diversity requirement in the scanning radius can form an autonomous area, then, calculating whether the nodes meet the core point requirement, so as to select whether to add the autonomous area, and then repeating the steps until all the nodes are accessed. Finally, in order to add all nodes into an autonomous region, the nodes which are not added into the autonomous region carry out the steps again by using new algorithm parameters. After the clustering is completed, the core node in each autonomous region selects a node located in the middle of the autonomous region as the core node of the region.
The NCPHC algorithm provided by the embodiment specifically comprises the following steps:
step1, after nodes in the content center network are divided into different autonomous areas based on the improved DBSCAN clustering algorithm, core nodes are selected and CN fields are allocated to each node.
Step2, when the interest packet sent by the user reaches the source server or some other node which caches the specific content, discarding the interest packet.
Step3, packaging the requested content object into a data packet.
Step4, calculating a Hash Value corresponding to the content through a Hash algorithm, and then writing the Hash Value into a Hash Value field in the data packet.
Step5, inquiring a content Popularity record table CPRT of the node, finding out comprehensive content Popularity of the current time period corresponding to the content, and writing the Value into a Popularity Value field in the data packet.
Step6, writing the name of the Core Node in the autonomous area to which the Node belongs into the Core Node field of the data packet.
Step7, when the data packet is forwarded to the user along the port information recorded in the PIT table.
Step8, the node checks whether the CN field of the node is the same as the CN field of the data packet in the forwarding process to judge whether to enter a new autonomous region.
Step9, when the node finds that the CN field of the data packet is different from the CN field of the node, the node writes the CN field of the node into the CN field of the data packet.
Step10, inquiring whether the content is cached by the nodes in the autonomous area or not from an area content cache table ACCT of the core nodes in the autonomous area, and if the content is cached correspondingly, directly forwarding the interest packet to the user according to the PIT table.
Step11, if no corresponding cache exists, calculating a cache sequence value C of the content name in the data packet in the autonomous region, finding out a node with the same sequence number field SN in the autonomous region, if the cache space of the node is still free, directly caching the content in the data packet in the node,
step12, if the cache space of the node has no space, comparing the Value of the Value field of the polarity of the data packet with the Value of the lowest integrated content Popularity in the current time period in the content Popularity record table in the node, if the Value of the PV field of the data packet is higher than the Value of the lowest integrated content Popularity in the current time period, replacing the content in the data packet with the content corresponding to the lowest Value in the table in the cache space,
step13, if not, the content is not cached in the node, but all nodes within the one-hop range of the node are orderly inquired according to the utilization rate of the storage space from small to large, whether the requirement of cache replacement is met or not is sequentially inquired, if yes, cache replacement is carried out, the subsequent nodes are not inquired any more, and if not, the content is not cached in the autonomous area.
The format of the data packet is modified in this embodiment as shown in fig. 1 below. And adding a HashValue (HV) field, a Core Node (CN) field and a Polarity Value (PV) field into the original message format of the data packet.
The Core Node field of the data packet is written by the Node in the Core Node name of the autonomous region where the Node is located, so as to judge whether the data packet reaches different autonomous regions. When the Node finds that the Core Node field in the data packet is the same as the Core Node field of the Node, it indicates that the data packet has executed a cache replacement algorithm in the autonomous region, when the Node finds that the Core Node field in the data packet is different from the Core Node field of the Node, it indicates that the data packet just reaches the autonomous region and does not execute cache replacement, the Core Node field of the Node is written into the Core Node field of the data packet, and then it is determined whether to cache the content and the Node position of the content according to the Hash Value field in the data packet message.
The Value of the Hash Value field of the Data packet is the Content Name field in the extracted interest packet, and the Content Name field is written into the Hash Value field of the Data packet after the corresponding Hash Value is calculated through the MD5 Hash algorithm. When the data packet reaches one autonomous area, defining the buffer sequence value C of the data packet in the autonomous area as C=HV mod n. The Value of the Hash Value field in the data packet is HV, n is the number of nodes contained in the autonomous region, and the cache sequence Value C is the result of dividing the Value of the Hash Value field by the number n of the nodes and taking the remainder.
The invention uses the Value field of the polarity of the data packet as the Value of the comprehensive content Popularity, and the defined formula is that
Figure BDA0003537769530000151
Wherein P (t) represents the overall content popularity of the content in the node during the current time period, P (t-1) represents the overall content popularity of the content in the node during the previous time period, N k To number of times this content is requested in the node within the current time period, N m In order to obtain the number of times that all the contents in the node are requested in the current time period, alpha and beta are weight coefficients, which represent the proportion of popularity of the contents in the current time period and the last time period, and generally, alpha and beta are 0.5.
The format of the content popularity record table (Content popularity record table, CPRT) proposed by the present invention is shown in fig. 2, where the first column in the table is the name of the content, the second column is the number of times the content is requested in the current time period, the third column is the integrated content popularity of the content in the previous time period, and the fourth column is the integrated content popularity of the content in the current time period. When a content cached in a node is requested, the number of requests of the corresponding position in the table is increased by one, and meanwhile, the method is based on a formula
Figure BDA0003537769530000161
The current time period in the table is updated to integrate the popularity of the content. Further, after every time period t, the number of content requests of this table in each node is reset to 0, while the value of the current-period integrated content popularity is recorded into the last-period integrated content popularity, and the calculation of the value of the current-period integrated content popularity is restarted according to the number of requests and the value of the last-period integrated content popularity. / >
The format of the regional content cache table (Area content cache table, ACCT) maintained inside the core node proposed by the present invention is shown in fig. 3 below, which records which content cache copies and their corresponding cache locations are in the autonomous region. The content names in the table represent the corresponding content names cached in the autonomous region, and the cache node names are the names of the cache nodes corresponding to the content.
The flow chart of the CCN route forwarding algorithm based on the improved DBSCAN cluster is shown in the following figure 4.
Embodiment two:
the embodiment provides a CCN cache replacement device, which comprises the following steps:
clustering and partitioning module: the method comprises the steps of clustering nodes in a network to form a plurality of autonomous areas; selecting a core node from the nodes of each autonomous region, wherein the core node is responsible for counting the content information cached in each node in the autonomous region, and uniformly caching content copies in each node in the autonomous region;
and a search module: the method comprises the steps of receiving interest packets sent by users, searching in each control area, generating data packets when the interest packets arrive at a source server or some other node which caches the content required by the interest packets, and processing the data packets;
And a cache replacement module: and the data packet is returned and sent to the user, and the buffer memory of the data packet is replaced.
The apparatus of this embodiment may be used to implement the method described in embodiment one.
Embodiment III:
the embodiment provides a CCN cache replacement device, which comprises a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method of embodiment one.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing is merely a preferred embodiment of the present invention, and it should be noted that modifications and variations could be made by those skilled in the art without departing from the technical principles of the present invention, and such modifications and variations should also be regarded as being within the scope of the invention.

Claims (6)

1. The CCN cache replacement method is characterized by comprising the following steps of:
clustering nodes in the network to form a plurality of autonomous areas; selecting a core node from the nodes of each autonomous region, wherein the core node is responsible for counting the content information cached in each node in the autonomous region, and uniformly caching content copies in each node in the autonomous region;
receiving an interest packet sent by a user, searching in each control area, generating a data packet when the interest packet reaches a source server or some other node which caches the content required by the interest packet, and processing the data packet;
the data packet is returned and sent to a user, and cache replacement of the data packet is performed;
the method for receiving the interest packet sent by the user, searching in each control area, generating and processing the data packet when the interest packet arrives at a source server or some other node which caches the content required by the interest packet, and comprises the following steps:
receiving and reading an interest packet sent by a user, and acquiring a requested content object;
encapsulating the requested content object into a data packet;
calculating a Hash Value corresponding to the name of the requested content object through a Hash algorithm, and then writing the Hash Value into a Hash Value field in a data packet;
Inquiring a content Popularity record table CPRT of the node, finding out the comprehensive content Popularity of the current time period corresponding to the content, and writing the Value into a polarity Value field in a data packet;
writing the name of the Core Node in the autonomous area to which the Node belongs into the Core Node field of the data packet;
the method for returning the data packet to the user and carrying out cache replacement of the data packet comprises the following steps: the data packet is returned to a user, whether cache replacement is carried out on the content in the data packet is determined by comprehensively calculating the popularity of the node content in the previous time period and the current time period, and the method comprises the following steps:
step A, forwarding the data packet to a user along port information recorded in a PIT table;
step B, the node which receives the data packet in the forwarding process checks whether the CN field of the node is the same as the CN field of the data packet to judge whether to enter a new autonomous area; if the two types of the images are different, the step C is carried out, otherwise, the step D is carried out;
step C, the node writes the CN field of the data packet into the CN field of the data packet, and inquires the area content cache table ACCT of the core node in the autonomous area where the node is located whether the content is cached by the node in the autonomous area, if yes, the data packet is forwarded to the user according to the PIT table, and the step B is entered, otherwise, the step E is entered;
Step D, forwarding the data packet to the user according to the PIT table, and entering the step B;
step E, calculating a caching sequence value C of the content name in the data packet in the autonomous region, finding out a node with the same sequence number field SN in the autonomous region, if the caching space of the node is still free, directly caching the content in the data packet in the node, then entering step D, and if the caching space is not free, entering step F;
step F, comparing the Value of the Value field of the polarity of the data packet with the Value of the lowest comprehensive content Popularity in the current time period in the content Popularity record table in the node, if the Value of the PV field of the data packet is higher than the Value of the lowest comprehensive content Popularity in the current time period, replacing the content in the data packet with the content corresponding to the lowest Value in the table in the cache space, otherwise, entering the step G;
and G, not caching the content in the node, orderly inquiring whether the cache replacement requirement is met according to the storage space utilization rate from small to large by all nodes in the one-hop range of the node, if so, carrying out the cache replacement, and if not, not caching the content in the autonomous region, and entering the step B.
2. The CCN cache replacement method of claim 1, wherein the method of clustering nodes in a network to form a plurality of autonomous areas comprises partitioning based on a modified DBSCAN clustering algorithm;
the method for dividing the nodes in the content center network into different autonomous areas based on the improved DBSCAN clustering algorithm comprises the following steps:
step 1, randomly selecting a node m from all nodes in a network;
step 2, acquiring set algorithm parameters, wherein the set algorithm parameters comprise a scanning radius L, minimum included point minPts and a content cache diversity set value D; judging the number of nodes with content cache diversity of other nodes within the range from the selected node m to the scanning radius L of the node m not more than D according to the set algorithm parameters, if the content cache diversity is not less than the minimum inclusion point minPts, the node is a core point, and then adding the core point and the nodes into an autonomous region;
step 3, calculating whether other nodes of the non-core points in the autonomous region are core points, and if the other nodes are the core points, adding the core points and the nodes meeting the conditions into the autonomous region above;
step 4, repeating the step 3 until no node is satisfied as a core point;
Step 5, a node which is not accessed is selected randomly again, and the steps 2-4 are repeated;
step 6, after all nodes are accessed, if all nodes join an autonomous area, the clustering algorithm is ended; if nodes still remain and are not added into the autonomous region, the nodes which are not added into the autonomous region form a new sample data set;
and 7, updating new algorithm parameters, and repeating the steps 2-7 according to a new sample data set of the new algorithm parameters until all nodes are added into the autonomous region.
3. The CCN cache replacement method of claim 2, wherein the method of updating the new algorithm parameters comprises: setting the scanning radius to be twice of the original scanning radius, setting the minimum inclusion point to be half of the original minimum inclusion point, and setting the content cache diversity setting value to be twice of the original content cache diversity setting value;
the method for selecting a core node from the nodes of each autonomous region comprises the following steps: after the clustering is completed, the core node in each autonomous region selects a node located in the middle of the autonomous region as a core node.
4. A CCN cache replacement apparatus, comprising the steps of:
Clustering and partitioning module: the method comprises the steps of clustering nodes in a network to form a plurality of autonomous areas; selecting a core node from the nodes of each autonomous region, wherein the core node is responsible for counting the content information cached in each node in the autonomous region, and uniformly caching content copies in each node in the autonomous region;
and a search module: the method comprises the steps of receiving interest packets sent by users, searching in each control area, generating data packets when the interest packets arrive at a source server or some other node which caches the content required by the interest packets, and processing the data packets;
and a cache replacement module: the data packet is returned and sent to the user, and the cache replacement of the data packet is performed;
the searching module receives interest packets sent by users, searches in each control area, and when the interest packets arrive at a source server or some other node which caches the content required by the interest packets, the method for generating and processing the data packets comprises the following steps:
receiving and reading an interest packet sent by a user, and acquiring a requested content object;
encapsulating the requested content object into a data packet;
calculating a Hash Value corresponding to the name of the requested content object through a Hash algorithm, and then writing the Hash Value into a Hash Value field in a data packet;
Inquiring a content Popularity record table CPRT of the node, finding out the comprehensive content Popularity of the current time period corresponding to the content, and writing the Value into a polarity Value field in a data packet;
writing the name of the Core Node in the autonomous area to which the Node belongs into the Core Node field of the data packet;
the buffer replacing module returns the data packet to the user, and the method for replacing the buffer of the data packet comprises the following steps: the data packet is returned to a user, whether cache replacement is carried out on the content in the data packet is determined by comprehensively calculating the popularity of the node content in the previous time period and the current time period, and the method comprises the following steps:
step A, forwarding the data packet to a user along port information recorded in a PIT table;
step B, the node which receives the data packet in the forwarding process checks whether the CN field of the node is the same as the CN field of the data packet to judge whether to enter a new autonomous area; if the two types of the images are different, the step C is carried out, otherwise, the step D is carried out;
step C, the node writes the CN field of the data packet into the CN field of the data packet, and inquires the area content cache table ACCT of the core node in the autonomous area where the node is located whether the content is cached by the node in the autonomous area, if yes, the data packet is forwarded to the user according to the PIT table, and the step B is entered, otherwise, the step E is entered;
Step D, forwarding the data packet to the user according to the PIT table, and entering the step B;
step E, calculating a caching sequence value C of the content name in the data packet in the autonomous region, finding out a node with the same sequence number field SN in the autonomous region, if the caching space of the node is still free, directly caching the content in the data packet in the node, then entering step D, and if the caching space is not free, entering step F;
step F, comparing the Value of the Value field of the polarity of the data packet with the Value of the lowest comprehensive content Popularity in the current time period in the content Popularity record table in the node, if the Value of the PV field of the data packet is higher than the Value of the lowest comprehensive content Popularity in the current time period, replacing the content in the data packet with the content corresponding to the lowest Value in the table in the cache space, otherwise, entering the step G;
and G, not caching the content in the node, orderly inquiring whether the cache replacement requirement is met according to the storage space utilization rate from small to large by all nodes in the one-hop range of the node, if so, carrying out the cache replacement, and if not, not caching the content in the autonomous region, and entering the step B.
5. The CCN cache replacement device of claim 4, wherein said clustering partition module clusters nodes in the network to form a plurality of autonomous areas, said method comprising the steps of:
step 1, randomly selecting a node m from all nodes in a network;
step 2, acquiring set algorithm parameters, wherein the set algorithm parameters comprise a scanning radius L, minimum included point minPts and a content cache diversity set value D; judging the number of nodes with content cache diversity of other nodes within the range from the selected node m to the scanning radius L of the node m not more than D according to the set algorithm parameters, if the content cache diversity is not less than the minimum inclusion point minPts, the node is a core point, and then adding the core point and the nodes into an autonomous region;
step 3, calculating whether other nodes of the non-core points in the autonomous region are core points, and if the other nodes are the core points, adding the core points and the nodes meeting the conditions into the autonomous region above;
step 4, repeating the step 3 until no node is satisfied as a core point;
step 5, a node which is not accessed is selected randomly again, and the steps 2-4 are repeated;
step 6, after all nodes are accessed, if all nodes join an autonomous area, the clustering algorithm is ended; if nodes still remain and are not added into the autonomous region, the nodes which are not added into the autonomous region form a new sample data set;
And 7, setting the scanning radius to be twice the original scanning radius, setting the minimum inclusion point to be half of the original minimum inclusion point, setting the content cache diversity setting value to be twice the original content cache diversity setting value, and repeating the steps 2-7 according to the new sample data set of the new algorithm parameter until all nodes are added into the autonomous region.
6. The CCN cache replacement device is characterized by comprising a processor and a storage medium;
the storage medium is used for storing instructions;
the processor being operative according to the instructions to perform the steps of the method of any one of claims 1-3.
CN202210229532.7A 2022-03-09 2022-03-09 CCN cache replacement method and device Active CN114745440B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210229532.7A CN114745440B (en) 2022-03-09 2022-03-09 CCN cache replacement method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210229532.7A CN114745440B (en) 2022-03-09 2022-03-09 CCN cache replacement method and device

Publications (2)

Publication Number Publication Date
CN114745440A CN114745440A (en) 2022-07-12
CN114745440B true CN114745440B (en) 2023-05-26

Family

ID=82275182

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210229532.7A Active CN114745440B (en) 2022-03-09 2022-03-09 CCN cache replacement method and device

Country Status (1)

Country Link
CN (1) CN114745440B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105049254A (en) * 2015-07-30 2015-11-11 重庆邮电大学 Data caching substitution method based on content level and popularity in NDN/CCN
CN105407055A (en) * 2015-12-30 2016-03-16 深圳先进技术研究院 Energy consumption control method of content center network
CN112399485A (en) * 2020-10-30 2021-02-23 南通大学 CCN-based new node value and content popularity caching method in 6G

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9276840B2 (en) * 2013-10-30 2016-03-01 Palo Alto Research Center Incorporated Interest messages with a payload for a named data network
US9736263B2 (en) * 2015-02-16 2017-08-15 Telefonaktiebolaget L M Ericsson (Publ) Temporal caching for ICN

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105049254A (en) * 2015-07-30 2015-11-11 重庆邮电大学 Data caching substitution method based on content level and popularity in NDN/CCN
CN105407055A (en) * 2015-12-30 2016-03-16 深圳先进技术研究院 Energy consumption control method of content center network
CN112399485A (en) * 2020-10-30 2021-02-23 南通大学 CCN-based new node value and content popularity caching method in 6G

Also Published As

Publication number Publication date
CN114745440A (en) 2022-07-12

Similar Documents

Publication Publication Date Title
US20210105335A1 (en) Processing and caching in an information-centric network
US9825860B2 (en) Flow-driven forwarding architecture for information centric networks
CN105721311B (en) Method and system for updating link state information
US8149716B2 (en) Systems and methods for adaptive routing in mobile ad-hoc networks and disruption tolerant networks
KR101337039B1 (en) Server-side load balancing using parent-child link aggregation groups
EP2813060B1 (en) A method for collaborative caching for content-oriented networks
CN106982248B (en) caching method and device for content-centric network
US10554555B2 (en) Hash-based overlay routing architecture for information centric networks
US10193805B2 (en) User oriented IoT data discovery and retrieval in ICN networks
US10356209B2 (en) System and method to support context-aware content requests in information centric networks
Scherb et al. Resolution strategies for networking the IoT at the edge via named functions
US20210112004A1 (en) Apparatus and method for forwarding a packet in content centric network
US11502956B2 (en) Method for content caching in information-centric network virtualization
RU2483457C2 (en) Message routing platform
CN114745440B (en) CCN cache replacement method and device
CN112688880B (en) Method for reducing redundant data packet transmission in named data network
CN113037635B (en) Multi-source assembling method and device for data block in ICN router
Pal et al. NACID: A neighborhood aware caching and interest dissemination in content centric networks
CN115865844B (en) Virtual-real combined dynamic flow scheduling method and device based on SDN (software defined network) and NDN (non-dynamic network)
Hou et al. Named data network dynamic cache placement strategy based on programmable data plane
Karadeniz Design and implementation of a QoS-aware communication protocol for named data networks
John Directory Assisted Routing of Content in Information-Centric Networks
Marandi Bloom Filter-Based Content Discovery and Retrieval for Information-Centric Networks
Zhong et al. Interaction-Aware Video Community-Based Content Delivery in Wireless Mobile Networks
CN114490758A (en) CCN route forwarding method based on improved DBSCAN clustering

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