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



Similar documents
INTERNATIONAL TELECOMMUNICATION UNION

System and Network Management

INTERNATIONAL TELECOMMUNICATION UNION

SNMP SMI Structure of Management Information

Prepared By: P Lichen. P Xulu

Network Management (NETW-1001)

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

Simple Network Management Protocol

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

SNMP and Network Management

INTERNATIONAL TELECOMMUNICATION UNION

A Brief Introduction to Internet Network Management and SNMP. Geoff Huston NTW Track 4

TELE 301 Network Management

INTERNATIONAL TELECOMMUNICATION UNION

SNMP Basics BUPT/QMUL

SNMP. Simple Network Management Protocol

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

Security Issues of the Digital Certificates within Public Key Infrastructures

Outline of the SNMP Framework

Introduction to Simple Network Management Protocol (SNMP)

Network Management. What is network management?

Simple Network Management Protocol SNMP

Chapter 9 Network Management

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

Detailed Specifications

NISTIR 7676 Maintaining and Using Key History on Personal Identity Verification (PIV) Cards

Advanced Security Mechanisms for Machine Readable Travel Documents and eidas Token

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

SIMPLE NETWORK MANAGEMENT PROTOCOL (SNMP)

Network Management & Monitoring Introduction to SNMP

ETSI TS V1.1.1 ( )

Chapter 9 Network Management

Network Monitoring & Management Introduction to SNMP

Introduction Network Management Framework Structure of Management Information Names Instances Syntax...

Lecture 5: Foundation of Network Management

RaneNote SNMP: SIMPLE? NETWORK MANAGEMENT PROTOCOL

ITU-T Q.812. Amendment 3 (02/00) Protocol profile for electronic communications interactive agent Amendment 3:

Using SNMP for Remote Measurement and Automation

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

Network Management & Monitoring Introduction to SNMP

Simple Network Management Protocol

PA160: Net-Centric Computing II. Network Management

Dave Perkins. September, SNMP MIB User,

Brocade Product Training

MODULE 1 MODULE 2. Contents. Unit 1: UNIT 1. Network Management Fundamentals

Network Working Group. Category: Informational Internet Mail Consortium B. Ramsdell Worldtalk J. Weinstein Netscape March 1998

A New On-line Certificate Validation Method using LDAP Component Matching Technology

X.500 and LDAP Page 1 of 8

This Lecture. NWEN 403 Advanced Network Engineering. Network Management. Outline. Network management. Qiang Fu

SNMP Simple Network Management Protocol

Biometrics, Tokens, & Public Key Certificates

TechNote 0006: Digital Signatures in PDF/A-1

encoding compression encryption

Interoperability Guidelines for Digital Signature Certificates issued under Information Technology Act

Section 4: Interim Local Management Interface Specification

SNMP -overview. Based on: W.Stallings Data and Computer Communications

Simple Network Management Protocol

Request for Comments: Category: Experimental NSA February 2000

The ABCs of SNMP. Info Sheet. The ABC of SNMP INTRODUCTION. SNMP Versions

Introduction to Web Services

OSI Protocols. Background. Technology Basics. Media Access CHAPTER

Vanguard Applications Ware Basic Protocols. SNMP/MIB Management

Network Management. Network management definition? Network Management. Network management definition? Copyright and acknowledgments

Network Management. Network Management. Copyright and acknowledgments. Acknowledgements. Pag. 1

Network Management. Copyright and acknowledgments

CSI 333 Lecture 1 Number Systems

TÓPICOS AVANÇADOS EM REDES ADVANCED TOPICS IN NETWORKS

(Refer Slide Time: 1:17-1:40 min)

SNMP, CMIP based Distributed Heterogeneous Network Management using WBEM Gateway Enabled Integration Approach

Configuring CitectSCADA SNMP projects with MIB2CIT. A reference for CitectSCADA Customers

[MS-FAX]: Fax Server and Client Remote Protocol. Intellectual Property Rights Notice for Open Specifications Documentation

SNMP Agent Plug-In Help Kepware Technologies

, SNMP, Securing the Web: SSL

Instruction Set Architecture (ISA)

INTERNET MANAGEMENT PROTOCOLS TUTORIAL STOCKHOLM, SWEDEN 29 OCTOBER 1999 AIKO PRAS UNIVERSITY OF TWENTE THE NETHERLANDS

Advantech WebAccess Device Driver Guide. BwSNMP Advantech WebAccess to SNMP Agent (Simple Network Management Protocol) Device Driver Guide

TECHNICAL NOTES. Technical Notes P/N REV A01. EMC ITOI VoIP Management Suite 8.1. May, 2012

mod_ssl Cryptographic Techniques

ATSC Standard: ATSC Security and Service Protection Standard

2.1 The scope of Time Stamping Protocol (TSP)

Institute of Computer and Communication Engineering, National Cheng Kung University Mid-Term Exam of the Network Management course

CHAPTER THREE, Network Services Management Framework

What is it? SNMP. Agenda. Four Basic Elements

Sponsored by the Alliance for Telecommunications Industry Solutions. Generic Guidelines for the use of TCP/IP in Electronic Bonding

Network Management. New York Institute of Technology CSCI 690 Michael Hutt

QoS: CBQoS Management Policy-to- Interface Mapping Support Configuration Guide, Cisco IOS XE Release 3S (Cisco ASR 1000)

This document describes the Livingston implementation of the Simple Network Management Protocol (SNMP) and includes the following topics:

Text Book: Computer Networking: A Top Down Approach Featuring the Internet 3rd edition, by Jim Kurose and Keith Ross, Addison-Wesley

BEA WebLogic Server. and BEA WebLogic Express. SNMP Management Guide

ITEC310 Computer Networks II

How To Configure Voice Vlan On An Ip Phone

SNMP Reference Manual

ETSI TS V1.1.1 ( ) Technical Specification

Presented by Aurang Zeb 14CS-03. Network Management System

Internet infrastructure. Prof. dr. ir. André Mariën

Chapter 7D The Java Virtual Machine

Package PKI. July 28, 2015

Common Security Protocol (CSP) ACP 120. June 1998

NEMA Standards Publication PS 3 Supplement 41. Digital Imaging and Communications in Medicine (DICOM) Digital Signatures

Monitoring Oracle WebLogic Server with SNMP 12c (12.2.1)

Transcription:

Kommunikationssysteme (KSy) - Block 7 Abstract Syntax Notation One ASN.1 Dr. Andreas Steffen 2000-2002 A. Steffen, 22.01.2002, KSy_ASN1.ppt 1 ASN.1 Abstract Syntax Notation One Standards and applications using ASN.1 Abstract syntax and transfer syntax Simple types basic types, character string types Date and time types Type definitions Subtype definitions Value Assignments Object identifier type (OID) Structured types sequence, set Context-specific tags BER Basic Encoding Rules Type length value rule Type tags Encoding of identifier field Encoding of tag classes Encoding of tag numbers Encoding of length field Encoding of integers Encoding of sequences Encoding of object identifiers Alternative encoding rules PER, DER, CER

Standards and Applications using ASN.1 X.400 Message Handling System / X.500 Directory Services LDAP based Directories / X.509 Digital Certificates RSA Public Key Cryptography Standards Storage and Transmission of Keys / Certificates (PKCS #12) Secure Electronic Transaction (SET) Visa / Mastercard H.323 / T.120 Multimedia Communication Standards Definition and Exchange of Multimedia Terminal Capabilities Telecommunications Management Network (TMN) Performance / Fault and Configuration Management Information Unicode Worldwide Character Standard Universal 16-bit Character Set comprising all written languages Simple Network Transfer Protocol (SNMP) Management Information Base (MIB) / SNMP PDUs A. Steffen, 22.01.2002, KSy_ASN1.ppt 2 Source: OSS Nokalva, http://www.oss.com/asn1/usage.html

The OSI Approach: Abstract Syntax and Transfer Syntax User User User Presentation Mapping Local Mapping Local Storage Application Component Encoding Rules Abstract Syntax Application Component Encoding Rules Local Mapping Local Storage Data Transfer Component Transfer Syntax Data Transfer Component A. Steffen, 22.01.2002, KSy_ASN1.ppt 3 Abstract Syntax An abstract syntax provides a set of formal rules for describing the structure of objects independent of both the user presentation and the machine-specific encoding techniques used for storage and transmission of the objects. Transfer Syntax The transfer syntax is the actual representation of data as it is transmitted over a network. Often data is represented by a stream of octets. Encoding Rules Encoding rules define the mapping of the abstract syntax used to represent data objects into the transfer syntax used to transmit the objects over a physical transmission channel.

Abstract Syntax Notation and Encoding Rules ASN.1 - Abstract Syntax Notation One ITU-T X.680 / ISO 8824-1 (1997) obsoletes ITU-T X.208 BER - Basic Encoding Rules of ASN.1 ITU-T X.690 / ISO 8825-1 (1997) obsoletes ITU-T X.209 A. Steffen, 22.01.2002, KSy_ASN1.ppt 4 Abstract Syntax Notation One ASN.1 is especially well suited for the representation of the complex, variable and extensible data structures used in modern communications applications. Basic Encoding Rules of ASN.1 BER encodes ASN.1 objects into a series of octet strings that can be transmitted over an octet oriented communications channel

ASN.1 Simple Types I Basic Types BOOLEAN INTEGER ENUMERATED REAL BIT STRING OCTET STRING Character String Types (various subsets of ISO 10646-1) NumericString (0-9,<space>) PrintableString (0-9,A-Z,a-z,<space>,<special>) VisibleString GraphicString TeletexString UTF8String IA5String A. Steffen, 22.01.2002, KSy_ASN1.ppt 5

ASN.1 Simple Types II Object Types OBJECT IDENTIFIER ObjectDescriptor Miscellaneous Types NULL UTCTime yymmdd hhmm[ss] <local offset from UTC> GeneralizedTime yyyymmdd hhmm[ss] <local offset from UTC> A. Steffen, 22.01.2002, KSy_ASN1.ppt 6 NULL The NULL type denotes a null value. OBJECT IDENTIFIER The OBJECT IDENTIFIER type denotes an object identifier, a sequence of integer components that identifies an object such as an algorithm, an attribute type, or perhaps a registration authority that defines other object identifiers. An OBJECT IDENTIFIER value can have any number of components, and components can generally have any nonnegative value. UTCTime yy = 50..99 : 1950-1999 yy = 00..49 : 2000-2049 GeneralizedTime Mandatory starting with the year 2050

ASN.1 Type Definitions Syntax: <type name> ::= <type> Examples: Counter ::= INTEGER IpAddress ::= OCTET STRING Months ::= ENUMERATED {january (1), february (2), march (3), april (4), may (5), june (6), july (7), august (8), september (9), october (10), november (11), december (12)} A. Steffen, 22.01.2002, KSy_ASN1.ppt 7

ASN.1 Subtype Definitions Syntax: <subtype name> ::= <type> ( <constraint> ) Examples: Counter ::= INTEGER ( 0..4294967295 ) IpAddress ::= OCTET STRING ( SIZE(4) ) Spring ::= Months ( march april may ) Summer ::= Months ( june july august ) SmallPrime ::= INTEGER ( 2 3 5 7 11 ) ExportKey ::= BIT STRING ( SIZE(40) ) A. Steffen, 22.01.2002, KSy_ASN1.ppt 8

ASN.1 Value Assignments I Syntax: <value name> <type> ::= <value> Examples: ipinreceives Counter ::= 2450 iproutemask IpAddress ::= 'FFFFFF00'H currentmonth Months ::= february currenttime UTCTime ::= "000204075015+0100" givenname VisibleString ::= "Andreas" married BOOLEAN ::= TRUE faxmessage BIT STRING ::= '01100001101'B encryptionkey ExportKey ::= 'A1B2C3D4E5'H A. Steffen, 22.01.2002, KSy_ASN1.ppt 9

ASN.1 Value Assignments II OBJECT IDENTIFIER root ccitt(0) iso(1) joint-iso-ccitt(2) org(3) internet(1) dod(6) mgmt(2) mib-2(1) experimental(3) private(4) enterprise(1) internet OBJECT IDENTIFIER ::= { iso(1) org(3) dod(6) 1 } private OBJECT IDENTIFIER ::= { internet 4 } A. Steffen, 22.01.2002, KSy_ASN1.ppt 10 Hierarchical Tree Structure ASN.1 object identifiers are organized in a hierarchical tree structure to make it possible to give any object a unique global identifier. SNMP Objects The official SNMP objects defined by various RFCs are attached below the node { iso(1) org(3) dod( 6) internet(2) mgmt(1) } Enterprise specific SNMP objects are attached below the node { iso(1) org(3) dod( 6) internet(2) private(4) enterprise(1) } SNMP OIDs of some well-known enterprises IBM: { enterprises 2 } Cisco: { enterprises 9 } Hewlett-Packard: { enterprises 11 } Sun Microsystems: { enterprises 42 } Microsoft: { enterprises 311 } Intel: { enterprises 343 } Security OIDs of some well-known enterprises Sun Microsystems: { iso(1) member-body(2) US(840) 113536 } RSA Data Security Inc: { iso(1) member-body(2) US(840) 113549 } Microsoft: { iso(1) member-body(2) US(840) 113556 } Netscape: { joint-iso-ccitt (2) country (16) usa (840) org (1) 113730 } Verisign: { joint-iso-ccitt (2) country (16) usa (840) org (1) 113733 } Intel: { joint-iso-ccitt (2) country (16) usa (840) org (1) 113741 }

ASN.1 Structured Types I SEQUENCE Use: Collection of a moderate number of variables that may be of different type and whose order is significant. Type Definition: UserAccount ::= SEQUENCE { username VisibleString, password VisibleString, accountnr INTEGER } Value Assignment: myaccount UserAccount ::= { username "steffen", password "jane51", accountnr 4711 } A. Steffen, 22.01.2002, KSy_ASN1.ppt 11

ASN.1 Structured Types II SEQUENCE OF Use: Collection of a large number of variables of the same type and whose order is significant. Type Definition: MemberCountries ::= SEQUENCE OF VisibleString AccountRegistry ::= SEQUENCE OF UserAccount Value Assignment: eumembers MemberCountries ::= { "Austria", "Belgium", "Denmark", "Finland", "France", "Germany", "Greece", "Ireland", "Italy", "Luxembourg", "The Netherlands", "Portugal", "Spain", "Sweden", "United Kingdom"} A. Steffen, 22.01.2002, KSy_ASN1.ppt 12

ASN.1 Structured Types III SET Use: Collection of a moderate number of variables that may be of different type and whose order is insignificant. Type Definition: UserAccount ::= SET { username [0] VisibleString, context-specific tags password [1] VisibleString, or automatic tagging accountnr [2] INTEGER } Value Assignment: myaccount UserAccount ::= { accountnr 4711, username "steffen", password "jane51" } A. Steffen, 22.01.2002, KSy_ASN1.ppt 13 Context-Specific Tags Since they can occur in arbitrary order, the members of a set need tags in order to uniquely identify them. Tags can either be defined explicitly by the system designer or are assigned automatically by the ASN.1 parser if the automatic tagging option is used.

ASN.1 Structured Types IV SET OF Use: Collection of variables that are the same type and whose order is insignificant. Type Definition: Keywords ::= SET OF VisibleString Value Assignment: someasn1keywords Keywords ::= {"INTEGER", "BOOLEAN", "REAL"} A. Steffen, 22.01.2002, KSy_ASN1.ppt 14

Kommunikationssysteme (KSy) - Block 7 Basic Encoding Rules of ASN.1 BER A. Steffen, 22.01.2002, KSy_ASN1.ppt 15

General Encoding Rule for ASN.1 Values Type - Length - Value Identifier Field Length Field Contents Field 1. Primitive, definite-length encoding simple types 2. Constructed, definite-length encoding structured types (SEQUENCE[OF], SET[OF]) 3. Constructed, indefinite-length encoding structured types (SEQUENCE[OF], SET[OF]) A. Steffen, 22.01.2002, KSy_ASN1.ppt 16

ASN.1 Type Tags I Universal Class Tags UNIVERSAL 1 BOOLEAN UNIVERSAL 2 -UNIVERSAL basic types 3 BIT STRING UNIVERSAL 4 UNIVERSAL 9 REAL UNIVERSAL 10 INTEGER OCTET STRING ENUMERATED UNIVERSAL 6 - object types UNIVERSAL 7 - character string types UNIVERSAL 5 NULL -UNIVERSAL miscellaneous 23 UTCTime types - structured types OBJECT IDENTIFIER ObjectDescriptor UNIVERSAL 26 VisibleString... UNIVERSAL 24 GeneralizedTime UNIVERSAL 16 SEQUENCE [OF] UNIVERSAL 17 SET [OF] A. Steffen, 22.01.2002, KSy_ASN1.ppt 17

ASN.1 Type Tags II Application Class Tags Explicit Tagging: (strong type checking) IpAddress ::= [APPLICATION 0] OCTET STRING (SIZE(4)) Counter ::= [APPLICATION 1] INTEGER (0..4294967295) Implicit Tagging: (shorter encoding) IpAddress ::= [APPLICATION 0] IMPLICIT -- RFC 1155 OCTET STRING (SIZE(4)) Counter ::= [APPLICATION 1] IMPLICIT -- RFC 1155 INTEGER (0..4294967295) A. Steffen, 22.01.2002, KSy_ASN1.ppt 18

BER Encoding of Identifier Field I Tag numbers < 31 Identifier Octet Bits 8 7 6 5 4 3 2 1 Class P/C Tag number 0 = Primitive 1 = Constructed 0 0 = Universal 0 1 = Application 1 0 = Context-specific 1 1 = Private A. Steffen, 22.01.2002, KSy_ASN1.ppt 19

BER Encoding of Identifier Field II Tag numbers 31 Leading octet 2nd octet Last octet Class P/C 1 1 1 1 1 1... 1 0 + +... + = Tag number A. Steffen, 22.01.2002, KSy_ASN1.ppt 20

BER Encoding of Length Field Short definite form ( L < 128 octets) one octet L octets 0 Length L Contents field Long definite form ( 128 L < 2 1008 octets) first octet K octets L octets 1 K Length L Contents field Indefinite form; content field terminated by EOC one octet two octets 1 0 0 0 0 0 0 0 Contents field EOC '0000'H A. Steffen, 22.01.2002, KSy_ASN1.ppt 21 Short definite form Used either for primitive or constructed types with content lengths smaller than 128 octets. Long definite form Used either for primitive or constructed types with content lengths usually equal or greater than 128 octets. Indefinite form Used for constructed types only. The end-of-contents octets (EOC) can be considered as the encoding of a value whose tag is universal class, whose form is primitive, whose tag number is zero, and whose contents are absent, i.e. it has zero length.

BER Encoding Examples I INTEGER Type Length Value yesterday INTEGER ::= 127 02 01 7F today INTEGER ::= 128 02 02 00 80 00 0 00010 two s complement UNIVERSAL P 2 DayOfYear ::= [APPLICATION 17] IMPLICIT INTEGER today DayOfYear ::= 128 51 02 00 80 01 0 10001 APPLICATION P 17 A. Steffen, 22.01.2002, KSy_ASN1.ppt 22 BER coding of two s complement integers -129: 1111 1111 0111 1111 = 02 02 FF 7F -128: 1111 1111 1000 0000 = 02 01 80-127: 1111 1111 1000 0001 = 02 01 81-1: 1111 1111 1111 1111 = 02 01 FF 0: 0000 0000 0000 0000 = 02 00 1: 0000 0000 0000 0001 = 02 01 01 127: 0000 0000 0111 1111 = 02 01 7F 128: 0000 0000 1000 0000 = 02 02 00 80 129: 0000 0000 1000 0001 = 02 02 00 81

BER Encoding Examples II SEQUENCE Birthday ::= SEQUENCE { name VisibleString, day DayOfYear } mybirthday Birthday ::= { name "Jane", day 128 } UNIVERSAL 16 00 1 10000 Type Definition Value Assignment Birthday Length Contents BER Encoding 30?? 0A VisibleString Length Contents 1A 04 "Jane" DayOfYear Length Contents 51 02 00 80 A. Steffen, 22.01.2002, KSy_ASN1.ppt 23

BER Encoding Examples III OBJECT IDENTIFIER enterprise OBJECT IDENTIFIER ::= {iso(1) org(3) dod(6) internet(1) private(4) 1} X Y Z = 40 X + Y 43 6 1 4 1 0 0 0 0 0 06 05 2B 06 01 04 01 A. Steffen, 22.01.2002, KSy_ASN1.ppt 24 Coding of OID Root ccitt(0): Z = Y { 0..39} iso(1): Z = 40 + Y {40..79} joint-isi-ccitt(2): Z = 80 + Y {80..119} Coding of OID node numbers Similar coding as tag numbers in identifier field Range {0..127}: 0xxx xxxx Range {128..16383}: 1xxx xxxx 0xxx xxxx Range {16384..2097151}: 1xxx xxxx 1xxx xxxx 0xxx xxxx

Alternative Encoding Rules Packed Encoding Rules (PER) Very compressed encoding based on ASN.1 subtype information. Example: subtype INTEGER (998..1001) is encoded using two bits only. Used e.g. in H.323 multimediastandard. Distinguished Encoding Rules (DER) Subset of BER that gives exactly one way to represent any ASN.1 value. Used e.g. in X.509 certificates where computation of digital hash sums must be unique. Uses definite-length encoding. Canonical Encoding Rules (CER) Subset of BER that gives exactly one way to represent any ASN.1 value but based on indefinite-length encoding. A. Steffen, 22.01.2002, KSy_ASN1.ppt 25