Upload
others
View
18
Download
0
Embed Size (px)
Citation preview
Mai-Ing Cheng
Principal Program Manager
Microsoft Corporation
The Protocol Engineering Framework (PEF)Protocol Design, Documentation, Testing, and Analysis
Part 1: Background
Traditional development cycle for protocol
related artifacts
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:
Moving Forward: ChallengesMultiple masters
Specs, Code, Parsers, Models, Test Suites, Inventory
Efficiency and accuracy of creation / maintenance hard
Verification
Difficulty capturing messages
Part 2: PEF
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.
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
• 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
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
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
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
Part 3: The Language
Open Protocol Notation
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
Example: DataProtocol HTTP;
...
message Response
{
VersionType Version;
uint StatusCode;
string ReasonPhrase;
HttpHeadersType Headers;
optional MessageBodyType ChunkedMessageBody;
binary Payload;
}
...
Example: Architectureprotocol DHCPv6;
using UDP;
...
endpoint Server
over UDP.Host provides Messages consumes Messages
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};
References
OPN Programming Guide
PEF Architecture Tutorial
Download Microsoft Message Analyzer
Microsoft Message Analyzer Operating Guide
Message Analyzer Blog
Appendex