mirror of
https://github.com/jmcorgan/fips.git
synced 2026-08-10 16:43:12 +00:00
COORDS_PRESENT warmup-then-reactive for DataPackets
Include source and destination coordinates on the first N DataPackets of each session (default 5, configurable via node.session.coords_warmup_packets). This warms transit node coord_caches so multi-hop forwarding and error signal routing work after SessionSetup cache entries expire. On CoordsRequired receipt, reset the counter to re-enable coordinate inclusion for the next N packets, handling mid-session cache expiry and path changes. Changes: - SessionConfig: add coords_warmup_packets field (default 5) - SessionEntry: add coords_warmup_remaining counter, initialized on Established transition (both initiator and responder paths) - send_session_data(): attach coords via DataPacket::with_coords() while counter > 0, decrement per send - handle_coords_required(): reset counter for affected session - 4 new unit tests for counter lifecycle and config default
This commit is contained in:
@@ -231,6 +231,11 @@ pub struct SessionConfig {
|
||||
/// Established sessions with no activity for this duration are removed.
|
||||
#[serde(default = "SessionConfig::default_idle_timeout_secs")]
|
||||
pub idle_timeout_secs: u64,
|
||||
/// Number of initial DataPackets per session that include COORDS_PRESENT
|
||||
/// for transit cache warmup (`node.session.coords_warmup_packets`).
|
||||
/// Also used as the reset count on CoordsRequired receipt.
|
||||
#[serde(default = "SessionConfig::default_coords_warmup_packets")]
|
||||
pub coords_warmup_packets: u8,
|
||||
}
|
||||
|
||||
impl Default for SessionConfig {
|
||||
@@ -240,6 +245,7 @@ impl Default for SessionConfig {
|
||||
pending_packets_per_dest: 16,
|
||||
pending_max_destinations: 256,
|
||||
idle_timeout_secs: 90,
|
||||
coords_warmup_packets: 5,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -249,6 +255,7 @@ impl SessionConfig {
|
||||
fn default_pending_packets_per_dest() -> usize { 16 }
|
||||
fn default_pending_max_destinations() -> usize { 256 }
|
||||
fn default_idle_timeout_secs() -> u64 { 90 }
|
||||
fn default_coords_warmup_packets() -> u8 { 5 }
|
||||
}
|
||||
|
||||
/// Internal buffers (`node.buffers.*`).
|
||||
|
||||
Reference in New Issue
Block a user