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

Authors: Khamsa Farah; Karim Chabir; Mohamed Naceur Abdelkrim
Journal: Scientific Programming
 (2022)

---

## Abstract

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 difficult issues due to the complex interactions between system entities and the effect of the network-induced delay on the closed-loop system. Therefore, 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. This paper mainly studies the problem of the graphic modeling, based on the colored Petri nets (CPN), of the NCS under communication constraints. Therefore, models of the communication network (Ethernet) and system entities are presented. Then, the influence 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.


---

## Body

## 1. Introduction

NCS belong to the class of real-time systems where the task values depend not only on the efficiency of the calculations but also on their uptime. Rapid technological development has increased, at a reasonable cost, the number of devices for implementing control and diagnostic algorithms sharing the same communication network [1, 2]. Real-time automation considers the limitations of computing resources computers and communication networks as design constraints. Specifically, the study of NCS deals primarily with the interaction between control systems and communication media [3]. A network-controlled system is a collection of computing devices that communicate with each other through a network. Sensors and actuators are devices for interacting with the physical world in a feedback loop [3–5]. This kind of system is closed via a real-time communication network that may be shared with other applications, as shown in Figure 1. Inserting a network into the control loop can provide unreliable and time-dependent service levels in terms of delays, vibrations, or losses, for example. Quality of service (QoS) can improve network behavior in real-time, but network behavior is still susceptible to interference, especially in wireless media, routing crossovers, and heavy traffic. On the other hand, network fluctuations can threaten the stability, integrity, and performance of modules in the physical environment.Figure 1
NCS architecture.A difficult problem in controlling orange network-based systems is the effect of network delay. The time required to read the measurement from the sensor and send a control signal to an operator on the network depends on network characteristics such as topology and routing diagrams. Therefore, the overall performance of a network control station can be greatly affected by network delays. The delay problem is exacerbated when data loss occurs during transmission. In addition, the delays not only degrade the performance of the network-based control system but can also destabilize the system [6–10].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–20] have studied methods for robust stability and stabilization conditions for networked control systems with network-induced delay.The general context of this paper is, therefore, network-controlled 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. The 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. This is achieved by combining the strengths of Petri nets with the expressive power of high-level 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. That 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. There 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]. The 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. This 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. This 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. Then, to resolve this problem, we proposed, as an idea for future work, adopting a solution based on SDN controllers. This 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. Then, 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.


## 2. Specifications of Studied NCS

Our regulation loop, as shown in Figure2, 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. There are two PCs as an additive traffic source to charge the network.Figure 2
Studied system distribution.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.The 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. The switch therefore dynamically constructs a table that associates port numbers and MAC addresses. The 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. Then, 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. The switch uses microsegmentation to divide the collision domains, one per connected segment. Thus, 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. There 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. This 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–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. The 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. The type of switches that we want to model offers two modes of classification of service, to which are added frame scheduling mechanisms. The 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]. This 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. The modeled switch has the parameters summarized in Table 1.Table 1
Switch parameters.
ParametersEthernet switchDebit (Mbit/s)10Duration of a bit (microsecond)0.1Max data field size (byte)1500Min message size (byte)64


## 3. Petri Nets Modeling

The colored Petri net (CPN) modeling method can describe a variety of resource types and execution logic, and it can be formally verified. The 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.


### 3.1. Model of the Entire System

The network-controlled system as a whole is illustrated by the RDPCTH in Figure3. 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). The places shown in this model represent the input and output ports between each module; however, the “retard” place is intended for delay detection. The 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 3
CPN modeling of NCS.


### 3.2. Ethernet Switch Modeling

Figure4 shows the model of our Ethernet network based on CPN with all of its internal operations. The 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. Then, 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].Figure 4
Model of Ethernet switch.Figure 5
Classification modeling.


#### 3.2.1. Scheduling Policy Modeling

The scheduling operation occurs at the output of the FIFO output queues. The frames are transmitted according to a weighted round robin scheduling algorithm.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 Figure6). This 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].Figure 6
CPN model of WRR scheduler.


### 3.3. 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.The 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 (Figure7). As soon as the actuator receives the frames, it sends them to the process through the process-in port. The 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 ()). This 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.Figure 7
A process with detection delay mechanisms.The difference is obtained as soon as it is executed. Then, 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. Then, the token in the timer must wait (t1-t2) units of time before the plant transition can be crossed. Then, 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). The xk-uk selection function associated with the transition selection uk-xk 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.


## 3.1. Model of the Entire System

The network-controlled system as a whole is illustrated by the RDPCTH in Figure3. 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). The places shown in this model represent the input and output ports between each module; however, the “retard” place is intended for delay detection. The 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 3
CPN modeling of NCS.


## 3.2. Ethernet Switch Modeling

Figure4 shows the model of our Ethernet network based on CPN with all of its internal operations. The 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. Then, 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].Figure 4
Model of Ethernet switch.Figure 5
Classification modeling.


### 3.2.1. Scheduling Policy Modeling

The scheduling operation occurs at the output of the FIFO output queues. The frames are transmitted according to a weighted round robin scheduling algorithm.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 Figure6). This 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].Figure 6
CPN model of WRR scheduler.


## 3.2.1. Scheduling Policy Modeling

The scheduling operation occurs at the output of the FIFO output queues. The frames are transmitted according to a weighted round robin scheduling algorithm.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 Figure6). This 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].Figure 6
CPN model of WRR scheduler.


## 3.3. 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.The 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 (Figure7). As soon as the actuator receives the frames, it sends them to the process through the process-in port. The 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 ()). This 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.Figure 7
A process with detection delay mechanisms.The difference is obtained as soon as it is executed. Then, 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. Then, the token in the timer must wait (t1-t2) units of time before the plant transition can be crossed. Then, 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). The xk-uk selection function associated with the transition selection uk-xk 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.


## 4. Simulation Results

Consider a simple controlled system described by the following difference equation:(1)xk+1=Axk+Buk,yk=Cxk.This system is unstable without any command feedback, but the system is controllable.The optimal command is given as follows:(2)uk=−Fxk,this state feedback command stabilizes the system and minimizes the quadratic criterion J, as detailed in [27].with:A = 1.05, B = 1.8, F = 0.3594. All variables, colors, and functions are declared as shown in Figure 8, Figure 9, Figure 10, and Figure 11. The simulation of the proposed models leads to the results presented in Figure 12 and Figure 13. The simulation parameters are given in Table 2Figure 8
Colors, variables, and functions declarations.Figure 9
Declaration function soustract.Figure 10
Declaration function select.Figure 11
Colors and variables declaration.Figure 12
Ideal behavior.Figure 13
Behavior under network-induced delay.Table 2
Simulation parameters.
ParametersReal valuesModel values (ns)Latency500 ns500Producer period1 ms1000000Consumer period1 ms1000000Delay due to store and forward mode51.2μs51200


## 5. Discussion and Promising Areas

Figure12 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. This solution consists of installing a WRR weight controller connected wire-to-wire to all the switches as shown in Figure14 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).Figure 14
Proposed architecture based on an SDN controller.SDN is a networking technology focused on opening new possibilities in network management and coordination. This 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. The 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. This 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 with respect to controller resource and service interruption constraints. Additionally, in [36], a hybrid network control system is developed and discussed.


## 6. Conclusion

This 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. The distributed feedback control scheme is designed based on the physical connectivity of the subsystems. The local controller allows the exchange of control input data and sensor information between them to reduce disturbances resulting from physical interconnections. The stability of the system is examined under network-induced delay. The simulation results showed that an induced delay can infect the normal behaviour of the system. The proposed model has succeeded in detecting the degradation caused by the induced delay. Therefore, 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.



---

*Source: 5103199-2022-10-10.xml*