directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Directory Wiki] Update of "Asn1Home" by EmmanuelLecharny
Date Sun, 04 Sep 2005 10:25:45 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Directory Wiki" for change notification.

The following page has been changed by EmmanuelLecharny:
http://wiki.apache.org/directory/Asn1Home

------------------------------------------------------------------------------
  
  We have depicted three layers :
   * Request/Response : This is the more abstract layer. Exchanged messages are 'human readable'.
Each message is a Java Bean, containing all the information about a Request or a Response.
-  * PDU : As communication petween the Client and the Server is done through a network, we
need to transform the beans to something more 'network friendly'. The data are stored in PDU,
or '''P'''acket '''D'''ata '''U'''nit. Those PDU contain an encoded form of messages, specified
in [http://www.faqs.org/rfcs/rfc2251.html RFC 2251] and [http://asn1.elibel.tm.fr/en/standards/index.htm
ASN.1]
+  * [#PDU PDU] : As communication petween the Client and the Server is done through a network,
we need to transform the beans to something more 'network friendly'. The data are stored in
PDU, or '''P'''acket '''D'''ata '''U'''nit. Those PDU contain an encoded form of messages,
specified in [http://www.faqs.org/rfcs/rfc2251.html RFC 2251] and [http://asn1.elibel.tm.fr/en/standards/index.htm
ASN.1]
   * [http://java.sun.com/j2se/1.4.2/docs/api/java/nio/ByteBuffer.html ByteBuffers] : To transfer
PDU from/to Client to/from Server, we need to store bytes in a structure that will permit
to deal with network latency. Thus we are using byte buffers, which allow us to send pieces
of PDU until the whole PDU has been transmitted. (Note : [http://java.sun.com/j2se/1.4.2/docs/api/java/nio/ByteBuffer.html
ByteBuffer] is also a Java NIO class, but can be seen just as a byte container. It could have
been something totally different from the NIO class).
  
  This layering allows many different implementations. 
@@ -41, +41 @@

  
  Ideally, they are generated by an '''ASN.1''' compiler, but can be hand crafted.
  
+ 
  === PDUs/TLVs ===
  
  PDU stands for '''P'''acket '''D'''ata '''U'''nit. An ASN.1 encoded element is stored in
a PDU. This is what is transfered between a client and a server.
@@ -48, +49 @@

  TLV stands for '''Type/Length/Value'''. A PDU is made of '''TLV'''s. Each '''TLV''' represent
either a primitive element, and it has a '''V'''alue, or a constructed element, and the '''V'''alue
is itself one ore more '''TLV''' (The '''V''' can contain more than one '''TLV'''). The '''PDU'''
structure is like a tree, where the '''PDU''' is the whole tree, and where '''TLV''' are leaves
(primitives) and branches (constructed)
  
  Further information about '''TLV'''s can be found here :
-  * ["TLVPageInfo"]: Informations about '''Tlv'''s
+  * ["TLV Page Info"]: Informations about '''Tlv'''s
  
  === ByteBuffer ===
  Buffering the incoming request or the ourgoing response is essential. As a request or a
response can be hudge (for exampole, if we want to store images), it is necessary to store
bytes in buffers in order to be able to pipeline the processing. Flushing informations byte
by byte is totally insane, from the network point of view.
@@ -73, +74 @@

   * the first pass compute each length
   * the second pass generate the '''PDU'''
  
- This is the way it's done.
+ The ["Encoding Asn.1"] page gives informations about the encoding process.
  
  === Decoder ===
- The decoding process is an infinite loop that can read a '''PDU'''.
+ The decoding process is a loop which reads PDUs and constructs objects on the fly. It can
stop and restart without loosing information, as PDU may be very long (it also means that
we must store a current state for each decoding).
  
- TODO
+ The ["Decoding Asn.1"] page gives informations about the encoding process.
  
  === Performance ===
  TODO : performance against memory/scalability/failover
@@ -88, +89 @@

  
  == Implementations ==
  Two codecs are currently available :
-  * [http://wiki.apache.org/directory/LdapCodec Ldap codec] which encodes and decodes LDAP
messages
-  * [http://wiki.apache.org/directory/SpnegoCodec Spnego codec] which encodes an decodes
SPNEGO messages
+  * ["Ldap codec"] which encodes and decodes LDAP messages
+  * ["Spnego codec"] which encodes an decodes SPNEGO messages
  

Mime
View raw message