Presentation is loading. Please wait.

Presentation is loading. Please wait.

ASN.1 CNS 4650 Fall 2004 Rev. 2.

Similar presentations


Presentation on theme: "ASN.1 CNS 4650 Fall 2004 Rev. 2."— Presentation transcript:

1 ASN.1 CNS 4650 Fall 2004 Rev. 2

2 What is ASN.1 Abstract Syntax Notation One
Overcome how different computer systems transmit data Model parameters exchanged between application entities

3 Why ASN.1? What was available at the time Different hardware
Different development languages

4 “Endian” Problem Taken from Gulliver’s Travels
Whether eggs should be broken on top or bottom “Little Endian” refers to machines that read bytes right to left (Intel) “Big Endian” refers to machines that read bytes left to right (Motorola, IBM, SUN) Data cannot be transferred directly between the two Tanenbaum’s Stegosaurus” Tanenbaum’s stegosaurus when transferred directly between endian machine ended up with a very wild name and was 167,772 meters!

5 How to Solve the “Endian” Problem
Marshalling of data Single “Syntax” Solutions today CORBA ASN.1 Java and .Net (kind of…)

6 Development Languages
Languages do not all contain the same data types For instance C does not really have a boolean it is usually simulated C requires ‘\0’ to terminate a string, this is not always the case in other languages Without “standard” types who has to manipulate the data? The sender or receiver? Note that C and other languages share many of the same data types today. But that was not the case in former times. For instance the C string is somewhat of a de facto standard for most languages or at least the ability to produce a C style string. This was not always the case.

7 Backus-Naur Format (BNF)
Formal way to describe formal languages Most often used to describe computer languages Designed to be unambiguous

8 Built-in Language Types
Boolean Integer Octet string Null Sequence Set Many more

9 Built-in Syntax Definitions
IA5 String Numeric String UTC Time Printable String IA5 String is International Alphabet No.5 String Printable string is a string that is printable from a Telex (old…very old) UTC is Universal Time Coordinate

10 BNF Examples Begin with general then to specifics Uses := { } [ ] |
:= is the left must be replaced by the right { } [ ] is for formating and grouping | is for “or”

11 BNF ASN.1 Example File := SEQUENCE { Owner Owner,
fileName PrintableString, createDate UTCTime, contents Any } Owner := SEQUENCE { personalName IA5String, organizationalName IA5String } Owner is described by the Owner structure below the the file structure

12 Encoding Rules Basic Encoding Rules (BER)
Distinguished Encoding Rules (DER) Canonical Encoding Rules (CER) Packet Encoding Rules (PER) Discuss first two. The others are for information.

13 Basic Encoding Rules (BER)
Represent ASN.1 values as an octect string Three encoding methods\ Primitive, definite length Constructed, definite length Constructed, indefinite length Simple non-string types employ the primitive, definite-length method; structured types employ either of the constructed methods; and simple string types employ any of the methods, depending on whether the length of the value is known.

14 BER Parts TLV Tag octet Length octet Value octet

15 Distinguished Encoding Rules (DER)
Subset of BER Exactly one way to represent the octet string Restricts certain types (BIT STRING) beyond BER Used for digital certificates

16 ASN.1 and OIDs Used by LDAP, Kerberos, and SNMP
Value used to uniquely identify every objectclass and attribute Object Indentifer (OID) is same as ASN.1

17 OIDs Sub-arc No standard on how to delegate number after arc
Example: No standard on how to delegate number after arc De-facto standard is to place all objectclasses under a sub-arc and all attributes under a separate sub-arc

18 How to read ASN.1 Numbers


Download ppt "ASN.1 CNS 4650 Fall 2004 Rev. 2."

Similar presentations


Ads by Google