Presentation is loading. Please wait.

Presentation is loading. Please wait.

BER ENCODING Basic Encoding Rules. Basic Encoding Rules What is it?  BER is the original rules laid out by the ASN.1 standard for encoding information.

Similar presentations


Presentation on theme: "BER ENCODING Basic Encoding Rules. Basic Encoding Rules What is it?  BER is the original rules laid out by the ASN.1 standard for encoding information."— Presentation transcript:

1 BER ENCODING Basic Encoding Rules

2 Basic Encoding Rules What is it?  BER is the original rules laid out by the ASN.1 standard for encoding information into octet string.

3 Basic Encoding Rules What it does?  Facilitates the exchange of structured data especially between application programs over networks by describing data structures in a way that is independent of machine architecture and implementation language.  To send data through the network one needs to encode it to a string of bits. ASN.1 defines various algorithms to accomplish that task, called Encoding rules. There are plenty of them; the standard is the Basic Encoding Rules (BER).

4 Basically, BER is used for Encoding abstract information into concrete data stream independent to the machine architecture and implementation language.

5 Basic Encoding Rules How it works?  BER uses a form of encoding commonly known as Tag-Length-Value or Type-Length-Value. Each item is encoded as a tag, indicating what type it is, a length indicating the size of the object, and a value, which contains the actual contents of the object.  There are three methods to encode an ASN.1 value under BER, the choice of which depends on the type of value and whether the length of the value is known.

6 BER encoding methods:  Primitive, definite-length encoding  Constructed, definite- length encoding  Constructed, indefinite-length encoding Every method has 3-4 parts:  Identifier octets - These identify the class and tag number of the ASN.1 value, and indicate whether the method is primitive or constructed.  Length octets. - For the definite-length methods, these give the number of contents octets. For the constructed, indefinite-length method, these indicate that the length is indefinite.  Contents octets. - For the primitive, definite-length method, these give a concrete representation of the value. For the constructed methods, these give the concatenation of the BER encodings of the components of the value  End-of-contents octets. - For the constructed, indefinite- length method, these denote the end of the contents. For the other methods, these are absent.

7 Example encoding the instance “CPE”,51,”A” 1A5String sampleString1= “CPE” 1A5String sampleString2= “A”,” INTEGER sampleInt = 51 I L CI L CI L C 16 03 67 80 6902 0133160165 CPE51A Identifier octets 16(hex) = 00010110(binary) Identifier octets Type Length octets Length Contents octets Value 8bit7bit6bit5bit4bit3bit2bit1bit Class 0 0 P/C 0 Tag Number 1 0 1 1 0

8 Classbit 8bit 7description Universal00 The type is native to ASN.1 Application01 valid for one specific application Context- specific 10 depends on the context Private11 Defined in private specifications P/Cbit 6 Primitive0 Constructed1 8bit7bit6bit5bit4bit3bit2bit1bit Class 0 0 P/C 0 Tag Number 1 0 1 1 0


Download ppt "BER ENCODING Basic Encoding Rules. Basic Encoding Rules What is it?  BER is the original rules laid out by the ASN.1 standard for encoding information."

Similar presentations


Ads by Google