Communication assurance with Session Types Rumyana Neykova - - PowerPoint PPT Presentation

communication assurance with session types
SMART_READER_LITE
LIVE PREVIEW

Communication assurance with Session Types Rumyana Neykova - - PowerPoint PPT Presentation

Communication assurance with Session Types Rumyana Neykova Communication Safety with Session Types Promises: Organising structured communications from a global point of view Efficient type-checking strategy of processes through


slide-1
SLIDE 1

Communication assurance with Session Types

Rumyana Neykova

slide-2
SLIDE 2

Communication Safety with Session Types

 Promises:

 Organising structured communications from a global point of

view

 Efficient type-checking strategy of processes

through projection of global types onto participants

slide-3
SLIDE 3

The shortcoming

When the endpoints are not typed… the communication assurance is lost 

slide-4
SLIDE 4

Runtime Verification to the rescue

Transport Monitor Monitor Monitor

PAlice PCarol PBob

Attach monitor to each untyped participant. Monitors check that every incoming and outgoing message is correct wrt the protocol specifications.

slide-5
SLIDE 5

Content

 Session Types Overview  Runtime Verification Overview  Monitoring Demo  Future Directions

slide-6
SLIDE 6

Session Types in a Nutshell

“…Session Types structure a series of interactions in a simple and concise syntax and ensure type safe communication.”

slide-7
SLIDE 7

Session Types Guarantees

  • Communication follow the described protocol
  • No communication mismatch

Communication Safety Session Fidelity

  • No deadlock/ stuck in a session

Progress

slide-8
SLIDE 8

Example

 How it works?

 Step 1: Write Global Type  Step 2: Write Local Programs  Step 3: Project and Type Check

Locally

Alice Seller Bob Carol quote Address Date quote

  • k
  • k

Delegate T

slide-9
SLIDE 9

Step 1: Write Global Types

slide-10
SLIDE 10

Step 2: Projections

slide-11
SLIDE 11

Typing System

Typing judgement are of the shape:

slide-12
SLIDE 12

Evolution

 Binary Session Types [THK98, HVK98]  Myltiparty Session Types [POPL’08]  Progress in Interleaved Multiparty Sessions [Concur’08]  Session Types with Assertions [Concur’11]  Dynamic Multirole session types [POPL’11]

slide-13
SLIDE 13

Limitations …

An alternative mechanisms for validations is needed !!!

Proving communication assurance in the presence

  • f untyped endpoints is a problem for the existing

theory since it relies on typing.

slide-14
SLIDE 14

Runtime Verification

“…Formal method that is used for monitoring of a program being executed by verifying the generated events against a set of properties”

slide-15
SLIDE 15

The process

 Properties are written in some formal logic - specification

language

 The properties are transformed into runtime monitor which

is instrumented with the system to be monitored

 A runtime monitor observes the system while it is running  The monitor triggers an appropriate response if a system

property is violated.

slide-16
SLIDE 16

Components

  • 1. System to be monitored
  • 2. Set of specifications written in some formal notation
  • 3. Stream of events extracted from the system (trace)
  • 4. Monitoring system which receives the events and verifies
slide-17
SLIDE 17

Specification Language

 What kind of properties to specify?

 Temporal properties  Consequential: authentication happens before data access  real-time: transaction takes no more than 30 sec to execute  Contextual properties: possibility to monitoring objects either

globally or locally

 Exceptions related: monitoring all exceptional cases in the

execution of the program “Specification language should be properly chosen to meet the properties that need to be enforced.”

slide-18
SLIDE 18

Various Options for specification Language

“Defining a specification language is a problem of choosing the

  • ptimal balance between simplicity, efficiency and effectiveness”

 The language can be based on:

 Algebra  Automata  Logic  Regular expressions

 It can be fully featured language

 Functional  Object-oriented  Imperative  Extension of an existing language

slide-19
SLIDE 19

Monitor

“A monitor is a system that observes the behaviour of a system and determines if it is consistent with a given specification”

slide-20
SLIDE 20

Example of RV tools

Larva JRMTC ASML JASS Obser ver

Enforce Real-time properties Fully functional specification language Design By Contract Approach Self-checking distributed system

slide-21
SLIDE 21
slide-22
SLIDE 22

OOI(Ocean Observation Initiative)

Aim: to deploy an infrastructure to expand the scientists’ ability to remotely study the ocean Need for global safety ensurance by local validation with possibly unsafe endpoints

 Builds on large scale infrastructure  Distributed components are managed under diverse

administrative domains

 Active entities participants and organizations are called

agents, agents must conform to norms

slide-23
SLIDE 23

OOI Use Case : Instrument Command

slide-24
SLIDE 24

Use Case

slide-25
SLIDE 25

Distributed Monitor

 Check:

 session initialisation  messages within sessions

(External) monitors : drop violating incoming and ongoing messages

slide-26
SLIDE 26

Properties

 Local/global conformance: a monitored process

well- behaves and coherence is preserved in a network

 Local/global transparency: monitors do not alter

well-behaved interactions

 Session fidelity: the interactions of a network are

step-by-step conform to the corresponding global types

slide-27
SLIDE 27

Demo Time

Demo

slide-28
SLIDE 28

Demo Notes

 Untrusted code runs on end-point machines.  They communicate through a common transport

(AMQP).

 Monitors check that every incoming and outgoing

message is correct wrt the protocol specifications

slide-29
SLIDE 29

Future Directions

 Runtime enforcements  Exception Handling  Real-Time Properties  Contextual Properties

slide-30
SLIDE 30

Q & A

slide-31
SLIDE 31

Appendix

 OOI  AMQP  Monitor  Properties