diff --git a/Cargo.lock b/Cargo.lock
index df99e98a..0c67811e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -121,6 +121,12 @@ version = "2.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
+[[package]]
+name = "byteorder"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
+
[[package]]
name = "bytes"
version = "1.10.1"
@@ -1207,6 +1213,7 @@ dependencies = [
"async-stream",
"async-trait",
"bincode",
+ "byteorder",
"bytes",
"dashmap",
"futures",
diff --git a/Cargo.toml b/Cargo.toml
index 8cb4cd46..d8900275 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,6 +11,7 @@ tokio-util = { version = "0.7", features = ["rt"] }
futures = "0.3"
async-trait = "0.1"
bytes = "1"
+byteorder = "1"
log = "0.4"
dashmap = "5"
diff --git a/docs/rust-binary-router-library-design.md b/docs/rust-binary-router-library-design.md
index fd515843..3599733d 100644
--- a/docs/rust-binary-router-library-design.md
+++ b/docs/rust-binary-router-library-design.md
@@ -1123,50 +1123,57 @@ examples are invaluable. They make the abstract design tangible and showcase how
2. **Frame Processor Implementation** (Simple Length-Prefixed Framing using
`tokio-util`):
- ```rust
- // Crate: my_frame_processor.rs
- use bytes::{BytesMut, Buf, BufMut};
- use tokio_util::codec::{Encoder, Decoder};
- use std::io;
+ ```rust
+ // Crate: my_frame_processor.rs
+ use bytes::{BytesMut, Buf, BufMut};
+ use tokio_util::codec::{Decoder, Encoder};
+ use byteorder::{BigEndian, ReadBytesExt};
+ use std::io;
- pub struct LengthPrefixedCodec;
+ const MAX_FRAME_LEN: usize = 16 * 1024 * 1024; // 16 MiB upper limit
- impl Decoder for LengthPrefixedCodec {
- type Item = BytesMut; // Raw frame payload
- type Error = io::Error;
+ pub struct LengthPrefixedCodec;
- fn decode(&mut self, src: &mut BytesMut) -> Result