Description
Require a code from 1 through 254 and a length byte from 0 through 255; return the two-byte header.
Packet headers encode several meanings in fixed-width fields. Bit positions, network byte order, and reserved values must be distinguished from validation of an entire message.
Require a code from 1 through 254 and a length byte from 0 through 255; return the two-byte header.
When to use this tool
Use DHCP Option Length Octet Field when you need to decode or encode one explicit packet field.
How to use the tool and how it works
- Enter code, length. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read header. Use the output convention below.
Require a code from 1 through 254 and a length byte from 0 through 255; return the two-byte header.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| code | Code | Required. Safe integer; minimum 1; maximum 254. |
| length | Length | Required. Safe integer; minimum 0; maximum 255. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| header | Header | Required. Array of safe integer; maximum items 256. |
{
"input": {
"code": 53,
"length": 1
},
"output": {
"header": [
53,
1
]
}
} Limitations and assumptions
- Pad and end codes are deliberately excluded; payload bytes are not generated or checked.
- 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
Inspect the complete captured header and apply the relevant protocol's structural and state rules.
References
Similar or alternative tools
- DHCP Option Pad End Token
Classify option code zero as pad, 255 as end, and every other byte as option.
- SCTP Chunk Length Padding Count
Round a chunk length of 4-65535 bytes up to a multiple of four.