Industrial Communication Systems
Industrial Communication Systems
Automation Industrielle
Office Industrielle Automation
network
TCP - IP
Ethernet
Plant Network
Ethernet, ControlNet
Fieldbus
intelligent field devices
FF, PROFIBUS, MVB, LON
Sensor Busses
simple switches etc.
CAN, DeviceNet, SDS, ASI-bus, Interbus-S
File
Process bus
Programmable
Process Level Logic Controller
Field bus
Field level
Sensor/
Actor
Bus
direct I/O
- transmission of numerous small data items (process variables) with bound delay (1ms..1s)
- harsh environment (temperature, vibrations, EM-disturbances, water, salt,…)
- robust and easy installation by skilled people
- high integrity (no undetected errors)
- high availability (redundant layout)
- clock synchronization (milliseconds down to a few microseconds)
- continuous supervision and diagnostics
- low attachment costs ( € 5.- / node)
- moderate data rates (50 kbit/s … 5 Mbit/s) but large distance range (10m .. 4 km)
- non-real-time traffic for commissioning (e.g. download) and diagnostics
- in some applications intrinsic safety (oil & gas, mining, chemicals,..)
- reduce cabling
PLC
(Rangierung,
tableau de brassage (armoire de triage)
COM
PLC
field bus
Office
network
TCP IP
Ethernet
Plant Network
Ethernet, ControlNet
Fieldbus
intelligent field devices
FF, PROFIBUS PA, LON
Sensor Busses
simple switches etc.
CAN, DeviceNet, SDS, ASI-bus, Interbus-S
Modicom IEC 870-5 DNP 3.0 Conitel RP 570 serial links (telephone)
COM RTU
substation substation
Medium
MV Voltage
circuit
breaker
(Schalter,
Disjoncteur)
switch position
and commands
G
current, voltage,
temperature
Bay Bay Bay Generator
Transformer
workstation1 workstation2
logger
printer
gateway
gateway
station bus
switch
Pumps, gates, valves, motors, water level sensors, flow meters, temperature sensors,
gas meters (CH4), generators, … are spread over an area of several km2
Some parts of the plant have explosive atmosphere.
Wiring is traditionally 4..20 mA, resulting in long threads of cable (several 100 km).
H1 Speed Fieldbus
JB Segment 1 Segment 3 JB
Sub Station
AO
AI
PID
PLC
AO
PID
AI AI AI AI AI AI AI AI PID AO
AO AO
DI M.C.C.
FB Protocol
Converter
AI AI
S S S S S
AI AI AI PID AI PID AI AI AI AI
AO AO
Data are transmitted from the periphery or from fast controllers to higher level, but slower links to
the control level through field busses over distances of 1-2 km.
The control stations gather data at rates of about 200 kbit/s over distances of 30 m.
Planning of a field bus requires to estimate the data density per unit of length (or surface)
and the requirements in response time and throughput over each link.
Source: Echelon
low cost, low data rate (78 kbit/s), may use power lines (10 kbit/s)
Monitoring redundantes
ECU und Bordnetz
Bordnetz ECU
Diagnose ECU 12V und 48V
c
Betätigungs-
einheit
Bremsen
ECU ECU
ECU
4
- 8 nodes
- 4 electromechanical wheel brakes
- 2 redundant Vehicle Control Unit
- Pedal simulator
- Fault-tolerant 2-voltage on-board power supply
- Diagnostic System
•(description)
“slaves”
input output
peer-to-peer: distributed
PLC PLC PLC
PLCs may exchange data, “masters”
AP AP AP
share inputs and outputs
allows redundancy
and “distributed intelligence”
devices talk directly to each other
“slaves”
input output
separate bus master from application master !
In principle, the bus could transmit the process variable in clear text, possibly using XML.
However, this is quite expansive and only considered when the communication network
offers some 100 Mbit/s and a powerful processor is available to parse the message
More compact ways such as ASN.1 have been used in the past with 10 Mbit/s Ethernet.
Field busses are still slow (1Mbit/s ..12 Mbits/s) and therefore more compact
encodings are used.
Field busses devices had a low data rate and transmit over and over the same variables.
It is economical to group variables of a device in the same frame as a dataset.
A dataset is treated as a whole for communication and access.
A variable is identified within a dataset by its offset and its size
Variables may be of different types, types can be mixed.
Dataset
0 16 32 48 64 66 70
all door closed
bit offset size lights on
heat on
air condition on
To allow later extension, room is left in the datasets for additional variables.
Since the type of these future data is unknown, unused fields are filled with '1".
To signal that a variable is invalid, the producer overwrites the variable with "0".
Since both an "all 1" and an "all 0" word can be a meaningful combination, each
variable can be supervised by a check variable, of type ANTIVALENT2:
Dataset
variable value check
correct variable 0 1 0 1 1 1 0 0 0 1
error
0 0 0 0 0 0 0 0 0 0
undefined 1 1 1 1 1 1 1 1 1 1
A variable and its check variable are treated indivisibly when reading or writing
The check variable may be located anywhere in the same data set.
application application
processor processor
events
(interrupts)
traffic
memory queues
bus bus
controller controller
sending: application writes data into memory sending: application inserts data into queue
and triggers transmission,
receiving: application reads data from memory bus controller fetches data from queue
receiving: bus controller inserts data into queue
the bus controller decides when to transmit and interrupts application to fetch them,
bus and application are not synchronized application retrieves data
Bus and Application are (de)coupled by a shared memory, the Traffic Memory,
where process variables are directly accessible to the application.
Application
Processor
Traffic Memory
Associative
memory
It is necessary to check that the data in the traffic memory is still up-to-date,
independently of a time-stamp (simple devices do not have time-stamping)
Applications tolerate an occasional loss of data, but no stale data.
To protect the application from using obsolete data, each Port in the traffic
memory has a freshness counter.
This counter is reset by writing to that port. It is incremented regularly,
either by the application processor or by the bus controller.
The application should always read the value of the counter before using
the port data and compare it with its tolerance level.
Bus error interrupts in case of severe disturbances are not directed to the
application, but to the device management.
Rather than fetch and store individual variables, access is done by clusters
(predefined groups of variables):
ap_put_cluster (cluster_name)
ap_get (cluster_name)
The cluster is a table containing the names and values of several variables.
Note: Usually, only one variable is allowed to raise an interrupt when received: the one
carrying the current time (sent by the common clock)
To this purpose, the devices are equipped with a clock that records the creation date of
the value (not the transmission time).
A field bus provides means to synchronize clocks in spite of propagation delays and
failure of individual nodes. Protocols such as IEEE 1588 can be used.
bus
t1 val1
Industrial Automation 13 3.2 Field bus operation
Transmission principle
The previous operation modes made no assumption, how data are transmitted.
nevertheless transmit:
how much hysteresis ? - every xx as “I’m alive” sign
- coarse (bad accuracy) limit update - when data is internally updated
- fine (high frequency) frequency !, - upon quality change (failure)
limit hysteresis
Industrial Automation 15 3.2 Field bus operation
Fieldbus: Cyclic Operation mode
Bus devices
Master 1 2 3 4 5 6
(slaves)
Poll
List
plant
The master polls the addresses in a fixed sequence, according to its poll list.
Individual period Individual period N polls
1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6
time [ms]
44 µs .. 296 µs
No explicit error recovery needed since a fresh value will be transmitted in the next cycle.
Cycle time is limited by the product of the number of data transmitted by the
duration of each poll (e.g. 100 µs / point x 100 points => 10 ms)
To keep a low poll time, only small data items may be transmitted (< 256 bits)
bus
variable identifier
Phase 2: The device that sources that variable responds with a slave frame
containing the value, all devices subscribed as sink receive that frame.
subscribed subscribed subscribed devices
device device
bus.
master sink source sink sink devices
(slaves)
bus
variable value
time
Read Transfer
t_repeat
The propagation delay T_m
round-trip (t_pd = 6 µs/km)
delay limits t_source access delay
the extension t_mm t_ms (t_repeat < 3 µs)
of a read-only T_s
bus
t_repeat Slave Frame
t_sm
T_m ne xt M a st
er F ra me
distance
1 2 4a 8 16 1 4b 1 2 3 64 1 4a
time
1 ms period 1 ms 1 ms
(basic period) group with
period 1 ms
Cyclic polling need tools to configure the poll cycles.
The poll cycles should not be modified at run-time (non-determinism)
A device exports many process data (state variables) with different priorities.
If there is only one poll type per device, a device must be polled at the
frequency required by its highest-priority data.
To reduce bus load, the master polls the process data, not the devices
cyclic
poll application application application application
1 2 3 4
bus source
master Ports Ports
port
Ports Ports
Periodic Traffic
List Memory
sink sink
port port
bus bus bus bus bus
controller controller controller controller controller
bus
port address port data
The bus traffic and the application cycles are asynchronous to each other.
The bus master scans the identifiers at its own pace.
Bus and applications are decoupled by a shared memory, the traffic memory,
which acts as distributed database actualized by the network.
It is currently used for power plant control, rail vehicles, aircrafts, etc...
The poll scan list located in the central master (which may be duplicated for
availability purposes) determines the behavior of the bus.
It is configured for a specific project by a single tool, which takes into account
the transmission wishes of the applications.
This guarantees that no application can occupy more than its share of the bus
bandwidth and gives control to the project leader.
publisher
application instance subscribers application instances
device device device
applications
bus
bus instance
Worst-case delay for transmitting all time critical variables is the sum of:
Source application cycle time 8 ms
Individual period of the variable 16 ms
Sink application cycle time 8 ms
= 32 ms
% periodic time
37 of 16 bits
30 frames of 128 bits 65 frames of 64 bits
18 of 32
sensors/
actors
plant
interrupt
Bus
Controller
bus
request
interrupt
indication
confirm
time
Non-deterministic Deterministic
Collision Central master,
(Ethernet) Token-passing (round-robin),
Binary bisection,
Collision with winner.
events
producers F F F F F F F F F F F F
& consumers
input and
output queues
bus
acknowledgements
data packets
The average delivery time depends on the length of the queues, on the bus
traffic and on the processing time at the destination.
Often, the computers limit far more the event delay than the bus does.
time
sporadic periodic sporadic periodic
phase phase phase phase
Cyclic transmission takes a large share of the bus bandwidth and should be reserved
for really critical variables.
A message transmission scheme must exist alongside the cyclic transmission to carry
not-critical variables and long messages such as diagnostics or network management
The real-time communication model uses two stacks, one for time-critical variables
and one for messages
7 Application
implicit implicit 6 Presentation
Remote Procedure Call 5 Session
Logical Link connection-oriented 4 Transport (connection-oriented)
Control connectionless 3 Network (connectionless)
connectionless 2" Logical Link Control
medium access 2' Link (Medium Access)
common
media 1 Physical
R1 R2 R3 R4 E1 E2 E3
bus
Worst Case is normal case Typical Case works most of the time
Only system management messages could be threaded through from end to end,
but due to lack of standardization, data conversion is today not avoidable.
Plant-bus (Ethernet)
Operator bus (Ethernet)
Console, LS LS LS PM LS LS LS PM LS LS LS PM LS LS LS PM
Section Supervision
Printing Towers
Section Control
SSB SSC SSD SSE
Line bus (AF100)
Reelstand-Gateways RPB RPC RPD RPE
multiplicity of field busses with different tasks, often associated with units.
main task of controllers: gateway, routing, filtering, processing data.
most of the processing power of the controllers is used to route data
Pressmasterbus (Ethernet)
Section bus C
V-Sercos V-Sercos V-Sercos
V-Sercos
Service-Arcnet
Falz- und
AC160 AC160 AC160 Wendeturm- AC160
Tower-ARCnet Turmsteuerung Turmsteuerung Turmsteuerung steuerung
Section bus B Section bus D
Section bus C
Line bus Rollen-
wechslerkoppler I KT94 MR93
Rollenwechsler- Sektions- Sektions-
AC160
koppler A steuerung steuerung
Oxydry-Arcnet Interbus-S
KT94
ODC
Auro Oxydry
ARCnet
Trunk Bus
copying, copying,
filtering & filtering &
marshalling gateway gateway marshalling
delay delay
Feeder Bus Feeder Bus stop
speed speed
stop
7 Application
6 Presentation
5 Session
4 Transport
3 Network
2 Link
1 Physical
• is a model, not a standard protocol, but a suite of protocols with the same name
has been standardized by UIT / ISO / IEC for open systems data interconnection
(but with little success)
Management of connections
5 Session (e.g. ISO 8326)
node 1 node 2
Application 7 7
Presentation 6 6
Session 5 5
Transport 4 4
Network 3 3
Link 2 2
1 1
Physical
Physical Medium
500m
To connect a workstation of
department A department A to the printer of
server department B, the cable becomes too
workstations
long and the messages are corrupted.
500m
Application 7 7
Presentation 6 6
Session 5 5
Transport 4 4
Network 3 3
Link 2 2 2 2
Physical 1 1 1 1
department A department A
server server
workstations
Ethernet Ethernet 1
repeater
Bridge
printer printer
Ethernet Ethernet 2
There is only one Ethernet which carries There are now two Ethernets and only the
both department’s traffic cross-department traffic burdens both busses
LAN
port port
port
port port
Spanning-tree-Algorithmen port
avoid loops and ensures
LAN
redundancy
port
port
LAN
port
port
port
LAN LAN
nodes
queues crossbar-
switch
(or bus)
full-duplex
Application 7 7
Presentation 6 6
Session 5 5
Transport 4 4
Network 3 3 3
Link 2 2 2 2
Physical 1 1 1 1
The router routes the frames on the base of their network address.
The subnets may have different link layer protocols
Frames in transit are handled in the network layer .
segment
subnet (LAN, bus, extended link)
devices (nodes, stations) have different physical addresses
presentation
application
transport
session
physical link network link phy
LLC
preamble destination source LLC final origin NC TRP SES PRE APL CRC ED
Network Control
repeater, hub bridge router application
(gateway)
INFO
User information
Signal
NSAP = 00
Service-
Data Unit
(SDU) Protocol
Data Unit
(PDU)
N - Layer (n)-layer entity (n)-layer entity
Protocol
Service- Data Unit
Data Unit (PDU)
(SDU)
user of user of
service N service N
functions in layer N
Service Access Points represent the interface to a service (name, address, pointer,...)
ASAP Application
(z.B. File transfer, Email,....)
ISO 8473
Network-SAP
Network NSAP (not Network address)
ISO-stack
time
The TCP/IP stack is lighter than the OSI stack, but has about the same complexity
TCP/IP was implemented and used before being standardized.
Internet gave TCP/IP a decisive push
TCP/IP however installs itself as a competitor to the OSI suite, although some efforts are
made to integrate it into the OSI model
TCP/IP/UDP is becoming the backbone for all non-time critical industrial communication
TCP/IP/UDP is quickly displacing proprietary protocols.
Next generation TCP/IP (V6) is very much like the OSI standards.
Like OSI, TCP protocols have delays counted in tens or hundred milliseconds,
often unpredictable especially in case of disturbances.
1) Name the layers of the OSI model and describe their function
3) What is encapsulation ?
3.3.2
1. Layering
2. Topology
3. Physical media
5. Optical Fibres
6. Modulation
7. Synchronization
8. Encoding
9. Repeaters
EPFL - Industrial Automation 2004 June, HK 2 3.3.2 Field busses - Physical Layer
OSI Model - location of the physical level
EPFL - Industrial Automation 2004 June, HK 3 3.3.2 Field busses - Physical Layer
Subdivisions of the physical layer
EPFL - Industrial Automation 2004 June, HK 4 3.3.2 Field busses - Physical Layer
Concepts relevant to the physical layer
EPFL - Industrial Automation 2004 June, HK 5 3.3.2 Field busses - Physical Layer
Example: RS-232 - Mechanical-Electrical Standard
Originally developed for modem communication, now serial port in IBM-PCs
Telephone
Topology: lines
Data DTE DCE DCE DTE Data
Terminal 2 2 Terminal
Equipment Equipment
2 3 7
Mechanical
1
25
EPFL - Industrial Automation 2004 June, HK 6 3.3.2 Field busses - Physical Layer
Physical Layer Outline
1. Layering
2. Topology
3. Physical media
5. Optical Fibers
6. Modulation
7. Synchronization
8. Encoding
9. Repeaters
EPFL - Industrial Automation 2004 June, HK 7 3.3.2 Field busses - Physical Layer
Topology: Simplex, Half and Full Duplex
Half-duplex Examples:
Sender/ Sender/
Receiver Receiver RS485
Bus (Half-Duplex, except when using Carrier Frequency over multiple bands)
Terminator
Examples:
Ethernet, Profibus
Examples:
SERCOS, Interbus-S
EPFL - Industrial Automation 2004 June, HK 8 3.3.2 Field busses - Physical Layer
Bus topologies
party-line
Terminator
Terminator
advantage: little wiring disadvantages: easy to disrupt, high attenuation and reflections, no fibres
point-to-point hub
star
advantage: robust point-to-point links, can use fibres disadvantage: requires hub, more wiring
repeater
500m
department B server
Physically, there is only one Ethernet
carrying both department’s traffic, only one
Ethernet node may transmit at a time.
500m
EPFL - Industrial Automation 2004 June, HK 10 3.3.2 Field busses - Physical Layer
Bus: repeaters and hubs
higher-level hub
repeaters
EPFL - Industrial Automation 2004 June, HK 11 3.3.2 Field busses - Physical Layer
Party-line (bus) and star wiring
d = average distance between devices
Up to 32 devices
(more with repeaters)
hub
PLC wiring length = d • n • n / 2 • 2
increases with square of number of devices
Up to 16 devices
per hub
does it fit into the
wiring tray ? I/O I/O I/O I/O I/O
star wiring may more than offset the advantage of field busses (reduced wiring) and leads to
more concentration of I/O on the field devices.
EPFL - Industrial Automation 2004 June, HK 12 3.3.2 Field busses - Physical Layer
Rings
The wiring amount is the same for a bus with hub or for a ring with wiring cabinet.
Since rings use point-to-point links, they are well adapted to fibres
EPFL - Industrial Automation 2004 June, HK 13 3.3.2 Field busses - Physical Layer
Physical Layer Outline
1. Layering
2. Topology
3. Physical media
5. Optical Fibres
6. Modulation
7. Synchronization
8. Encoding
9. Repeaters
EPFL - Industrial Automation 2004 June, HK 14 3.3.2 Field busses - Physical Layer
Media (bandwidth x distance)
Transfer rate (Mbit/s) Costs Electromagnetic
200m 700m 2000m (Fr/m) Compatibility
optical fibres single mode 2058 516 207 5.5 very good
multimode 196 49 20 6.5 very good
plastic 1 0.5 - 6.5 very good
1. Layering
2. Topology
3. Physical media
5. Optical Fibres
6. Modulation
7. Synchronization
8. Encoding
9. Repeaters
EPFL - Industrial Automation 2004 June, HK 16 3.3.2 Field busses - Physical Layer
Electrical: Transmission media
Cost efficient
Coaxial cablewiring: core
Zw = 50Ω ... 100Ω
twisted pair (without inflexible, costly,
dielectric low losses
screen shield
10 MHz..100 MHz
EPFL - Industrial Automation 2004 June, HK 17 3.3.2 Field busses - Physical Layer
Electrical: Twisted wire pair
EPFL - Industrial Automation 2004 June, HK 18 3.3.2 Field busses - Physical Layer
Electrical: What limits transmission distance ?
Characteristic impedance
Attenuation
Linear resistance
All parameters Linear capacitance are frequency-dependent
Cross talk
Common-mode
Shield protection
EPFL - Industrial Automation 2004 June, HK 19 3.3.2 Field busses - Physical Layer
Consider in cables
EPFL - Industrial Automation 2004 June, HK 20 3.3.2 Field busses - Physical Layer
Electrical: Signal Coupling Types
Inductive transformer-coupling
galvanic separation
good electromagnetic compatibility (filter)
retro-action free
good efficiency
signal may not contain DC-components
bandwidth limited
EPFL - Industrial Automation 2004 June, HK 21 3.3.2 Field busses - Physical Layer
Electrical: Resistive (direct) coupling
wired-OR behaviour
(“Low” wins over “High”
Out In Out In Out In
device device device
EPFL - Industrial Automation 2004 June, HK 22 3.3.2 Field busses - Physical Layer
Electrical: Balanced Transmission
Shield UA UB
100 ?
(Data Ground)
The shield should not be used as a data ground (inductance of currents into conductors)
EPFL - Industrial Automation 2004 June, HK 23 3.3.2 Field busses - Physical Layer
Electrical: RS-485 as an example of balanced transmission
The most widely used transmission for busses over balanced lines (not point-to-point)
TxS RxS TxS RxS TxS RxS
•••
100?
A
stub Terminator
A
tap
120? 120?
Data-GND
B Zw ˜ 120? , C' ˜ 100 pF/m
segment length
EPFL - Industrial Automation 2004 June, HK 24 3.3.2 Field busses - Physical Layer
Electrical: RS-485 Distance x Baudrate product
distance
10000
5000
limited by copper resistance
100? /km -> 6dB loss limit
2000
1200
1000
500
limited by
frequency-dependent
200 losses ˜ 20 dB/decade
100
50
20
12
10KBd 100KBd 1 MBd 10 MBd Baudrate
EPFL - Industrial Automation 2004 June, HK 25 3.3.2 Field busses - Physical Layer
Electrical: Transformer Coupling
cost of the transformer depends on transmitted frequency band (not center frequency)
Sender/Receiver
Sender/Receiver
Isolation transformer
isolation resistors
shield
EPFL - Industrial Automation 2004 June, HK 26 3.3.2 Field busses - Physical Layer
Electrical: MIL 1553 as an example of transformer coupling
Isolation transformer
long
stub
short
stub Isolation transformer
shield shield
MIL 1553 is the standard field bus used in avionics since the years '60 - it is costly and obsolete
EPFL - Industrial Automation 2004 June, HK 27 3.3.2 Field busses - Physical Layer
Electrical: Free topology wiring
voltage
source
terminator
Free topology is used to connect scattered devices which are usually line-powered.
Main application: building wiring
Transmission medium is inhomogeneous, with many reflections and discontinuities.
Radio techniques such as echo cancellation, multiple frequency transmission
(similar to ADSL) phase modulation, etc... are used.
Speed is limited by the amount of signal processing required (typically: 10 kbit/s)
EPFL - Industrial Automation 2004 June, HK 28 3.3.2 Field busses - Physical Layer
Electrical: Power Line Carrier technology
HF-trap
220V
EPFL - Industrial Automation 2004 June, HK 29 3.3.2 Field busses - Physical Layer
Electrical: Mechanical Connecting devices to an electrical bus
stub
EPFL - Industrial Automation 2004 June, HK 31 3.3.2 Field busses - Physical Layer
Electrical: Connectors
Field busses require at the same time low cost and robust connectors.
The cheapest connectors come from the automobile industry (Faston clips)
and from telephony (RJ11, RJ 45)
The most popular connector is the sub-D 9 (the IBM PC's serial port),
which exists in diverse rugged versions.
EPFL - Industrial Automation 2004 June, HK 32 3.3.2 Field busses - Physical Layer
Electrical: Water-proof Connectors
1. Layering
2. Topology
3. Physical media
5. Optical Fibers
6. Modulation
7. Synchronization
8. Encoding
9. Repeaters
EPFL - Industrial Automation 2004 June, HK 34 3.3.2 Field busses - Physical Layer
Fiber: Principle
3 components:
transmitter fibre receiver
GaAs
PIN
LED
fotodiode
Is
different refraction
coefficients
light does not travel faster than electricity in a fiber (refraction index).
EPFL - Industrial Automation 2004 June, HK 35 3.3.2 Field busses - Physical Layer
Fiber: Types
Multimodefibre Monomode fibre
N(r)
Refraction profile 50 µm
Core
Cross-section
Clad
Longitudinal section
EPFL - Industrial Automation 2004 June, HK 36 3.3.2 Field busses - Physical Layer
Fibre: Use
in industry, fibers cost the same as copper - think about system costs !
EPFL - Industrial Automation 2004 June, HK 37 3.3.2 Field busses - Physical Layer
Fiber: building an optical bus
n% coupling losses
Every branch costs a
Passive coupler certain percentage of light
n% coupling losses
costly manufacturing (100 $ branches)
1 1
2 2
Passive star coupler 3 3 costly manufacturing
4 4 (100 $ / 4 branches)
5 5
Fused zone
6 6
fibre pair
EPFL - Industrial Automation 2004 June, HK 38 3.3.2 Field busses - Physical Layer
Fiber: building an optical ring and bridging
prism
example of
solution
Powered unpowered
Double ring
This is why optical fibers are mostly used in rings (FDDI, Sercos)
EPFL - Industrial Automation 2004 June, HK 39 3.3.2 Field busses - Physical Layer
Fiber: advantages
5 ) galvanic separation and potential-free operation (great for large current environment)
6 ) tamper free
8 ) low cable weight (100 kg/km) and diameter, flexible, small cable duct costs
10) standardized
EPFL - Industrial Automation 2004 June, HK 40 3.3.2 Field busses - Physical Layer
Fiber: Why are fibres so little used ?
5) Galvanic isolation can be achieved with coaxial cables and twisted pairs through opto-couplers
7) Optical busses using (cheap) passive components are limited to a few branches (16)
10) Topology is restricted by the star coupler (hub) or the ring structure
EPFL - Industrial Automation 2004 June, HK 41 3.3.2 Field busses - Physical Layer
Radio Transmission
Radio had the reputation to be slow, highly disturbed and range limited.
Mobile radio (GSM, DECT) is able to carry only limited rate of data (9.6 kbit/s) at high costs,
distance being limited only by ground station coverage.
IEEE 802.11 standards developed for computer peripherals e.g. Apple’s AirPort
allow short-range (200m) transmission at 11 Mbit/s in the 2.4 GHz band with 100mW.
Bluetooth allow low-cost, low power (1 mW) links in the same 2.4 GHz band, at 1 Mbit/s
Modulation uses amplitude, phase and multiple frequencies (see next Section)
bluetooth module
EPFL - Industrial Automation 2004 June, HK 42 3.3.2 Field busses - Physical Layer
Wireless Field busses
no wiring,
mobile,
easy to install
short distance,
limited bandwidth,
area overlap and frequency limitations
not tamper-free,
difficult to power the devices
costs of base station
EPFL - Industrial Automation 2004 June, HK 43 3.3.2 Field busses - Physical Layer
Redundancy at the physical layer
Party-Line
Terminator
Terminator
decentralized wiring both cables can run in the same conduct where
common mode failure acceptable
star coupler A
star coupler B
common mode failures cannot be excluded since wiring has to come together at each device
EPFL - Industrial Automation 2004 June, HK 44 3.3.2 Field busses - Physical Layer
Physical Layer Outline
1. Layering
2. Topology
3. Physical media
5. Optical Fibers
6. Modulation
7. Synchronization
8. Encoding
9. Repeaters
EPFL - Industrial Automation 2004 June, HK 45 3.3.2 Field busses - Physical Layer
Modulation
Base band
Signal transmitted as a sequence of binary
states, one at a time (e.g. Manchester)
Carrier band
Signal transmitted as a sequence of frequencies,
one at a time
(e.g. FSK = frequency shift keying = 2-phase
Modulation.
Broadband
Backward Forward-
Signal transmitted as a sequence of frequencies, channel channel
several at the same time.
5-108 162-400
Signals may be modulated on a carrier frequency MHz MHz Frequency
(e.g. 300MHz-400MHz, in channel of 6 MHz)
EPFL - Industrial Automation 2004 June, HK 46 3.3.2 Field busses - Physical Layer
Physical Layer Outline
1. Layering
2. Topology
3. Physical media
5. Optical Fibres
6. Modulation
7. Synchronization
8. Encoding
9. Repeaters
EPFL - Industrial Automation 2004 June, HK 47 3.3.2 Field busses - Physical Layer
Synchronisation: where does it take place ?
"determine the beginning and the end of a data stream"
Bit synchronisation Recognize individual bits
Character synchronisation Recognize groups of (5,7,8,9,..) bits
Frame synchronisation Recognize a sequence of bits transmitted as a whole
Message synchronisation Recognize a sequence of frames
Session synchronisation Recognize a sequence of messages
+NRZ Data
+Framing
= Line Signal
EPFL - Industrial Automation 2004 June, HK 48 3.3.2 Field busses - Physical Layer
Frames: Synchronization
Data A B C SYN D E F G
Bit-stuffing
delimiter A symbol sequence is used as delimiter, which includes non-data symbols
(e.g. IEC 61158)
Signal
EPFL - Industrial Automation 2004 June, HK 49 3.3.2 Field busses - Physical Layer
Physical Layer Outline
1. Layering
2. Topology
3. Physical media
5. Optical Fibers
6. Modulation
7. Synchronization
8. Encoding
9. Repeaters
EPFL - Industrial Automation 2004 June, HK 50 3.3.2 Field busses - Physical Layer
Encoding: popular DC-free encodings
user
Manchester 1 1 0 1 1 0 0 0
1: falling edge at midpoint Ethernet, FIP
0: rising edge at midpoint IEC 61158,
DC-free, memoryless* MVB, MIL 1553
Differential Manchester
always transition at midpoint
1: no transition at start point LON
0: transition at start point
(polarity-insensitive, DC-free,
memoryless)
Miller (MFM)
centre frequency halved High-density
not completely DC-free diskettes
memory: two bits
(sequence 0110)
Xerxes
replaces “101” sequence
by DC-balanced sequence FlexRay
DC-free, memory: two bits
memoryless*: decoding does not depend on history
EPFL - Industrial Automation 2004 June, HK 51 3.3.2 Field busses - Physical Layer
Encoding: DC-free coding for transformer coupling
The drivers must be carefully balanced (positive and negative excursion |+U| = |-U|)
Many applications (ISDN…) accept not completely DC-free codes, provided that
the DC component is statistically small when transmitting random data, but have to
deal with large interframe gaps.
effect of unbalance
(magnetic discharge)
EPFL - Industrial Automation 2004 June, HK 52 3.3.2 Field busses - Physical Layer
Decoding base-band signals
Zero-crossing detector
decoding depends on the distance between edges Dynamic: 10 dB
line
unipolar signal
idle level
histeresis Uh+
Uh-
time
active
RxS
bipolar signal
idle Dynamic: 18 dB
Uh+
Uh-
EPFL - Industrial Automation 2004 June, HK 53 3.3.2 Field busses - Physical Layer
Encoding: Physical frame of IEC 61158-2
1 0 1 0 1 0 1 0
+U
Preamble (variable) 0V for PLL synchronisation
-U
1 N+ N- 1 0 N- N+ 0
Start delimiter (8 bit times) needed since preamble
is variable length
1 0 0 1 1 0 1 1
Payload (variable length)
1 N+ N- N+ N- 1 0 1
End delimiter (8 bit times) defines end of frame
EPFL - Industrial Automation 2004 June, HK 54 3.3.2 Field busses - Physical Layer
Encodings: Multi-frequency
frequency
unused 22,5 kHz 31,5 kHz 40,5 kHz 49,5 kHz 58,5 kHz 67,5 kHz 76,5 kHz 85,5 kHz
27 kHz 36 45 kHz 54 63 72 81 kHz 90 kHz
kHz kHz kHz kHz
EPFL - Industrial Automation 2004 June, HK 55 3.3.2 Field busses - Physical Layer
Bandwidth and Manchester Encoding
Delimiter " 0 " " 1 "" 0 " " 0 " " 1 " " 1 " " 0 "
3-step 2-step
3-step
EPFL - Industrial Automation 2004 June, HK 56 3.3.2 Field busses - Physical Layer
Encoding: qualities
6) Polarity
A polarity-insensitive electrical wiring simplifies installation
EPFL - Industrial Automation 2004 June, HK 57 3.3.2 Field busses - Physical Layer
Physical Layer Outline
1. Layering
2. Topology
3. Physical media
5. Optical Fibres
6. Modulation
7. Synchronization
8. Encoding
9. Repeaters
EPFL - Industrial Automation 2004 June, HK 58 3.3.2 Field busses - Physical Layer
Repeater
A repeater is used at a transition from one medium to another within the same subnet.
decoder
encoder
segment 1 segment 2
decoder
encoder
(RS 485) (transformer-coupled)
The repeater:
• decodes and reshapes the signal (knowing its shape)
• recognizes the transmission direction and forward the frame
• detects and propagates collisions
EPFL - Industrial Automation 2004 June, HK 59 3.3.2 Field busses - Physical Layer
Repeater and time skew
Repeaters introduce an impredictable delay in the transmission since they need some time
to synchronize on the incoming signal and resolve collisions.
EPFL - Industrial Automation 2004 June, HK 60 3.3.2 Field busses - Physical Layer
Star coupler (hub)
A star coupler is a collection of repeaters that connect point-to-point links into a bus
(e.g. for optical fibres). it is called "hub" in the Ethernet standard.
It is a star topology, but a bus structure
opto-electrical
wired-or electrical media transceiver
to other device
or star coupler to other device
or star coupler
fibre pair
EPFL - Industrial Automation 2004 June, HK 61 3.3.2 Field busses - Physical Layer
To probe further
Fred Halsall, Data Communications, Computer Networks and Open Systems, Addison-Wesley
EPFL - Industrial Automation 2004 June, HK 62 3.3.2 Field busses - Physical Layer
Assessment
What is the function of the physical layer ?
What is the difference between a bus and a ring ?
How is a bus wired ?
Which electrical media are used in industry ?
How is the signal coupled to an electrical media ?
How is the signal decoded ?
What is an open-collector (open-drain) electrical media ?
What are the advantages and disadvantages of transformer coupling ?
What limits the distance covered by electrical signals and how is this to overcome ?
What are the advantages and disadvantages of optical fibres ?
When are optical fibers of 240 mm used rather than 62.5 mm ?
What is a broadband medium ?
What is DSL ?
What is the purpose of modulation ?
What is the purpose of encoding ?
What is the difference between bit rate and Baudrate and what does it say about efficiency?
What limits the theoretical throughput of a medium ?
What is the difference between Manchester encoding, Miller and differential Manchester ?
Which are the qualities expected from an encoding scheme ?
EPFL - Industrial Automation 2004 June, HK 63 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation 2004 June, HK 64 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation 2004 June, HK 65 3.3.2 Field busses - Physical Layer
Industrial Automation
Automation Industrielle
Industrielle Automation
EPFL - Industrial Automation 2004 June, HK 2 3.3.3 Field busses - Link Layer
Link Layer function
The link layer implements the protocols used to communicate within the same subnet.
1) Data integrity
2) Medium Access
EPFL - Industrial Automation 2004 June, HK 3 3.3.3 Field busses - Link Layer
Link Layer in the OSI Model
Functions
Network
7 Application store-and-forward
bridge control
address discovery
6 Presentation Logical Link connection establishment
Control flow Control
(LLC) error handling
5 Session
Medium Access medium allocation
Control (master redundancy)
4 Transport (MAC)
addressing
3 Network Frame frame format
integrity control
2 Link Physical
Signaling
1 Physical Physical
Medium
EPFL - Industrial Automation 2004 June, HK 4 3.3.3 Field busses - Link Layer
OSI model with two nodes
Node 1 Node 2
Application
7 7
Presentation 6 6
Session 5 5
Transport 4 4
Network 3 3
Link 2 2
Physical 1 1
Physical Medium
EPFL - Industrial Automation 2004 June, HK 5 3.3.3 Field busses - Link Layer
OSI model with repeater (physical layer connection)
Node 1 repeater Node 2
Application 7 7
Presentation 6 6
Session 5 5
Transport 4 4
Network 3 3
Link 2 2
Physical 1 1 1 1
The two segments on each side of a repeater form a single subnet, identified by
• same speed (medium, modulation may differ)
• same frame format (except fringe effects)
• same medium access
• same address space (transparent on both side of the repeater)
Repeaters introduce a delay in the order of a few bit time.
EPFL - Industrial Automation 2004 June, HK 6 3.3.3 Field busses - Link Layer
OSI model with three nodes (bridge): link layer connection
Application 7 7
Presentation 6 6
Session 5 5
Transport 4 4
Network 3 3
Link 2 2 2 2
Physical 1 1 1 1
EPFL - Industrial Automation 2004 June, HK 7 3.3.3 Field busses - Link Layer
Link Layer Outline
EPFL - Industrial Automation 2004 June, HK 8 3.3.3 Field busses - Link Layer
HDLC as example of a link layer protocol
EPFL - Industrial Automation 2004 June, HK 9 3.3.3 Field busses - Link Layer
HDLC Topology
full-duplex
or Primary
half-duplex
medium (Mainframe)
EPFL - Industrial Automation 2004 June, HK 10 3.3.3 Field busses - Link Layer
HDLC - Full- and Half duplex operation
Full-Duplex
Command/Data
Requester/ Responder/
Primary Secondary
Acknowledgement
Sender/Receiver Sender/Receiver
Command/Acknowledgement
Requester/ Responder/
Primary Secondary
Data
Sender/Receiver Sender/Receiver
Half-Duplex
Requester/ Responder/
Primary Secondary
Sender/Receiver Sender/Receiver
The Primary switches the Secondary to send mode, the Secondary sends until it returns control
EPFL - Industrial Automation 2004 June, HK 11 3.3.3 Field busses - Link Layer
Link Layer Outline
EPFL - Industrial Automation 2004 June, HK 12 3.3.3 Field busses - Link Layer
Frame Sublayer
Network Network
Physical Physical
Signaling Signaling
Physical Physical
Medium Medium
The frame layer is concerned with the correct frame format and contents,
with (practically) no consideration of the medium or speed.
EPFL - Industrial Automation 2004 June, HK 13 3.3.3 Field busses - Link Layer
Error Handling
Error detection
Frame data are protected by redundant information, such as parity bits,checksum,
CRC (Cyclic Redundancy Check)
Error recovery
Except when medium is very poor (Power Line Carrier, radio), error correcting
codes are not used.
Erroneous frames are ignored, the potential sender of the error is not informed
(the address of the sender is unknown if the frame is damaged)
The sender is informed of the lack of response when it does not receive the
expected acknowledgement within a time-out.
Definition of the time-out has a strong impact on real-time behaviour
EPFL - Industrial Automation 2004 June, HK 14 3.3.3 Field busses - Link Layer
Link Layer Outline
EPFL - Industrial Automation 2004 June, HK 15 3.3.3 Field busses - Link Layer
Error Detection
• Hamming-Distance
EPFL - Industrial Automation 2004 June, HK 16 3.3.3 Field busses - Link Layer
Hamming Distance
The Hamming Distance between two words is the number of bits in which they differ:
Example Word 1: 01100110
Word 2: 00101001 -> Hamming-Distance = 5
The Hamming Distance of a code is the minimum number of bits which need to be tilted
in a valid codeword to produce another valid (but erroneous) codeword
Example: HD = 4: ZD = 3, ZC = 1
EPFL - Industrial Automation 2004 June, HK 17 3.3.3 Field busses - Link Layer
Hamming distance in 3 dimensions: parity
1 0 1 1 0 0 0 0 1
par D7 D6 D5 D4 D3 D2 D1 D0
Odd parity: sum Modulo-2 of all "1" in the codeword (including the parity bit) is odd
The parity bit is the last transmitted bit (->LSB first, a matter of convention)
illegal
111
110
101
100
legal 011
010
001
000
EPFL - Industrial Automation 2004 June, HK 18 3.3.3 Field busses - Link Layer
Error Detection through CRC
data (dividend)
GP(divisor)
rest
EPFL - Industrial Automation 2004 June, HK 19 3.3.3 Field busses - Link Layer
Residual Error Rate, Parity
Example:
Hamming Distance 2
n n -1
Residual error rate R
er
= 1 - (1 - E )
r
- n · E · (1- E )
r r
no error exactly one error
Rer for two word length:
-5 -10
E = 10 n = 9 bit R = 72 · 10
r er quite efficient….
-5 -5
E = 10 n = 513 bit R = 2.6· 10 quite useless ...
r er
EPFL - Industrial Automation 2004 June, HK 20 3.3.3 Field busses - Link Layer
Integrity classes and bit error rate
10 0
10 - 2
s s I1
10 - 4 c la
gr ity
In te 2
10 - 6 FT
2
T1.
10 - 8 F
I2
s
as
cl
10 -10
y
it
gr
te
In
10 -12
Integrity class I3
10 -14
EPFL - Industrial Automation 2004 June, HK 21 3.3.3 Field busses - Link Layer
Synchronization Errors
HDLC-frame
flag flag
EPFL - Industrial Automation 2004 June, HK 22 3.3.3 Field busses - Link Layer
Link Layer Outline
EPFL - Industrial Automation 2004 June, HK 23 3.3.3 Field busses - Link Layer
Error Correcting Codes
Error correcting codes are used where the probability of disturbances is high (e.g. power
line communication) and the time to retransmit is long (e.g. space probe near Jupiter).
In industry, error correcting codes are normally directly embedded in the physical layer,
e.g. as part of a multitone transmission (ADSL) or of a radio protocol (Bluetooth).
Error correction necessarily decreases the data integrity, i.e. the probability of accepting
wrong data, since the redundancy of correction is taken from the code redundancy.
It is much more important to reject erroneous data (low residual error rate) than to try to
correct transmission.
However, when the medium is very bad (radio), error correction is necessary to
transmit even short messages.
Assigning bits for error detection and correction is a tradeoff between integrity and
availability.
EPFL - Industrial Automation 2004 June, HK 24 3.3.3 Field busses - Link Layer
Link Layer Outline
EPFL - Industrial Automation 2004 June, HK 25 3.3.3 Field busses - Link Layer
Medium Access Control
EPFL - Industrial Automation 2004 June, HK 26 3.3.3 Field busses - Link Layer
Link Layer Outline
EPFL - Industrial Automation 2004 June, HK 27 3.3.3 Field busses - Link Layer
Medium Access Control - quality criteria
EPFL - Industrial Automation 2004 June, HK 28 3.3.3 Field busses - Link Layer
Link Layer Outline
EPFL - Industrial Automation 2004 June, HK 29 3.3.3 Field busses - Link Layer
MAC single master (e.g. Profibus DP)
bus
slave slave slave master
devices
(slaves)
bus
EPFL - Industrial Automation 2004 June, HK 30 3.3.3 Field busses - Link Layer
Link Layer Outline
EPFL - Industrial Automation 2004 June, HK 31 3.3.3 Field busses - Link Layer
MAC Rings (1): register insertion principle
Devices are connected by point-to-point links (no bus!), there is one sender per segment.
The operation is similar to a large shift register.
The master sends a long frame with the output data to the first device in the ring.
Each device reads the data intended for it, inserts its data instead and
passes the frame to the next device.
The last device gives the frame back to the master.
data time
master
input input input
data time
EPFL - Industrial Automation 2004 June, HK 32 3.3.3 Field busses - Link Layer
MAC Rings (2): pros and cons
Two major field busses use the ring topology, Interbus-S and SERCOS
and the register-insertion principle described.
the position of the bit in the frame corresponds to the position of the device in the ring,
there are no device addresses - easy to use, but prone to misconfiguration.
each device introduces a delay at least equal to a few bits
+ deterministic access, good usage of capacity, addresses are given by device sequence
on the ring, only point-to-point links
EPFL - Industrial Automation 2004 June, HK 33 3.3.3 Field busses - Link Layer
Link Layer Outline
EPFL - Industrial Automation 2004 June, HK 34 3.3.3 Field busses - Link Layer
MAC Ethernet (1): CSMA-CD principle (stochastic)
EPFL - Industrial Automation 2004 June, HK 35 3.3.3 Field busses - Link Layer
MAC Ethernet (2): collision conditions
A repeater B
preamble
(2 x 7.5 s/km+ 2
= 8 Bytes
Tpd repeaters)
minimum
frame size
= 64 Bytes
EPFL - Industrial Automation 2004 June, HK 36 3.3.3 Field busses - Link Layer
MAC Ethernet (3): propagation conditions and bus diameter
The frame must be long enough to allow all stations to detect a collision while the frame is
being transmitted.
500 m
Collisions can only be detected reliably when the frame size is longer than the
propagation delay -> padding to a minimum size (512 bits = 64 Bytes)
Since a station which expects a collision must wait one slot time before transmitting,
the maximum frame throughput on Ethernet is limited by the slot time.
EPFL - Industrial Automation 2004 June, HK 37 3.3.3 Field busses - Link Layer
MAC Ethernet (4): collision probability and simultaneous transmitters
After the end of a frame, a transmitter chooses a slot at random from a fixed number of slots
utilisation 100% 1
frame size
0.8
4096
1024
0.6
512
0.4 48
0.2
0
number of transmitters
1 2 3 4 5 10 32 64 128 256
Ethernet is not efficient for small frame size and large number of simultaneous transmitters
Ethernet is considered to enter overload when reaching 10%-18% load
EPFL - Industrial Automation 2004 June, HK 38 3.3.3 Field busses - Link Layer
MAC Ethernet (5): when collisions can't be detected
It is not always possible to detect collisions.
LON uses a p-persistent MAC with 16-slot collision avoidance (p = 1/16)
1
probability of loosing a packet source: P. Koopman, CMU
0.9
0.8
0.7
0.4
0.3
0.2
with collision detection
0.1
number of simultaneous transmitters
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
EPFL - Industrial Automation 2004 June, HK 39 3.3.3 Field busses - Link Layer
Link Layer Outline
EPFL - Industrial Automation 2004 June, HK 40 3.3.3 Field busses - Link Layer
MAC CAN (1): Deterministic Arbitration
The CAN fieldbus uses media with a dominant and a recessive state
When several transmitters are simultaneously active, the dominant state wins
over the recessive state if there is at least one transmitter sending the dominant state
(dominant is “Low” in open collector, "Bright" in an optical fiber, or a collision on a medium
that allows collisions).
Rt Rt
Bus line
A device is capable to know if the signal it puts on the line is disturbed (XOR).
EPFL - Industrial Automation 2004 June, HK 41 3.3.3 Field busses - Link Layer
MAC CAN (2): Collision with Winner
Also known as "Urn" or "binary bisection" method
• Each station has a different identity (in this example: 4 bit ID)
• Each station listens before sending and can detect collisions
• Competing stations start transmitting at the same time (1st bit is a SYNC-sign)
• Each station begins its transmission with its identity, bit by bit
• In case of collision, "1" wins over "0" ("1" = Low, bright, dominant).
• A station, whose "0" bit was transformed into a “1" retires immediately
• The winning station has not been disturbed and transmits.
• Loosing stations await the end of the ongoing transmission to start again.
slot time
Station 10 (wins) 1 0 1 0
Station 09 1 0 0 (1)
Bus signal 1 0 1 0
Drawback: the slot time (one bit time) must be long enough so that every station can
detect if it has been disturbed - I.e. twice as long as the propagation time
from one end of the bus to the other ( signal speed = 5 ns / m).
EPFL - Industrial Automation 2004 June, HK 43 3.3.3 Field busses - Link Layer
Link Layer Outline
EPFL - Industrial Automation 2004 June, HK 44 3.3.3 Field busses - Link Layer
MAC Profibus (1): Token principle
Each station knows the next station in the ring (and the overnext)
Each station delegates the right to send to the next station in the ring,
(in the form of a token frame or as an appendix to a data frame).
Variants Token with Priority (back to the station with the highest priority)
EPFL - Industrial Automation 2004 June, HK 45 3.3.3 Field busses - Link Layer
MAC Profibus (2): Token passing
logical ring
AS AS AS active stations
(potential masters)
passive stations
(slaves)
Active Stations (AS) can become master if they own the token,
for a limited duration (one frame only).
After that time, the master passes the token to a station with a higher address
or, if it has the highest address, to the station with the lowest address.
A station must send at least one frame (data or token) when it gets its turn.
EPFL - Industrial Automation 2004 June, HK 46 3.3.3 Field busses - Link Layer
MAC Profibus (3): Token passing algorithm
AS AS PS TS NS AS
When the current master has no more data to send, or when its turn expires, it
sends a token frame to the Next Station (NS) in the ring.
If the master does not receive an acknowledgement for two consecutive trials,
the master removes the station from the LAS and declares the overnext
active station (OS) as NS.
EPFL - Industrial Automation 2004 June, HK 47 3.3.3 Field busses - Link Layer
MAC Profibus (4): Token initialization
If it senses traffic, a station records the token frames and builds a list of active stations (LAS).
In particular, it observes if a station with the same name as itself already exists.
When a master checks the gap, the station will receive a token offer.
If a station does not register any traffic during a certain time, it sends a token frame to itself.
It sends the first token frame to itself, to let other starting stations register it.
Only when it detects no other station does a station begin with a systematic
poll of all addresses, to build the LAS.
EPFL - Industrial Automation 2004 June, HK 48 3.3.3 Field busses - Link Layer
Link Layer Outline
EPFL - Industrial Automation 2004 June, HK 49 3.3.3 Field busses - Link Layer
Comparison of Medium Access Control Methods
stochastic deterministic
optimistic pessimistic
EPFL - Industrial Automation 2004 June, HK 50 3.3.3 Field busses - Link Layer
Link Layer Outline
EPFL - Industrial Automation 2004 June, HK 51 3.3.3 Field busses - Link Layer
Logical Link Control Sublayer
Network Network
Frame Frame
Physical Physical
Signaling Signaling
Physical Physical
Medium Medium
EPFL - Industrial Automation 2004 June, HK 52 3.3.3 Field busses - Link Layer
Connection-Oriented and Connection-Less communication
these considerations apply to all levels of the OSI model
Connectionless mode Connection-Oriented mode
(Datagram ≈ letter) (Virtual Circuit ≈ telephone)
Each packet (Datagram) contains all A connection is first established between sender
information needed to forward it to its final and receiver.
destination over the network, including the Information packets are identified by their
path back to the sender. connection identifier and by their sequence
number within that connection.
The network assumes no responsibility for The network cares for opening and closing
the ordering of packets and does not try to connections and ensures that packets are received
recover damaged datagrams. in same order as they are sent, recovering lost
The burden of flow control and error recovery packets and controlling the flow.
is shifted to the application. Applications see the network as a reliable pipe.
Connection is closed after use (and reused)
Semantic of CL-transmission Semantic of CO-transmission
Send_Packet (source, destination, Packet1); Open_Channel(Node, Task, Channel_Nr);
Send_Message (Channel_Nr, Msg1);
Send_Packet (source, destination, Packet2);
Send_Message (Channel_Nr, Msg2);
Close(Channel_Nr);
EPFL - Industrial Automation 2004 June, HK 53 3.3.3 Field busses - Link Layer
Connection-Oriented Link Service
REQUEST
INDICATION
RESPONSE
CONFIRM
EPFL - Industrial Automation 2004 June, HK 54 3.3.3 Field busses - Link Layer
Flow Control
packets 6 7 8 9 10 11 12
time
sent and sent but not yet can be sent may not
acknowledged acknowledged be sent
EPFL - Industrial Automation 2004 June, HK 55 3.3.3 Field busses - Link Layer
Simple transfer with window size = 1
connect nm_connect.ind
i
timer nm_connect.cnf
Connect Confirm
Transfer
ack DATA (0)
timer ACK (1) alive
time-out
DATA (1)
ACK (2)
DATA ( last)
nm_message_ind
ACK (last) late
nm_message.cnf Disconnection acks
time
EPFL - Industrial Automation 2004 June, HK 56 3.3.3 Field busses - Link Layer
Error Recovery
EPFL - Industrial Automation 2004 June, HK 57 3.3.3 Field busses - Link Layer
Link Layer Outline
EPFL - Industrial Automation 2004 June, HK 58 3.3.3 Field busses - Link Layer
Example: HDLC
EPFL - Industrial Automation 2004 June, HK 59 3.3.3 Field busses - Link Layer
HDLC Control Field (ISO 4335)
flag flag
8 8 8 16 8
1 2 3 4 5 6 7 8
Control Field Format for: N(S) = Sequence number of
Information Transfer sender
Command/Response 0 N(S) P/F N(R)
(I-Format PDU) N(R) = Sequence number of
Supervisory receiver
Commands/Responses 1 0 S P/F N(R)
(S-Format PDUs)
S = Supervisory
Unnumbered
Commands/Response 1 1 M P/F M
(U-Format PDUs)
P/F = Poll/Final (Please respond/Final in sequence)
EPFL - Industrial Automation 2004 June, HK 60 3.3.3 Field busses - Link Layer
HDLC Connection Types
The receiver indicates which packet it expects next, either through a special frame
( Receiver Ready N(R) ) or within its information frames (I-Frame, N(R))
At the same time, this sequence number acknowledges all previously received
frames with number N(R) -1.
LAPB (LAP-balanced): every station can become primary and start transmitting
(if medium access allows).
EPFL - Industrial Automation 2004 June, HK 61 3.3.3 Field busses - Link Layer
HDLC Exchange (NMR in ISO 4335)
Send Sequence
set normal response please confirm
mode, poll information packets
SNRM, P I0,0 I1,0 I2,0P I3,0
Primary
(Commander) time
UA,F RR3,F
Secondary
(Responder) accept receiver
connection, ready, expects 3
final
Receive Sequence
receiver receiver
set normal response
ready, expects 0 ready, expects 3
mode, poll
SNRM; P RR0;P RR3;P
Primary time
(Commander)
UA;F I0,0 I1,0 I2,0;F I3,0
Secondary
(Responder) accept several
connection, final information packets last frame
EPFL - Industrial Automation 2004 June, HK 62 3.3.3 Field busses - Link Layer
Clocks
EPFL - Industrial Automation 2004 June, HK 63 3.3.3 Field busses - Link Layer
Time Distribution in a single master system
At fixed intervals, the Master broadcasts the exact time as a periodic variable.
When receiving this variable, the bus controllers generate a pulse which can
resynchronize a slave clock or generate an interrupt request.
master
clock pulse pulse pulse
bus bus bus
controller controller controller
BUS
bus master time variable
EPFL - Industrial Automation 2004 June, HK 64 3.3.3 Field busses - Link Layer
Clock compensation for transmission delays
other master
slave with clock
clock
master
1 MVB 1 other MVB
synchronizer
The clock does not need to be generated by the Master, but the master must poll the clock
The clock can synchronize sampling within a few µs across several bus segments.
EPFL - Industrial Automation 2004 June, HK 65 3.3.3 Field busses - Link Layer
IEEE 1588 PTP Clock Synchronization
IEEE 1588 defines the Precision Time Protocol, a clock synchronization that assumes that
two consecutive frames have the same delay, but the moment of sending suffers jitter.
The clock device (possibly coupled to a radio signal) sends the first frame with an coarse
time stamp, but registers in hardware the exact moment when the frame was sent.
It then sends a second frame with the exact time at which the first frame was sent.
Bridges and switches are responsible to compensate for their internal delays and send a
corrected time frame.
EPFL - Industrial Automation 2004 June, HK 66 3.3.3 Field busses - Link Layer
High precision clock synchronization
Alternatively, all devices receive a radio signal from GPS to recalibrate their internal clocks.
EPFL - Industrial Automation 2004 June, HK 67 3.3.3 Field busses - Link Layer
Assessment
EPFL - Industrial Automation 2004 June, HK 68 3.3.3 Field busses - Link Layer
Industrial Automation
Automation Industrielle
Industrielle Automation
3.3.4
2005 May, HK
Industrial Automation 2 3.0.3 Presentation Layer
Presentation Layer
2005 May, HK
Industrial Automation 3 3.0.3 Presentation Layer
Transfer Syntax: describe what is in a frame ?
Role: how to define formally the format and meaning of the transmitted data
IEEE 802.4 ISO 8802 ISO 8473 ISO 8073 DATA (DT) TPDU
token bus logical link control connectionless network control class 4 transport control (normal format)
13 3 >48 5
2005 May, HK
Industrial Automation 4 3.0.3 Presentation Layer
ASN.1 justification
2005 May, HK
Industrial Automation 5 3.0.3 Presentation Layer
Semantic Levels of Data Representation
Semantic format 154,5 Vrms
struct {
unsigned count;
int item2:8;
Application Language format int item1:4;
int dummy:4; Application
} Processor
D15 D00
Application Memory
Application Storage format
(Assembly language)
Storage format
Traffic Memory Parallel Bus Format
Traffic Memory format (8 bit, 16 bit, 32 bits)
time
2005 May, HK
Industrial Automation 6 3.0.3 Presentation Layer
Bit Transmission Order
Most data links are byte-oriented (transmit 8 bit as an indivisible unit)
The order of bit transmission within a byte (octet) is dependent on the link.
It does not matter as long as all bus participants use the same scheme
first first
0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0
LSB MSB MSB LSB time
UART, HDLC, Ethernet FDDI, FIP, CAN, MVB
Legacy of the old telex
There is no relation between the bit and the byte ordering scheme
octet in octet out
Who says which bit is really transmitted first ?
(FDDI: multi-bit symbol transmission, multi-bit
transmission with interleaving)
2005 May, HK
Industrial Automation 7 3.0.3 Presentation Layer
Integer representation in memory: Big-Endian vs Little Endian
LE BE
Memory contents
MSB LSB Intel Motorola
DEC IBM, TCP/IP,
address 7 6 5 4 3 2 1 0 Unix, RISC
x0000 0 0 0 0 0 0 1 0 INTEGER8 =2 =2
x0001 0 0 0 0 0 0 0 1
INTEGER16 =1 = 256
x0002 0 0 0 0 0 0 0 0
x0003 0 0 0 0 0 0 0 1
x0004 0 0 0 0 0 0 0 0
INTEGER32 =1 = 16777216
x0005 0 0 0 0 0 0 0 0
x0006 0 0 0 0 0 0 0 0
2005 May, HK
Industrial Automation 8 3.0.3 Presentation Layer
How are sequence of octets transmitted ?
INTEGER32
how to name bits ?
2005 May, HK
Industrial Automation 9 3.0.3 Presentation Layer
So, how to respect network byte ordering ?
All data "seen" by the sockets layer and passed on to the network must be in network order
struct sockaddr_in s;
/* WRONG */
s.sin_port = 23;
/* RIGHT */
s.sin_port = htons(23);
2005 May, HK
Industrial Automation 10 3.0.3 Presentation Layer
Inconsistency: Token-bus frame (IEEE 802.4)
first MAC
symbol
read this picture from left to right,
preamble then top to bottom
N N 0 N N 0 0 0
F F M M M P P P
I/G L/U lsb
Destination Address
remaining 44 bits of address
msb
Addresses are transmitted least significant bit first
I/G L/U lsb
Source Address
remaining 44 bits of address
msb
lsb msb first octet
Data are transmitted least significant bit first within
an octet, but most significant octet first within a
word (imposed by higher layers)
lsb msb last data octet
msb
2005 May, HK
Industrial Automation 11 3.0.3 Presentation Layer
How to specify transmitted data
offset 0
offset
time
first: agree on a bit and byte ordering second: describe the data stream
scheme: {0,0} scheme recommended. formally (machine-readable)
intuitive formal
0 1 2 3 4 5 6 7 CommandPDU :== SEQUENCE
0 snu gni nodeID or groupID {
1 stationID BOOLEAN1 snu -- system
2 BOOLEAN1 gni -- group
functionID
3
CHOICE (gni)
protocolID
{
4
command Group : ENUM6 groupID;
parameter Individual: ENUM6 nodeID;
i
}
ENUM8 stationID;
i+1
...
2005 May, HK
Industrial Automation 12 3.0.3 Presentation Layer
Can a “C”-declaration serve as an encoding syntax ?
Such a machine-dependent syntax is only valid if all applications use the same syntax on
the same machine with the same compiler, it is not suited to describe the bus traffic.
2005 May, HK
Industrial Automation 13 3.0.3 Presentation Layer
Abstract Syntax Notation Number 1 (ASN.1)
• The IEC/ISO define a standard notation in IEC 8824 (ASN.1), allowing to define
simple types (primitive) and constructed types.
• Data structures can take forms not usually found in programming languages.
• Each data structure is identified during transmission by a tag.
• In principle, ASN.1 only defines data structures to be transmitted, but not how
they are encoded for transmission.
• One possible coding of the primitive and constructed data types is defined in
ISO/IEC 8825 as "Basic Encoding Rules“ (BER) defined in ISO 8825.
• More efficient encodings (PER,…) also exist.
• ASN.1 can be used for defining memory contents, file contents or communication
data, and in general any exchanged information.
• ASN.1 has the same role as XML, but it is far more efficient.
2005 May, HK
Industrial Automation 14 3.0.3 Presentation Layer
ASN.1 Syntax Example
Informal ASN.1
Name: John P Smith PersonRecord ::= [APPLICATION 0] SEQUENCE {
Title: Director name Name
Employee Number: 51
Date of Hire: 17 September 1971 title [0] VisibleString,
Name of Spouse: Mary T Smith number EmployeeNumber,
Number of 2 dateOfHire [1] Date,
Children: nameOfSpouse [2] Name,
children [3] SEQUENCE OF
Child Information Ralph T Smith
Name: 11 November 1957 Childinformation DEFAULT {} }
Date of Birth
ChildInformation ::= SEQUENCE {
Child Information Susan B Jones name Name,
Name: 17 July 1959
Date of Birth dateOfBirth [0] Date}
2005 May, HK
Industrial Automation 15 3.0.3 Presentation Layer
Abstract syntax and transfer syntax
E.g. A transfer syntax defines the name of the structures and elements, their value range
[e.g. 0..15], ….
A transfer syntax describes how the structures and elements are effectively
encoded for storing and transmission, so that the receiver can fully decode the
transmitted
information. At transmission time, only the transfer syntax is visible, it cannot be
interpreted
without knowing the abstract syntax.
The basic encoding rules for ASN.1 are defined in the standard ISO 8825-1.
2005 May, HK
Industrial Automation 16 3.0.3 Presentation Layer
ASN.1 encoding: TLV
ASN.1 does not say how data are stored nor transmitted, but it assumes that the
transmission format consists for each item of: a tag, a length and a value (TLV)
the tag specifies the data type of the value that follows, implicitly or explicitly.
2005 May, HK
Industrial Automation 17 3.0.3 Presentation Layer
ASN.1 Data Types
UNIVERSAL
four Tag Types APPLICATION
CONTEXT_SPECIFIC
PRIVATE
2005 May, HK
Industrial Automation 18 3.0.3 Presentation Layer
ASN.1: The Type SEQUENCE
This notation assumes that all elements in the sequence are present and are transmitted
in the specified order.
2005 May, HK
Industrial Automation 19 3.0.3 Presentation Layer
Tagging
Of course, if all types would be different, it would be sufficient to specify the type,
but this practice (called EXPLICIT tagging) should not be followed.
Structured types need in any case a tag, otherwise they cannot be distinguished
from another structured type (note how “PersonRecord” is identified)
tags A1 A1 A4 A3 A5
2005 May, HK
Industrial Automation 20 3.0.3 Presentation Layer
ASN.1: The CHOICE type
A choice selects exactly one alternative of several.
There is normally a distinct tag for each choice, but the type can
also be used as tag, as long as all types are distinct:
2005 May, HK
Industrial Automation 21 3.0.3 Presentation Layer
quantity in millimeters
Difference between ASN.1 and “C”* or XML/XDR
ASN.1 is a format for data exchange, “C” is a compiler-dependent format for storage in RAM.
ASN.1 types may have a variable size (INTEGER may be 8, 16, 32, 64 bits).
ASN.1 SEQUENCE differs from a “C” struct since not all elements must be transmitted, nor is
their order to be maintained (if tagging is used).
ASN.1 CHOICE differs from a “C” union since the length depends on the chosen item,
and the contents differ.
ASN.1 has the same role as XML. XML is however both an abstract and a transfer syntax, it is
sent in clear text.
Unix systems use XDR (Sun's external data representation) that is 32-bit oriented, not efficient
for small data items, also a mixture of abstract and transfer syntax.
2005 May, HK
Industrial Automation 22 3.0.3 Presentation Layer
Explicit and implicit tagging
This practice is dangerous, because another encoding (PER) could use other
tag numbers.
2005 May, HK
Industrial Automation 23 3.0.3 Presentation Layer
Transfer Syntax: Basic Encoding Rules (BER)
A companion to ASN1, BER (ISO 8825-1) defines encoding rules for ASN.1 data types
Type, Tag and size are transmitted before every value or structured data
02 02 12 34
2005 May, HK
Industrial Automation 24 3.0.3 Presentation Layer
BER – Tag/Type field
Primitive {0} or
Class Tag
Constructed {1}
(for universal class only):
00 = UNIVERSAL
00 = null (size = 0, no value)
01 = APPLICATION
10 = CONTEXT_SPECIFIC 01 = Boolean type
11 = PRIVATE 02 = Integer type
03 = Bitstring type
04 = Octetstring type
05 = Null type
P: after the size comes a value - 06 = Object Identifier type
C: after the size comes a tag 07 = Object Descriptor type
16 = Sequence and Sequence_Of types
17 = Set and Set_Of types
18-22 = Character strings (numeric, printable, …)
23-24 = Time types
25 = Graphic string
26 = VisibleString (ISO646)
> 28 = reserve and escape: use a second octet.
Example: 00000010 = UNIVERSAL INTEGER
10100001 = [CONTEXT_SPECIFIC 1] SEQUENCE
2005 May, HK
Industrial Automation 25 3.0.3 Presentation Layer
Example ASN.1 and BER
8 1
AP C 7
CallerRef :== [APPLICATION 7] SEQUENCE { 16
priority [2] INTEGER, CS P 2
command [0] INTEGER, 1 high_prio
reference [1] INTEGER, high_prio
caller INTEGER} CS P 0
1 command
command
CS P 1
(useful information) 2 reference
reference (MSB)
reference (LSB)
CS P 3
4
UN P 2 caller
2
caller (MSB)
caller (LSB)
2005 May, HK
Industrial Automation 26 3.0.3 Presentation Layer
Examples
Tag/Type:
decoding the first digit: constructed means: the next octet is not
a value, but a type/tag !
0,1: Universal, not constructed
2,3: Universal, constructed
4,5: Application Specific, not constructed [APPLICATION 1]
6,7: Application Specific, constructed
8,9: Context Specific, not constructed [6]
A,B: Context Specific, constructed
2005 May, HK
Industrial Automation 27 3.0.3 Presentation Layer
Examples
2005 May, HK
Industrial Automation 28 3.0.3 Presentation Layer
Beyond ASN.1 and BER
In low speed busses such as fieldbus, this is still too much overhead.
100 MBit/s Ethernet has sufficient bandwidth, but the burden is shifted to the processors
2005 May, HK
Industrial Automation 29 3.0.3 Presentation Layer
ROSIN Compact – Retrofit Encoding
The railways operators needed to define formally the exchange rules for
data of already existing devices, of different manufacturers and vintage.
Therefore, a notation was developed (ROSIN notation) to describe any data transfer,
on a bit rather than a byte-orientation. It also allows to cope with alignment
(data should be transmitted at an offset that is a multiple of their size to reduce
processor load)
Each data type is specified, e.g. Integer32 differs from Integer32_LE (Little Endian)
The ROSIN notation uses the ASN.1 meta-syntax, but it does not imply a TLV scheme.
- the length can be deduced from the type or position,
- typing information is inserted explicitly when:
• a choice exists among several alternative types (e.g. depends on success/failure)
• types have a (large) variable size (e.g. text strings, files)
• sequences have optional fields and out-of-sequence fields (occurs too often).
2005 May, HK
Industrial Automation 30 3.0.3 Presentation Layer
ROSIN - Retrofit encoding rules example
Type_InfoMessage ::= RECORD {
parameter1 INTEGER8 -- octet.
parameter2 INTEGER16, -- 16-bit word, MSB first 0 7
parameter3 UNSIGNED6, -- 6- bit value
0 parameter1
par4 ANTIVALENT2, -- 2 bits for par4, e.g. check variable.
parameter5 Parameter5, -- parameter5 has a structured type 1 parameter2
parameter6 STRING32, -- an array of up to 32 8-bit characters.
-- trailed if shorter with “0” characters. 2
snu ENUM1 { 3 parameter3 par4
USER (0), -- 0 = user
SYSTEM (1) -- 1 = system 4 parameter5
}, 5
gni ENUM1 { -- could also be expressed as BOOLEAN1
INDIV (0), -- individual function addressing 6
GROUP (1), -- group addressing.
},
7 parameter6
node_id UNSIGNED6, -- 6-bit unsigned integer CHARACTER8
sta_or_func ONE_OF [snu] { -- meaning depends on ‘snu’
function [USER] UNSIGNED8, -- if snu = user, function identifier 39 snu gni node_id
station [SYSTEM] UNSIGNED8 -- if snu = system, station identifier 40 sta_or_func
},
next_station_id UNSIGNED8, -- next station or ‘FF’H if unknown 41 next_station_id
tv BOOLEAN1, -- TRUE if 1 42 tv d1 top_counter
res1 BOOLEAN1 (=0), -- 0 (place holder)
topo_counter UNSIGNED6, -- 6-bit unsigned integer 43 tnm_code
tnm_code ENUM8 { -- has only two defined values
44 action_code
FIRSTCASE (‘1E’H) -- one of two defined values
SECONDCASE (‘84’H) -- the other defined value
},
action_code Action_Code, -- this type is used several times
}
2005 May, HK
Industrial Automation 31 3.0.3 Presentation Layer
Comparing Coding Efficiency
encoding/decoding highly packed data may cost more than is won by shorter transmission
2005 May, HK
Industrial Automation 32 3.0.3 Presentation Layer
Engineering Units
Data presentation (e.g. integer) is insufficient to express the meaning of the variable.
Scaling (determined the possible range of a variable) is necessary for analog displays.
It requires the definition of the possible range of values that the variable may take.
2005 May, HK
Industrial Automation 33 3.0.3 Presentation Layer
SI Units
All physical variables should be restricted to SI Units (NIST 330-1991, IEEE 268A-1974)
or refered directly to them
For instance:
• speeds shall be expressed in meter/second, not in km/h or in miles/hour
• angles shall be represented in radian rather than degree or grad.
2005 May, HK
Industrial Automation 34 3.0.3 Presentation Layer
Why floating point ?
2005 May, HK
Industrial Automation 35 3.0.3 Presentation Layer
Fractionals
span value
physical variable
UNSIGNED16
0 65535
INTEGER16
-32768 0 +32767
e.g. offset = 0,0 m/s, span = 100,0 m/s, base unit = UNSIGNED16
means: 0 = 0,0 m/s, 65536 == 100,0 m/s
2005 May, HK
Industrial Automation 36 3.0.3 Presentation Layer
Scaled Variables
Process Variables are often transmitted and processed as fractionals:
Fractional format expresses analog values as integer multiples of the resolution
e.g.:
distance = 0..65535 x 0.1 m (resolution) --> 0 .. 65535 (UNSIGNED16)
distance = -32768..+32767 x 0.1 m --> -32768 .. 32768 (INTEGER16)
speed = 0.. 6553,5 m/s, resolution = 0.1 m/s --> 0 .. 65535 (UNSIGNED16)
speed = 0.. 6.5535 m/s, resolution = 0,0001 m/s --> 0 .. 65535 (UNSIGNED16)
The resolution is often a decimal fraction of a unit !
A conversion from fractional to floating point did cost over 5 Mia € (Ariane 501 accident)
2005 May, HK
Industrial Automation 37 3.0.3 Presentation Layer
Constructed Application Data Types
Time-Stamped Variable:
value
time
status
2005 May, HK
Industrial Automation 38 3.0.3 Presentation Layer
Application Data Types
Structured Text:
Joint Photographic Experts Group (JPEG) -- compression and coding for graphic images.
Tagged Image File Format (TIFF) -- coding format for graphic images.
14
2005 May, HK
Industrial Automation 39 3.0.3 Presentation Layer
Presentation Layer in the application
Coding and conversion functions to application layer data cannot be done in the
presentation layer due to the lack of established rules
These functions ensure that information sent from the application layer of one system will
be readable by the application layer of another system.
Examples of presentation layer coding and conversion schemes in the application:
Common data representation formats -- The use of standard image, sound, and video
formats allow the interchange of application data between different types of computer
2005 May, HK
Industrial Automation 40 3.0.3 Presentation Layer
Gateway
When devices share no common transport layer protocol, gateways act as protocol
converters and application layer protocols must ensure end-to-end control.
Protocol Conversion is costly in development and real time, since protocols are in
general insufficiently specified, custom-designed, and modified without notice.
Protocol Conversion requires at least an semantical equivalent of the objects on both
sides of the gateway, so that one command can be converted into another - if possible.
gateway
PD-marshalling
presentation presentation
session session
Real-Time PV PV
Protocols transport transport
network network
link link link link
2005 May, HK
Industrial Automation 41 3.0.3 Presentation Layer
To probe further
2005 May, HK
Industrial Automation 42 3.0.3 Presentation Layer
Assessment
2005 May, HK
Industrial Automation 43 3.0.3 Presentation Layer
Industrial Automation
Automation Industrielle
Industrielle Automation
2. Physical layer
1. Electrical RS 485
2. Middle-Distance
3. Fibre Optics
3. Device Classes
4. Frames and Telegrams
5. Medium Allocation
6. Clock Synchronization
7. Fault-tolerance concept
8. Integrity Concept
9. Summary
passenger
doors information light
Train Bus
Vehicle Bus
diagnostics and passenger information require relatively long, but infrequent messages
star coupler
optical links
optical links
rack
rack
The MVB can span several vehicles in a multiple unit train configuration:
Train Bus
node repeater
MVB
MVB can serve as a train bus in trains with fixed configuration, up to a distance of:
> 200 m (EMD medium or ESD with galvanic isolation) or
> 2000 m (OGF medium).
Terminator Repeater
ESD Segment
section
Repeater
Device Device Device
OGL link
Repeater
ESD Segment
all MVB media operate at same speed, segments are connected by repeaters.
1. Applications in vehicles
2. Physical layer
1. ESD (Electrical, RS 485)
2. EMD (Transformer-coupled)
3. OGF (Optical Glass Fibres)
3. Device Classes
4. Frames and Telegrams
5. Medium Allocation
6. Clock Synchronization
7. Fault-tolerance concept
8. Integrity Concept
9. Summary
+5V +5V
Ru Ru
(390W) (390W)
Data_N
Rm Rm
(150 W) (150 W)
Rd Data_P Rd
(390 W) (390 W)
equipotential line Bus_GND
GND
segment length
protection galvanic
circuit barrier
1
RS 485
+5V transceiver
RxS
RxS'
male
TxS
TxS'
protective earth
+5V el
0V el
TxF
female
TxF'
+Vcc
Data
GND
1
power
cable
device casing DC/DC
shield connected to connected to converter
connector casing supply ground
A.Bus_GND
B.Bus_GND
A.Bus_5V
B.Bus_5V
A.Data_N
B.Data_N
A.Data_P
B.Data_P
reserved
(optional TxE)
1 2 3 4 5 5 4 3 2 1
male female
6 7 8 9 9 8 7 6
Line_A
Line_A
Line_B
Line_B
Line_A Line_A
cable cable
Line_B Line_B
10
device
bus
controller
transceiver
transformer
shield
device
Bus_Controller
transceiver A transceiver B
1
A1 B1 B2 A2
Connector_1 Connector_2
1 1
Line_A Line_A
Line_B Line_B
Carrying both redundant lines in the same cable eases installation
it does not cause unconsidered common mode failures in the locomotive environment
(most probable faults are driver damage and bad contact)
1 A1. Data_P
6 Line_A
Line_A A.Term_P
2 A1. Data_N
7
A.Term_N
8
3 terminator connector
4 B1. Data_P
9 5
Line_B 9
5 B1.Data_N
4
8
shields contacts case
3
5 B1.Data_N 7
9
Line_B B.Term_N Line_B 2
4 B1. Data_P 6
8
B.Term_P 1
3
7
2 A1. Data_N
6
Line_A
1 A1. Data_P
Zt.B
female
Connector_1 (female)
opto-electrical
Star Coupler wired-or electrical media transceiver
to other device
or star coupler to other device
or star coupler
fibre pair
MVBC
TxD TxE
RxDA RxDB
3 5 3
1 1
A.Data_P A.Data_P
A.5V B.5V
A.0V B.0V RS-485 transceiver
fibre-optical transceivers
bus (redundant)
administrator bus
slave slave slave slave
administrator
repeater
decoder
encoder
ESD segment EMD segment
decoder
encoder
(RS 485) (transformer-coupled)
The repeater:
• decodes and reshapes the signal (knowing its shape)
• recognizes the transmission direction and forward the frame
• detects and propagates collisions
direction Line_A
recogniser (single-thread
optical link)
decoder
encoder
decoder Line_B
(unused for single-
thread)
1. Applications in vehicles
2. Physical layer
1. Electrical RS 485
2. Middle-Distance
3. Fibre Optics
3. Device Classes
4. Frames and Telegrams
5. Medium Allocation
6. Clock Synchronization
7. Fault-tolerance concept
8. Integrity Concept
9. Summary
A B
board bus
bus
controller analog
or
binary
MVB RS 485 input/
redundant drivers/ device
receivers address output
bus pairs
(ESD) register
device
status
(monomaster)
A B
private
RAM application
processor
traffic store
MVB EPROM
redundant Bus
bus pairs Controller
(ESD)
RS 485 shared
drivers/ local RAM
receivers
local
device input/
status output
• Class 2 and higher devices have a processor and may exchange messages.
• Class 2 devices are configurable I/O devices (but not programmable)
• The Bus Controller communicates with the Application Processor through a
shared memory, the traffic store, which holds typically 256 ports.
Class 5 devices are gateways with several link layers (one or more MVB, WTB).
duplicated
electrical or optical 12 bit device address
CPU parallel bus
transmitters to traffic store
A
Manchester 16x16 Clock,
Tx buffer Main
and CRC Timers &
Control A19..1 address
encoder Sink Time
Unit
Supervision
B
JTAG
interface D15..0 data
A
DUAL 16x16
Manchester Rx buffer Class 1 Traffic Store
and CRC logic Control
& Arbiter
control
decoders
B
duplicated electrical or
optical receivers
The interface between the bus and the application is a shared memory, the
Traffic Memory , where Process Data are directly accessible to the application.
0..4095
Logical Ports
(256 typical) process data
for Process base
data
6 bus
management
ports
8 physical
messages packets
ports and
bus supervision
2 message ports
bus
controller
MVB
1. Applications in vehicles
2. Physical layer
1. Electrical RS 485
2. Middle-Distance
3. Fibre Optics
3. Device Classes
4. Frames and Telegrams
5. Medium Allocation
6. Clock Synchronization
7. Fault-tolerance concept
8. Integrity Concept
9. Summary
data 1 10 10 00 10 11 1 110 1
clock
frame
signal
0 123 45 67 8
9-bit Start Delimiter frame data 8-bit check end
sequence delimiter
active state
idle state
active state
idle state
This prevents mistaking the next master frame when a slave frame is lost.
master
remotest
data source
master fr repeater
ame
delay
propagation delay
(6 µs/km)
max
repeater t_source
t_ms
t_ms < 42,7µs delay
e
slave fram
The reply delay time-out can be
t_s
repeater raised up to 83,4 µs for longer
delay distances
(with reduced troughput).
t_sm
n e xt m a s
ter fram e
time
distance
Process Data
Master Frame (Request) Slave Frame (Response)
F= port dataset
0..7 address
4 bits 12 bits time
16, 32, 64, 128 or 256 bits of Process Data
Message Data
256 bits of Message Data
Master Frame
F= source destination prot source size FN FF ON OF MTC
12 device device ocol device transport data
4 bits 12 bits time
decoded final node
by final function
hardware origin node message
tranport
origin function
Supervisory Data control
bus
variable identifier
Phase 2: The device which sources that variable responds with a slave frame
containing the value, all devices subscribed as sink receive that frame.
subscribed subscribed
device device subscribed devices
bus
master devices
sink source sink sink
(slaves)
bus
variable value
The bus and the application are (de)coupled by a shared memory, the
Traffic Memory, where process variables are directly accessible to the application.
Application
Processor
Associative Traffic Memory
memory
Process Data
Base
bus
starts t1 t2
ends time
writer
reader 1
error !
(slow) reader 2
page0
traffic store
page1
0 16
1 single 32 all
2 logical Process_Data device 64 Process_Data devices
3 subscribed 128 (application subscribed
4 as 256 -dependent) as
5 reserved source - sink
6 reserved -
7 reserved -
1. Applications in vehicles
2. Physical layer
1. Electrical RS 485
2. Middle-Distance
3. Fibre Optics
3. Device Classes
4. Frames and Telegrams
5. Medium Allocation
6. Clock Synchronization
7. Fault-tolerance concept
8. Integrity Concept
9. Summary
1 2 3 4 5 6 7 SD ? ? ? ? 1 2 8 9 SD ? ? ? ? EV 1 2
time
guard phase guard phase
time
Sporadic Data
events ? events ?
time
guard event guard
time data time
individual period
Periodic data are polled at their individual period (a multiple of the basic period).
Between periodic phases, the Master continuously polls the devices for events.
Since more than one device can respond to an event poll, a resolution procedure
selects exactly one event.
guard
>350µs
T_spo
basic period
2 BP datasets 4.0 4.2 4.2
4.0 4.0
8.1 8.1
2 BP datasets 2.1 2.0 2.1 2.0 2.1 2.0 2.1 2.0 2.1 2.0 2.1
1 BP datasets 1 1 1 1 1 1 1 1 1 1 1
period 7
period 1
period 2
period 4
period 5
period 7
0
period 0
period 3
period 6
1
The algorithm which builds the poll table spreads the cycles evenly over the macroperiod
To scan events, the Master issues a General Event Poll (Start Poll) frame.
If no device responds, the Master keeps on sending Event Polls until a device
responds or until the guard time before the next periodic phase begins.
If several devices respond to an event poll, the Master detects the collision and
starts event resolution
telegram time
collision silence collision valid event frame
The devices are divided into groups on the base of their physical addresses.
The Master first asks the devices with an odd address if they request an
event.
000 100 010 110 001 101 011 111 individual poll
EA EA EA EA EA EA EA EA event read
At fixed intervals, the Master broadcasts the exact time as a periodic variable.
When receiving this variable, the bus controllers generate a pulse which can
resynchronize a slave clock or generate an interrupt request.
MVB
Sync port address Sync port variable
Master
Slave clock clock Slave clocks Slave clocks
MVB 1 MVB 2
Bus Slave devices Bus
administrator 1 administrator 2
Synchronizer
1. Applications in vehicles
2. Physical layer
1. Electrical RS 485
2. Middle-Distance
3. Fibre Optics
3. Device Classes
4. Frames and Telegrams
5. Medium Allocation
6. Clock Synchronization
7. Fault-tolerance concept
8. Integrity Concept
9. Summary
Transmission Integrity
MVB rather stops than provides false data.
The probability for an undetected transmission error (residual error rate)
is low enough to transmit most safety-critical data.
This is achieved through an extensive error detection scheme
Transmission Availability
MVB continues operation is spite of any single device error. In
particular, configurations without single point of failure are possible.
This is achieved through a complete duplication of the physical layer.
Graceful Degradation
The failure of a device affects only that device, but not devices which
do not depend on its data (retro-action free).
Configurability
Complete replication of the physical layer is not mandatory.
When requirements are slackened, single-thread connections may
be used and mixed with dual-thread ones.
encoder selector
signal quality report
decoder decoder
A B A B
transmitters receivers
bus line B
bus line A
BA AB
device device
repeater repeater
optical link A
optical link B
device device
repeater repeater
star coupler A
A A copper bus A
B B copper bus B
Bus Administrator
redundant
opto links B Bus
Administrator
star coupler B
The failure of one device cannot prevent other devices from communicating.
Optical Fibres do not retro-act.
token passing
current bus
bus bus bus master
administrator administrator administrator
1 2 3
Bus
1. Applications in vehicles
2. Physical layer
1. Electrical RS 485
2. Middle-Distance
3. Fibre Optics
3. Device Classes
4. Frames and Telegrams
5. Medium Allocation
6. Clock Synchronization
7. Fault-tolerance concept
8. Integrity Concept
9. Summary
1) Manchester II encoding
Double signal inversion necessary to cause an undetected error, memoryless code
Clock
Data 1 1 0 1 0 0 0 1
Frame
violations
Line Signal
3) A check octet according to TC57 class FT2 for each group of up to 64 bits,
provides a Hamming Distance of 4 (8 if Manchester coding is considered):
-15
(Residual Error Rate < 10 under standard disturbances)
Master Frame size in bits
9 4 12 8 MD = Master frame Delimiter
16 (33) MSD F address CS CS = Check Sequence 8 bits
useful (total)
size in bits
Slave Frame 9 16 8
16 (33) SSD 2 bytes CS SD = Slave frame Delimiter
9 32 8
32 (49) SSD 4 bytes CS
9 64 8
64 (81)
128 (153) SSD 8 bytes CS DATA
256 (297) 64
repeat 1, 2 or 4 x
4) Different delimiters for address and data against single frame loss:
respond within respond within
1.3 µs < t < 4.0 µs 4 µs < tsm <1.3 ms
ms
time
t mm 1,3 ms
> 22 µs > 22 µs
MSD ADDRESS a CS SSD DATA (a) CS MSD ADDRESS b CS SSD DATA (b) CS
time
6) Configuration check: size at source and sink ports must be same as frame size.
Data Integrity
Very high data integrity, but nevertheless insufficient for safety applications
(signalling)
Increasing the Hamming Distance further is of no use since data falsification
becomes more likely in a device than on the bus.
Data Transfer
• critical data transmitted periodically to guarantee timely delivery.
• obsolete data are discarded by sink time supervision.
• error in the poll scan list do not affect safety.
Device Redundancy
Redundant plant inputs A and B transmitted by two independent devices.
Diverse A and B data received by two independent devices and compared.
The output is disabled if A and B do not agree within a specified time.
Availability
Availability is increased by letting the receiving devices receive both A and
B. The application is responsible to process the results and switchover to the
healthy device in case of discrepancy.
poll
A B A B time
individual period
Bus
Administrator
redundant vehicle bus
(for availability only)
input output
devices devices
A B A B
confinement
application ° fail-safe
responsibility comparator
and enabling
spreader device logic
(application
dependent)
redundant input redundant, integer output
poll
time
A B A B
redundant individual period redundant
bus bus
administrator redundant vehicle bus administrator
(for availability)
input output
devices devices
A B A B A B A B
comparator
C C and enabling
logic
confinement
switchover logic or
spreader device A B comparator
(application (application
dependent) dependent)
redundant input available and integer output
1. Applications in vehicles
2. Physical layer
1. Electrical RS 485
2. Middle-Distance
3. Fibre Optics
3. Device Classes
4. Frames and Telegrams
5. Medium Allocation
6. Clock Synchronization
7. Fault-tolerance concept
8. Integrity Concept
9. Summary
Real-Time Protocols
Link Layer Interface
Upper Link Layer LP LM LS
management
station
process message supervisory
data data data
Traffic Store
slave master
Lower Link Process Data polling
Layer Message Data telegram arbitration
Supervisory Data handling mastership transfer
frame coding
Physical Layer
Bus Controllers:
BAP 15 (Texas Instruments, obsolete)
MVBC01 (VLSI, in production, includes master logic
MVBC02 (E2S, in production, includes transformer coupling)
Repeaters:
REGA (in production)
MVBD (in production, includes transformer coupling)
Medium Attachment Unit:
OGF: fully operational and field tested (8 years experience)
ESD: fully operational and field tested (with DC/DC/opto galvanic separation)
EMD: lab tested, first vehicles equipped
Stack:
Link Layer stack for Intel 186, i196, i960, 166, 167, Motorola 68332, under
DOS, Windows, VRTX,...
Tools:
Bus Administrator configurator
Bus Monitor, Download, Upload, remote settings
0.6
MVB @ 1,5 Mbit/s
0.5
0.4
0.3
IEC Fieldbus @ 2,5 Mbit/s
0.2
0.1
16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 256
dataset size in bits
1 0 1 0 1 0 1 0 1 N+ N- 1 0 N+ N- 0 Data FCS 1 N+ N- N+ N- 1 0 1 v v v v
16 bits
MVB frame
Start Delimiter 8 bits End Delimiter
0 N- N+ 1 N- N+ 1 1 1 Data FCS v v
Master Frame
v v
0 0 0 0 N+ N- 0 N+ N- Data FCS Slave Frame