protocol engineering frameworkdownload.microsoft.com/download/c/6/0/c60e2bd0-8a7c... · the...

22
Mai-Ing Cheng Principal Program Manager Microsoft Corporation The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Upload: others

Post on 22-Aug-2020

23 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Mai-Ing Cheng

Principal Program Manager

Microsoft Corporation

The Protocol Engineering Framework (PEF)Protocol Design, Documentation, Testing, and Analysis

Page 2: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Part 1: Background

Page 3: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis
Page 4: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Traditional development cycle for protocol

related artifacts

Page 5: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Technical Document Testing Program of Windows

• Hundreds protocols/technical documents tested

• Thousands pages studied and converted into requirements

• Thousands testable requirements identified and converted into test assertions

model-based testing

• Tested using traditional test automation

• Thousands person days:

Page 6: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Moving Forward: ChallengesMultiple masters

Specs, Code, Parsers, Models, Test Suites, Inventory

Efficiency and accuracy of creation / maintenance hard

Verification

Difficulty capturing messages

Page 7: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Part 2: PEF

Page 8: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

The Protocol Engineering Framework (PEF)

PEF enables teams

to formally

describe their

protocol with “One

Truth,” and to

generate a

consistent set of

artifacts from that

model with very

little additional

effort.

Page 9: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

The Protocol Engineering Framework

Functions Value Propositions

Visual exploration and validation of state

machine

Improve protocol design efficiency

Generated documents, code contracts, parsing Improve efficiency of producing accurate,

verifiable protocol documentation

Generated test suites that run against

implementations

Improve conformance test efficiency and

coverage

Integrated event and protocol message tracing Improve diagnosis and debugging of platforms

and services

Machine validation of protocol traces Improve protocol interoperability

Page 10: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

• Author an OPN protocol description, using Visual Studio

• Type check the project, compile it and launch other operations of the PEF environment

Authoring And Compiling A Model

Page 11: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Bootstrapping From Existing Code• Migrate an existing set of protocols to OPN

• Use an bootstrapping tool and use the authoring

environment for any subsequent update

POM

RPC/DCOM

IDL

SOAP

WCF/WSDL

Block

XSD

HTTP

XSD/WCF

OPN

Page 12: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Protocol Documentation• Utilize OPN specification to automatically generate draft

Technical Protocol Documents

OPN Spec

• Authoring

experience

POM

• TD

generation

Technical

Document

• OPN

information

read-only

• Or hints for

writers

• Update OPN spec, can update the TDs

Page 13: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Protocol Messages Analysis and Troubleshooting

• Develop the OPN code that implements a protocol

• Capture traffic and load the captures in the framework

• Messages are verified against constraints specified in OPN and errors are reported

• Analyzes some critical parts using the tool visualization capabilities

Page 14: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Part 3: The Language

Page 15: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Open Protocol Notation

Page 16: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Basic Concepts

Data

• Scalars, Arrays, Sets,

Bags, Maps, Records,

Messages

• Pattern matching

language for

describing shapes of

data

• Rich library, LINQ, and

user functions

• Annotations (aspects)

on data

Architecture

• Protocols and

modules as

components

• Endpoints for

receiving and sending

messages

• Dynamic instantiation

and addressing of

endpoints

• Stacking of endpoints

Behavior

• Abstract data model

as state of roles and

endpoints

• Actors as basic entities

for processing

• Event-driven

processing and

observation rules

attached to actors

• Behavioral constraints

by message sequence

patterns

Page 17: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Example: DataProtocol HTTP;

...

message Response

{

VersionType Version;

uint StatusCode;

string ReasonPhrase;

HttpHeadersType Headers;

optional MessageBodyType ChunkedMessageBody;

binary Payload;

}

...

Page 18: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Example: Architectureprotocol DHCPv6;

using UDP;

...

endpoint Server

over UDP.Host provides Messages consumes Messages

Page 19: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Example: Behaviorprotocol HTTP;

virtual operation Operation

{

in string Method = method;

in UriType Uri = uri;

in string Version = ver.ToString();

out uint StatusCode = statusCode;

out string ReasonPhrase = reasonPhrase;

out string ContentType = ...;

out string ContentEncoding = ...;

out binary Payload = payload;

} =

accepts HttpContract.Request{Method is method:string,

Uri is uri:UriType, Version is ver:VersionType} ->

issues HttpContract.Response{StatusCode != 100, StatusCode is statusCode:uint,

ReasonPhrase is reasonPhrase:string,

Headers is header:map<string, any>, Payload is payload:binary};

Page 21: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Appendex

Page 22: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis

Microsoft Open Protocols

http://www.microsoft.com/protocols