| CPC H04L 47/62 (2013.01) [H04L 41/40 (2022.05); H04L 49/90 (2013.01); H04B 7/18513 (2013.01)] | 16 Claims |

|
1. A network node simulation method based on Linux container, comprising:
step 1, creating each of container nodes in a satellite network scenario;
step 2, creating a data unit for packet transmission between the container nodes in a shared memory of a physical machine, and creating container-level unit management queues respectively corresponding to the container nodes and a machine-level unit management queue in the shared memory of the physical machine, wherein the machine-level unit management queue comprises a machine-level unit supply queue and a machine-level unit recycle queue, and each of the container-level unit management queues comprises a container-level unit supply queue and a container-level unit recycle queue;
step 3, creating an output queue for each of the container nodes in the shared memory, wherein the output queue is lock-free, concurrent, and secure;
step 4, creating an output queue registry in each of the container nodes, wherein the output queue registry is configured to store information of one or more output queues corresponding to one or more other container nodes that required to be received and processed by the container node, and the output queue registry comprises an output queue quantity, an output queue serial number used to uniquely mark a corresponding output queue, and an enqueue packet count;
step 5, allocating and managing, by each of the container nodes, a first dynamic thread according to a task;
step 6, sending, by a source container node, a packet to a destination container node, and determining whether there is a data unit in a container-level unit supply queue of the source container node;
step 7, in a situation that there is no data unit in the container-level unit supply queue of the source container node, obtaining, by the source container node, a data unit from the machine-level unit management queue, supplementing the obtained data unit to the container-level unit supply queue of the source container node;
step 8, in a situation that there is a data unit in the container-level unit supply queue of the source container node, obtaining, by the source container node, a data unit from the container-level unit supply queue of the source container node and filling a packet into the obtained data unit;
step 9, generating, by each of the container nodes, a forwarding table, and determining a target output queue, by the source container node or a forwarding container node according to the corresponding generated forwarding table;
step 10, allocating, by a next-hop container node, a second dynamic thread for receiving and processing the packet;
step 11, storing, by the source container node or the forwarding container node, an index of the obtained data unit for storing the packet into the target output queue, and determining whether the target output queue is full;
step 12, in a situation that the target output queue is full, informing, by the source container node or the forwarding container node, the next-hop container node to dynamically schedule multiple threads for receiving and processing the packet;
step 13, in a situation that the target output queue is not full, writing, by the source container node or the forwarding container node, the index of the obtained data unit for storing the packet into a position of the target output queue pointed by an enqueue index, and increasing an enqueue packet count of the target output queue by 1; and obtaining, by the next-hop container node, the packet from the obtained data unit of the target output queue, wherein the step 13 comprises steps 13.1, 13.2, and 13.3:
step 13.1, determining, by the next-hop container node, a position of the packet taken out from the target output queue;
step 13.2, checking, by the next-hop container node, whether the target output queue is empty by comparing a dequeue index with a tail index of the target output queue, performing step 14, in a situation that the target output queue is empty; and reading the index of the obtained data unit for storing the packet from a position of the target output queue pointed by the dequeue index, in a situation that the target output queue is not empty; and
step 13.3, looking up, by the next-hop container node, a destination container node serial number contained in simulation parameter information in the obtained data unit, comparing the destination container node serial number with a serial number of the next-hop container node to determine whether the next-hop container node is the destination container node, performing step 15 in a situation that the next-hop container node is the destination container node, and performing step 9 in a situation that the next-hop container node is the destination container node;
step 14, logging off, by the next-hop container node, registration information of the target output queue, after it is determined that stream interruption is caused on the target output queue;
step 15, determining, by the destination container node, a container-level unit recycle queue of the destination container node is full;
step 16, in a situation that the container-level unit recycle queue of the destination container node is full, recycling, by the destination container node, the data unit and supplementing the recycled data unit to the machine-level unit management queue;
step 17, in a situation that the container-level unit recycle queue of the destination container node is not full, finishing a transmission process on the data unit, and performing a transmission process on next data unit in a circulating manner, until all data units are processed.
|