High-Level Petri Nets-Based Modeling of Network Controlled Systems under Communication Constraints (Network-Induced Delay)

Our work deals with the problems of communication delays, packets dropouts, and quantization errors in the signal transmitted in network-controlled systems (NCS). Although NCS provides a paradigm for adapting to frequent changes in the manufacturing industry, modeling and managing operations are diﬃcult issues due to the complex interactions between system entities and the eﬀect of the network-induced delay on the closed-loop system. )erefore, our paper is about detecting degradations resulting from the insertion of a network in the regulation loop, which can even lead in some cases to the destabilization of the NCS. )is paper mainly studies the problem of the graphic modeling, based on the colored Petri nets (CPN), of the NCS under communication constraints. )erefore, models of the communication network (Ethernet) and system entities are presented. )en, the inﬂuence of network-induced delay is detected. Finally, as an idea for future work, we propose a solution based on an SDN controller in order to avoid precedent degradations.

An original idea from [11] consists in proposing a parity relation-based FD system robust to the network-induced delay. Authors in [12] presented a new switched system model to describe the NCS with both delay and packet dropout. In [13,14], authors have investigated the distributed control problem for a class of large-scale systems with communication constraints and topology switching. Strategies such as event-based communication and logarithmic quantization have been introduced to reduce the transmitted information. Besides, in [15], a novel networked predictive control algorithm based on k-order adaptive discrete-time sliding-mode control is proposed. Many other works have concentrated on network-induced constraints in NCS [16,17]. Finally, authors in [18][19][20] have studied methods for robust stability and stabilization conditions for networked control systems with network-induced delay.
)e general context of this paper is, therefore, networkcontrolled systems. NCS are systems where controllers, actuators, sensors, and other applications communicate through a communication network. To achieve the goal of designing a context-aware information system for NCS, models of the entities in the system are constructed based on colored Petri nets (CPN) and a multiagent system architecture in which each entity in the system is modeled as an agent to capture the interactions of entities in NCS. )e use of colored Petri nets in our work is motivated by the fact that they are found to be an appropriate formal graphical language for modeling and analysis of concurrent and distributed systems. )is is achieved by combining the strengths of Petri nets with the expressive power of highlevel programming languages. Petri nets provide two constructions: the first is graphical for specifying synchronization of concurrent processes, and the second is a programming language for specifying and manipulating data values. CPN can be classed as a means of modeling and simulating network behavior. It provides a well-adapted and progressive framework for the representation and analysis of communications systems. For large systems, hierarchical colored Petri nets (HCPN) provide the possibility of modeling every part with a substitution transition, which is an abstraction of another model. )at is to say, hierarchy is used to subdivide a model into different parts, which allows modular modeling. Such architecture must be able to represent the operations of storage, routing, classification, and scheduling in the network. )ere have been many results in theory and also in practical applications [21]. PN has been popular also for almost a half-century as a formalism and practical tool for modeling, simulating, and analyzing systems exhibiting behaviors of concurrency [22]. )e first perspective of work related to PN is for Brauer (1980). From 1984 and for almost two decades, a significant part of the core of contributions to PN theory and applications was edited by Grzegorz Rozenberg. Most of those contributions came from informatics. Time was introduced in the field of PN in the middle of the seventies, when systems performance started to be considered. PN and time have been used in many works since 1973. )is method is well suited for modeling the behaviour of distributed systems, but the absence of powerful structuring primitives has still been identified as a weakness. As Jensen says in [23], the absence of compositionality has been one of the main critiques raised against Petri net models. )is has led to the development of hierarchical coloured Petri nets (HCPN), which essentially introduces a facility for building a PN out of subnets or modules. A simulation of the model has been conducted to demonstrate the practicality of the proposed method in terms of computation time and response time and in detecting the influence of the network on the system's stability. )en, to resolve this problem, we proposed, as an idea for future work, adopting a solution based on SDN controllers. )is paper is structured as follows. Section 2 deals with the specifications of an Ethernet switch. Section 3 aims to present Petri net modeling. In section 4, we present the simulation results. )en, a discussion and a few promising areas that are open to future research are briefly explained in section 5. Finally, a general conclusion is given in section 6.

Specifications of Studied NCS
Our regulation loop, as shown in Figure 2, is made up of a controller, a process, a sensor, and an actuator that exchange data via three Ethernet switches, and we add two PCs communicating via the same network. We choose to work with three switches to increase the induced delay so that its effect is powerful on the performance of the system and remarkable in the representative curve of its response. )ere are two PCs as an additive traffic source to charge the network.
A network switch is a piece of equipment that connects several segments (cables or fibers) in a computer and telecommunications network and that makes it possible to create virtual circuits. Unlike a concentrator, a switch does not reproduce on all the ports each frame that it receives; it knows how to determine on which port it must send a frame, according to the destination address of this frame. Switches are frequently used as a replacement for hubs because they take up less space on the network. In the case of an IP/ Ethernet network, a switch is not interested in the same OSI layer as the router; they use MAC addresses and IP  addresses, respectively, to direct the data. Concretely, for an address which can be partially known, a frame is always sent on the same port, whatever the state of the traffic, once its routing and communication tables are filled. )e switch establishes and updates a table; in the case of the switch for an Ethernet network, it is the MAC address table, which indicates to it which ports to direct the frames intended for a given MAC address, according to the MAC source addresses of frames received on each port. )e switch therefore dynamically constructs a table that associates port numbers and MAC addresses. )e switch sends the frame back to the corresponding port. If the destination port is the same as that of the transmitter, the frame is not transmitted. If the recipient's address is unknown in the table. )en, the frame is treated as a broadcast (that is, it is forwarded to all ports on the switch except the send port). Each port has its own collision domain. )e switch uses microsegmentation to divide the collision domains, one per connected segment. )us, only the network interfaces directly connected by a point-to-point link request the medium. If the switch to which it is connected supports a full duplex, the collision domain is eliminated. )ere are four methods for forwarding packets: (i) Direct mode (cut through): the switch simply reads the hardware address and transmits it as is. No error detection is performed with this method. (ii) Store and forward mode: the switch buffers and usually performs a checksum operation on each frame before sending it (this mode is used in our work). (iii) Fragment free: packets are passed at a fixed rate, allowing for simplified error detection. )is is a compromise between the previous methods. (iv) Automatic switching (adaptive switching): depending on the errors observed, the switch automatically chooses one of the three previous modes.
Ethernet is well known by network engineers in the industrial environment and provides an open and flexible communication system. Multiple research studies [24][25][26] show that Ethernet, with its advantages such as the nondeterministic access protocol and the propagation time of information in the network, is the solution to guaranteeing the properties of determinism and reactivity of the control. )e switch modeled in our work is a Cisco Catalyst 2950 XL series switch. It is based on a shared memory of 8 MB. Once a frame is received as an input, it is directly copied into a global shared memory. )e type of switches that we want to model offers two modes of classification of service, to which are added frame scheduling mechanisms. )e first mode consists of recognizing the already labeled flows and directing them to the different queues according to their level of service. In the second mode, the network administrator can reclassify flows on the input port with a default value. Once these frames have been classified, they are routed to the appropriate output queue as observed in [27]. )is switch has four queues per output port. One queue has an "absolute" priority (the highest priority) and is used to process real-time applications, and the other three are for low-priority packets. Note that there are as many output buffers as there are priorities. )e modeled switch has the parameters summarized in Table 1.

Petri Nets Modeling
)e colored Petri net (CPN) modeling method can describe a variety of resource types and execution logic, and it can be formally verified. )e proposed methodology allows the construction of compact models for task scheduling problems. Moreover, a simulation process is possible within the constructed model, which allows the study of some performance aspects of the task allocation problem before any implementation stage.

Model of the Entire System
. )e network-controlled system as a whole is illustrated by the RDPCTH in Figure 3. Each abstraction transition (controller, Ethernet switch, actuator, process, sensor, and one additive traffic (PC1 and PC2) to charge the network) represents an RDPCT (or RDPCTH for the Ethernet switch abstraction transition). )e places shown in this model represent the input and output ports between each module; however, the "retard" place is intended for delay detection. )e inhibiting arc between transition and place means that the transition is validated only if the place does not contain any token. Its representation in colored Petri nets, specifically in the CPN Tools tool, is illustrated by a double-oriented arc (arrowed at both ends). Figure 4 shows the model of our Ethernet network based on CPN with all of its internal operations. )e modeling and performance analysis of a switched Ethernet network architecture requires the ability to model the operations of storing, routing, classifying, and scheduling packets through which the flow passes, as detailed in [28,29]. Namely, the storage in a FIFO input memory after receiving the frame. )en, the flow is confronted with the routing operation that sends the packets to the appropriate output queue. After that comes the operation of classification, modeled in Figure 5, which allows the selection of the packets according to their priorities in the appropriate output queues. Finally, these packets are transmitted to the output according to the scheduling algorithm implemented in the switch [24,30].   Weighted round robin scheduling (WRR): assigns to each flow a normalized weight according to the average packet size of the flow and serves the tails (not empty) in turn and according to their weight (see Figure 6). )is algorithm is based on a fair method (serve in turn and according to their weight). High-priority packets will be served until the desired number is reached and "w1" becomes 0, which allows moving to lower-priority packets as observed by [29].

Model of Detection Delay Mecanism (Process).
To consider the delay induced by the Ethernet switch, a calculation procedure has been developed and attached to the model of the process.)e command value calculated in the command module is sent to the switch module by the place port "net-input1" and in the delay calculation place, which is a process input port place ( Figure 7). As soon as the actuator receives the frames, it sends them to the process through the processin port. )e time labels associated with the tokens that arrive at the process-in place and at the delay computation place are extracted using the intTime () function: fun intTime (i) � IntInf.toInt (time ()). )is function translates the conversion of the time label, which is of the form @ + T (exp:@ + 5), into an integer. A subtraction operation is applied to these values thanks to the function subtract (i, y) (C-D transition), which is associated with a transition.
)e difference is obtained as soon as it is executed. )en, this value can be reused from in the two following manners: (i) First case: the times are greater than one or more sampling periods. As the transitions in "cpnTools" (the Petri nets simulator) are P-timed, when the plant transition is active, the token waits Te units of time to send the calculated state xk. However, imagine that the token carrying the information uk has a time tag (t1) whose value is greater than the time tag (t2) associated with the token in the timer. )en, the token in the timer must wait (t1-t2) units of time before the plant transition can be crossed. )en, the new calculated value xk is sent to the sensor after Te units of time. In short, the token in the timer will now have a label of (t1-t2) + Te, which may cause an erroneous shift in the data processing (Transition selection uk-xk). )e xk-uk selection function associated with the transition selection ukxk chooses the states to be taken into account for the calculation of the next state of the system. (ii) Second case: knowing this value is useful for controlling the network to minimize delays.

Simulation Results
Consider a simple controlled system described by the following difference equation: )is system is unstable without any command feedback, but the system is controllable.
)e optimal command is given as follows: this state feedback command stabilizes the system and minimizes the quadratic criterion J, as detailed in [27].  Figure 11. )e simulation of the proposed models leads to the results presented in Figure 12 and Figure 13. )e simulation parameters are given in Table 2 5. Discussion and Promising Areas Figure 12 shows the response of the system without a network. the system follows the set point, and it behaves almost ideally. Figure 13 shows the response of the system, in the presence of the network, that has fluctuated, and the curve is characterized by overshoots before the state reaches the setpoint. We notice that the system losses its stability because of the delay induced by the network.
To overcome this annoying problem, we propose the use of SDN as a method of controlling the network to minimize the delay induced and to protect the system from its destabilizing effect. )is solution consists of installing a WRR weight controller connected wire-to-wire to all the switches as shown in Figure 14 and which has the following functions: (i) Detect the instability of the process (delay in the observation, normally faster because this observation is almost immediate). (ii) Transmit the WRR weights to the various switches via the dedicated links (wire-to-wire) (configuration transmission delay), which is faster because configuration messages are not congested by other traffic. (iii) Update the weights in the switches (delay in the configuration and in the treatment of the saturated buffers before returning to a stable system).
SDN is a networking technology focused on opening new possibilities in network management and coordination. )is is important in future networks, where the virtualization of resources and network functions is the basic paradigm.
Many works propose SDN to control networks in a programmatic way, facilitate the deployment of new services and applications, as well as the tuning of network scheduling policies and performance. It represents a significant change in the way networks are architected, built, and managed.    SDN is therefore more widely recognized today as an architecture that opens up the network to applications [26,31]. It enables the network to better identify the applications transported, so it can better manage them (quality of service, security, traffic engineering, etc.). Despite it still being restricted in the enterprise environment, the widespread replacement of traditional networks with SDN offers the possibility of controlling the network based on application requirements. One of the main problems that arise when an emergency happens is minimizing the delay time in resource forwarding so as to reduce both human and material damages [32]. Solutions focus on moving a switch between two controller instances. Careful planning is required when migrating multiple switches due to controller resource constraints and to ensure minimal downtime on the network. )e experiments in [33] show that the delay of the emergency traffic improves by 33 percent when that solution is running. In [34], the authors present a new security system for networks based on SDN, which can be easily integrated with the existing network infrastructure and provide security for all network components. )is system enables the creation of additional boundaries within the network to provide a multilevel defense system, solves a single point of failure problem, and facilitates the protection of the network from attacks and malicious users. Poster [35] also presents a model and a solution for migration scheduling, taking a set of switch migrations as input and generating a migration schedule    Scientific Programming with respect to controller resource and service interruption constraints. Additionally, in [36], a hybrid network control system is developed and discussed.

Conclusion
)is article illustrates high-level Petri net-based graphical modeling of a network-controlled system and the detection of the network-induced delay's impact on system stability. )e distributed feedback control scheme is designed based on the physical connectivity of the subsystems. )e local controller allows the exchange of control input data and sensor information between them to reduce disturbances resulting from physical interconnections. )e stability of the system is examined under network-induced delay. )e simulation results showed that an induced delay can infect the normal behaviour of the system. )e proposed model has succeeded in detecting the degradation caused by the induced delay. )erefore, we consider that enabling a protection mechanism to learn from experience and use existing knowledge about a delay to infer and prevent delay influence is an important and potentially fruitful future research area. We also believe that the development and deployment of network security policies are essential in networks with a dynamic environment.

Appendix
Formal presentation A Petri net is a bipartite graph of which we particularize the two families of vertices: the places and the transitions. As in any bipartite graph, an arc never connects two vertices of the same family. States are represented by circles, while transitions are represented by lines or rectangles. )eir dynamics are derived from the marking or the distributed state.
Definition of colors )e defined colors represent the Ethernet frame with some abstractions, depending on the requirements and the assumptions made. )e elements that we have modeled are chosen according to our needs and their relevance. )ese elements are the destination address, the source address, the tag representing the level of priority of the frame, and the data to be transmitted. )e transmission mode is selected as store and forward, which suggests that the frames are not erroneous. )e frame size is assumed to be constant and equal to 64 bytes (without the preamble and SFD). )e colors and variables needed for modeling this network and its internal modules in our work are declared as follows:   )e destination address is defined by the color "outp," the source address by the color "inp," and the tag expressing the priority level of the frame by the color "prio." Here three levels of priority are defined: H � 2 (high priority associated with the command frame), M � 1 (medium priority), and B � 0 (low priority) "paquet" is composed of a complex color made using the product function of several colors.

Data Availability
)e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
)e authors declare that they have no conflicts of interest.