Packet CRCs

Invariant CRC (ICRC)

Covers All Fields That Don't Change

The 32-bit ICRC is generated by the source CA port's Link Layer and covers all packet fields that do not change (i.e., they are not altered by switches or routers) as the packet transits from the source port to the destination port. The ICRC is present in all IBA packets but not in raw packets (in a raw packet the fields that may be altered while the packet is in transit are not known). The ICRC calculation is restarted for each new packet in a message.

The header fields that may be modified by switches or routers are comprised of:

  • The fields that a switch may modify as the packet transits the local subnet. This would include:

    - LRH:VL.

    - BTH:Resv8a fields. Note that although the Resv8a field is currently not used, it could be modified by a switch in the future.

  • The additional fields that a router may modify are:

    - LRH:SL.

    - GRH:HopLmt

Included/Excluded Fields for a Local Packet

Refer to Figure 25-15 on this page. If it is a local packet (there is no GRH present), then the ICRC calculation includes/excludes the following fields:

  • The ICRC includes:

    - The LRH except for the VL field.

    - The BTH for the Resv8a field.

    - ETHs (if present).

    - Packet payload (if present).

  • The ICRC excludes: (these fields are replaced with 1s for the ICRC calculation)

    - The LRH:VL field.

    - The BTH:Resv8a field.

Figure 25-15. Fields Excluded from ICRC in Local Packet's ICRC Calculation


Included/Excluded Fields for a Global Packet

Refer to Figure 25-16 on this page. If it is a global packet (there is a GRH present), then the ICRC calculation includes/excludes the following fields:

  • The ICRC includes:

    - The following GRH fields:

    - IPVer.

    - PayLen.

    - NxtHdr.

    - SGID.

    - DGID.

    - BTH except for the Resv8a field.

    - ETHs (if present).

    - Packet payload (if present).

  • The ICRC excludes (these fields are replaced with 1's for the CRC calculation):

    - All fields of the LRH.

    - BTH:Resv8a.

    - The following GRH fields:

    - FlowLabel.

    - TClass.

    - HopLmt.

Figure 25-16. Fields Excluded from ICRC Calculation in Global Packet's ICRC Calculation


ICRC Algorithm

The polynomial used is the same CRC-32 used by Ethernet: 04C11DB7h. The procedure for the calculation is:

1.
The initial value of the CRC-32 calculation is FFFFFFFFh.

2.
The CRC calculation is done in big-endian byte order with the least-significant bit of the most-significant byte being the first bit in the calculation.

3.
The bit sequence yielded by the calculation is complemented and the result is the ICRC.

4.
The resulting bits are sent in order starting with the bit representing the coefficient of the highest term of the remainder polynomial. Transmitting the least-significant bit of the most-significant byte first does not apply to the ICRC field.

The CRC always starts with LRH:LVer bit 0, whether a GRH is present or not.

This bit and byte ordering is consistent with Ethernet's CRC calculation.

Variant CRC (VCRC)

Refer to Figure 25-17 on page 652. The 16-bit VCRC covers all fields of the Packet. This field is present in all data packets including raw packets and includes all bytes from the first byte of the LRH to the last byte before the VCRC, inclusive. When a switch or a router alters any of the packet's fields, the VCRC must be recalculated in the Link Layer of that port on the device.

Figure 25-17. All Fields Are Included in VCRC Calculation


The polynomial used is the same CRC-16 used by HIPPI-6400 - 0x100B (6400Mbits/s High-Performance Parallel Interface).

The procedure for the calculation is:

1.
The initial value of the CRC-16 calculation is FFFFh.

2.
The CRC calculation is done in big-endian byte order with the least-significant bit of the first byte of the LRH (bit 0 of LRH:LVer) being the first bit in the CRC calculation.

3.
The bit sequence of the result is complemented and the result is the VCRC.

4.
The resulting VCRC is transmitted in order starting with the bit representing the coefficient of the highest term of the remainder polynomial. Transmitting the least-significant bit of the most-significant byte first does not apply to the VCRC field.

This bit and byte ordering is consistent with Ethernet's CRC calculation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.24.106