ASN.1 Compiler for text-based protocols! - PowerPoint PPT Presentation

About This Presentation
Title:

ASN.1 Compiler for text-based protocols!

Description:

Two approaches to generate encode/decode routines. dedicated routines per message ... 280 Decoding - 1micro- seconds. Is there a tool to optimize parser ... – PowerPoint PPT presentation

Number of Views:140
Avg rating:3.0/5.0
Slides: 18
Provided by: francine9
Category:

less

Transcript and Presenter's Notes

Title: ASN.1 Compiler for text-based protocols!


1
ASN.1 Compiler for text-based protocols!
  • Raman Govindan
  • Software Consultant, Wipro Technologies

2
AGENDA
  • What is ASN.1 Compiler?
  • Components of ASN.1 Compiler
  • Example of ASN.1 Specification
  • Working of ASN.1 Compiler
  • Case Study

3
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)

4
ASN.1 Compiler Components
ASN.1
specification
Input Validation
and Parsing

Header
File
Table
Decoded Data
ASN.1 Encode
ASN.1 Decode
Network
Encoded bytes
5
ASN.1 Example
  • typedef struct
  • char b
  • C c
  • D d
  • int e
  • A
  • typedef struct
  • char c
  • int e
  • C
  • typedef struct
  • int e
  • D
  • A SEQUENCE
  • b BOOLEAN
  • c C
  • d D
  • e INTEGER
  • C SEQUENCE
  • c BOOLEAN
  • e INTEGER
  • D SEQUENCE
  • e INTEGER

6
Wipro ASN.1 Compiler Front-End Working
B
BOOLEAN
A
I
INTEGER
D
C
I
B
Info B Info I Info C Info D Info
A B, I I,
B, C, D, I
7
Wipro ASN.1 Compiler Back-End Working
Driving Table
  • typedef struct
  • char b(1)
  • C c
  • D d
  • int e(5)
  • A
  • typedef struct
  • char c(0)
  • int e(2)
  • C
  • typedef struct
  • int e(3)
  • D

B
I
C
D
A
ROOT
BOOLEAN
BOOLEAN
Encoded Bit stream
INTEGER
INTEGER
INTEGER
1
2
3
0
5
8
Footprint of various alternatives.
Units are in KB
160
140
120
100
80
60
40
20
0
RAS
Q.931
H.245
H.225
H.323
9
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
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.

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
  • 1(space
    typed-time)
  • repeat-interval typed-time
  • typed-time 1(DIGIT)
    fixed-len-time-unit
  • fixed-len-time-unit "d" "h" "m" "s"
  • zone-adjustments time space "-"
    typed-time
  • (space
    time space "-" typed-time)

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(1000000000..4294967295)
  • positiveNegativeNTPTimeStamp
    INTEGER(1000000000..4294967295)
  • repeatFields SEQUENCE
  • repeatInterval typedTime
  • duration typedTime
  • offset SEQUENCE OF typedTime

13
Equivalent ASN.1 Representation . . .
  • zoneAdjustements SEQUENCE
  • time NTPTimeStamp
  • adjust positiveNegativetypedTime
  • typedTime CHOICE
  • ntpTimeStamp NTPTimeStamp
  • days INTEGER (1..73050)
    -- Two centuries
  • hours INTEGER (1..8784)
    -- One year
  • minutes INTEGER (1..527040)
    -- One year
  • seconds INTEGER (1..31622400) --
    One year
  • positiveNegativetypedTime CHOICE
  • ntpTimeStamp positiveNegativeNTPTimeStam
    p
  • days INTEGER(-73050..730
    50)
  • hours INTEGER(-8784..8784
    )
  • minutes INTEGER(-527040..5270
    40)
  • seconds INTEGER(-31622400..316
    22400)

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

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.
16
One Application of ASN.1
VoiceEngine for RG
VoiceEngine for RG
ASN.1 is used here
Wipro
VoiceEngine
H323-NCS GW
HFC out
C
Settop Box,
Home Gateway,
M
HFC OUT
LAN Access Point
visit us at http//www.wipro.com/homenet
VoiceEngine Software provides the Voice Over
Cable Capability to the device
17
Thank You
visit us at http//www.wipro.com/homenet
Write a Comment
User Comments (0)
About PowerShow.com