Subject: [dtn] DTN BPv7 test bundles and CRCs

From: Brian Sipos <[email-masked]>
Date: Fri, 22 Mar 2019 15:45:14 +0000

To anyone who has been prototyping Bundle Protocol version 7 (BPbis) agents,
I'm spending a little time on a Wireshark dissector to examine and troubleshoot bundles and the only trouble I've run into is in verifying the CRCs. The BPbis spec is not very helpful in determining exactly what CRC implementation to use only because the ITU specification itself doesn't provide CRC test vectors.

I'm doing prototyping in Python and dissecting in C language, so there is even a disparity between what CRC algorithms are available and how well they are documented. This seems like such an easy use/build decision to use COTS CRC function but I'm struggling to find implementations to match what BPbis requires.

I think there would be a lot of value to have some test/representative bundles in an appendix which include blocks with different CRC types and different block sizes. Some CRC implementations pad out octet-sequences to a multiple of the CRC size and some apparently do something else. The problem is in the CRC implementations not being very clear about their parameters but having a few encoded test bundles to work with would go a long way to ensuring compatibility of implementations.

Thanks for any advice,
Brian S.

---

From: Felix Walter <[email-masked]>
Date: Mon, 25 Mar 2019 12:49:00 +0100

Hi Brian,

This sounds really useful! I agree that it would be very good to have
some example bundles provided. We have Python as well as C code for our
interpretation of the BPbis CRC section available with µPCN v0.6.0 [1].
The Python implementation can be found in tools/bundle7/crc.py, the C
implementation in components/bundle7/src/crc.c.

Please note that in this version the used CRC-32 variant is still the
PKZIP/Ethernet CRC-32 as specified in draft-ietf-dtn-bpbis-10. For using
CRC32-C (Castagnoli), the table in the C file needs to be re-generated
with the corresponding polynomial. This can be done using the Python
code which includes parameters for a lot of CRC variants.

Felix

[1] https://upcn.eu/

--
Dipl.-Ing. Felix Walter
Chief Technology Officer
D3TN GmbH
 
E-Mail: [email-masked]
Web: https://d3tn.com

Address:
D3TN GmbH
Leon-Pohle-Str. 2
01219 Dresden

Commercial Register: District Court Dresden
Register Number: HRB 34957
VAT ID No.: DE303348407
Managing Directors: Marius Feldmann, Paul Seidler

On 22.03.19 16:45, Brian Sipos wrote:
> I'm spending a little time on a Wireshark dissector to examine and
> troubleshoot bundles and the only trouble I've run into is in
> verifying the CRCs. The BPbis spec is not very helpful in determining
> exactly what CRC implementation to use only because the ITU
> specification itself doesn't provide CRC test vectors.
>
> I'm doing prototyping in Python and dissecting in C language, so there
> is even a disparity between what CRC algorithms are available and how
> well they are documented. This seems like such an easy use/build
> decision to use COTS CRC function but I'm struggling to find
> implementations to match what BPbis requires.
>
> I think there would be a lot of value to have some test/representative
> bundles in an appendix which include blocks with different CRC types
> and different block sizes. Some CRC implementations pad out
> octet-sequences to a multiple of the CRC size and some apparently do
> something else. The problem is in the CRC implementations not being
> very clear about their parameters but having a few encoded test
> bundles to work with would go a long way to ensuring compatibility of
> implementations.
>
> Thanks for any advice,
> Brian S.
>
> _______________________________________________
> dtn mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/dtn

---

From: Alvar Penning <[email-masked]>
Date: Mon, 25 Mar 2019 13:48:41 +0100

Hi everyone,

> We have Python as well as C code for our interpretation of the BPbis
> CRC section available with µPCN v0.6.0.

to check the bundles of my ongoing BPv7 implementation[0], I updated
µPCN's Python implementation to the current draft and published the
changed code on GitHub[1]. Perhaps others would also benefit from this
small change to this very helpful library.

Best regards,
Alvar

[0]: WIP, https://github.com/geistesk/dtn7
[1]: https://github.com/geistesk/upcn-bundle7

---

From: Brian Sipos <[email-masked]>
Date: Thu, 28 Mar 2019 12:44:23 +0000

All,
Thank you for the pointers to other implementations. I was able to reconcile the CRCs listed in the BPv7 spec with the 16-bit CRC listed at [1] and the 32-bit CRC listed at [2], both of these references have "check" results for test input.

To Scott B.,
I think the current citation in [3] is not accurate, the ITU-T V.42 spec is *not* the same as the CRC-32C identified in BPv7. I would suggest citing the same reference as was done in [4] and it would be extremely helpful to have CRC examples as are included in [5].
I was being very careful to cross-check my CRC use, but a naive implementation which only checks bundles generated by itself could easily use the wrong CRC parameterization and end up not being interoperable and not know it.

Thanks,
Brian S.

[1]: http://reveng.sourceforge.net/crc-catalogue/16.htm#crc.cat.crc-16-ibm-sdlc
[2]: http://reveng.sourceforge.net/crc-catalogue/17plus.htm#crc.cat.crc-32-castagnoli
[3]: https://tools.ietf.org/html/draft-ietf-dtn-bpbis-12#ref-CRC
[4]: https://tools.ietf.org/html/rfc7143#ref-Castagnoli93
[5]: https://tools.ietf.org/html/rfc7143#appendix-A.4<https://tools.ietf.org/html/rfc7143>

________________________________
From: dtn <[email-masked]> on behalf of Brian Sipos <[email-masked]>
Sent: Friday, March 22, 2019 11:45
To: [email-masked]
Subject: [dtn] DTN BPv7 test bundles and CRCs

Thanks for any advice,
Brian S.

---

From: "Burleigh, Scott C (312B)" <[email-masked]>
Date: Thu, 28 Mar 2019 14:53:13 +0000

Thanks, Brian - I've revised the [CRC] reference and have added a reference to Appendix A.4 of RFC 7143 for the CRC examples.

Scott

From: Brian Sipos <[email-masked]>
Sent: Thursday, March 28, 2019 5:44 AM
To: [email-masked]; Burleigh, Scott C (312B) <[email-masked]>
Subject: [EXTERNAL] Re: DTN BPv7 test bundles and CRCs

All,

To Scott B.,

Thanks,
Brian S.

[5]: https://tools.ietf.org/html/rfc7143#appendix-A.4

________________________________
From: dtn <[email-masked]<mailto:[email-masked]>> on behalf of Brian Sipos <[email-masked]<mailto:[email-masked]>>
Sent: Friday, March 22, 2019 11:45
To: [email-masked]<mailto:[email-masked]>
Subject: [dtn] DTN BPv7 test bundles and CRCs

Thanks for any advice,
Brian S.