-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subtlety between length and size. #1277
Comments
From my point of view, "length" and "size" should be interchangeable. For the examples you cited for header unions and variable-length headers, I would push for the text to be adjusted to refer to either "maximum size" or "minimum and maximum sizes". For example, for 8.19: - Similar to headers, the size of a header union can be determined at compile-time.
+ Similar to headers, the maximum size of a header union can be determined at compile-time. (I might further clarify by adding "with variable-length fields" after "headers" since headers without variable-length fields are a static length.) And for 8.10: - Additionally, the size of a variable-length bit-string can be determined at compile-time.
+ Additionally, the maximum size of a variable-length bit-string can be determined at compile-time. |
Please, note that when we talk about scalar types, we also use the term "width", like "fixed-width", "bit-width", etc, in many places in the spec. In the section 7.1.6.4 the spec says "dynamically-sized", when it refers to So, yes, both "length", "width" and "size" can be used as synonyms and that's what people do. I would think that these terms might have somewhat different connotation depending on the context. For example, we often think of a header that is something that is received/transmitted and thus is "long" (or "short") and that's why people often use the word "length" in that context. When we think of fields, we often think in terms of the corresponding table entries, containing these fields or operations on them and they tend to be "wide" or "narrow" (a typical expression would be something like "32-bit-wide"). Hence, we use the term "width." The term "size" is probably more generic in that sense, but all three terms are very useful. If there are specific instances in the spec, where this creates a misunderstanding or confusion, let's point them out and discuss those. |
After discussion at the May 13th 2024 LDWG, we agreed that @jonathan-dilorenzo would create a PR to improve the wording in the specification, including clarifying uses of "maximum size" as discussed above. |
Maybe this is clear in the lingua franca of the networking community, but I find the subtlety between the length of a field and the size of a field a bit confusing. Here are some examples of the usage in the specification:
In section 7.2.4 it says:
However, in section 8.19, it says:
And refers to section 9 where there's a table that includes (and similar for the minimum size):
There is also this line in 8.10:
I believe this is basically treating the
length
as the runtime size of the type and usingfixed length
to denote that the runtime length is compile-time known? While it's usingsize
to describe bounds on the runtime size? I.e. as a shorthand to describe that the minimum and maximum sizes are both respectively compile-time known?Perhaps this can become clearer by changing 'size' to say 'minimum and maximum size' in the instances above? Is it worth further defining 'size' and 'length' in some way?
The text was updated successfully, but these errors were encountered: