ASN.1 소개 건아정보기술 SW개발팀 김강민 주임연구원.

Slides:



Advertisements
Similar presentations
Second part needs improvement (encoding, Compilers)
Advertisements

 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
1 Data types, operations, and expressions Overview l Format of a Java Application l Primitive Data Types l Variable Declaration l Arithmetic Operations.
Jump to first page PKI2001 (TIFR, Mumbai) ASN.1 Abstract Syntax Notation One ASN.1 is a standard way to describe a message(a unit application data) that.
Number Systems Lecture 02.
Structured Data Types. Date Types We have seen various data types –Integer, Real, Character, Logical All these types define data values of different kinds.
SNMP: Simple Network Management Protocol
Chapter 2: C Fundamentals Dr. Ameer Ali. Overview C Character set Identifiers and Keywords Data Types Constants Variables and Arrays Declarations Expressions.
Abstract Syntax Notation One ASN.1
ASN.1 CNS 4650 Fall 2004 Rev. 2.
Computers Organization & Assembly Language
A Variable is symbolic name that can be given different values. Variables are stored in particular places in the computer ‘s memory. When a variable is.
Fortran 1- Basics Chapters 1-2 in your Fortran book.
Abstract Syntax Notation Computer Networks courses Villanova University.
Copyright © 2002 W. A. Tucker1 Chapter 7 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
C Tokens Identifiers Keywords Constants Operators Special symbols.
C-Language Keywords(C99)
AUTOMATA THEORY Reference Introduction to Automata Theory Languages and Computation Hopcraft, Ullman and Motwani.
Abstract Syntax Notation ASN.1 Week-5 Ref: “SNMP…” by Stallings (Appendix B)
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
C++ Programming: Basic Elements of C++.
Copyright © 2012 Pearson Education, Inc. Chapter 2: Introduction to C++
Abstract Syntax Notation One ASN.1. Abstract Syntax Notation One  Both the information and communications models need to be specified syntactically and.
An Introduction to Abstract Syntax Notation 1 (ASN.1)
These notes were originally developed for CpSc 210 (C version) by Dr. Mike Westall in the Department of Computer Science at Clemson.
Primitive Variables.
Programming Fundamentals. Today’s Lecture The Conditional Operator Logical Operators Structures Enumerations.
XSD: XML Schema Language Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
Part:2.  Keywords are words with special meaning in JavaScript  Keyword var ◦ Used to declare the names of variables ◦ A variable is a location in the.
Application support functions Chapter Introduction ASN.1 Security Data encryption Nonrepudiation Authentication Public key certification authorities.
BER ENCODING Basic Encoding Rules. Basic Encoding Rules What is it?  BER is the original rules laid out by the ASN.1 standard for encoding information.
1.1 – SETS AND SYMBOLS. Goals SWBAT understand basic set notation and set symbols SWBAT solve simple sentences with a given domain SWBAT graph sets of.
9/21/2016 Presentation layer Abstract Syntax Notation #1 Basic Encoding Rules.
Manajemen Jaringan, Sukiswo ST, MT 1 SNMP Management Information Sukiswo
Jaringan Telekomunikasi, Sukiswo ST, MT Sukiswo
Data Representation COE 308 Computer Architecture
RPR FOM v2.0 Datatype Naming
Definition of the Programming Language CPRL
Programming and Data Structure
Data Representation ICS 233
Lec 3: Data Representation
The Machine Model Memory
Chapter 6 JavaScript: Introduction to Scripting
Data Representation.
The ITU-T X.500 series and X.509 in a changing world
Computer Programming BCT 1113
ASN.1: Introduction Zdeněk Říha.
Presented By: Prof. D.W.Chadwick Other Author: D.Mundy
© 2016 Pearson Education, Ltd. All rights reserved.
Network Management Information model
Variables and Primative Types
Dept. of Computer Science and Engineering
Introduction to Scripting
A Closer Look at Instruction Set Architectures
Data Structures Mohammed Thajeel To the second year students
Session III Chapter 6 – Creating DTDs
Data Representation COE 301 Computer Organization
Copyright © Cengage Learning. All rights reserved.
Chapter 2: Introduction to C++.
Data Representation ICS 233
Session II Chapter 6 – Creating DTDs
C Language B. DHIVYA 17PCA140 II MCA.
Variables in C Topics Naming Variables Declaring Variables
Data Representation COE 308 Computer Architecture
Basic Java structural components
Standards, Models and Language
Presentation transcript:

ASN.1 소개 건아정보기술 SW개발팀 김강민 주임연구원

목 차 개요 ASN.1 필요성 관련 규범 ASN.1 문법 Basic Encoding Rule(BER) Q&A

개 요 ASN.1은 Abstract Syntax Notation One의 약자입니다. 국제전기통신 연합(ITU)에서 네트워크 데이터 교환을 정의한 프로토콜로 X.680 ~ X.699에서 정의하고 있습니다. ASN : Abstract Syntax Notation one. (추상적인 문법 표기 1) ITU : international Telecommunication Union

ASN.1 필요성 Sun과 Windows간 데이터 전송에는 Little endian, Big endian 차이로 인해 데이터 변환이 필요합니다. 1:1이 아니라 N개의 시스템간 통신을 위해서는 이론상 시스템 하나에 N-1개의 데이터 변환기가 필요합니다. 이 부분의 낭비를 줄이기 위해 ASN.1이란 표준을 사용합니다. ASN.1

관련 규범(1/2) ISO 15784 : Intelligent transport systems (ITS) — Data exchange involving roadside modules communication ISO 15784-1 General principles and documentation framework of application profiles ISO 15784-3  Application profile-data exchange (AP-DATEX) KS X ISO 14827 : 교통 정보 및 제어 시스템-ITS를 위한 센터간 데이터 인터페이스 KS X ISO 14827-1 메시지 정의 요구사항. KS X ISO 14827-2 DATEX-ASN KS X ISO : ISO 문서를 번역해서 기술적 내용 및 규격서의 서식을 변경하지 않고 작성한 한국산업규격이다.

관련 규범 (2/2) ※ ITU 참고사항 (2009년 1월) : ITU-T ASN.1 Standards Projects Abstract Syntax Notation One X.680 – Basic Notation X.681 – Information Objects X.682 – General Constraint Notation X.683 – Parameterization X.690 – Basic (BER), Cannoical(CER), and Distinguished (DER) Encoding Rules X.691 – Packed Encoding Rules (PER) Latest X.692 – Encoding Control Notation (ECN) X.693 – XML Encoding Rules (XER)

ASN.1 문법 (1/10) 예제

ASN.1 문법 (2/10) Module Built-in Types Tagged Type assignment Value assignment Built-in Types Simple Type Structured Type Tagged

ASN.1 문법 (3/10) Module (x.680 - 3.6.43) Module definition One or more instances of the use of the ASN.1 notation for type, value, value set, information object class, information object, and information object set (as well as the parameterized variant of those), encapsulated using the ASN.1 module notation Module definition

Assignment lexical Item ASN.1 문법 (4/10) 모듈 분석 Assignment lexical Item Object Identifier (X.660) Module definition Format Type Assignment Module Body Comment (one line)

ASN.1 문법 (5/10) Assignment Type Example InventoryList {1 2 0 0 6 1} DEFINITIONS ::= BEGIN { ItemId ::= SEQUENCE partnumber IA5String, quantity INTEGER, wholesaleprice REAL, saleprice REAL } StoreLocation ::= ENUMERATED Baltimore (0), Philadelphia (1), Washington (2) } END

ASN.1 문법 (6/10) Assignment Value Example gadget ItemId ::= { partnumber "7685B2", quantity 73, wholesaleprice 13.50, saleprice 24.95 }

ASN.1 문법 (7/10) Built-in Type Simple type Simple Type Tag Typical use BOOLEAN 1 Model logical, two-state variable values INTEGER 2 Model integer variable values BIT STRING 3 Model binary data of arbitrary length OCTET STRING 4 Model binary data whose length is a multiple of eight NULL 5 Indicate effective absence of a sequence element OBJECT IDENTIFIER 6 Name information objects REAL 9 Model real variable values ENUMERATE 10 Model values of variables with at least three states CHARACTER STRING * Models values that are strings of characters from a specified characterset Character Sting Type Tag Typical use NumericString 18 0,1,2,3,4,5,6,7,8,9, and space PrintableString 19 Upper and lower case letters, digits, space, apostrophe, left/right parenthesis, plus sign, comma, hyphen, full stop, solidus, colon, equal sign, question mark TeletexString (T61String) 20 The Teletex character set in CCITT's T61, space, and delete VideotexString 21 The Videotex character set in CCITT's T.100 and T.101, space, and delete VisibleString (ISO646String) 26 Printing character sets of international ASCII, and space IA5String 22 International Alphabet 5 (International ASCII) GraphicString 25 All registered G sets, and space 27 All registered C and G sets, space and delete

ASN.1 문법 (8/10) Built-in Type Structured type Structured Type Tag Typical Use SEQUENCE 16 Models an ordered collection of variables of different type SEQUENCE OF Models an ordered collection of variables of the same type SET 17 Model an unordered collection of variables of different types SET OF Model an unordered collection of variables of the same type CHOICE * Specify a collection of distinct types from which to choose one type SELECTION Select a component type from a specified CHOICE type ANY Enable an application to specify the type Note: ANY is a deprecated ASN.1 Structured Type. It has been replaced with X.680 Open Type.

ASN.1 문법 (9/10) Tagged Example a) seats SET { maximum [APPLICATION 0] INTEGER, occupied [APPLICATION 1] INTEGER, vacant [APPLICATION 2] INTEGER } b) seats SET maximum [APPLICATION 0] IMPLICIT INTEGER, occupied [APPLICATION 1] IMPLICIT INTEGER, vacant [APPLICATION 2] IMPLICIT INTEGER c) seats SET maximum [0] INTEGER, occupied [1] INTEGER, vacant [2] INTEGER The APPLICATION class distinguishes data types that have a wide, scattered use within a particular presentation context. PRIVATE distinguishes data types within a particular organization or country. CONTEXT-SPECIFIC distinguishes members of a sequence or set, the alternatives of a CHOICE, or universally tagged set members. Only the class number appears in braces for this data type; the term COONTEXT-SPECIFIC does not appear.

ASN.1 문법 (10/10) Lexical Items Comment Range separator : “..” a "comment" begins with a pair of adjacent hyphens, it shall end with the next pair of adjacent hyphens or at the end of the line. Ex) // comment one line a "comment" begins with "/*", it shall end with a corresponding "*/", whether this "*/" is on the same line or not. Ex) /* comment with several lines */ Range separator : “..” Assignment lexical item : “::=“ bstring : 0,1로 구성되며 끝에 ‘B를 붙인다. Ex) ‘0100101’B hstring : 0,1,2..F로 구성되며 끝에 ‘H를 붙인다. Ex) ‘AB019’H

Basic Encoding Rule(BER) (1/5) The encoding of a data value shall consist of four components which shall appear in the following order a) identifier octets b) length octets c) contents octets d) end-of-contents octets

Basic Encoding Rule(BER) (2/5) Structure of an encoding end-of-contents은 반드시 존재해야 하는 것은 아니다. Identifier octets Length octets Contents octets End-of-contents octets

Basic Encoding Rule(BER) (3/5) Identifier Octet Length Octet Short length the length octets shall consist of a single octet in which bit 8 is zero and bits 7 to 1 encode the number of octets in the contents octets (which may be zero), as an unsigned binary integer with bit 7 as the most significant bit. L = 38 can be encoded as 001001102 Long length a) bit 8 shall be one; b) bits 7 to 1 shall encode the number of subsequent octets in the length octets, as an unsigned binary integer with bit 7 as the most significant bit c) the value 111111112 shall not be used. L = 201 can be encoded as: 100000012 110010012

Basic Encoding Rule(BER) (4/5) Contents octets The contents octets shall consist of zero, one or more octets, and shall encode the data value as specified End-of-contents octets The end-of-contents octets shall be present if the length is encoded as specified

Basic Encoding Rule(BER) (5/5) 예제 SEQUENCE의 L 부분은 element 인 First와 Second의 길이를 모두 나타낸다. Seq ::= SEQUENCE { first INTEGER, second INTEGER } seqVa1 Seq ::= { 10, 20 } Tag Length Value SEQUENCE V의 길이* INTEGER V의 길이 10 20

Q & A