![Page 1: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/1.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/2.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/3.jpg)
![Page 4: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/4.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/5.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/6.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/7.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/8.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/9.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/10.jpg)
• 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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/11.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/12.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/13.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/14.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/15.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/16.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/17.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/18.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/19.jpg)
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 20: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/20.jpg)
References
OPN Programming Guide
PEF Architecture Tutorial
Download Microsoft Message Analyzer
Microsoft Message Analyzer Operating Guide
Message Analyzer Blog
![Page 21: Protocol Engineering Frameworkdownload.microsoft.com/download/C/6/0/C60E2BD0-8A7C... · The Protocol Engineering Framework (PEF) Protocol Design, Documentation, Testing, and Analysis](https://reader036.vdocuments.us/reader036/viewer/2022062415/5fcfd1ef70fe5d133c3b2f4b/html5/thumbnails/21.jpg)
Appendex