Sample SortCL-Compatible ASN.1 Jobs
In the previous article, new support for SortCL-compatible jobs in the IRI Voracity data processing ecosystem for ASN.1-encoded data files was introduced. This article takes a more in-depth look through sample jobs demonstrating various use cases, ASN.1 encoding rules, schema files, and the Protocol Data Units (PDUs) involved with data defined in ASN.1 schemas.
Note that many of the jobs shown herein are presented in raw text script form, after serialization in the IRI Workbench graphical job design environment, built on Eclipse. Also, a license from OSS Nokalva is needed along with your IRI software license to support the ASN.1 Encoding Rules used in SortCL jobs.
A zip file of all the examples discussed in this article may be downloaded from here.
Example 1: Output BER-encoded data from existing compliant CSV file
Here is an example of an IRI CoSort data transformation job that sorts and maps CSV data to a BER-encoded file meeting the specifications of TAP3, a standard for exchanging data between mobile network operators for roaming calls. The number of fields have been truncated for readability. :
/INFILE=ASN.csv /PROCESS=CSV /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_SENDER, TYPE=ASCII, POSITION=1, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_RECIPIENT, TYPE=ASCII, POSITION=2, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILESEQUENCENUMBER, TYPE=ASCII, POSITION=3, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILECREATIONTIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=4, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILECREATIONTIMESTAMP_UTCTIMEOFFSET, TYPE=ASCII, POSITION=5, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_TRANSFERCUTOFFTIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=6, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_TRANSFERCUTOFFTIMESTAMP_UTCTIMEOFFSET, TYPE=ASCII, POSITION=7, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILEAVAILABLETIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=8, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILEAVAILABLETIMESTAMP_UTCTIMEOFFSET, TYPE=ASCII, POSITION=9, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_SPECIFICATIONVERSIONNUMBER, TYPE=NUMERIC, POSITION=10, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_RELEASEVERSIONNUMBER, TYPE=NUMERIC, POSITION=11, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILETYPEINDICATOR, TYPE=ASCII, POSITION=12, SEPARATOR=",") ......... /SORT /KEY=TRANSFERBATCH_BATCHCONTROLINFO_SENDER /OUTFILE="TAP-0310.asn,BER;tap.ber" /PROCESS=ASN1 /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_SENDER, TYPE=ASCII, POSITION=1, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_RECIPIENT, TYPE=ASCII, POSITION=2, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILESEQUENCENUMBER, TYPE=ASCII, POSITION=3, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILECREATIONTIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=4, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILECREATIONTIMESTAMP_UTCTIMEOFFSET, TYPE=ASCII, POSITION=5, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_TRANSFERCUTOFFTIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=6, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_TRANSFERCUTOFFTIMESTAMP_UTCTIMEOFFSET, TYPE=ASCII, POSITION=7, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILEAVAILABLETIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=8, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILEAVAILABLETIMESTAMP_UTCTIMEOFFSET, TYPE=ASCII, POSITION=9, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_SPECIFICATIONVERSIONNUMBER, TYPE=NUMERIC, POSITION=10, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_RELEASEVERSIONNUMBER, TYPE=NUMERIC, POSITION=11, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILETYPEINDICATOR, TYPE=ASCII, POSITION=12, SEPARATOR=",") .........
NOTE: The input data in the CSV file must meet the constraints of the ASN.1 specification (TAP-0310.asn in this case).
Example 2: Sort BER-encoded file and output to Excel
Here is another example of CoSort taking a TAP3 BER-encoded call detail record, sorting it on one of the input fields, and outputting to an Excel compatible file in XLSX format.:
/INFILE="TAP-0310.asn,BER;tap.ber" /PROCESS=ASN1 /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_SENDER, TYPE=ASCII, POSITION=1, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_RECIPIENT, TYPE=ASCII, POSITION=2, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILESEQUENCENUMBER, TYPE=ASCII, POSITION=3, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILECREATIONTIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=4, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILECREATIONTIMESTAMP_UTCTIMEOFFSET, TYPE=ASCII, POSITION=5, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_TRANSFERCUTOFFTIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=6, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_TRANSFERCUTOFFTIMESTAMP_UTCTIMEOFFSET, TYPE=ASCII, POSITION=7, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILEAVAILABLETIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=8, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILEAVAILABLETIMESTAMP_UTCTIMEOFFSET, TYPE=ASCII, POSITION=9, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_SPECIFICATIONVERSIONNUMBER, TYPE=NUMERIC, POSITION=10, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_RELEASEVERSIONNUMBER, TYPE=NUMERIC, POSITION=11, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILETYPEINDICATOR, TYPE=ASCII, POSITION=12, SEPARATOR=",") ......... /SORT /KEY=TRANSFERBATCH_BATCHCONTROLINFO_RECIPIENT /OUTFILE="'Sheet1',HEADER;outTAP.xlsx" /PROCESS=XLSX /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_SENDER, TYPE=ASCII, POSITION=1, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_RECIPIENT, TYPE=ASCII, POSITION=2, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILESEQUENCENUMBER, TYPE=ASCII, POSITION=3, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILECREATIONTIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=4, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILECREATIONTIMESTAMP_UTCTIMEOFFSET, TYPE=ASCII, POSITION=5, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_TRANSFERCUTOFFTIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=6, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_TRANSFERCUTOFFTIMESTAMP_UTCTIMEOFFSET, TYPE=ASCII, POSITION=7, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILEAVAILABLETIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=8, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILEAVAILABLETIMESTAMP_UTCTIMEOFFSET, TYPE=ASCII, POSITION=9, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_SPECIFICATIONVERSIONNUMBER, TYPE=NUMERIC, POSITION=10, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_RELEASEVERSIONNUMBER, TYPE=NUMERIC, POSITION=11, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILETYPEINDICATOR, TYPE=ASCII, POSITION=12, SEPARATOR=",") .........
Octet strings from the TAP3 schema are output as hex values. Hex values can be decoded to ASCII with the decode_hex function.
Example 3: Masking Call Detail Records using IRI FieldShield
Given this original set of call detail records encoded with Basic Encoding Rules by the definitions provided in an ASN.1 schema,
and running this IRI FieldShield data masking job script in the same SortCL syntax,
/INFILES="{C:/Eclipse/Workbench_10_08/workspace/ASN.1/TAP-0310.asn},BER,DataInterChange;C:/Eclipse/Workbench_10_08/workspace/ASN.1/tapgen6.ber" /PROCESS=ASN1 /ALIAS=tapgen6 /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_SENDER, TYPE=ASCII, POSITION=1, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_RECIPIENT, TYPE=ASCII, POSITION=2, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILESEQUENCENUMBER, TYPE=ASCII, POSITION=3, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILECREATIONTIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=4, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILECREATIONTIMESTAMP_UTCTIMEOFFSET, TYPE=ASCII, POSITION=5, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_TRANSFERCUTOFFTIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=6, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_TRANSFERCUTOFFTIMESTAMP_UTCTIMEOFFSET, TYPE=ASCII, POSITION=7, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILEAVAILABLETIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=8, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_FILEAVAILABLETIMESTAMP_UTCTIMEOFFSET, TYPE=ASCII, POSITION=9, SEPARATOR=",") /FIELD=(TRANSFERBATCH_BATCHCONTROLINFO_SPECIFICATIONVERSIONNUMBER, TYPE=NUMERIC, POSITION=10, SEPARATOR=",") ....... /REPORT /OUTFILE=masked-tap-gen /PROCESS=RECORD /FIELD=(PSEUDO_TRANSFERBATCH_BATCHCONTROLINFO_SENDER, TYPE=ASCII, POSITION=1, SEPARATOR=",", SET="C:/IRI/cosort105/sets/tadig-codes.set") /FIELD=(PSEUDO_TRANSFERBATCH_BATCHCONTROLINFO_RECIPIENT, TYPE=ASCII, POSITION=2, SEPARATOR=",", SET="C:/IRI/cosort105/sets/tadig-codes.set") /FIELD=(DECODE_TRANSFERBATCH_BATCHCONTROLINFO_FILESEQUENCENUMBER=decode_hex(TRANSFERBATCH_BATCHCONTROLINFO_FILESEQUENCENUMBER), TYPE=ASCII, POSITION=3, SEPARATOR=",") /FIELD=(PSEUDO_TRANSFERBATCH_BATCHCONTROLINFO_FILECREATIONTIMESTAMP_LOCALTI, TYPE=ASCII, POSITION=4, SEPARATOR=",", SET="C:/Eclipse/Workbench_10_08/workspace/ASN.1/timestamps.set") /FIELD=(DECODE_TRANSFERBATCH_BATCHCONTROLINFO_FILECREATIONTIMESTAMP_UTCTIMEOFFSET=decode_hex(TRANSFERBATCH_BATCHCONTROLINFO_FILECREATIONTIMESTAMP_UTCTIMEOFFSET), TYPE=ASCII, POSITION=5, SEPARATOR=",") /FIELD=(PSEUDO_TRANSFERBATCH_BATCHCONTROLINFO_TRANSFERCUTOFFTIMESTAMP_LOCAL, TYPE=ASCII, POSITION=6, SEPARATOR=",", SET="C:/Eclipse/Workbench_10_08/workspace/ASN.1/timestamps.set") /FIELD=(DECODE_TRANSFERBATCH_BATCHCONTROLINFO_TRANSFERCUTOFFTIMESTAMP_UTCTIMEOFFSET=decode_hex(TRANSFERBATCH_BATCHCONTROLINFO_TRANSFERCUTOFFTIMESTAMP_UTCTIMEOFFSET), TYPE=ASCII, POSITION=7, SEPARATOR=",") /FIELD=(PSEUDO_TRANSFERBATCH_BATCHCONTROLINFO_FILEAVAILABLETIMESTAMP_LOCALTIMESTAMP, TYPE=ASCII, POSITION=8, SEPARATOR=",", SET="C:/Eclipse/Workbench_10_08/workspace/ASN.1/timestamps.set") /FIELD=(DECODE_TRANSFERBATCH_BATCHCONTROLINFO_FILEAVAILABLETIMESTAMP_UTCTIMEOFFSET=decode_hex(TRANSFERBATCH_BATCHCONTROLINFO_FILEAVAILABLETIMESTAMP_UTCTIMEOFFSET), TYPE=ASCII, POSITION=9, SEPARATOR=",") /FIELD=(DECODE_TRANSFERBATCH_BATCHCONTROLINFO_SPECIFICATIONVERSIONNUMBER=decode_hex(TRANSFERBATCH_BATCHCONTROLINFO_SPECIFICATIONVERSIONNUMBER), TYPE=NUMERIC, POSITION=10, SEPARATOR=",") .......
results in this delimited flat file with pseudonymized data.
Note that the decode_hex function is only applied for ease of viewing, since ASN.1 octet string values are output as the hex representation. Set files were used to pull random TADIG code and timestamp replacement values.
Here is a visual overview of the script in IRI Workbench, where the orange arrows indicate fields that have had transforms applied to them.
Example 4: Converting TAP3 Call Detail Records to other Formats and Layouts
The example included in the zip folder will output to a text file. Alternatively, data could be transported to a database using a script similar to the one shown below.
Truncated script outputting to database:
/INFILE=”TAP0310.asn;tap.ber” /PROCESS=ASN1 /FIELD=(transferBatch_batchControlInfo_sender, POSITION=1, SEPARATOR=',') /FIELD=(transferBatch_batchControlInfo_recipient, POSITION=2, SEPARATOR=',') /FIELD=(transferBatch_batchControlInfo_fileSequenceNumber, POS=3, SEP=',') /FIELD=(transferBatch_batchControlInfo_fileCreationTimeStamp_localTimeStamp, POS=4, SEP=',') /FIELD=(transferBatch_batchControlInfo_fileCreationTimeStamp_utcTimeOffset, POS=5, SEP=',') /FIELD=(transferBatch_batchControlInfo_transferCutOffTimeStamp_localTimeStamp, POS=6, SEP=',') /FIELD=(transferBatch_batchControlInfo_transferCutOffTimeStamp_utcTimeOffset, POS=7, SEP=',') /FIELD=(transferBatch_batchControlInfo_fileAvailableTimeStamp_localTimeStamp, POS=8, SEP=',') /FIELD=(transferBatch_batchControlInfo_fileAvailableTimeStamp_utcTimeOffset, position=9, SEP=',') ………. /REPORT /OUTFILE="asn.base;DSN=New My SQL;UID=root;PWD=$PASS;" /PROCESS=ODBC /FIELD=(transferBatch_batchControlInfo_sender, POS=1,SEP=”\t”,ODEF="transferBatch_batchControlInfo_sender") /FIELD=(transferBatch_batchControlInfo_recipient, POS=2, SEP=”\t”,ODEF="transferBatch_batchControlInfo_recipient") /FIELD=(transferBatch_batchControlInfo_fileSequenceNumber, POS=3, SEP=”\t”,ODEF="transferBatch_batchControlInfo_fileSequenceNumber") /FIELD=(transferBatch_batchControlInfo_fileCreationTimeStamp_localTimeStamp, POS=4, SEP=”\t”,ODEF="transferBatch_batchControlInfo_fileCreationTimeStamp_localTimeStamp") /FIELD=(transferBatch_batchControlInfo_fileCreationTimeStamp_utcTimeOffset, POS=5, SEP=”\t”,ODEF="transferBatch_batchControlInfo_fileCreationTimeStamp_utcTimeOffset") /FIELD=(transferBatch_batchControlInfo_transferCutOffTimeStamp_localTimeStamp, POS=6, SEP=”\t”,ODEF="transferBatch_batchControlInfo_transferCutOffTimeStamp_localTimeStamp") /FIELD=(transferBatch_batchControlInfo_transferCutOffTimeStamp_utcTimeOffset, POS=7, SEP=”\t”,ODEF="transferBatch_batchControlInfo_transferCutOffTimeStamp_utcTimeOffset") /FIELD=(transferBatch_batchControlInfo_fileAvailableTimeStamp_localTimeStamp, POS=8, SEP=”\t”,ODEF="transferBatch_batchControlInfo_fileAvailableTimeStamp_localTimeStamp") /FIELD=(transferBatch_batchControlInfo_fileAvailableTimeStamp_utcTimeOffset, POS=9, SEP=”\t”,ODEF="transferBatch_batchControlInfo_fileAvailableTimeStamp_utcTimeOffset") ……….
The image below shows the output of TAP3 BER-encoded data (top portion of image) to a comma-delimited text file.
Example 5: Synthesizing a BER-encoded TAP3 Test File
The tapgen.rcl.txt file in the examples folder linked at the beginning of the post displays an example of synthesizing BER-encoded data that adheres to the standard TAP3 schema. This script could fine-tuned to generate a larger range of realistic and random data (but still within the constraints of the TAP3 specification), but it does show a simple method of generating a TAP3-compliant file.
Truncated script:
/INFILE=rfp /PROCESS=RANDOM /INCOLLECT=1 /FIELD=(transferBatch_batchControlInfo_sender, POSITION=1, SEPARATOR=",",SET={5052594854}) /FIELD=(transferBatch_batchControlInfo_recipient, POSITION=2, SEPARATOR=",",SET={484B474854}) /FIELD=(transferBatch_batchControlInfo_fileSequenceNumber, POSITION=3, SEPARATOR=",",SET={3030303033}) /FIELD=(transferBatch_batchControlInfo_fileCreationTimeStamp_localTimeStamp, POSITION=4, SEPARATOR=",",SET={3230303430323034313134343438}) /FIELD=(transferBatch_batchControlInfo_fileCreationTimeStamp_utcTimeOffset, POSITION=5, SEPARATOR=",",SET={2D30343030}) /FIELD=(transferBatch_batchControlInfo_transferCutOffTimeStamp_localTimeStamp, POSITION=6, SEPARATOR=",",SET={3230303430323034313134343438}) /FIELD=(transferBatch_batchControlInfo_transferCutOffTimeStamp_utcTimeOffset, POSITION=7, SEPARATOR=",",SET={2D30343030}) /FIELD=(transferBatch_batchControlInfo_fileAvailableTimeStamp_localTimeStamp, POSITION=8, SEPARATOR=",",SET={3230303430323034313134343438}) /FIELD=(transferBatch_batchControlInfo_fileAvailableTimeStamp_utcTimeOffset, POSITION=9, SEPARATOR=",",SET={2D30343030}) ………. /REPORT /OUTFILE="TAP-0310.asn;tapgen.ber" /PROCESS=ASN1 /FIELD=(transferBatch_batchControlInfo_sender, POSITION=1, SEPARATOR=",") /FIELD=(transferBatch_batchControlInfo_recipient, POSITION=2, SEPARATOR=",") /FIELD=(transferBatch_batchControlInfo_fileSequenceNumber, POSITION=3, SEPARATOR=",") /FIELD=(transferBatch_batchControlInfo_fileCreationTimeStamp_localTimeStamp, POSITION=4, SEPARATOR=",") /FIELD=(transferBatch_batchControlInfo_fileCreationTimeStamp_utcTimeOffset, POSITION=5, SEPARATOR=",") /FIELD=(transferBatch_batchControlInfo_transferCutOffTimeStamp_localTimeStamp, POSITION=6, SEPARATOR=",") /FIELD=(transferBatch_batchControlInfo_transferCutOffTimeStamp_utcTimeOffset, POSITION=7, SEPARATOR=",") /FIELD=(transferBatch_batchControlInfo_fileAvailableTimeStamp_localTimeStamp, POSITION=8, SEPARATOR=",") /FIELD=(transferBatch_batchControlInfo_fileAvailableTimeStamp_utcTimeOffset, POSITION=9, SEPARATOR=",") ……….
Example 6: TAP3 BER-encoded file to JSON
The input is a non-human readable, BER-encoded file based on the TAP3 ASN.1 schema.
The input looks like this when opened in a basic text editor.
SortCL can easily translate this to JSON, however. In the image below,the SortCL script top left is used to make this transformation to the JSON file shown in the bottom middle of the image. The job makes use of a sortcl-compatible Data Definition Format (DDF) file containing the field definitions; a small part of that is shown top right.
The DDF file can be generated easily in an interactive and visual way through the Metadata Discovery wizard in IRI Workbench, which is also subsumed in the Data Source definition pages of most of the fit-for-purpose new job wizards in Workbench. Alternatively, the executable asn1_2ddf program provides a more batch-able, automated approach to generating DDF files for ASN.1-encoded data.
There are many functions that could have been applied to this data, such as sorting by field(s), performing selective encryption or pseudonymization, adding fields, and so much more. However, this script simply acts as a converter of the ASN.1-encoded data to a more human readable JSON format.
Example 7: Reporting on one PDU from an ASN.1 file defining several PDUs
This is for e1ap, a protocol related to 5G.
Selecting from a specific PDU:
This job gets information from the PDU with the type name TimeToWait. e1ap has many PDUs, but one must be chosen. In TAP3, however, there is a single PDU that can be referenced called DataInterChange. In that case, the PDU does not need to be specified since all types map out to that single PDU.
Script:
/INFILE=”e1ap.asn,PER,TimeToWait;E1AP-PDU_Reset.per” /PROCESS=ASN1 /FIELD=(FIELD1,POSITION=1,SEPARATOR=",") /REPORT /OUTFILE=e1appdu1.out
Output:
v1s v1s v1s v2s v1s v1s v1s v1s v10s v1s v1s v1s v1s v1s v1s v20s v1s v1s v1s v1s v1s v1s v1s v1s
Example 8: NG application protocol for 5G -> Simple report of selected PDU to text file
This script (ngap.scl) references a specific PDU that is used to interpret the data message with, from an ASN.1 schema that contains multiple PDUs. The field layout can be generated by ASN1_2DDF. The script will report the data to a text file.
Script:
/INFILE="ngap.asn,PER,NGAP-PDU;NGAP-PDU_HandoverRequest.per" /PROCESS=ASN1 /FIELD=(initiatingMessage_procedureCode, POSITION=1, SEPARATOR=",") /FIELD=(initiatingMessage_criticality, POSITION=2, SEPARATOR=",") /FIELD=(initiatingMessage_value, POSITION=3, SEPARATOR=",") /FIELD=(successfulOutcome_procedureCode, POSITION=4, SEPARATOR=",") /FIELD=(successfulOutcome_criticality, POSITION=5, SEPARATOR=",") /FIELD=(successfulOutcome_value, POSITION=6, SEPARATOR=",") /FIELD=(unsuccessfulOutcome_procedureCode, POSITION=7, SEPARATOR=",") /FIELD=(unsuccessfulOutcome_criticality, POSITION=8, SEPARATOR=",") /FIELD=(unsuccessfulOutcome_value, POSITION=9, SEPARATOR=",") /REPORT /OUTFILE=ngapPDU.out
Output:
12,reject,000006000A000320303900550003401A85001D000100000F40018A0069000F00AABBCC1001234500ABCDEF123456006500020112,,,,,,
For additional examples, check out the ASN.1 sample repository.
Wrap Up
An array of examples have been demonstrated in this article to give an idea of some basic ways to process or generate ASN.1 encoded data. In the following article, the fourth of the five part series, support for the ASN.1 process in IRI Workbench will be discussed and demonstrated.
Article Links: Other articles in the series:
- Introduction to ASN.1
- ASN.1 Integration with SortCL
- Using IRI Workbench with ASN.1 encoded data
- Gaining insight from Call Detail Records