| With the development of network technology lots of new service applications and network agreements have appeared. Therefore we are needed to test and evaluate these new technologies and performance exactly. Software simulation combines advantages of math analysis and real test method and becomes the main method for testing network performances. However, the Simulator has a great distortion to the real network, and the Emulator lacks the guide in the aspect of network framework. Both of them can not satisfy experimenters'demands well.This thesis proposes the idea that is to apply the network scenarios setting to network emulator. And the mapping from network scenarios to network models is realized by applying policy mechanism. The experimenters just input the needed network scenarios, and then the simulation system will call the corresponding policy to build the network environment. Experimenters also can control the state of simulative network flexibly which includes network faults, traffic, etc. Then, they input the analog data to test the performance of this network scenario and transfer the results to emulators in the experiment network. This process will reach the effects of operating the network scenarios of software simulation on the experiment network. This method improves pertinence of applying emulator to simulate the network damage, and it can also test the simulator's simulation effect.The definition of policy by IETF is a series of gathered management rules. And every rule is made up with some conditions and motions. Policy is applied to network security originally and then it is applied to the network management field. The extension of policy-based network management to the high level inspires people's research and application of policy-based SLAM. And the application of applying policy to building network scenarios is an example of applying policy to the dummy network world. It excuses experimenters of the complicated operation of NS2 or OPNET and also can guides the build of real network environment.The process of simulating network scenarios is the process of calling the network scenarios policies on different levels to realize the network framework, network operation and network elements on different network levels. The build of simulative network scenarios includes two steps which are the build of network and the control of network state. And in addition the network simulation process is needed to control. Therefore this paper has designed three types of policies: network generation policy, network status control policy and simulation control policy.Network generation policy is divided into network topology generation policy, network device generation policy, and network deployment policy. Policy module response the subnet numbers, nodes numbers and the network hiberarchy on the basis of network type and scale. Simulation system generates terminal nodes, switching nodes and network lines according to the guides of policy, and then link them together. Later according to the type of network it will finish network service deployment and background flow simulation.Network scenarios refer to the network which is under some status. Network status control policy is divided into network fault policy and network service policy.Using these strategies can simulate many network problems flexibly and keep network in any status. As for the network fault simulation, experimenters set the fault type and place of nodes or links, and simulation system will set the corresponding performance parameters according to the guides of policy module. As for the network service, policy module returns data package format, flow types, the number of people on line, etc according to the network service type and time.Simulation control policy includes two types which are the analysis of simulation result and SLAM configuration test policy. The former is to help experimenters define the program of data analysis effectively. When experimenters do the network simulation, they only need to set the demands for analyzing what they need. The system will finish the setting operation automatically and this will lower the complicated degree of simulation operation. SLAM system is a high-level interface based on the network management system and it provides a platform of equal negotiation for customers and service providers. The purpose of SLAM configuration test policy is to apply SLAM configuration policy to network simulation system and test its effects to improving the service performance.Based on the above ideas, this paper designs and implements a original system of network emulator based on network scenarios. There are three modules which are policy module, network simulation module and NIST Net interface. In the policy module, we realize PDP, PEP, policy repository, policy editor, and also define the storage method and the format of network scenarios policy, and design the LDAP Schema for policy, policy group, policy condition and policy action respectively. The network scenarios factors which are set by experimenters are treated as property of policy condition Schema. The specific operation of network simulation is treated as policy for action Schema. PDP is used for looking for policy and deciding. PEP is designed for the interface of packaging policy request and distributing policy action.Network scenarios simulation module is the main module in the system. It receives the network scenarios which is input by experimenters, generates network scenarios models according to policy guides and transfer the results to the network emulator. It is made up of three parts which are scenarios generation, status control and simulation control. By calling the network policy, it generates the network devices include terminal nodes, switching nodes, network lines, and controlling their performance parameters to realize service simulation, topology generation, and fault simulation. NIST Net interface delivers the performance parameter from"network scenarios simulation"to command line interface tool of NIST Net in order to build new rules and realize the real physical network damage.Prototype system is developed under Linux system and it uses the software framework of"PhpldapAdmin + OpenLDAP + BDB"to realize store and manage policy. Nistnet-3.0 is installed for network impairment, and network communications is simulated by the message transmission mechanism between the C++ classes. Then a IPTV streaming media performance experiment network is built. The results show that the experiment based on network scenarios is more true and exact, and we reach the expected experiment effects.It is proved by the research and experiment that applying simulation scenarios to experiment network provides a new way of software simulation network, which can be the final test before the real network production. The scenarios generation based on the policy provides a new method of software simulation network and it can also be applied to the real network programming and designing. |