Chapter 1. Overview of ASN2CSV

ASN2CSV is a command-line tool that translates ASN.1 data encoded in the Basic, Canonical, or Distinguished Encoding Rules (BER/CER/DER) to a comma-separated text format (CSV) suitable for use with spreadsheet tools or databases. Unlike some tools provided by Objective Systems, ASN2CSV does not support messages encoded using the Packed Encoding Rules (PER).

ASN2CSV is envisioned primarily as a tool for working with call data records (CDRs) in a variety of formats such as TAP3, SGSN, R12, CCN, SR13, and others. It therefore does not support more advanced features of the ASN.1 standards such as two-phase decoding or information objects.

There exists no standard for converting ASN.1-encoded data to CSV. BER, CER, and DER data are encoded in a hierarchical format that lends itself to translation to similar formats such as XML. CSV, on the other hand, is flat data format: there are no structured types or children, and all data in a CSV file are displayed on single lines. This complicates the translation of ASN.1 to CSV, since structured data types like SEQUENCEs can be nested to an arbitrary depth or repeated an arbitrary number of times.

While these limitations make conversion a difficult problem, CSV offers some advantages over XML. CSV files are usually considerably smaller than XML, since no markup is necessary to distinguish elements. Many databases import CSV data directly into tables, so no intermediate transformations are required. CSV files are also easier to manipulate procedurally; no external XML parsers are required to read the files, and many scripting languages have built-in facilities for working with comma-delimited data.

This document describes some of the unique challenges of transforming ASN.1-encoded data to CSV and the approach taken by ASN2CSV to solve those problems.