Practical application of the multi-model approach in the study of complex systems
PPractical application of the multi-model approach in the study of complex systems
Anna V. Korolkova, * Dmitry S. Kulyabov,
1, 2, † and Michal Hnatiˇc
3, 4, 5, ‡ Department of Applied Probability and Informatics,Peoples’ Friendship University of Russia (RUDN University),6 Miklukho-Maklaya St, Moscow, 117198, Russian Federation Laboratory of Information TechnologiesJoint Institute for Nuclear Research6 Joliot-Curie, Dubna, Moscow region, 141980, Russian Federation Department of Theoretical Physics, SAS, Institute of Experimental Physics,Watsonova 47, 040 01 Koˇsice, Slovak Republic Pavol Jozef ˇSaf´arik University in Koˇsice (UPJˇS),ˇSrob´arova 2, 041 80 Koˇsice, Slovak Republic Bogoliubov Laboratory of Theoretical PhysicsJoint Institute for Nuclear Research6 Joliot-Curie, Dubna, Moscow region, 141980, Russian Federation
Different kinds of models are used to study various natural and technical phenomena. Usually,the researcher is limited to using a certain kind of model approach, not using others (or even notrealizing the existence of other model approaches). The authors believe that a complete study ofa certain phenomenon should cover several model approaches. The paper describes several modelapproaches which we used in the study of the random early detection algorithm for active queuemanagement. Both the model approaches themselves and their implementation and the resultsobtained are described.
Keywords: active queue management, mathematical modeling, simulation, surrogate modeling, stochasticsystems * [email protected] † [email protected] ‡ [email protected] a r X i v : . [ c s . OH ] F e b I. INTRODUCTION
Scientific research is easy to start but difficult to complete. Our study of the Random Early Detection (RED)algorithm stood out from the study of approaches and mechanisms of traffic control in data transmission networks.But the further we went, the less satisfied we were with the results. The originally constructed mathematical modelseemed to us somewhat artificial and non-extensible. To build a more natural mathematical model from first principles,we have developed a method of stochastization of one-step processes. To verify the mathematical model, we have builtphysical and simulation models. To conduct optimization studies, we began to build a surrogate model for the REDalgorithm. At the last we came to an understanding that all of our models form some kind of emergent structure, withthe help of which we can investigate various phenomena — stochastic and statistical systems in particular.In this paper, we try to present our understanding of the multi-model approach to modeling.
II. MODEL APPROACHES
Modeling as a discipline encompasses different types of model approaches. From our point of view, these approachescan be schematically described in a unified manner (see Fig. 1). In this case, the research structure consists ofoperational and theoretical parts. The operational parts are represented by procedures of the system preparation andmeasurement. It is also common to describe the operational part as input and output data.The theoretical part consists of two layers: a model layer and an implementation layer. The implementation layerdescribes the specific structure of the evolution of the system. Depending on the type of implementation, differenttypes of models can be obtained: a mathematical model (implementation — mathematical expressions), a simulationmodel (implementation — an algorithm), a physical model (implementation — an analog system), a surrogate model(implementation — approximation of behavior). Each type of model has its area of applicability, its advantages anddisadvantages. The use of the entire range of models allows the most in-depth and comprehensive study of the modeledsystem.
III. RED ACTIVE QUEUE MANAGEMENT ALGORITHM
Random Early Detection (RED) algorithm is at the heart of several mechanisms to prevent and control congestion inrouter queues. Its main purpose is to smooth out temporary bursts of traffic and prevent prolonged network congestionby notifying traffic sources about the need to reduce the intensity of information transmission.The operation of a module implementing a RED-type algorithm can be schematically represented as follows.When a packet of transmitted data enters the system, it enters the reset module. The decision to remove the packageis made based on the value of the 𝑝 (^ 𝑞 ) function received from the control unit. The function 𝑝 (^ 𝑞 ) depends on theexponentially weighted moving average of the queue length ^ 𝑞 , also calculated by the ontrol unit based on the currentvalue of the queue length 𝑞 .The classic RED algorithm is discussed in detail in [1]. Only the formulas for calculating the reset function 𝑝 (^ 𝑞 ) andthe exponentially weighted moving average queue length ^ 𝑞 are given here. The use of ^ 𝑞 is associated with the need tosmooth outliers of the instantaneous queue length 𝑞 . Theoretical partModelRealisationOperationalpartPreparation OperationalpartMeasurement
Figure 1. Generic structure of the model approach
Theoretical partModelMathematical realisationOperationalpartPreparation OperationalpartMeasurement
Figure 2. Generic structure of the mathematical model
To calculate ^ 𝑞 , the recurrent formula for exponentially weighted moving average (EWMA) is used: ^ 𝑞 𝑘 +1 = (1 − 𝑤 𝑞 )^ 𝑞 𝑘 + 𝑤 𝑞 𝑞 𝑘 , 𝑘 = 0 , , , . . . , where 𝑤 𝑞 , < 𝑤 𝑞 < is the weight coefficient of the exponentially weighted moving average: 𝑤 𝑞 = 1 − 𝑒 − /𝐶 , where 𝐶 is the channel bandwidth (packets per second).The 𝑝 (^ 𝑞 ) packet discard function linearly depends on the ^ 𝑞 , the minimum 𝑞 min and maximum 𝑞 max thresholds andthe maximum discard parameter 𝑝 max , which sets the maximum packet discard level when ^ 𝑞 reaches the value 𝑞 max ,and the function 𝑝 (^ 𝑞 ) is calculated as follows: 𝑝 (^ 𝑞 ) = ⎧⎪⎪⎪⎨⎪⎪⎪⎩ , < ^ 𝑞 𝑞 min , ^ 𝑞 − 𝑞 min 𝑞 max − 𝑞 min 𝑝 max , 𝑞 min < ^ 𝑞 𝑞 max , , ^ 𝑞 > 𝑞 max . (1)The drop function (1) describes the classic RED algorithm. And the main effort in the design of new algorithms likeRED is directed at various modifications of the type of the drop function.Since the complete simulated system consists of interoperable TCP and RED algorithms, it is necessary to simulatethe evolution of the TCP source as well. Since the original model was based on the TCP Reno protocol, we simulatedthis particular protocol.TCP uses a sliding window mechanism to deal with congestion. The implementation of this mechanism depends onthe specific TCP protocol standard.In TCP Reno the congestion control mechanism consists of the following phases: slow start, congestion avoidance,fast transmission, and fast recovery. The dynamics of the congestion window (CWND) size depends on the specificphase.TCP Reno monitors two types of packet loss:• Triple Duplicate ACK (TD). Let the 𝑛 -th packet not to be delivered, and the subsequent packets ( 𝑛 + 1 , 𝑛 + 2 ,etc.) are delivered. For each packet delivered out of order (for 𝑛 + 1 , 𝑛 + 2 , etc.), the receiver sends an ACKmessage for the last undelivered ( 𝑛 -th) packet. Upon receipt of three such packets, the source resends the 𝑛 -thpacket. Besides, the window size is reduced by 2 times 𝑐𝑤𝑛𝑑 → 𝑐𝑤𝑛𝑑/ .• Timeout (TO). When a packet is sent, the timeout timer is started. Each time a confirmation is received, thetimer is restarted. The window is then set to the initial value of the overload window. The first lost packet isresent. The protocol enters the slow start phase.The general congestion control algorithm is of the AIMD type (Additive Increase, Multiplicative Decrease) — anadditive increase of the window size and its multiplicative decrease. IV. MATHEMATICAL MODEL
The most rigorous research is usually based on a mathematical model (see Fig. 2). In this case, the model layer isrealized through mathematical expressions describing the evolution of the system.There are several approaches to modeling RED-type algorithms. The most famous approach is modeling using theautomatic control theory approach [2–4]. To us, this approach seems somewhat artificial and inconsistent. We preferto do our modeling from first principles.We have developed a method of stochastization of one-step processes, which allows us to obtain models from firstprinciples. Moreover, the resulting model models are immanently stochastic [5–7]. Our model of interaction betweenthe TCP source and the RED algorithm is based on these methods and is mathematically represented in the form ofstochastic differential equations with Wiener and Poisson processes [8–10].We will use the following notation. 𝑊 ( 𝑡 ) is the TCP Reno window size, 𝑄 ( 𝑡 ) is the queue size, 𝑇 := 𝑇 ( 𝑄 ( 𝑡 )) is theround-trip time (taking into account equipment delays), 𝑡 is the time, 𝐶 is the queue service intensity, ^ 𝑄 ( 𝑡 ) is theExponentially Weighted Moving-Average (EWMA) [1]: ^ 𝑄 ( 𝑡 ) = (1 − 𝑤 𝑞 ) ^ 𝑄 ( 𝑡 ) + 𝑤 𝑞 𝑄 ( 𝑡 ) , where 𝑤 𝑞 , < 𝑤 𝑞 < is the weight coefficient.We used the method of stochastization of one-step processes to obtain the Fokker–Planck and Langevin equationsfor the stochastic processes 𝑊 ( 𝑡 ) and 𝑄 ( 𝑡 ) .The kinetic equations will be: ⎧⎪⎪⎪⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎪⎪⎪⎩ 𝑊 ( 𝑡 ) −−−→ 𝑊 ( 𝑡 ) ,𝑊 ( 𝑡 )
12 d 𝑁 ( 𝑡 )d 𝑡 −−−−−→ , 𝑊 ( 𝑡 ) 𝑇 −−−→ 𝑄 ( 𝑡 ) , − 𝐶 −−→ 𝑄 ( 𝑡 ) , (2)where d 𝑁 ( 𝑡 ) is the Poisson process [3].Let us write down the Fokker–Planck equations corresponding to the kinetic equations (2): 𝜕𝑤 ( 𝑡 ) 𝜕𝑡 = − 𝜕𝜕𝑊 ( 𝑡 ) [︂(︂ 𝑊 ( 𝑡 ) − 𝑊 ( 𝑡 )2 d 𝑁 ( 𝑡 )d 𝑡 )︂ 𝑤 ( 𝑡 ) ]︂ ++ 12 𝜕 𝜕𝑊 ( 𝑡 ) [︂(︂ 𝑊 ( 𝑡 ) + 𝑊 ( 𝑡 )2 d 𝑁 ( 𝑡 )d 𝑡 )︂ 𝑤 ( 𝑡 ) ]︂ ,𝜕𝑞 ( 𝑡 ) 𝜕𝑡 = − 𝜕𝜕𝑄 ( 𝑡 ) [︂(︂ 𝑊 ( 𝑡 ) 𝑇 − 𝐶 )︂ 𝑞 ( 𝑡 ) ]︂ ++ 12 𝜕 𝜕𝑄 ( 𝑡 ) [︂(︂ 𝑊 ( 𝑡 ) 𝑇 − 𝐶 )︂ 𝑞 ( 𝑡 ) ]︂ , (3)where 𝑤 ( 𝑡 ) is the density of the random process 𝑊 ( 𝑡 ) , 𝑞 ( 𝑡 ) is the density of the random process 𝑄 ( 𝑡 ) .The Langevin equations corresponding to the equations (3) have the form: ⎧⎪⎪⎪⎨⎪⎪⎪⎩ d 𝑊 ( 𝑡 ) = 1 𝑇 d 𝑡 − 𝑊 ( 𝑡 )2 d 𝑁 ( 𝑡 ) + √︂ 𝑇 + 𝑊 ( 𝑡 )2 d 𝑁 ( 𝑡 )d 𝑡 d 𝑉 ( 𝑡 ) , d 𝑄 ( 𝑡 ) = (︂ 𝑊 ( 𝑡 ) 𝑇 − 𝐶 )︂ d 𝑄 ( 𝑡 ) + √︂ 𝑊 ( 𝑡 ) 𝑇 − 𝐶 d 𝑉 ( 𝑡 ) , (4)where d 𝑉 ( 𝑡 ) is the Wiener process corresponding to the random process 𝑊 ( 𝑡 ) , d 𝑉 ( 𝑡 ) is the Wiener processcorresponding to the random process 𝑄 ( 𝑡 ) .The equations (4) are supplemented by the constraint equation (written in differential form for convenience): d ^ 𝑄 ( 𝑡 )d 𝑡 = 𝑤 𝑞 𝐶 ( 𝑄 ( 𝑡 ) − ^ 𝑄 ( 𝑡 )) . This mathematical model can be investigated both in the form of stochastic differential equations and by writingthem down in moments. The equation in moments is naturally easier to study.
Figure 3. Virtual stand for studying the functioning of the RED algorithm. host01 is the packet source; host02 is the recipient.
Theoretical partModelAlgorithmic realisationOperationalpartPreparation OperationalpartMeasurement
Figure 4. Generic structure of the simulation model
V. PHYSICAL MODEL
The resulting mathematical model should be compared with experimental data and verified. Unfortunately, we donot have the resources to take data from a working network or build a full-scale test bench on real network equipment.Therefore, we tried to create a virtual experimental installation based on the virtual machines [11]. Virtual machinesrun images of real routers operating systems. This is what allows us to call this model physical .To create the stand, the software package GNS3 (Graphical Network Simulator) [12] was chosen. This allows you tosimulate a virtual network of routers and virtual machines. The software package GNS3 works on almost all platforms.It can be considered as a graphical interface for different virtual machines. To emulate Cisco devices the Dynamipsemulator is used. Alternatively, emulators such as VirtualBox and Qemu can be used. The latter is especially usefulwhen it used with a KVM system which allows a hardware processor implementation. GNS3 coordinates the operationof various virtual machines and also provides the researcher with a convenient interface for creation and customizationof the required stand configuration. Also, the developed topology can be linked to an external network to manage andcontrol data packets.The stand consists of a Cisco router, a traffic generator, and a receiver. D-ITG (Distributed Internet TrafficGenerator) is used as a traffic generator (see Fig. 3). D-ITG allows us to obtain estimates of the main indicators of thequality of service (average packet transmission delay, delay variation (jitter), packet loss rate, performance) with ahigh degree of confidence.
VI. SIMULATION MODEL
With the development of computer technology it became possible to specify a model implementation not in the formof a mathematical description, but in the form of some algorithm (Fig. 4). This type of model is called simulationmodels and the approach itself is called simulation.The simulation model plays a dual role. The simulation model, debugged and tested on experimental data and a
34 3332 3130 2928 9927 998268 97 25 79624 6 9523 594 22 4 93 12121392 119120 20 192 9111818 1 8990 117 1708811616 871151586 11414 85 113138411212 83 1111182 109110 10 81108 7980 10778106 7710576104 7510374102 7310172100 71 697068 6766 6564 6362 61596058 5756 5554 5352 51495048 4746 4544 4342 4140 3938 3736 35
Figure 5. Visualization of the simulation. Packets drop is shown physical model, can itself serve the purposes of the mathematical model verification. On the other hand, the simulationmodel makes it possible to study the behavior of the modeled system more effectively than the mathematical modelfor different variants of the input data.
A. Simulation model on NS-2
The ns2 [13, 14] package is the network protocol simulation tool. During its existence, the functionality has beenrepeatedly verified by data from field experiments. Therefore, this package itself has become a reference modeling tool.This is exactly the case when a simulation model is a replacement for a physical model and a natural experiment.The program for ns2 is written in the TCL language [15, 16]. The simulation results can be represented usingvisualization tool nam (see Fig. 5).The simulator is built on an event-driven architecture. That is, it implements a discrete approach to modeling. Onthe one hand, this is a plus, since it directly implements the TCP and RED specification (see section III). On the otherhand, the amount of resulting data sharply increases, which makes it difficult to carry out any lengthy simulationexperiment.In our works, this software is used precisely for verification of the obtained results [17, 18].
B. Hybrid model for RED algorithm
To study the RED algorithm we developed the prototype of the simulation model. We wanted to avoid the resourceintensiveness of discrete modeling approaches. However, it was necessary to take into account the discrete specifics ofTCP and RED (see section III). Therefore, we have chosen a hybrid (continuous–discrete) approach. The model wasimplemented in the hybrid modeling language Modelica [19, 20].Since we are building the hybrid continuous–discrete model, then to describe each phase of TCP functioning, we willturn to the model with continuous time. The transition between phases will be described by discrete states.To build a hybrid model, we need:• write a dynamic model for each state;• replace systems with piecewise constant parameters with systems with variable initial conditions;• write the state diagram of the model (Fig. 6 and 7).The resulting diagrams are directly converted into a Modelica program [21–23].
Slow start do/cwnd + 1
Congestion Avoidance do/cwnd + 1/cwnd
Fast Recovery do/ssth=cwnd/2, cwnd=ssth
Timeout do/cwnd=1, ssth=cwnd/2 [cwnd >= ssth][cwnd >= timeout_th] [cwnd < timeout_th] [retr_timer < 0][cwnd < timeout_th][cwnd >= timeout_th][retr_timer < 0]
Figure 6. TCP state diagram
Calculate EWMAEnqueueCalculate dropping probabilityDrop [q < q_min] [q_min <= q <= q_max] [q > q_max]
Figure 7. RED state diagram
Theoretical partModelSurrogate realisationOperationalpartPreparation OperationalpartMeasurement
Figure 8. Generic structure of the surrogate model
VII. SURROGATE MODEL
Most scientific and technical problems require experiments and simulations to obtain results, to determine thelimitations imposed on the result. However, for many real-world problems simulation alone can take minutes, hours,days. As a result, routine tasks such as decision optimization, decision space exploration, sensitivity analysis, andwhat-if analysis become impossible as they require thousands or millions of modeling evaluations.One way to simplify research is to build surrogate models (approximation models, response surface models,metamodels, black box models) (see Fig. 8) that mimic the behavior of the original model so closely as much aspossible, while being computationally cheap [24]. Surrogate models are built using a data-driven approach. The exactinner workings of the simulation code are not supposed to be known (or even understood), only the input—output(preparation—measurement) behavior is important. The model is built based on modeling the response to a limitednumber (sometimes quite large) of selected data points .The scientific challenge for surrogate modeling is to create a surrogate that is as accurate as possible using as fewmodeling estimates as possible. The process consists of the following main stages [25]:• sample selection;• construction of the surrogate model and optimization of model parameters;• an estimate of the accuracy of the surrogate. Note that this type of model is known to many researchers. When only one modeling variable is involved, the process of building thesurrogate model is called curve fitting
For some problems the nature of the true function is a priori unknown, so it is unclear which surrogate model willbe the most accurate. Moreover, it is not clear how to obtain the most reliable estimates of the accuracy of a givensurrogate. In this case, the model layer (Fig. 8) is replaced by the researcher’s guess. In our case, the surrogate modelis based on a clearly formulated mathematical model, which allows us to obtain clear, substantiated results of surrogatemodeling.At this moment we are developing a methodology for constructing surrogate models for both RED type algorithmsand arbitrary stochastic one-step processes.
VIII. CONCLUSION
The authors tried to outline the concept of a multi-model approach to the study of physical and technical systemsusing the example of the interaction between the TCP protocol and the RED-type active queue management algorithm.This research is in line with the research of stochastic models in science and technology.The multi-model approach makes it possible to increase the efficiency of the study of the phenomenon, to consider itfrom different angles, and to create effective software systems.
ACKNOWLEDGMENTS
The publication has been prepared with the support of the “RUDN University Program 5-100” and funded byRussian Foundation for Basic Research (RFBR) according to the research project No 19-01-00645. [1] S. Floyd, V. Jacobson, Random Early Detection Gateways for Congestion Avoidance, IEEE/ACM Transactions onNetworking 1 (4) (1993) 397–413. doi:10.1109/90.251892 .[2] V. Misra, W.-B. Gong, D. Towsley, Stochastic Differential Equation Modeling and Analysis of TCP-Windowsize Behavior,Proceedings of PERFORMANCE 99 (1999).[3] V. Misra, W.-B. Gong, D. Towsley, Fluid-Based Analysis of a Network of AQM Routers Supporting TCP Flows with anApplication to RED, ACM SIGCOMM Computer Communication Review 30 (4) (2000) 151–160. doi:10.1145/347057.347421 .[4] C. V. V. Hollot, V. Misra, D. Towsley, A Control Theoretic Analysis of RED, in: Proceedings IEEE INFOCOM 2001.Conference on Computer Communications. Twentieth Annual Joint Conference of the IEEE Computer and CommunicationsSociety (Cat. No.01CH37213), Vol. 3, IEEE, 2001, pp. 1510–1519. doi:10.1109/INFCOM.2001.916647 .[5] M. N. Gevorkyan, A. V. Demidova, T. R. Velieva, A. V. Korol’kova, D. S. Kulyabov, L. A. Sevast’yanov, Implementing aMethod for Stochastization of One-Step Processes in a Computer Algebra System, Programming and Computer Software44 (2) (2018) 86–93. arXiv:1805.03190 , doi:10.1134/S0361768818020044 .[6] M. Hnatiˇc, E. G. Eferina, A. V. Korolkova, D. S. Kulyabov, L. A. Sevastyanov, Operator Approach to the Master Equation forthe One-Step Process, EPJ Web of Conferences 108 (2016) 02027. arXiv:1603.02205 , doi:10.1051/epjconf/201610802027 .[7] A. V. Korolkova, E. G. Eferina, E. B. Laneev, I. A. Gudkova, L. A. Sevastianov, D. S. Kulyabov, Stochastization OfOne-Step Processes In The Occupations Number Representation, Proceedings 30th European Conference on Modelling andSimulation (2016) 698–704 doi:10.7148/2016-0698 .[8] A. V. Korolkova, D. S. Kulyabov, T. R. Velieva, I. S. Zaryadov, Essay on the study of the self-oscillating regime in thecontrol system, in: M. Iacono, F. Palmieri, M. Gribaudo, M. Ficco (Eds.), 33 European Conference on Modelling andSimulation, ECMS 2019, Vol. 33 of Communications of the ECMS, European Council for Modelling and Simulation, Caserta,2019, pp. 473–480. doi:10.7148/2019-0473 .[9] T. R. Velieva, D. S. Kulyabov, A. V. Korolkova, I. S. Zaryadov, The approach to investigation of the the regions ofself-oscillations, Journal of Physics: Conference Series 937 (2017) 012057.1–8. doi:10.1088/1742-6596/937/1/012057 .[10] T. R. Velieva, A. V. Korolkova, D. S. Kulyabov, B. A. Dos Santos, Model Queue Management on Routers, Bulletin ofPeoples’ Friendship University of Russia. Series “Mathematics. Information Sciences. Physics” 2 (2014) 81–92.[11] T. R. Velieva, A. V. Korolkova, D. S. Kulyabov, Designing Installations for Verification of the Model of Active QueueManagement Discipline RED in the GNS3, in: 6th International Congress on Ultra Modern Telecommunications andControl Systems and Workshops (ICUMT), IEEE Computer Society, 2015, pp. 570–577. arXiv:1504.02324 , doi:10.1109/ICUMT.2014.7002164 .[12] C. Welsh, GNS3 network simulation guide, PACKT Publisher, 2013.[13] T. Issariyakul, E. Hossain, Introduction to Network Simulator NS2, Springer US, Boston, MA, 2012. doi:10.1007/978-1-4614-1406-3 .[14] E. Altman, T. Jim´enez, NS Simulator for Beginners, Synthesis Lectures on Communication Networks 5 (1) (2012) 1–184. doi:10.2200/S00397ED1V01Y201112CNT010 . [15] B. Welch, K. Jones, Practical Programming in Tcl and Tk, 4th Edition, Prentice Hall, 2003.[16] A. P. Nadkarni, The Tcl Programming Language: A Comprehensive Guide, CreateSpace Independent Publishing Platform,2017.[17] T. R. Velieva, A. V. Korolkova, D. S. Kulyabov, S. A. Abramov, Parametric study of the control system in the TCPnetwork, in: 10th International Congress on Ultra Modern Telecommunications and Control Systems, Moscow, 2019, pp.334–339. doi:10.1109/ICUMT.2018.8631267 .[18] T. R. Velieva, A. V. Korolkova, A. V. Demidova, D. S. Kulyabov, Software Package Development for the Active TrafficManagement Module Self-oscillation Regime Investigation, in: W. Zamojski, J. Mazurkiewicz, J. Sugier, T. Walkowiak,J. Kacprzyk (Eds.), Contemporary Complex Systems and Their Dependability: Proceedings of the Thirteenth InternationalConference on Dependability and Complex Systems DepCoS-RELCOMEX, July 2-6, 2018, Brun´ow, Poland, Vol. 761 ofAdvances in Intelligent Systems and Computing, Springer International Publishing, Cham, 2019, conference paper 48, pp.515–525. doi:10.1007/978-3-319-91446-6_48 .[19] P. Fritzson, Principles of Object-Oriented Modeling and Simulation with Modelica 2.1, Wiley-IEEE Press, 2003.[20] P. Fritzson, Introduction to Modeling and Simulation of Technical and Physical Systems with Modelica, John Wiley &Sons, Inc., Hoboken, NJ, USA, 2011. doi:10.1002/9781118094259 .[21] T. R. Velieva, E. G. Eferina, A. V. Korolkova, D. S. Kulyabov, L. A. Sevastianov, Modelica-based TCP simulation, Journalof Physics: Conference Series 788 (100) (2017) 012036.1–7. doi:10.1088/1742-6596/788/1/012036 .[22] A.-M. Y. Apreutesey, A. V. Korolkova, D. S. Kulyabov, Modeling RED algorithm modifications in the OpenModelica, in: D. S.Kulyabov, K. E. Samouylov, L. A. Sevastianov (Eds.), Proceedings of the Selected Papers of the 9th International Conference"Information and Telecommunication Technologies and Mathematical Modeling of High-Tech Systems" (ITTMM-2019),Moscow, Russia, April 15-19, 2019, Vol. 2407 of CEUR Workshop Proceedings, Moscow, 2019, pp. 5–14.[23] A. V. Korolkova, T. R. Velieva, P. A. Abaev, L. A. Sevastianov, D. S. Kulyabov, Hybrid Simulation Of Active TrafficManagement, Proceedings 30th European Conference on Modelling and Simulation (2016) 685–691 doi:10.7148/2016-0685 .[24] Y. Jin, Surrogate-assisted evolutionary computation: Recent advances and future challenges, Swarm and EvolutionaryComputation 1 (2) (2011) 61–70. doi:10.1016/j.swevo.2011.05.001 .[25] L. A. Sevastianov, A. L. Sevastianov, E. A. Ayrjan, A. V. Korolkova, D. S. Kulyabov, I. Pokorny, Structural Approachto the Deep Learning Method, in: V. Korenkov, T. Strizh, A. Nechaevskiy, T. Zaikina (Eds.), Proceedings of the 27thSymposium on Nuclear Electronics and Computing (NEC-2019), Vol. 2507 of CEUR Workshop Proceedings, Budva, 2019,pp. 272–275. рактическое применение мультимодельного подхода при исследовании сложныхсистем А. В. Королькова, * Д. С. Кулябов,
1, 2, † и М. Гнатич ‡ Кафедра прикладной информатики и теории вероятностей,Российский университет дружбы народов,117198, Москва, ул. Миклухо-Маклая, д. 6 Лаборатория информационных технологий,Объединённый институт ядерных исследований,ул. Жолио-Кюри 6, Дубна, Московская область, Россия, 141980 Лаборатория теоретической физики,Объединённый институт ядерных исследований,ул. Жолио-Кюри 6, Дубна, Московская область, Россия, 141980
Для исследования разнообразных природных и технических явлений используется разныетипы моделей. Обычно исследователь ограничивается использованием какого-то определённоготипа модельного подхода, не используя другие (или даже не осознавая существование другихмодельных подходов). Авторы считают, что полное исследование некоторого явления должноохватывать несколько модельных подходов. В работе описываются несколько модельных подхо-дов, использованные нами при исследовании модуля активного управления трафиком RED.Описываются как сами модельные подходы, так и их реализации и полученные результаты.
Ключевыеслова: активное управление трафиком, математическое моделирование, имитационное моде-лирование, суррогатное моделирование, стохастические системы * [email protected] † [email protected] ‡ [email protected] a r X i v : . [ c s . OH ] F e b I. ВВЕДЕНИЕ
Научное исследование легко начать, но трудно завершить. Наше исследование алгоритма RED выделилосьиз исследования подходов и механизмов управления трафиком в сетях передачи данных. Но чем дальше мыпродвигались, тем менее нас удовлетворяли полученные результаты. Первоначально построенная математи-ческая модель казалась нам несколько искусственной и нерасширяемой. Для построения более естественнойматематической модели из первых принципов нами была разработана методика стохастизации одношаговыхпроцессов. Для верификации математической модели нами были построены физическая и имитационные модели.Для проведения оптимизационных исследований мы стали строить суррогатную модель алгоритма RED. Вконце концов мы достигли понимания, что все наши модели образуют некоторую эмерджентную структуру, спомощью которой можно исследовать разнообразные явления. В частности, стохастические и статистическиесистемы.В этой работе мы пытаемся представить наше понимание мультимодельного подхода к моделированию.
II. МОДЕЛЬНЫЕ ПОДХОДЫ
Моделирование как дисциплина охватывает разные типы модельных подходов. С нашей точки зрения этиподходы можно схематически описать единым образом (см. рис. 1). В данном случае структура исследованиясостоит из операциональных и теоретических частей. Операциональные части представлены процедурамиприготовления системы и измерения. Также распространено описание операциональной части как входных ивыходных данных.Теоретическая часть состоит из двух слоёв: модельного слоя и слоя реализации. Слой реализации описываетконкретную структуру эволюции системы. В зависимости от типа реализации, можно получать разные видымоделей: математическую модель (реализация — математические выражения), имитационная модель (реализа-ция — алгоритм), физическая модель (реализация — аналоговая система), суррогатная модель (реализация —аппроксимация поведения). Каждый тип моделей имеет свою область применимости, свои преимущества инедостатки. Использование всего спектра моделей позволяет наиболее глубокое и всестороннее исследованиемоделируемой системы.
III. АЛГОРИТМ АКТИВНОГО УПРАВЛЕНИЯ ТРАФИКОМ RED
Алгоритм Random Early Detection (RED) лежит в основе ряда механизмов предотвращения и контроляперегрузок в очередях маршрутизаторов. Его основное предназначение заключается в сглаживании временныхвсплесков трафика и предупреждении длительной перегрузки сети посредством уведомления источников трафикао необходимости снижения интенсивности передачи информации.Функционирование модуля, реализующего алгоритм типа RED, можно схематично представить следующимобразом.Пакет передаваемых данных при поступлении в систему попадает в модуль сброса. Решение о сбросе пакетапринимается на основе значения функции 𝑝 (^ 𝑞 ) , получаемого от управляющего модуля. Функция 𝑝 (^ 𝑞 ) зависит отзначения экспоненциально взвешенного скользящего среднего размера длины очереди ^ 𝑞 , также вычисляемогоуправляющим модулем, основываясь на текущем значении длины очереди 𝑞 . ТеоретическаячастьМодельРеализацияОперациональнаячастьПриготовление ОперациональнаячастьИзмерение
Рис. 1. Общая структура модельного подхода
Классический алгоритм RED подробно рассмотрен в работе [1]. Здесь приведены лишь формулы для расчётафункции сброса 𝑝 (^ 𝑞 ) и экспоненциально взвешенной скользящей средней длины очереди ^ 𝑞 . Использование ^ 𝑞 вызвано необходимостью сглаживания выбросов мгновенной длины очереди 𝑞 .Для вычисления ^ 𝑞 используется рекуррентная формула экспоненциально взвешенного скользящего среднего(Exponentially Weighted Moving-Average, EWMA): ^ 𝑞 𝑘 +1 = (1 − 𝑤 𝑞 )^ 𝑞 𝑘 + 𝑤 𝑞 𝑞 𝑘 , 𝑘 = 0 , , , . . . , где 𝑤 𝑞 , < 𝑤 𝑞 < — весовой коэффициент экспоненциально взвешенного скользящего среднего: 𝑤 𝑞 = 1 − 𝑒 − /𝐶 , где 𝐶 — пропускная способность канала (пакетов в секунду).Функция 𝑝 (^ 𝑞 ) сброса пакетов линейно зависит от ^ 𝑞 , минимального 𝑞 min и максимального 𝑞 max пороговыхзначений и параметра максимального сброса 𝑝 max , задающего максимальный уровень сброса пакетов придостижении ^ 𝑞 значения 𝑞 max , и вычисляется следующим образом: 𝑝 (^ 𝑞 ) = ⎧⎪⎪⎪⎨⎪⎪⎪⎩ , < ^ 𝑞 𝑞 min , ^ 𝑞 − 𝑞 min 𝑞 max − 𝑞 min 𝑝 max , 𝑞 min < ^ 𝑞 𝑞 max , , ^ 𝑞 > 𝑞 max . (1)Данная функция сброса (1) описывает классический алгоритм RED. И основные усилия при конструированииновых алгоритмов типа RED направлено на разные модификации вида функции сброса.Поскольку полная моделируемая система состоит из взаимодействующих протокола TCP и алгоритма RED,то необходимо моделировать также и эволюцию источника, работающего по протоколу TCP. Поскольку ориги-нальная модель базировалась на протоколе TCP Reno, то нами моделировался именно этот протокол.В протоколе TCP используется механизм скользящего окна для борьбы с перегрузками. Реализация данногомеханизма зависит от конкретного стандарта протокола TCP.В TCP Reno механизм управления перегрузками состоит из следующих фаз: медленный старт, предотвраще-ние перегрузок, быстрая передача и быстрое восстановление. Динамика изменения размера окна перегрузки(Congestion Window, CWND) зависит от конкретной фазы.Протокол TCP Reno отслеживает два варианта потери пакетов:• Тройное дублирование подтверждения (Triple Duplicate ACK, TD). Пусть 𝑛 -й пакет не доставлен, апоследующие пакеты ( 𝑛 + 1 , 𝑛 + 2 и т.д.) доставлены. Для каждого пакета, доставленного в нарушенииочерёдности (для 𝑛 + 1 , 𝑛 + 2 и т.д.) получатель отсылает сообщение ACK для последнего недоставленного( 𝑛 -го) пакета. При получении трёх таких пакетов источник перепосылает 𝑛 -й пакет. Кроме того, размерокна уменьшается в 2 раза 𝑐𝑤𝑛𝑑 → 𝑐𝑤𝑛𝑑/ .• Тайм-аут (Timeout, TO). При отправке пакета запускается таймер тайм-аута. При получении каждогоподтверждения таймер перезапускается. Окно при этом устанавливается в начальное значение окнаперегрузки. Первый потерянный пакет перепосылается. Протокол переходит в фазу медленного старта.Общий алгоритм управления перегрузкой относится к типу AIMD (Additive Increase, Multiplicative Decrease) —аддитивное увеличение размера окна и мультипликативное его уменьшение. IV. МАТЕМАТИЧЕСКАЯ МОДЕЛЬ
Наиболее строгое исследование базируется, обычно, на математической модели (см. рис. 2). В этом случаемодельный слой реализуется посредством математических выражений, описывающих эволюцию системы.Есть несколько подходов к моделированию алгоритмов типа RED. Наиболее известным подходом являетсямоделирование с использование подхода теории автоматического управления [2–4]. Нам этот подход представля-ется несколько искусственным и непоследовательным. Мы предпочитаем проводить моделирование из первыхпринципов.Нами разработан метод стохастизации одношаговых процессов, который позволяет получать модели из первыхпринципов. При этом полученные модели модели являются имманентно стохастическими [5–7]. Наша модель вза-имодействия источника TCP и алгоритма RED строится на основе этих методов и математически представляетсяв виде стохастических дифференциальных уравнений с винеровским и пуассоновским процессом [8–10].
ТеоретическаячастьМодельМатематическое представлениеОперациональнаячастьПриготовление ОперациональнаячастьИзмерение
Рис. 2. Общая структура математической модели
Будем использовать следующие обозначения. 𝑊 ( 𝑡 ) — функция изменения размера окна TCP Reno, 𝑄 ( 𝑡 ) —функция изменения размера очереди, 𝑇 := 𝑇 ( 𝑄 ( 𝑡 )) — время двойного оборота c учётом задержек обработкипакетов в оборудовании, 𝑡 — время, 𝐶 — интенсивность обслуживания пакетов в очереди, ^ 𝑄 ( 𝑡 ) — функцияэкспоненциально взвешенного скользящего среднего (Exponentially Weighted Moving-Average, EWMA) [1]: ^ 𝑄 ( 𝑡 ) = (1 − 𝑤 𝑞 ) ^ 𝑄 ( 𝑡 ) + 𝑤 𝑞 𝑄 ( 𝑡 ) , где 𝑤 𝑞 , < 𝑤 𝑞 < — весовой коэффициент.Мы использовали метод стохастизации одношаговых процессов для получения уравнений Фоккера–Планка иЛанжевена для случайных процессов 𝑊 ( 𝑡 ) и 𝑄 ( 𝑡 ) .Кинетические уравнения будут иметь вид: ⎧⎪⎪⎪⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎪⎪⎪⎩ 𝑊 ( 𝑡 ) −−−→ 𝑊 ( 𝑡 ) ,𝑊 ( 𝑡 )
12 d 𝑁 ( 𝑡 )d 𝑡 −−−−−→ , 𝑊 ( 𝑡 ) 𝑇 −−−→ 𝑄 ( 𝑡 ) , − 𝐶 −−→ 𝑄 ( 𝑡 ) , (2)где d 𝑁 ( 𝑡 ) — пуассоновский процесс [3].Выпишем уравнения Фоккера–Планка, соответствующее кинетическим уравнениям (2): 𝜕𝑤 ( 𝑡 ) 𝜕𝑡 = − 𝜕𝜕𝑊 ( 𝑡 ) [︂(︂ 𝑊 ( 𝑡 ) − 𝑊 ( 𝑡 )2 d 𝑁 ( 𝑡 )d 𝑡 )︂ 𝑤 ( 𝑡 ) ]︂ ++ 12 𝜕 𝜕𝑊 ( 𝑡 ) [︂(︂ 𝑊 ( 𝑡 ) + 𝑊 ( 𝑡 )2 d 𝑁 ( 𝑡 )d 𝑡 )︂ 𝑤 ( 𝑡 ) ]︂ ,𝜕𝑞 ( 𝑡 ) 𝜕𝑡 = − 𝜕𝜕𝑄 ( 𝑡 ) [︂(︂ 𝑊 ( 𝑡 ) 𝑇 − 𝐶 )︂ 𝑞 ( 𝑡 ) ]︂ ++ 12 𝜕 𝜕𝑄 ( 𝑡 ) [︂(︂ 𝑊 ( 𝑡 ) 𝑇 − 𝐶 )︂ 𝑞 ( 𝑡 ) ]︂ , (3)где 𝑤 ( 𝑡 ) — плотность распределения случайного процесса 𝑊 ( 𝑡 ) , 𝑞 ( 𝑡 ) — плотность распределения случайногопроцесса 𝑄 ( 𝑡 ) .Соответствующие уравнениям (3) уравнения Ланжевена имеет вид: ⎧⎪⎪⎪⎨⎪⎪⎪⎩ d 𝑊 ( 𝑡 ) = 1 𝑇 d 𝑡 − 𝑊 ( 𝑡 )2 d 𝑁 ( 𝑡 ) + √︂ 𝑇 + 𝑊 ( 𝑡 )2 d 𝑁 ( 𝑡 )d 𝑡 d 𝑉 ( 𝑡 ) , d 𝑄 ( 𝑡 ) = (︂ 𝑊 ( 𝑡 ) 𝑇 − 𝐶 )︂ d 𝑄 ( 𝑡 ) + √︂ 𝑊 ( 𝑡 ) 𝑇 − 𝐶 d 𝑉 ( 𝑡 ) , (4)где d 𝑉 ( 𝑡 ) — винеровский процесс, соответствующий случайному процессу 𝑊 ( 𝑡 ) , d 𝑉 ( 𝑡 ) — винеровский процесс,соответствующий случайному процессу 𝑄 ( 𝑡 ) . Рис. 3. Виртуальный стенд для исследования функционирования алгоритма RED. host01 — источник пакетов; host02 —получатель.
Уравнения (4) дополняются уравнением связи (для удобства записанное в дифференциальном виде): d ^ 𝑄 ( 𝑡 )d 𝑡 = 𝑤 𝑞 𝐶 ( 𝑄 ( 𝑡 ) − ^ 𝑄 ( 𝑡 )) . Исследовать данную математическую модель можно как в виде стохастических дифференциальных уравнений,так и записав их в моментах. Уравнение в моментах, естественно, легче для исследования.
V. ФИЗИЧЕСКАЯ МОДЕЛЬ
Полученную математическую модель нужно сопоставить с экспериментальными данными, верифицировать её.К сожалению, мы не обладаем ресурсами для снятия показаний с работающей сети или для построения натурногостенда на настоящем сетевом оборудовании. Поэтому нами была произведена попутка собрать виртуальнуюэкспериментальную установку на основе виртуальных машин [11]. На виртуальных машинах выполняютсяобразы операционных систем реальных маршрутизаторов. Именно это позволяет нам называть данную модель физической .Для построения стенда был выбран программный комплекс GNS3 (Graphical Network Simulator) [12]. Он позво-ляет моделировать виртуальную сеть из маршрутизаторов и виртуальных машин. Работает практически на всехплатформах. Фактически это графический интерфейс для разных виртуальных машин. Для эмуляции устройствCisco используется эмулятор dynamips. Кроме того, можно использовать такие эмуляторы, как VirtualBox иQemu. Последний особенно удобен при использовании с системой KVM, позволяющей использовать аппаратнуюреализацию процессора. Фактически, GNS3 осуществляет оркестрацию работы разных виртуальных машин,а также предоставляет исследователю удобный интерфейс создания и настройки необходимой конфигурациистенда. Кроме того, есть возможность соединения проектируемой топологии с внешней сетью для управления иманипуляций пакетами данных.Стенд состоит из маршрутизатора Cisco, генератора трафика и получателя. В качестве генератора трафикаиспользуется D-ITG (Distributed Internet Traffic Generator) (рис. 3). D-ITG позволяет получить оценки основныхпоказателей качества обслуживания (средняя задержка передачи пакетов, вариация задержки (джиттер),коэффициент потерь пакетов, производительность) с высокой степенью достоверности.
VI. ИМИТАЦИОННАЯ МОДЕЛЬ
С развитием компьютерной техники появилась возможность задавать модельную реализацию не в видематематического описания, а в виде некоторого алгоритма (рис. 4). Такого типа модели получили названиеимитационных моделей, а сам подход получил название имитационного моделирования.Имитационная модель играет двоякую роль. Отлаженная и проверенная на экспериментальных данных ифизической модели имитационная модель сама по себе может служить целям верификации математической
ТеоретическаячастьМодельАлгоритмическое представлениеОперациональнаячастьПриготовление ОперациональнаячастьИзмерение
Рис. 4. Общая структура имитационной модели
34 3332 3130 2928 9927 998268 97 25 79624 6 9523 594 22 4 93 12121392 119120 20 192 9111818 1 8990 117 1708811616 871151586 11414 85 113138411212 83 1111182 109110 10 81108 7980 10778106 7710576104 7510374102 7310172100 71 697068 6766 6564 6362 61596058 5756 5554 5352 51495048 4746 4544 4342 4140 3938 3736 35
Рис. 5. Визуализация моделирования системы. Показан сброс пакетов модели. С другой стороны, имитационная модель позволяет более эффективно, чем математическая модель,исследовать поведение моделируемой системы при разных вариантах входных данных.
A. Имитационная модель на NS-2
Пакет ns2 [13, 14] является средством имитационного моделирования сетевых протоколов. За время своегосуществования функционал многократно верифицировался данными натурных экспериментов. Поэтому этотпакет сам стал эталонном средством моделирования. Это именно тот случай, когда имитационная модельявляется заменой физической модели и натурного эксперимента.Программа для ns2 пишется на языке TCL [15, 16]. Результаты моделирования можно представить с помощьюсредства визуализации nam (см. рис. 5).Средство моделирования построено по событийно-ориентированной архитектуре. То есть реализует дискретныйподход к моделирования. С одной стороны это является плюсом, поскольку напрямую реализует спецификациюTCP и RED (см. раздел III). С другой стороны резко возрастает количество результирующих данных, что делаетзатруднённым проведение сколь-либо длительного имитационного эксперимента.В наших работах данный программный продукт используется именно как средство верификации полученныхрезультатов [17, 18].
Slow start do/cwnd + 1
Congestion Avoidance do/cwnd + 1/cwnd
Fast Recovery do/ssth=cwnd/2, cwnd=ssth
Timeout do/cwnd=1, ssth=cwnd/2 [cwnd >= ssth][cwnd >= timeout_th] [cwnd < timeout_th] [retr_timer < 0][cwnd < timeout_th][cwnd >= timeout_th][retr_timer < 0]
Рис. 6. Диаграмма состояний TCP
Calculate EWMAEnqueueCalculate dropping probabilityDrop [q < q_min] [q_min <= q <= q_max] [q > q_max]
Рис. 7. Диаграмма состояний RED
ТеоретическаячастьМодельСуррогатное представлениеОперациональнаячастьПриготовление ОперациональнаячастьИзмерение
Рис. 8. Общая структура суррогатной модели
B. Гибридная модель алгоритма RED
Для исследования алгоритма RED нами был разработан прототип имитационной модели. Мы хотели избежатьресурсозатратности дискретных подходов моделирования. Но при этом необходимо было учесть дискретнуюспецификацию TCP и RED (см. раздел III). Поэтому нами был выбран гибридный (непрерывно–дискретный)подход. Модель была реализована на языке гибридного моделирования Modelica [19, 20].Поскольку мы строим гибридную непрерывно–дискретную модель, то для описания каждой фазы функцио-нирования TCP перейдём к модели с непрерывным временем. Переход же между фазами будет описыватьсядискретными состояниями.Для построения гибридной модели необходимо:• записать динамическую модель для каждого состояния;• заменить системы с кусочно–постоянными параметрами на системы с переменными начальными условиями;• записать диаграмму состояний модели (рис. 6 и 7).Полученные диаграммы непосредственно преобразовываются в программу на языке Modelica [21–23].
VII. СУРРОГАТНАЯ МОДЕЛЬ
Большинство научных и технических проблем требуют экспериментов и моделирования для получениярезультатов, определения ограничений, накладываемых на результат. Однако для многих реальных проблемодно только моделирование может занять несколько минут, часов, дней. В результате рутинные задачи, такиекак оптимизация решений, исследование пространства решений, анализ чувствительности и анализ «что, если»становятся невозможными, поскольку они требуют тысяч или миллионов оценок моделирования.Один из способов упростить исследование — построить суррогатные модели (аппроксимационные модели,модели поверхности отклика, метамодели, модели чёрного ящика) (см. рис. 8), которые имитируют поведениеисходной модели настолько близко, насколько это возможно, в то время как вычислительно дёшевы [24].Суррогатные модели строятся с использованием подхода, основанного на данных. Точная внутренняя работакода моделирования не предполагается известной (или даже понятой), важно только поведение ввода–вывода(приготовления–измерения). Модель строится на основе моделирования реакции на ограниченное количество(порой достаточно большое) выбранных точек данных .Научная задача суррогатного моделирования заключается в создании суррогата, который является макси-мально точным, используя как можно меньше оценок моделирования. Процесс состоит из следующих основныхэтапов, которые могут чередоваться [25]:• выбор образца;• построение суррогатной модели и оптимизация параметров модели;• оценка точности суррогата.Для некоторых проблем природа истинной функции априори неизвестна, поэтому неясно, какая суррогатнаямодель будет наиболее точной. Кроме того, непонятно, как получить наиболее надёжные оценки точностиданного суррогата. В данном случае модельный слой (рис. 8) заменяется догадками исследователя. В нашемже случае суррогатная модель базируется на ясно сформулированной математической модели, что позволяетполучить ясные, обоснованные результаты суррогатного моделирования.На данный момент нами разрабатывается методика построения суррогатных моделей как для собственноалгоритмов типа RED, так и для произвольных стохастических одношаговых процессов. VIII. ЗАКЛЮЧЕНИЕ
Авторы попытались обрисовать концепцию мультимодельного подхода к исследованию физических и техниче-ских систем на примере взаимодействующих протокола TCP и алгоритма активного управления трафиком типаRED. Данное исследование находится в русле исследований стохастических моделей в науке и технике.Мультимодельный подход позволяет повысить эффективность исследование явления, рассмотреть его с разныхсторон и создать эффективные программные комплексы.
БЛАГОДАРНОСТИ