Segmentation by yantingting

VIEWS: 8 PAGES: 7

									                                                                           Contribution #: [JM0401-122-1]


                                       CONTRIBUTION

Project:               ANSI Std C12.22

Title:                 Segmentation

Author(s):             Avygdor Moise

Contact:               Name: Avygdor Moise
                       Organization: Future DOS R&D Inc.
                       Address: #303, 6707 Elbow Drive S.W. Calgary, Alberta, Canada T2V 0E5
                       Tel: 403 616 8634
                       Fax: 403 203 7071
                       Email: avy@fdos.ca

Related                Wk0307, JM0401-120-1 definitions
Document(s):
Supersedes

Submission Date:       January 28, 2004

Distribution:          ANSI C12 SC17 members
                       MC Task Force
Abstract:              This contribution introduces a Application segmentation sub layer specification
                       and moves the C12.22 Segmentation protocol from the Application Layer to the
                       Application segmentation sub layer. It then updates the information to ensure
                       consistency with the rest of the working document.
Objectives             OSI Compliance of services
addressed and/or
introduced:
Summary of             Section 6.3.3.15 moved to 6.3.4. with changes as per this document.
modifications to the
Standard Document:




                                                                                                    1
Disclaimer:
This contribution has been prepared to assist the work of ANSI C12-17 sub-committee. This document is
offered as a basis for discussion in accordance with the submission rules of this sub-committee.
                                                                                                    2
Disclaimer:
This contribution has been prepared to assist the work of ANSI C12-17 sub-committee. This document is
offered as a basis for discussion in accordance with the submission rules of this sub-committee.
6.3.4 Application segmentation sub-layer
The Application segmentation sub-layer provides for C12.22 Segmentation
capability. When segmentation is supported it shall be accomplished through
the construction of sufficient number of C12.22 Segments each shall contain a
fragment of the original <asce-pdu> in a manner that facilitates the effective
transmission of the un-fragmented <acse-pdu> to the next C12.22 Node on the
path to the target C12.22 Node. The detailed implementation algorithm for APDU
Segmentation is described in the following sub-sections.

The Application segmentation sub-layer shall also be responsible for the re-
assembly of all C12.22 Segments received from the Transport Layer prior to
delivery to the Application Layer.

It may further segment or re-assemble C12.22 Fragment as needed to optimize
the performance of the C12.22 Network when implemented in a C12.22 Relay.


6.3.4.1 APDU Segmentation
APDUs as defined by <acse-pdu> are used to request services and transfer
payloads. APDUs are delivered to the lower layers in the OSI stack for
encapsulation, address resolution and subsequent transmission to its
destination through the Transport Layer. In general, the Application Layer
does not have knowledge (nor should it have any such knowledge) of network
segment size and transmission constraints and similarly the Application
segmentation sub-layer does not have any knowledge of the limits that may be
imposed by the remote Application Layer or remote Application segmentation
sub-layer. However, these limits can be discovered through the use of the
<called-apinvocation-id-element> in <acse-pdu> error responses.

When limits exist and the native transmission protocol does not provide
segmentation services, the C12.22 Application Layer may take one of the
following actions:

   1. Submit the <acse-pdu> as a whole without attempting to segment it. This
      approach assumes that the APDU may be “lost” or an error response may be
      received from the next C12.22 Node that participates in the transmission
      of this <acse-pdu>; or
   2. Construct a <sgns> error response APDU and deliver it to its own
      Application Layer process; or
   3. Break the APDU into appropriately sized segments and deliver each
      segment in turn to the next C12.22 Node that participates in the
      transmission of this <acse-pdu>. Each APDU Segment is encapsulated as an
      <acse-pdu> which has the Invocation ID Element <calling-apinvocation-id-
      element>, and one non-overlapping fragment of the original Application
      Layer supplied <acse-pdu>.

The following subsections detail the APDU Segmentation algorithm, segment size
discovery algorithm and error exception reporting algorithm. Conforming
implementations may optimize it or alter algorithm as long as they adhere to
the production rules expressed by this standard.

6.3.4.2 The segmentation algorithm
This sub-section assumes that the Application segmentation sub-layer is
capable of segmentation, and it can fragment an APDU into appropriately sized
segments for transmission.


                                                                                                    3
Disclaimer:
This contribution has been prepared to assist the work of ANSI C12-17 sub-committee. This document is
offered as a basis for discussion in accordance with the submission rules of this sub-committee.
Under the above assumption, if a C12.22 Node’s Transport Layer interface
cannot transmit a C12.22 Datagram due to imposed limits of Datagram size the
Application segmentation sub-layer shall proceed and fragment the APDU as
follows:

1. Extract the <seg-sequence-number> from the <calling-apinvocation-id-
   element>. This value should be retained for subsequent association with
   error or information reports for a period not exceeding the period set for
   duplicate datagram rejection.
2. The Application segmentation sub-layer allocates sufficient buffers for the
   transmission of all of the smaller segments.
3. If the Application segmentation sub-layer fails to allocate sufficient
   buffers for the transmission of any of the smaller segments it shall return
   the error <sgnp> to the Application Layer, as outlined later on in this
   section. A report of <sgnp> to the Application Layer shall be interpreted
   as information for the Application Layer instructing it to reduce its
   future service request or response sizes such that it can be delivered by
   the Transport Layer.
4. If the <acse-pdu> being fragmented is a not product of an earlier
   segmentation (by virtue the absence of the <calling-apinvocation-id-
   element>’s fields <segment-byte-offset> and <apdu-size>) then
    Copy the entire un-segmented <acse-pdu> into a datagram capture buffer.
      This includes all the <acse-pdu> components: the byte 60H, <elements-
      length> and <elements> unaltered.
    Split the captured data buffer into smaller non-overlapping fragments
      that are suitable (size-wise) for inclusion into the newly generated
      <acse-pdu> segments.
    For each fragment of the datagram capture buffer build a new <acse-pdu>
      by placing a datagram capture buffer fragment into the <user-
      information-element>’s <app-data> and setting the <app-data-length> to
      the size of the datagram capture buffer corresponding fragment in bytes.
    Create the following fields ahead of the <user-information-element>:
         o <called-ap-title> derived from the un-segmented <acse-pdu> and
            ancillary information that may be available to the Application
            Layer.
         o <calling-ap-title> derived from the un-segmented <acse-pdu> and
            ancillary information that may be available to the Application
            Layer.
         o <calling-apinvocation-id-element> then within the <calling-
            apinvocation-id-element:
                Set the <seg-id>’s <seg-sequence-number> to the <seg-
                   sequence-number> previously extracted from the fully
                   assemble APDU, as all related segments shall have the same
                   <seg-sequence-number>.
                Set the <seg-id>’s <segment-byte-offset> to the fragment’s
                   byte offset relative to the beginning of the datagram
                   capture buffer.
                Set the <seg-id>’s <apdu-size> to the size of the fully
                   assembled <acse-pdu> as stored in the datagram capture
                   buffer, including all the <acse-pdu> components such as the
                   byte 60H, <elements-length> and all unaltered <elements>.
                Set the data type (word length in bytes) of the <segment-
                   byte-offset> by subtracting the field size of <seg-sequence-
                   number> from the value of <seg-id-length> then dividing the
                   result by 2. The value 1, 2 or 3 shall be obtained
                   representing <byte>, <word16>, and <word24> respectively.
    Append the previously constructed <user-information-element>, to the end
      of the <acse-pdu>.

                                                                                                    4
Disclaimer:
This contribution has been prepared to assist the work of ANSI C12-17 sub-committee. This document is
offered as a basis for discussion in accordance with the submission rules of this sub-committee.
    Update the <acse-pdu>’s <elements-length>.
    Finish the sending the fragments to its Transport Layer.
5. If the <acse-pdu> being fragmented is a product of a previous segmentation
   (by virtue the presence of the <calling-apinvocation-id-element>’s fields
   <seg-sequence-number>, <segment-byte-offset> and <apdu-size>) then
    Copy all the <acse-pdu>’s <elements> excluding the element <user-
      information-element> to the target <acse-pdu> construction area.
    Copy the segment’s <app-data> portion from the <acse-pdu>’s <user-
      information-element> into a datagram capture buffer.
    Split the captured datagram buffer into smaller non-overlapping
      fragments that are suitable (size-wise) for inclusion into the newly
      generated <acse-pdu> segments.
    Adjust all length and offset fields in each of the resulting <acse-pdu>
      segments. Specifically adjust each
         o <user-information-element>’s <app-data-length> to the length of
            the newly reduced data fragment in bytes.
         o <seg-id>’s <segment-byte-offset> being the fragment’s revised
            <app-data> location in the fully-assembled <acse-pdu> as
            originally delivered by its Application Layer. This new segment
            offset can be computed by adding the <acse-pdu>’s <segment-byte-
            offset>, which is being segmented, to the byte offset of the new
            segment’s <app-data> relative to the beginning of the <app-data>
            portion in the datagram capture buffer.
    Update the <acse-pdu>’s <elements-length>.
    Finish the sending the fragments to the Transport Layer.


6.3.4.3 The reassembly algorithm
This sub-section assumes that the Application segmentation sub-layer layer is
capable of reassembly, and it can assemble all APDU fragments received from
its Transport Layer, into the original <acse-pdu> then deliver it to the
Application Layer.

If the Application segmentation sub-layer cannot perform the re-assembly then
it may issue a <sgns> error as outlined later in this section. It shall then
discard all related incoming APDUs from its Transport Layer.

Assuming the above, when the datagram is received from the Transport Layer is
a segment of a fragmented <acse-pdu> (by virtue the presence of the <calling-
apinvocation-id-element>’s fields <seg-sequence-number>, <segment-byte-offset>
and <apdu-size>) the Application segmentation sub-layer shall reassemble the
APDU before delivering it to the C12.22 Application Layer. Reassembly is not
required for strictly forwarding functions, such as C12.22 Relays. However,
any C12.22 Relay may choose, at its option, to perform full or partial APDU
reassembly based on their system’s requirements and knowledge.

The reassembly algorithm is outlined below:

1. Allocate an <acse-pdu> re-assembly buffer that is capable of holding the
   APDU <seg-id>’s <apdu-size> in bytes. This field is found in the <calling-
   apinvocation-id-element> elements.
2. For each segment received copy the <app-data> portion of the <user-
   information-element> into the buffer at the offset specified by the <seg-
   id>’s <segment-byte-offset> of the <calling-apinvocation-id-element> up to
   length specified in the <user-information-element>’s <app-data-length> in
   bytes.

                                                                                                    5
Disclaimer:
This contribution has been prepared to assist the work of ANSI C12-17 sub-committee. This document is
offered as a basis for discussion in accordance with the submission rules of this sub-committee.
3. Repeat step 2 above until all segments have been received. All segments
   were received when the <acse-pdu> re-assembly buffer contains no gaps or
   the duplicate packer recognition period expires.
4. If all segments were received with no gaps in the user data then forward
   the re-assembled buffer to its Application Layer for processing.
5. If all segments were received and there are gaps in the user data, discard
   all segments silently.

6.3.4.4 Segment size discovery and error reporting algorithm
Remote Transport Layers or C12.22 Application segmentation sub-layers or
C12.22 Application Layers may have the capacity to indicate that the <acse-
pdu> received is larger than what they can received; or the service requested
may result in an Application Layer response that may generate an <acse-pdu>
that is too large for them to generate. When any one of these conditions
arises, the remote C12.22 Node, at its option, may generate one of the
following error responses:

<sgns>

         This error will be returned any participating C12.22 Application
         segmentation sub-layer that encounters a non-cooperating entity, leading
         to the conclusion that it is not possible to deliver the APDU to the
         target C12.22 Node.

         When this error is received by the Application segmentation sub-layer
         Layer it may take one of the following actions:
             If <called-aptitle-element> matches one of its registered C12.22
               ApTitles then it shall forward the response to its own Application
               Layer.
             If <called-aptitle-element> does not match any of its registered
               C12.22 ApTitles and it is a C12.22 Relay then it shall forward it
               to the target Application Layer).
             Otherwise it may silently discard the error response.


<sgnp>
         This may be C12.22 Application segmentation sub-layer error indication.
         The recipient of this indication may be the C12.22 Application
         segmentation sub-layer or the C12.22 Application Layer, subject to the
         conditions which triggered this error.

         If the Application segmentation sub-layer is presented with an <acse-
         pdu> from its own Application Layer, and the APDU is too large to for it
         to process it may respond with <sgnp> error <acse-pdu> to its own
         Application Layer. Regardless on whether it issues the <sgnp> error; it
         shall discard the offending <acse-pdu>.

         The Application segmentation sub-layer shall deliver the <acse-pdu> to
         its Application Layer when:

              It is presented with an <acse-pdu> from its own Transport Layer,
               having a <called-apinvocation-id-element>, which contains a <seg-
               id> with only the <seg-sequence-number> element; or
              It is presented with an <acse-pdu> from its own Transport Layer,
               having a <called-apinvocation-id-element>, which contains a <seg-
               id> with <seg-sequence-number> and <segment-byte-offset> of zero.


                                                                                                    6
Disclaimer:
This contribution has been prepared to assist the work of ANSI C12-17 sub-committee. This document is
offered as a basis for discussion in accordance with the submission rules of this sub-committee.
       The Application segmentation sub-layer shall then interpret the <called-
       apinvocation-id-element>’s <apdu-size> as being the largest possible
       <acse-pdu> that can be delivered in relation to the request that was
       last issued by the Application Layer to the <calling-aptitle-element>
       from the <called-aptitle-element> using <seg-sequence-number> found in
       the <called-apinvocation-id-element>.

       Otherwise, the C12.22 Application segmentation sub-layer shall re-
       segment all segments that match <called-apinvocation-id-element>’s <seg-
       sequence-number> and exceed the maximum segment size as requested in the
       <called-apinvocation-id-element>’s <apdu-size> then re-send them to its
       Transport Layer. In doing so it shall recall the values of <seg-
       sequence-number> and <apdu-size> that it originally used those segments
       and place them in the <calling-apinvocation-id-element>.


All other error and non error APDUs shall be delivered to its Application
Layer subject to the reassembly algorithm rules.




                                                                                                    7
Disclaimer:
This contribution has been prepared to assist the work of ANSI C12-17 sub-committee. This document is
offered as a basis for discussion in accordance with the submission rules of this sub-committee.

								
To top