CN105959161B - A kind of high speed packet construction and distribution control method and equipment - Google Patents

A kind of high speed packet construction and distribution control method and equipment Download PDF

Info

Publication number
CN105959161B
CN105959161B CN201610536328.4A CN201610536328A CN105959161B CN 105959161 B CN105959161 B CN 105959161B CN 201610536328 A CN201610536328 A CN 201610536328A CN 105959161 B CN105959161 B CN 105959161B
Authority
CN
China
Prior art keywords
message
queue
thread
module
construction
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
CN201610536328.4A
Other languages
Chinese (zh)
Other versions
CN105959161A (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.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
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 National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN201610536328.4A priority Critical patent/CN105959161B/en
Publication of CN105959161A publication Critical patent/CN105959161A/en
Application granted granted Critical
Publication of CN105959161B publication Critical patent/CN105959161B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/085Retrieval of network configuration; Tracking network configuration history
    • H04L41/0853Retrieval of network configuration; Tracking network configuration history by actively collecting configuration information or by backing up configuration information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/80Actions related to the user profile or the type of traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • H04L49/3009Header conversion, routing tables or routing tags
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/9047Buffering arrangements including multiple buffers, e.g. buffer pools

Abstract

The invention discloses a kind of high speed packet construction and distribution control method and equipment, high speed packet construction of the present invention and distribution control equipment include: thread scheduling module, message load configuration module, message package module, transmitted traffic control module, output interface selecting module;Wherein thread scheduling module, message load configuration module, message package module, transmitted traffic control module are by NPU software realization;Output interface selecting module is realized by FPGA.Using the flow work mechanism, different function module is attached on multithreading and works in order, and each thread handles different functional modules in a certain order.Compared with prior art, high speed packet construction of the present invention and distribution control device and method can increase substantially the transmission rate of message, while solve the diversity construction problem of high speed packet existing for the existing data packet transmission tool realized based on hardware technology.

Description

A kind of high speed packet construction and distribution control method and equipment
Technical field
The invention belongs to computer network fields, and especially to being applied to, high speed network message is constructed and multiplex roles send control The method and apparatus of system.
Background technique
Network flow tester is the network equipment and system performance, an important tool of safety test, and can be to net The indices (packet loss, network gulp down mouth amount, network delay) of network equipment and system carry out effectively evaluating, application network test Instrument is an important means for evaluating network system and Network Security Device.When testing equipment under test with tester, network is needed Tester construction and transmission high speed flow, high speed packet construction and sending rate control are the important modules of network tester.
At home and abroad, the network packet generation technique realized, is generally based on software constructing network data packet and hair Data packet is sent, or network packet construction is realized based on hardware FPGA and is sent.It is mostly based on the data of software realization Packet transmission tool uses x86 structure, puts forth effort on raising operational performance, concentrates on Cache consistency, branch prediction etc. progress Optimization, and it is then less in the optimization of memory access performance, cause to construct data packet and transmission packet rate is lower, only can satisfy The test of slow network equipment is not able to satisfy the test to data packet stream the amount exigent network equipment and system.It is based on Although the data packet that hardware technology is realized, which sends tool, can satisfy the equipment test more demanding to packet rate, but test Data packet it is relatively simple, and the type of data packet and length compare fixation substantially, cannot dynamically adjust the type of data packet And content, it can not accurately reflect the performance indicator of equipment under test, and certain specific test equipments can only be adapted to.
Therefore, high speed packet construction is realized based on available data packet construction and distribution control method and equipment and sent, It is difficult to meet the diversity construction of message simultaneously and high speed packet is sent.
Summary of the invention
The present invention provides a kind of high speed packet construction and distribution control method and equipment, it is therefore an objective to overcome existing data The deficiency of the technologies such as packet diversity construction and transmission rate, in multicore NPU (Network Processing Unit, network processes Device) it realizes in+FPGA platform, control problem is sent to solve diversity construction and the multiplex roles of high speed packet.
Technical solution is as follows:
A kind of high speed packet construction and distribution control method, which is characterized in that step includes:
The first step, thread scheduling module line taking journey and by thread scheduling to message load from thread pool according to customized task Constructing module, message package module, transmitted traffic control module, note processing message load configuration module, message package module, hair The thread for sending flow-control module is respectively message load configuration thread, message encapsulation thread, transmitted traffic control thread;
Second step, message load configuration thread execute message load configuration module, read load configuration parameter, construct message Then message load data is put into tectonic loading queue by load data, detailed process is as follows:
Step 101, initialization idle payload queue, give idle payload queue assignment idle payload cache blocks;Idle payload Cache blocks are to be read from idle payload queue by message load configuration thread and store the cache blocks for having constructed data;
Step 102, initialization tectonic loading queue, message load configuration thread filling idle payload cache blocks are simultaneously inserted into In tectonic loading queue;
Step 103 judges whether idle payload queue is empty, if not being that sky thens follow the steps 104, otherwise continues to execute Step 103;
Step 104 takes idle payload cache blocks from idle payload queue, reads construction configuration data and generates charge number According to, and load data is filled to idle payload cache blocks;
Step 105 judges whether tectonic loading queue is full, if less than execution step 107, no to then follow the steps 106;
Step 106 will construct data dump in free buffer block and be inserted into idle payload queue, go to step 103;
Step 107 will construct free buffer block and be inserted into tectonic loading queue;
Step 108 judges that data packet sends whether task terminates, if do not terminated, thens follow the steps 103;Otherwise, it ties Beam;
Third step, message encapsulate thread and execute message package module, read message load configuration mould from tectonic loading queue The message load data of block construction reads message configuration, encapsulated message head, and specifies in Ethernet header custom zone Message output interface;Then packaged message is put into transmit queue;
4th step, transmitted traffic control thread and execute transmitted traffic control module, message are read from transmit queue, according to more Message is sent to output interface selecting module by flow control mechanism between interface;
5th step, output interface selecting module will branch to specified output from the received message of transmitted traffic control module Interface.
Further improvement as high speed packet of the present invention construction and distribution control method:
The high speed packet construction and distribution control method are also fixed using a thread heartbeat reading system time, and System time is shared to transmitted traffic control thread to use, other threads do not need frequently to read system time, reduce system Call context switch timing.
Queue sharing data, line are used between the high speed packet construction and each execution thread of distribution control method Diversity data packet construction is handled between journey with the producer/Consumer model and is sent, message encapsulates thread from idle queues It obtains Packet Descriptor and the Packet Descriptor constructed is inserted into transmit queue, transmitted traffic controls thread from transmission team It is taken in column and sends Packet Descriptor transmission and by Packet Descriptor also to idle queues.
For the thread scheduling module using grouping thread scheduling method, interior every group of thread includes a processing message load structure The message load configuration thread of modeling block, a message for handling message package module encapsulate thread and a processing transmitted traffic The transmitted traffic of control module controls thread;And a producer/consumer queue is shared in thread grouping.
Message encapsulation thread step includes: in the high speed packet construction and distribution control method third step
Step 201, the idle construction queue of initialization, distribute Packet Descriptor;
Step 202, initialization transmit queue;
Step 203, message encapsulation thread judge whether idle construction queue is empty, if not thening follow the steps 204 for sky, Otherwise step 203 is continued to execute;
Step 204, read data packet configuration, the dequeue data packet descriptor from free time construction queue, from tectonic loading team It takes the load cache blocks constructed to encapsulate to Packet Descriptor in column, idle payload block is also back to idle payload team after the completion Column fill custom zone data, set output interface, so far complete message encapsulation;
Step 205, message encapsulation thread judge whether transmit queue is full, if less than then follow the steps 207, otherwise executes Step 206;
Step 206, message encapsulation thread discharge Packet Descriptor to free time construction queue, go to step 203;
The Packet Descriptor constructed is inserted into transmit queue by step 207, message encapsulation thread;
Step 208, message encapsulation thread judge that data packet sends whether task terminates, if do not terminated, thens follow the steps 203;Otherwise terminate.
Transmitted traffic control thread step includes: in the high speed packet construction and the 4th step of distribution control method
Step 301 judges whether transmit queue is empty, no to then follow the steps 301 if not thening follow the steps 302 for sky;
Step 302 obtains Packet Descriptor in transmit queue;
Step 303 calculates output interface real-time traffic;
Step 304 judges whether output interface real-time traffic is less than preset interface flow, if it is thening follow the steps 306, it is no to then follow the steps 305;
Step 305, release Packet Descriptor to free time construct queue, go to step 301;
Step 306 sends message to output interface;
Step 307 judges that data packet sends whether task terminates, if be not finished, thens follow the steps 301;Otherwise, it ties Beam.
The present invention also provides a kind of high speed packet constructions and distribution control equipment, which is characterized in that including thread scheduling Module, message load configuration module, message package module, transmitted traffic control module, output interface selecting module;
Thread scheduling module sends to high speed packet and appoints for taking idle thread to distribute different functions from thread pool Business recycles thread resources to thread pool after the completion of executing;
Message load configuration module constructs message load data for reading load configuration parameter;Message load configuration Module workflow includes:
Step 101, initialization idle payload queue, give idle payload queue assignment idle payload cache blocks;Idle payload Cache blocks are to be read from idle payload queue by message load configuration thread and store the cache blocks for having constructed data;
Step 102, initialization tectonic loading queue, message load configuration thread filling idle payload cache blocks are simultaneously inserted into In tectonic loading queue;
Step 103 judges whether idle payload queue is empty, if not being that sky thens follow the steps 104, otherwise continues to execute Step 103;
Step 104 takes idle payload cache blocks from idle payload queue, reads construction configuration data and generates charge number According to, and load data is filled to idle payload cache blocks;
Step 105 judges whether tectonic loading queue is full, if less than execution step 107, no to then follow the steps 106;
Step 106 will construct data dump in free buffer block and be inserted into idle payload queue, go to step 103;
Step 107 will construct free buffer block and be inserted into tectonic loading queue;
Step 108 judges that data packet sends whether task terminates, if do not terminated, thens follow the steps 103;Otherwise, it ties Beam;
Message package module is configured for reading message, encapsulated message head, and in Ethernet header custom zone Specified message output interface;Message package module workflow includes:
Step 201, the idle construction queue of initialization, distribute Packet Descriptor;
Step 202, initialization transmit queue;
Step 203, message encapsulation thread judge whether idle construction queue is empty, if not thening follow the steps 204 for sky, Otherwise step 203 is continued to execute;
Step 204, read data packet configuration, the dequeue data packet descriptor from free time construction queue, from tectonic loading team It takes the load cache blocks constructed to encapsulate to Packet Descriptor in column, idle payload block is also back to idle payload team after the completion Column fill custom zone data, set output interface, so far complete message encapsulation;
Step 205, message encapsulation thread judge whether transmit queue is full, if less than then follow the steps 207, otherwise executes Step 206;
Step 206, message encapsulation thread discharge Packet Descriptor to free time construction queue, go to step 203;
The Packet Descriptor constructed is inserted into transmit queue by step 207, message encapsulation thread;
Step 208, message encapsulation thread judge that data packet sends whether task terminates, if do not terminated, thens follow the steps 203;Otherwise terminate;
Transmitted traffic control module is for flow control between multiplex roles;Transmitted traffic control module workflow includes:
Step 301 judges whether transmit queue is empty, no to then follow the steps 301 if not thening follow the steps 302 for sky;
Step 302 obtains Packet Descriptor in transmit queue;
Step 303 calculates output interface real-time traffic;
Step 304 judges whether output interface real-time traffic is less than preset interface flow, if it is thening follow the steps 306, it is no to then follow the steps 305;
Step 305, release Packet Descriptor to free time construct queue, go to step 301;
Step 306 sends message to output interface;
Step 307 judges that data packet sends whether task terminates, if be not finished, thens follow the steps 301;Otherwise, it ties Beam;
Output interface selecting module is used to the high speed flow that software generates branching to specified output interface.
As high speed packet of the present invention construct and distribute control equipment further improvement, the thread scheduling module, Message load configuration module, message package module, transmitted traffic control module are by NPU software realization;The output interface selection Module is realized by FPGA.
Compared with prior art, the beneficial effect of high speed packet construction and distribution control method of the present invention and equipment is:
Thread is grouped by thread scheduler module by the function of carrying in present device and method, nothing between thread between group Data sharing, it is noiseless between each other, in the hope of reducing resource bottleneck in multithreading implementation procedure to the greatest extent.Thread is grouped interior each function Energy module is orderly executed by assembly line, and multifarious data packet construction is handled with the producer/Consumer model and is sent, The effect that can achieve no lock in group between thread to shared queue, reduces and locks the waiting time, the method can be to avoid multi-thread Journey increases substantially the transmission rate of message to shared resource competition bring loss;
Message load configuration module reads load configuration parameter and constructs message charge number in present device and method According to then message package module reads message configuration, encapsulated message head, and specifies report in Ethernet header custom zone Literary output interface, therefore, based on present device test type of data packet and length be not it is fixed, can dynamically adjust The type and content of data packet can more accurately reflect the performance indicator of equipment under test, solve existing based on hardware technology The diversity construction problem of high speed packet existing for the data packet transmission tool of realization.
Detailed description of the invention
Fig. 1 be structural relation in high speed packet of the present invention construction and distribution control equipment between each functional module and Data flow relational graph.
Fig. 2 is high speed packet construction and distribution control method flow chart of the present invention.
Fig. 3 is message load configuration thread execution flow chart of the present invention.
Fig. 4 is message encapsulation thread execution flow chart of the present invention.
Fig. 5 is transmitted traffic control thread execution flow chart of the present invention.
Specific embodiment
Fig. 1 is the knot in high speed data packet of embodiment of the present invention construction and distribution control equipment between each functional module Structure relationship and data flow relational graph.High speed packet construction of the present invention and distribution control equipment include: thread scheduling module, report Literary load configuration module, message package module, transmitted traffic control module, output interface selecting module;Wherein thread scheduling mould Block, message load configuration module, message package module, transmitted traffic control module are by NPU software realization;Output interface selects mould Block is realized by FPGA.Using the flow work mechanism, different function module is attached on multithreading and works in order, each thread Different functional modules is handled in a certain order.Modules correlation is as shown in Figure 1.
Thread scheduling module sends to high speed packet and appoints for taking idle thread to distribute different functions from thread pool Business recycles thread resources to thread pool after the completion of executing.
Message load configuration module constructs message load data for reading load configuration parameter;Message load configuration Module workflow includes:
Step 101, initialization idle payload queue, give idle payload queue assignment idle payload cache blocks;Idle payload Cache blocks are to be read from idle payload queue by message load configuration thread and store the cache blocks for having constructed data;
Step 102, initialization tectonic loading queue, message load configuration thread filling idle payload cache blocks are simultaneously inserted into In tectonic loading queue;
Step 103 judges whether idle payload queue is empty, if not being that sky thens follow the steps 104, otherwise continues to execute Step 103;
Step 104 takes idle payload cache blocks from idle payload queue, reads construction configuration data and generates charge number According to, and load data is filled to idle payload cache blocks;
Step 105 judges whether tectonic loading queue is full, if less than execution step 107, no to then follow the steps 106;
Step 106 will construct data dump in free buffer block and be inserted into idle payload queue, go to step 103;
Step 107 will construct free buffer block and be inserted into tectonic loading queue;
Step 108 judges that data packet sends whether task terminates, if do not terminated, thens follow the steps 103;Otherwise, it ties Beam.Message package module specifies report for reading message configuration, encapsulated message head in Ethernet header custom zone Literary output interface;Message package module workflow includes:
Step 201, the idle construction queue of initialization, distribute Packet Descriptor;
Step 202, initialization transmit queue;
Step 203, message encapsulation thread judge whether idle construction queue is empty, if not thening follow the steps 204 for sky, Otherwise step 203 is continued to execute;
Step 204, read data packet configuration, the dequeue data packet descriptor from free time construction queue, from tectonic loading team It takes the load cache blocks constructed to encapsulate to Packet Descriptor in column, idle payload block is also back to idle payload team after the completion Column fill custom zone data, set output interface, so far complete message encapsulation;
Step 205, message encapsulation thread judge whether transmit queue is full, if less than then follow the steps 207, otherwise executes Step 206;
Step 206, message encapsulation thread discharge Packet Descriptor to free time construction queue, go to step 203;
The Packet Descriptor constructed is inserted into transmit queue by step 207, message encapsulation thread;
Step 208, message encapsulation thread judge that data packet sends whether task terminates, if do not terminated, thens follow the steps 203;Otherwise terminate.
Transmitted traffic control module is for flow control between multiplex roles;Transmitted traffic control module workflow includes:
Step 301 judges whether transmit queue is empty, no to then follow the steps 301 if not thening follow the steps 302 for sky;
Step 302 obtains Packet Descriptor in transmit queue;
Step 303 calculates output interface real-time traffic;
Step 304 judges whether output interface real-time traffic is less than preset interface flow, if it is thening follow the steps 306, it is no to then follow the steps 305;
Step 305, release Packet Descriptor to free time construct queue, go to step 301;
Step 306 sends message to output interface;
Step 307 judges that data packet sends whether task terminates, if be not finished, thens follow the steps 301;Otherwise, it ties Beam.
Output interface selecting module is realized that the high speed flow for generating software branches to specified output and connects by FPGA Mouthful.
The present invention further provides a kind of methods for carrying out high speed packet construction and distribution control using above equipment, such as Shown in Fig. 2, steps are as follows:
The first step, thread scheduling module line taking journey and by thread scheduling to message load from thread pool according to customized task Constructing module, message package module, transmitted traffic control module, note processing message load configuration module, message package module, hair The thread for sending flow-control module is respectively message load configuration thread, message encapsulation thread, transmitted traffic control thread.
Second step, message load configuration thread execute message load configuration module, read load configuration parameter, construct message Then message load data is put into tectonic loading queue by load data, as shown in figure 3, detailed process is as follows:
Step 101, initialization idle payload queue, give idle payload queue assignment idle payload cache blocks;Idle payload Cache blocks are to be read from idle payload queue by message load configuration thread and store the cache blocks for having constructed data;
Step 102, initialization tectonic loading queue, message load configuration thread filling idle payload cache blocks are simultaneously inserted into In tectonic loading queue;
Step 103 judges whether idle payload queue is empty, if not being that sky thens follow the steps 104, otherwise continues to execute Step 103;
Step 104 takes idle payload cache blocks from idle payload queue, reads construction configuration data and generates charge number According to, and load data is filled to idle payload cache blocks;
Step 105 judges whether tectonic loading queue is full, if less than execution step 107, no to then follow the steps 106;
Step 106 will construct data dump in free buffer block and be inserted into idle payload queue, go to step 103;
Step 107 will construct free buffer block and be inserted into tectonic loading queue;
Step 108 judges that data packet sends whether task terminates, if do not terminated, thens follow the steps 103;Otherwise, it ties Beam.
Third step, message encapsulate thread and execute message package module, read message load configuration mould from tectonic loading queue The message load data of block construction reads message configuration, encapsulated message head, and specifies in Ethernet header custom zone Message output interface.Then packaged message is put into transmit queue.
4th step, transmitted traffic control thread and execute transmitted traffic control module, message are read from transmit queue, according to more Message is sent to output interface selecting module by flow control mechanism between interface.
5th step, output interface selecting module will branch to specified output from the received message of transmitted traffic control module Interface.
As a further improvement of the present invention:
The present invention is applied to multicore NPU+FPGA platform, in order to construct and send diversity data packet, the high speed at a high speed Data packet construction and distribution control method are also fixed using a thread heartbeat reading system time, and system time is shared to Transmitted traffic controls thread and uses, other threads do not need frequently to read system time, when the system that reduces calls context switching Between;
Queue sharing data, line are used between the high speed packet construction and each execution thread of distribution control method Diversity data packet construction is handled between journey with the producer/Consumer model and is sent, message encapsulates thread from idle queues It obtains Packet Descriptor and the Packet Descriptor constructed is inserted into transmit queue, transmitted traffic controls thread from transmission team It is taken in column and sends Packet Descriptor transmission and by Packet Descriptor also to idle queues;
For the thread scheduling module using grouping thread scheduling method, interior every group of thread includes a processing message load structure The message load configuration thread of modeling block, a message for handling message package module encapsulate thread and a processing transmitted traffic The transmitted traffic of control module controls thread.And a producer/consumer queue is shared in thread grouping, to reach no lock Effect, no data is shared between thread between group, locks the waiting time to reduce multithreading and access shared queue.
As shown in figure 4, message encapsulation thread is specifically held in the high speed packet construction and distribution control method third step Row following steps:
Step 201, the idle construction queue of initialization, distribute Packet Descriptor;
Step 202, initialization transmit queue;
Step 203, message encapsulation thread judge whether idle construction queue is empty, if not thening follow the steps 204 for sky, Otherwise step 203 is continued to execute;
Step 204, read data packet configuration, the dequeue data packet descriptor from free time construction queue, from tectonic loading team It takes the load cache blocks constructed to encapsulate to Packet Descriptor in column, idle payload block is also back to idle payload team after the completion Column fill custom zone data, set output interface, so far complete message encapsulation;
Step 205, message encapsulation thread judge whether transmit queue is full, if less than then follow the steps 207, otherwise executes Step 206;
Step 206, message encapsulation thread discharge Packet Descriptor to free time construction queue, go to step 203;
The Packet Descriptor constructed is inserted into transmit queue by step 207, message encapsulation thread;
Step 208, message encapsulation thread judge that data packet sends whether task terminates, if do not terminated, thens follow the steps 203;Otherwise terminate.
As shown in figure 5, transmitted traffic control thread tool in the high speed packet construction and the 4th step of distribution control method Body executes following steps:
Step 301 judges whether transmit queue is empty, no to then follow the steps 301 if not thening follow the steps 302 for sky;
Step 302 obtains Packet Descriptor in transmit queue;
Step 303 calculates output interface real-time traffic;
Step 304 judges whether output interface real-time traffic is less than preset interface flow, if it is thening follow the steps 306, it is no to then follow the steps 305;
Step 305, release Packet Descriptor to free time construct queue, go to step 301;
Step 306 sends message to output interface;
Step 307 judges that data packet sends whether task terminates, if be not finished, thens follow the steps 301;Otherwise, it ties Beam.
It should be noted last that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting, although ginseng It is described the invention in detail according to preferred embodiment, those skilled in the art should understand that, it can be to the present invention Technical solution be modified or replaced equivalently, without departing from the spirit and scope of the technical solution of the present invention.

Claims (8)

1. a kind of high speed packet construction and distribution control method, which is characterized in that step includes:
The first step, thread scheduling module line taking journey and by thread scheduling to message load configuration from thread pool according to customized task Module, message package module, transmitted traffic control module, note processing message load configuration module, send stream at message package module The thread of amount control module is respectively message load configuration thread, message encapsulation thread, transmitted traffic control thread;
Second step, message load configuration thread execute message load configuration module, read load configuration parameter, construct message load Then message load data is put into tectonic loading queue by data, detailed process is as follows:
Step 101, initialization idle payload queue, give idle payload queue assignment idle payload cache blocks;Idle payload caching Block is to be read from idle payload queue by message load configuration thread and store the cache blocks for having constructed data;
Step 102, initialization tectonic loading queue, message load configuration thread filling idle payload cache blocks are simultaneously inserted into construction In load queue;
Step 103 judges whether idle payload queue is empty, if not being that sky thens follow the steps 104, otherwise continues to execute step 103;
Step 104 takes idle payload cache blocks from idle payload queue, reads construction configuration data and generates load data, and Load data is filled to idle payload cache blocks;
Step 105 judges whether tectonic loading queue is full, if less than execution step 107, no to then follow the steps 106;
Step 106 will construct data dump in free buffer block and be inserted into idle payload queue, go to step 103;
Step 107 will construct free buffer block and be inserted into tectonic loading queue;
Step 108 judges that data packet sends whether task terminates, if do not terminated, thens follow the steps 103;Otherwise, terminate;
Third step, message encapsulate thread and execute message package module, read message load configuration module structure from tectonic loading queue The message load data made reads message configuration, encapsulated message head, and specifies message in Ethernet header custom zone Output interface;Then packaged message is put into transmit queue;
4th step, transmitted traffic control thread and execute transmitted traffic control module, message are read from transmit queue, according to multiplex roles Between flow control mechanism message is sent to output interface selecting module;
5th step, output interface selecting module will branch to specified output from the received message of transmitted traffic control module and connect Mouthful.
2. high speed packet construction as described in claim 1 and distribution control method, which is characterized in that the high speed packet Construction and distribution control method are also fixed using a thread heartbeat reading system time, and system time is shared to transmission stream Amount control thread uses, other threads do not need frequently to read system time, reduces system and calls context switch timing.
3. high speed packet construction as described in claim 1 and distribution control method, which is characterized in that the high speed packet Queue sharing data are used between construction and each execution thread of distribution control method, use the producer/consumer between thread Model is constructed and is sent to handle diversity data packet, and message encapsulation thread obtains Packet Descriptor from idle queues and will The Packet Descriptor of construction is inserted into transmit queue, and transmitted traffic control thread takes transmission Packet Descriptor from transmit queue It sends and by Packet Descriptor also to idle queues.
4. high speed packet construction as described in claim 1 and distribution control method, which is characterized in that the thread scheduling mould Block is using grouping thread scheduling method, the interior message load configuration line comprising a processing message load configuration module of every group of thread Journey, a message encapsulation thread for handling message package module and one handle the transmitted traffic control of transmitted traffic control module Thread;And a producer/consumer queue is shared in thread grouping.
5. high speed packet construction as described in claim 1 and distribution control method, which is characterized in that the high speed packet Message encapsulation thread step includes: in construction and distribution control method third step
Step 201, the idle construction queue of initialization, distribute Packet Descriptor;
Step 202, initialization transmit queue;
Step 203, message encapsulation thread judge whether idle construction queue is empty, if not thening follow the steps 204 for sky, otherwise Continue to execute step 203;
Step 204, read data packet configuration, the dequeue data packet descriptor from free time construction queue, from tectonic loading queue It takes the load cache blocks constructed to encapsulate to Packet Descriptor, idle payload block is also back to idle payload queue after the completion, Custom zone data is filled, output interface is set, so far completes message encapsulation;
Step 205, message encapsulation thread judges whether transmit queue expires, and then follow the steps 207 if less than, no to then follow the steps 206;
Step 206, message encapsulation thread discharge Packet Descriptor to free time construction queue, go to step 203;
The Packet Descriptor constructed is inserted into transmit queue by step 207, message encapsulation thread;
Step 208, message encapsulation thread judge that data packet sends whether task terminates, if do not terminated, thens follow the steps 203; Otherwise terminate.
6. high speed packet construction as described in claim 1 and distribution control method, which is characterized in that the high speed packet Transmitted traffic control thread step includes: in construction and the 4th step of distribution control method
Step 301 judges whether transmit queue is empty, no to then follow the steps 301 if not thening follow the steps 302 for sky;
Step 302 obtains Packet Descriptor in transmit queue;
Step 303 calculates output interface real-time traffic;
Step 304 judges whether output interface real-time traffic is less than preset interface flow, no if it is thening follow the steps 306 Then follow the steps 305;
Step 305, release Packet Descriptor to free time construct queue, go to step 301;
Step 306 sends message to output interface;
Step 307 judges that data packet sends whether task terminates, if be not finished, thens follow the steps 301;Otherwise, terminate.
7. a kind of high speed packet construction and distribution control equipment, which is characterized in that including thread scheduling module, message load structure Modeling block, message package module, transmitted traffic control module, output interface selecting module;
Thread scheduling module sends task to high speed packet and holds for taking idle thread to distribute different functions from thread pool Thread resources are recycled after the completion of row to thread pool;
Message load configuration module constructs message load data for reading load configuration parameter;Message load configuration module Workflow includes:
Step 101, initialization idle payload queue, give idle payload queue assignment idle payload cache blocks;Idle payload caching Block is to be read from idle payload queue by message load configuration thread and store the cache blocks for having constructed data;
Step 102, initialization tectonic loading queue, message load configuration thread filling idle payload cache blocks are simultaneously inserted into construction In load queue;
Step 103 judges whether idle payload queue is empty, if not being that sky thens follow the steps 104, otherwise continues to execute step 103;
Step 104 takes idle payload cache blocks from idle payload queue, reads construction configuration data and generates load data, and Load data is filled to idle payload cache blocks;
Step 105 judges whether tectonic loading queue is full, if less than execution step 107, no to then follow the steps 106;
Step 106 will construct data dump in free buffer block and be inserted into idle payload queue, go to step 103;
Step 107 will construct free buffer block and be inserted into tectonic loading queue;
Step 108 judges that data packet sends whether task terminates, if do not terminated, thens follow the steps 103;Otherwise, terminate;
Message package module is specified in Ethernet header custom zone for reading message configuration, encapsulated message head Message output interface;Message package module workflow includes:
Step 201, the idle construction queue of initialization, distribute Packet Descriptor;
Step 202, initialization transmit queue;
Step 203, message encapsulation thread judge whether idle construction queue is empty, if not thening follow the steps 204 for sky, otherwise Continue to execute step 203;
Step 204, read data packet configuration, the dequeue data packet descriptor from free time construction queue, from tectonic loading queue It takes the load cache blocks constructed to encapsulate to Packet Descriptor, idle payload block is also back to idle payload queue after the completion, Custom zone data is filled, output interface is set, so far completes message encapsulation;
Step 205, message encapsulation thread judges whether transmit queue expires, and then follow the steps 207 if less than, no to then follow the steps 206;
Step 206, message encapsulation thread discharge Packet Descriptor to free time construction queue, go to step 203;
The Packet Descriptor constructed is inserted into transmit queue by step 207, message encapsulation thread;
Step 208, message encapsulation thread judge that data packet sends whether task terminates, if do not terminated, thens follow the steps 203; Otherwise terminate;
Transmitted traffic control module is for flow control between multiplex roles;Transmitted traffic control module workflow includes:
Step 301 judges whether transmit queue is empty, no to then follow the steps 301 if not thening follow the steps 302 for sky;
Step 302 obtains Packet Descriptor in transmit queue;
Step 303 calculates output interface real-time traffic;
Step 304 judges whether output interface real-time traffic is less than preset interface flow, no if it is thening follow the steps 306 Then follow the steps 305;
Step 305, release Packet Descriptor to free time construct queue, go to step 301;
Step 306 sends message to output interface;
Step 307 judges that data packet sends whether task terminates, if be not finished, thens follow the steps 301;Otherwise, terminate;
Output interface selecting module is used to the high speed flow that software generates branching to specified output interface.
8. high speed packet construction as claimed in claim 7 and distribution control equipment, which is characterized in that the thread scheduling mould Block, message load configuration module, message package module, transmitted traffic control module are by NPU software realization;The output interface choosing Module is selected to be realized by FPGA.
CN201610536328.4A 2016-07-08 2016-07-08 A kind of high speed packet construction and distribution control method and equipment Active CN105959161B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610536328.4A CN105959161B (en) 2016-07-08 2016-07-08 A kind of high speed packet construction and distribution control method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610536328.4A CN105959161B (en) 2016-07-08 2016-07-08 A kind of high speed packet construction and distribution control method and equipment

Publications (2)

Publication Number Publication Date
CN105959161A CN105959161A (en) 2016-09-21
CN105959161B true CN105959161B (en) 2019-04-26

Family

ID=56899670

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610536328.4A Active CN105959161B (en) 2016-07-08 2016-07-08 A kind of high speed packet construction and distribution control method and equipment

Country Status (1)

Country Link
CN (1) CN105959161B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108170758A (en) * 2017-12-22 2018-06-15 福建天泉教育科技有限公司 High concurrent date storage method and computer readable storage medium
CN111338787B (en) * 2020-02-04 2023-09-01 浙江大华技术股份有限公司 Data processing method and device, storage medium and electronic device
CN111427616A (en) * 2020-04-16 2020-07-17 上海航天计算机技术研究所 Satellite-borne software setting method for flow control data downloading

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101175033A (en) * 2007-11-27 2008-05-07 中兴通讯股份有限公司 Message order-preserving method and device thereof
CN101668005A (en) * 2009-09-25 2010-03-10 东南大学 Data transmission accelerating engine method based on multiple access passages of transmitting end
CN101964759A (en) * 2010-11-10 2011-02-02 中国人民解放军国防科学技术大学 Multiuser-supporting high-speed message diversion method
CN102331923A (en) * 2011-10-13 2012-01-25 西安电子科技大学 Multi-core and multi-threading processor-based functional macropipeline implementing method
CN102662908A (en) * 2012-04-23 2012-09-12 西安电子科技大学 Method and system for controlling high-speed interface in multi-processor system-on-chip
CN103428099A (en) * 2013-08-21 2013-12-04 中国人民解放军国防科学技术大学 Flow control method for universal multi-core network processor

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5081847B2 (en) * 2009-02-20 2012-11-28 株式会社日立製作所 Packet processing apparatus and packet processing method using multiprocessor

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101175033A (en) * 2007-11-27 2008-05-07 中兴通讯股份有限公司 Message order-preserving method and device thereof
CN101668005A (en) * 2009-09-25 2010-03-10 东南大学 Data transmission accelerating engine method based on multiple access passages of transmitting end
CN101964759A (en) * 2010-11-10 2011-02-02 中国人民解放军国防科学技术大学 Multiuser-supporting high-speed message diversion method
CN102331923A (en) * 2011-10-13 2012-01-25 西安电子科技大学 Multi-core and multi-threading processor-based functional macropipeline implementing method
CN102662908A (en) * 2012-04-23 2012-09-12 西安电子科技大学 Method and system for controlling high-speed interface in multi-processor system-on-chip
CN103428099A (en) * 2013-08-21 2013-12-04 中国人民解放军国防科学技术大学 Flow control method for universal multi-core network processor

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
实时线程池性能研究与动态优化;刘云生,王刚,王卫国;《计算机工程与科学》;20071215(第12期);正文123-125页

Also Published As

Publication number Publication date
CN105959161A (en) 2016-09-21

Similar Documents

Publication Publication Date Title
CN105446860B (en) Pressure testing system and method for testing based on asynchronism and concurrency mechanism
CN105959161B (en) A kind of high speed packet construction and distribution control method and equipment
CN104021044B (en) A kind of job scheduling method and device
CN106171032B (en) Data transmission method and equipment
CN104216768B (en) Data processing method and device
CN104915253B (en) A kind of method and job processor of job scheduling
CN104137083B (en) Interface arrangement and memory bus system
CN100576177C (en) Bidirectional grade gridding resource scheduling method based on the QoS constraint
CN104202261A (en) Service request processing method and device
CN103984235B (en) Space manipulator Control System Software framework and construction method based on C/S structure
CN111694675B (en) Task scheduling method and device and storage medium
CN110011936A (en) Thread scheduling method and device based on multi-core processor
CN107102897A (en) A kind of database active defense method of many GPU parallel processings
CN112954300B (en) Performance testing device and method for video monitoring platform
CN107395735A (en) The delay capacity reducing dispatching method and system of a kind of container cluster
CN111061547B (en) Task scheduling method and system for heterogeneous system
CN106775961A (en) A kind of method of cross-system data and signal transmission
CN105868000A (en) Method for parallelly processing data in extensible manner for network I/O (input/output) virtualization
CN104360962B (en) Be matched with multistage nested data transmission method and the system of high-performance computer structure
CN102984089B (en) Traffic management dispatching method and device
CN116197919B (en) Robot control system and control method
CN106941488B (en) Multi-layer protocol packet encapsulation device and method based on FPGA
CN106413095A (en) Data transmission method
CN103795653B (en) A kind of data cache method, device and optical network unit
Kraft RTSSim-a simulation framework for complex embedded systems

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant