Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Real-time behaviour of Ethernet on the example of

PROFINET
Heitzer Bernhard#1
1
bernhard.heitzer@stud.hs-regensburg.de
#
Maschinenfabrik Reinhausen
Falkensteinstrasse 8
93059 Regensburg
Jürgen Mottok#2
2
Juergen.Mottok@hs-regensburg.de
#
Laboratory for Save and Secure Systems, HS-Regensburg
Seybothstrasse 11
93059 Regensburg

Abstract: Ethernet is used more and more in industrial


environment. In these applications it is a basic
requirement to provide real-time communication. This 2. REQUIREMENTS FOR A REAL-TIME ETHERNET
paper describes the limitations why standard Ethernet SYSTEM
cannot be used as a real-time system and which A function in a system is executed within a defined
additions have to be implemented to make it real-time interval, this is the specification for real-time. This
capable. As example the real-time Ethernet system interval is defined between R (Release), the earliest start
PROFINET is described in this paper along with an time of the function, and D (Deadline), the latest end time
illustration of some performance measures. for the function. If the function is not finished within this
interval the processed data is corrupted. Real-time is
Keywords: Ethernet, real-time, PROFINET, automation, given when the demands of punctuality and simultaneity
performance are met. Punctuality means the function is finished before
D and simultaneity describes the cyclic occurrence of an
1. INTRODUCTION event in a given interval.
The update time of the process data is divided in three
The usage of Ethernet in automation has grown classes (Table 1. Quality of Service (QoS)). These
continuously in the last years, where Real-time Ethernet definitions are based on existing application-classes from
systems represent the main factor for its strong use. fieldbus-systems.
Ethernet is not only used because of its real-time ability,
but rather because of the possibility for an easy
Table 1. Quality of Service (QoS)
integration in an existing IT-network.
In automation many different requirements have to be QoS Class Application QoS Latency
met for real-time. Also, there are various basic approaches 1 Controller-to- 100ms
to accomplish real-time ability for Ethernet. The first part Controller
of this paper describes the most important requirements in 2 Distributed I/O- 10ms
a real-time Ethernet application. Furthermore fundamental Devices
problems are considered which must be addressed to 3 Motion Control <=1ms
create a real-time Ethernet system which meets the given
requirements.
The last chapter shows the principles of the real-time
Ethernet system PROFINET and which measures are 3. FACTORS WHICH INFLUENCE A REAL-TIME
taken to meet the real-time requirements. Additionally ETHERNET SYSTEM
some theoretical performance examples illustrate An entire switched Ethernet network could be seen as a
transmission times of real-time Ethernet frames and system of queuing devices which influence the quality of
update times in a PROFINET system. communication. The scheduling strategies to be used in
these devices are defined in the IEEE Standard. Possible Category A Systems are based on the standard Ethernet
strategies are first-come first-serve (FCFS) and non- TCP/IP protocol and use standard HW. They can be used
preemptive priority queuing (PQ) algorithms. FCFS in normal IT-Networks and allow a simple integration in a
schedules all frames in an equal way. The forwarding corporate network. The communication is not
time is short because of the fact that this algorithm is very deterministic and mainly influenced by the TCP/IP-
simple. The PQ algorithm allows to prefer specific frames, Protocol runtimes.
where frames with a high priority are forwarded first. Devices are identified by the IP-Address and for this it
However this could lead to longer forwarding times for is also possible to transmit frames beyond the local
some frames, especially in huge Networks with Line network.
topology. Also protocol runtimes and the time for frame
generation have to be taken into consideration for the
transmission time.

4. IMPLEMENTATION OF REAL-TIME ETHERNET

In a standard Ethernet system the CSMA-CD protocol


is used, which can lead to unpredictable behavior because
of the collision detection. In modern Ethernet systems
only full-duplex switched-Ethernet is used and for this
there are no frame-collisions on the wire.
Priority based scheduling like PQ could be
implemented by using IEEE802.1D/Q. So it is possible to
separate time critical frames and non-critical frames from
each other to fulfill the QoS class 2 requirements. Figure 1. Categorization of real-time Ethernet systems
In a switched network the transmission time for time
critical frames increases with the amount of switches. In category B time-critical frames are not sent with the
This is why a standard Ethernet system cannot be used for IP-Protocol anymore. This results in shorter protocol
time-critical applications like motion control (QoS Class runtimes in the devices. Devices are now identified by the
3). MAC-Address. Non-time critical frames can be sent in
To use Ethernet in QoS Class 3 applications a method addition with IP-based services also beyond the local
like TDMA has to be used. With TDMA the bus cycle is network.
divided in different time-slots. The advantage of this The category A and B systems both use prioritization of
method is that the transmission time can be calculated the time-critical frames within the VLAN-tag which is
from the beginning on. defined in IEEE802.1D/Q.
A bus cycle has to start at the same time on every Sending time-critical frames in category C is also
device to coordinate the time critical and non-critical performed without the IP-Protocol. Besides that TDMA is
time-slots. In order to achieve that synchronization used in this category for scheduling and therefore
between the devices is necessary. A common standard for standard Ethernet HW cannot fulfill these requirements
time synchronization is the Precision Time Protocol (PTP). anymore. Here both facts shorter protocol-runtime and a
PROFINET for example uses its own synchronization deterministic access lead to meet the requirements of QoS
protocol which is called PTCP. This algorithm is nearly Class 3. Identical to category B it is also possible to send
identical to PTP. By using PTCP in a switched Ethernet non-critical frames.
system a jitter <1µs is possible.
Common available real-time Ethernet systems can be 5. REAL-TIME ETHERNET SYSTEM PROFINET
assigned into three categories. Distinguishing features are
PROFINET is a Master-Slave system. The Master (IO-
the grade of compliance to the Ethernet standard (which
Master) can send frames to all devices in the network as
includes the possible use of standard Ethernet HW) and
well as receive frames from all devices. A Slave (IO-
the performance (Figure 1).
Device) has the possibility to send frames to the IO-
Master only. Cross traffic to other IO-Devices is only Conformance Class C extends the functionalites of CC-
possible non-cyclically. B with the fundamental difference of the synchronization
The communication concept of PROFINET is designed between the IO-Devices. In PROFINET this method of
modular. Functionalities in communication differs in the communication is called isochronous real-time (IRT).
way of data transfer to meet the different performance Cyclic and acyclic communication is separated by
requirements. TDMA as it is shown in Figure 2. The first time-slot is
PROFINET IO specifies the transfer of I/O-Data for reserved for the cyclic IRT-communication. Every IO-
peripheral devices such as sensor or actor. PROFINET IO Device has to send his cyclic RT-frames within the IRT-
includes real-time (PROFINET RT) and isochronous real- interval. For the acyclic TCP/IP communication there is a
time (PROFINET IRT) communication with the periphery. reserved second time-slot. Using CC-C it is possible to
For a simpler use of PROFINET IO in applications reach bus-cycles of 250µs.
three application classes are specified. Each application
class has its own minimum requirements. Their categories
are:
• Applications with unsynchronized
communication.
• Bus-synchronization with unsynchronized
applications.
• Synchronous applications. Figure 2. PROFINET TDMA process
In addition to the application requirements there are
additional determinations for the devices, method of Synchronization of the IO-Devices in CC-C is
communication (RT, IRT), transmission medium and implemented with the PTCP and so all IO-Devices work
redundancy. with the identical time-base. Using PTCP it is possible to
synchronize the IO-Devices with max. Jitter of <1µs.
A. Conformance Class A
The IRT-communication uses two different methods for
Conformance Class A allows the usage of standard
sending RT-frames, RTC2 and RTC3, which differ in
Ethernet Hardware. CC-A includes cyclic RT-
performance.
communication and acyclic TCP/IP-communication.
RT-frames are priorized as described in IEEE802.1D/Q D. RT-Class-2
and transmitted on base of the MAC-address. These For the transmission in the IRT-interval all switches
frames are preferred against non time-critical TCP/IP- create an address-table on start-up. With this table it is
frames. The cycle for the transmission of an RT-frame has possible to route RT-frames on base of their source- and
to be defined by the user. There is no synchronization destination-MAC-address. The routing mechanism on
between the devices. In PROFINET this method of base of the MAC-address allows to change the topology
sending RT-frames is called RT-Class 1 (RTC1). Further of the network, but it must be ensured that the
PROFINET features are: transmission of an RT-frame is finished within the IRT-
• Alarms/Diagnosis interval. This is the reason why in RTC2 the IRT-interval
• Automatic address-resolution has an additional time reserve as it is shown in Figure 3.
• Neighborhood detection The capacity of the available bandwidth is not optimal
• 100Base Tx/Fx amongst others in RTC2 because of the throughput time
• Wireless-communication (ca. 10µs) in the switch. This period of time is needed to
evaluate the source and destination MAC-address.
B. Conformance Class B
CC-B includes the functionalities from CC-A plus the
additional features:
• IO-Device cross transmission
• Device swap-out without engineering tool
• Media-redundancy-protocol MRP

C. Conformance Class C
This duration is called Propagation Delay pmax . The
Propagation Delay can be determined exactly by using the
PTCP.

G. Bridge Delay: q
The throughput time for a frame from one port to
another port in a switch is called Bridge Delay q . An
estimated value for the Bridge Delay in PROFINET
Figure 3. PROFINET IRT RTC2
switches is q max = 10 µs for RTC1/RTC2 and ca.
qmin = 3µs for RTC3 (the exact value is given in the
E. RT-Class-3 GSD-file). For further calculation also a variable d is
In RTC3 there is no time reserve left in the IRT-interval. specified which represents the number of IO-Devices in
This will only work under the prerequisite that the the network.
topology of the network is known before startup. On base
of this information the communication plan hast to be H. Transmission Delay: t
calculated before. The calculation with an engineering- One Ethernet-frame has a specified header-length of 34
tool, that also requires throughput times of the switches. Bytes and has an additional CRC-value with 4 Bytes. The
In RTC3 this throughput time is approximately 3, 5µs. data-field has a minimum size of 46 Byte and therefore
The exact throughput times for RTC1/RTC2/RTC3 are the minimum size of one Ethernet-frame is 84 Byte. If the
available in the PROFINET GSD-file which can be data-field is completely filled the maximal size of one
processed by the engineering-tool. Every PROFINET Ethernet-frame is 1538 Byte. The PROFINET system
manufacturer has to offer a GSD-file for the produced runs with a speed of 100Mbit/s. The calculated
Device, so throughput times for every Device are known transmission time for one Ethernet-frame with minimum
by the engineering-tool. size t min is:
Forwarding of RT-frames in RTC3 is not based on 84 Byte ÷ 100 MBit / s = 6 , 72 µs
MAC-addresses anymore. The network topology is
and for one Ethernet-frame with maximum size t max :
planned with the engineering-tool before startup and with
this information the engineering-tool creates a table for 1538 Byte ÷ 100 MBit / s = 123 ,04 µs
the RT-frame routing. This table is stored on every
I. Transmission Time without waiting Time: Tmin
involved switch. Now it is possible to make accurate
predictions when and where a specific RT-frame is The example in Figure 4 shows a calculation for the
forwarded. This means that the communication is transmission time of one PROFINET frame (minimal size
deterministic. 84 Byte) from the IO-Master to the IO-Device 4. The
Worst-case scenario for IRT-communication is a line Mathematical formula for the calculation in Figure 4 is:
topology. In this case the defined send order causes that Tmin = d * (qmax + p ) + t min
the RT-frame for the last IO-Device in the line-topology Since the bridge delay is 10µs and because of this a
to be sent first. When the first RT-frame is on its way, the RTC1 or RTC2 communication must be used.
second RT-frame is sent to the second to the last IO- Nevertheless, it could happen that a RTC frame has to
Device. wait until another frame is transmitted on the wire, as
shown in the next example.
6. PERFORMANCE CALCULATION
F. Propagation Delay: p
The Ethernet standard specifies a maximal section
length of 100m between switches for cooper wire.
Electrical signals spread at a speed of ca. 200000km/s in
cooper. The maximal duration to send one bit within one
section is:
100 ÷ 200000 km / s = 0 ,5 µs
RTC-frame. The IO-Master transmits four RTC3-frames
(minimum size 84 Byte) one for each IO-Device. The
Mathematical formula for the calculation in Figure 6 is:
U = d * t min + q RTC 3 + p
Since IO-Device 2, 3 and 4 receive the frames before
the IO-Master transmission is finished, q and p are
considered only once.
The previous examples calculate how long it takes to
4 * (10 µs + 0 ,5 µs ) + 6 ,72 µs = 48 ,72 µs
transmit one PROFINET-frame. In practice it is common
that more than one frame is sent in one bus-cycle. Every
Figure 4. Min. Transmission Time time more than one frame shall be sent the second and
further frames are queued until the previous frame has
been forwarded. In Figure 6 RTC3 communication with
J. Transmission Time with waiting Time: Tmax
the TDMA method is used and, additionally the IO-
The example in Figure 5 shows a calculation for the Master has knowledge of the network topology. As
transmission time of one PROFINET frame (minimal size described earlier the IO-Master builds a send order. The
84 Byte) from the IO-Master to the IO-Device 4. frame for the last IO-Device in the line is transmitted first.
The Mathematical formula for the calculation in Figure This method saves time, because the forwarding time is
5 is: optimized.
Tmax = d * (q max + p ) + t min + (d − 1) * (t max + q max )
The calculation is influenced by the fact that the RTC
frame has to wait before it can be forwarded. Again a
bridge delay of 10µs is used. In this worst case the
transmitted frame has to wait at every IO-Device until a
maximum UDP-frame (size 1538 Byte) is transmitted on
the wire. The UDP-frame was sent just before the
PROFINET frame has arrived. This leads to a waiting
time for the PROFINET frame of 123, 04µs at every IO-
Device.

4 * 6,72 µs + 0 ,5 µs + 3 µs = 29 ,93 µs



Figure 6. Updating time


              
The Update time also gives a reference for the duration
of a bus-cycle for a specific number of IO-Devices. In
  
   
  
   
  
   
opposite it is also possible to calculate how many IO-
! "#$% ! "#$% ! "#$%
Devices can be connected to a PROFINET network with a
&    ! "!  ' (
given bus cycle time. The Mathematical formula for the
maximal number of IO-Devices for a given bus-cycle is:
4 * (10 µs + 0,5µs ) + 6,72 µs + ( 4 − 1) * (123,04 µs + 10µs ) = 447,84µs
d = (t cycle − p − q min/ max ) ÷ t min/ max
E.g. how many IO-Devices can be updated with a bus-
Figure 5. Max. Transmission Time
cycle time of 250µs if every IO-Device is updated with a
minimum RTC3 frame?
K. Updating Time with RTC3: U (250 µs − 0,5µs − 3µs ) ÷ 6,72 µs = 36,68 ≈ 36
The example in Figure 6 shows a calculation for the Solution: With RTC3 it is possible to update 36 IO-
Update time of the process data. This is the time how long Devices with a bus-cycle time of 250µs (the result has to
it takes that every IO-Device in the network gets one adjust downward).
CONCLUSIONES

As described Ethernet especially real-time Ethernet,


can be considered as an adequate communication system
for automation and it is suitable even for applications with
hard real-time requirements a short cycle-times (e.g.
motion control).For automation applications the
advantage to integrate the communication in existing IT-
networks without losing the real-time characteristic gives
additional benefit.
The real-time Ethernet system PROFINET was
explained in some of the most important details. The final
practice view from the application side covers especially
how it is implemented and the performance of the real-
time communication.

REFERENCES

[1] K. Werner, T. Heimbold and D. Telschow


“Bustechnologien für die Automation” Hüthig
Verlag Heidelberg, 2000
[2] K. Frithjof, V. Oestereich und V. Volz „Industrielle
Kommunikation mit Feldbus und Ethernet“ VDE-
Verlag, 2010
[3] M. Popp, „Industrielle Kommunikation mit
PROFINET“ PROFIBUS Nutzerorganisation e.V.,
2007
[4] B. Heitzer, „Evaluierung von Echtzeit-
Kommunikationssystemen für die Automatisierung
in der Sekundärtechnik“ 2011
[5] P. Ferrari, A. Flammini, D. Marioli, A. Taroni
„Experimental evaluation of PROFINET
performance“ Dept. of Electronics for Automation
and PCC Italy University of Brescia, 2004

You might also like