network_protocol/core/mod.rs
1//! # Core Protocol Components
2//!
3//! Low-level packet handling, codecs, and binary serialization.
4//!
5//! This module provides the foundation for the protocol, handling packet framing,
6//! encoding/decoding, and wire format.
7//!
8//! ## Components
9//! - **Packet**: Binary packet format with magic bytes and checksums
10//! - **Codec**: Tokio codec for framing over byte streams
11//!
12//! ## Wire Format
13//! ```text
14//! [Magic(4)] [Version(1)] [Flags(1)] [Length(4)] [Payload(N)]
15//! ```
16//!
17//! ## Security
18//! - Maximum packet size: 16MB (prevents memory exhaustion)
19//! - Magic bytes prevent accidental misinterpretation
20//! - Length validation before allocation
21
22pub mod codec;
23pub mod packet;
24pub mod serialization;