34
Diagnosis of V2X communication via evaluation modules and textual rule sets Presented by Tim Ruß © All rights reserved

Diagnosis of V2X communication via evaluation modules and

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Diagnosis of V2X communication via evaluation modules and

Diagnosis of V2X communication via evaluation modules and textual rule sets

Presented by Tim Ruß

© All rights reserved

Page 2: Diagnosis of V2X communication via evaluation modules and

Motivation

© All rights reserved

Page 3: Diagnosis of V2X communication via evaluation modules and

ifak: Institute for Automation and Communication

• Applied research

• Test laboratories

© All rights reserved

User Conference on

Advanced Automated Testing

Page 4: Diagnosis of V2X communication via evaluation modules and

Examples for our communication domains

© All rights reserved

User Conference on

Advanced Automated Testing

Device

Device

Controller

Right image © CAR 2 CAR

Communication Consortium Left images © Phoenix Contact

Factory Automation Vehicle-to-X (also: Car2X)

Page 5: Diagnosis of V2X communication via evaluation modules and

Manual process: Checking Wireshark records

• Search for connection / startup sequence

• Search for errors (alarms, connection releases…)

Demand to automate such processes

© All rights reserved

User Conference on

Advanced Automated Testing

Page 6: Diagnosis of V2X communication via evaluation modules and

Agenda

• Scope and methods

• Approach

• Use case

• Summary

© All rights reserved

User Conference on

Advanced Automated Testing

Page 7: Diagnosis of V2X communication via evaluation modules and

Scope and methods

© All rights reserved

Page 8: Diagnosis of V2X communication via evaluation modules and

Scope and terminology

• Network communication of distributed (computer) systems: • OSI reference model • Protocol Data Units of higher levels: “messages”

• “Checking” those messages: • Verification: If a specification is correct according to the design.

Prior to the implementation. • Validation: Check if customer expectations fulfilled • Conformance check: Check if an implementation matches the

underlying specification

© All rights reserved

User Conference on

Advanced Automated Testing Image © CC BY-SA

Page 9: Diagnosis of V2X communication via evaluation modules and

Testing methods for software (e.g. source code)

• Architecture: Test system around System Under Test (SUT)

• Stimulation via input parameters

• Check of states or return values

• E.g. Unit Tests

• Coverage criteria

• E.g. check program execution paths

© All rights reserved

User Conference on

Advanced Automated Testing

SUT

Test

System

Stimulation

Check

Page 10: Diagnosis of V2X communication via evaluation modules and

Testing network protocols

• Fuzzing: Generate random input/network data

• Conformance check

• Replace other protocol layers with test system (upper tester, lower tester)

• Run subsequent test cases…

Difficult for already running systems without test interfaces

Demand for diagnosis after commissioning

© All rights reserved

User Conference on

Advanced Automated Testing

Page 11: Diagnosis of V2X communication via evaluation modules and

Protocol specifications given in different formats

Example: Generation frequency of V2X status messages (CAMs) as plain text:

© All rights reserved

User Conference on

Advanced Automated Testing

Page 12: Diagnosis of V2X communication via evaluation modules and

Formal graphical descriptions for network protocols (1)

© All rights reserved

User Conference on

Advanced Automated Testing

Connect Request Connect Indication

Connect Response

Connect Confirm

Service User Service User Service Provider

Time Flow Charts Sequence Charts

Page 13: Diagnosis of V2X communication via evaluation modules and

© All rights reserved

User Conference on

Advanced Automated Testing

Transition

Pre-place

Post-place

Arc

Token

Formal graphical descriptions for network protocols (2)

Finite State Machines Petri nets

s0 s1 Aim: Check requirements

and errors at the same

time (like parallel test

cases, but not all have to

be executed) diagnosis

Page 14: Diagnosis of V2X communication via evaluation modules and

Approach

© All rights reserved

Page 15: Diagnosis of V2X communication via evaluation modules and

Approach: Using a Petri net to compare network messages against requirements

© All rights reserved

User Conference on

Advanced Automated Testing

Lorem ipsum dolor

sit amet,

consectetur

adipisici elit…

100101 1101001

/

Images © CC BY-SA

Continuously,

at runtime

Once,

before-

hand Requirements Petri net Verdict

Network messages

Page 16: Diagnosis of V2X communication via evaluation modules and

Case 1: Check a sequence of messages

Example: “A connect request is followed by a connect response.”

© All rights reserved

User Conference on

Advanced Automated Testing

Connect request

Connect response

Global start place (init)

Global end place (success)

Page 17: Diagnosis of V2X communication via evaluation modules and

Case 2: Check parameter values within messages

Example: “The ErrorCode of the response must be 0.”

© All rights reserved

User Conference on

Advanced Automated Testing

Response [ErrorCode == 0] [ErrorCode != 0]

(success) (error)

Response

Page 18: Diagnosis of V2X communication via evaluation modules and

Whole toolchain & workflow

© All rights reserved

User Conference on

Advanced Automated Testing

User/

Tester

Textual

„rules“ Parser

Petri net

generator

System

Under

Test

Messages

Decoder

Firing

transitions Verdicts

Currently

own DSL ANTLR

C++,

(Python)

C++,

PCAP

Page 19: Diagnosis of V2X communication via evaluation modules and

Creation of structures via subnets

• Structures for control flow, e.g. from UML Sequence Diagrams

• Considered most important:

• Alternatives (“alt”) • Parallels (“par”) • Loops (“loop”) • Errors (“not”)

• Start and end places as interfaces between structures

© All rights reserved

User Conference on

Advanced Automated Testing

Page 20: Diagnosis of V2X communication via evaluation modules and

N = (P; T; F)

© All rights reserved

User Conference on

Advanced Automated Testing

class Petrinet : def __init__ (self): self.places = [] self.transitions = [] self.arcs = []

Text Mathematical Python

„A net N consists of places P,

transitions T and flow relations F.“

Description of net creation with Python

Page 21: Diagnosis of V2X communication via evaluation modules and

def createPar(self, interfaces, operandCount):

startTrans = self.petrinet.addTransition()

self.petrinet.addArc(interfaces.getStartPlace(), startTrans)

endTrans = self.petrinet.addTransition()

self.petrinet.addArc(endTrans, interfaces.getEndPlace())

operands = []

for i in range(0, operandCount):

operandStartPlace = self.petrinet.addPlace()

self.petrinet.addArc(startTrans, operandStartPlace)

operandEndPlace = self.petrinet.addPlace()

self.petrinet.addArc(operandEndPlace, endTrans)

operandInterfaces = NetInterfaces(operandStartPlace, operandEndPlace)

operands.append(operandInterfaces)

return operands

© All rights reserved

User Conference on

Advanced Automated Testing

possible interfaces

to other structures

Page 22: Diagnosis of V2X communication via evaluation modules and

Use Case

© All rights reserved

Page 23: Diagnosis of V2X communication via evaluation modules and

Use Case: Vehicle-to-X communication (V2X)

• Vehicles send out status messages periodically (Cooperative Awareness Messages, CAM)

• Monitoring modules shall capture and check messages according to user defined rules

© All rights reserved

User Conference on

Advanced Automated Testing

First prototype New version

Page 24: Diagnosis of V2X communication via evaluation modules and

User-selected requirements for CAM payload

• User defined: StationType == 11 (Tram)

• From CAM protocol specification: 1 Hz ≤ f ≤ 10 Hz

© All rights reserved

User Conference on

Advanced Automated Testing

Page 25: Diagnosis of V2X communication via evaluation modules and

Check the vehicle role (1)

“Every CAM shall have a station type of 1.”

© All rights reserved

User Conference on

Advanced Automated Testing

CAM

[StationType == 1] CAM

[StationType != 1]

Error

Start of alternative

End of alternative

Page 26: Diagnosis of V2X communication via evaluation modules and

Check the vehicle role (2)

© All rights reserved

User Conference on

Advanced Automated Testing

Loop start

Loop end

Leave loop

[i > max]

Repeat loop

[i < max] …

Alt start

Alt end

“Every CAM shall have a station type of 1.”

Page 27: Diagnosis of V2X communication via evaluation modules and

Check the message interval (1)

“The transmit frequency shall always be between 1 Hz and 10 Hz.”

© All rights reserved

User Conference on

Advanced Automated Testing

CAM

[∆t <= 1000 ms &&

∆t >= 100 ms]

CAM

[∆t > 1000 ms ||

∆t < 100 ms] ∆t = tCAM(n) – tCAM(n-1)

Error

Alt start

Alt end

Page 28: Diagnosis of V2X communication via evaluation modules and

Check the message interval (2)

© All rights reserved

User Conference on

Advanced Automated Testing

“The transmit frequency shall always be between 1 Hz and 10 Hz.”

Loop start

Loop end

Leave loop

[i > max]

Repeat loop

[i < max] …

Alt start

Alt end

Page 29: Diagnosis of V2X communication via evaluation modules and

Check parameter and frequency

© All rights reserved

User Conference on

Advanced Automated Testing

Loop end

Parameter loop start Frequency loop start

Loop end

Global end (all processes finished)

Global start

Page 30: Diagnosis of V2X communication via evaluation modules and

Summary

© All rights reserved

Page 31: Diagnosis of V2X communication via evaluation modules and

Summary

• Check several requirements and detect errors at the same time Diagnosis

• User-selected requirements as “rules”

• Petri subnets with interface places

• Connect subnets

• React to decoded messages (move tokens), create verdicts

© All rights reserved

User Conference on

Advanced Automated Testing

Requirement / rule

Start End

Page 32: Diagnosis of V2X communication via evaluation modules and

Thank you for your kind attention Tim Ruß [email protected]

© All rights reserved

Page 33: Diagnosis of V2X communication via evaluation modules and

(Backup)

© All rights reserved

User Conference on

Advanced Automated Testing

Page 34: Diagnosis of V2X communication via evaluation modules and

Example for DSL

import <denm_cancelation.components> as stations

Rule {

name: "DENM Cancelation";

description: "Abkündigung einer DENM prüfen"

Declaration {

Signal {

name: "V2X_DENM";

use DENM.causeCode as cause;

}

}

sequence {

Loop [3] {

Message CyclistWarning(from == rsu and to == car1);

Message CyclistWarning(from == rsu and to == Any);

}

Message CyclistWarning(from == rsu and to == Any and canceled == true);

}

}

© All rights reserved

User Conference on

Advanced Automated Testing