A data caching method, device, switch equipment, system and program product
By analyzing the priority and tenant level of data packets, optimizing the cache order of data packets to the switch device, solving the problem of packet loss in the switch device and improving the service quality of virtual private networks.
Patent Information
- Application Number
- CN202411180499.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-08-27
AI Technical Summary
The data packet caching method in switch equipment can easily lead to packet loss of important data packets, affecting the service quality of virtual private networks, especially high priority and high tenant-level data packets cannot be effectively cached.
By analyzing the cache priority and tenant level of the data packet, determining the cache batch and maximum occupancy ratio of the data packets, optimizing the cache order of the data packets to write to the data exchange cache, and discarding packets that cannot be written.
Ensure that data packets with high cache priority and high tenant level are cached first, improve the service quality of virtual private networks, and make reasonable use of data exchange cache resources.
Smart Images

Figure CN118714105B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of switches, and in particular to a data caching method, device, switch equipment, system and program product. Background Art
[0002] Switch devices are common network devices that can be used in various network application scenarios. For example, in a virtual private network (VPN) scenario, a switch device can forward tunnel data packets, where tunnels are a common communication method for virtual private networks. In addition, a data exchange cache is provided in the switch device to temporarily store data packets that cannot be forwarded. The capacity of the data exchange cache is usually small, that is, the switch device cannot temporarily store a large number of data packets that cannot be forwarded.
[0003] In the related art, switch devices usually write data packets into the cache in the order of first-arrived-first-written. However, this data packet caching method can easily cause important data packets to fail to be cached. For example, it can easily cause data packets of important virtual private network tenants to fail to be cached and be lost, thereby affecting the service quality of the virtual private network. Summary of the invention
[0004] The purpose of the present invention is to provide a data caching method, device, switch device, system and program product, wherein the switch device can cache currently input data packets according to the cache priority of each data packet and the tenant level of each virtual private network tenant, thereby improving the network service quality.
[0005] In order to solve the above technical problems, the present invention provides a data caching method, which is applied to a switch device, and the method comprises:
[0006] Parsing a currently input data packet to obtain a cache priority of the data packet and a tenant level of a virtual private network tenant to which the data packet belongs;
[0007] Determine a cache batch of each of the data packets according to the cache priority, and determine a maximum occupancy ratio of the remaining space of the data exchange cache by each of the virtual private network tenants in the same cache batch according to the tenant level;
[0008] The data packets are sequentially written into the data exchange cache according to the cache batch and the maximum occupancy ratio, and the data packets that cannot be written into the data exchange cache are discarded.
[0009] Optionally, parsing the currently input data packet to obtain the cache priority of the data packet and the tenant level of the virtual private network tenant to which the data packet belongs includes:
[0010] Determining whether the data packet is a tunnel data packet;
[0011] If the data packet is a tunnel data packet, the cache priority is obtained from the option field of the data packet header, and the tenant level is determined according to the tunnel identification field in the data packet header; wherein different virtual private network tenants correspond to different tunnel identification fields;
[0012] If the data packet is not a tunnel data packet, a lowest cache priority and a lowest tenant level are set for the data packet.
[0013] Optionally, the cache priority setting process includes:
[0014] Get the tunnel identification field of all VPN tenants;
[0015] Performing a modulo operation on the tunnel identification field and a preset cache priority number;
[0016] The result of the modulo operation is used as the cache priority of the virtual private network tenant.
[0017] Optionally, determining the maximum occupancy ratio of the remaining space of the data exchange cache by each of the virtual private network tenants in the same cache batch according to the tenant level includes:
[0018] For all virtual private network tenants in the same cache batch, obtaining a preset weight corresponding to the tenant level of each virtual private network tenant;
[0019] The ratio between the preset weights is determined, and the ratio is used as the maximum occupancy ratio of the remaining space of the data exchange cache by each virtual private network tenant in the cache batch.
[0020] Optionally, it also includes:
[0021] When it is determined that the local machine has entered a congested state, the step of parsing the currently input data packet to obtain the priority information of the data packet is entered.
[0022] Optionally, it also includes:
[0023] When it is determined that the outbound flow of the local machine is less than the inbound flow, it is determined that the local machine enters the congestion state.
[0024] Optionally, after writing the data packets into the data exchange cache in sequence according to the cache batch and the maximum occupancy ratio, the method further includes:
[0025] A data packet is taken out from the data exchange buffer and sent to a target device.
[0026] Optionally, writing the data packets into the data exchange cache in sequence according to the cache batch and the maximum occupancy ratio, and discarding the data packets that cannot be written into the data exchange cache, comprises:
[0027] Set the first cached batch as the batch to be written;
[0028] Writing each data packet in the batch to be written into the data exchange cache according to the maximum occupied ratio of the remaining space of the data exchange cache by each virtual private network tenant in the batch to be written, and discarding the data packets that cannot be written into the data exchange cache;
[0029] Determining whether the data exchange buffer is full;
[0030] If the data exchange cache is not full, the next cache batch is used as the batch to be written, and the steps of writing each data packet in the batch to be written into the data exchange cache according to the maximum occupancy ratio of the remaining space of the data exchange cache by each virtual private network tenant in the batch to be written, and discarding the data packets that cannot be written into the data exchange cache are performed;
[0031] If the data exchange buffer is full, all unwritten buffer batches are discarded.
[0032] Optionally, according to the maximum occupied ratio of the remaining space of the data exchange cache by each virtual private network tenant in the batch to be written, each data packet in the batch to be written is written into the data exchange cache, and the data packet that cannot be written into the data exchange cache is discarded, including:
[0033] Obtaining the remaining space size of the data exchange cache, and determining the maximum space occupancy size obtained by each virtual private network tenant in the batch to be written according to the remaining space size and the maximum occupancy ratio of each virtual private network tenant in the batch to be written to the remaining space of the data exchange cache;
[0034] The first virtual private network tenant in the batch to be written is used as a tenant to be processed;
[0035] Writing the data packets of the tenant to be processed into the data exchange cache, and determining whether all the data packets of the tenant to be processed have been written;
[0036] If all the data packets of the tenant to be processed have been written, the next virtual private network tenant of the batch to be written is used as the tenant to be processed, and the step of writing the data packets of the tenant to be processed into the data exchange cache is entered;
[0037] If the data packet of the tenant to be processed has not been written, determining whether the maximum space occupied by the tenant to be processed is fully written;
[0038] If the maximum space occupied by the tenant to be processed is full, all unwritten data packets of the tenant to be processed are discarded, and the step of taking the next virtual private network tenant of the batch to be written as the tenant to be processed is entered;
[0039] If the maximum space occupied by the tenant to be processed is not full, the step of writing the data packet of the tenant to be processed into the data exchange cache is entered.
[0040] The present invention also provides a data cache device, applied to a switch device, the device comprising:
[0041] A parsing module, used to parse the currently input data packet to obtain the cache priority of the data packet and the tenant level of the virtual private network tenant to which the data packet belongs;
[0042] A cache scheduling module, used to determine a cache batch of each of the data packets according to the cache priority, and to determine a maximum occupancy ratio of the remaining space of the data exchange cache by each of the virtual private network tenants in the same cache batch according to the tenant level;
[0043] The cache module is used to write the data packets into the data exchange cache in sequence according to the cache batch and the maximum occupancy ratio, and discard the data packets that cannot be written into the data exchange cache.
[0044] The present invention also provides a switch device, comprising:
[0045] Memory for storing computer programs;
[0046] A processor is used to implement the data caching method as described above when executing the computer program.
[0047] The present invention also provides a network communication system, comprising:
[0048] A switch device, used to execute the data caching method as described above;
[0049] The user equipment is used to send a data packet to the switch equipment.
[0050] Optionally, it also includes:
[0051] The tunnel endpoint device is used to encapsulate the data packet sent by the user equipment into a tunnel data packet, add a cache priority in the message header option field of the tunnel data packet, and send the tunnel data packet to the switch device.
[0052] The present invention also provides a computer program product, comprising a computer program or instructions, wherein the computer program or instructions implement the steps of the above-mentioned data caching method when executed by a processor.
[0053] The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the data caching method as described above is implemented.
[0054] The present invention provides a data caching method, which is applied to a switch device. The method comprises: parsing a currently input data packet to obtain a cache priority of the data packet and a tenant level of a virtual private network tenant to which the data packet belongs; determining a cache batch of each data packet according to the cache priority, and determining a maximum occupancy ratio of each virtual private network tenant in the same cache batch to a remaining space of a data exchange cache according to the tenant level; sequentially writing each data packet into a data exchange cache according to the cache batch and the maximum occupancy ratio, and discarding data packets that cannot be written into the data exchange cache.
[0055] It can be seen that in the present invention, when the switch device receives the currently input data packet, it will parse the data packet to determine the cache priority of the data packet and the tenant level of the virtual private network tenant to which the data packet belongs. Subsequently, the switch device will determine the cache batch of each data packet according to the cache priority, and determine the maximum occupancy ratio of each virtual private network tenant in the same cache batch to the remaining space of the data exchange cache according to the tenant level. In other words, the present invention can specifically cache the currently input data packet according to the cache priority of each data packet and the tenant level of each virtual private network tenant, so that data packets with higher cache priority can occupy the cache first, and virtual private network tenants with higher tenant levels can occupy larger data exchange cache space. Furthermore, the present invention can write each data packet into the data exchange cache in sequence according to the cache batch and the maximum occupancy ratio, and discard the data packet that cannot be written into the data exchange cache, so as to ensure that the data exchange cache of the switch gives priority to serving data packets with high cache priority and virtual private network users with high tenant levels, so as to improve the service effect. The present invention also provides a data cache device, a switch device, a network communication system, a computer program product, and a computer-readable storage medium, which have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0057] Figure 1 A flow chart of a data caching method provided by an embodiment of the present invention;
[0058] Figure 2 A structural block diagram of a first network communication system provided by an embodiment of the present invention;
[0059] Figure 3 A structural block diagram of a second network communication system provided by an embodiment of the present invention;
[0060] Figure 4 A structural block diagram of a third network communication system provided by an embodiment of the present invention;
[0061] Figure 5 A schematic diagram of a networking structure provided by an embodiment of the present invention;
[0062] Figure 6 A structural block diagram of a data cache device provided by an embodiment of the present invention;
[0063] Figure 7 This is a structural block diagram of a switch device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0065] Switch devices are common network devices that can be used in various network application scenarios. For example, in a virtual private network scenario, a switch device can forward tunnel data packets, where tunnels are a common means of communication for virtual private networks. In addition, a data exchange cache may be provided in the switch device to temporarily store data packets that cannot be forwarded. The capacity of the data exchange cache is usually small, that is, the switch device cannot temporarily store a large number of data packets that cannot be forwarded. In related technologies, switch devices usually write data packets to the data exchange cache in the order of first arrival, first write. However, this method of data packet caching can easily lead to the inability to cache important data packets. For example, it can easily lead to data packets of important virtual private network tenants being unable to be cached and being lost, thereby affecting the quality of service of the virtual private network.
[0066] In view of this, the present invention aims at the technical problem of how a switch device caches data packets of different priorities, and can provide a data caching method, which can control the switch device to cache the currently input data packets according to the caching priority of each data packet and the tenant level of each virtual private network tenant, so that high-priority data packets can be preferentially cached and the network service quality can be improved.
[0067] For easier understanding, please refer to Figure 1 , Figure 1 A flow chart of a data caching method provided by an embodiment of the present invention. The method is applied to a switch device and may include:
[0068] S100: Parse a currently input data packet to obtain a cache priority of the data packet and a tenant level of a virtual private network tenant to which the data packet belongs.
[0069] In this embodiment, the data packets currently received by the switch device come from various user devices. These user devices may be only different virtual private network tenant devices, and of course may also include non-tenant devices. Before caching the currently input data packet, the switch device may first parse the data packet to obtain the cache priority of the data packet and the tenant level of the virtual private network tenant to which the data packet belongs. It should be pointed out that for data packets of non-tenant devices, the corresponding tenant level defaults to the lowest tenant level. The above-mentioned cache priority and tenant level are introduced below.
[0070] The cache priority represents the priority of the data packet being written into the data exchange cache of the switch device. The higher the cache priority, the higher the priority of the data packet to be cached; the lower the cache priority, the later the cache order of the data packet. In other words, the cache priority is used to determine the cache order of the currently input data packets. More specifically, the cache priority is used to determine the cache batches of each currently input data packet, one cache priority corresponds to one cache batch, and each cache batch contains all the data packets corresponding to the cache priority. In addition, the higher the cache priority, the earlier the cache batch is written into the data exchange cache; the lower the cache priority, the later the cache batch is written into the cache.
[0071] It should be noted that the present embodiment does not limit the number of cache priorities, which can be set according to actual application requirements. In order to achieve the effect of distinguishing the cache order, at least two cache priorities need to be set. The present embodiment also does not limit the setting method of the cache priority, which can be set according to actual application requirements. It should also be noted that regardless of whether the above-mentioned user device belongs to a virtual private network tenant, it can set the above-mentioned cache priority for the data packet. Of course, non-tenant devices may not set the above-mentioned cache priority in the data packet, but when the switch device determines that the data packet belongs to a non-tenant device, it automatically sets the lowest cache priority for it, so as to give priority to the service quality of the virtual private network tenants.
[0072] It should also be noted that this embodiment does not limit how the data packet carries the cache priority, and can be set according to actual application requirements. For example, a specified field can be added to the header of the data packet to save the cache priority; for another example, the cache priority can be carried in the original option field (Option field, such as IP Option) in the data packet header. Considering that the option field is an existing structure in the data packet header, it is not necessary to change the message structure to carry the cache priority information in the option field; and the field length of the option field is relatively long, for example, the field length of the IP Option is 32 bits, which is sufficient to save the above cache priority, so the cache priority in this embodiment can be saved in the option field of the data packet. When parsing the data packet header, the switch device can retrieve the cache priority from the option field; if it is determined that the cache priority is not written in the option field (such as non-tenant devices can set the cache priority), the switch device can automatically set the lowest cache priority for the data packet.
[0073] Furthermore, the tenant level characterizes the importance of the virtual private network tenant. The higher the tenant level, the more important the virtual private network tenant is, and the more the switch equipment needs to ensure its network communication quality; the lower the tenant level, the more general the importance of the virtual private network tenant is, and its network communication quality can be appropriately reduced. The purpose of setting the tenant level is that the data packets sent by multiple virtual private network tenants can have the same cache priority, that is, they belong to the same cache batch and should be written into the data exchange cache at the same time. However, the importance of each virtual private network tenant is different. If these data packets are written into the cache indiscriminately, it may happen that the data packets of virtual private network tenants with lower levels occupy more cache space, resulting in that the data packets of virtual private network tenants with higher levels can only be cached in small quantities, or even cannot be cached, and thus the effect of giving priority to ensuring the network communication quality of high-level virtual private network tenants cannot be achieved. Therefore, the present embodiment sets the above-mentioned tenant level, and the maximum occupied ratio of the remaining space of the data exchange cache by each virtual private network tenant in the same cache batch can be determined according to the tenant level. That is, the maximum cache space that can be occupied by each virtual private network tenant in the same cache batch can be limited by the tenant level, thereby avoiding the situation where only less or even no data packets of high-level tenants can be cached due to excessive caching of data packets of low-level tenants.
[0074] It should be noted that the network system can usually set up a dedicated tunnel for each virtual private network tenant. The data packet transmitted in this tunnel can be called a tunnel data packet, and the message header of the tunnel data packet usually has a tunnel identification field for uniquely identifying the tunnel. For example, for a tunnel built based on VXLAN technology (Virtual Extensible Local Area Network), the tunnel identification field can be VNI (VXLAN Network ID). Therefore, in this embodiment, each virtual private network tenant can be distinguished by the tunnel identification field in the tunnel data packet. Furthermore, there are two ways to parse the data packet to obtain the tenant level: 1. Pre-store the mapping relationship between each tunnel identification field and the tenant level in the switch device. When receiving the data packet, the switch device can query the mapping relationship using the tunnel identification field in the data packet to obtain the corresponding tenant level; 2. The tenant level can be directly represented by the value of the tunnel identification field, and then the switch device also obtains the corresponding tenant level when extracting the tunnel identification field. In this embodiment, in order to improve processing efficiency and avoid additional data storage and parsing consumption, the tenant level can be directly represented by the value of the tunnel identification field. For data packets sent by non-tenant devices, since they are not tunnel data packets, the switch device can automatically set the lowest tenant level for them.
[0075] Based on this, parsing the currently input data packet to obtain the cache priority of the data packet and the tenant level of the virtual private network tenant to which the data packet belongs may include:
[0076] S101, determine whether the data packet is a tunnel data packet; if the data packet is a tunnel data packet, proceed to step S102; if the data packet is not a tunnel data packet, proceed to step S103.
[0077] S102, acquiring the cache priority from the option field of the data packet header, and determining the tenant level according to the tunnel identification field in the data packet header; wherein different virtual private network tenants correspond to different tunnel identification fields;
[0078] S103: Set the lowest cache priority and the lowest tenant level for the data packet.
[0079] Further, it should be pointed out that this embodiment does not limit whether the above cache priority and tenant level have an association relationship. The two may not have an association relationship. In this case, when the virtual private network tenant sends a data packet, the above cache priority can be set for the data packet according to the urgency of the data packet without considering its own tenant level; the two may also have an association relationship. In this case, when the virtual private network tenant sends a data packet, it is necessary to set the above cache priority for the data packet according to its own tenant level, which can be set according to actual application requirements. In this embodiment, in order to better serve high-level virtual private network tenants, the above cache priority can be set according to the tenant level, that is, each cache priority corresponds to one or more tenant levels. This setting process can follow the idea of "the higher the tenant level, the higher the cache priority" and be set in a stepped form. For example, for tenant levels 1 to 5, the larger the value, the higher the tenant level, and the cache priority 1 to 3 can be set. The larger the value, the higher the priority, where tenant levels 1 and 2 correspond to cache priority 1, tenant levels 3 and 4 correspond to cache priority 2, and tenant level 5 corresponds to cache priority 3. In this way, higher-level virtual private network tenants can be better served.
[0080] Furthermore, since the present embodiment can use the value of the tunnel identification field to represent the tenant level, in order to set each tenant level to each cache priority more evenly, the present embodiment can set the correspondence between the cache priority and the tenant level by means of a modulo operation.
[0081] Based on this, the cache priority setting process may include:
[0082] Step 11: Get the tunnel identification field of all VPN tenants;
[0083] Step 12: performing a modulo operation on the tunnel identification field and a preset cache priority number;
[0084] Step 13: Using the result of the modulo operation as the cache priority of the VPN tenant.
[0085] The cache priority setting can be expressed as:
[0086] VNI mod M = Q;
[0087] VNI represents the tunnel identification field, which is the dividend; mod represents the modulus operation; M represents the preset cache priority number, which is the divisor and is not 0; Q represents the cache priority corresponding to the VNI, which is the remainder.
[0088] S200, determining a cache batch of each of the data packets according to the cache priority, and determining a maximum occupancy ratio of the remaining space of the data exchange cache by each of the virtual private network tenants in the same cache batch according to the tenant level.
[0089] As described above, this embodiment can determine the cache batch of each of the data packets according to the cache priority, wherein the cache batch represents the time order in which the data packets are written into the cache, one cache batch corresponds to one cache priority, and the higher the cache priority, the earlier the cache batch is written into the data interaction cache, and the lower the cache priority, the later the cache batch is written into the data interaction cache.
[0090] This embodiment can also determine the maximum proportion of the remaining space of the data exchange cache occupied by each virtual private network tenant in the same cache batch according to the tenant level. The remaining space of the data exchange cache refers to the cache space remaining in the data exchange cache when the writing of the current cache batch is started. In other words, when writing to each round of cache batches, this embodiment can limit the maximum cache space size that each virtual private network tenant in the cache batch can occupy in the current cache remaining space to ensure service quality.
[0091] It should be noted that this embodiment does not limit how to determine the above-mentioned maximum occupancy ratio. For example, the ratio of each tenant level can be used as the maximum occupancy ratio; for another example, the preset weights corresponding to each tenant level can be preset in the switch device, and then the ratio of the preset weights can be used as the maximum occupancy ratio. In order to improve the setting flexibility, this embodiment can set the preset weights of each tenant level in the switch device; the switch device can obtain the preset weights corresponding to the tenant level of each virtual private network tenant in the same cache batch, determine the ratio between these preset weights, and use this ratio as the maximum occupancy ratio of the remaining space of the data exchange cache for each virtual private network tenant in the cache batch.
[0092] Based on this, determining the maximum occupancy ratio of the remaining space of the data exchange cache by each of the virtual private network tenants in the same cache batch according to the tenant level may include:
[0093] S201. For all VPN tenants in the same cache batch, obtain a preset weight corresponding to the tenant level of each VPN tenant;
[0094] S202: Determine a ratio between the preset weights, and use the ratio as a maximum occupancy ratio of the remaining space of the data exchange cache by each virtual private network tenant in the cache batch.
[0095] S300: sequentially write the data packets into the data exchange cache according to the cache batch and the maximum occupancy ratio, and discard the data packets that cannot be written into the data exchange cache.
[0096] After obtaining the above cache batches and maximum occupancy ratio, the switch device can write the currently received data packets into the data exchange cache in sequence. It is worth pointing out that, considering that the data packets are written in batches, the front cache batches can occupy a larger cache space in the data exchange cache, and the cacheability is higher, so the switch device can well guarantee the forwarding effect of these data packets; although the cache batches at the back can occupy a smaller cache space in the data exchange cache, and the cacheability is lower, the switch device can limit the maximum cache space available to each virtual private network tenant, and try to ensure that each virtual private network tenant can still have a part of the data packets cached, so as to try to guarantee the forwarding effect of these data packets.
[0097] It should be noted that in the following situations, data packets cannot be written into the cache and will be discarded: 1. The data exchange cache is full, and all unwritten data packets cannot be written into the cache; 2. The maximum cache space that can be occupied by the virtual private network tenant to which the data packet belongs is full, and all unwritten data packets of the virtual private network tenant cannot be written into the cache.
[0098] Furthermore, after storing the data packet in the data exchange cache, the switch device may also take out the data packet from the data exchange cache and send the data packet to the target device to release the cache space.
[0099] Based on this, after writing the data packets sequentially into the data exchange cache according to the cache batch and the maximum occupancy ratio, the method may further include:
[0100] S400: Taking out a data packet from the data exchange buffer and sending the data packet to a target device.
[0101] Based on the above embodiments, in the present invention, when the switch device receives the currently input data packet, it will parse the data packet to determine the cache priority of the data packet and the tenant level of the virtual private network tenant to which the data packet belongs. Subsequently, the switch device will determine the cache batch of each data packet according to the cache priority, and determine the maximum occupancy ratio of each virtual private network tenant in the same cache batch to the remaining space of the data exchange cache according to the tenant level. In other words, the present invention can specifically cache the currently input data packet according to the cache priority of each data packet and the tenant level of each virtual private network tenant, so that data packets with higher cache priority can occupy the cache first, and virtual private network tenants with higher tenant levels can occupy larger data exchange cache space. Furthermore, the present invention can write each data packet into the data exchange cache in sequence according to the cache batch and the maximum occupancy ratio, and discard the data packet that cannot be written into the data exchange cache, so as to ensure that the data exchange cache of the switch gives priority to serving data packets with high cache priority and virtual private network users with high tenant levels, so as to improve the service effect.
[0102] Based on the above embodiment, the process of sequentially writing data packets into the data exchange cache according to the cache batch and the maximum occupancy ratio is introduced below. Based on this, sequentially writing each data packet into the data exchange cache according to the cache batch and the maximum occupancy ratio, and discarding the data packets that cannot be written into the data exchange cache, may include:
[0103] S201: Set the first cache batch as the batch to be written.
[0104] S202. Write each data packet in the batch to be written into the data exchange cache according to the maximum occupancy ratio of each virtual private network tenant in the batch to be written to the data exchange cache, and discard the data packets that cannot be written into the data exchange cache.
[0105] As described above, the above maximum occupancy ratio is used to determine the maximum space size that each virtual private network tenant in the current cache batch can occupy in the remaining space of the data exchange cache. Therefore, when caching each batch to be written, it is necessary to first obtain the remaining space size of the data exchange cache, and use the remaining space size and the above maximum occupancy ratio to calculate the maximum space occupancy size obtained by each virtual private network tenant in the batch to be written, and then cache the data packets of each virtual private network tenant based on the maximum space occupancy size. During the caching process, if the data packets of the virtual private network tenant have been cached and the maximum space occupancy size of the tenant has not been used up, the data packets of the next virtual private network tenant are cached, and the unused cache space of the current tenant can be used for writing the data packets of the next cache batch; if the data packets of the virtual private network tenant are not all cached, and the maximum space occupancy size of the tenant has been used up, all the unwritten data packets of the tenant are discarded, and the data packets of the next virtual private network tenant are cached.
[0106] Based on this, according to the maximum occupancy ratio of the remaining space of the data exchange cache by each virtual private network tenant in the batch to be written, writing each data packet in the batch to be written into the data exchange cache, and discarding the data packets that cannot be written into the data exchange cache, may include:
[0107] Step 21: Obtain the remaining space size of the data exchange cache, and determine the maximum space occupancy size obtained by each virtual private network tenant in the batch to be written based on the remaining space size and the maximum occupancy ratio of each virtual private network tenant in the batch to be written to the remaining space of the data exchange cache.
[0108] Step 22: The first virtual private network tenant in the batch to be written is used as a tenant to be processed.
[0109] Step 23: writing the data packets of the tenant to be processed into the data exchange cache, and determining whether all the data packets of the tenant to be processed have been written.
[0110] It should be noted that when writing a data packet of a tenant, the writing can be performed according to the order of reception, that is, the data packet received first is written first, and the data packet received later is written later.
[0111] Step 24: If all the data packets of the tenant to be processed have been written, the next virtual private network tenant in the batch to be written is used as the tenant to be processed, and the step of writing the data packets of the tenant to be processed into the data exchange cache is entered.
[0112] Step 25: If the data packet of the tenant to be processed has not been written, it is determined whether the maximum space occupied by the tenant to be processed is fully written.
[0113] Step 26: If the maximum space occupied by the tenant to be processed is full, all unwritten data packets of the tenant to be processed are discarded, and the step of taking the next virtual private network tenant of the batch to be written as the tenant to be processed is entered.
[0114] Step 27: If the maximum space occupied by the tenant to be processed is not full, the step of writing the data packet of the tenant to be processed into the data exchange cache is entered.
[0115] In this way, the size of the cache space that can be occupied by each virtual private network tenant can be effectively limited, thereby trying to ensure the network communication effect of each tenant.
[0116] S203: Determine whether the data exchange buffer is full.
[0117] S204. If the data exchange cache is not full, the next cache batch is used as the batch to be written, and the step of writing each data packet in the batch to be written into the data exchange cache according to the maximum occupancy ratio of the remaining space of the data exchange cache by each virtual private network tenant in the batch to be written is entered, and the data packets that cannot be written into the data exchange cache are discarded.
[0118] S205: If the data exchange cache is full, all cache batches that have not been written are discarded.
[0119] As described above, if the data exchange cache is not full, the remaining data packets can still be written. If the data exchange cache is full, the remaining unwritten data packets cannot be written and need to be discarded. Considering that the discarded data packets are mainly in the later batches, this embodiment can effectively guarantee the forwarding quality of the data packets in the earlier batches (i.e., high cache priority); considering that the discarded data packets can be dispersed among various virtual private network tenants, it can try its best to guarantee the forwarding quality of the data packets in the later batches (i.e., low cache priority).
[0120] Based on the above embodiment, in order to achieve reasonable use of cache resources, the switch device can cache data packets according to the above cache priority and tenant level only when it determines that it has entered a congested state, that is, when data packets accumulate and cannot be forwarded quickly.
[0121] Based on this, the method may further include:
[0122] S500: When it is determined that the local device has entered a congested state, the step of parsing the currently input data packet to obtain priority information of the data packet is entered.
[0123] It should be noted that this embodiment does not limit the method for determining the congestion state. For example, the switch device may determine that it has entered a congestion state when the cache space consumption reaches a preset water level value; or the switch device may determine that the local machine has entered a congestion state when it determines that the outbound traffic of the local machine is less than the inbound traffic. In order to effectively ensure the quality of network communication services, the switch device in this embodiment determines that the local machine has entered a congestion state when it determines that the outbound traffic of the local machine is less than the inbound traffic, thereby ensuring that the cache space of the device is always consumed according to the cache priority and tenant level, thereby effectively ensuring the quality of network communication services.
[0124] Based on the above embodiment, the network communication system provided by this embodiment is introduced below. Figure 2 , Figure 2 This is a structural block diagram of the first network communication system provided by an embodiment of the present invention. This network communication system may include:
[0125] The switch device 10 is used to execute the data caching method described in the above embodiment.
[0126] The user equipment 20 is used to send a data packet to the switch device 10 .
[0127] It should be noted that the number of user devices may be multiple; and the number of users may be tenants of a virtual private network or not, and may be set according to actual application requirements.
[0128] Furthermore, this embodiment also provides a second network communication system. Figure 3 , Figure 3 This is a structural block diagram of a second network communication system provided by an embodiment of the present invention. The second network communication system may also include:
[0129] The tunnel endpoint device 30 is used to encapsulate the data packet sent by the user equipment into a tunnel data packet, add a cache priority in the message header option field of the tunnel data packet, and send the tunnel data packet to the switch device.
[0130] In other words, the tunnel endpoint device (e.g., VTEP device, Virtual Tunnel Endpoint) can replace the user device to encapsulate the tunnel data packet. Each user device can directly send the original data packet to the tunnel endpoint device. Different from the related art, the tunnel endpoint device in this embodiment can also add the tenant's cache priority in the header option field of the tunnel data packet to meet the processing requirements of the switch device 10.
[0131] For further information, please refer to Figure 4 , Figure 4This is a structural block diagram of the third network communication system provided by an embodiment of the present invention, wherein some user devices 20 (tenant devices) communicate with the tunnel endpoint device 30 and send data packets to the tunnel endpoint device, while other user devices 20 (non-tenant devices) directly send data packets to the switch device 10.
[0132] The data caching method is fully introduced below based on specific examples. The present invention can set up five processes in the EVPN scenario of the data center, namely tenant VTEP access, tenant priority division, tenant priority mapping, device cache allocation and scheduling, and same priority cache allocation and scheduling. Without changing the traditional IP packet header format, the tenant's VNI can be divided into different cache priorities and mapped to the IP Option of the IP header to divide the data exchange cache (buffer) usage priority. It can support all priority mappings of up to 16,000,000 tenants, ensuring that when there is burst traffic in the switch, high-priority tenants are prioritized and scheduled, ensuring that tenants of different levels use the switch cache resources reasonably. Regardless of whether the intermediate device supports EVPN, it only needs to be slightly upgraded to identify IP Option to achieve cache priority scheduling for different tenants.
[0133] 1. Tenant VTEP access: Different tenants access the EVPN network and use different VNIs to identify different tenants. Figure 5 A schematic diagram of a networking structure provided by an embodiment of the present invention, in Figure 5 In the example, VTEP1, VTEP2, VTEP3, and VTEP4 form a large EVPN Layer 2 network. VNI101 under each VTEP is level 5 tenant A, VNI102 is level 4 tenant B, VNI103 is level 3 tenant C, VNI104 is level 2 tenant D, VNI105 is level 1 tenant E, etc. Different tenants are identified by different VNIs, and a maximum of 16,000,000 tenants are supported.
[0134] 2. Tenant priority division. As shown in the figure, there are five tenants with tenant levels 1 to 5. If three cache priorities need to be divided.
[0135] Then divide the VNI of each tenant by 3 and calculate the remainders.
[0136] For example, for a Level 5 tenant, VNI 101:
[0137] 101 mod 3 = 2
[0138] Level 4 tenant, VNI 104:
[0139] 104 mod 3 = 2
[0140] Level 3 tenant, VNI 103:
[0141] 103 mod 3 = 1
[0142] Level 2 tenant, VNI 102:
[0143] 102 mod 3 = 0
[0144] Level 1 tenant, VNI 105:
[0145] 105 mod 3 = 0
[0146] It can be seen that the remainder of level 4 and 5 tenants is the same, and they belong to the same priority 2. Level 3 tenants belong to priority 1. Level 1 and 2 tenants have the same remainder, and they belong to the same priority 0.
[0147] If there are 16,000,000 tenants and a different level needs to be set for each tenant, a maximum of 16,000,000 tenant levels need to be divided.
[0148] 3. Tenant priority mapping.
[0149] In step 2, three different priorities are defined: 2, 1, and 0. The tenant priority needs to be mapped to the cache priority in the IP option.
[0150] Level 4 and 5 tenants have priority 2, and the cache priority value in the mapped ip option is 2;
[0151] Level 3 tenant priority 1, mapped ip option cache priority value 1;
[0152] Level 1 and 2 tenants have a priority of 0, and the cache priority value in the mapped IP option is 0;
[0153] 4. Device cache allocation and scheduling.
[0154] When a VTEP node or intermediate transmission device is congested due to burst traffic, the device will perform cache scheduling based on the buffer priority in ipoption. Level 4 and 5 tenants will use cache resources first; when the burst traffic of level 4 and 5 tenants is forwarded, level 3 tenants will use cache resources; the same applies to level 1 and 2 tenants.
[0155] 5. Same priority cache allocation and scheduling.
[0156] The cache priority in the IP option used by level 4 and 5 tenants is 2. By default, the device performs 1:1 scheduling based on the byte size. You can set different cache scheduling weights for different tenants. Under the same priority, different tenants are scheduled based on the weight size.
[0157] Beneficial effects brought by the technical solution of the present invention:
[0158] The feature of the present invention is that in the EVPN scenario, through tenant VTEP access, tenant priority division, tenant priority mapping, device cache allocation and scheduling, and same priority cache allocation and scheduling, a method for different tenant cache scheduling is implemented. The format of the traditional IP message header is not changed, the tenant's VNI is divided into different priority levels, and mapped to the IP option of the IP header for buffer priority division, which can support all priority mappings of up to 16,000,000 tenants. It ensures that when there is burst traffic in the switch, high-priority tenants are prioritized and tenants of different levels use the switch cache resources reasonably. Regardless of whether the intermediate device supports EVPN, it only needs to be slightly upgraded to recognize IP option to implement cache priority scheduling for different tenants.
[0159] Based on the above examples, please refer to Figure 6 , Figure 6 A structural block diagram of a data cache device provided by an embodiment of the present invention, which is applied to a switch device and may include:
[0160] The parsing module 601 is used to parse the currently input data packet to obtain the cache priority of the data packet and the tenant level of the virtual private network tenant to which the data packet belongs;
[0161] A cache scheduling module 602 is used to determine a cache batch of each of the data packets according to the cache priority, and to determine a maximum occupancy ratio of the remaining space of the data exchange cache by each of the virtual private network tenants in the same cache batch according to the tenant level;
[0162] The cache module 603 is used to write the data packets into the data exchange cache in sequence according to the cache batch and the maximum occupancy ratio, and discard the data packets that cannot be written into the data exchange cache.
[0163] Optionally, the parsing module 601 may include:
[0164] A judging submodule, used for judging whether the data packet is a tunnel data packet;
[0165] A first parsing submodule, configured to obtain the cache priority from the option field in the packet header if the packet is a tunnel packet, and determine the tenant level according to the tunnel identification field in the packet header; wherein different virtual private network tenants correspond to different tunnel identification fields;
[0166] The second parsing submodule is used to set the lowest cache priority and the lowest tenant level for the data packet if the data packet is not a tunnel data packet.
[0167] Optionally, the device may further include:
[0168] An acquisition module, used to acquire tunnel identification fields of all virtual private network tenants;
[0169] A modular operation module, used for performing a modular operation on the tunnel identification field and a preset cache priority number;
[0170] The cache priority setting module is used to use the result of the modulo operation as the cache priority of the virtual private network tenant.
[0171] Optionally, the cache scheduling module 602 may include:
[0172] A weight acquisition submodule, for acquiring, for all virtual private network tenants in the same cache batch, a preset weight corresponding to a tenant level of each virtual private network tenant;
[0173] The ratio calculation submodule is used to determine the ratio between the preset weights and use the ratio as the maximum occupancy ratio of the remaining space of the data exchange cache by each virtual private network tenant in the cache batch.
[0174] Optionally, the device may further include:
[0175] The cache scheduling trigger module is used to parse the currently input data packet and obtain the priority information of the data packet when it is determined that the local machine has entered a congested state.
[0176] Optionally, the device may further include:
[0177] The congestion determination module is used to determine that the local machine has entered the congestion state when it is determined that the outbound flow of the local machine is less than the inbound flow.
[0178] Optionally, the device may further include:
[0179] The sending module is used to take out the data packet from the data exchange buffer and send the data packet to the target device.
[0180] Optionally, the cache module 603 may include:
[0181] Set up a submodule to use the first cached batch as the batch to be written;
[0182] A batch cache submodule, used to write each data packet in the batch to be written into the data exchange cache according to the maximum occupancy ratio of each virtual private network tenant in the batch to be written to the remaining space of the data exchange cache, and discard the data packets that cannot be written into the data exchange cache;
[0183] A judging submodule, used to judge whether the data exchange buffer is full;
[0184] a loop control submodule, for, if the data exchange cache is not full, using the next cache batch as the batch to be written, and entering the step of writing each data packet in the batch to be written into the data exchange cache according to the maximum occupancy ratio of the remaining space of the data exchange cache by each virtual private network tenant in the batch to be written, and discarding the data packets that cannot be written into the data exchange cache;
[0185] The discard submodule is used to discard all unwritten cache batches if the data exchange cache is full.
[0186] Optionally, the batch cache submodule may include:
[0187] a space allocation unit, configured to obtain the remaining space size of the data exchange cache, and determine the maximum space occupancy size obtained by each virtual private network tenant in the batch to be written according to the remaining space size and the maximum occupancy ratio of each virtual private network tenant in the batch to be written to the remaining space of the data exchange cache;
[0188] A setting unit, configured to set the first virtual private network tenant in the batch to be written as the tenant to be processed;
[0189] A cache unit, used to write the data packets of the tenant to be processed into the data exchange cache, and determine whether the data packets of the tenant to be processed have all been written;
[0190] A first loop control unit, configured to, if all data packets of the to-be-processed tenant have been written, take the next virtual private network tenant of the to-be-processed batch as the to-be-processed tenant, and proceed to the step of writing the data packets of the to-be-processed tenant into the data exchange cache;
[0191] A judging unit, configured to judge whether the maximum space occupied by the tenant to be processed is fully written if the data packet of the tenant to be processed has not been written;
[0192] A second loop control unit is used for discarding all unwritten data packets of the tenant to be processed if the maximum space occupied by the tenant to be processed is full, and entering the step of taking the next virtual private network tenant of the batch to be written as the tenant to be processed;
[0193] The third loop control unit is used to enter the step of writing the data packet of the tenant to be processed into the data exchange cache if the maximum space occupied by the tenant to be processed is not full.
[0194] Please refer to Figure 7 , Figure 7 This is a structural block diagram of a switch device provided in an embodiment of the present invention. The embodiment of the present invention provides a switch device 10, including a processor 11 and a memory 12; wherein the memory 12 is used to store a computer program; and the processor 11 is used to execute the data caching method provided in the above embodiment when executing the computer program.
[0195] For the specific process of the above data caching method, reference may be made to the corresponding contents provided in the above embodiments, which will not be described in detail here.
[0196] Furthermore, the memory 12 as a carrier for storing resources may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be temporary storage or permanent storage.
[0197] In addition, the switch device 10 also includes a power supply 13, a communication interface 14, an input / output interface 15 and a communication bus 16; wherein the power supply 13 is used to provide a working voltage for each hardware device on the switch device 10; the communication interface 14 can create a data transmission channel between the switch device 10 and an external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present invention, and is not specifically limited here; the input / output interface 15 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0198] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, wherein the computer program / instruction implements the data caching method described in the above embodiment when executed by a processor.
[0199] Since the embodiments of the computer program product part correspond to the embodiments of the data caching method part, please refer to the description of the embodiments of the data caching method part for the embodiments of the computer program product part, which will not be repeated here.
[0200] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the data caching method described in the above embodiment is implemented.
[0201] Since the embodiments of the computer-readable storage medium part and the embodiments of the data caching method part correspond to each other, the embodiments of the storage medium part refer to the description of the embodiments of the data caching method part, which will not be repeated here.
[0202] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0203] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0204] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0205] The above is a detailed introduction to a data caching method, device, switch equipment, system and program product provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. A data caching method, characterized in that: Applied to a switch device, the method comprises: Parsing a currently input data packet to obtain a cache priority of the data packet and a tenant level of a virtual private network tenant to which the data packet belongs; Determine the cache batch of each data packet according to the cache priority, and determine the maximum occupancy ratio of the remaining space of the data exchange cache by each virtual private network tenant in the same cache batch according to the tenant level; wherein, the higher the cache priority of the data packet, the earlier the order in which the cache batch of the data packet is written into the data exchange cache, and the lower the cache priority of the data packet, the later the order in which the cache batch of the data packet is written into the data exchange cache, and the virtual private network tenant with a higher tenant level occupies a larger data exchange cache space; The data packets are sequentially written into the data exchange cache according to the cache batch and the maximum occupancy ratio, and the data packets that cannot be written into the data exchange cache are discarded.
2. The data caching method according to claim 1, characterized in that: Parsing the currently input data packet to obtain the cache priority of the data packet and the tenant level of the virtual private network tenant to which the data packet belongs, including: Determining whether the data packet is a tunnel data packet; If the data packet is a tunnel data packet, the cache priority is obtained from the option field of the data packet header, and the tenant level is determined according to the tunnel identification field in the data packet header; wherein different virtual private network tenants correspond to different tunnel identification fields; If the data packet is not a tunnel data packet, a lowest cache priority and a lowest tenant level are set for the data packet.
3. The data caching method according to claim 2, characterized in that: The cache priority setting process includes: Get the tunnel identification field of all VPN tenants; Performing a modulo operation on the tunnel identification field and a preset cache priority number; The result of the modulo operation is used as the cache priority of the virtual private network tenant.
4. The data caching method according to claim 1, characterized in that: Determining the maximum occupancy ratio of the remaining space of the data exchange cache by each of the virtual private network tenants in the same cache batch according to the tenant level includes: For all virtual private network tenants in the same cache batch, obtaining a preset weight corresponding to the tenant level of each virtual private network tenant; The ratio between the preset weights is determined, and the ratio is used as the maximum occupancy ratio of the remaining space of the data exchange cache by each virtual private network tenant in the cache batch.
5. The data caching method according to claim 1, characterized in that: Also includes: When it is determined that the local machine has entered a congested state, the step of parsing the currently input data packet to obtain the priority information of the data packet is entered.
6. The data caching method according to claim 5, characterized in that: Also includes: When it is determined that the outbound flow of the local machine is less than the inbound flow, it is determined that the local machine enters the congestion state.
7. The data caching method according to claim 1, characterized in that: After the data packets are sequentially written into the data exchange cache according to the cache batch and the maximum occupancy ratio, the method further includes: A data packet is taken out from the data exchange buffer and sent to a target device.
8. The data caching method according to any one of claims 1 to 7, characterized in that: The method further comprises: sequentially writing each of the data packets into the data exchange cache according to the cache batch and the maximum occupancy ratio, and discarding the data packets that cannot be written into the data exchange cache, including: Set the first cached batch as the batch to be written; Writing each data packet in the batch to be written into the data exchange cache according to the maximum occupied ratio of the remaining space of the data exchange cache by each virtual private network tenant in the batch to be written, and discarding the data packets that cannot be written into the data exchange cache; Determining whether the data exchange buffer is full; If the data exchange cache is not full, the next cache batch is used as the batch to be written, and the steps of writing each data packet in the batch to be written into the data exchange cache according to the maximum occupancy ratio of the remaining space of the data exchange cache by each virtual private network tenant in the batch to be written, and discarding the data packets that cannot be written into the data exchange cache are performed; If the data exchange buffer is full, all unwritten buffer batches are discarded.
9. The data caching method according to claim 8, characterized in that: According to the maximum occupied ratio of the remaining space of the data exchange cache by each virtual private network tenant in the batch to be written, each data packet in the batch to be written is written into the data exchange cache, and the data packets that cannot be written into the data exchange cache are discarded, including: Obtaining the remaining space size of the data exchange cache, and determining the maximum space occupancy size obtained by each virtual private network tenant in the batch to be written according to the remaining space size and the maximum occupancy ratio of each virtual private network tenant in the batch to be written to the remaining space of the data exchange cache; The first virtual private network tenant in the batch to be written is used as a tenant to be processed; Writing the data packets of the tenant to be processed into the data exchange cache, and determining whether all the data packets of the tenant to be processed have been written; If all the data packets of the tenant to be processed have been written, the next virtual private network tenant of the batch to be written is used as the tenant to be processed, and the step of writing the data packets of the tenant to be processed into the data exchange cache is entered; If the data packet of the tenant to be processed has not been written, determining whether the maximum space occupied by the tenant to be processed is fully written; If the maximum space occupied by the tenant to be processed is full, all unwritten data packets of the tenant to be processed are discarded, and the step of taking the next virtual private network tenant of the batch to be written as the tenant to be processed is entered; If the maximum space occupied by the tenant to be processed is not full, the step of writing the data packet of the tenant to be processed into the data exchange cache is entered.
10. A data cache device, characterized in that: Applied to a switch device, the device comprises: A parsing module, used to parse the currently input data packet to obtain the cache priority of the data packet and the tenant level of the virtual private network tenant to which the data packet belongs; A cache scheduling module, used to determine the cache batch of each data packet according to the cache priority, and determine the maximum occupancy ratio of each virtual private network tenant in the same cache batch to the remaining space of the data exchange cache according to the tenant level; wherein, the higher the cache priority of the data packet, the earlier the order in which the cache batch of the data packet is written into the data exchange cache, and the lower the cache priority of the data packet, the later the order in which the cache batch of the data packet is written into the data exchange cache, and the virtual private network tenant with a higher tenant level occupies a larger data exchange cache space; The cache module is used to write the data packets into the data exchange cache in sequence according to the cache batch and the maximum occupancy ratio, and discard the data packets that cannot be written into the data exchange cache.
11. A switch device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the data caching method according to any one of claims 1 to 9 when executing the computer program.
12. A network communication system, characterized in that: include: A switch device, used to execute the data caching method according to any one of claims 1 to 9; The user equipment is used to send a data packet to the switch equipment.
13. The network communication system according to claim 12, characterized in that: Also includes: The tunnel endpoint device is used to encapsulate the data packet sent by the user equipment into a tunnel data packet, add a cache priority in the message header option field of the tunnel data packet, and send the tunnel data packet to the switch device.
14. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the data caching method according to any one of claims 1 to 9 are implemented.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by a processor, the data caching method according to any one of claims 1 to 9 is implemented.
