Network Management!

10 Jan 2018

Network Management(NM) is an important and interesting subject in CAN networks. Pretty much as the name says, its how the CAN network is managed. Lets look at the role of NM, Types of NM implementations and in-depth analysis of OSEK NM implementation.

  • Role of NM
  • NM has the following roles/tasks:

    1. Startup and shut down of network communication
    2. Handling communication failure
    3. Appointment for Network Configuration
    4. Inspection of network configuration
    5. Power management
    6. Node management
  • Types of NM
  • There are two kinds of NM implementations:

    1. OSEK NM implementation
    2. AutoSAR NM implementation

    Side-Note: OSEK and AutoSAR are two kinds of standards/Architectures.
    OSEK - Open systems and their interfaces for electronics in Motor vehciles
    AutoSAR - Automotive Open System Architecture

  • OSEK NM implementation
  • OSEK uses a token based strategy for NM implementation. OSEK NM has a ring network strategy where-in all NM nodes are taken to be part of a ring.
    NM messages in OSEK fall in fixed identifier range 500 - 57F.
    NM messages are basically CAN messages whose data is interpreted and implemented in a certain manner.

  • States of OSEK NM
    1. Alive: When a new node enters the network, it tells other nodes of its existence and it is in Alive state. It is also used to setup ring in the network startup phase
    2. Ring: When node enters into a Ring network with other nodes, it is in Ring state
    3. After Ring Formation:
    4. Limphome: When node has no logical successor and is alone in the ring, it is in limphome State
    5. Sleep indication: When node is about to sleep, it sets the sleep indication bit
    6. Sleep acknowledgement: When there is no power and no messages, the node enters a low power consumption state, waiting for a timeout, acknowledging and entering into Sleep
    7. Note: Node can be in only one of Alive/Ring/Limphome at any point. Node can combine that with Sleep indication and if its last node to go to sleep, Sleep acknowledgement state is set by it.

  • Byte Structure of NM messages:
  • NM messages can have length of 4-8 bytes depending on manufacturer.
    1. Byte-1: It contains address of logical successor in the ring here. In case node is in Alive Mode or in Limphome mode , it will have the station's own address here.
    2. Byte-2: It contains Network state information.
      • Bit 0 - Alive State
      • Bit 1 - Ring State
      • Bit 2 - Limphome state
      • Bit 3 - Reserved
      • Bit 4 - Sleep indication State
      • Bit 5 - Sleep acknowledgement State
      • Bit 6 - Reserved
      • Bit 7 - Reserved
    3. Byte-3: Reason for wake up is listed in this byte. Data is interpreted as follows
      • 00 - No entry
      • 01 - Wake Up due to Power ON/IGN ON
      • 02 - Wake Up due to CAN messages
      • 03 - Wake Up due to external events like door warning
      • 04 - Wake Up due to internal events like NMWakeUp
    4. Bytes 4-8 - Reserved
    CAN Message Example Example:
    Consider two nodes A and B with address 511 and 512 respectively.
    0x511 - 11 01
    0x512 - 12 01
    After Ring is formed:
    ox511 - 12 02
    0x512 - 11 02
    Consider Node A wants to sleep
    0x511 - 12 12
    0x512 - 11 02
    Node B also wants to sleep and conditions for sleep are favourable
    0x511 - 12 12
    0x512 - 11 12
    0x511 - 12 12
    0x512 - 11 32 ( Sleep ack bit is set for last node to sleep once sleep mode is about to be entered)

    NOTE: Images taken from Thamim Ansari's presenation(Thanks!!), Reproduced here for understanding purposes.