Engineering Electronic Department

Technical University of Catalonia, UPC Campus Terrassa, SPAIN

Lecturer: Dr. Luis Romeral

1

Outline Block 3: OSI Model and Digital

Subject 1.- OSI Model: definitions - General Concepts - Seven layers OSI - Model - Protocols and Service Units - , Bridges, Routers, and Gateways

Subject 2.- - Functions of the Physical Layer - Interfaces RS 232 / RS 485 / Ethernet - Physical : cables and optical fibers - - Coding and Synchronization

Subject 3.- Aircraft buses - TCP/IP - ARINC - CSDB / FDDI

2

1 OSI Model - Location of the Physical Level

All services directly called by the end user 7 Application (Mail, File ,...)

Application Presentation Definition and conversion of the protocols 6 data formats (e.g. ASN 1)

Session Management of connections 5 (e.g. ISO 8326)

End-to-end and error recovery 4 Transport (z.B. TP4, TCP)

Network Routing, possibly segmenting 3 (e.g. IP, X25) Transport protocols Link Error detection, Flow control and error recovery, 2 medium access (e.g. HDLC)

Coding, Modulation, Electrical and 1 Physical mechanical coupling (e.g. V24)

3

Physical Layer Definition

In the Open Systems (OSI) communications model, the physical layer supports the electrical or mechanical interface to the physical medium.

For example, this layer determines how to put a stream of from the upper () layer on to the pins for a parallel printer interface, an , or a carrier, i.e., the Physical Layer is responsible for -level transmission between network nodes.

In copper networks, the Physical Layer is responsible for defining specifications for electrical . In fiber optic networks, the Physical Layer is responsible for defining the characteristics of light signals.

The physical layer is usually a combination of software and hardware programming and may include electromechanical devices. It does not include the physical media as such.

4

2 Major Functions of Physical Layer

The major functions and services performed by the physical layer are related to Bit-by-bit - to-node delivery:

• Providing a standardized interface to physical transmission media, including • Mechanical specification of electrical connectors and cables, for example maximum cable length • Electrical specification of level and impedance • Radio interface, including electromagnetic spectrum frequency allocation and specification of signal strength, analog , etc. • Specifications for IR over optical fiber or a IR link • Modulation and Line coding • Bit synchronization in synchronous • Start-stop signalling and flow control in asynchronous serial communication • Carrier sense and collision detection utilized by some level 2 multiple access protocols • Equalization filtering, training sequences, pulse shaping and other of physical signals

5

Subdivisions of the Physical Layer

same for different media medium-independent signalling (e.g. modulation, codification)

applies to one media medium-dependent signalling Physical (e.g. optical fibres) Layer electrical / optical applies to one media type specifications (e.g. 200µm optical fibres)

mechanical defines the mechanical interface specifications (e.g. connector type and pin-out)

The physical layer is also concerned with

• Point-to-point, multipoint or point-to-multipoint line configuration • Physical , for example , ring, mesh or • Serial or • Simplex, half duplex or full duplex transmission mode • Autonegotiation 6

3 Concepts relevant to the physical layer

Topology Ring, Bus, Point-to-point Mechanical Connector, Pin-out, Cable, Assembly Medium signals, transfer rate, levels Channels Half-duplex, full-duplex, broadcast Control Send, Receive, Collision Modulation , Carrier band, Coding/Decoding Binary, NRZ, Manchester,.. Synchronization Bit, , Flow Control Handshake Interface Binary bit, Collision detection [multiple access] Signal quality supervision, redundancy control

7

Topologies

Link (Point -To-Point) Full-duplex / Sender/ Examples: Receiver Receiver RS232

Half-duplex Sender/ Sender/ Examples: Receiver Receiver RS485

Master Star Point-to-Point

8

4 Topologies

Bus (Half-Duplex, except when using Carrier Frequency over multiple bands)

Terminator Examples: (resistor) Ethernet, Profibus

Ring (Half-Duplex, except double ring)

Examples:

SERCOS, Interbus-S

consists of point-to-point links

Radio Free topology

9

Topologies

Ring: a ring consists only of point-to-point links Each node can interrupt the ring and introduce its own frames

Classical ring

Ring in floor wiring wiring cabinet

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 10

5 Electrical: Resistive (direct) coupling

Unipolar, unbalanced Bipolar, unbalanced

+ Us Coax Ru + Us Zw Zw Rd -Us

Open Collector Ut Terminator and Ut = 5 V (e.g.) Pull-up resistor (unbalanced) Rt Rt Bus line, = Zw

Wired-OR behaviour (“Low” wins over “High”)

Out In Out In Out In device device device

11

Electrical: Balanced Transmission

Differential transmitter and receiver: + good rejection of disturbances on the line and common-mode - double number of lines

+Ub Differential amplifier Zw symmetrical line (Twisted Wire Pair) Rt (OpAmp)

Shield 100 Ω UA UB

(Data Ground)

Used for twisted wire pairs (e.g. RS422, RS485)

Common mode rejection: influence of a voltage which is applied simultaneously on both lines with respect to ground.

The shield should not be used as a data ground (inductance of currents into conductors)

12

6 Electrical: Transformer Coupling

Provides galvanic separation, freedom of retro-action and impedance matching but no DC-components may be transmitted. cost of the transformer depends on transmitted frequency band (not center frequency)

Sender/Receiver

Isolation transformer

isolation resistors shield

Twisted Wire Pair

13

Electrical: MIL 1553 as an example of transformer coupling

Double-Transformer (long stub: 0.3 .. 6m)

Direct Coupling Sender/Receiver (short stub: 0.3 m)

long stub short stub Isolation transformer

isolation resistors

shield shield

Twisted Wire Pair

MIL 1553 is the standard field bus used in avionics since the years '60 – it is costly and obsolete 14

7 RS – 232 Interface

• Originally developed for communication, now in many instruments Unipolar Serial Transmission ƒ 25 pines (usually, only 9) ƒ Low speed, function of the cable length. Example, for 9600 bauds (bits(sec) ,

ƒ Voltage output:, d < 30m ƒ Current output:, d < 500 m

ƒ Bidirectional transmission, Full - Duplex 15

RS-232 - Mechanical-Electrical Standard

Topology: lines Data DTE DCE DCE DTE Data Terminal 2 2 Terminal Equipment Equipment Terminal Data Communication Modem

Cabling rules modem eliminator extension extension Tip: Do not use 2 Modem cables, computer terminal only Extension cable cable cables

Electrical: transmitter receiver +12V +3V "0" Space On

-12V -3V "1" Mark Off

16

8 RS – 232 Electronics

Atention: DB9 DTE Connection !

The MAX232 is a family of line drivers/receivers intended for all EIA/TIA-232E and V.28/V.24 communications interfaces, particularly applications where ±12V is not available. 17

RS – 232 Electronics

18

9 Some other RS- 232 cabling….

Hardware contention control

Wihtthreepinsconnection, RxD, TxD, GND, control of transmission have to be made by soft (Protocol)

19

RS – 422 Interface

¾ Bipolar Serial transmission (, differential signaling) ƒ 37 pines (usually, only 5) ƒ Data rates in the Mbps (function of distance): ƒ at 19.2 KBPS, 1200 m ƒ at 2 MBPS, d = 60 m ƒ Bidireccional transmission Differential channel ƒ Full – duplex, double cable pair

Point to Point Link

20

10 RS – 485 Interface

¾ Bipolar Serial transmission (twisted pair, differential signaling) ƒ Simplified RS – 422 interface ƒ Enables multi-drop ƒ Bidireccional Transmission, Semi-Duplex ƒ Additional Software is needed (OSI 2 Level)

Link Control

21

Differential signaling concept

RS – 485 Bus Electrical noise has no effect

Bit space Differential signaling

22

11 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

•• • B

A 100Ω stub Terminator A tap 120Ω 120Ω Data-GND B Zw ≈ 120Ω, C' ≈ 100 pF/m segment length

multiple transmitter Short-circuit limitation allowed needed

Ishort < 250 mA

23

RS – 485 Electronics

Typical RS – 485 Operating Circuit

Typical Half-Duplex RS – 485 Network

24

12 Physical Media

The Physical Layer defines items such as: connector types, cable types. Physical media defines how is the data transmitted in the real world.

• Examples –Wires • Single ended • Differential – Fiber • Quarz • Plastic – Wireless (RF) –

25

Transmission media: Electrical Wires

¾ To transmit electrical signal (voltage or current)

ƒ Twisted pair ƒ Coax cable

Problems: ƒ Atenuatons ƒ Reflections and radiating energy (connection, end of line) SOLUTION ƒ Line Amplifiers (Drives)

ƒ Terminator resistors, Z0 = √L/C

Z0

26

13 Electrical Wires comparison

Zw = 50Ω ... 100Ω core inflexible, costly, dielectric low losses shield screen 10 MHz..100 MHz

Shielded twisted Zw = 85Ω..120Ω Wire (Twinax) flexible, cheap, Shield twisting compensates disturbances medium attenuation ~1 MHz..12 MHz very cheap, Unshielded twisted wire Telephone sensible to perturbations very cheap, Uncommitted wiring numerous branches, not terminated, very high losses and disturbances, except possibly at one place (e.g. powerline com.) very low speed (~10 ..100 kbit/s)

1) Classical wiring technology, 1) low data rate 2) Well understood by electricians in the field 2) costly galvanic separation 3) Easy to configure in the field (transformer, optical) 4) Cheap (depends if debug costs are included) 3) sensible to disturbances 4) difficult to debug, find bad contacts 27

Transmission Media: Optical Fiber

3 components: transmitter receiver fibre Is GaAs PIN LED fotodiode

different refraction coefficients Transmitter, cable and receiver must be "tuned" to the same wavelength

Cable glass (up to 100 km) or plastic (up to 30 m). Transmitter laser (power), laser-diode (GaAsP, GaAlAs, InGaAsP) Receiver PIN-diode Wavelength 850 nm (< 3,5 dB/km, > 400 MHz x km) 1300 nm-window (Monomode)

light does not travel faster than electricity in a fiber (refraction index) !

28

14 Optical Fiber: Types

Multimodefibre Monomode fibre N(r) Refraction profile 50 µm

50 - 300 µm 50 - 100 µm 2-10 µm

Core Cross-section

Clad

Longitudinal section

total reflection gradual reflection waveguide (red) 650nm 10 dB/km 800nm 5dB/km 3 dB/km 2,3 dB/km (infra-red) 1300nm 0,6 dB/km 0,4 dB/km 20MHz·km 1 GHz·km 100 GHz·km

Uses: HCS (Hard-Clad Silica) 50 or 62.5 µm LAN fibre telecom - costly ø 200 µm, < 500m 29

Optical Fiber: Coupling and Bridging

Passive coupler n% coupling losses

Every branch costs a certain percentage of light

costly manufacturing (100 $ branches) n% coupling losses

Mechanical bridging: difficult ! spring

example of prism solution

Powered Unpowered

30

15 Optical Fiber: Advantages and disadvantages

1 ) high bandwidth and data rate (400 MHz x km) 2 ) small, frequency-insensitive attenuation (ca. 3 dB/km) 3 ) cover long distances without a repeater 4 ) immune against electromagnetic disturbances (great for electrical substations) 5 ) galvanic separation and potential-free operation (great for large current environment) 6 ) may be used in explosive environments (chemical, mining) 7 ) low cable weight (100 kg/km) and diameter, flexible, small cable duct costs 8 ) low cost cable and standarized

1) In process control, propagation time is more important than data rate 2) Attenuation is not important for most distances used in avionics (200m) 3) Coaxial cables provide a sufficiently high immunity 4) Reliability of optical and connections is insufficient (MTTF ≈ 1/power). 5) Galvanic isolation can be achieved with normal cables and opto-couplers 6) Installation of optical fibres is costly due to splicing 7) Topology is restricted by the star coupler (hub) or the ring structure 31

Transmission Media: Radio Frequencies

In – air communication, Multiple Networks with varying criteria for utilizing different links: • Aircraft Control Domain • Airline Services Domain • Passenger Information and Entertainment Services Domain

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 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

module

Modulation uses amplitude, phase and multiple frequencies

32

16 Media (bandwidth x distance)

Transfer rate (Mbit/s) Costs Electromagnetic (€/m) Compatibility 200m 700m 2000m optical fibres single mode 2058 516 207 0.9 very good multimode 196 49 20 1.2 very good plastic 1 0.5 - 1 very good

coaxial cables 50 Ohm 20 8 1.2 0.2 good 75 Ohm TV 1/2" 12 2.5 1.0 0.33 good 93-100 Ohm 15 5 0.8 0.35 good

twisted wire twinax 8 0.9 0.2 0.6 very good individually 2 0.35 0.15 0.1 very good shielded (STP) good (crosstalk) group shielding (UTP) 1 0.3 0.1 0.15 regular (foreign) good (crosstalk) Telephone cable 0.2 0.1 0.05 0.03 bad (foreign)

others Power line carrier 1 0.05 0.01 - very bad Radio1 1 1 - bad Infrared 0.02 0 0- good ultrasound 0.010 0 - bad the bandwidth x distance is an important quality factor of a medium 33

Modulation: Basic Concept

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)

Broadband

Signal transmitted as a sequence of frequencies, Backward Forward- several at the same time. channel channel

Signals may be modulated on a carrier frequency 5-108 162-400 MHz MHz Frequency (e.g. 300MHz-400MHz, in channel of 6 MHz)

34

17 Modulation: Definitions

Modulation is the process of varying a periodic waveform, i.e. a tone, in order to use that signal to convey a message. Normally a high-frequency sinusoid waveform is used as carrier signal. The three key parameters of a sine wave are its amplitude, its phase and its frequency, all of which can be modified in accordance with a low frequency information signal to obtain the modulated signal. A device that performs modulation is known as a modulator and a device that performs the inverse operation of modulation is known as a demodulator (demod). A device that can do both operations is a modem ( "MOdulate-DEModulate).

DTE: DCE: Data Communications Equipment

35

Analogue and Digital Modulation

The aim of digital modulation is to transfer a digital bit stream over an analog bandpass channel, for example over the public switched (where a filter limits the frequency range to between 300 and 3400 Hz) or a limited band. The aim of analog modulation is to transfer an analog lowpass signal, for example an audio signal or TV signal, over an analog bandpass channel, for example a limited radio frequency band or a cable TV network channel. Analog and digital modulation facilitate frequency division multiplex (FDM), where several low pass information signals are transferred simultaneously over the same shared physical medium, using separate bandpass channels. The aim of digital baseband modulation methods, also known as line coding, is to transfer a digital bit stream over a lowpass channel, typically a non-filtered copper wire such as a serial bus or a wired . The aim of pulse modulation methods is to transfer a narrowband , for example a phone call over a wideband lowpass channel.

36

18 Analogue and Digital Modulation

In analog modulation, the modulation is applied continuously in response to the analog information signal. Common analog modulation techniques are: • (AM) • Angle modulation • (FM) • Phase modulation (PM)

In digital modulation, an analog carrier signal is modulated by a digital bit stream. Digital modulation methods can be considered as digital-to-analog conversion, and the corresponding or detection as analog-to-digital conversion. These are the most fundamental digital modulation techniques: • ASK, is represented as variations in the amplitude of a . A finite number of amplitudes are used. • FSK, digital information is transmitted through discrete frequency changes of a carrier wave. A finite number of frequencies are used. • PSK, conveys data by changing, or modulating, the phase of a reference signal. A finite number of phases are used. 37

Amplitude Shift Keying (ASK)

1 BW = 2( )= 2 f d Tb

38

19 Frequency Shift Keying (FSK)

BW = 2( ∆f + f d ) 39

Phase Shift Keying (PSK)

fd BW = 2 f d 40

20 Digital Modulation Operations

Amplitude Shift Keying (ASK) Baseband filtered ASK

Frequency Shift Keying (FSK) FSK Waveforms

41

Digital Modulation Operations

Phase Shift Keying (PSK) Baseband filtered ASK

If two only two phases are used, 0 – 1, it is named BPSK. Amplitude & Phase Shift Keying (APK) Alternatively, instead of using the bit patterns to set the phase of the wave, it can instead be used to change it by a specified amount. The demodulator then determines the changes in the phase of the received signal rather than the phase itself. Since this scheme depends on the difference between successive phases, it is termed differential phase-shift keying (DPSK). 42

21 Modulation Alphabet

In Digital Modulation, each of the phases, frequencies or amplitudes are assigned a unique pattern of binary bits, and usually, each phase, frequency or amplitude encodes an equal number of bits. The changes in the carrier signal are chosen from a finite number of M alternative symbols (the Modulation Alphabet)

• If the alphabet consists of M = 2N alternative symbols, each symbol represents a message consisting of N bits. If the (also known

as the baud rate) is fS symbols/second (or baud), the data rate is N fS bit/second.

• For example, an alphabet consisting of 16 alternative symbols, needs 4 bits for representing every symbol. Thus the data rate is four times the baud rate.

Minimum-shift keying (MSK - FSK): The difference between the higher and lower frequency is identical to half the . As a result, the waveforms used to represent a 0 and a 1 bit differ by exactly half a carrier period 43

Example: Quadrature phase-shift keying (QPSK)

With four phases, QPSK can encode two bits per symbol. Each adjacent symbol only differs by one bits with Gray coding. Although QPSK can be viewed as a quaternary modulation, it is easier to see it as two independently modulated quadrature carriers. With this interpretation, the even (or odd) bits are used to modulate the in-phase component of the carrier, while the odd (or even) bits are used to modulate the quadrature-phase component of the carrier. QPSK may be used either to double the data rate compared to a BPSK system while maintaining the bandwidth of the signal or to maintain the data-rate of BPSK but halve the bandwidth needed.

The odd bits contribute to the in-phase component: 1 1 0 0 0 1 1 0

The even bits contribute to the quad component: 1 1 0 0 0 1 1 0

44

22 Synchronization

To 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

Bit and Character synchronization: • Asynchronous and Synchronous communicaton

Frame, Message and Session synchronization: • Especific Protocol definitions

45

Asynchronous Communication

Asynchronous serial communication describes an asynchronous, serial transmission protocol in which a start signal is sent prior to each byte, character or code word and a stop signal is sent after each code word.

The start signal serves to prepare the receiving mechanism for the reception and registration of a symbol and the stop signal serves to bring the receiving mechanism to rest in preparation for the reception of the next symbol

Clock Receptor

46

23 Synchronous Communication

In synchronous t5ransmissions, the receiver uses a clock which is synchronised to the transmitter clock. The clock may be transferred by:

• A separate interface circuit (as in X.21 or RS-449) or • Encoded in the data (e.g. Manchester Encoding, AMI encoding, ….)

The two devices initially synchronize themselves to each other, and then continually send characters to stay in sync. Even when data is not really being sent, a constant flow of bits allows each device to know where the other is at any given time. That is, each character that is sent is either actual data or an idle character.

Synchronous communications allows faster data transfer rates than asynchronous ones, because additional bits to mark the beginning and end of each data byte are not required.

Clock is extracted from the received date !!

47

Coding / Encoding

Coding / Encoding techniques are used by the physical layer to encode the clock and data of a synchronous bit stream.

Asynchronous

Ethernet, MIL 1553,.. Synchronous

48

24 Coding / Encoding

NRZ : Non-return to zero encoding is used in slow speed communications interfaces for asynchronous transmission. Using NRZ, a logic 1 bit is sent as a high value and a logic 0 bit is sent as a low value (the line driver chip used to connect the cable may subsequently invert these signals).

MANCHESTER: In the Manchester encoding shown, a logic 0 is indicated by a 0 to 1 transition at the centre of the bit and a logic 1 is indicated by a 1 to 0 transition at the centre of the bit. Note that signal transitions do not always occur at the ‘ bit boundaries’ (the division between one bit and another), but that there is always a transition at the centre of each bit. A Manchester encoded signal contains frequent level transitions which allow the receiver to extract the clock signal using a Digital Phase Locked Loop (DPLL) and correctly decode the value and timing of each bit.

AMI (Alternate Mark Inversion): It is a synchronous clock encoding technique which uses bipolar pulses to represent logical 1 values. It is therefore a three level system. A logical 0 is represented by no symbol, and a logical 1 by pulses of alternating polarity. The alternating coding prevents the build-up of a DC voltage level down the cable. This is considered an advantage since the cable may be used to carry a small DC current to power intermediate equipment such as line repeaters. 49

Coding / Encoding

AMI coding was used extensively in first generation PCM networks, but suffers the drawback that a long run of 0's produces no transitions in the data stream (and therefore does not contain sufficient transitions to guarantee lock of a DPLL). The HDB3 code is a bipolar signaling technique (i.e. relies on the transmission of both positive and negative pulses). It is based on Alternate Mark Inversion (AMI), but extends this by inserting violation codes whenever there is a run of 4 or more 0's.

The encoding rules follow those for AMI, except that a sequence of four consecutive 0's are encoding using a special "violation" bit. This bit has the same polarity as the last 1-bit which was sent using the AMI encoding rule. The purpose of this is to prevent long runs of 0's in the data stream which may otherwise prevent a DPLL from tracking the centre of each bit. By introducing violations, extra "edges" are introduced, enabling a DPLL to provide reliable reconstruction of the clock signal at the receiver, i.e. whatever data is sent, the DPLL will be able to reconstruct the data and extract the bits at the receiver.

Example of HDB3 encoding: The pattern of bits " 1 0 0 0 0 1 1 0 “ encoded in HDB3 is " + 0 0 0 V - + 0 " (the corresponding encoding using AMI is " + 0 0 0 0 - + "). 50

25 Frame synchronization character-synchronous A character is used as synchronisation character (e.g. bisync) If this character appears in the data stream, it is duplicated, and the receiver removes duplicated synchronisation characters

Data A B C SYN D E F G Signal SYN A B C SYN SYN D E F G SYN

flag Byte-stuffing flag

bit-synchronous A bit sequence is used as a flag (e.g. 01111110). (e.g. HDLC) To prevent this sequence in the bit-stream, the transmitter inserts a "0" after each group of 5 consecutive "1", which the receiver removes.

Data 11 100011111 110 011111 0 flag Signal 0 1 1 1 1 1 10 1 1 1 0 0 0 1 1 1 1 1 0 1 1 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 10

Bit-stuffing delimiter A symbol sequence is used as delimiter, which includes non-data symbols (e.g. IEC 61158) Signal

"1" "1" "0" "0" "1" "1" Delimiter (not Manchester) Manchester symbols

51

Finally, from the digital to the !

52

26