Login Register
The stories and information posted here are artistic works of fiction and falsehood. Only a fool would take anything posted here as fact.


Car hacking - part 2 filter_list
Author
Message
Car hacking - part 2 #1
Today we are going to talk about some signaling protocols used in car networks to send and receive data.

Note : This post is going to be long, so pardon me if it bores some of you.

SIGNALING PROTOCOLS :
CAN BUS : CAN stands for Controller Area Network which is a vehicle bus standard allows microcontrollers and devices to communicate with each other on a network. it is a message based protocol designed for multiplex wiring to save copper in automobiles, not only vehicles CAN is used in many other places such as ships, elevators/escalators etc. It uses 2 wires and differential signaling and as it is a bus multiple nodes(ECU) can be connected to these 2 wires. The transmission on CAN requires all the nodes in the network to be synchronised, the data inside CAN is contained by a frame (a packet in layman terms) which is sent to all the nodes at the same time and the frame is processed only when it is useful for the node. The worst part about it is that CAN is a low-level protocol and does not support any security feature at all in it's standard implementation, however the manufacturers are expected to have their own security implementations, although there are passwords or keypairs required to access some very critical functions like firmware. A CAN frame has 4 types :
DATA frame : This frame here contains the data from ECUs for transmission and has 2 message formats Base Frame Format and Extended Frame Format both contain 11 and 29 identifier bits respectively. Each of them has 12 to 14 fields, but for us only 3 fields are relevant Arbitration identifier(which is identifier of a message and the node uses it to decide whether to process of drop a frame), Data Length Code(DLC shows length of data field in bytes.) and Data field(which contains data in bytes, and can contain 8 bytes of data.).
Remote Frame : This frame here is used to request data from a node, like usually a source node sends data to destination node but it is also possible for a destination node to ask for data from a source node to process. There are 2 differences between a data frame and a remote frame which are the RTR-bit is transmitted as a dominant bit in the data frame and remote frame does not contains any data field. if there is some event where data and remote frame with same identifier are transmitted on the same time the data frame will win because of the dominant bit following the identifier.
Error Frame : This frame is transmitted by any node detecting error which contains 2 fields the first one is given by superposition of Error flags(6-12 bits) contributed from different stations & second one is the Error Delimiter, and has 2 different types of flags Active and Passive which contain 6 dominant bits(Active) transmitted by a node detecting error that is in active state, and 6 recessive bits(Passive) transmitted by a node detecting error in passive state. After that let's talk about error counters in CAN there are 2 error counters and the frame works according to these counters to determine which error frame has to be transmitted and the counters are TEC(Transmit Error Counter) & REC(Receive Error Counter) So what is there role? When a TEC or REC is greater than 127 and lesser than 255 the passive frame is transmitted, When TEC and REC is lesser than 128 the active frame is transmitted, and when TEC is greater than 255 the bus goes into OFF state and nothing happens.
OverLoad frame : This frame is used to inject a delay between data or remote frame. It contains 2 bit fields Overload Flag and Overload delimiter. Overload Flag consists on 6 dominant bits and Overload Delimiter consists of 8 recessive bits.
2. SAE J1850 : It is a class B protocol bus developed and used
for diagnostics and data sharing applications in vehicles, it
uses 2 approaches : 1. 41.6Kbps Pulse Width Modulated
(PWM) two wire differential approach. 2. 10.4Kbps Variable
Pulse Width (VPW) single wire approach. The protocol uses
Carrier Sense Multiple Access/Collision
Resolution(CSMA/CR), unlike CAN it is used just in on-
road/off-road land-based vehicles. The J1850 frame contains 8
fields as follows : SOF(Start of Frame), Header, Data, Cyclic
Redundancy Check(CRC), EOD(End Of Data), IFR(in Frame
Response), CRC and EOF(End Of Frame).

3. Keyword Protocol : Also called KWP2000 is a protocol used in OBD-II covering application and session layer of OSI model and also transport and network layer(when used with CAN as it is also compatible with it), uses a bidirectional serial communication (meaning it sends data one bit at a time sequentially) on a single line(wire) called K-line and the data rate on it is between 1.2 and 10.4 kilobaud(measurement of symbol rate) and a message on it can contain upto 255 bytes in a data field. It also has an optional L-line implementation for wakeup but on K-line implementation it uses 2 special sequences 5-baud wakeup and fast-initialisation.

4. Local Interconnect Protocol (LIN) : a serial network protocol used for communication between components in a vehicle as CAN was too expensive for manufacturers to use for each and every component in a vehicle 5 European car manufacturers(BMW, Audi, Volkswagen, Mercedes, Volvo) with Volcano Automotive Group and Motorola developed LIN. LIN consists 16 nodes one master and up to 15 slaves, and all messages are initiated by master and just like what happens in CAN each slave receive the message and is processed by the one which finds it useful, The master node however can also act as a slave to reply to it's own message, In LIN the master and slaves are usually microcontrollers but some special hardware or application-specific integrated circuits can also be used.

5. MOST Protocol : Also stands for Media Oriented Systems Transport high-speed multimedia network serial bus-based daisy-chain or ring topology and synchronous data communication protocol implemented in vehicles to over-come audio/video signal limitations in CAN BUS. it uses plastic optical fibres or electrical data conductors to transport these signals and is able to manage upto 64 such devices in ring topology configuration and can be used for applications inside and outside the car. It defines all the networking layers of OSI model for communication and it's communication functionality is provided by a driver software known as MOST Network Services which includes Basic Layer System Services (Layer 3, 4, 5) and Application Socket Services (Layer 6), they process the MOST protocol between a MOST Network Interface Controller (NIC), which is based on the physical layer, and the API (Layer 7).

6. Flex Ray Bus : FlexRay is a communication bus designed to ensure high data rates, fault tolerance, operating on a time cycle, split into static and dynamic segments for event-triggered and time-triggered communications. It was designed to be faster and reliable than CAN and TTP supporting data rates upto 10Mbit/s and supports both star and party line network topologies and can have 2 independent data channels for fault-tolerance so that even if one channel goes down the communication still continues but with a lower bandwidth. Just like every other protocol the communication happens in form of frames and the message consists of bytes.

7. Automotive Ethernet : It is a physical layer standard designed to be used in automotive connectivity applications, IEEE standardized the technology with 802.3bw (100BASE-T1) expanded to 802.3bp(1000BASE-T1) both with data rate upto 100Mbps to 1000Mbps respectively uses PAM3 as signal encoding in both the versions of it, the cable type used in it is as short as 15m one twisted pair bi-directional unshielded copper.

Reply

RE: Car hacking - part 2 #2
This reminds me of a talk some researchers from Tencent did a few years back:
[Image: 7ajmN5P.jpg]

Telegram: Oni_SL (Link)

Reply







Users browsing this thread: 1 Guest(s)