# Selecting \`@extent\` value in DSDL

**URL:** <https://forum.opencyphal.org/t/selecting-extent-value-in-dsdl/2038>\
**Category:** Development & Maintenance\
**Created:** [December 1, 2023, 12:25pm UTC](https://forum.opencyphal.org/t/selecting-extent-value-in-dsdl/2038 "2023-12-01T12:25:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ych](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/ych/32/1510_2.png) [@ych](https://forum.opencyphal.org/u/ych)\
**Post date:** [December 1, 2023, 12:25pm UTC](https://forum.opencyphal.org/t/selecting-extent-value-in-dsdl/2038/1 "2023-12-01T12:25:13Z")

</div>

Is there a specific logic or set of rules for choosing the `@extent` value in DSDL?

Consider the case of [7509.Heartbeat.1.0.dsdl](https://github.com/OpenCyphal/public_regulated_data_types/blob/master/uavcan/node/7509.Heartbeat.1.0.dsdl). The following instructions are provided at the end of this file:

```auto
@assert _offset_ % 8 == {0}
@assert _offset_ == {56} # Fits into a single-frame Classic CAN transfer (least capable transport, smallest MTU).
@extent 12 * 8

```

The first assertion for alignment (`@assert _offset_ % 8 == {0}`) is straightforward, and the second assertion (`@assert _offset_ == {56}`) is also reasonable, especially with the accompanying comment about fitting into a single-frame Classic CAN transfer.

However, I’m confused about the last `@extent` directive, particularly `@extent 12 * 8`. This directive sets the extent to `96` bits, but I’m struggling to understand the rationale behind this, especially since the previous assertion checks for a `56` bits match. Furthermore, if we are considering possible extensions to this data type, why choose a `12` byte size instead of for example byte sizes like 16, 32, or 64? Any clarification on this would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [December 1, 2023, 1:01pm UTC](https://forum.opencyphal.org/t/selecting-extent-value-in-dsdl/2038/2 "2023-12-01T13:01:28Z")

</div>

> [@ych](#):
>
> This directive sets the extent to `96` bits, but I’m struggling to understand the rationale behind this, especially since the previous assertion checks for a `56` bits match.

This is to provide sufficient space for any likely extension fields added to the data type later on. In this case 12 bytes (5 extra on top of 7 that are already used) were considered sufficient. There is no other rationale behind this. It could have been any larger number as well.
