Industrial communications first test

advertisement
Digital data communications: data exchange
between 2 nodes: 1. information (user data), 2. error
control (corruption from phys. Layer, error detection),
3. flow control (buffer overflows, intermediate storage
problems). Data link layer: flow ctrl, err ctrl, framing.
Transmission: encoding (chars → bits; EBCDIC – 8
bit, ASCII – 7 bit), decoding, codewords (bit
representation of data used during transmission).
Worst case: DPLL
needs 10 bit transitions
(5 b.t. of ±2, 5 of ±1).
Manch/Dif.Manch used in LAN; NRZI in WAN.
Little-Endian (IBM 80x86): low, high; Big-Endian
(IBM 370, Motorola, Sun): high, low → solution,
network byte order for ctrl data (ex: LSB sent first).
Sync: recover bits, bytes, frames. Types of sync:
asynchronous transm. (independent tx & rx clocks, rx
always resyncs of 1st bit of another byte), sync.
Transm (global clock or sync-ed tx & rx clocks, bits
are explicitly recovered, rx syncs each bit for duration
of frame). Start/stop bit: SOC,SOB 1→0 /EOC,EOB.
Sync. transm: higher bitrates, efficiency. Frame:
payload (data), overhead (ctrl bits). 1. Bits encoded
in signal transitions, 2. reserved byte precedes each
frame, 3. frame is encapsulated between reserved
bytes. SYN must be sent to maintain readiness. 3
sync. protocols: 1. Byte-count (no start/end chars,
field with length used); 2. Byte-oriented (Binary
sync, frame composed of a series of 8 bit chars, use
of ctrl chars); 3. Bit-oriented (high level data link ctrl,
bit stream used, special bit sequences (flags) are
used).
Char. Oriented sync. transm.: primarily for ASCIIdata, no start/stop bits, SYN chars: 1st allows bit
sync, 2nd – byte sync. Frame sync using STX,ETX.
Hunt mode for byte sync: after each bit check last 8
bits. Bit oriented sync. transm: 1.scheme:
SOF&EOF as 01111110 and use bit stuffing to
differentiate between data and ctrl chars (11111 →
insert 0 after). 2.scheme: seek delimiter, get address
& length, count number of bytes. Used in LANs.
3.scheme – bit encoding violations: illegal manch.
code, J: signal level remains same as previous for 1
bit period, K: signal level remains opposite to
previous for 1 bit period, payload – no J or K.
Sync. transm: Bit sync using: 1. Clock encoding; 2.
DPLL (digital phase locked loop, uses forced signal
bit transitions in signal, receiver clock synced to
signal by DPLL, requires bit stuffing). Methods of
clock encoding: 1. Bipolar encoding; 2. Manchester
encoding (uses NRZ signal); 3. Dif. Manch. encoding
DPLL: -receiver resyncs clock w/ edge transition;
scramble input data with bit stuffing. Uses NRZI:
signal level changes for ‘0’, doesn’t for ‘1’.
LLC (Logical Link Ctrl) – used with LANs, defined in
IEEE 802.2 spec. Is a p2p protocol. LLC is higher
than MAC on DLL. Format (grey-PDU part):
SAP identifies a protocol within the device having
that h/w interface. SNAP (above LLC) provides other
protocol types. Field size: 5bytes.
Async. FTPs: Xmodem: break data into blocks:
[SOH:1byte-block#:128bytes_data:1byte_checksum].
Good to use in noisy lines. Ymodem – also sends
filename, size, timestamp. Zmodem: larger packet
size (dyn. adjustment), uses CRC-32. Worse
performance in noisy lines. Kermit: different packet
data size and error detection methods. Typical: 1KB
packets+CRC-24.
Binary synchronous:
Async. transm: PISO→SIPO; Bit sync: 1→0 –
start transmission, 2. sample bits at ½ time, 3. shift to
SIPO register. Byte sync: bit counting to determine
byte boundary; Frame sync: 1. text-data – use STX,
ETX; 2. pure binary data – STX/ETX may cause
errors. Byte-stuffing: TX: add DLE before any
inadvertent DLE in frame data. RX: remove
redundant DLE bytes in data. DLE STX means end
of frame.
Supervisory: 00: Receiver Ready (RR), 01: Reject
(REJ), 10: Rec. not Ready (RNR), 11: Selective
Reject (SREJ).
HDLC (High Level Data Link Ctrl): 01111110 flags &
0-bit stuffing. Supports p2p, mp; h/duplex, f/duplex;
switched/unsw.conn. Stations: 1. Primary – controls
all data link operations issuing commands and rx-ing
responses from secondary stations. Has ability to
hold separate sessions with dif. Stations. 2.
Secondary – can only comm. w/ primary station.
These talk to each other via primary station. 3.
Combined station – combination of (1) and (2): tx-es
and rx-es both commands and responses, uses line
addr. to distinguish b/ween cmd and resp frames (i.e.
frame rx-ed w/ own addr: cmd, partner addr: rsp,
frame tx-ed w/ own addr: rsp, w/ partner addr: cmd).
Unbalanced cfg: primary + 1> second stations: p2p,
mp, h/ or f/ duplex. NRM or ARM (normal or async
resp. mode). Balanced cfg: two combined stations
(peers). Only for p2p links, h/ or f/duplex. ABM
(async balanced mode). NRM: primary always
initiates transfers to second; second needs explicit
permission to transfer a response. ARM: second
doesn’t need explicit perms, link overhead may be
reduced; in mp lines only 1 secondary can be in
ARM mode. ABM: commonly used in p2p. Other
non-operational modes: NDM (normal discon. mode):
second station not ready to rx any I or S frame, ADM
(async D.M.): combined station not ready to rx I,S;
IM (init. Mode): used to initialize stations or xchange
parameters between them.
P/F bit: primary sends smth. bit is on, it’s a poll to the
2ndary, which tx-es, with P/F off. When done → on.
LLC service to higher layers: connectionless:
Unacked (Type 1), Acked (Type 3; 2 forms:
push/pull); connection-oriented (Type 2, similar to
TCP, only support unicast connections). All nodes
must support the unacked conn-less svc.
PPP (p2p protocol) – 1 sender, 1 receiver, one link:
no MAC. Important: multiplex many protocols over 1
serial conn.; handle compression & encrypt. at
lowest layer; easy authentication at other end of
conn. E.g.: dialup, ISDN, DSL.
Requirements: packet framing, bit transparency,
error detection, connection liveness, network layer
address negotiation. Non: no prevention of long runs
of certain bit strings, no err recovery, no flow ctrl, no
need to supp mp links. Frame format:
Flag same as in HDLC, but uses byte stuffing (7E
and 7D replaced by 7D followed by original octet
XORed with 20). Addr & Ctrl fields: legacy of the
HDLC frame format. Protocol – higher layer protocol
type. LCP config: header compression, max payload
length, type of CRC (2B,4B), disable/select auth
stage (PAP, CHAP, EAP), line quality monitoring.
LCP frame types:
Auth at Link Layer: no need to resolve names/get IP
addr prior to auth. In mp: authorize all protocols at
the same time.
NCP (netw. ctrl protocol) – msg. types: Config(Req/Ack/Nac/Reject), Terminate-(Req/Ack), CodeReject (7 total). These are not LCP messages.
PPPoE [RFC2516] – PPP over Ethernet. Added
functionality useful to ISPs: -secure comm. via using
auth (user logins), -measure user generated traffic.
Data link protocols:
Types of links: p2p, broadcast (shared wire/medium,
Eth., WLAN), switched (sw. Eth., ATM).
Multiple Access prot.(=Medium Access Control
prot.): -algorithm that determines how stations share
channels, -info on channel sharing uses the same
channel. Ideal of rate R bps: efficient (node sends at
rate R), fair (M nodes send at ~R/M rate),
decentralized, simple, scalable, with traffic priorities.
MAC protocols: 1.Channel partitioning (no collisions:
xDM, xDD, xDMA; issue – contention at the
receiver), 2.Random Access (allow/recover from
collisions), 3.Handshaking.
Collision detection requires a minimum size frame.
E.g.: B=10Mbps,L=2km,P=200m/usec. Min. Frame
size: MF=((2*L)/P)*B=25bytes. Exponent.backoff: 1st
collision: choose K at random from {0,1}; delay is
K*512bit tx times; after 2nd collision choose K {0...3};
after iit collision ch. K {0,...,2i-1}, after 10> coll: K
{0...1023}, after 16 coll.: give up. Abort time: jam
signal (32/48 bits). Inter frame gap: 96 bit times after
tx-ing. Frame burst: tx multiple frames; burst limit:
8KB for Gbit Eth. Random Acc. Prot. advantages: small latency for low traffic load, netw. Init not
required; disadv: unbounded msg latency, poor perf.
under heavy load.
Node: sends 32bit jam, so 32-bit MAC CRC fails.
Inter-frame gap: 96bits (10-MbpsEth.: 9.6us). Fullduplex Ethernet: no CSMA/CD required.
Industrial Ethernet – higher temperature ranges,
rugged/metal housing, fan-less products that
withstand vibrations, industrial connectors and
cables – CAT5E, EMC immunity, higher reliability &
availability. Office installation: fixed, often startopology; Industry: plant dependent cabling, cabling
ducting, redundant cabling, often ring topologies.
Deterministic Eth.: use switch w/ fulldupl. ports.
Handshaking (polling): Token passing – Token
bus, Token ring (like T.b. bounded latency, high
throughput during heavy traffic, unlike: better for light
traffic, global, local priority mech. available).
Hybrid: Implicit token: variable length TDMA. Small
latency for light traffic, good throughput under heavy
tr., global prioritization via fixed slots. Disadv:
complex node mapping. Binary countdown: each
node is assigned a unique id, nodes compete. High
throughput under light loads, priot. possible, low
overhead. Global priority: nodes must determine
winner, Bit dominance – realized, Implicit
tokens/Token ring – very fast (implicit/explicit) token
pass to all nodes. Global fairness: Bit dominance and
Random access must use emulation; Implicit token –
use rotating slots, Explicit token protocols – as part
of token passing.
IEEE 802.3 Ethernet
Structure: Preamble: 7bytes of AA, then 1B,
Type/Length: DIX- indicate higher layer protocol
type, 802.3- indicate length of data+pad+CRC.
Topologies: shared bus, wiring hub, switched.
CDMA:
IEEE 802.1p allows high-priority messaging. IEEE
802.1Q allows separation of data collection and realtime control. IGMP – management for multicast
messaging, used to assign sensor IEDs to sepcific
consumer IEDs.
Example b/w calc: Given X number of producer IED’s and
one consumer IED:
1. Port Bandwidth of consumer device (On uplink port) =
BWConsumer (Mbits/second);
2. Frame size generated by producer IED’s = FS (in bits)
3. IED Period of reporting by producer devices = TProducer (ms)
Given a 16 port full-duplex 100Mbps Ethernet Switch with:
– BWConsumer = 100Mb/s (This number represents total traffic
including CRC and preamble). The maximum number of possible
frame bits @ 100% utilization of this port is defined as:
– BWMAX = 100,000,000 bits/second
For this analysis assume the following:
– The frame size generated by producer devices, FS=64 bytes
– The period of IED reporting, Treporting = 1 ms (i.e. 1000 times /
second). Therefore, it can be calculated that each producer device
will consume:
– 64 bytes x 8 bits/byte x 1000/s = 512 kbits/s of bandwidth.
Therefore one can conclude the following:
– Each IED consumes (512,000)/(100,000,000) =
0.512 % of bandwidth each second
– (100,000,000) / (512,000) = 195.
This implies 195 producer devices can be used before the
maximum channel BW is reached.
Architectures: Cascading (cost-effective, IED-IED
N-hops in worse case), Star (1 main
switch→connections to N-1 switches, low-latency, 2
hops), Ring (like previous + cascade in a O shape,
rapid reconfig via IEEE 802.1w, up to 50 switches in
a ring, reduced cabling effort, clear cabling structure,
this architecture often preferred).
Advantages of fixed assignment: simple,
deterministic response time, no wasted time for
coordination msgs. Disadv.: wasted b/w, n/w size
fixed, prioritization is local to each node, TDM
depends on synced clks.
Random access: ALOHA (no CS/CD, vulnerable: 2t,
if t – time of packet tx), CSMA, CSMA/CD. CSMA
persistence: Persistent: idle-tx, busy-continue
sensing; Non-persistent: idle-tx, busy-wait random t;
p-persistent: idle-tx with probability p, wait one slot
with prob. 1-p, busy-continue sensing. Priority: by
persistence, e.g. lower priority → less persistent.
Collision detect: in wired LAN measure signal
strengths, compare tx-ed, rx-ed signals. In WLAN
use channel reservation. Dealing with collisions:
Contention slots – detect collision.
Switch fabric – capability of switch backplane to
support max traffic without blocking. Cut-through vs
store & forward switching:
Error conditions on Eth.: Runt (framesize
<64bytes, may be because of collision), Long (fs.
1518-6kbytes, ~faulty hw or sw), Giant (>6k, same
reason), Dribble (>1518bytes, still can be
processed), Jabber (electrical problems, long frames
with incorrect FCS/align. Error, NIC sends A’s and
5’s – preamble bits indicating a falsely busy n/w),
FCS error (low probability), Alignment error (missing
octets), Broadcast storm, Collisions (good guide: coll.
cannot total more than 1% of tx-ed frames), Late
collision: 2 devices tx at the same time w/out
detecting a collision. Excessive col: station discards
frame after 16 tx attempts. Jam signals: 96 bits of
10101...→ every station stops tx-ing, also for
congestion, J.s. is normally a result of collision
detection.
Real-time reqs: IEEE 802.3x, 802.1p, 802.1Q VLAN,
802.1w, IGMP. Interoperability: common “Application
layer” must be established, data format - ? Fieldbus
Protocols over Ethernet: Schneider Modbus/TCP
(de facto standard – widely supported, easy to
implement, no OO comm. model), Siemens ProfiNet
(supp. OO, real-time extensions not available),
Rockwell EtherNet/IP (ControlNet/DeviceNet, uses
CIP, supports OO, multicast model, difficulty in
supporting legacy A-B protocols). Foundation
Fieldbus – HSE – high-speed Ethernet (Supports OO
comm. model, multicast, n/w management, major
vendor support).
Download