Academia.eduAcademia.edu

Hybrid modeling of communication networks using Modelica

2002

Modeling and simulation of communication networks using Modelica is discussed. Congestion control in packet-switched networks, such as the Internet, is today mainly analyzed through time-consuming simulations of individual packets. We show, by developing a model library based on a recent hybrid systems model, that Modelica provides an efficient platform for the analysis of communication networks. As an example, a comparison between the two congestion control protocols is presented.

)lUQTYLVW'6WUDQGHPDU.-RKDQVVRQ.++HVSDQKD-3 +\EULG0RGHOLQJRI&RPPXQLFDWLRQ1HWZRUNV8VLQJ0RGHOLFD QG,QWHUQDWLRQDO0RGHOLFD&RQIHUHQFH3URFHHGLQJVSS 3DSHUSUHVHQWHGDWWKHQG,QWHUQDWLRQDO0RGHOLFD&RQIHUHQFH0DUFK 'HXWVFKHV=HQWUXPIU/XIWXQG5DXPIDKUWH9 '/5 2EHUSIDIIHQKRIHQ*HUPDQ\ $OOSDSHUVRIWKLVZRUNVKRSFDQEHGRZQORDGHGIURP KWWSZZZ0RGHOLFDRUJ&RQIHUHQFHSDSHUVVKWPO 3URJUDP&RPPLWWHH œ 0DUWLQ 2WWHU 'HXWVFKHV =HQWUXP IU /XIW XQG 5DXPIDKUW H9 '/5  ,QVWLWXW IU 5RERWLN XQG 0HFKDWURQLN 2EHUSIDIIHQKRIHQ *HUPDQ\ FKDLUPDQ RI WKH SURJUDP FRPPLWWHH  œ +LOGLQJ(OPTYLVW'\QDVLP$%/XQG6ZHGHQ œ 3HWHU )ULW]VRQ 3(/$% 'HSDUWPHQW RI &RPSXWHU DQG ,QIRUPDWLRQ 6FLHQFH /LQN|SLQJ 8QLYHUVLW\6ZHGHQ /RFDORUJDQL]HUV 0DUWLQ2WWHU$VWULG-DVFKLQVNL&KULVWLDQ6FKZHLJHU(ULND:RHOOHU-RKDQQ%DOV 'HXWVFKHV=HQWUXPIU/XIWXQG5DXPIDKUWH9 '/5 ,QVWLWXWIU5RERWLNXQG 0HFKDWURQLN2EHUSIDIIHQKRIHQ*HUPDQ\ Färnqvist D., Strandemar K., Johansson K.H., Hespanha J.P. Hybrid Modeling of Communication Networks ... Hybrid Modeling of Communication Networks Using Modelica Daniel Färnqvist†, Katrin Strandemar†, Karl Henrik Johansson†, ‡ and João Pedro Hespanha§ Abstract Modeling and simulation of communication networks using Modelica is discussed. Congestion control in packet-switched networks, such as the Internet, is today mainly analyzed through time-consuming simulations of individual packets. We show, by developing a model library based on a recent hybrid systems model, that Modelica provides an efficient platform for the analysis of communication networks. As an example, a comparison between the two congestion control protocols is presented. 1 Introduction The interaction with a variety of networks plays an important role in everyone’s life. A growing use of networks, such as the Internet, with their widening set of services increases the demand on the control of the network. The objective is often to improve traffic throughput and to better accommodate different service demands. Communication networks experience major problems due to traffic congestion. Today’s congestion control is in most networks implemented as end-to-end protocols, e.g., [4, 12, 10]. The protocols have proved to form the basis of a remarkably robust and scalable system, though the understanding of the basic principles of these complex systems is far from satisfactory. There is intensive research on modeling and simulation of the Internet. It has been pointed out that classical network models from telecommunication based on Poisson modeling are not suitable for the Internet [8]. Recent models capturing the self-similar nature of the traffic has been developed [5]. The general opinion in the network area is still that Internet modeling and simulation are open research problems [9]. ✁ The authors want to thank Håkan Hjalmarsson and Gunnar Karlsson for helpful discussions. † Dept. of Signals, Sensors & Systems, Royal Institute of Technology, SE–100 44 Stockholm, Sweden ‡ Corresponding author. Tel. +46 8 7907321. Fax +46 8 7907329. [email protected] § Dept. of Electrical & Computer Engineering, University of California, Santa Barbara, CA The Modelica Association 209 The intention of this paper is to describe initial work on modeling packet-switched communication network using Modelica. The standard modeling and simulation environment targeted at networking research is the discrete event simulator ns-2 [7]. ns-2, which was originally developed at UC Berkeley, implements network protocols such as the transmission control protocol (TCP) and traffic source behaviors such as file transfer protocol (FTP) and Telnet. Since ns-2 directly implements the Internet protocols and simulates individual packets, it provides on one hand accurate simulation results but on the other hand a rather slow simulation speed. The result of this is that ns-2 is mainly for studying relatively small networks over a short time scale. The other extreme is to use flow models, i.e., to approximate the packet transmission with a continuous flow and basically neglect the network protocols. Flow models capture average transmission rates but ignores events such as packet drops. Flow models are hence suitable for the study of steady-state behavior but not for evaluating transient phenomena. This is for instance due to that certain congestion control strategies are based on the implicit feedback information from packet drops, which are not included in the flow model. A hybrid systems model, which is based on the average rates but takes packet drops into account, was recently proposed in the literature [3]. The motivation for this model is to capture the network behavior on a time scale in between packet models and flow models. Studies have shown that the hybrid model is able to model many important network phenomena [3, 1]. In this paper, we will show that the hybrid model is suitable for Modelica. Moreover, we show that simulating the model in Dymola provides an efficient environment for studying congestion control in computer networks. The outline of the paper is as follows. Section 2 presents a brief introduction to congestion control in communication networks. The hybrid model is described in Section 3 and its Modelica implementation is discussed in Section 4. An example, where two TCP versions are compared for a small wireless network, is given in Section 5. Modelica 2002, March 18−19, 2002 Hybrid Modeling of Communication Networks ... Färnqvist D., Strandemar K., Johansson K.H., Hespanha J.P. Queue- not - full q f = s f − rf ☎ ✁ ✄ rf = ✁ ✂ sf qf q q = 0, s < B B q = qmax , s > B ? otherwise z := 0 Queue- full s≤B ? drop f z =s−B ✆ qf = sf − ✝ Figure 1: Communication network. rf = 2 Communication Networks q q z = L? s drop f B z := 0 Figure 2: Hybrid queue model. A packet-switched communication network can be described by a directed graph. The nodes represent the routers, which direct the packets from sender to receiver, and the edges correspond to wired or wireless links. Figure 1 illustrates a connection with one sender and one receiver. The bandwidths of the links are limited, so each router has a buffer where packets are stored if more packets are entering the router than is going out. In this way, it is possible to deal with minor traffic congestion in the network. If too many packets enter a router in a short amount of time, however, packets will be dropped due to that the buffer has finite size. The way this congestion problem is handled by the senders on the Internet is through a control mechanism denoted transmission control protocol (TCP). The receiver sends acknowledgments back to the sender, when packets have arrived. In order to efficiently use the network resources, the TCP sender adjusts it sending rate according to a control variable called the window size w. The TCP sender sends w number of packets and waits for acknowledgments for them to return. Hence, w corresponds to the number of unacknowledged packets the sender may have in the network. When the sender has received acknowledgments for all w packets, w is increased by one. If a packet is dropped (so that no acknowledgment for that packet is received), w is decreased by a factor two. Hence, TCP uses additive increase and multiplicative decrease (AIMD) to regulate the congestion window size based on explicit acknowledgments and implicit negative acknowledgments. Although, the AIMD control strategy has proved to be efficient, robust and remarkably scalable for the Internet, it is believed that it might be too abrupt for emerging applications such as streaming of audio and video. Modelica 2002, March 18−19, 2002 qf qf 210 3 Hybrid Model In the hybrid model for communication networks proposed by Hespanha et al. [3, 1], the network dynamics and the TCP dynamics is modeled as hybrid systems (e.g., [2, 11]). Note that the hybrid model is based on traffic flows, but is more accurate than a classical flow model since it handles discrete events such as packet drops and window adjusting. 3.1 Network Dynamics Packet transmission rates are in the hybrid model treated as continuous-time real-valued variables. The received rate of packets at a router is denoted r and the sent rate is denoted s. The number of packets stored in a router queue is denoted q, which is also treated as a continuous variable. The dynamics of the queue is depending on if the queue is full (q qmax ) or not (0 q qmax ). We thus for each router introduce the hybrid system with two discrete states shown in Figure 2. In this model, subscript f refers to flow f , so that the windows w f for all flows are updated according to given equations. Moreover, introduce the variables q ∑ f q f and s ∑ f s f , and let the bandwidth of the outgoing link be equal to a constant B. Note that when the queue is full, a drop will be generated as soon as the variable z is equal to the predefined packet size L. Which flow f of the incoming flows that will lose a packet is determined by the distribution of the flows in the queue. ✞ ✟ ✠ ✞ ✞ The Modelica Association Färnqvist D., Strandemar K., Johansson K.H., Hespanha J.P. Hybrid Modeling of Communication Networks ... 60 q w Timeout 50 40 packets Cong.- avoid. Slow - start 30 20 Fast - recov. 10 0 0 Figure 3: Hybrid TCP model. 0.4 0.6 0.8 1 time 1.2 1.4 1.6 1.8 2 Figure 5: Illustration of congestion avoidance for a network with a single router. When the queue q (solid) exceeds qmax 57, one packets is dropped. TCP reduces accordingly the window w (dashed) by a factor two. Note the characteristic shape of w with intervals of approximately linear growth and periodic jumps. drop f ? Cong. avoid. 0.2 ✞ w& f = rf = 1 RTT f wf ⋅L RTT f w f := w f 2 Figure 4: Simplified model of congestion control in TCP. 3.2 TCP Dynamics The hybrid TCP model consists of four discrete states as shown in Figure 3. We will not detail the continuous dynamics and the transition rules for all states, but rather focus on the most important discrete state, namely, congestion avoidance. It is through the congestion avoidance state the additive increase and multiplicative decrease control strategy described in Section 2 is implemented. Introduce the round-trip time RT T f for flow f as the time between sending a packet and receiving the corresponding acknowledgment. It is given by the sum of the physical propagation time and the queueing times. The sender estimates RT T f and uses it in the congestion control algorithm. Congestion avoidance in TCP can be described by the hybrid system in Figure 4. If RT T f is approximately constant, we note that the window size w f grows linearly. The corresponding transmission rate r f for the sender is proportional to w f . If a drop occur in flow f , the window size is reduced by a factor two. Figure 5 shows a simulation of the queue size q (solid) and the window size w (dashed) for a typical session. When the queue becomes full (q qmax 57), a packet is dropped and w is reduced by a factor two. The window size has a sawtooth shape, which is characteristic for TCP flows. The reason why the growth ✞ The Modelica Association ✞ 211 Figure 6: Example of a simple communication network implemented in Modelica. in w is not linear in the beginning of the session is that RT T varies substantially due to the rapid increase in q: when q is small RT T is approximately equal to the physical propagation time, while if q is large packets spend a relatively large amount of time in the queue. 4 Modelica Implementation An example of a communication network implemented in Modelica is shown in Figure 6. Two senders and two receivers are connected to the network. Their flows are sharing the same link capacity. If the sum of the flows at some time instance is larger than the bandwidth of the link, packets will be queued. The hybrid model described in previous section consists of continuous equations and discrete events. Modelica was chosen as implementation language Modelica 2002, March 18−19, 2002 Hybrid Modeling of Communication Networks ... Färnqvist D., Strandemar K., Johansson K.H., Hespanha J.P. 70 Routing rf sf rf TCPW TCP SACK TCP 2 60 TCP 1 Queue 2 Queue 1 50 w 40 RTT f 30 drop in f? 20 Figure 7: Composition of hybrid communication network model. The network dynamics and the TCP dynamics are separated. since it supports efficient handling of such models. We have developed a communication network library. The library contains standard building blocks for network simulation, such as TCP senders, routing tables, and queues. Figure 7 shows the schematic layout of our communication network model. Note that the network dynamics and the TCP controllers are separated. The only information shared between the two submodels are the sending rates r f , the round-trip times RT T f , and the drop events. The modular structure allows an easy testing of for instance different TCP controllers applied to the same network topology. Appropriate handling of the switching between discrete states is important for accurate and efficient simulation of the hybrid model. Implementations in Simulink showed some problems in this respect. Our implementation in Modelica and simulation in Dymola works well. Note that the simulation time is not depending on the number of flows, but instead by the number of discrete events generated by packet drops. The simulation time grows considerably when the number of discrete events becomes large, which hence limits the complexity of the model that can be studied. In ns-2, where individual packets are simulated, the simulation time is also depending on the size of the packet flows as well as the number of flows. 5 Example Let us simulate the simple computer network in Figure 6. Sender 1 sends Flow f 1 using a version of TCP called TCP Westwood (TCPW) [6] and Sender 2 sends Flow f2 using TCP SACK [3]. TCP SACK corresponds approximately to “standard” TCP used for the Internet today. The flows are sent over the same wireless link. For a wireless link transmission losses are Modelica 2002, March 18−19, 2002 212 10 0 0 5 10 15 20 25 time Figure 8: Simulation of the system in Figure 6. The windows size for TCP SACK is considerably reduced when the wireless link is losing a lot of packets (at about t 5 and t 15), while TCPW is able to cope with the losses very well. ✞ ✞ more likely than for a wired link. For the network in Figure 6, there can be packet losses both due to that the router queue is full and due to that the wireless transmission lose packets. We model the wireless link as having a good and a bad state. In the good state 0.1% of the transmitted packets are lost, while in the bad state 10% of the packets are lost. The link stays in each state a random amount of time, which is exponentially distributed. TCPW was designed taking wireless links into account, while TCP SACK was designed for wired links. Next we will see that TCPW might be a good option for the emerging wireless Internet. Figure 8 shows the window sizes for a simulation of the network in Figure 6. The solid line corresponds to TCPW and the dashed line to TCP SACK. Note the time intervals at about t 5 and t 15 when the link is in the bad state. The packet losses due to the bad transmission result in a sudden decrease of the window size for TCP SACK, while TCPW are able to compensate for the packet losses of the wireless link. The window size for TCPW is in general larger than for TCP SACK. This gives a larger throughput for the connection using TCPW, as is shown in Figure 9. Figure 10 shows the throughput when two TCPW’s are sharing the same wireless link (upper plots) and when two TCP SACK’s are sharing the same link (lower plots). From the simulations we see that the major advantage of TCPW is when the link is in the bad state. When the link is in the good state, the performance of both TCP implementations are roughly equal. Since TCP (SACK) was developed for wired net✞ ✞ The Modelica Association Färnqvist D., Strandemar K., Johansson K.H., Hespanha J.P. Hybrid Modeling of Communication Networks ... 7 2 7 x 10 2 TCPW TCP SACK 1.8 1.6 1.6 1.4 1.4 1.2 1.2 Throughput Throughput 1.8 1 0.8 0.6 0.6 0.4 0.4 0.2 0.2 5 10 15 20 0 0 25 time TCPW 1 TCPW 2 TCP SACK 1 TCP SACK 2 1 0.8 0 0 x 10 5 10 15 20 25 30 35 time Figure 9: TCPW gives a larger throughput than TCP Figure 10: Throughput for two TCP Westwood SACK. The difference is emphasized when there are a senders (upper plots) and two TCP SACK senders large number of packet losses due to the wireless trans- (lower plots). mission. works, where packet losses arise only due to buffer overflow, there is a problem using it over wireless links. The reason is that the window size is reduced by a factor two every time a drop occurs, regardless if the drop is due to congestion or to transmission loss. TCPW has another way of updating the window size when a drop occurs. The window size is set to a value based on an estimate of the available bandwidth and the current round-trip time RT T . Since RT T is highly dependent on the queue sizes, so that RT T is small if and only if all corresponding queues are small, a small RT T implies that a detected drop must be due to wireless loss. The aim of TCPW is hence to utilize the available bandwidth more efficiently. References [1] S. Bohacek, J. P. Hespanha, J. Lee, and K. Obraczka. Analysis of a TCP hybrid model. In Proc. of the 39th Annual Allerton Conference on Communication, Control, and Computing, 2001. [4] V. Jacobson. Congestion avoidance and control. In Proc. of SIGCOMM, volume 18.4, pages 314–329, 1988. [5] W. E. Leland, M. S. Taqqu, W. Willinger, and D. V. Wilson. On the self-similar nature of ethernet traffic (extended version). IEEE/ACM Transactions on Networking, 2(1):1–15, 1994. [6] S. Mascolo, C. Casetti, M. Gerla, M. Y. Sanadidi, and R. Wang. TCP Westwood: bandwidth estimation for enhanced transport over wireless links. In MobiCom, Rome, Italy, 2001. [7] The Network Simulator ns-2. Information Sciences Institute, University of Southern California. http://www.isi.edu/nsnam/ns. [8] V. Paxson and S. Floyd. Wide-area traffic: the failure of Poisson modeling. IEEE/ACM Trans. on Networking, 3(3):226–244, 1995. [9] V. Paxson and S. Floyd. Why we don’t know how to simulate the internet. In Proc. of the Winter Simulation Conference, 1997. [10] L. L. Peterson and B. S. Davie. Computer networks: a systems approach. Morgan Kaufmann, 2nd edition, 2000. [2] R. W. Brockett. Hybrid models for motion control [11] A. van der Schaft and J. M. Schumacher. An Introsystems. In H. Trentelman and J. Willems, editors, duction to Hybrid Dynamical Systems. Number 251 Essays in Control: Perspectives in the Theory and Its in Lecture Notes in Control and Information Sciences. Applications, pages 29–53. Birkhäuser, Boston, 1993. Springer-Verlag, London, 2000. [3] J. P. Hespanha, S. Bohacek, K. Obraczka, and J. Lee. Hybrid modeling of TCP congestion control. In M. Di Benedetto and A. Sangiovanni-Vincentelli, editors, Hybrid Systems: Computation and Control, volume 2034 of Lecture Notes in Computer Science, pages 291–304. Springer-Verlag, Berlin, Germany, 2001. The Modelica Association 213 [12] J. Walrand and P. Varaiya. High-performance communication networks. Morgan Kaufmann, 2nd edition, 2000. Modelica 2002, March 18−19, 2002