Last Time. Bit banged SPI I2C LIN Ethernet. u Embedded networks. Ø Characteristics Ø Requirements Ø Simple embedded LANs

Similar documents
CS 5523 Operating Systems: Synchronization in Distributed Systems

Processes. Criteria for Comparing Scheduling Algorithms

CS 5523: Operating Systems

Quality of Service in Optical Telecommunication Networks

COMP 635: WIRELESS & MOBILE COMMUNICATIONS COURSE INTRODUCTION. Jasleen Kaur. Fall 2017

General Framework of Electronic Voting and Implementation thereof at National Elections in Estonia

Estonian National Electoral Committee. E-Voting System. General Overview

Cadac SoundGrid I/O. User Guide

Case 2:18-cv JRG Document 1 Filed 08/01/18 Page 1 of 26 PageID #: 1

IC Chapter 15. Ballot Card and Electronic Voting Systems; Additional Standards and Procedures for Approving System Changes

Frequency-dependent fading bad for narrowband signals. Spread the narrowband signal into a broadband signal. dp/df. (iii)

Sensyflow P. Thermal air-mass flowmeter for test rigs and quality assurance 10/ EN. Function and System Design

The optical memory card is a Write Once media, a written area cannot be overwritten. Information stored on an optical memory card is non-volatile.

United States District Court, D. Delaware. LUCENT TECHNOLOGIES, INC. Plaintiff. v. NEWBRIDGE NETWORKS CORP. and Newbridge Networks, Inc. Defendants.

Concurrent Programing: Why you should care, deeply. Don Porter Portions courtesy Emmett Witchel

The Electronic Communications Act (2003:389)

Maps and Hash Tables. EECS 2011 Prof. J. Elder - 1 -

CS 5523: Operating Systems

ETSI TS V8.3.0 ( )

A Bloom Filter Based Scalable Data Integrity Check Tool for Large-scale Dataset

Maps, Hash Tables and Dictionaries

Operating Systems. Chenyang Lu

Model Act to Permit Continued Access by Law Enforcement to Wire & Electronic Communications

Downloaded from: justpaste.it/vlxf

SMS based Voting System

Aristotle s Model of Communication (Devito, 1978)

CPSC 467b: Cryptography and Computer Security

LAW ON ELECTRONIC COMMUNICATIONS

CS 5523 Operating Systems: Intro to Distributed Systems

DIAPHRAGM VACUUM PUMPS AND COMPRESSORS

Cyber-Physical Systems Feedback Control

File Systems: Fundamentals

The contact details provided in this section will be published on the Hague Conference website

Critiques. Ø Critique #1

VLSI Design I; A. Milenkovic 1

Dependability in Distributed Systems

Wednesday, January 4, electronic components

DRAFT AUSTRALIAN STANDARD FOR COMMENT

ETSI TS V ( )

1. Contact details The contact details provided in this section will be published on the Hague Conference website

Opportunities in Communication

CSE 520S Real-Time Systems

Addressing the Challenges of e-voting Through Crypto Design

IN-POLL TABULATOR PROCEDURES

PHASED OUT. LED light engine / OLED LED linear / area. Module CLE Shallow G1 ADV Modules CLE

Kit Potentiometer Rotational Analog Displacement Sensor

CS 2461: Computer Architecture I

CABLE TELEVISION FRANCHISE AGREEMENT. THIS CABLE TELEVISION FRANCHISE AGREEMENT (the "Franchise Agreement")

600Amps Internet Services, Inc. TERMS OF SERVICE (Rev , January 1, 2018)

Choosing the Right Monitor for Your Application

CHAPTER 2 LITERATURE REVIEW

Lecture 6 Cryptographic Hash Functions

Opening Chief Editor s Report P802.3cg draft 0.3

Implementation of aadhar based voting machine using

Adaptive QoS Control for Real-Time Systems

LED light engines LED compact. Module CLE G3 ADV Modules CLE ADVANCED

Philips Lifeline. Ø Chenyang Lu 1

Final Review. Chenyang Lu. CSE 467S Embedded Compu5ng Systems

TECHNICAL ADVISORY GROUP ON MACHINE READABLE TRAVEL DOCUMENTS (TAG-MRTD)

Real-Time Wireless Control Networks for Cyber-Physical Systems

Real- Time Wireless Control Networks for Cyber- Physical Systems

Practical Application of Precision Time Protocol: Campus path measurement, Smart SFP reflectors, IEEE1588 grandmaster clocks, and stuff.

AUTOMATED AND ELECTRIC VEHICLES BILL DELEGATED POWERS MEMORANDUM BY THE DEPARTMENT FOR TRANSPORT

Florida Supreme Court Standards for Electronic Access to the Courts

RFM-DACNF04-S250KH (FMC DA board) Hardware Reference Manual

Agenda. Accredited Standards Committee* National Committee for Information Technology Standards (NCITS)

Before : LORD JUSTICE GROSS LORD JUSTICE FLOYD and MR JUSTICE ARNOLD Between:

Regulation and Oversight (a) Severability (b) Preemption. Provision of Cable Service

Internet of Things Wireless Sensor Networks. Chenyang Lu

1. Contact details The contact details provided in this section will be published on the Hague Conference website

1. Contact details The contact details provided in this section will be published on the Hague Conference website

Statement on Security & Auditability

Global Conditions (applies to all components):

Servilla: Service Provisioning in Wireless Sensor Networks. Chenyang Lu

We should share our secrets

TELECOMMUNICATIONS ORDINANCE (Chapter 106) WIRELESS INTERNET OF THINGS LICENCE. [Company Name]... [Address]

A Calculus for End-to-end Statistical Service Guarantees

The problems with a paper based voting

1. Contact details The contact details provided in this section will be published on the Hague Conference website

Tariff M.P.S.C. No. 25 (U) Original Sheet 1 ACCESS SERVICE

A2LA. P111 Technical Consensus Decisions from the Electromagnetic Advisory Committee (EMAC)

Joint T10/T11 FC_TAPE AdHoc Meeting March 9, 1999 Harrisburg Pennsylvania Stewart Wyatt, HP, Secretary

Configuring MST (802.1s)/RSTP (802.1w) on Catalyst Series Switches Running CatOS

German Federal Ministry of the Interior 20 August / 6

GAO. Statement before the Task Force on Florida-13, Committee on House Administration, House of Representatives

mg Doc Filed 12/13/18 Entered 12/13/18 15:42:22 Main Document Pg 1 of 5

No Recourse (n) Construction of Franchise Agreement

Payments System Law Rationalizing Laws and Regulations

Communications Act 8 of 2009 section 86

P802.3cg Draft D0.2. Valerie Maguire IEEE P802.3cg, Chief Editor. September 14, 2017 Charlotte, NC

Inductive proximity sensors basic series

Abstract: We present a modular voting architecture in which vote generation is performed separately from vote casting.

TinyOS and nesc. Ø TinyOS: OS for wireless sensor networks. Ø nesc: programming language for TinyOS.

1. Contact details The contact details provided in this section will be published on the Hague Conference website

Getting Started Guide

Chief Electoral Officer Directives for the Counting of Ballots (Elections Act, R.S.N.B. 1973, c.e-3, ss.5.2(1), s.87.63, 87.64, 91.1, and 91.

Manual of Practical Holography. Graham Saxby

SECURITY, ACCURACY, AND RELIABILITY OF TARRANT COUNTY S VOTING SYSTEM

IEEE RTPGE Study Group Minutes Minneapolis, 5/15/12 5/16/12 Dave Dwelley, recording secretary. Called to order at 9:00am by David Law

Did you sign in for training? Did you silence your cell phone? Do you need to Absentee Vote? Please Hold Questions to the end.

Transcription:

Last Time u Embedded networks Ø Characteristics Ø Requirements Ø Simple embedded LANs Bit banged SPI I2C LIN Ethernet

Today u CAN Bus Ø Intro Ø Low-level stuff Ø Frame types Ø Arbitration Ø Filtering Ø Higher-level protocols

Motivation u Some new cars contain > 3 miles of wire u Clearly inappropriate to connect all pairs of communicating entities with their own wires Ø O(n 2 ) wires u CAN permits everyone on the bus to talk Ø Cost ~$3 / node $1 for CAN interface $1 for the transceiver $1 for connectors and additional board area

CAN Bus u Cars commonly have multiple CAN busses Ø Physical redundancy for fault tolerance u CAN nodes sold Ø 200 million in 2001 Ø 300 million in 2004 Ø 400 million in 2009

What is CAN? u Controller Area Network Ø Developed by Bosch in the late 1980s Ø Current version is 2.0, from 1991 u Multi-master serial network u Bus network: All messages seen by all nodes u Highly fault tolerant u Resistant to interference u Lossless in expected case u Real-time guarantees can be made about CAN performance

More about CAN u Message based, with payload size 0-8 bytes Ø Not for bulk data transfer! Ø But perfect for many embedded control applications u Bandwidth Ø 1 Mbps up to 40 m Ø 40 Kbps up to 1000 m Ø 5 Kbps up to 10,000 m u CAN interfaces are usually pretty smart Ø Interrupt only after an entire message is received Ø Filter out unwanted messages in HW zero CPU load u Many MCUs have optional onboard CAN support

CAN Bus Low Level u CAN does not specify a physical layer u Common PHY choice: Twisted pair with differential voltages Ø Resistant to interference Ø Can operate with degraded noise resistance when one wire is cut Ø Fiber optic also used, but not commonly u Each node needs to be able to transmit and listen at the same time Ø Including listening to itself

Dominant and Recessive u Bit encoding: Ø Voltage difference dominant bit == logical 0 Ø No voltage difference recessive bit == logical 1

Bus Conflict Detection u Bus state with two nodes transmitting: Node 2 Node 1 dominant dominant dominant recessive dominant recessive dominant recessive u So: Ø When a node transmits dominant, it always hears dominant Ø When a node transmits recessive and hears dominant, then there is a bus conflict u Soon we ll see why this is important

More Low Level u CAN Encoding: Non-return to zero (NRZ) Ø Lots of consecutive zeros or ones leave the bus in a single state for a long time Ø In contrast, for a Manchester encoding each bit contains a transition u NRZ problem: Not self-clocking Ø Nodes can easily lose bus synchronization u Solution: Bit stuffing Ø After transmitting 5 consecutive bits at either dominant or recessive, transmit 1 bit of the opposite polarity Ø Receivers perform destuffing to get the original message back

CAN Clock Synchronization u Problem: Nodes rapidly lose sync when bus is idle Ø Idle bus is all recessive no transitions Ø Bit stuffing only applies to messages u Solution: All nodes sync to the leading edge of the start of frame bit of the first transmitter u Additionally: Nodes resynchronize on every recessive to dominant edge u Question: What degree of clock skew can by tolerated by CAN? Ø Hint: Phrase skew as ratio of fastest to slowest node clock in the network

CAN is Synchronous u Fundamental requirement: Everyone on the bus sees the current bit before the next bit is sent Ø This is going to permit a very clever arbitration scheme Ø Ethernet does NOT have this requirement This is one reason Ethernet bandwidth can be much higher than CAN u Let s look at time per bit: Ø Speed of electrical signal propagation 0.1-0.2 m/ns Ø 40 Kbps CAN bus 25000 ns per bit A bit can travel 2500 m (max bus length 1000 m) Ø 1 Mbps CAN bus 1000 ns per bit A bit can travel 100 m (max bus length 40 m)

CAN Addressing u Nodes do not have proper addresses u Rather, each message has an 11-bit field identifier Ø In extended mode, identifiers are 29 bits u Everyone who is interested in a message type listens for it Ø Works like this: I m sending an oxygen sensor reading Ø Not like this: I m sending a message to node 5 u Field identifiers also serve as message priorities Ø More on this soon

CAN Message Types u Data frame Ø Frame containing data for transmission u Remote frame Ø Frame requesting the transmission of a specific identifier u Error frame Ø Frame transmitted by any node detecting an error u Overload frame Ø Frame to inject a delay between data and/or remote frames if a receiver is not ready

CAN Data Frame u Bit stuffing not shown here it happens below this level

Data Frame Fields u RTR remote transmission request Ø Always dominant for a data frame u IDE identifier extension Ø Always dominant for 11-bit addressing u CRC Based on a standard polynomial u CRC delimiter Always recessive u ACK slot This is transmitted as recessive Ø Receiver fills it in by transmitting a dominant bit Ø Sender sees this and knows that the frame was received By at least one receiver u ACK delimiter Always recessive

Remote Frame u Same as data frame except: Ø RTR bit set to recessive Ø There is no data field Ø Value in data length field is ignored

Error Checking u u u Five different kinds of error checking are performed by all nodes Message-level error checking Ø Ø Ø Verify that checksum checks Verify that someone received a message and filled in the ack slot Verify that each bit that is supposed to be recessive, is Bit-level error checking Ø Ø Verify that transmitted and received bits are the same Except identifier and ack fields Verify that the bit stuffing rule is respected

Error Handling u Every node is in error-active or error-passive state Ø Normally in error-active u Every node has an error counter Ø Incremented by 8 every time a node is found to be erroneous Ø Decremented by 1 every time a node transmits or receives a message correctly u If error counter reaches 128 a node enters errorpassive state Ø Can still send and receive messages normally u If error counter reaches 256 a node takes itself off the network

Error Frame u Active error flag six consecutive dominant bits Ø This is sent by any active-error node detecting an error at any time during a frame transmission Ø Violates the bit stuffing rule! This stomps the current frame nobody will receive it Ø Following an active error, the transmitting node will retransmit u Passive error flag six consecutive recessive bits Ø This is sent by any passive-error node detecting an error Ø Unless overwritten by dominant bits from other nodes! u After an error frame everyone transmits 8 recessive bits

Bus Arbitration u Problem: Control access to the bus u Ethernet solution: CSMA/CD Ø Carrier sense with multiple access anyone can transmit when the medium is idle Ø Collision detection Stomp the current packet if two nodes transmit at once Why is it possible for two nodes to transmit at once? Ø Random exponential backoff to make recurring collisions unlikely u Problems with this solution: Ø Bad worst-case behavior repeated backoffs Ø Access is not prioritized

CAN Arbitration u Nodes can transmit when the bus is idle u Problem is when multiple nodes transmit simultaneously Ø We want the highest-priority node to win u Solution: CSMA/BA Ø Carrier sense multiple access with bitwise arbitration u How it works: Ø Two nodes transmit start-of-frame bit Nobody can detect the collision yet Ø Both nodes start transmitting message identifier As soon as the identifiers differ at some bit position, the node that transmitted recessive notices and aborts the transmission

Multiple Colliding Nodes

Arbitration Continued u Consequences: Ø Nobody but the losers see the bus conflict Ø Lowest identifier always wins the race Ø So: Message identifiers also function as priorities u Nondestructive arbitration Ø Unlike Ethernet, collisions don t cause drops Ø This is cool! u Maximum CAN utilization: ~100% Ø Maximum Ethernet with CSMA/CD utilization: ~37%

CAN Message Scheduling u Network scheduling is usually non-preemptive Ø Unlike thread scheduling Ø Non-preemptive scheduling means high-priority sender must wait while low-priority sends Ø Short message length keeps this delay small u Worst-case transmission time for 8-byte frame with an 11-bit identifier: Ø 134 bit times Ø 134 µs at 1 Mbps

Babbling Idiot Error u What happens if a CAN node goes haywire and transmits too many high priority frames? Ø This can make the bus useless Ø Assumed not to happen u Schemes for protecting against this have been developed but are not commonly deployed Ø Most likely this happens very rarely Ø CAN bus is usually managed by hardware

CAN Hardware u FlexCan seen on ColdFire chips u 16 message buffers Ø Each can be used for either transmit or receive Ø Buffering helps tolerate bursty traffic u Transmission Ø Both priority order and queue order are supported u Receiving Ø FlexCAN unit looks for a receive buffer with matching ID Ø Some ID bits can be specified as don t cares

More FlexCan u Interrupt sources Ø Message buffer Ø Error 32 possibilities successful transmit / receive from each of the 16 buffers Ø Bus off too many errors

Higher Level Standards u CAN leaves much unspecified Ø How to assign identifiers? Ø Endianness of data? u Standardized higher-level protocols built on CAN: Ø CANKingdom Ø CANOpen Ø DeviceNet Ø J1939 Ø Smart Distributed System u Similar to how Ø TCP is built in IP Ø HTTP is built in TCP Ø Etc.

CANOpen u Important device types are described by device profiles Ø Digital and analog I/O modules Ø Drives Ø Sensors Ø Etc. u Profiles describe how to access data, parameters, etc.

CAN Summary u Not the cheapest network Ø E.g., LIN bus is cheaper u Not suitable for high-bandwidth applications Ø E.g. in-car entertainment streaming audio and video Ø MOST Media Oriented Systems Transport u Design point: Ø Used where reliable, timely, medium-bandwidth communication is needed Ø Real-time control of engine and other major car systems