Skip to content

Latest commit

 

History

History
242 lines (219 loc) · 15.4 KB

bpv6_notes.md

File metadata and controls

242 lines (219 loc) · 15.4 KB

Bundle Protocol Version 6 Notes

1. Protocol Compliance and Tailoring 2. Bundle Formats


1. Protocol Compliance and Tailoring


1.1 Endpoint IDs

  • Compressed Bundle Header Encoding (CBHE) is used on all generated data bundles.
  • The only addressing schema supported by the BP library is the "ipn" schema defined in RFC6260.
  • The format of endpoint IDs as defined by this schema are "ipn:{node}.{service}" where {node} and {service} are unsigned integers encoded as SDNVs in the bundle header block.
  • Constant static data structures declared in the code set the size of all endpoint IDs. All {node} numbers are 28 bits (which occupies 32 bits of bundle memory encoded as an SDNV), and all {service} numbers are 14 bits (which occupies 16 bits of bundle memory encoded as an SDNV).
  • The convention used by the BP library is that {node} number identifies the endpoint application agent and the {service} number identifies a flow of data that is able to be processed by the application agent.
  • All endpoints are treated as singletons and marked as such in the PCF, even for forwarded bundles.

1.2 Fixed Size SDNVs

  • The BP library uses fixed sized SDNVs for all SDNV fields of generated bundles.
  • Bundles that are received by the library can have any size SDNV as long as the encoded value fits within the unsigned long integer for the local platform the library is compiled on.

1.3 Creation Time Sequence

  • The BP library does not reset the creation time sequence number, but maintains a strictly incrementing value (stepped by one for each successive bundle created) per channel. This allows receiving nodes to detect gaps in the data and allows reconstruction of the original sending order of the data.

1.4 Lifetimes

  • The BP library calculates an absolute time for a bundles expiration at the time the bundle is created.
  • The expiration time is checked prior to transmission and on receipt (in bplib_load and bplib_process functions).
  • A value of zero has special meaning when using bplib and specifies an infinite lifetime, this is different than the protocol specification which interprets zero as an immediate expiration. In order to be compatible with other BP nodes, ULONG_MAX - 1 should be used to set the maximum lifetime (136 years on 32-bit machine).
  • The lifetime setting of a bundle is the minimal amount of time the bundle will remain in the system. It is possible and likely that the bundle will exist in the system and consume storage resources longer than its lifetime as the lifetime is only checked at certain points in the code. What can be said is that a bundle with an expired lifetime will not be transmitted by the library, nor will the payload of an expired bundle be passed to the application.

1.5 Administrative Records

  • The only supported administrative record type is the aggregate custody signal, all other record types are ignored.
  • The report to EID for bundles generated by this library is set to the null EID.

1.6 DTN Aggregate Custody Signaling

  • The BP library only supports custody transfers when DTN Aggregate Custody Signals are used. Regular RFC5050 custody signals are not supported. A custody signal bundle received by the library is ignored.
  • A data bundle received by the library that is requesting custody transfer without a CTEB is dropped.
  • ACS acknowledgments are delivered to the “custodian” node and service provided in the bundle.
  • The rate that ACS bundles are sent is controlled via a receiver node configuration setting. The BP library has a run-time defined maximum number of fills per ACS, and a dynamically configurable setting for the longest time a partially full ACS bundle can remain in memory before it is sent.
  • Only positive acknowledgements are generated (i.e. ACS bundles mark the appropriate fields indicating positive acknowledgment of custody transfer). This means that the lifetime of a bundle and the timeout setting of the sending bundle agent completely define the bundle’s retransmission behavior.

1.7 Bundle Integrity

  • The BP library inserts a BIB in all data bundles it generates and all data bundles it accepts custody of for forwarding.
  • Bundles received by the library are not required to have BIBs, but if they do, then the bundle is verified against the BIB prior to accepting custody (if requested) and processing the payload (if destined for the local node).

1.8 Timeouts

  • Timeout processing is not fully implemented. The library keeps track of active bundles (i.e. bundles that have been sent but not acknowledged) in a circular buffer of bundle references that maintain strictly incrementing custody IDs. When the application requests a bundle to be loaded, only the oldest active bundle is checked for a timeout.
  • If CID_REUSE is set, then the age of the bundle is measure against the first time it was sent; otherwise if CID_REUSE is not set, then the age of the bundle is measure against the most recent time it was sent.
  • If the circular buffer wraps and the oldest active bundle has not timed out, then onboard transmission of bundles stop until the oldest bundle times out.

1.9 Class of Service

  • The class of service of generated data bundles and received bundles is set to normal and otherwise completely ignored.

1.10 Fragmentation

  • Custody transfer is requested per fragment. In other words, each fragment has its own CTEB.
  • A fragment of a bundle that requests custody transfer, and is sent to an intermediary hop, is acknowledged and forwarded by that hop without requiring the entire original bundle to be reconstituted. Even though it is not required, there is also no assumed constraint on the fragment being further fragmented, or combined with other fragments if they are available.
  • Bundle integrity via the BIB is always applied to each fragment. If the library generates fragmented bundles, it will put a BIB in each fragment. If a bundle with a BIB is received that is to be forwarded, and needs to be fragmented, then the BIB is checked upon receipt, and then that original BIB is dropped. The outgoing fragmented bundles will all have their own BIB generated by the library. This applies even when the BIB block flags indicate that the block is to be kept.

1.11 Routing

  • If a BP library channel receives bundles to be forwarded then the pre-build bundle headers are marked as dirty and rebuilt when the local node generates bundles of its own to be sent. The result is a temporary loss of performance.
  • When a call to the BP library returns a bundle, it will set a flag if the bundle needs to be routed to a different destination than the channel’s default destination.
  • When routing bundles, the BP library will associate any bundle with a destination {node} that matches its local {node} number as being destined for itself and will then require that the {service} number matches the channel's {service} number that it is being processed on. Any bundle with a {node} that is different than its local {node} number is treated as a bundle that needs to be routed.
  • A service number of 0 is considered a global service and is allowed to be passed to any channel associated with the node.

1.12 Payload Block

  • The library assumes that the last block of every bundle is the payload block and stops processing the bundle when the payload block is reached.

1.13 Bundle Protocol Agent (BPA) Services

  • The concept of a BPA corresponds to a bundle channel.
  • There is no concept of switchin between an Active and Passive state for the BPA. A registration is commenced when a channel is opened, and terminated when a channel is closed.
  • There is no concept of polling the state of the BPA as there is no concept of an Active or Passive state.
  • Bundles are transmitted via the bplib_store and bplib_load APIs, but transmission cannot be cancelled.
  • Bundles are delivered via the bplib_process and bplib_accept APIs.

2. Bundle Formats


2.1 Data Bundle

 -------------------------------------------------
                    Data Bundle
 -------------------------------------------------
 |-----------------------------------------------|
 |                                               |
 |              Primary Bundle Block             |
 |                                               |
 |-----------------------------------------------|
 |                                               |
 |        Custody Transfer Extension Block       |
 |                                               |
 |-----------------------------------------------|
 |                                               |
 |             Bundle Integrity Block            |
 |                                               |
 |-----------------------------------------------|
 |                                               |
 |              Bundle Payload Block             |
 |                                               |
 |-----------------------------------------------|

2.2 DTN Aggregate Custody Signal (DACS)

 -------------------------------------------------
             Aggregate Custody Signal
 -------------------------------------------------
 |-----------------------------------------------|
 |                                               |
 |              Primary Bundle Block             |
 |                                               |
 |-----------------------------------------------|
 |                                               |
 |             Bundle Integrity Block            |
 |                                               |
 |-----------------------------------------------|
 |                                               |
 |              Bundle Payload Block             |
 |    (ACS as administrative record in payload)  |
 |                                               |
 |-----------------------------------------------|

2.3 Primary Bundle Block: Compressed Bundle Header Encoding (CBHE)

 -------------------------------------------------
               Primary Bundle Block
 -------------------------------------------------
 |    MSB    |           |           |    LSB    |
 | (8 bits)  | (8 bits)  | (8 bits)  | (8 bits)  |
 |-----------|-----------|-----------|-----------| 0
 |  Version  |     Processing Control Flags      |
 |-----------|-----------------------------------| 4
 |  Blk Len  |         Destination Node ...
 |-----------|-----------------------|-----------| 8
      ...    |  Destination Service  |    ...
 |-----------|-----------------------|-----------| 12
          ... Source Node            |   Source
 |-----------|-----------------------|-----------| 16
    Service  |         Report To Node ...
 |-----------|-----------------------|-----------| 20
      ...    |   Report To Service   |    ...
 |-----------|-----------------------|-----------| 24
          ... Custody Node           |  Custody
 |-----------|-----------------------|-----------| 28
    Service  |    Creation Timestamp Seconds
 |-----------|-----------------------|-----------| 32
     ...                             | Timestamp
 |-----------|-----------------------|-----------| 36
   Sequence  |       Lifetime ...
 |-----------|-----------------------|-----------| 40
     ...                             | Dict Len  |
 |-----------------------------------|-----------| 44
 |                Fragment Offset                |
 |-----------------------------------------------| 48
 |                Payload Length                 |
 |-----------------------------------------------| 52

2.4 Custody Transfer Enhancement Block (CTEB)

 -------------------------------------------------
        Custody Transfer Enhancement Block
 -------------------------------------------------
 |    MSB    |           |           |    LSB    |
 | (8 bits)  | (8 bits)  | (8 bits)  | (8 bits)  |
 |-----------|-----------|-----------|-----------|
 |                                               |
 |              Primary Bundle Block             |
 |                                               |
 |-----------|-----------|-----------------------|
 .           .           .                       .
 |-----------|-----------|-----------|-----------| 0 --> Custody Transfer Enhancement Block
 |    0xA    | Blk Flags | Blk Len   |  ...
 |-----------|-----------|-----------|-----------| 4
              Custody ID             |  ...
 |-----------------------|-----------------------| 8
 |    Custodian EID (ASCII character array)      |
 |-----------------------------------------------| Variable

2.5 Bundle Integrity Block (BIB)

 -------------------------------------------------
              Bundle Integrity Block
 -------------------------------------------------
 |    MSB    |           |           |    LSB    |
 | (8 bits)  | (8 bits)  | (8 bits)  | (8 bits)  |
 |-----------|-----------|-----------|-----------|
 |                                               |
 |              Primary Bundle Block             |
 |                                               |
 |-----------|-----------|-----------------------|
 .           .           .                       .
 |-----------|-----------|-----------------------| 0 --> Bundle Integrity Block
 |    0xD    | Blk Flags |     Block Length ...
 |-----------|-----------|-----------|-----------| 4
    ...                  |    STC    |    SBT    |
 |-----------|-----------|-----------|-----------| 8
 |    CSI    |    CSF    |     CL    |    SRT    |
 |-----------|-----------|-----------|-----------| 12
 |    SRL    |   Security Result ...
 |-----------|-----------|-----------|-----------| Variable

 STC: Security Target Count (hardcoded to 1)
 SBT: Security Target Block Type (hardcoded to 1)
 CSI: Cipher Suite ID
 CSF: Cipher Suite Flags
 SRC: Compound Length (number of bytes that follow)
 SRT: Security Result Type (hardcoded to 5)
 SRL: Security Result Length (2 if CRC16, 4 if CRC32)

2.6 Aggregate Custody Signal Block

 -------------------------------------------------
         DTN Aggregate Custody Signal Block
 -------------------------------------------------
 |    MSB    |           |           |    LSB    |
 | (8 bits)  | (8 bits)  | (8 bits)  | (8 bits)  |
 |-----------|-----------|-----------|-----------|
 |                                               |
 |              Primary Bundle Block             |
 |                                               |
 |-----------|-----------|-----------------------|
 .           .           .                       .
 |-----------|-----------|-----------------------| 0 --> Payload BLock
 |    0x1    | Blk Flags |     Block Length ...
 |-----------|-----------|-----------|-----------| 4 --> Aggregate Custody Signal
            ...          |    0x40   |  Status   |
 |-----------|-----------|-----------|-----------| 8
 |                First Custody ID               |
 |-----------------------|-----------------------| Variable
 |  Number Valid CIDs    |  Number Skipped CIDs  |
 |-----------------------|-----------------------|
 |  Number VAlid CIDs    |  Number Skipped CIDs  |
 |-----------------------|-----------------------|
 .                       .                       .
 |-----------------------|-----------------------|
 |  Number Valid CIDs    |  Number Skipped CIDs  |
 |-----------------------------------------------| Variable