Upload
venkatesh-palla
View
248
Download
4
Tags:
Embed Size (px)
Citation preview
1
Welcome to Internal Training Program
CAN Network Layer
2
Agenda
What is Network Layer
Why Network Layer
Advantages of CAN
Road Vehicle Diagnostics on CAN
Network Layer Functions
Types of Frames in the Network Layer
Structure of Request and Response Messages
Network Layer Timing Parameters
Examples
3
What is Network Layer
It Specifies protocol to meet the requirements of CAN-based vehiclenetwork systems on controller area networks . It has been defined in accordance with the diagnostic services established in ISO 14229-1 and ISO 15031-5
4
Why Network Layer
The exchange of data between network nodes, e.g.from ECU to ECU, or between external test equipment and an ECU. If the data to be transferred do not fit intoa single CAN frame, a segmentation method is provided by Network Layer.
5
Advantages of CAN
• Can is a multi-master Bus
• Prioritization of messages through “Identifiers”
•Theoriticaly No limitation on the number of nodes
• Multicast reception with the time synchronization
• System wide data consistency
• Error detection and error signaling
• automatic retransmission of corrupted messages as soon as the bus is idle again
• Distinction between temporary errors and permanent failures of nodes and autonomous switching off of defect nodes
6
Road Vehicle Diagnostics on CAN
Application Layer
Tester ECURequest
Response
7
Tester Application Layer
Physical Layer
ECU Application Layer
Physical Layer
Service Request
ServiceIndication
+ve or -veResponse
ServiceConformation
Application Layer talks about the Services available between the Tester Unit and the ECU (called Diagnostic Services)
8
Structure of Request and Response Messages
SA- Source Address TA- Target AddressRA- Remote Address TA_type- Addressing type (Physical or Functional)SID- Service Identifier NR- Negative Response
Request Message
Positive Response
TA TA_typeSA RA(optional)
ResponseID
Result Bytes
TA TA_typeSA RA(optional)
NR SID
TA TA_typeSA RA(optional)
SIDParameter
Bytes
Negative ResponseReason for
NR
9
Road Vehicle Diagnostics on CAN
Network Layer
10
Network Layer Functions
Message Segmentation
Message Re-assembly
Flow-Control
11
How the Network Layer fits in….
Appl Layer
Session LayerSession Layer
Appl Layer
Data link Layer Data link Layer
Physical LayerPhysical Layer
Network Layer Network Layer
Tester ECUServices
Maintain Diag Session
Flow Control
Segmentation
Re-Assembly
Segmentation
Re-Assembly
12
Types of Frames in the Network Layer
Unsegmented Message Transmission:
Single Frame (SF): Used in short messages which can be transmitted in a Single CAN message.
Segmented Message Transmission:
First Frame (FF):First Frame to be transmitted as part of Segmented message transmission.
Consecutive Frame (CF):The Remainder of the message Frames that are sent by the Message transmitter following the First frame.
Flow-Control Frame (FC):Frame sent by the message- Receiver periodically to regulate the rate of arrival of the segmented messages.
13
Unsegmented Message Segmented Message Transmission
14
Transfer of Data between Network Layers of Two or more Nodes takes place through the Network-Protocol Data Units (N_PDU)
Address Information Protocol Control Info Data Field
N_AI N-PCI N_Data
N_PDU
N_AI parameters:Used to identify the Following:1. Source address, Target address of message senders and recipients2.Communication model for the message and 3.Optional Address extension
N_PCI Parameters:Used to identify the Type of N_PDU and other necessary Control Information
N_Data Parameters:Consists of the DataBytes to be Transmittedto the other Node.
15
N_AI
N_SA(Source Address)
N_TA(Target Address)
N_TAtype
(Physical/Functional Address) N_AE
(Extended Address-Optional)
For Long messages that make use of Segmented MessageTransmission, the N_AI information has to be copied to every Frame Segment.
16
N_PCI
17
Single Frame N_PCI
18
First Frame N_PCI
12 (4+8) bytes can be used to represent Data Length.
Max Data Length= 4095 bytes
19
Consecutive Frame N_PCI
Sequence Number (SN):Used in the Consecutive Frame N_PDU to specify the order of the consecutive frames. Rules applying to the Sequence Number (SN):
1.Starts with zero (0) for all segmented messages.
2.For the First Frame, SN=0 by default.
3.SN is incremented by 1 for each Consecutive frame transmitted during a segmented message transmission.
4.When SN reaches 15 (Fh), it shall wraparound and be set to zero (0) for the Consecutive Frame (CF).
20
Flow Control N_PCI
Flow Status
21
Block Size (BS) : Byte 2 of the FC N_PCI
22
Separation Time (Stmin): Byte 3 of FC N_PCI
23
Network Layer Timing Parameters
24
CAN message flow
User Interface for Reading Request / Response
Example 1 – Diagnostic message transmission on CAN
Unsegmented Message Transmission
s
Request
Response
25
Request
Response
CAN message flow
Example 2 – Diagnostic message transmission on CAN
Segmented Message Transmission
26
Documents for Reference
1.Documents on Road Vehicle Diagnostics on CAN - ISO 15765-1 : General Information ISO 15765-2 : Network Layer ISO 15765-3 : Application Layer
2. KWP Specifications - ISO 14230-1 to ISO14230-4
3. CAN Specification Documents Part A and Part B
27
Questions??
28
Thank you