1 / 17

ASN.1 Compiler for text-based protocols!

ASN.1 Compiler for text-based protocols!. Raman Govindan Software Consultant, Wipro Technologies. AGENDA. What is ASN.1 Compiler? Components of ASN.1 Compiler Example of ASN.1 Specification Working of ASN.1 Compiler Case Study. What is ASN.1 Compiler?.

msaucedo
Télécharger la présentation

ASN.1 Compiler for text-based protocols!

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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 ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001

  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) ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001

  4. Driving 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 ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001

  5. A ::= SEQUENCE { b BOOLEAN c C d D e INTEGER } C ::= SEQUENCE { c BOOLEAN e INTEGER } D ::= SEQUENCE { e INTEGER } 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; ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001

  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 ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001

  7. Wipro ASN.1 Compiler Back-End Working D I C B B I SEQUENCE 4 SEQUENCE 2 D I C B SEQUENCE 1 SEQUENCE 4 SEQUENCE 4 SEQUENCE 4 SEQUENCE 2 I B I D I C B B D I C 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 3 2 0 5 ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001

  8. Table Driven Approach Dedicated Routines 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 ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001

  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 ITU-T and ITU-D Workshop - Bangalore (India), 30-31 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), 30-31 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 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) ITU-T and ITU-D Workshop - Bangalore (India), 30-31 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(1000000000..4294967295) positiveNegativeNTPTimeStamp ::= INTEGER(1000000000..4294967295) repeatFields ::= SEQUENCE { repeatInterval typedTime duration typedTime offset SEQUENCE OF typedTime } ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001

  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 positiveNegativeNTPTimeStamp days INTEGER(-73050..73050) hours INTEGER(-8784..8784) minutes INTEGER(-527040..527040) seconds INTEGER(-31622400..31622400) } ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001

  14. 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 Benchmark Results Text-based ASN.1-based ITU-T and ITU-D Workshop - Bangalore (India), 30-31 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), 30-31 August 2001

  16. One Application of ASN.1 Bluetooth Home LAN Cable Modem E’net / USB SIP H.323 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 ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001

  17. Thank You visit us at http://www.wipro.com/homenet ITU-T and ITU-D Workshop - Bangalore (India), 30-31 August 2001

More Related