ASN.1 and its use for e-health standards John Larmouth ITU-T ASN.1 Rapporteur ITU-T SG17 Workshop on Standardization in E-health.

Slides:



Advertisements
Similar presentations
International Telecommunication Union ASN.1 Today and Tomorrow © 2002 OSS Nokalva.
Advertisements

Best Practices in Web Service Style, Data Binding and Validation (for use in Data-Centric Applications) David Meredith, Asif Akram, Rob Allan CCLRC Daresbury.
CSPP51038 WSDL in depth. Advanced Schema features (required for understanding wsdl)
XML Data Validation An Open QA Framework February 28, 2005 The Exchange Network Node Mentoring Workshop.
What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
XML Craig Stewart Dr. Alexandra I. Cristea
Dr. Alexandra I. Cristea XHTML.
Comparing TTCN-3 and TTCN-2 TTCN-3 User Conference May 3 rd -May 5 th,2004 Sophia Antipolis.
Programming Paradigms and languages
XML: text format Dr Andy Evans. Text-based data formats As data space has become cheaper, people have moved away from binary data formats. Text easier.
SOAP.
1 Web Data Management XML Schema. 2 In this lecture XML Schemas Elements v. Types Regular expressions Expressive power Resources W3C Draft:
TCP/IP Protocol Suite 1 Chapter 21 Upon completion you will be able to: Network Management: SNMP Understand the SNMP manager and the SNMP agent Understand.
Chapter 3 Program translation1 Chapt. 3 Language Translation Syntax and Semantics Translation phases Formal translation models.
PZ04A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ04A - Scalar and composite data Programming Language.
Sunday, June 28, 2015 Abdelali ZAHI : FALL 2003 : XML Schemas XML Schemas Presented By : Abdelali ZAHI Instructor : Dr H.Haddouti.
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
Introduction to XML This material is based heavily on the tutorial by the same name at
Efficient XML Interchange. XML Why is XML good? A widely accepted standard for data representation Fairly simple format Flexible It’s not used by everyone,
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
1.A file is organized logically as a sequence of records. 2. These records are mapped onto disk blocks. 3. Files are provided as a basic construct in operating.
XML Validation I DTDs Robin Burke ECT 360 Winter 2004.
The emergence of ASN.1 as an XML Schema Notation
Why XML ? Problems with HTML HTML design - HTML is intended for presentation of information as Web pages. - HTML contains a fixed set of markup tags. This.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
Dr. Azeddine Chikh IS446: Internet Software Development.
XML CPSC 315 – Programming Studio Fall 2008 Project 3, Lecture 1.
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
AML ASN.1 Markup Language A markup notation for ASN.1 values Copyright © 2001 Griffin Consulting, All Rights Reserved. Griffin Consulting 1625 Glenwood.
Presentation Services  need for a presentation services  ASN.1  declaring data type  encoding data types  implementation issues  reading: text, section.
What is XML?  XML stands for EXtensible Markup Language  XML is a markup language much like HTML  XML was designed to carry data, not to display data.
 XML is designed to describe data and to focus on what data is. HTML is designed to display data and to focus on how data looks.  XML is created to structure,
Processing of structured documents Spring 2002, Part 2 Helena Ahonen-Myka.
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
How do I use HTML and XML to present information?.
Study Group 7/17 ASN.1 ASN.1: Past uses, new developments, and future prospects in security and e-commerce applications John Larmouth
Abstract Syntax Notation One ASN.1. Abstract Syntax Notation One  Both the information and communications models need to be specified syntactically and.
XML – Part III. The Element … This type of element either has the element content or the mixed content (child element and data) The attributes of the.
XML Introduction. What is XML? XML stands for eXtensible Markup Language XML stands for eXtensible Markup Language XML is a markup language much like.
The eXtensible Markup Language (XML). Presentation Outline Part 1: The basics of creating an XML document Part 2: Developing constraints for a well formed.
What it is and how it works
Tutorial 13 Validating Documents with Schemas
CS 157B: Database Management Systems II February 11 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron.
Well Formed XML The basics. A Simple XML Document Smith Alice.
Introduction to DTDs. Introduction We learned how to structure information using XML Learned XML grammar Learned the rules for XML encoding We learned.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
Study Group 17 ASN.1 The importance of colour John Larmouth ISO ASN.1 Rapporteur Note, for best viewing, this presentation needs.
CHAPTER NINE Accessing Data Using XML. McGraw Hill/Irwin ©2002 by The McGraw-Hill Companies, Inc. All rights reserved Introduction The eXtensible.
XML Extensible Markup Language
1 Scalar and composite data Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Scalar and composite data Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Study Group 17 ASN.1 John Larmouth ITU-T and ISO/IEC ASN.1 Rapporteur
Chapter 27 Network Management Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 9 Web Services: JAX-RPC,
CITA 330 Section 2 DTD. Defining XML Dialects “Well-formedness” is the minimal requirement for an XML document; all XML parsers can check it Any useful.
9/21/2016 Presentation layer Abstract Syntax Notation #1 Basic Encoding Rules.
Jaringan Telekomunikasi, Sukiswo ST, MT Sukiswo
Presentation Services
Introduction to Algorithms
Unit 4 Representing Web Data: XML
The ITU-T X.500 series and X.509 in a changing world
ASN.1: Introduction Zdeněk Říha.
XML QUESTIONS AND ANSWERS
Dept. of Computer Science and Engineering
ASN.1 소개 건아정보기술 SW개발팀 김강민 주임연구원.
CSCE 315 – Programming Studio Spring 2013
Chapter 7 Representing Web Data: XML
Chapter 9 Web Services: JAX-RPC, WSDL, XML Schema, and SOAP
Introduction to Algorithms
Presentation transcript:

ASN.1 and its use for e-health standards John Larmouth ITU-T ASN.1 Rapporteur ITU-T SG17 Workshop on Standardization in E-health Geneva, May 2003

With (no!) apologies! Light relief? This presentation is not about what exchanges you need for e-health This presentation is not about what exchanges you need for e-health It is about the notation to use for such definitions, and the form of encodings (bits on the line) for your messages It is about the notation to use for such definitions, and the form of encodings (bits on the line) for your messages n Not important? Please think again. My focus is on ASN.1 and its value as such a notation My focus is on ASN.1 and its value as such a notation n But alternatives will be discussed

What is ASN.1? (1) n It is a notation for defining the content – the abstract syntax of documents –supported by binary encoding rules –supported by XML encoding rules n Hence Abstract Syntax Notation One n It can also be called an XML Schema Notation

What is XML? n eXtensible Mark-up Language n It is a human-readable form of encoding for messages with a number of advantages, and an immense amount of hype! XML usually talks about documents not messages XML usually talks about documents not messages n An XML schema notation (there are several, XSD is the best known) defines the form (structure, content, syntax, of XML documents

A quick look at an XML document <Patient> George Bush George Bush <occupation>Politician</occupation><age>40</age><previous-history> …… …… <current-illness> AFEC9D49 AFEC9D49 </Patient>

What is ASN.1? (2) n Quite old – early 1980s. n Mature! But still developing. n ISO Standards and ITU-T Recommendations n Heavily used to define messages in many industrial and commercial sectors Until recently, all ASN.1-defined messages were encoded in binary Until recently, all ASN.1-defined messages were encoded in binary

ASN.1 - lineage n ASN.1 was borne around 1982-ish n First ASN.1 Standard (CCITT X.409) in 1984 Borne from X.400 (mother with an early child, and the standard the world should have had!) Borne from X.400 (mother with an early child, and the standard the world should have had!) Fathered by X.500 ( certified insane at birth, but totally secure ) Fathered by X.500 ( certified insane at birth, but totally secure ) n Grand-parents (OSI) died prematurely and are not discussed in polite conversation today

Waving a magic wand n Without ASN.1-defined messages: – The lights go out! – Portable phones dont work! – Parcels get lost! – Traffic lights fail! – Aircraft fall from the sky! – Your impending marriage suffers as Net Meeting fails! X X X X X X n On second thoughts – it might be a better world?

A sample of ASN.1 notation BBCard ::= SEQUENCE { name IA5String, team IA5String, age INTEGER, position IA5String, handedness ENUMERATED { left-handed,right-handed, ambidextrous }, batting-average REAL }

A sample of ASN.1 notation with constraints (encouraged) BBCard ::= SEQUENCE { name IA5String (SIZE (1..60)), team IA5String (SIZE (1..60)), age INTEGER (1..100), position IA5String (SIZE (1..60)), handedness ENUMERATED { left-handed,right-handed, ambidextrous }, batting-average REAL }

The C data-structure for the base-ball card typedef struct BBCard { char name [61] ; char team [61] ; short age ; char position [61] ; enum { left_handed = 0, right_handed = 1, ambidextrous = 2, } handedness ; float batting_average ; } BBCard ;

A base-ball card value in XML syntax <BBCard> Jorge Posada Jorge Posada New York Yankees New York Yankees <age>29</age><position>C</position><handedness>right-handed</handedness><batting-average>0.277</batting-average></BBCard>

The Montagues and the Capulets (A shorter history of contending philosophies) (With apologies to William Shakespeare and to those from a non-UK culture!)

The Montagues and Capulets n A long and on-going civil dispute n Montagues => Binary-based specification n Capulets => Character-based specification

Understanding of protocol specification techniques n 1.5 billion seconds ago ….. Computers started to communicate n Major advances every 150 million seconds n There was a need for –A means of syntax (data structure) specification –Procedure (sequence) specification –Test suite specification – Validation n And tools to support rapid and (largely) error-free implementation!

The stone-age Montagues Diagrams of bits and bytes - e.g. IPv4 (The earliest approach, simple and clear, but focusing totally on the bits-on-the-line.) Tool support not possible Extensibility support crude Tool support not possible Extensibility support crude - based on reserved fields.

The stone-age Capulets n Simple command lines – in ASCII! n Simple character mnemonics and error codes (eg 200 OK) n Simple comma-separated parameters n Good for simple dialogues n Extensibility by adding commands in V2, with unknown commands ignored by V1 systems

The Bronze Age Montagues invent TLV and Tabular Notation n Each PDU and each parameter has an ID (or Tag), a Length, and a Value n Nested TLVs in TLVs – sounds familiar to XML cognoscentiae? n (Should have been patented? No XML!) n Tables list each parameter: Tabular Notation

Tabular Notation and TLV was a break- through n Extensibility was EXCELLENT. n Version 1 systems just skipped (using TLV) anything they did not know. n Tool-support, however, not possible. But it was verbose! But it was verbose! But not as verbose as the character-based encodings used by the Capulets!

The Bronze Age Capulets invent BNF n The Capulets main concern was with precise specification of correct syntax n This was the dawning of Backus Naur Form (BNF) n This potentially allowed more complex information to be specified in a command But it never really made it to the modern era of automatic mapping to Java, C++, C etc. But it never really made it to the modern era of automatic mapping to Java, C++, C etc.

150 Million seconds after the Bronze Age n Recognition of: – Separation of "abstract syntax" (content) from encoding – Encoding rules n ASN.1 specifications define a de facto, platform and language independent API n Tools emerge to support the transformation of ASN.1 to a platform-specific API, and the encoding of data across that API n Supported on a wide range of platforms and languages – typically C, C++, Java Profits for all! Profits for all!

300 Million seconds later, the Capulets develop XML n Don't really need to describe it to this audience! n But focus still more on what is a syntactically correct document, rather than on its content n Can be seen as the TLV approach stolen from the Montagues (!) but with an end-tag instead of a length field to delimit elements n Rapidly gained popularity! n The encoding-of-choice for many applications today

And finally, after another Million seconds ASN.1 develops XML Encoding Rules Romeo and Juliet marry!

Back to the serious business! n The separation of the specification of document content from representation issues has been retained in the marriage n XML is (just) another way of encoding data defined using ASN.1 The same ASN.1 definition (schema) defines both XML and (very efficient) binary encodings The same ASN.1 definition (schema) defines both XML and (very efficient) binary encodings This includes canonical encodings for security sensitive work and signatures This includes canonical encodings for security sensitive work and signatures

Current work using ASN.1 as an XMLschema n There are two pieces of OASIS work that use ASN.1 as an XML schema n The XCBF work (Extensible Common Biometrics Formats) uses ASN.1 alone to define the XML document n The UBL (Universal Business Language) work uses XSD as the master schema, but this is algorithmically mapped into an ASN.1 schema by a mapping tool in order to provide binary protocols

Mapping between binary and XML n All message formats defined using ASN.1 have a both an XML format and a binary format (no additional work needed) n Tools are available to map message formats between compact binary and XML formats for such messages (in both directions) n For some applications you may want only binary or only XML, but you use only one notation

ASN.1 support for XML - basic n The first Recommendation developed for XML support in ASN.1 was called "basic XML encoding rules", or BASIC-XER This provided no control over details of XML representation such as use of attributes instead of elements, space-separated lists, xsi:type, or namespaces ( Do you care? ) This provided no control over details of XML representation such as use of attributes instead of elements, space-separated lists, xsi:type, or namespaces ( Do you care? ) n This was very much basic XML! A canonical representation was also defined A canonical representation was also defined

Extended ASN.1 support for XML n Encoding Instructions were introduced into the ASN.1 notation n These control things such as encoding as an attribute rather than as an element, or as a space-separated list n Also support for XSD concepts such as union, default-for-empty, nillable, and so on n Encoding instructions can be prefixed or can be included separately in an Encoding Control Section (see later)

Coloring the BaseBall card schema BBCard ::= SEQUENCE { name [ATTRIBUTE] IA5String, team [ATTRIBUTE] IA5String, age INTEGER, position IA5String, handedness ENUMERATED { left-handed,right-handed, ambidextrous }, batting-average REAL } Unchanged API

The new XML syntax <BBCard name = Jorge Posada team = New York Yankees > <age>29</age><position>C</position><handedness>right-handed</handedness><batting-average>0.277</batting-average></BBCard>

Another example Employee ::= [UNCAPITALIZED] SEQUENCE { id [ATTRIBUTE] INTEGER(0..MAX), recruitedDate, salaries [LIST] SEQUENCE OF salary REAL }

Without the coloring, we have basic XML:

With the coloring, we get: Much less verbose, assuming you care! But the same information content

Equivalently we could write: Employee ::= SEQUENCE { id INTEGER(0..MAX), recruitedDate, salaries SEQUENCE OF salary REAL } ENCODING-CONTROL XER NAME Employee AS UNCAPITALIZED ATTRIBUTE Employee.id LIST Employee.salaries At first sight this is more verbose and less clear! But …..

Advantages of the separate Encoding Control Section n It keeps a much clearer separation of encoding issues from content n In most cases it is much less verbose, as you are able to apply encoding instructions globally, or to selected parts of the spec, and also to use NOT on selected parts n The embedded form is usually good for examples n The separate section is best for real specifications

Part of an invoice in XSD and the ASN.1 equivalent <xsd:element <xsd:element name="part-no" type="xsd:number"/> name="part-no" type="xsd:number"/> <xsd:element <xsd:element name="quantity" type="xsd:number"/> name="quantity" type="xsd:number"/> </xsd:complexType> maps to: LineItemPair ::= SEQUENCE { part-noINTEGER, quantityINTEGER }

The full invoice in ASN.1 (couldn't get the XSD onto a single slide!) Invoice ::= SEQUENCE { numberINTEGER, nameUTF8String, detailsSEQUENCE OF LineItemPair, LineItemPair, chargeREAL, authenticatorBIT STRING} LineItemPair ::= SEQUENCE { part-noINTEGER, quantityINTEGER }

The XML encoding of an Invoice (1) <Invoice><number>32950</number> funny-name with < funny-name with < <details><Line-item><part-no>296</part-no><quantity>2</quantity></Line-item>Cont

The XML encoding of an Invoice (2) Continuation <part-no>4793</part-no><quantity>74</quantity> <charge>397.65</charge><authenticator> EFF8 E F </authenticator></invoice>

The importance of binary encodings available n Re-opening the Montague and Capulet war! n Romeo and Juliet, happily married for a few years, get divorced! Maybe not! n There are real merits in using the same schema definition for both character and binary encodings n The next example can be taken quickly

A personnel-record defined (1) PersonnelRecord ::= SEQUENCE { name Name, title VisibleString, number EmployeeNumber, dateOfHire DATE-TIME (Date), nameOfSpouse Name, children SEQUENCE OF child ChildInformation DEFAULT {} }

A personnel-record defined (2) ChildInformation ::= SEQUENCE { name Name, dateOfBirth DATE-TIME (Date)} Name ::= SEQUENCE { givenName VisibleString, initial VisibleString, familyName VisibleString} EmployeeNumber ::= INTEGER

An example personnel-record (1) <PersonnelRecord><name><givenName>John</givenName><initial>P</initial><familyName>Smith</familyName></name><title>Director</title><number>51</number><dateOfHire> </dateOfHire><nameOfSpouse><givenName>Mary</givenName><initial>T</initial><familyName>Smith</familyName> </nameOfSpouse Cont

An example personnel-record (2) <children><child><name><givenName>Ralph</givenName><initial>T</initial><familyName>Smith</familyName></name><dateOfBirth> </dateOfBirth></child><child><name><givenName>Susan</givenName><initial>B</initial><familyName>Jones</familyName></name><dateOfBirth> </dateOfBirth></child></children></PersonnelRecord>

A count of octets for the personnel-record value n With white-space omitted, 653 octets n Fully human-readable with white-space, can be double that! n Binary TLV-style encoding 136 octets n Compact binary encoding 94 octets (other examples compress better) n ZIP compression ….. of XML or binary? n But does size (or transaction processing speed) matter anyway?

Tail-end remarks n Everyone is bored by now! n One example is much like another. n Refer to the paper if you wish. n Messages from these examples: –Simplicity and clarity of specification –Content clearly separated from syntax –Ability to apply coloring for XML –The same schema definition provides all forms of encoding as well as C, C++ and Java APIs

Future developments n Discussions are ongoing on –The application of ASN.1 to SOAP –Use of ASN.1 in web services –An ASN.1 definition of the infoset –Mapping UML to ASN.1 n Much is in place already, but work continues on the full integration of ASN.1 with XML n ASN.1 earlier shed its dependence on OSI and is now shedding its dependence on binary encodings n But it still fully supports efficient binary encodings

In conclusion Notations for e-health message content definition, and the encoding of those messages may seem boring. Notations for e-health message content definition, and the encoding of those messages may seem boring. But it is an important aspect of any e-health standardisation. Conscious and informed decisions are needed. Consider the ITU-T Recommendation ASN.1 The End – clapping is allowed!