| Network processor(NP)is a special circuit applied in the network field,which is responsible for executing network data processing and forwarding,and has the flexibility of a general-purpose microprocessor and the performance of a special-purpose Application Specific Integrated Circuit(ASIC).When executing network applications,the network processor should quickly process the data arriving at the interface and process as much data as possible without losing line speed.In the process of processing,network processor not only need to receive,store,copy and forward a large number of data packets,but also need to reasonably allocate computing resources and storage resources.The ability to reasonably and efficiently allocate the storage and computing resources in the network processor through the program is the key index to measure the high-performance network processor.The way that developers manually allocate resources leads to low development efficiency and forms a development bottleneck.The allocation method of the program’s automatic allocation of resources should take into account the resource allocation characteristics of different network processors to ensure the rationality and effectiveness of the allocation.Aiming at the above problems,a network processor resource allocation method based on particle swarm algorithm was designed,which can allocate resources to different network processors with less adjustment parts,and can get good allocation in a limited time.The solution is refined and implemented for the Network Processor Unit 1T(NPU1T)device.Firstly,according to the characteristics of network processor and its resource allocation,different methods for solving related problems were analyzed,and then the overall method and its flow division were proposed based on particle swarm optimization algorithm.Aiming at the defect that the search ability of traditional particle swarm optimization algorithm declines in the later stage of search,the elimination mechanism of low-quality particles was used to improve the optimization effect.Then,the characteristics of resource allocation about NPU1 T network processor equipment were analyzed,and the proposed allocation method and its sub modules were realized by using the compiler in NPU1 T development tool.Based on NPU1 T compiler,NPU1 T simulator,NPU1 T board and Sprient TestCenter N11 U test instrument,the performance of the allocation method was tested,including the test of the correctness of the allocation method and the Load,allocating time,board delay,board throughput capacity.The test results show that the allocation method is correct to a certain extent.With the increase of the number of iterations and the population size,the load caused by the allocation to the NPU1 T accounts for the maximum load variation range of about 44%~ 53%,the allocation time varies from about 800 s to about 13000 s.When the 100 G port was connected,the round-trip delay of the board varies from about 3850 ns to about 3250 ns,and the throughput of the board varies from about 97.8Gb/s to about 99.3Gb/s.The allocation method has a certain optimization effect.Compared with the initial allocation without optimization,the optimization proportion of load was 26% ~ 39%,the optimization proportion of round-trip delay was 5% ~ 20%,and the optimization proportion of throughput was 0.9% ~ 2.5%. |