diff --git a/ostp-client/src/bridge.rs b/ostp-client/src/bridge.rs index 7cdaac8..d6e2d65 100644 --- a/ostp-client/src/bridge.rs +++ b/ostp-client/src/bridge.rs @@ -533,7 +533,7 @@ impl Bridge { psk, session_id, handshake_payload, - max_padding: 1400, // ยง7 FIX: Allow padding up to full MTU size to break traffic analysis fingerprints + max_padding: 1280, // Safe MTU size to avoid UDP fragmentation on Windows/PPPoE padding_strategy: PaddingStrategy::Profile(self.profile), obfuscation_key: obf_key, max_reorder: 262144, diff --git a/ostp-client/src/tunnel/linux_handler.rs b/ostp-client/src/tunnel/linux_handler.rs index f1cf2f7..71bd549 100644 --- a/ostp-client/src/tunnel/linux_handler.rs +++ b/ostp-client/src/tunnel/linux_handler.rs @@ -138,6 +138,7 @@ pub async fn run_linux_tunnel( // 4. Setup commands (Using standard /1 routing trick for fail-proof overriding) let setup_script = format!( "ip tuntap add name ostp_tun mode tun || true; \ + ip link set dev ostp_tun mtu 1300; \ ip addr add 10.1.0.2/24 dev ostp_tun || true; \ ip link set dev ostp_tun up; \ ip route add {} via {} dev {}; \ diff --git a/ostp-client/src/tunnel/wintun_handler.rs b/ostp-client/src/tunnel/wintun_handler.rs index e9fe31e..992dc92 100644 --- a/ostp-client/src/tunnel/wintun_handler.rs +++ b/ostp-client/src/tunnel/wintun_handler.rs @@ -137,6 +137,7 @@ pub async fn run_wintun_tunnel( // to the physical interface DNS servers, which are physically routed and work flawlessly. let net_setup = "\ netsh interface ipv4 set address name=\"ostp_tun\" static 10.1.0.2 255.255.255.0 10.1.0.1\n\ + netsh interface ipv4 set subinterface \"ostp_tun\" mtu=1300 store=persistent\n\ netsh interface ipv4 set interface name=\"ostp_tun\" metric=5\n"; let _ = Command::new("powershell") diff --git a/ostp-core/src/framing/padding.rs b/ostp-core/src/framing/padding.rs index b2001dc..20c1203 100644 --- a/ostp-core/src/framing/padding.rs +++ b/ostp-core/src/framing/padding.rs @@ -10,9 +10,9 @@ pub enum TrafficProfile { impl TrafficProfile { pub fn target_size(&self, current: usize) -> usize { match self { - TrafficProfile::JsonRpc => align_up(current.max(220), 64).min(1408), - TrafficProfile::HttpsBurst => align_up(current.max(1200), 128).min(1472), - TrafficProfile::VideoStream => align_up(current.max(900), 188).min(1472), + TrafficProfile::JsonRpc => align_up(current.max(220), 64).min(1280), + TrafficProfile::HttpsBurst => align_up(current.max(1200), 128).min(1280), + TrafficProfile::VideoStream => align_up(current.max(900), 188).min(1280), } } }