## 3 Development of Software-Based Router and Traffic Generator
### Development of Software-Based Router  
In this work the developed model of the software router is presented, which allows estimating the traffic created by service messages, time of staying of a packet in the node, number of packets in the buffer, probability of loss of packets, jitter, adequacy of routing tables in nodes, establishing optimal structural and functional parameters of a node and parameters of a routing protocol [49]. The model of the software router has the following features:  
* Each component of the model is implemented in the form of a separate application and has its own IP-address and port, which allows you to select and connect components depending on the specific conditions;
* The simulation model of the router can be as close as possible to the specific model of the manufacturer;
* Distribution of components of the data network model is possible both on one and on several computers (servers) for the purpose of maximum approximation to real conditions and modelling networks with an unlimited number of nodes, not limiting the resources of one computer. The router software is based on socket technology, which is the software object of the operating system and consists of the IP address of the device and the TCP port. Using the API of the operating system, the software router receives the generated socket object and uses it to communicate with other software routers that are installed on other physical machines in the local network. In the process of developing the router model, the modular structure of the program in the form of a tree is first built [50; 51]. Then the program modules are programmed alternately, starting with the modules of the lowest level (leaves of the tree of the modular structure of the program), in such an order that for each program module all modules to which it can address are already programmed. After programming all the modules of the program, the individual modules are tested and debugged in the same (ascending) order as their programming. This order of program development seems quite natural at first glance: each module is expressed through already programmed directly subordinate modules, and during testing it uses already debugged modules. To describe the structure of such a system the diagram of classes is used (Figure 1). This is one of the main ways of description, because Unified Modeling Language (UML) is first of all an object-oriented language, and classes are the main (if not the only) \"building material\". Dashed arrows represent dependencies between elements, in particular on the presented diagram those elements that have the arrow pointing at them depend on the elements from which the arrows are outgoing. White diamond arrows show aggregation, elements that have diamond pointed at them, aggregate those elements from which the arrow is outgoing. When an element aggregates other elements it means that the element doesn't much depend on the number of contained elements and will function properly even with a single inner element. Black diamond arrow shows composition. The difference of composition from aggregation is that element strongly depends on the number of contained elements and without inner elements will not be able to operate normally, so inner elements can be considered like composite parts of the overall element. The router model is represented by a set of queues and service devices (Figure 2) and reflects the process of packet transmission as follows:  
(1) Aggregated multiservice traffic arrives at the ports of incoming interfaces. Figure 1: UML diagram of software-based router model. 2 Packets of streams arrive in the input queue
3. The processor of the router on the basis of the classifier, taking into account the discipline of queuing, selects the packet and analyzes its header type of service (ToS), differentiated services code point(DSCP);
4.