Download presentation
Presentation is loading. Please wait.
1
ASN.1 Compiler for text-based protocols!
Raman Govindan Software Consultant, Wipro Technologies
2
ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001
AGENDA What is ASN.1 Compiler? Components of ASN.1 Compiler Example of ASN.1 Specification Working of ASN.1 Compiler Case Study ITU-T and ITU-D Workshop - Bangalore (India), August 2001
3
ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001
What is ASN.1 Compiler? ASN.1 Compiler is a tool to convert the data description in ASN.1 format to programming language dependent data structures and associated routines to encode/decode the same. Two approaches to generate encode/decode routines dedicated routines per message generic routines (which is considered for the rest of the presentation) ITU-T and ITU-D Workshop - Bangalore (India), August 2001
4
ASN.1 Compiler Components
specification Input Validation and Parsing Header Driving File Table Front End Back End ASN.1 Encode Decoded Data ASN.1 Decode Network Encoded bytes ITU-T and ITU-D Workshop - Bangalore (India), August 2001
5
ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001
ASN.1 Example A ::= SEQUENCE { b BOOLEAN c C d D e INTEGER } C ::= SEQUENCE { c BOOLEAN D ::= SEQUENCE { e INTEGER typedef struct { char b; C c; D d; int e; } A; char c; } C; } D; - Illustrates one-to-one mapping of Abstract Syntax to Concrete Syntax - Same example will be used to demonstrate working of ASN Compiler ITU-T and ITU-D Workshop - Bangalore (India), August 2001
6
ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001
Wipro ASN.1 Compiler Front-End Working B BOOLEAN A I INTEGER C D I B Graph is converted to table using Depth First Algorithm. Info B; Info I; Info C; Info D; Info A; &B, &I &I, &B, &C, &D, &I ITU-T and ITU-D Workshop - Bangalore (India), August 2001
7
ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001
Wipro ASN.1 Compiler Back-End Working Driving Table typedef struct { char b;(1) C c; D d; int e;(5) } A; char c;(0) int e;(2) } C; int e;(3) } D; B SEQUENCE 4 B C D I SEQUENCE 4 B C D I SEQUENCE 4 B C D I SEQUENCE 4 B C D I I C D A SEQUENCE 1 I SEQUENCE 2 B I SEQUENCE 2 B I ROOT BOOLEAN BOOLEAN Values within () indicate the value to be encoded. Encoded Bit stream INTEGER INTEGER INTEGER 1 2 3 5 ITU-T and ITU-D Workshop - Bangalore (India), August 2001
8
Footprint of various alternatives.
Units are in KB 160 140 120 100 80 Table Driven Approach Dedicated Routines 60 40 20 RAS Q.931 H.245 H.225 H.323 ITU-T and ITU-D Workshop - Bangalore (India), August 2001
9
ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001
Advantages of text-based protocols and how ASN.1 Tools help achieve the same. easy implementation easy debugging similar parser implementation available high extensibility ASN.1 Compiler eases implementation ASN.1 Compiler trace facility for debug ASN.1 Compiler generates code. ASN.1 support extension elements ITU-T and ITU-D Workshop - Bangalore (India), August 2001
10
Case Study Text-based ASN.1-based
Case study is on a comparative study of text-based versus ASN.1-based protocol extract of text-based protocol and its equivalent ASN.1 representation is taken as reference for the study. ITU-T and ITU-D Workshop - Bangalore (India), August 2001
11
Extract of Text-based protocol
time-fields = 1*( "t=" start-time space stop-time *(CRLF repeat-fields) CRLF) [zone-adjustments CRLF] repeat-fields = "r=" repeat-interval space typed-time 1*(space typed-time) zone-adjustments = time space ["-"] typed-time *(space time space ["-"] typed-time) start-time = time | "0" stop-time = time | "0" time = POS-DIGIT 9*(DIGIT) ;sufficient for 2 more centuries repeat-fields = "r=" repeat-interval space typed-time repeat-interval = typed-time typed-time = 1*(DIGIT) [fixed-len-time-unit] fixed-len-time-unit = "d" | "h" | "m" | "s" ITU-T and ITU-D Workshop - Bangalore (India), August 2001
12
Equivalent ASN.1 Representation
TimeFields ::= SEQUENCE { timeFields SEQUENCE OF TimeField zoneAdjustments ZoneAdjustments OPTIONAL } TimeField ::= SEQUENCE { startTime NTPTimeStamp Optional -- Optional means 0 stopTime NTPTimeStamp Optional -- Optional means 0 repeatFields SEQUENCE OF RepeatField OPTIONAL NTPTimeStamp ::= INTEGER( ) positiveNegativeNTPTimeStamp ::= INTEGER( ) repeatFields ::= SEQUENCE { repeatInterval typedTime duration typedTime offset SEQUENCE OF typedTime ITU-T and ITU-D Workshop - Bangalore (India), August 2001
13
Equivalent ASN.1 Representation . . .
zoneAdjustements ::= SEQUENCE { time NTPTimeStamp adjust positiveNegativetypedTime } typedTime ::= CHOICE { ntpTimeStamp NTPTimeStamp days INTEGER ( ) Two centuries hours INTEGER ( ) One year minutes INTEGER ( ) One year seconds INTEGER ( ) -- One year positiveNegativetypedTime ::= CHOICE { ntpTimeStamp positiveNegativeNTPTimeStamp days INTEGER( ) hours INTEGER( ) minutes INTEGER( ) seconds INTEGER( ) ITU-T and ITU-D Workshop - Bangalore (India), August 2001
14
Benchmark Results Text-based ASN.1-based
2800 Encoding - 1micro-seconds 280 Decoding - 1micro- seconds Is there a tool to optimize parser-generated code? Footprint is 100KB for entire grammar which includes the one in this case study. Text compression can be used for efficient bandwidth at the expense of performance 23000 Encoding - 1micro-seconds 22000 Decoding - 1micro-seconds Optimized ASN.1 Compiler leads to easier development Footprint is 45KB PER can be used for efficient bandwidth Encoding Text-based performance is slow due to text processing like string concatenation Encoding/Decoding of text-based protocol accounts to around .004 micro-seconds as compared to just micro-seconds ITU-T and ITU-D Workshop - Bangalore (India), August 2001
15
Hurdles to ASN.1-based protocol
Availability of limited free ASN.1 tools Contribute more and more tools in public domain. Tool to convert BNF to ASN.1 representation will promote text-based evangelists to consider ASN.1-based protocols. ITU-T and ITU-D Workshop - Bangalore (India), August 2001
16
ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001
One Application of ASN.1 VoiceEngine for RG VoiceEngine for RG ASN.1 is used here Bluetooth Wipro VoiceEngine H323-NCS GW Cable Modem E’net / USB Home LAN SIP H.323 HFC out Settop Box, C Home Gateway, M HFC OUT LAN Access Point visit us at VoiceEngine Software provides the Voice Over Cable Capability to the device ITU-T and ITU-D Workshop - Bangalore (India), August 2001
17
ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001
Thank You visit us at ITU-T and ITU-D Workshop - Bangalore (India), August 2001
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.