SlideShare uma empresa Scribd logo
1 de 39
ASN.1 
Tomado de: http://www.obj-sys. 
com/asn1tutorial/asn1only.html
Purpose of ASN.1 
ASN.1 is a fundamental tool for use by 
applications. It provides the ability to describe 
the information that will be exchanged 
independent of the way that information is 
represented on each of the communicating 
systems
Modules 
The fundamental unit of ASN.1 is the module. 
The sole purpose of a module is to name a 
collection of type definitions and/or value 
definitions (assignments) that constitute a data 
specification. 
A type definition is used to define and name a 
new type by means of a type assignment and a 
value definition is used to define and name a 
specific value, when it is necessary, by means of 
a value assignment.
Modules 
Module reference optional object identifier 
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
Type Assignment 
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 
Type reference (name of the type) 
Component value
Value Assignment 
A value assignment consists of a value reference 
(the name of the value), the type of the value, ::= 
(``is assigned the value''), and a valid value 
notation. 
gadget ItemId ::= { 
partnumber "7685B2", quantity 73, 
wholesaleprice 13.50, 
saleprice 24.95 ) 
defines ``gadget" as a value of type ``ItemId".
Built-in Types 
ASN.1 has built-in types that are simple and 
structured. Structured types are composed of 
component types, each of which is a simple or 
structured type. A user-defined type is 
composed of simple and structured types. 
ASN.1 also has another category of types called 
useful, which provide standard definitions for a 
small number of commonly used types.
Simple Types 
ASN.1 has built-in types that are simple and 
structured. Structured types are composed of 
component types, each of which is a simple or 
structured type. A user-defined type is c 
ASN.1 also has another category of types called 
useful, which provide standard definitions for a 
small number of commonly used types. 
omposed of simple and structured types.
Simple Types 
Type BOOLEAN takes values TRUE and FALSE. 
Usually, the type reference for BOOLEAN 
describes the true state. 
For example: 
Female ::= BOOLEAN 
is preferable to 
Gender ::= BOOLEAN.
Simple Types 
Type INTEGER takes any of the infinite set of integer 
values. It has an additional notation that names some of 
the possible values of the integer. For example, 
ColorType ::= INTEGER { 
red (0) 
white (1) 
blue (2) } 
indicates that the ``ColorType" is an INTEGER and its 
values 0, 1, and 2 are named ``red", ``white", and ``blue", 
respectively. The ColorType could also have any of the 
other valid integer values, such as 4 or -62.
Simple Types 
Type BIT STRING takes values that are an ordered 
sequence of zero or more bits. The bit sequence is either 
a binary or hexadecimal string delimited by single quotes 
followed by B or H, respectively. 
Occupation ::= BIT STRING{ 
clerk (0) 
editor (1) 
artist (2) 
publisher (3) } 
names the first bit ``clerk", the second bit ``editor", and 
so on. 
(editor, artist) and '0110'B are two representations for the 
same value of ``Occupation".
Simple Types 
• Type OCTET STRING takes values that are an 
ordered sequence of zero or more eight-bit 
octets. 
• The sequence is written in the same form as a 
BIT STRING sequence. 
• Thus, `1101000100011010'B and `82DA'H are 
valid values of OCTET STRING.
Simple Types 
• Type OBJECT IDENTIFIER names information 
objects (for example, abstract syntaxes or 
ASN.1 modules). 
• A list of positive numbers, enclosed in braces 
and ordered by level starting from the root, 
uniquely identifies an information object at a 
node of the tree. This ordered list of positive 
numbers delimited by braces is the value 
notation for type OBJECT IDENTIFIER.
Simple Types
Simple Types 
Type REAL takes values that are the machine 
representation of a real number, namely the 
triplet (m, b, e), where m is the mantissa (a 
signed number), b the base (2 or 10), and e the 
exponent (a signed number). 
For example, the representation of the value 
3.14 for the variable Pi, declared as 
Pi ::= REAL, 
can be 
(314, 10, -2).
Simple Types 
Type ENUMERATED is similar to the INTEGER 
type, but names specific values only. 
ColorType ::= ENUMERATED { 
red (0) 
white (1) 
blue (2) } 
ColorType can take only the values specifically in 
the list;
Simple Types 
Type CHARACTER STRING takes values that are 
strings of characters from some defined (ISO- or 
CCITT-registered) character set. 
if Address is of type PrintableString, then 
``Villanova, PA 19085'' is an Address value.
Structured Types 
Type SEQUENCE is an ordered list of zero or more 
component types. The type notation requires braces 
around the list and permits a local identifier preceding 
the list to act as the name of the sequence type. 
There are two ways to specify that a component type is 
optional in the ordered list: using OPTIONAL after the 
component type and using DEFAULT followed by a value 
after the component type. When DEFAULT is used, the 
specified value is assumed whenever the type is absent 
from the list. Any of the component types can be an 
embedded sequence, in which case COMPOSED OF 
precedes the embedded sequence.
Structured Types 
The value notation for each sequence type is the list 
of component values within braces. 
{ airline "American", 
flight "1106", 
seats { 320, 107, 213 }, 
airport { origin "BWI", destination "LAX" }, 
crewsize 10 } 
or 
{ "American", "1106", { 320, 107, 213 }, { "BWI", 
"LAX" }, 10 } 
represent the same instance of the sequence type
Structured Types 
The value notation for each sequence type is the list 
of component values within braces. 
{ airline "American", 
flight "1106", 
seats { 320, 107, 213 }, 
airport { origin "BWI", destination "LAX" }, 
crewsize 10 } 
or 
{ "American", "1106", { 320, 107, 213 }, { "BWI", 
"LAX" }, 10 } 
represent the same instance of the sequence type
Structured Types 
AirlineFlight ::= SEQUENCE { 
airline IA5String, 
flight NumericString, 
seats SEQUENCE { 
maximum INTEGER, 
occupied INTEGER, 
vacant INTEGER }, 
airport SEQUENCE { 
origin IA5String, 
stop1 [0] IA5String OPTIONAL, 
stop2 [1] IA5String OPTIONAL, 
destination IA5String }, 
crewsize ENUMERATED { six (6), eight (8), ten (10) }, 
cancel BOOLEAN DEFAULT FALSE }.
Structured Types 
Two components, Stop1 and Stop2 of the 
sequence type airport are tagged with the 
context-specific tags [0] and [1] to avoid 
ambiguity due to consecutive optional 
components not having distinct types. Without 
the tags, the definition of airport would be 
invalid in ASN.1.
Structured Types 
Type SEQUENCE OF is similar to SEQUENCE, 
except that all values in the ordered list must be 
of the same type.
Structured Types 
Type SET takes values that are unordered lists of 
component types. The type and value notations for SET 
are similar to SEQUENCE, except that the type of each 
component must be distinct from all others and the 
values can be in any order 
{"Maggie", 4, TRUE} {TRUE, "Maggie", 4} {4, 
TRUE,"Maggie"} 
are three representations of the same instance of 
Person ::= SET { 
name IA5String, 
age INTEGER, 
female BOOLEAN }.
Structured Types 
Type SET OF takes values that are unordered 
lists of a single type.
Structured Types 
Type CHOICE takes one value from a specified list of 
distinct types.. The value notation is that for the 
type chosen. For example, each of the three values, 
(1) nothing TRUE, (2) car "Lincoln", (3) cash 25000 
is a valid instance of 
Prize ::= CHOICE { 
car IA5String, 
cash INTEGER, 
nothing BOOLEAN }.
Structured Types 
Type SELECTION enables the user to choose a 
component type from a specified CHOICE type. The 
less than symbol ``<" must precede the name of the 
CHOICE type. 
Winner ::= SEQUENCE { 
lastName VisibleString, 
ssn VisibleString, 
cash < Prize } 
with value notation 
{ lastName `AUSTING', ssn `222334444', cash 5000 }
Structured Types 
Type ANY, without further specification, is 
incomplete. It must be supplemented by any 
valid ASN.1 type . The value notation for the 
type notation ANY is the specified type followed 
by its value.
Structured Types 
{ author "Shakespeare", reference IA5String 
"ISBN0669123757" } 
and 
{ author "Shakespeare", reference INTEGER 1988 
} 
are two possible values of 
TextBook ::= SEQUENCE { 
author IA5String, 
reference ANY }
Structured Types 
Type TAGGED is used to enable the receiving 
system to correctly decode values from several 
datatypes that a protocol determines may be 
transmitted at any given time. TAGGED has no 
value notation of its own. Its type notation 
consists of three elements: a user-defined tag, 
possibly followed by IMPLICIT or EXPLICIT, 
followed by the value notation of the type 
being tagged.
Structured Types 
• The user-defined tag consists of a class and 
class number contained in braces. 
• Class is UNIVERSAL, APPLICATION, PRIVATE, 
or CONTEXT-SPECIFIC. 
• The UNIVERSAL class is restricted to the ASN.1 
built-in types. It defines an application-independent 
data type that must be 
distinguishable from all other data types. The 
other three classes are user defined.
Structured Types 
• The user-defined tag consists of a class and 
class number contained in braces. 
• Class is UNIVERSAL, APPLICATION, PRIVATE, 
or CONTEXT-SPECIFIC. 
• The UNIVERSAL class is restricted to the ASN.1 
built-in types. It defines an application-independent 
data type that must be 
distinguishable from all other data types. The 
other three classes are user defined.
Structured Types 
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.
Structured Types 
a) seats SET { maximum INTEGER, occupied 
INTEGER, vacant INTEGER } 
b) b) seats SET { maximum [APPLICATION 0] 
INTEGER, occupied [APPLICATION 1] INTEGER, 
vacant [APPLICATION 2] INTEGER } 
c) c) seats SET { maximum [APPLICATION 0] 
IMPLICIT INTEGER, occupied [APPLICATION 1] 
IMPLICIT INTEGER, vacant [APPLICATION 2] 
IMPLICIT INTEGER } 
d) d) seats SET { maximum [0] INTEGER, occupied 
[1] INTEGER, vacant [2] INTEGER }
Additional Features 
a) ASN.1 defines a subtype notation and value 
sets, a method for handling recursion in data 
types, and a macro facility.
Value Sets 
• SingleValue: 
Divisors-of-6 ::= INTEGER (1 | 2 | 3 | 6) 
• ContainedSubtype: 
Divisors-of-18 ::= INTEGER (INCLUDES Divisors-of- 
6 | 9 | 18) 
• ValueRange: 
TeenAgeYears ::= (13 .. 19) 
• Permitted Alphabet: 
BooleanValue ::= IA5String (FROM ('T' | 'F')) 
• SizeConstraint: 
BaseballTeamRoster ::= SET SIZE (1..25) OF 
PlayerNames
Inner Type 
• InnerType constrains the value ranges of 
structured types. 
• In particular, it can change an OPTIONAL 
component of a structured type into one that 
is always PRESENT or always ABSENT. 
• The type notation requires the keywords 
``WITH COMPONENTS'' followed by the 
components of the structured type, each 
component with or without a constraint.
Inner Type 
NonStopFlights ::= AirlineFlight ( 
WITH COMPONENTS { 
airline ("American" | "Delta"), 
flight, 
nonstopseats ::= seats 
( WITH COMPONENTS 
{ maximum (0..200), occupied (100..200), 
vacant (0..100) } ), 
nonstopairport ::= airport 
( WITH COMPONENTS { origin, stop1 [0] 
ABSENT, stop2 [1] ABSENT, destination ("LAX") } ), 
crewsize, 
cancel })
Structured Types 
AirlineFlight ::= SEQUENCE { 
airline IA5String, 
flight NumericString, 
seats SEQUENCE { 
maximum INTEGER, 
occupied INTEGER, 
vacant INTEGER }, 
airport SEQUENCE { 
origin IA5String, 
stop1 [0] IA5String OPTIONAL, 
stop2 [1] IA5String OPTIONAL, 
destination IA5String }, 
crewsize ENUMERATED { six (6), eight (8), ten (10) }, 
cancel BOOLEAN DEFAULT FALSE }.

Mais conteúdo relacionado

Mais procurados (20)

Mql4 manual
Mql4 manualMql4 manual
Mql4 manual
 
ExAlg Overview
ExAlg OverviewExAlg Overview
ExAlg Overview
 
SQL- Introduction to MySQL
SQL- Introduction to MySQLSQL- Introduction to MySQL
SQL- Introduction to MySQL
 
Chap1introppt2php(finally done)
Chap1introppt2php(finally done)Chap1introppt2php(finally done)
Chap1introppt2php(finally done)
 
2 1 data
2 1  data2 1  data
2 1 data
 
Structure and union
Structure and unionStructure and union
Structure and union
 
LEARN C# PROGRAMMING WITH GMT
LEARN C# PROGRAMMING WITH GMTLEARN C# PROGRAMMING WITH GMT
LEARN C# PROGRAMMING WITH GMT
 
Unit4 Slides
Unit4 SlidesUnit4 Slides
Unit4 Slides
 
02. Data Type and Variables
02. Data Type and Variables02. Data Type and Variables
02. Data Type and Variables
 
Database Design and Normalization Techniques
Database Design and Normalization TechniquesDatabase Design and Normalization Techniques
Database Design and Normalization Techniques
 
Chapter 08
Chapter 08Chapter 08
Chapter 08
 
Character set of c
Character set of cCharacter set of c
Character set of c
 
Structure & Union in C++
Structure & Union in C++Structure & Union in C++
Structure & Union in C++
 
Intoduction to structure
Intoduction to structureIntoduction to structure
Intoduction to structure
 
Structure & union
Structure & unionStructure & union
Structure & union
 
Gunosy.go#7 reflect
Gunosy.go#7 reflectGunosy.go#7 reflect
Gunosy.go#7 reflect
 
9 case
9 case9 case
9 case
 
Array assignment
Array assignmentArray assignment
Array assignment
 
31 uml
31 uml31 uml
31 uml
 
Structure & union
Structure & unionStructure & union
Structure & union
 

Semelhante a ASNP

Python variables and data types.pptx
Python variables and data types.pptxPython variables and data types.pptx
Python variables and data types.pptxAkshayAggarwal79
 
C UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDYC UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDYRajeshkumar Reddy
 
cassignmentii-170424105623.pdf
cassignmentii-170424105623.pdfcassignmentii-170424105623.pdf
cassignmentii-170424105623.pdfYRABHI
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programmingHarshita Yadav
 
Vb6 ch.8-3 cci
Vb6 ch.8-3 cciVb6 ch.8-3 cci
Vb6 ch.8-3 cciFahim Khan
 
Data Types, Variables, and Constants in C# Programming
Data Types, Variables, and Constants in C# ProgrammingData Types, Variables, and Constants in C# Programming
Data Types, Variables, and Constants in C# ProgrammingSherwin Banaag Sapin
 
C data types, arrays and structs
C data types, arrays and structsC data types, arrays and structs
C data types, arrays and structsSaad Sheikh
 
Unit 5-hive data types – primitive and complex data
Unit 5-hive data types – primitive and complex dataUnit 5-hive data types – primitive and complex data
Unit 5-hive data types – primitive and complex datavishal choudhary
 
LISP: Type specifiers in lisp
LISP: Type specifiers in lispLISP: Type specifiers in lisp
LISP: Type specifiers in lispLISP Content
 
IMP PPT- Python programming fundamentals.pptx
IMP PPT- Python programming fundamentals.pptxIMP PPT- Python programming fundamentals.pptx
IMP PPT- Python programming fundamentals.pptxlemonchoos
 
Datatypes in Python.pdf
Datatypes in Python.pdfDatatypes in Python.pdf
Datatypes in Python.pdfking931283
 
Strings Arrays
Strings ArraysStrings Arrays
Strings Arraysphanleson
 
12TypeSystem.pdf
12TypeSystem.pdf12TypeSystem.pdf
12TypeSystem.pdfMdAshik35
 
02. Primitive Data Types and Variables
02. Primitive Data Types and Variables02. Primitive Data Types and Variables
02. Primitive Data Types and VariablesIntro C# Book
 

Semelhante a ASNP (20)

Data Handling
Data HandlingData Handling
Data Handling
 
Data types
Data typesData types
Data types
 
Python variables and data types.pptx
Python variables and data types.pptxPython variables and data types.pptx
Python variables and data types.pptx
 
C UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDYC UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDY
 
cassignmentii-170424105623.pdf
cassignmentii-170424105623.pdfcassignmentii-170424105623.pdf
cassignmentii-170424105623.pdf
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
 
Vb6 ch.8-3 cci
Vb6 ch.8-3 cciVb6 ch.8-3 cci
Vb6 ch.8-3 cci
 
Notes(1).pptx
Notes(1).pptxNotes(1).pptx
Notes(1).pptx
 
Data Types, Variables, and Constants in C# Programming
Data Types, Variables, and Constants in C# ProgrammingData Types, Variables, and Constants in C# Programming
Data Types, Variables, and Constants in C# Programming
 
C data types, arrays and structs
C data types, arrays and structsC data types, arrays and structs
C data types, arrays and structs
 
Unit 5-hive data types – primitive and complex data
Unit 5-hive data types – primitive and complex dataUnit 5-hive data types – primitive and complex data
Unit 5-hive data types – primitive and complex data
 
LISP: Type specifiers in lisp
LISP: Type specifiers in lispLISP: Type specifiers in lisp
LISP: Type specifiers in lisp
 
LISP: Type specifiers in lisp
LISP: Type specifiers in lispLISP: Type specifiers in lisp
LISP: Type specifiers in lisp
 
IMP PPT- Python programming fundamentals.pptx
IMP PPT- Python programming fundamentals.pptxIMP PPT- Python programming fundamentals.pptx
IMP PPT- Python programming fundamentals.pptx
 
DBMS
DBMSDBMS
DBMS
 
Datatypes in Python.pdf
Datatypes in Python.pdfDatatypes in Python.pdf
Datatypes in Python.pdf
 
Strings Arrays
Strings ArraysStrings Arrays
Strings Arrays
 
12TypeSystem.pdf
12TypeSystem.pdf12TypeSystem.pdf
12TypeSystem.pdf
 
Arrays
ArraysArrays
Arrays
 
02. Primitive Data Types and Variables
02. Primitive Data Types and Variables02. Primitive Data Types and Variables
02. Primitive Data Types and Variables
 

Último

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 

Último (20)

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 

ASNP

  • 1. ASN.1 Tomado de: http://www.obj-sys. com/asn1tutorial/asn1only.html
  • 2. Purpose of ASN.1 ASN.1 is a fundamental tool for use by applications. It provides the ability to describe the information that will be exchanged independent of the way that information is represented on each of the communicating systems
  • 3. Modules The fundamental unit of ASN.1 is the module. The sole purpose of a module is to name a collection of type definitions and/or value definitions (assignments) that constitute a data specification. A type definition is used to define and name a new type by means of a type assignment and a value definition is used to define and name a specific value, when it is necessary, by means of a value assignment.
  • 4. Modules Module reference optional object identifier 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
  • 5. Type Assignment 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 Type reference (name of the type) Component value
  • 6. Value Assignment A value assignment consists of a value reference (the name of the value), the type of the value, ::= (``is assigned the value''), and a valid value notation. gadget ItemId ::= { partnumber "7685B2", quantity 73, wholesaleprice 13.50, saleprice 24.95 ) defines ``gadget" as a value of type ``ItemId".
  • 7. Built-in Types ASN.1 has built-in types that are simple and structured. Structured types are composed of component types, each of which is a simple or structured type. A user-defined type is composed of simple and structured types. ASN.1 also has another category of types called useful, which provide standard definitions for a small number of commonly used types.
  • 8. Simple Types ASN.1 has built-in types that are simple and structured. Structured types are composed of component types, each of which is a simple or structured type. A user-defined type is c ASN.1 also has another category of types called useful, which provide standard definitions for a small number of commonly used types. omposed of simple and structured types.
  • 9. Simple Types Type BOOLEAN takes values TRUE and FALSE. Usually, the type reference for BOOLEAN describes the true state. For example: Female ::= BOOLEAN is preferable to Gender ::= BOOLEAN.
  • 10. Simple Types Type INTEGER takes any of the infinite set of integer values. It has an additional notation that names some of the possible values of the integer. For example, ColorType ::= INTEGER { red (0) white (1) blue (2) } indicates that the ``ColorType" is an INTEGER and its values 0, 1, and 2 are named ``red", ``white", and ``blue", respectively. The ColorType could also have any of the other valid integer values, such as 4 or -62.
  • 11. Simple Types Type BIT STRING takes values that are an ordered sequence of zero or more bits. The bit sequence is either a binary or hexadecimal string delimited by single quotes followed by B or H, respectively. Occupation ::= BIT STRING{ clerk (0) editor (1) artist (2) publisher (3) } names the first bit ``clerk", the second bit ``editor", and so on. (editor, artist) and '0110'B are two representations for the same value of ``Occupation".
  • 12. Simple Types • Type OCTET STRING takes values that are an ordered sequence of zero or more eight-bit octets. • The sequence is written in the same form as a BIT STRING sequence. • Thus, `1101000100011010'B and `82DA'H are valid values of OCTET STRING.
  • 13. Simple Types • Type OBJECT IDENTIFIER names information objects (for example, abstract syntaxes or ASN.1 modules). • A list of positive numbers, enclosed in braces and ordered by level starting from the root, uniquely identifies an information object at a node of the tree. This ordered list of positive numbers delimited by braces is the value notation for type OBJECT IDENTIFIER.
  • 15. Simple Types Type REAL takes values that are the machine representation of a real number, namely the triplet (m, b, e), where m is the mantissa (a signed number), b the base (2 or 10), and e the exponent (a signed number). For example, the representation of the value 3.14 for the variable Pi, declared as Pi ::= REAL, can be (314, 10, -2).
  • 16. Simple Types Type ENUMERATED is similar to the INTEGER type, but names specific values only. ColorType ::= ENUMERATED { red (0) white (1) blue (2) } ColorType can take only the values specifically in the list;
  • 17. Simple Types Type CHARACTER STRING takes values that are strings of characters from some defined (ISO- or CCITT-registered) character set. if Address is of type PrintableString, then ``Villanova, PA 19085'' is an Address value.
  • 18. Structured Types Type SEQUENCE is an ordered list of zero or more component types. The type notation requires braces around the list and permits a local identifier preceding the list to act as the name of the sequence type. There are two ways to specify that a component type is optional in the ordered list: using OPTIONAL after the component type and using DEFAULT followed by a value after the component type. When DEFAULT is used, the specified value is assumed whenever the type is absent from the list. Any of the component types can be an embedded sequence, in which case COMPOSED OF precedes the embedded sequence.
  • 19. Structured Types The value notation for each sequence type is the list of component values within braces. { airline "American", flight "1106", seats { 320, 107, 213 }, airport { origin "BWI", destination "LAX" }, crewsize 10 } or { "American", "1106", { 320, 107, 213 }, { "BWI", "LAX" }, 10 } represent the same instance of the sequence type
  • 20. Structured Types The value notation for each sequence type is the list of component values within braces. { airline "American", flight "1106", seats { 320, 107, 213 }, airport { origin "BWI", destination "LAX" }, crewsize 10 } or { "American", "1106", { 320, 107, 213 }, { "BWI", "LAX" }, 10 } represent the same instance of the sequence type
  • 21. Structured Types AirlineFlight ::= SEQUENCE { airline IA5String, flight NumericString, seats SEQUENCE { maximum INTEGER, occupied INTEGER, vacant INTEGER }, airport SEQUENCE { origin IA5String, stop1 [0] IA5String OPTIONAL, stop2 [1] IA5String OPTIONAL, destination IA5String }, crewsize ENUMERATED { six (6), eight (8), ten (10) }, cancel BOOLEAN DEFAULT FALSE }.
  • 22. Structured Types Two components, Stop1 and Stop2 of the sequence type airport are tagged with the context-specific tags [0] and [1] to avoid ambiguity due to consecutive optional components not having distinct types. Without the tags, the definition of airport would be invalid in ASN.1.
  • 23. Structured Types Type SEQUENCE OF is similar to SEQUENCE, except that all values in the ordered list must be of the same type.
  • 24. Structured Types Type SET takes values that are unordered lists of component types. The type and value notations for SET are similar to SEQUENCE, except that the type of each component must be distinct from all others and the values can be in any order {"Maggie", 4, TRUE} {TRUE, "Maggie", 4} {4, TRUE,"Maggie"} are three representations of the same instance of Person ::= SET { name IA5String, age INTEGER, female BOOLEAN }.
  • 25. Structured Types Type SET OF takes values that are unordered lists of a single type.
  • 26. Structured Types Type CHOICE takes one value from a specified list of distinct types.. The value notation is that for the type chosen. For example, each of the three values, (1) nothing TRUE, (2) car "Lincoln", (3) cash 25000 is a valid instance of Prize ::= CHOICE { car IA5String, cash INTEGER, nothing BOOLEAN }.
  • 27. Structured Types Type SELECTION enables the user to choose a component type from a specified CHOICE type. The less than symbol ``<" must precede the name of the CHOICE type. Winner ::= SEQUENCE { lastName VisibleString, ssn VisibleString, cash < Prize } with value notation { lastName `AUSTING', ssn `222334444', cash 5000 }
  • 28. Structured Types Type ANY, without further specification, is incomplete. It must be supplemented by any valid ASN.1 type . The value notation for the type notation ANY is the specified type followed by its value.
  • 29. Structured Types { author "Shakespeare", reference IA5String "ISBN0669123757" } and { author "Shakespeare", reference INTEGER 1988 } are two possible values of TextBook ::= SEQUENCE { author IA5String, reference ANY }
  • 30. Structured Types Type TAGGED is used to enable the receiving system to correctly decode values from several datatypes that a protocol determines may be transmitted at any given time. TAGGED has no value notation of its own. Its type notation consists of three elements: a user-defined tag, possibly followed by IMPLICIT or EXPLICIT, followed by the value notation of the type being tagged.
  • 31. Structured Types • The user-defined tag consists of a class and class number contained in braces. • Class is UNIVERSAL, APPLICATION, PRIVATE, or CONTEXT-SPECIFIC. • The UNIVERSAL class is restricted to the ASN.1 built-in types. It defines an application-independent data type that must be distinguishable from all other data types. The other three classes are user defined.
  • 32. Structured Types • The user-defined tag consists of a class and class number contained in braces. • Class is UNIVERSAL, APPLICATION, PRIVATE, or CONTEXT-SPECIFIC. • The UNIVERSAL class is restricted to the ASN.1 built-in types. It defines an application-independent data type that must be distinguishable from all other data types. The other three classes are user defined.
  • 33. Structured Types 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.
  • 34. Structured Types a) seats SET { maximum INTEGER, occupied INTEGER, vacant INTEGER } b) b) seats SET { maximum [APPLICATION 0] INTEGER, occupied [APPLICATION 1] INTEGER, vacant [APPLICATION 2] INTEGER } c) c) seats SET { maximum [APPLICATION 0] IMPLICIT INTEGER, occupied [APPLICATION 1] IMPLICIT INTEGER, vacant [APPLICATION 2] IMPLICIT INTEGER } d) d) seats SET { maximum [0] INTEGER, occupied [1] INTEGER, vacant [2] INTEGER }
  • 35. Additional Features a) ASN.1 defines a subtype notation and value sets, a method for handling recursion in data types, and a macro facility.
  • 36. Value Sets • SingleValue: Divisors-of-6 ::= INTEGER (1 | 2 | 3 | 6) • ContainedSubtype: Divisors-of-18 ::= INTEGER (INCLUDES Divisors-of- 6 | 9 | 18) • ValueRange: TeenAgeYears ::= (13 .. 19) • Permitted Alphabet: BooleanValue ::= IA5String (FROM ('T' | 'F')) • SizeConstraint: BaseballTeamRoster ::= SET SIZE (1..25) OF PlayerNames
  • 37. Inner Type • InnerType constrains the value ranges of structured types. • In particular, it can change an OPTIONAL component of a structured type into one that is always PRESENT or always ABSENT. • The type notation requires the keywords ``WITH COMPONENTS'' followed by the components of the structured type, each component with or without a constraint.
  • 38. Inner Type NonStopFlights ::= AirlineFlight ( WITH COMPONENTS { airline ("American" | "Delta"), flight, nonstopseats ::= seats ( WITH COMPONENTS { maximum (0..200), occupied (100..200), vacant (0..100) } ), nonstopairport ::= airport ( WITH COMPONENTS { origin, stop1 [0] ABSENT, stop2 [1] ABSENT, destination ("LAX") } ), crewsize, cancel })
  • 39. Structured Types AirlineFlight ::= SEQUENCE { airline IA5String, flight NumericString, seats SEQUENCE { maximum INTEGER, occupied INTEGER, vacant INTEGER }, airport SEQUENCE { origin IA5String, stop1 [0] IA5String OPTIONAL, stop2 [1] IA5String OPTIONAL, destination IA5String }, crewsize ENUMERATED { six (6), eight (8), ten (10) }, cancel BOOLEAN DEFAULT FALSE }.