Description
Pad optionBytes in 0-40 to a four-byte boundary.
A wire-format length may count headers, payload, padding, or only part of an enclosing message. Offsets and exclusive ends must use a clearly stated byte convention.
Pad optionBytes in 0-40 to a four-byte boundary.
When to use this tool
Use IPv4 Options Padding Boundary Byte Count when you need a field-level byte count or boundary check.
How to use the tool and how it works
- Enter optionBytes. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read paddingBytes, ihl. Use the output convention below.
Pad optionBytes in 0-40 to a four-byte boundary. Return the padding and IHL equal to five plus the padded option length divided by four.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| optionBytes | Option Bytes | Required. Safe integer; minimum 0; maximum 40. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| paddingBytes | Padding Bytes | Required. Safe integer. |
| ihl | Ihl | Required. Safe integer. |
{
"input": {
"optionBytes": 5
},
"output": {
"paddingBytes": 3,
"ihl": 7
}
} Limitations and assumptions
- This handles byte counts only; option syntax and end-of-list placement are not inspected.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Compare the computed span with the actual captured buffer and validate its contents separately.
References
Similar or alternative tools
- Network: IPv4 Ihl Option Byte Count
Multiply IHL in 5-15 by four for headerBytes and multiply IHL minus five by four for optionBytes.
- Network: TCP Data Offset Header Bytes
Multiply the data offset, from 5 through 15, by four to obtain headerBytes.