ASN.1 lecture v.0.2. Abstract Syntax Notation One. Máté J. Csorba



Similar documents
INTERNATIONAL TELECOMMUNICATION UNION

INTERNATIONAL TELECOMMUNICATION UNION

INTERNATIONAL TELECOMMUNICATION UNION

Abstract Syntax Notation One ASN.1. ASN.1 Abstract Syntax Notation One

SNMP....Simple Network Management Protocol...

Prepared By: P Lichen. P Xulu

RaneNote SNMP: SIMPLE? NETWORK MANAGEMENT PROTOCOL

Simple Network Management Protocol (SNMP) Amar J. Desai Graduate Student University of Southern California Computer Science

SNMP and Network Management

Network Management. What is network management?

Chapter 9 Network Management

System and Network Management

8 Tutorial: Using ASN.1

Chapter 9 Network Management

Chapter 8 Network Management. Chapter 8 outline. What is network management? Chapter 8: Network Management

Link Layer Discovery Protocol and MIB

High-Level Programming Languages. Nell Dale & John Lewis (adaptation by Michael Goldwasser)

Distributed Network Management Using SNMP, Java, WWW and CORBA

Advanced TTCN-3 Test Suite validation with Titan

dominique <dot> toupin <at> ericsson <dot> com GYORGY <dot> RETHY <at> ericsson <dot> com

Simple Network Management Protocol

Lexical analysis FORMAL LANGUAGES AND COMPILERS. Floriano Scioscia. Formal Languages and Compilers A.Y. 2015/2016

ETSI EN V1.3.1 ( )

Programming Languages CIS 443

ITU-T Z.100. Specification and description language (SDL)

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Security Issues of the Digital Certificates within Public Key Infrastructures

Chapter 9 Network Management. ISO network management. What is network management? Chapter 9: Network Management. Network Management standards

Number Representation

SNMP SMI Structure of Management Information

TechNote 0006: Digital Signatures in PDF/A-1

Java (12 Weeks) Introduction to Java Programming Language

Specification of the Broadcast Wave Format (BWF)

Simple Network Management Protocol

Network Management. Jaakko Kotimäki. Department of Computer Science Aalto University, School of Science. 21. maaliskuuta 2016

R07. IV B.Tech. II Semester Regular Examinations, April, NETWORK MANAGEMENT SYSTEMS (Information Technology)

Packet Structure and Encoding

You can probably work with decimal. binary numbers needed by the. Working with binary numbers is time- consuming & error-prone.

Network Management (NETW-1001)

Advanced Security Mechanisms for Machine Readable Travel Documents and eidas Token

Topics. Parts of a Java Program. Topics (2) CS 146. Introduction To Computers And Java Chapter Objectives To understand:

[MS-RDPESC]: Remote Desktop Protocol: Smart Card Virtual Channel Extension

Introduction to Python

1 The Java Virtual Machine

AQA GCSE in Computer Science Computer Science Microsoft IT Academy Mapping

AN1304. NFC Type MIFARE Classic Tag Operation. Application note PUBLIC. Rev October Document information

Ensemble X12 Development Guide

The programming language C. sws1 1

SQL Server An Overview

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007

Introduction to Simple Network Management Protocol (SNMP)

Principles of Database Management Systems. Overview. Principles of Data Layout. Topic for today. "Executive Summary": here.

Chapter 4: Computer Codes

Getting Started with the Internet Communications Engine

Database Design and Database Programming with SQL - 5 Day In Class Event Day 1 Activity Start Time Length

Type 2 Tag Operation Specification. Technical Specification T2TOP 1.1 NFC Forum TM NFCForum-TS-Type-2-Tag_

This section describes how LabVIEW stores data in memory for controls, indicators, wires, and other objects.

What is COM/DCOM. Distributed Object Systems 4 COM/DCOM. COM vs Corba 1. COM vs. Corba 2. Multiple inheritance vs multiple interfaces

Introduction to TTCN-3

RTP / RTCP. Announcements. Today s Lecture. RTP Info RTP (RFC 3550) I. Final Exam study guide online. Signup for project demos

C H A P T E R Condition Handling

Molecular Dynamics Simulations with Applications in Soft Matter Handout 7 Memory Diagram of a Struct

PA160: Net-Centric Computing II. Network Management

Infrastructure that supports (distributed) componentbased application development

My First TTCN-3 Project with TTworkbench

MySQL for Beginners Ed 3

Character Code Structure and Extension Techniques

What Your Mother Didn't Tell You About PEM, DER, PKCS. Eric Norman University of Wisconsin-Madison

SNMP Traffic Measurements

Pemrograman Dasar. Basic Elements Of Java

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

SNMP Basics BUPT/QMUL

Windows 7 Security Event Log Format

Information Models, Data Models, and YANG. IETF 86, Orlando,

PL/SQL MOCK TEST PL/SQL MOCK TEST I

CPU Organization and Assembly Language

Preservation Handbook

Section 1.4 Place Value Systems of Numeration in Other Bases

Compiler Construction

Lab 4.4 Secret Messages: Indexing, Arrays, and Iteration

Open Mobile API Test Specification for Transport API

Chapter 1: Introduction

Signalling Control System Serial Train Information Interface

DNA Data and Program Representation. Alexandre David

, SNMP, Securing the Web: SSL

4D Plugin SDK v11. Another minor change, real values on 10 bytes is no longer supported.

Ecma/TC39/2013/NN. 4 th Draft ECMA-XXX. 1 st Edition / July The JSON Data Interchange Format. Reference number ECMA-123:2009

Digital Imaging and Communications in Medicine (DICOM) Part 10: Media Storage and File Format for Media Interchange

Object Oriented Software Design

UNIVERSITY OF BOLTON CREATIVE TECHNOLOGIES COMPUTING SEMESTER TWO EXAMINATION 2014/2015 NETWORK MANAGEMENT MODULE NO: CPU6009

Data Modeling Basics

Database System Concepts

Core Components Data Type Catalogue Version October 2011

Transcription:

ASN.1 lecture v.0.2 Abstract Syntax Notation One Máté J. Csorba csorba@item.ntnu.no 1

Contents Past, present and future of ASN.1 Why ASN.1? Tools and integration Training material Basic conventions, built-in types Tagging, extensions Subtyping, constraints, etc... Introduction to BER (PER skipped) Short examples 2

Credits Some of the material includes intellectual property from: Dr. Andreas Steffen, Zürcher Hochschule Winterthur Prof. John Larmouth, Salford University, UK Dr. György Réthy, János Zoltán Szabó, Test Competence Center, Ericsson Hungary 3

The stone-age 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 - based on reserved fields. 4

The stone-age Simple command lines in ASCII, e.g. Telnet Simple character mnemonics and error codes (e.g. 200 OK ) Simple comma-separated parameters Good for simple dialogues Extensibility by adding commands in V2, with unknown commands ignored by V1 systems 5

The bronze-age TLV and Tabular Notation Each PDU and each parameter has an ID (or Tag), a Length, and a Value Nested TLVs in TLVs? Tables list each parameter: Tabular Notation 6

And finally: ASN.1 ASN.1 was borne around 1982 First ASN.1 Standard (CCITT X.409) in 1984 International Standard : ITU-T X.680 to X.683 ISO/IEC 8824-1 to 4 There was a need for A means of syntax (data structure) specification Procedure (sequence) specification Test suite specification Validation And tools to support rapid implementation! 7

ASN.1: What is it? Describes the data exchanged between two communicating applications Supported by efficient encodings of the data Supports a diversity of operating systems and programming languages 8

ASN.1: What is it? Formal notation, supported by tools, means: no ambiguity validation is easier, at lower cost reduced time-to-market Translates easily, with tool support, into any programming language (C, C++, Java, Cobol, Pascal, and many others) Integration also with SDL 9

Abstract vs. Transfer Syntax *Taken from: Dr. Andreas Steffen, Zürcher Hochschule Winterthur 10

So. ASN.1 offers today. Wide use in a large range of industries: Keeping the lights burning Portable phones we need them Birthday presents on time Traffic lights Aircraft fly safely Multimedia standards Many other industrial sectors 11

So thanks to ASN.1 Without ASN.1: The lights go out! Portable phones don t work! Parcels get lost! X Traffic lights fail! X Aircraft fall from the sky! Your impending marriage suffers as Net Meeting fails! X X X X 12

The near future Recognition of: Separation of "abstract syntax" (content) from encoding Encoding rules Work continues on the full integration of ASN.1 with XML Use of ASN.1 in web services 13

Tool Vendors Adrenta Technologies ATOS Origin France Telecom R&D Nikolaus Computertechnik Objective Systems OSS Nokalva Talura Aps unigone * (according to ASN.1 consortium, ITU-T) 14

Ericsson s TITAN TTCN-3 test executor => Data definition language for protocol testing - Conformance - Interoperability - Load/stress - Regression In my time 15

And now for something completely different Next => Training material, prepare some coffee in the break! Recommended bookmark: http://www.asn1.org/books/a4card.pdf 16

Abstract Syntax introduction *Taken from: Dr. György Réthy, TCC Ericsson 17

Structure of ASN.1 18

Recommended reading John Larmouth, ASN.1 Complete, Elsevier-Morgan Kaufmann, 1999 Downloadable PDF version: http://www.oss.com/asn1/larmouth.html Olivier Dubuisson, ASN.1 - Communication between heterogeneous systems, Elsevier-Morgan Kaufmann, 2000 Downloadable PDF version: http://www.oss.com/asn1/dubuisson.html 19

Contents 1. Basic conventions 2. Built-in ASN.1 types (basics of tagging and extensibility) NULL, BOOLEAN, INTEGER, BIT STRING, OCTET STRING, ENUMERATED, SEQUENCE (OF), SET (OF), CHOICE, Character string types, time types, REAL, ANY & other hole types: EMBEDDED PDV, EXTERNAL, Unrestricted character string 3. Tagging - additions Types of tags, IMPLICIT, EXPLICIT, AUTOMATIC tagging, tagging rules 4. Subtyping & constraints Single value, value range, size constraint, type constraint, permitted alphabet, contained subtype, inner subtyping 5. Extensibility - further rules ASN.1 model of extensions, extension marker, exception identifier, extensibility rules, version brackets 20

Naming conventions -1 21

Naming conventions -2 22

Module definition 23

Contents 1. Basic conventions 2. Built-in ASN.1 types (basics of tagging and extensibility) NULL, BOOLEAN, INTEGER, BIT STRING, OCTET STRING, ENUMERATED, SEQUENCE (OF), SET (OF), CHOICE, Character string types, time types, REAL, ANY & other hole types: EMBEDDED PDV, EXTERNAL, Unrestricted character string 3. Tagging - additions Types of tags, IMPLICIT, EXPLICIT, AUTOMATIC tagging, tagging rules 4. Subtyping & constraints Single value, value range, size constraint, type constraint, permitted alphabet, contained subtype, inner subtyping 5. Extensibility - further rules ASN.1 model of extensions, extension marker, exception identifier, extensibility rules, version brackets 24

NULL, BOOLEAN 25

Integer 26

Bitstring 27

Octetstring 28

Enumerated 29

Enumerated, extension 30

Rules to extension 31

Sequence 32

Tagging example -1 33

When tags shall be distinct 34

Sequence additions 35

Extension of a Sequence 36

Rules for extension 37

Rules for extension 38

Rules for extension 39

Set 40

Set 41

Choice 42

Tagging example 2 43

When tags shall be distinct 44

Choice 45

Version brackets 46

Selection type 47

Sequence of and Set of 48

Object identifiers 49

Real 50

Restricted charstring types 51

Time types 52

Embedded PDV 53

External 54

Contents 1. Basic conventions 2. Built-in ASN.1 types (basics of tagging and extensibility) NULL, BOOLEAN, INTEGER, BIT STRING, OCTET STRING, ENUMERATED, SEQUENCE (OF), SET (OF), CHOICE, Character string types, time types, REAL, ANY & other hole types: EMBEDDED PDV, EXTERNAL, Unrestricted character string 3. Tagging - additions Types of tags, IMPLICIT, EXPLICIT, AUTOMATIC tagging, tagging rules 4. Subtyping & constraints Single value, value range, size constraint, type constraint, permitted alphabet, contained subtype, inner subtyping 5. Extensibility - further rules ASN.1 model of extensions, extension marker, exception identifier, extensibility rules, version brackets 55

Tagging example 3 56

Tagging 57

Tagging 58

Universal class tags 59

Module definition again 60

Contents 1. Basic conventions 2. Built-in ASN.1 types (basics of tagging and extensibility) NULL, BOOLEAN, INTEGER, BIT STRING, OCTET STRING, ENUMERATED, SEQUENCE (OF), SET (OF), CHOICE, Character string types, time types, REAL, ANY & other hole types: EMBEDDED PDV, EXTERNAL, Unrestricted character string 3. Tagging - additions Types of tags, IMPLICIT, EXPLICIT, AUTOMATIC tagging, tagging rules 4. Subtyping & constraints Single value, value range, size constraint, type constraint, permitted alphabet, contained subtype, inner subtyping 5. Extensibility - further rules ASN.1 model of extensions, extension marker, exception identifier, extensibility rules, version brackets 61

Subtyping 62

Subtyping 63

Subtyping 64

Subtyping 65

Subtyping 66

Subtyping 67

Contents 1. Basic conventions 2. Built-in ASN.1 types (basics of tagging and extensibility) NULL, BOOLEAN, INTEGER, BIT STRING, OCTET STRING, ENUMERATED, SEQUENCE (OF), SET (OF), CHOICE, Character string types, time types, REAL, ANY & other hole types: EMBEDDED PDV, EXTERNAL, Unrestricted character string 3. Tagging - additions Types of tags, IMPLICIT, EXPLICIT, AUTOMATIC tagging, tagging rules 4. Subtyping & constraints Single value, value range, size constraint, type constraint, permitted alphabet, contained subtype, inner subtyping 5. Extensibility - further rules ASN.1 model of extensions, extension marker, exception identifier, extensibility rules, version brackets 68

Exeption handling 69

Extension examples 70

Parameterization 71

Parameterization 72

Parameterization 73

Jump to the topic of coding BER Tagging Tag of ASN.1 types Encoding of different types 74

Basics of coding 75

Coding of tag values higher then 30 76

Coding of the length field 77

Coding of the length field 78

When the length is null 79

Encoding of tags 80

Null, Boolean and Enumerated 81

Integer 82

Choice 83

Octetstring 84

Bitstring 85

Sequence (of), Set (of) 86

Obj. ID. 87

Real, base 10 88

Real, base 2 89

Ellipsis 90

Time for some practice 91

Example 1 Given the definition Company ::= SET { name [0] IA5String, zipcode [1] IA5String, CitationType INTEGER, other ANY DEFINED BY CitationType } where the INTEGER value of CitationType can be 0 = INTEGER, 1 = REAL, or 2 BOOLEAN, which of the following values are valid? Assume tagging has been done accurately. 1. CyberReal, 20742-1911, 1, TRUE 2. 60603, Villaland, 0, 500000.00 3. 0, 450, HomeNet 4. SitCom, 1, 70000.00 92

Example 2 A base-ball card value in XML syntax: <BBCard> <name>jorge Posada</name> <team>new York Yankees</team> <age>29</age> <position>c</position> <handedness>right-handed</handedness> <batting-average>0.277</batting-average> </BBCard> Definition in ASN.1 (type and value)? 93

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

ASN.1 value: Solution 2 cont d player1 BBCard ::= { name Jorge Posada, team New York Yankees, age 29, position C, handedness right-handed, batting-average 0.277 } 95

Example 3 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 ; Define in ASN.1 using subtyping/constraints! 96

Solution 3 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 } 97

Example 4 FooProtocol defined using ASN.1: FooProtocol DEFINITIONS ::= BEGIN FooQuestion ::= SEQUENCE { trackingnumber INTEGER, question VisibleString } FooAnswer ::= SEQUENCE { questionnumber INTEGER, answer BOOLEAN } END Example message (PDU): myquestion FooQuestion ::= { trackingnumber 5, question "Anybody there?" } Cookbook: Tags of a SEQUENCE : 30 an INTEGER: 02 a VisibleString: 1a "Anybody there?" in ASCII: 41 6e 79 62 6f 64 79 20 74 68 65 72 65 3f Encode using simple TLV triplets and XER! 98

Solution 4 TLV, 21 octets: 30 13 02 01 05 1a 0e 41 6e 79 62 6f 64 79 20 74 68 65 72 65 3f XER, 108 octets but more readable: <FooQuestion> <trackingnumber>5</trackingnumber> <question>anybody there?</question> </FooQuestion> 99