ATP Header Format

The IPv6 packet whose payload contains an ATP packet must conform to latest IPv6 
specification, currently RFC 2460. ATP suggest that the traffic class field should 
renamed to 'flags'. The leftmost bit could be RTP(real time payload), the rightmost be 
ECN(Explicit Congestion notification), the others are reserved. When RTP = 0, the 
packet falls in best-effort class of service. When RTP = 1, the packet should be 
transmitted with as minimum delay as possible.

Here is the pseudo-C data structure of an ATP header:
struct ATP-Packet
{
  struct IPv6-Fixed-Header /* IPv6 fixed header */
  {
  version: 4;
  flag-RTP: 1;
  flags-reserved: 6;
  flag-ECN: 1;
  flow-label: 24
  payload-length: 16;
  next-header: 8;
  hop-limit: 8;
  source-addr: 128;
  destination-addr: 128;
  };
  OPTIONAL IP-EXTENSION-HEADERS1;  /* chain of the IPv6 extension headers that must 
appear before the authentication header. */
  OPTIONAL struct AuthenticationHeader /* IPSec AH */
  {
    AHnextHeader: 8;
    AHpayloadLength: 8;
    reserved: 16;
    SPI: 32;
    AHsequenceNumber: 32;
    AuthData: VARIABLE (4..1020 bytes) /* must be 32-bit aligned.*/
    Padding: VARIABLE(0..4 bytes) /* make the header to 64-bit aligned */
  };
  OPTIONAL IP-EXTENSION-HEADERS2;  /* chain of the IPv6 extension headers that may 
appear after the authentication header. */
  ATP-flags-reserved: 5;
  flag-RST: 1;
  flag-SYN: 1; /* maybe it should be in the IPv6 fixed header? */
  flag-FIN: 1;
  Reserved: 4;
  WindowSize: 20;
  union {
    Checksum: 32;
    AckBitmap: 32;
  };
  SequenceNumber: 32;
  HeaderStackPointer: 8;
  DataSegmentLength: 24;
  OPTIONAL ATP-extension-headers;
  Payload: VARIABLE(0..224-1 bytes);
  Padding: VARIABLE(0..7 bytes);
  OPTIONAL UrgentData;
};

ATP-flags-reserved: reserved flags.
flagRST: a control flag meaning ¡®reset¡¯.
flagSYN: a control flag meaning ¡®synchronize¡¯
flagFIN: a control flag meaning ¡®finish¡¯.
The meanings of the three flags are borrowed from TCP.

Reserved: 4 bits. They may be used to extent window size in the future.
Window-size: Size of the sending window. The size refers to packet instead of byte.

Checksum: When ATP operates in non-security-extent mode the field is valid. Method to 
compute the checksum of an ATP packet is the same as TCP, only that the word length is 
now 32 bits. The fields which affect the checksum include the source and destination 
address in the IP fixed header, the whole ATP fixed header, all of the ATP optional 
headers, and the ATP payload. The checksum field in the ATP header is cleared to zero 
before checksum is computed. The payload is padding with zero to 64-bit alignment.

AckBitmap: When ATP operates in security-extent mode the field is valid. It is a 
32-bit map of selective acknowledgement. See 'Selective Acknowledgement Header¡¯below.

SequenceNumber: When ATP operates in non-security-extent mode it means the sequence 
number of current packet. When ATP operates in security-extent mode, it means the 
sequence number of an accumulatively acknowledged accepted packet.

HeaderStackPointer: indicates the offset of the 64-bit word following the last ATP 
extension header. The offset is relative to the start position of the ATP fixed 
header. The unit of the pointer is 64-bit word. It is abnormal if the value of the 
field is 0 or 1. No extension header exists if the value is 2. Format of the ATP 
extension headers are described in following paragraphs.

DataSegmentLength: the length in bytes of the ATP payload. Unlike the IPv6 payload 
length which counts IPv6 extension headers, data segment length of an ATP packet does 
not count the fixed header or extension headers. 

Payload is of variable length, from 0 to 2**24-1 bytes.

Padding makes the payload 64-bit aligned.

UrgentData is a special ATP extension header. See following paragraphs.



ATP Extension Headers

General Format:
struct general_ATP_extension_header
{
  Bit-Field2: VARIABLE(0..512 bytes);
  HeaderPointer: 8;
  OptionCode: 8;
  Bit-Field1: 16;
};

HeaderPointer has similar meaning as HeaderStackerPointer. It point to the first 
64-bit word of the current extension header. The pointer refers to 64-bit word. It is 
the offset relative to the start position of the ATP fixed header. The pointer points 
to the fixed header if the value is 2, which means reaching bottom of the header 
stack. Pointer value 0 and 1 are reserved. One may get the byte address of the header 
pointer field in the next extension header by multiplying the value with 8, then minus 
the result with 4.

OptionCode uniquely determines content and semantic of the extension header.

Bit-Field1 and Bit-Field2 are dependent on OptionCode.


OptionCode 0: reserved.


OptionCode 1: Congestion Feedback, Length 64 bits (8 bytes), format:
struct ATP-Congestion-Feedback
{
  WindowSize: 32;
  HeaderPointer: 8;
  OptionCode: 8; /* == Binary 00000001  */
  Reserved: 16;
};

WindowSize equals to the receiving window size. It is expected by adjusting sending 
window size in keeping with the receiving window size the sender and the receiver may 
fine-tune transmit rate. It is assumed that the congestion feedback is useful in LAN 
environment because the round trip time is short enough for the feedback to be 
effective.


OptionCode 2: Selective Acknowledgement, length variable(8..520 bytes), format:
struct ATP-Selective-Acknowledgement
{
  AckBitmap: VARIABLE(0..4095 bit);
  BitPadding: VARIABLE(0..63 bit);
  SequenceNumber: 32;
  HeaderPointer: 8;
  OptionCode: 8; /* value is binary 00000010 */
  Reserved: 4;
  BitmapLength: 12;
};

AckBitmap maps each bit in the field to the acknowledgements to a sequence of 
continuous ATP packets. The first bit should always be zero. When a bit is set to 1 it 
indicated that the corresponding packet has been accepted by the receiver. Or else the 
packet may be lost due to network congestion or line error, may be rejected by the 
receiver, or may not have been sent at all. If Bitmap-Length is zero, there is 
actually no Ack-Bitmap field (or thereafter Bit-Padding) in the header.

BitPadding, if there is, makes the AckBitmap 64-bit aligned.

SequenceNumber is that of the first ATP packet to be acknowledged. This packet has no 
mapped bit in AckBitmap. The AckBitmap mapped sequence of ATP packets must be 
continously following this first ATP packet.

BitmapLength is the actual bit length of the Ack-Bitmap field. It may be zero, or any 
value from 2 to 4095.



OptionCode 3: Urgent Data, Length variable (8..264 bytes), format:
struct ATP-Urgent-Data
{
  UrgentDataBlock: VARIABLE(0 or 2..256 bytes);
  Padding: VARIABLE(0..7 bytes);
  NextHeaderPointer: 32;
  HeaderPointer: 8;
  OptionCode: 8; /* value is binary 00000011*/
  SingleByteData: 8;
  DataTailOffset: 8;
};

UrgentDataBlock field, if there is, stores the urgent data longer than one byte. The 
actually length of the data equa DataTailOffset plus 1.

Padding, if there is, makes the urgent data block 8-byte (64-bit) aligned.

NextHeaderPointer is the byte address that store the NextHeader field in the header 
just below the urgent data header in the extension header stack.

SingleByteData is the data byte if DataTailOffset is zero. It should be zero if 
DataTailOffset is non-zero.

DataTailOffset is zero if the length of the urgent data is 1, and therefore the data 
is stored in the SingleByteData field. If DataTailOffset is non-zero, UrgentDataBlock 
contains the actually byte stream of the urgent data.



OptionCode 4: Fast Negation, length variable(8..520 bytes), format:
struct ATP-Fast-Negation
{
  NackBitmap: VARIABLE (0..4095 bits);
  BitPadding: VARIABLE (0..63 bits);
  SequenceNumber: 32;
  HeaderPointer: 8;
  OptionCode: 8; /* value is binary 00000100 */
  Reserved: 4;
  BitmapLength: 12;
};

NackBitmap maps each bit in the field to a sequence of contiguous ATP packets. If a 
bit is 1, the corresponding ATP packet is said to be explicitly and NEGATIVELY 
acknowledged by the receiver. Or else the state of the packet is unknown.

BitPadding makes the NackBitmap 64-bit aligned.

SequenceNumber is that of the first ATP packet to be NACKed. The sequence of ATP 
packets corresponding to NackBitmap, if there is, should be continuously following 
this first ATP packet.

BitmapLength is the actual bit length of the NackBitmap.



OptionCode 5, Payload Code Transform, format to be defined.


OptionCode 6, Payload Code Transform Negotiation, format TBD.


OptionCode 7, Resource Reservation, format TBD

OptionCode 8-255: reserved.

Reply via email to