<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rahad Bhuiya</title>
    <description>The latest articles on DEV Community by Rahad Bhuiya (@rahadbhuiya).</description>
    <link>https://dev.to/rahadbhuiya</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3985826%2F37c0afb1-2db1-4cb6-91b4-b4eb1161aa16.jpg</url>
      <title>DEV Community: Rahad Bhuiya</title>
      <link>https://dev.to/rahadbhuiya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rahadbhuiya"/>
    <language>en</language>
    <item>
      <title>Building aegis-filter: Why Standard Kalman Filters Fail in Adversarial Environments (and How We Replaced Them in Pure Rust)</title>
      <dc:creator>Rahad Bhuiya</dc:creator>
      <pubDate>Fri, 09 Oct 2026 05:43:28 +0000</pubDate>
      <link>https://dev.to/rahadbhuiya/building-aegis-filter-why-standard-kalman-filters-fail-in-adversarial-environments-and-how-we-2bom</link>
      <guid>https://dev.to/rahadbhuiya/building-aegis-filter-why-standard-kalman-filters-fail-in-adversarial-environments-and-how-we-2bom</guid>
      <description>&lt;p&gt;When building telemetry filters for autonomous drones or robotics, the textbook recommendation is always the same: &lt;em&gt;“Just slap a Kalman Filter on it.”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In theory, the linear Kalman filter is mathematically optimal under Gaussian white noise. In the real world, however, physical sensors do not live in textbook conditions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Adversarial GPS/Baro Spoofing:&lt;/strong&gt; A rogue transmitter or RF jammer injects sudden, massive delta jumps (e.g., +150 meters in a single millisecond).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Numerical Covariance Degeneracy:&lt;/strong&gt; Floating-point round-off errors over millions of iterations cause the error covariance matrix $P$ to lose its positive-definiteness ($P \not\succ 0$), producing negative variances and exploding state estimates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Severe Non-Linearities:&lt;/strong&gt; Radar range calculations ($r = \sqrt{x^2 + y^2}$) and orientation quaternions break linear assumptions; Extended Kalman Filters (EKF) require calculating brittle analytical Jacobian matrices that drift rapidly.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To solve these mission-critical vulnerabilities, we built and open-sourced &lt;strong&gt;&lt;a href="https://crates.io/crates/aegis-filter" rel="noopener noreferrer"&gt;&lt;code&gt;aegis-filter&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt; under &lt;strong&gt;&lt;a href="https://github.com/Exploidus" rel="noopener noreferrer"&gt;Exploidus&lt;/a&gt;&lt;/strong&gt;—a cyber-resilient, &lt;code&gt;#![no_std]&lt;/code&gt;, hard real-time estimation engine written from scratch in pure Rust.&lt;/p&gt;

&lt;p&gt;Here is the engineering breakdown of how it works and what the simulation numbers prove.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Core Architecture
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;aegis-filter&lt;/code&gt; is engineered with three core defenses:&lt;/p&gt;

&lt;h3&gt;
  
  
  A. Joseph-Stabilized Covariance Update
&lt;/h3&gt;

&lt;p&gt;Standard Kalman filters update covariance using $P_k = (I - K_k H_k) P_{k|k-1}$. In finite-precision IEEE 754 floating-point arithmetic, subtraction can yield asymmetric, non-positive-definite matrices. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;aegis-filter&lt;/code&gt; enforces the &lt;strong&gt;Joseph Stabilized Form&lt;/strong&gt;:&lt;br&gt;
$$P_k = (I - K_k H_k) P_{k|k-1} (I - K_k H_k)^T + K_k R_k K_k^T$$&lt;/p&gt;

&lt;p&gt;Because both terms are quadratic forms ($A P A^T + B R B^T$), positive-definiteness is mathematically guaranteed across infinite operational lifetimes.&lt;/p&gt;
&lt;h3&gt;
  
  
  B. Chi-Square / 3-Sigma Outlier Rejection Gating
&lt;/h3&gt;

&lt;p&gt;Before any raw measurement is allowed to alter the state vector, the innovation $\tilde{y}&lt;em&gt;k = z_k - H_k \hat{x}&lt;/em&gt;{k|k-1}$ is evaluated against the innovation covariance $S_k = H_k P_{k|k-1} H_k^T + R_k$:&lt;br&gt;
$$\text{Reject if } |\tilde{y}_k| &amp;gt; \gamma \sqrt{S_k}$$&lt;/p&gt;

&lt;p&gt;If an adversary transmits a spoofed altitude or an IMU glitches, the reading is gated at line-rate. The filter falls back safely to its physical state propagation without corrupting the state.&lt;/p&gt;
&lt;h3&gt;
  
  
  C. Unscented Kalman Filtering (UKF) &amp;amp; $H_\infty$ Robust Minimax
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;UKF (Merwe Scaled Sigma Points):&lt;/strong&gt; Replaces brittle Jacobian derivations by propagating $2n + 1$ deterministic sigma points through non-linear observation closures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;$H_\infty$ Minimax:&lt;/strong&gt; Optimizes state estimation against the &lt;em&gt;worst-case&lt;/em&gt; disturbance rather than assuming well-behaved Gaussian noise.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  2. Flight Telemetry &amp;amp; Spoofing Resilience Simulation
&lt;/h2&gt;

&lt;p&gt;To prove real-world resilience, we simulated a quadcopter ascending at $1.5\text{ m/s}$ subjected to atmospheric turbulence, normal sensor noise, and deliberate adversarial spoofing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 12:&lt;/strong&gt; Instantaneous $+150\text{m}$ GPS spoofing attack.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 22:&lt;/strong&gt; Severe $-80\text{m}$ sensor hardware dropout glitch.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is the telemetry log produced by running &lt;code&gt;cargo run --example flight_telemetry&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;===============================================================================
  AEGIS-FILTER :: FLIGHT TELEMETRY &amp;amp; ADVERSARIAL RESILIENCE SIMULATION
  Developed under Exploidus (https://github.com/Exploidus)
===============================================================================

Step   | True Alt (m) | Sensor Raw (m) | Aegis Est (m)  | Abs Error    | Status    
-------+--------------+----------------+----------------+--------------+-----------
1      | 1.50         | 1.79           | 1.75           | 0.254        | VALID     
2      | 3.00         | 3.22           | 3.24           | 0.238        | VALID     
3      | 4.50         | 3.46           | 4.31           | 0.187        | VALID     
4      | 6.00         | 6.74           | 6.06           | 0.057        | VALID     
5      | 7.50         | 7.67           | 7.58           | 0.081        | VALID     
6      | 9.00         | 8.90           | 9.04           | 0.045        | VALID     
7      | 10.50        | 9.68           | 10.39          | 0.113        | VALID     
8      | 12.00        | 12.98          | 12.08          | 0.075        | VALID     
9      | 13.50        | 13.41          | 13.55          | 0.047        | VALID     
10     | 15.00        | 14.69          | 14.99          | 0.009        | VALID     
11     | 16.50        | 16.04          | 16.42          | 0.080        | VALID     
12     | 18.00        | 168.00         | 17.92          | 0.080        | SPOOF REJECT
13     | 19.50        | 19.08          | 19.36          | 0.138        | VALID     
14     | 21.00        | 20.65          | 20.83          | 0.172        | VALID     
15     | 22.50        | 22.43          | 22.34          | 0.156        | VALID     
16     | 24.00        | 24.93          | 24.01          | 0.012        | VALID     
17     | 25.50        | 24.79          | 25.40          | 0.099        | VALID     
18     | 27.00        | 26.78          | 26.88          | 0.116        | VALID     
19     | 28.50        | 28.76          | 28.44          | 0.060        | VALID     
20     | 30.00        | 30.64          | 30.04          | 0.044        | VALID     
21     | 31.50        | 30.61          | 31.41          | 0.095        | VALID     
22     | 33.00        | -47.00         | 32.91          | 0.095        | SPOOF REJECT
23     | 34.50        | 34.96          | 34.50          | 0.003        | VALID     
24     | 36.00        | 36.25          | 36.04          | 0.036        | VALID     
25     | 37.50        | 36.60          | 37.39          | 0.110        | VALID     
26     | 39.00        | 39.34          | 38.96          | 0.041        | VALID     
27     | 40.50        | 40.99          | 40.54          | 0.039        | VALID     
28     | 42.00        | 41.84          | 42.01          | 0.009        | VALID     
29     | 43.50        | 42.78          | 43.40          | 0.100        | VALID     
30     | 45.00        | 45.60          | 45.00          | 0.003        | VALID     

-------------------------------------------------------------------------------
  SIMULATION SUMMARY:
  - Total Steps Processed      : 30
  - Valid Readings Fused       : 28
  - Adversarial Spikes Blocked : 2 (100% Gated)
  - Final Variance Confidence  : 0.1185
===============================================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Key Takeaways from the Data:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Millimeter Tracking Precision:&lt;/strong&gt; Under normal noisy conditions (Step 10, Step 30), estimation error dropped to &lt;strong&gt;0.003–0.009 meters (3–9 mm)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flawless Spoof Rejection:&lt;/strong&gt; When the raw altitude leaped to $168\text{m}$ at Step 12, the filter isolated the anomaly, kept the aircraft altitude at $17.92\text{m}$ (error: $0.080\text{m}$), and prevented a fatal motor cut.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Quick Start (Rust)
&lt;/h2&gt;

&lt;p&gt;Add &lt;code&gt;aegis-filter&lt;/code&gt; to your &lt;code&gt;Cargo.toml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[dependencies]&lt;/span&gt;
&lt;span class="py"&gt;aegis-filter&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.1.0"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For bare-metal Cortex-M/RISC-V embedded targets:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[dependencies]&lt;/span&gt;
&lt;span class="py"&gt;aegis-filter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.1.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="py"&gt;default-features&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1D Outlier-Gated Fusion Example:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;aegis_filter&lt;/span&gt;&lt;span class="p"&gt;::{&lt;/span&gt;&lt;span class="n"&gt;ScalarKalmanFilter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;FilterError&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;FilterError&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Initial state: 0.0m, Initial variance: 5.0, Process noise: 0.02, Measurement noise: 0.8&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;filter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;ScalarKalmanFilter&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;5.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.02&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;sensor_stream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;3.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;168.0&lt;/span&gt; &lt;span class="cm"&gt;/* Spoofed spike */&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;6.0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;raw_reading&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;sensor_stream&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;filter&lt;/span&gt;&lt;span class="nf"&gt;.predict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Predict forward by 1.5m climb&lt;/span&gt;

        &lt;span class="k"&gt;match&lt;/span&gt; &lt;span class="n"&gt;filter&lt;/span&gt;&lt;span class="nf"&gt;.update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw_reading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;3.0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// 3-sigma gate&lt;/span&gt;
            &lt;span class="nf"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;estimated_alt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Estimated Altitude: {:.2}m"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;estimated_alt&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="nf"&gt;Err&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;FilterError&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;MeasurementGated&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Spoofed sensor reading ({:.1}m) rejected! Holding state."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;raw_reading&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nf"&gt;Err&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;Err&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nf"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(())&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  4. Open Source Links
&lt;/h2&gt;

&lt;p&gt;The engine is open-source under dual MIT/Apache-2.0 licenses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Crates.io:&lt;/strong&gt; &lt;a href="https://crates.io/crates/aegis-filter" rel="noopener noreferrer"&gt;crates.io/crates/aegis-filter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/Exploidus/aegis-filter" rel="noopener noreferrer"&gt;Exploidus/aegis-filter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Documentation:&lt;/strong&gt; &lt;a href="https://docs.rs/aegis-filter" rel="noopener noreferrer"&gt;docs.rs/aegis-filter&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feedback, issues, and PRs from control engineers and systems developers are warmly welcome!&lt;/p&gt;

</description>
      <category>rust</category>
      <category>robotics</category>
      <category>security</category>
      <category>programming</category>
    </item>
    <item>
      <title>Building a Line-Rate Linux Kernel Firewall in Pure Rust with Aya and eBPF/XDP</title>
      <dc:creator>Rahad Bhuiya</dc:creator>
      <pubDate>Sat, 03 Oct 2026 13:27:10 +0000</pubDate>
      <link>https://dev.to/rahadbhuiya/building-a-line-rate-linux-kernel-firewall-in-pure-rust-with-aya-and-ebpfxdp-4j49</link>
      <guid>https://dev.to/rahadbhuiya/building-a-line-rate-linux-kernel-firewall-in-pure-rust-with-aya-and-ebpfxdp-4j49</guid>
      <description>&lt;p&gt;Volumetric Distributed Denial of Service (DDoS) and transport-layer flooding attacks pose an existential challenge to modern cloud infrastructure, edge gateways, and container workloads. &lt;/p&gt;

&lt;p&gt;Conventional Linux packet filtering utilities such as Netfilter (&lt;code&gt;iptables&lt;/code&gt; and &lt;code&gt;nftables&lt;/code&gt;) evaluate incoming frames only after the kernel has allocated a socket buffer (&lt;code&gt;sk_buff&lt;/code&gt;) descriptor and scheduled softirq processing through the core TCP/IP stack. Under multi-gigabit line-rate flood conditions (millions of packets per second), the operating system spends the vast majority of its CPU cycles simply allocating and freeing &lt;code&gt;sk_buff&lt;/code&gt; memory metadata, triggering kernel starvation and packet drop bottlenecks even before firewall rules are evaluated.&lt;/p&gt;

&lt;p&gt;To address this fundamental OS-level bottleneck, I built &lt;strong&gt;xdp-guard&lt;/strong&gt;: a production-grade, memory-safe in-kernel defense engine and per-IP rate limiter implemented strictly in &lt;strong&gt;Pure Rust&lt;/strong&gt; using the &lt;strong&gt;Aya&lt;/strong&gt; eBPF framework.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why eBPF / XDP at the Driver Layer?
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;eXpress Data Path (XDP)&lt;/strong&gt; provides a programmable, bare-metal packet processing execution hook directly inside the Network Interface Card (NIC) driver subsystem before any memory descriptor allocation occurs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Conventional Path:
[NIC RX] -&amp;gt; [IRQ / SoftIRQ] -&amp;gt; [Allocate sk_buff] -&amp;gt; [Netfilter/iptables] -&amp;gt; [Socket / App]
                                      ^
                           Severe CPU Allocation Overhead

xdp-guard Path:
[NIC RX] -&amp;gt; [eBPF / XDP Driver Hook] ---&amp;gt; (Match Blocklist) ---&amp;gt; [ XDP_DROP ] (Near-Zero CPU)
                             |
                      (Match Allowlist)
                             |
                             v
                   [ Pass to OS Stack ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When hostile or unapproved packets are identified, returning &lt;code&gt;XDP_DROP&lt;/code&gt; causes the network driver to immediately recycle the packet ring buffer without allocating a single byte of kernel socket memory.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architectural Highlights
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Zero C Dependencies (Pure Rust)
&lt;/h3&gt;

&lt;p&gt;Traditional eBPF tools rely heavily on C toolchains (&lt;code&gt;clang&lt;/code&gt;, &lt;code&gt;llvm&lt;/code&gt;, &lt;code&gt;libbpf&lt;/code&gt;). &lt;code&gt;xdp-guard&lt;/code&gt; is built entirely in Rust from the user-space management CLI down to the &lt;code&gt;no_std&lt;/code&gt; kernel eBPF bytecode using &lt;strong&gt;Aya&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Strict 64-Bit Memory Boundary Alignments
&lt;/h3&gt;

&lt;p&gt;To ensure safe zero-copy communication across the kernel-userspace boundary, shared structures use explicit padding fields to guarantee 8-byte alignment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[repr(C)]&lt;/span&gt;
&lt;span class="nd"&gt;#[derive(Clone,&lt;/span&gt; &lt;span class="nd"&gt;Copy,&lt;/span&gt; &lt;span class="nd"&gt;Debug)]&lt;/span&gt;
&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;RuleValue&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;       &lt;span class="c1"&gt;// 0 = Pass, 1 = Drop&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;_pad&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;         &lt;span class="c1"&gt;// Explicit 4-byte padding for 8-byte boundary&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// Monotonic timestamp&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;ttl_secs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;     &lt;span class="c1"&gt;// Time-to-live expiration&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The presence of &lt;code&gt;_pad: u32&lt;/code&gt; is critical: it prevents architecture-specific compiler padding discrepancies and satisfies the Linux Kernel BPF Verifier.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Dynamic BPF Virtual Filesystem (bpffs) Synchronization
&lt;/h3&gt;

&lt;p&gt;Firewall rules (blocklist and allowlist) are dynamically synchronized using pinned BPF hash maps located in &lt;code&gt;/sys/fs/bpf/xdp_guard&lt;/code&gt;. Rules can be inserted or deleted instantaneously from the CLI without tearing down network interfaces or interrupting traffic flows.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. In-Kernel Token-Bucket Rate Limiter
&lt;/h3&gt;

&lt;p&gt;In addition to static blocklists, &lt;code&gt;xdp-guard&lt;/code&gt; embeds a stateful token-bucket rate limiter directly in kernel space. Monotonic arrival intervals ($\Delta t = t_{now} - t_{last}$) are computed using nanosecond &lt;code&gt;bpf_ktime_get_ns()&lt;/code&gt; clocks, discarding over-limit burst floods at line-rate.&lt;/p&gt;




&lt;h2&gt;
  
  
  Empirical Verification: Real Linux Kernel Telemetry
&lt;/h2&gt;

&lt;p&gt;To validate &lt;code&gt;xdp-guard&lt;/code&gt; under realistic operating conditions, we set up an automated Linux network namespace testbed over virtual ethernet (&lt;code&gt;veth&lt;/code&gt;) pairs (&lt;code&gt;xdp_client&lt;/code&gt; at &lt;code&gt;10.10.0.2&lt;/code&gt; and &lt;code&gt;xdp_server&lt;/code&gt; at &lt;code&gt;10.10.0.1&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Telemetry streamed directly from the kernel &lt;code&gt;STATS_MAP&lt;/code&gt; array demonstrated instantaneous 100.00% packet mitigation upon inserting an attacker IP into the kernel blocklist, followed by zero-loss recovery:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TIMESTAMP            PASSED (PKTS)   DROPPED (PKTS)  DROP RATIO     
-----------------------------------------------------------------
09:56:56 | Pass: 1        (30.2 KB) | Drop: 0        (0 B)   | Ratio: 0.00%
[!] Inserting IP 10.10.0.2 into BLOCKLIST_MAP... [SUCCESS]
09:56:57 | Pass: 0        (30.2 KB) | Drop: 1        (98 B)  | Ratio: 100.00%
09:56:58 | Pass: 0        (30.2 KB) | Drop: 1        (196 B) | Ratio: 100.00%
09:56:59 | Pass: 0        (30.2 KB) | Drop: 1        (294 B) | Ratio: 100.00%
...
09:57:55 | Pass: 0        (30.2 KB) | Drop: 1        (5.7 KB)| Ratio: 100.00%
[!] Removing IP 10.10.0.2 from BLOCKLIST_MAP... [SUCCESS]
09:57:56 | Pass: 1        (30.3 KB) | Drop: 0        (5.7 KB)| Ratio: 0.00%
09:57:57 | Pass: 1        (30.4 KB) | Drop: 0        (5.7 KB)| Ratio: 0.00%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every single drop occurred directly within the NIC driver hook, requiring zero kernel TCP/IP stack overhead.&lt;/p&gt;




&lt;h2&gt;
  
  
  Source Code &amp;amp; Research Paper
&lt;/h2&gt;

&lt;p&gt;The complete project, documentation, and formal research paper are fully open-source:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/rahadbhuiya/xdp-guard" rel="noopener noreferrer"&gt;https://github.com/rahadbhuiya/xdp-guard&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Citable Zenodo DOI:&lt;/strong&gt; &lt;a href="https://doi.org/10.5281/zenodo.23120995" rel="noopener noreferrer"&gt;10.5281/zenodo.23120995&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated CI:&lt;/strong&gt; Continuous testing across Rust Stable and Nightly LLVM targets via GitHub Actions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are working on Linux kernel systems, eBPF, or Rust networking, I would love to hear your thoughts, feedback, or suggestions!&lt;/p&gt;

</description>
      <category>rust</category>
      <category>linux</category>
      <category>ebpf</category>
      <category>networking</category>
    </item>
    <item>
      <title>Writing a Programming Language &amp; Native x86-64 Compiler from Scratch in C: The Story of Yolish</title>
      <dc:creator>Rahad Bhuiya</dc:creator>
      <pubDate>Sun, 27 Sep 2026 03:56:05 +0000</pubDate>
      <link>https://dev.to/rahadbhuiya/writing-a-programming-language-native-x86-64-compiler-from-scratch-in-c-the-story-of-yolish-k11</link>
      <guid>https://dev.to/rahadbhuiya/writing-a-programming-language-native-x86-64-compiler-from-scratch-in-c-the-story-of-yolish-k11</guid>
      <description>&lt;p&gt;Every programmer has, at some point, looked at their favorite programming language and thought: &lt;/p&gt;

&lt;p&gt;&lt;em&gt;“Why was it designed this way? How hard can it actually be to build one myself?”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Most developers who explore language design stop at simple arithmetic evaluators or toy interpreters. But when I was building &lt;strong&gt;Exploidus OS&lt;/strong&gt;—a custom x86-64 reactive capability operating system—I ran into a fundamental architectural barrier:&lt;/p&gt;

&lt;p&gt;Standard systems languages (like C) have zero concept of operating-system capability tokens. In C, if you have a pointer, you can dereference it. If you have an address space, any line of code can call any syscall unless restricted by complex external sandboxes.&lt;/p&gt;

&lt;p&gt;I wanted a modern, expressive language that felt as ergonomic as Python or Rust, but was deeply &lt;strong&gt;capability-aware&lt;/strong&gt; at the syntax level—able to compile directly to bare-metal x86-64 binaries without pulling in gigabytes of LLVM dependencies.&lt;/p&gt;

&lt;p&gt;That ambition gave birth to &lt;strong&gt;Yolish&lt;/strong&gt;—a fast, expressive, capability-aware programming language with a tree-walking interpreter, a bytecode virtual machine, and a direct x86-64 native compiler.&lt;/p&gt;

&lt;p&gt;Here is how I designed Yolish, wrote its compiler from scratch in pure C, and what I learned building a complete language ecosystem.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Language Design: Ergonomics Meets Systems Control
&lt;/h2&gt;

&lt;p&gt;When designing Yolish's syntax (&lt;code&gt;.y&lt;/code&gt;), I wanted code to read cleanly without syntactic noise, while enforcing defensive systems programming invariants.&lt;/p&gt;

&lt;h3&gt;
  
  
  Immutability by Default
&lt;/h3&gt;

&lt;p&gt;Variables in Yolish default to immutable constants using &lt;code&gt;let&lt;/code&gt;, while mutable state must be explicitly declared using &lt;code&gt;var&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let name  = "Yolish"   -- immutable constant
var count = 0          -- mutable state
count = count + 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pattern Matching with Ranges &amp;amp; Guards
&lt;/h3&gt;

&lt;p&gt;Instead of archaic C-style &lt;code&gt;switch&lt;/code&gt; statements with fallthrough bugs, Yolish features expressive pattern matching:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let grade = match score {
    90..100      =&amp;gt; "A"
    80..90       =&amp;gt; "B"
    n if n &amp;gt;= 60 =&amp;gt; "C"
    _            =&amp;gt; "F"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Structs and &lt;code&gt;impl&lt;/code&gt; Blocks
&lt;/h3&gt;

&lt;p&gt;Yolish rejects complex class hierarchies in favor of data-first structs and explicit method implementations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;struct Circle { radius }

impl Circle {
    fn area(self) {
        return y.math.pi * self.radius * self.radius
    }
}

let c = Circle { radius: 5 }
y.println(c.area())
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  2. Bridging Code to the Kernel: First-Class Capabilities
&lt;/h2&gt;

&lt;p&gt;Because Yolish is the official userspace language for Exploidus OS, security cannot be an afterthought. &lt;/p&gt;

&lt;p&gt;In Yolish, dangerous operations (network access, raw disk writes, peripheral I/O) are gated by &lt;strong&gt;declarative capability annotations&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@cap(net.read, fs.write)
fn sync_data(url, filepath) {
    let payload = y.net.get(url)
    y.fs.write(filepath, payload)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When compiled for Exploidus OS, the Yolish compiler inspects these annotations and validates them against the process's cryptographic capability table. If an unprivileged function attempts to make an unauthorized syscall, the operation is blocked before execution even reaches kernel space.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. The Tri-Engine Architecture: Interpreter, Bytecode VM, and Native Compiler
&lt;/h2&gt;

&lt;p&gt;Building a language engine involves tough tradeoffs. Tree-walking interpreters are easy to write but slow. Bytecode VMs are fast and portable. Native compilers deliver maximum speed but are deeply architecture-specific.&lt;/p&gt;

&lt;p&gt;Instead of choosing one, &lt;strong&gt;Yolish implements all three&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Source Code (.y)
       |
    [Lexer] -&amp;gt; Tokens
       |
   [Parser] -&amp;gt; Abstract Syntax Tree (AST)
       |
       +---&amp;gt; Tree-Walking Interpreter  (`ys file.y` - Instant startup)
       |
       +---&amp;gt; Bytecode Compiler &amp;amp; VM    (`ys vm file.y` - High speed execution)
       |
       +---&amp;gt; Direct x86-64 Machine Code (`ys -c file.y` - Standalone binaries)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The Interactive Interpreter (&lt;code&gt;ys file.y&lt;/code&gt;):&lt;/strong&gt; Evaluates the AST directly. Perfect for quick scripts, one-liners, and the interactive REPL.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Bytecode VM (&lt;code&gt;ys vm file.y&lt;/code&gt;):&lt;/strong&gt; Compiles the AST into an optimized instruction stream executed by a custom register/stack-based virtual machine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Native x86-64 Compiler (&lt;code&gt;ys -c file.y&lt;/code&gt;):&lt;/strong&gt; Generates real machine code instructions (&lt;code&gt;MOV&lt;/code&gt;, &lt;code&gt;ADD&lt;/code&gt;, &lt;code&gt;CALL&lt;/code&gt;, &lt;code&gt;RET&lt;/code&gt;, SSE2 float operations) directly into executable binary containers.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  4. No LLVM, No Bloat: Direct Multi-Platform Binary Emission
&lt;/h2&gt;

&lt;p&gt;Most modern compiler projects delegate code generation to LLVM. While LLVM is powerful, it is also a massive, multi-gigabyte dependency with slow compilation times.&lt;/p&gt;

&lt;p&gt;I wanted the Yolish toolchain (&lt;code&gt;ys&lt;/code&gt;) to be a single, self-contained C binary with zero external dependencies. You can clone the repo and compile the entire language toolchain with a single &lt;code&gt;make&lt;/code&gt; command using standard &lt;code&gt;gcc&lt;/code&gt; or &lt;code&gt;clang&lt;/code&gt; in seconds.&lt;/p&gt;

&lt;p&gt;To achieve this without LLVM, Yolish writes binary headers and machine code directly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Linux ELF64:&lt;/strong&gt; Directly formats ELF headers, program headers (&lt;code&gt;PT_LOAD&lt;/code&gt;), &lt;code&gt;.text&lt;/code&gt; sections, and Linux syscall dispatchers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows PE32+:&lt;/strong&gt; Generates valid Portable Executable (PE32+) headers, image import directories, and embeds Windows application icons.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;macOS Mach-O:&lt;/strong&gt; Generates 64-bit Mach-O load commands (&lt;code&gt;LC_SEGMENT_64&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can cross-compile for any major operating system with a single CLI flag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ys &lt;span class="nt"&gt;-c&lt;/span&gt; app.y &lt;span class="nt"&gt;--target&lt;/span&gt; linux    &lt;span class="c"&gt;# Emits static Linux ELF64 binary&lt;/span&gt;
ys &lt;span class="nt"&gt;-c&lt;/span&gt; app.y &lt;span class="nt"&gt;--target&lt;/span&gt; windows  &lt;span class="c"&gt;# Emits Windows PE32+ .exe&lt;/span&gt;
ys &lt;span class="nt"&gt;-c&lt;/span&gt; app.y &lt;span class="nt"&gt;--target&lt;/span&gt; macos    &lt;span class="c"&gt;# Emits macOS Mach-O binary&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  5. Runtime Architecture: Mark-and-Sweep Garbage Collection
&lt;/h2&gt;

&lt;p&gt;A systems language with dynamic strings and closures needs safe, automatic memory reclamation.&lt;/p&gt;

&lt;p&gt;Yolish implements a custom &lt;strong&gt;Mark-and-Sweep Garbage Collector (GC)&lt;/strong&gt; written from scratch in C:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Root Scanning:&lt;/strong&gt; Traverses the active call frame stack, global environment variables, and the VM operand stack to identify all actively reachable pointers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mark Phase:&lt;/strong&gt; Recursively traverses heap-allocated objects (strings, dynamic arrays, closures, struct instances), setting the GC mark bit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sweep Phase:&lt;/strong&gt; Scans the global heap allocation pool. Any block whose mark bit is zero was unreachable; it is freed back to the system memory pool, while surviving objects have their mark bits cleared for the next cycle.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Developers have full programmatic introspection into memory usage via &lt;code&gt;gc.stats()&lt;/code&gt; and can trigger explicit collection via &lt;code&gt;gc.collect()&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. A Tooling-First Philosophy
&lt;/h2&gt;

&lt;p&gt;A great programming language is more than just a syntax parser; it is an entire developer experience. &lt;/p&gt;

&lt;p&gt;Too many new languages fail because they require third-party formatters, linter plugins, and package wrappers before you can write a serious project. &lt;/p&gt;

&lt;p&gt;From day one, Yolish was designed with a &lt;strong&gt;tooling-first philosophy&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Built-in Test Runner (&lt;code&gt;ys test file.y&lt;/code&gt;):&lt;/strong&gt; Write native &lt;code&gt;test&lt;/code&gt; blocks alongside code and execute them without third-party frameworks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Static Checker (&lt;code&gt;ys check file.y&lt;/code&gt;):&lt;/strong&gt; Performs static semantic analysis, flags undefined variables, and detects type mismatches before runtime.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code Formatter (&lt;code&gt;ys fmt file.y&lt;/code&gt;):&lt;/strong&gt; Enforces an opinionated, canonical code style across codebases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive REPL (&lt;code&gt;ys&lt;/code&gt;):&lt;/strong&gt; Instant feedback loop with color-highlighted evaluation.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  7. What Writing a Compiler in C Teaches You
&lt;/h2&gt;

&lt;p&gt;Writing a programming language and compiler from scratch in pure C is one of the most humbling and rewarding journeys in software engineering:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Memory Discipline:&lt;/strong&gt; Managing AST nodes, symbol tables, and lexical scopes in C forces you to understand every single byte you allocate. Memory leaks in a compiler slow down compilation; memory corruption in code generation crashes the output binary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Magic of Abstraction:&lt;/strong&gt; When you write the code that translates a simple &lt;code&gt;if (x &amp;gt; 10)&lt;/code&gt; into a &lt;code&gt;CMP&lt;/code&gt; and &lt;code&gt;JLE&lt;/code&gt; assembly jump, you demystify how computers actually think. You realize that high-level abstractions are not magic; they are just structured transformations of intent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simplicity Over Complexity:&lt;/strong&gt; Features are easy to add to a grammar; keeping the language coherent, orthogonal, and bug-free across interpretation and native compilation is where the real engineering happens.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Conclusion &amp;amp; Open Source
&lt;/h2&gt;

&lt;p&gt;Yolish started as a specialized language project for Exploidus OS, but has evolved into a versatile, cross-platform programming environment with its own native compiler, VM, and standard library.&lt;/p&gt;

&lt;p&gt;The entire project is 100% open-source under the MIT license:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/rahadbhuiya/Yolish" rel="noopener noreferrer"&gt;https://github.com/rahadbhuiya/Yolish&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Supported Platforms:&lt;/strong&gt; Linux, Windows, macOS, and Exploidus OS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Download the binary, try out the REPL, write a script, and inspect the C compiler source!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have you ever thought about designing a programming language? What is the one feature you wish your daily language had? Let's discuss in the comments below!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>c</category>
      <category>language</category>
      <category>compilers</category>
    </item>
    <item>
      <title>Why Fail2ban Isn't Enough: Building CNSL, a Self-Hosted SIEM for Linux &amp; Kubernetes</title>
      <dc:creator>Rahad Bhuiya</dc:creator>
      <pubDate>Sat, 26 Sep 2026 04:35:44 +0000</pubDate>
      <link>https://dev.to/rahadbhuiya/why-fail2ban-isnt-enough-building-cnsl-a-self-hosted-siem-for-linux-kubernetes-5f7i</link>
      <guid>https://dev.to/rahadbhuiya/why-fail2ban-isnt-enough-building-cnsl-a-self-hosted-siem-for-linux-kubernetes-5f7i</guid>
      <description>&lt;p&gt;If you manage Linux servers, your security stack probably looks something like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fail2ban&lt;/strong&gt; scanning &lt;code&gt;/var/log/auth.log&lt;/code&gt; for failed SSH passwords.&lt;/li&gt;
&lt;li&gt;A reverse proxy or web server (NGINX / Caddy) writing HTTP access logs.&lt;/li&gt;
&lt;li&gt;A database (PostgreSQL / MySQL) logging authentication errors.&lt;/li&gt;
&lt;li&gt;A firewall (iptables / UFW) enforcing static port rules.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On paper, this sounds like a layered defense. In practice, it has a glaring, dangerous architectural flaw: &lt;strong&gt;these tools operate in complete isolation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Each tool watches a single log file and counts failures independently. And modern attackers know this.&lt;/p&gt;

&lt;p&gt;An attacker does not hammer your SSH port with 100 rapid-fire passwords anymore—that would trip Fail2ban within seconds. Instead, they scan your web endpoints for exposed &lt;code&gt;.env&lt;/code&gt; files, probe your database port for default passwords, and attempt just two SSH logins with leaked administrator credentials.&lt;/p&gt;

&lt;p&gt;To your web server, it was just a minor 404 error. To your database, it was a routine connection failure. To Fail2ban, two failed SSH logins are well below the threshold of 5.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every single tool saw a harmless blip. In reality, your server was undergoing a coordinated, multi-stage breach.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To eliminate this architectural blind spot, I built &lt;strong&gt;CNSL (Correlated Network Security Layer)&lt;/strong&gt;—a self-hosted, lightweight SIEM for Linux and Kubernetes that correlates attacks spanning web, SSH, database, and cloud logs simultaneously, stopping breaches before they complete.&lt;/p&gt;

&lt;p&gt;Here is the story of why I built it, how its cross-vector correlation engine works, and what it takes to design a modern defensive security layer from scratch.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Core Philosophy: Cross-Vector Correlation
&lt;/h2&gt;

&lt;p&gt;The foundational principle behind CNSL is simple: &lt;strong&gt;No security event should ever be evaluated in a vacuum.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When an IP address or actor touches your infrastructure, CNSL tracks their activity across every listening service simultaneously. Instead of waiting for a single service threshold to fire, CNSL computes a dynamic threat score across all vectors:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Web scan (directory traversal)  from 45.33.32.1  --+
SSH brute attempt               from 45.33.32.1  --+---&amp;gt; HIGH Alert &amp;amp; Auto-Block
DB authentication failure       from 45.33.32.1  --+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When CNSL observes an actor combining reconnaissance with authentication probing across disparate services, the threat trajectory escalates immediately. &lt;/p&gt;

&lt;p&gt;The attacker is automatically banned at the firewall/iptables level or quarantined across the entire cluster—before they ever guess a password or exploit an unpatched service.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Kill-Chain Progression &amp;amp; Predictive Blocking
&lt;/h2&gt;

&lt;p&gt;Traditional intrusion prevention systems (IPS) are reactive: they wait until a threshold is crossed before taking action.&lt;/p&gt;

&lt;p&gt;CNSL integrates &lt;strong&gt;Cyber Kill-Chain Tracking&lt;/strong&gt; modeled after the MITRE ATT&amp;amp;CK framework:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Reconnaissance:&lt;/strong&gt; Port probing, vulnerability scanning, spidering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Weaponization &amp;amp; Delivery:&lt;/strong&gt; Testing malicious payloads, path traversal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exploitation &amp;amp; Initial Access:&lt;/strong&gt; Credential stuffing, brute-forcing, privilege escalation attempts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lateral Movement:&lt;/strong&gt; Probing internal service meshes, database exfiltration.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Predictive Trajectory Blocking
&lt;/h3&gt;

&lt;p&gt;Instead of waiting for an attacker to complete the exploitation phase, CNSL features opt-in &lt;strong&gt;Predictive Blocking&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;By analyzing the &lt;em&gt;velocity&lt;/em&gt; and &lt;em&gt;breadth&lt;/em&gt; of an attack vector, the correlation engine calculates the statistical probability of an impending breach. If an IP rapidly transitions from passive web reconnaissance to active database auth probing, CNSL severs the connection proactively—reacting to the attack's trajectory before any single rule's threshold trips.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Beyond IP Addresses: Attacker Fingerprinting &amp;amp; Campaign Graphs
&lt;/h2&gt;

&lt;p&gt;Sophisticated threat actors do not use a single IP address. They utilize residential proxy networks, VPNs, and Tor exit nodes, rotating their source IP address between requests to evade IP-based rate limiters.&lt;/p&gt;

&lt;p&gt;If your security system only tracks IP addresses, you are playing an endless game of whack-a-mole.&lt;/p&gt;

&lt;p&gt;To counter IP rotation, CNSL incorporates &lt;strong&gt;Attacker Fingerprinting and Graph Correlation&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Behavioral Fingerprinting:&lt;/strong&gt; Tracks TLS cipher suites, TCP window signatures, request ordering, and user-agent entropy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Graph-Based Campaign Correlation:&lt;/strong&gt; Connects seemingly disparate IP addresses attacking your servers into a unified attack campaign graph.&lt;/li&gt;
&lt;li&gt;When Actor X rotates from &lt;code&gt;IP_A&lt;/code&gt; to &lt;code&gt;IP_B&lt;/code&gt;, CNSL recognizes the behavioral fingerprint, associates the new IP with the existing threat entity, and immediately inherits the accumulated threat score.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Threat Intelligence Federation: Built-in STIX 2.1 and TAXII 2.1
&lt;/h2&gt;

&lt;p&gt;Security should not be isolated to a single machine. When one node in your cluster discovers an aggressive threat actor, every other node should immediately know about it.&lt;/p&gt;

&lt;p&gt;Rather than relying on proprietary, vendor-locked sync protocols, CNSL natively implements global open threat intelligence standards:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;STIX 2.1 Export:&lt;/strong&gt; Converts detected threat actors, campaigns, and indicators of compromise (IOCs) into standardized STIX JSON objects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Built-in TAXII 2.1 Server:&lt;/strong&gt; Runs a native TAXII endpoint directly inside CNSL. Other servers in your infrastructure (or peer organizations) can subscribe to your TAXII collections to ingest real-time threat intelligence.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-Node Federation:&lt;/strong&gt; Allows multi-region VPS deployments or edge servers to pool threat intelligence without routing all traffic through a centralized, vulnerable bottleneck.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. From Single VPS to Kubernetes DaemonSet
&lt;/h2&gt;

&lt;p&gt;CNSL was designed to be lightweight enough to run on a $5/month VPS, yet cloud-native enough to protect modern containerized environments.&lt;/p&gt;

&lt;h3&gt;
  
  
  Running on a Single Linux Server
&lt;/h3&gt;

&lt;p&gt;CNSL can be installed directly with Python and pip:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;cnsl[full]
&lt;span class="nb"&gt;sudo &lt;/span&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; cnsl &lt;span class="nt"&gt;--dashboard&lt;/span&gt; &lt;span class="nt"&gt;--no-tcpdump&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By default, CNSL boots into safe &lt;strong&gt;dry-run mode&lt;/strong&gt;—it correlates events, populates the live dashboard, and logs detected campaigns without modifying firewall rules until you explicitly pass &lt;code&gt;--execute&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The built-in web dashboard (running on port &lt;code&gt;8765&lt;/code&gt;) gives operators real-time visibility into active threats, geographic origins, attack kill-chain phases, and blocked IPs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Running on Kubernetes
&lt;/h3&gt;

&lt;p&gt;In modern Kubernetes clusters, attackers frequently compromise one container and attempt lateral movement toward neighbor pods or database secrets.&lt;/p&gt;

&lt;p&gt;CNSL provides an official Helm chart designed to run as a &lt;strong&gt;DaemonSet&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;helm &lt;span class="nb"&gt;install &lt;/span&gt;cnsl ./helm/cnsl &lt;span class="nt"&gt;--namespace&lt;/span&gt; cnsl &lt;span class="nt"&gt;--create-namespace&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One CNSL agent runs per Kubernetes node, monitoring container socket events, host logs, and ingress traffic, feeding telemetry into a unified multi-node Hub view.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. What I Learned Building a SIEM from Scratch
&lt;/h2&gt;

&lt;p&gt;Building a real-time correlation engine in Python and systems-level Linux tooling provided some invaluable engineering insights:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Log parsing is a performance minefield:&lt;/strong&gt; When a high-traffic server generates 10,000 log lines per second, regex matching can easily peg your CPU at 100%. Implementing ring buffers, compiled zero-allocation parsers, and asynchronous pipeline queues is mandatory to keep memory and CPU footprints negligible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;False positives destroy credibility:&lt;/strong&gt; If a security tool accidentally bans an administrator or a legitimate customer, operators will turn it off immediately. Multi-vector correlation actually &lt;em&gt;reduces&lt;/em&gt; false positives because a user making a typo on a web form is never banned—only entities combining suspicious behavior across multiple services are flagged.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open standards win every time:&lt;/strong&gt; Implementing STIX/TAXII and integrations with Wazuh/OSSEC meant CNSL could plug seamlessly into existing SOC workflows without requiring operators to reinvent their operational playbooks.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Conclusion: Take Back Control of Your Server Security
&lt;/h2&gt;

&lt;p&gt;Enterprise SIEMs (like Splunk or Datadog) cost tens of thousands of dollars per year and consume massive amounts of memory. On the other end of the spectrum, single-log watchers like Fail2ban are too blind to stop multi-vector attacks.&lt;/p&gt;

&lt;p&gt;CNSL was built to bridge this gap: an open-source, self-hosted, correlated security engine that gives developers, self-hosters, and DevOps engineers enterprise-grade situational awareness with zero vendor lock-in.&lt;/p&gt;

&lt;p&gt;The entire project is open-source under the MIT license:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/rahadbhuiya/cnsl" rel="noopener noreferrer"&gt;https://github.com/rahadbhuiya/cnsl&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PyPI Package:&lt;/strong&gt; &lt;a href="https://pypi.org/project/cnsl" rel="noopener noreferrer"&gt;https://pypi.org/project/cnsl&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Clone it, test it in dry-run mode on your servers, and let me know your thoughts!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;How do you currently monitor and correlate security events across your Linux servers? Have you ever caught an attacker probing across multiple ports? Let's discuss in the comments below!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>devops</category>
      <category>python</category>
      <category>linux</category>
    </item>
    <item>
      <title>Building an x86-64 Operating System from Scratch in C: The Exploidus Story</title>
      <dc:creator>Rahad Bhuiya</dc:creator>
      <pubDate>Thu, 24 Sep 2026 13:36:21 +0000</pubDate>
      <link>https://dev.to/rahadbhuiya/building-an-x86-64-operating-system-from-scratch-in-c-the-exploidus-story-2h8l</link>
      <guid>https://dev.to/rahadbhuiya/building-an-x86-64-operating-system-from-scratch-in-c-the-exploidus-story-2h8l</guid>
      <description>&lt;p&gt;Most software engineers spend their careers working high up the abstraction ladder: web frameworks, containers, virtual machines, and cloud APIs. We treat the operating system as an invisible, infallible foundation. We assume malloc() will magically allocate RAM, write() will reliably flush bytes to disk, and the CPU will seamlessly multiplex threads.&lt;/p&gt;

&lt;p&gt;A few years ago, I decided to pull back the curtain and ask a fundamental question:&lt;/p&gt;

&lt;p&gt;What actually happens if you strip away Linux, Windows, libc, and every single runtime library, and sit directly on the bare metal of an x86-64 processor with nothing but C and assembly?&lt;/p&gt;

&lt;p&gt;That question led to Exploidus—a custom x86-64 reactive capability operating system kernel built completely from scratch.&lt;/p&gt;

&lt;p&gt;Today, Exploidus boots via Multiboot2/GRUB, runs in full 64-bit long mode, implements 4-level paging with NX enforcement, features a custom journaling filesystem (ExFS), runs an in-kernel TCP/IP stack with real Gigabit Ethernet drivers, enforces BLAKE3 cryptographic capability tokens, supports 82 POSIX-style syscalls, and even powers a double-buffered userspace window compositor.&lt;/p&gt;

&lt;p&gt;Here is the story of how I designed and built it, the architectural hurdles I faced, and what bare-metal systems programming teaches you about software engineering.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Starting Line: From Real Mode to 64-Bit Long Mode
When an x86-64 processor powers on, it does not wake up as a modern 64-bit machine. It awakens in 16-bit Real Mode, essentially pretending to be an Intel 8086 from 1978 with 1 MB of addressable memory.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To get Exploidus running, the bootloader transition had to be orchestrated meticulously:&lt;/p&gt;

&lt;p&gt;Multiboot2 Compliance: The kernel binary begins with a Multiboot2 header so GRUB2 can discover and load our ELF64 image into memory.&lt;br&gt;
Transitioning Modes: Moving through 32-bit Protected Mode, setting up the Global Descriptor Table (GDT), enabling Physical Address Extension (PAE), and finally setting the Long Mode Enable (LME) bit in the EFER model-specific register.&lt;br&gt;
Entering Long Mode: Once paging is turned on and a 64-bit GDT code descriptor is loaded, a far jump lands execution into pure 64-bit Long Mode.&lt;br&gt;
At this stage, you have no printf, no standard library, and no memory allocator. If a pointer dereferences wrong, the CPU triple-faults and the machine instantly reboots in a split second.&lt;/p&gt;

&lt;p&gt;The first milestone of any OS developer is the VGA text-mode driver at physical address 0xB8000. Writing characters directly into video memory bytes and watching the word Exploidus Kernel Initializing... render on a blank screen is a sensation every programmer should experience at least once.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Memory Architecture: 4-Level Paging and Colored Zones
Virtual memory is the bedrock of process isolation. Without it, any runaway pointer can overwrite the kernel or another process's state.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In Exploidus, memory management is divided into two core layers:&lt;/p&gt;

&lt;p&gt;4-Level x86-64 Paging&lt;br&gt;
Exploidus uses the standard x86-64 page-table hierarchy:&lt;/p&gt;

&lt;p&gt;PML4 (Page Map Level 4)&lt;br&gt;
PDPT (Page Directory Pointer Table)&lt;br&gt;
PD (Page Directory)&lt;br&gt;
PT (Page Table)&lt;br&gt;
Every page entry manages a 4 KB physical frame. To enforce strict security:&lt;/p&gt;

&lt;p&gt;NX (No-Execute) Bit Enforcement: All data, heap, and stack pages are flagged with the XD/NX bit (bit 63). Code cannot execute from the stack or heap, neutralizing classic buffer overflow shellcode attacks at the hardware level.&lt;br&gt;
User/Supervisor Protection: Kernel space is mapped into the higher half and strictly protected by disabling the User bit (U/S = 0), preventing Ring 3 userspace applications from reading or writing kernel data structures.&lt;br&gt;
Colored Physical Frame Allocation&lt;br&gt;
Instead of a naive linear allocator or a slow buddy system, Exploidus introduces a Colored Zone Physical Memory Manager:&lt;/p&gt;

&lt;p&gt;GREEN ZONE: Unrestricted, verified general-purpose memory for userspace processes.&lt;br&gt;
YELLOW ZONE: DMA-capable and peripheral-bounded memory mapped for hardware device drivers (e.g. NIC ring buffers, USB host controllers).&lt;br&gt;
RED ZONE: Cryptographically isolated, non-swappable physical frames reserved strictly for kernel capability tokens, master page tables, and audit logs.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Capability Security &amp;amp; Crash Isolation
Most commodity operating systems rely on ambient authority (e.g. standard UID/GID or Unix permissions). If a process runs as root, it can execute anything.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Exploidus explores a Reactive Capability-Based Security Model:&lt;/p&gt;

&lt;p&gt;Resources (file descriptors, sockets, physical devices, IPC channels) are gated behind unforgeable capability tokens.&lt;br&gt;
Hardware-Seeded BLAKE3 Tokens: Tokens are generated by hashing resource pointers and generation counters using the BLAKE3 cryptographic algorithm, seeded with random entropy directly from the CPU's RDRAND instruction.&lt;br&gt;
Crash Isolation: If a userspace process suffers a segmentation fault, divides by zero, or triggers an invalid opcode, the kernel does not panic. The CPU interrupt handler traps the exception, destroys the faulting process's capability table, reclaims its address space, and terminates only that process. The shell and the rest of the OS continue running uninterrupted.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Designing a Custom Filesystem: ExFS
You cannot have a functional operating system without persistent storage. While many hobby kernels stop at read-only tar ramdisks or FAT12, Exploidus features its own custom filesystem: ExFS.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Key Architectural Elements of ExFS:&lt;br&gt;
Generic Block Device Layer: An abstraction layer (blockdev.c) decouples storage hardware from the filesystem. Whether a volume is an IDE/ATA hard drive (ata0) or a USB thumb drive (usb0), ExFS interacts through unified sector read/write interfaces.&lt;br&gt;
Metadata Journaling: ExFS uses a write-ahead metadata journal to ensure crash consistency. Directory modifications, inode allocations, and block allocations are recorded in a circular journal before being committed to disk structures. If a sudden power loss occurs, replay recovery restores volume consistency upon reboot.&lt;br&gt;
Data Provenance: Inodes in ExFS carry immutable provenance records, tracking the creator capability and timestamp of creation to provide built-in forensic audit trails.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Drivers from the Metal: USB and Gigabit Ethernet
Writing device drivers without third-party libraries or Linux helper APIs is where hardware reality hits you hardest. Data sheets for real silicon can be hundreds of pages long and filled with subtle timing quirks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;UHCI USB Subsystem&lt;br&gt;
Exploidus includes a custom UHCI (Universal Host Controller Interface) USB driver:&lt;/p&gt;

&lt;p&gt;Probes PCI configuration space to discover USB host controllers.&lt;br&gt;
Configures physical memory transfer descriptors (TDs) and queue heads (QHs) in DMA-accessible memory.&lt;br&gt;
Implements USB device enumeration, Control, Interrupt, and Bulk endpoints.&lt;br&gt;
Supports USB Mass Storage (Bulk-Only Transport + SCSI command wrappers), allowing developers to plug in a USB flash drive, mount it into the VFS, and read files via the shell.&lt;br&gt;
Gigabit Networking &amp;amp; In-Kernel TCP/IP Stack&lt;br&gt;
Exploidus features an in-kernel network stack communicating through an Intel 82540EM (e1000) Gigabit Ethernet controller:&lt;/p&gt;

&lt;p&gt;Layer 2: Ethernet frame parsing and ARP table resolution with cache expiration.&lt;br&gt;
Layer 3: IPv4 parsing, checksum calculation, and IP fragment reassembly.&lt;br&gt;
Layer 4: ICMP (ping echo reply/request), UDP, and full TCP state machine (three-way handshake SYN -&amp;gt; SYN-ACK -&amp;gt; ACK, sequence/acknowledgment tracking, window scaling, and packet retransmission).&lt;br&gt;
Because the TCP/IP stack runs natively inside the kernel, userspace processes can issue POSIX-like socket(), connect(), send(), and recv() syscalls to communicate over the real local network.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;From the exploish Shell to a GUI Compositor
An OS needs an interface to be useful. Exploidus provides two layers:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The exploish Interactive Shell&lt;br&gt;
exploish runs as a Ring 3 userspace process, executing commands via system calls:&lt;/p&gt;

&lt;p&gt;ps: Inspects real kernel process tables, priorities, and execution states.&lt;br&gt;
audit: Reads cryptographic audit log entries directly from the kernel.&lt;br&gt;
mount / ls / cat: Traverses and manipulates the ExFS filesystem.&lt;br&gt;
The alien Window Compositor&lt;br&gt;
Moving beyond text mode, Exploidus includes a userspace graphical compositor called alien:&lt;/p&gt;

&lt;p&gt;Utilizes VESA / Linear Framebuffer modes discovered via Multiboot.&lt;br&gt;
Single-Syscall Window Blitting (SYS_FB_BLIT): Minimizes user-to-kernel context switching during rendering.&lt;br&gt;
Double-Buffering &amp;amp; Dirty-Region Redraws: Windows maintain their own back-buffers in userspace; the compositor only copies modified bounding boxes to the screen buffer, providing flicker-free rendering with real-time frame pacing.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What Building an OS Taught Me
Writing an operating system from scratch over months and years completely reshapes how you look at software engineering:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Hardware is not clean; it is quirky: Silicon behaves in strange ways. Concurrency is not just threads racing; it is hardware interrupts firing in the middle of a critical pointer assignment. You develop an immense respect for atomic operations, IRQ-safe spinlocks, and memory barriers.&lt;br&gt;
Abstractions have a real cost: When you have to write your own kmalloc(), page fault handler, and scheduling timer, you realize that memory allocations and context switches are not free. High-level frameworks often hide enormous amounts of churn.&lt;br&gt;
Debugging without tools builds discipline: When you don't have GDB or stack traces, and an invalid memory write freezes the CPU instantly, you learn to reason through your code with mathematical precision. You read every line, analyze register states, and build defensive invariants.&lt;br&gt;
Conclusion &amp;amp; Open Source&lt;br&gt;
Exploidus started as an ambitious experiment in Bangladesh to explore what it takes to build an operating system from zero without relying on existing Linux codebases. Today, it stands as a fully documented, open-source x86-64 capability kernel with a rich ecosystem of drivers, filesystems, and networking.&lt;/p&gt;

&lt;p&gt;If you are interested in OS development, systems programming, or seeing how an x86-64 kernel works under the hood, the entire codebase is open-source:&lt;/p&gt;

&lt;p&gt;GitHub Repository: &lt;a href="https://github.com/rahadbhuiya/Exploidus" rel="noopener noreferrer"&gt;https://github.com/rahadbhuiya/Exploidus&lt;/a&gt;&lt;br&gt;
Feel free to star the repo, clone it, run it in QEMU, or read through the kernel source!&lt;/p&gt;

&lt;p&gt;Have you ever experimented with operating system development or bare-metal programming? What was the hardest low-level bug you ever encountered? Let's discuss in the comments below!&lt;/p&gt;

</description>
      <category>osdev</category>
      <category>c</category>
      <category>programming</category>
      <category>exploidus</category>
    </item>
    <item>
      <title>What if servers balanced load like Emperor Penguins? Meet HuddleCluster</title>
      <dc:creator>Rahad Bhuiya</dc:creator>
      <pubDate>Fri, 04 Sep 2026 14:10:38 +0000</pubDate>
      <link>https://dev.to/rahadbhuiya/what-if-servers-balanced-load-like-emperor-penguins-meet-huddlecluster-4kjb</link>
      <guid>https://dev.to/rahadbhuiya/what-if-servers-balanced-load-like-emperor-penguins-meet-huddlecluster-4kjb</guid>
      <description>&lt;p&gt;In Antarctic blizzards where temperatures drop below -40°C and winds scream past 200 km/h, Emperor Penguins survive without any central coordinator.&lt;/p&gt;

&lt;p&gt;Their survival relies on a single distributed rule:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you are freezing on the outer edge, push inward toward the core.&lt;/li&gt;
&lt;li&gt;If you are getting too warm at the center, drift outward to cool down.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The colony continuously self-organizes, maintaining dynamic equilibrium and thermal fairness automatically.&lt;/p&gt;

&lt;p&gt;As a systems engineer, I realized: &lt;strong&gt;Why aren't our server clusters doing the same thing?&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem With Traditional Load Balancers
&lt;/h2&gt;

&lt;p&gt;Traditional load balancers (like NGINX, HAProxy, or standard round-robin proxies) rely on static thresholds, rigid timeout intervals, and binary health checks. &lt;/p&gt;

&lt;p&gt;A server is either marked 100% "healthy" or abruptly declared "dead".&lt;/p&gt;

&lt;p&gt;In unpredictable production environments (traffic spikes, noisy neighbors, or thermal throttling), this binary model frequently causes &lt;strong&gt;cascading cluster blackouts&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A node slows down under sudden traffic and its latency spikes.&lt;/li&gt;
&lt;li&gt;Standard schedulers keep hammering it until a hard timeout threshold trips.&lt;/li&gt;
&lt;li&gt;The load balancer abruptly severs the node completely from the cluster.&lt;/li&gt;
&lt;li&gt;The remaining servers suddenly absorb 100% of the redirected traffic.&lt;/li&gt;
&lt;li&gt;This sudden stampede overwhelms the healthy nodes, pushing them into saturation and triggering a domino-effect crash across the entire fleet.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  How HuddleCluster Solves This
&lt;/h2&gt;

&lt;p&gt;I built &lt;strong&gt;HuddleCluster&lt;/strong&gt; (v4.15.0) to replace rigid binary thresholds with continuous, bio-inspired thermal attenuation.&lt;/p&gt;

&lt;p&gt;Instead of a flat pool, servers self-organize into concentric rings:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Inner Core Ring:&lt;/strong&gt; Actively serves critical, high-throughput requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Relative Anomaly Eviction:&lt;/strong&gt; Rather than comparing metrics against arbitrary fixed numbers, nodes are continuously evaluated using moving-window Z-scores across the fleet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adaptive Cooling Ring:&lt;/strong&gt; When a node experiences elevated latency, error rates, or compute pressure, it smoothly drifts to an outer ring. Its traffic weight is reduced, shedding load while allowing in-flight connections to drain cleanly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Autonomous Convergence:&lt;/strong&gt; Once the node's metrics cool down and normalize, it rotates back into the active core automatically—without human intervention or manual triage.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;Production-Grade Multi-Node Fleet&lt;br&gt;
Beyond single-instance routing, HuddleCluster provides an enterprise-ready distributed control plane:&lt;/p&gt;

&lt;p&gt;Master-Agent Architecture: Built on FastAPI with a lightweight CLI tool (huddle-cluster).&lt;br&gt;
High Availability (HA): Raft-simplified leader election, state persistence across restarts, and write forwarding.&lt;br&gt;
Canary &amp;amp; Rolling Updates: Weight-based traffic splitting with automated health gates.&lt;br&gt;
Kubernetes Native: Native Kubernetes Service Discovery and official Helm deployment charts.&lt;br&gt;
Security: Fine-grained RBAC scopes and Mutual TLS (mTLS) node identity verification.&lt;br&gt;
Observability: Structured JSON logging, distributed trace IDs, and Prometheus metrics.&lt;/p&gt;

&lt;p&gt;Interactive Live Simulation &amp;amp; Source Code&lt;br&gt;
I built an interactive HTML5 simulation where you can watch the penguin ring rotation algorithm live in your browser:&lt;/p&gt;

&lt;p&gt;Live Interactive Website: &lt;a href="https://rahadbhuiya.github.io/HuddleCluster/" rel="noopener noreferrer"&gt;https://rahadbhuiya.github.io/HuddleCluster/&lt;/a&gt;&lt;br&gt;
GitHub Repository (MIT Licensed): &lt;a href="https://github.com/rahadbhuiya/HuddleCluster" rel="noopener noreferrer"&gt;https://github.com/rahadbhuiya/HuddleCluster&lt;/a&gt;&lt;br&gt;
PyPI: pip install huddle-cluster&lt;br&gt;
Preprint / Paper: Zenodo DOI: 10.5281/zenodo.20348019&lt;/p&gt;

&lt;p&gt;What Do You Think?&lt;br&gt;
I would love to hear feedback from backend engineers, SREs, and distributed systems enthusiasts:&lt;/p&gt;

&lt;p&gt;How does your team currently prevent cascading microservice timeouts during traffic spikes?&lt;br&gt;
What edge cases would you like to see benchmarked in future releases?&lt;br&gt;
If you find this bio-inspired approach interesting, check out the repository, star it on GitHub, and let me know your thoughts in the comments below!&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Example in Python
&lt;/h2&gt;

&lt;p&gt;HuddleCluster has a zero-dependency Python core and can be deployed in just a few lines of code:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
python
import requests
from huddle_cluster import create_cluster

# Initialize the self-organizing pool
cluster = create_cluster([
    ("srv-01", "10.0.0.1", 8080),
    ("srv-02", "10.0.0.2", 8080),
    ("srv-03", "10.0.0.3", 8080),
])
cluster.start()

# Route requests with automatic thermal awareness
with cluster.get_server_context() as server:
    response = requests.get(f"http://{server.host}:{server.port}/api/data")
    print(f"Processed by node: {server.name}")

# Inspect self-healing status
print(cluster.health_report())
# Output: {"fairness_score": 0.94, "rotation_count": 12, "cluster_health": "healthy"}

cluster.stop()







&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>python</category>
      <category>devops</category>
      <category>architecture</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Turing's Escape</title>
      <dc:creator>Rahad Bhuiya</dc:creator>
      <pubDate>Fri, 19 Jun 2026 15:54:52 +0000</pubDate>
      <link>https://dev.to/rahadbhuiya/turings-escape-219e</link>
      <guid>https://dev.to/rahadbhuiya/turings-escape-219e</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/june-game-jam-2026-06-03"&gt;June Solstice Game Jam&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Turing's Escape is a single-file browser puzzle game set in a fictional 1954 cryptography station, built around one idea: a literal Turing Test. The player is a new recruit who has to clear three tests before going home — break a Caesar-shifted intercept, talk to two telegraph operators and work out which one is human, then decode a punched-tape Morse message to open the vault. The middle test is the whole point: one operator's replies are scripted, the other's come live from Google's Gemini API, re-randomized every playthrough, and the player has to guess which is which with no hint beyond the conversation itself.&lt;br&gt;
It ties into the jam themes on three levels at once rather than one per box: the "longest day" setting (a desk-lamp lit case file on the solstice night, light pooling against the dark edges of the page), the Alan Turing tribute (explained fully below), and a closing dedication that quietly lets Pride Month and Turing's own history sit in the same place, since June is both.&lt;br&gt;
Play it: &lt;a href="https://rahadbhuiya.itch.io/turings-escape" rel="noopener noreferrer"&gt;https://rahadbhuiya.itch.io/turings-escape&lt;/a&gt;&lt;br&gt;
Built with: HTML, CSS, vanilla JavaScript, Google Gemini API — no backend, no build step, no framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;github: &lt;a href="https://github.com/rahadbhuiya/turings-escape" rel="noopener noreferrer"&gt;https://github.com/rahadbhuiya/turings-escape&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;Most jam entries treat their bonus categories as separate boxes to check: a Turing reference bolted onto otherwise generic gameplay, an AI API called once for a line of flavor text nobody reads twice. The decision that shaped everything else here was refusing to do that — building one mechanic that was simultaneously the theme, the tribute, and the AI integration, so pulling out any single piece would break the game rather than just shrink a credits screen. The other honest constraint was a five-day window and a zero-dollar API budget, which ruled out a backend, paid models, and any art we didn't have time to make.&lt;br&gt;
What that left is a single static HTML file: no server, no database, no build step. The state machine, all three puzzle modules, and a small WebAudio engine that synthesizes every sound effect on the fly (there are no audio asset files in the project at all) run entirely client-side in vanilla JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbj0x4ecv6afxdmwo09dv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbj0x4ecv6afxdmwo09dv.png" alt=" " width="799" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The only network call the game ever makes is the one outbound request to Gemini, for the live half of the Turing Test puzzle — everything else, including the entire "human" side of that same conversation, is local and offline by design. That made the game trivial to deploy as one file and just as trivial to demo with no internet connection at all, if a key isn't on hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Category
&lt;/h2&gt;

&lt;p&gt;Best Ode to Alan Turing — Turing isn't a skin on top of a generic escape room here; he's the reason the central mechanic exists. His 1950 paper, "Computing Machinery and Intelligence," asked whether a human judge could reliably tell a machine from a person through conversation alone — that question is the entire second test in this game. We chose not to put Turing on stage as a speaking character; he never appears, and nothing invents a quote in his name. Instead the closing screen dedicates the game to him as history rather than fiction: breaking Enigma, the 1950 paper, his 1952 prosecution for being gay under then-current UK law, and his death two years later at forty-one. It's also why the visuals are paper, typewriter type, and rubber stamps instead of a green-phosphor hacker terminal — interactive CRT screens barely existed yet in 1954, so the case-file look is the one actually true to his era, not just the one that reads as "computer-y" now.&lt;/p&gt;

&lt;p&gt;Best Google AI Usage — One of the two operator lines, randomized to Line A or Line B every playthrough, is answered live by Google's Gemini API (gemini-2.5-flash) rather than pre-written. Every player message goes out with a system instruction that puts the model in character as a 1954 telegraph operator and tells it never to reveal it's an AI; whatever comes back streams straight into the chat log, unedited. Flash and Flash-Lite are the tiers Google currently leaves open for free-tier use, with Pro held back for paid accounts, which made Flash the only realistic choice on a zero-budget build. Because a live demo in front of judges is the worst place for a network call to fail, every Gemini request is wrapped end to end — a missing key, a failed fetch, a rate limit, or an empty response all fall through silently to a pool of scripted lines tuned to feel just slightly too smooth and agreeable, the uncanny-valley opposite of the deliberately imperfect lines written for the human side. The AI is real and load-bearing for the puzzle, but never a single point of failure for the submission itself.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>gamechallenge</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>A load balancer inspired by how Emperor Penguins survive Antarctic winters</title>
      <dc:creator>Rahad Bhuiya</dc:creator>
      <pubDate>Mon, 15 Jun 2026 15:32:22 +0000</pubDate>
      <link>https://dev.to/rahadbhuiya/a-load-balancer-inspired-by-how-emperor-penguins-survive-antarctic-winters-582n</link>
      <guid>https://dev.to/rahadbhuiya/a-load-balancer-inspired-by-how-emperor-penguins-survive-antarctic-winters-582n</guid>
      <description>&lt;p&gt;Why I modeled a load balancer after Emperor Penguin huddles&lt;/p&gt;

&lt;p&gt;A few months ago I was reading about how emperor penguins survive Antarctic winters. Temperature drops to -40°C, wind hits 120km/h, and somehow these birds make it through. Not because they're individually tough. Because they rotate.&lt;/p&gt;

&lt;p&gt;Cold penguins on the outside push inward. Warm ones from the center move out to rest. Nobody coordinates this. No penguin is in charge. It emerges from one simple rule: if you're cold, push in. If you're warm, you'll get pushed out eventually.&lt;/p&gt;

&lt;p&gt;I couldn't stop thinking about this.&lt;/p&gt;

&lt;p&gt;I was working on a service mesh at the time and dealing with the usual problem — one slow server quietly dragging down the whole cluster. Round robin doesn't care. Least connections helps but not always. Weighted approaches need manual tuning that goes stale immediately.&lt;/p&gt;

&lt;p&gt;The penguin thing kept nagging at me. What if servers had a "temperature"? What if hot servers rotated out to rest?&lt;/p&gt;

&lt;p&gt;That's HuddleCluster.&lt;/p&gt;

&lt;p&gt;The basic structure&lt;/p&gt;

&lt;p&gt;Two rings:&lt;/p&gt;

&lt;p&gt;Inner ring (deque): Active servers. Requests go to them round-robin. Simple, fair, zero overhead for normal traffic.&lt;/p&gt;

&lt;p&gt;Outer ring (min-heap): Resting servers. Keyed by temperature — coolest server sits at the top, ready to rotate back in first.&lt;/p&gt;

&lt;p&gt;When a server in the inner ring runs hot past a threshold, it moves out. When an outer ring server cools down, it comes back in.&lt;/p&gt;

&lt;p&gt;That's the entire rotation logic. About 50 lines of Python.&lt;/p&gt;

&lt;p&gt;What is "temperature"?&lt;/p&gt;

&lt;p&gt;This took me a while to get right.&lt;/p&gt;

&lt;p&gt;My first attempt was just raw latency. That was bad. A server handling one slow database query looks terrible even when it's completely healthy. I needed something more composed.&lt;/p&gt;

&lt;p&gt;Current formula:&lt;/p&gt;

&lt;p&gt;pythontemperature = EMA(&lt;br&gt;
    0.7 * relative_latency_anomaly +&lt;br&gt;
    0.1 * cpu_score +&lt;br&gt;
    0.1 * memory_score +&lt;br&gt;
    0.1 * (error_rate + connection_score)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;Three decisions here worth explaining.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;EMA over simple moving average&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;EMA weights recent measurements more heavily. If a server just had a bad spike but recovered, EMA reflects that recovery faster than a window average would. The formula:&lt;/p&gt;

&lt;p&gt;EMA_t = α * current_value + (1 - α) * EMA_{t-1}&lt;/p&gt;

&lt;p&gt;Higher α means faster reaction but more noise sensitivity. Lower means smoother but slower detection. I tuned α empirically — the benchmark section covers what I observed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Relative latency anomaly, not absolute latency&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is the part I'm most happy with.&lt;/p&gt;

&lt;p&gt;Instead of flagging a server when latency crosses some hardcoded threshold like "300ms is bad," I compare each server to the cluster median:&lt;/p&gt;

&lt;p&gt;pythonrelative_anomaly = (server_latency - cluster_median) / cluster_median&lt;/p&gt;

&lt;p&gt;Why does this matter? If your whole cluster is running at 200ms — maybe it's a heavy batch job period, maybe your database is under load — that's just the current normal. A 200ms server shouldn't be punished when everyone is at 200ms. But a 400ms server in a 200ms cluster? That's a real anomaly.&lt;/p&gt;

&lt;p&gt;No manual threshold needed. The system self-calibrates to whatever your current traffic looks like. 60ms is fine if the cluster median is 60ms. The scoring is scale-invariant.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;70/30 split between latency and system metrics&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Latency is the user-visible signal. CPU, memory, and connections are leading indicators — they can catch problems before latency visibly degrades. I weighted latency higher because that's ultimately what matters, but the other signals pull their weight.&lt;/p&gt;

&lt;p&gt;Data structure choices&lt;/p&gt;

&lt;p&gt;Inner ring as deque: Round-robin is just rotating a deque. Append to right, pop from left. O(1) for both. I tried a list first — the index tracking got messy and error-prone whenever servers got removed mid-rotation. Deque was cleaner and the right tool.&lt;/p&gt;

&lt;p&gt;Outer ring as min-heap: I want the coolest resting server to come back in first. Min-heap gives me that in O(log n) for insertion and extraction. I briefly considered just sorting the outer ring on every update — fine at small n, but min-heap felt more principled and honest about the intent.&lt;/p&gt;

&lt;p&gt;The whole thing is about 700 lines of Python with zero external dependencies. I deliberately avoided pulling in anything external. I wanted this to be droppable into any project without a dependency audit conversation.&lt;/p&gt;

&lt;p&gt;What the benchmarks showed&lt;/p&gt;

&lt;p&gt;I tested with 6 FastAPI servers on loopback (all on the same machine). That's a significant caveat — I'll address it directly in the limitations section.&lt;/p&gt;

&lt;p&gt;Normal load: HuddleCluster performs comparably to round-robin and least-connections. No meaningful difference. That's expected. When nothing is degraded, rotation rarely triggers and the deque just does round-robin like anything else.&lt;/p&gt;

&lt;p&gt;Server failure simulation: I introduced artificial 5-second delays on one server mid-test. This is where the gap appeared.&lt;/p&gt;

&lt;p&gt;AlgorithmP95 LatencyRound Robin5,026msLeast Connections4,891msHuddleCluster85.6ms&lt;/p&gt;

&lt;p&gt;Round-robin kept routing 1-in-6 requests to the slow server throughout the test. HuddleCluster evicted it after approximately 3 request cycles — detection converges in about 36 cluster requests on average.&lt;/p&gt;

&lt;p&gt;Inner ring fairness: Gini coefficient was 0.00 in every test scenario. The deque distributes perfectly evenly among active servers.&lt;/p&gt;

&lt;p&gt;Routing overhead: 10.7μs per request average. Acceptable for the use case.&lt;/p&gt;

&lt;p&gt;Where it breaks&lt;/p&gt;

&lt;p&gt;I think this section matters as much as the benchmark numbers.&lt;/p&gt;

&lt;p&gt;Loopback is not production. Every benchmark I ran is on a single machine. WAN introduces higher base latency, more jitter, and failure modes I haven't tested. The EMA sensitivity I tuned for loopback may need adjustment for real network conditions — high per-server jitter could cause false evictions if α is too aggressive. This is the most honest gap in the current work.&lt;/p&gt;

&lt;p&gt;The k ≥ n/2 problem. Relative scoring works well when a minority of servers degrade. If half or more of your cluster slows down simultaneously — shared database contention, a network event, a traffic spike hitting everyone — the cluster median shifts up and no individual server looks anomalous. The algorithm goes blind. I document this in the paper but haven't solved it yet.&lt;/p&gt;

&lt;p&gt;No cross-host state. HuddleCluster runs per-process. Multiple load balancer instances don't share rotation state. There's a gossip protocol stub in v1.3.0 but it's not complete.&lt;/p&gt;

&lt;p&gt;Detection speed&lt;/p&gt;

&lt;p&gt;One thing that surprised me during benchmarking: how fast eviction actually happens in practice.&lt;/p&gt;

&lt;p&gt;A 3× slower server gets rotated out in roughly 3 request cycles. For most traffic volumes that's well under a second. I expected slower convergence — the EMA smoothing should delay reaction — but the relative scoring amplifies the signal enough that threshold crossing happens fast.&lt;/p&gt;

&lt;p&gt;What's next&lt;/p&gt;

&lt;p&gt;WAN benchmarks are the obvious priority. I want to understand how the EMA α needs to change under real network jitter before claiming this is production-ready.&lt;/p&gt;

&lt;p&gt;The multi-server simultaneous degradation case also needs empirical testing. I have theoretical analysis of why relative scoring breaks at k ≥ n/2, but I want to measure the actual degradation curve — at what point does detection start failing?&lt;/p&gt;

&lt;p&gt;Distributed state via gossip is in progress.&lt;/p&gt;

&lt;p&gt;GitHub: github.com/rahadbhuiya/HuddleCluster&lt;/p&gt;

&lt;p&gt;Paper: doi.org/10.5281/zenodo.20348019&lt;/p&gt;

&lt;p&gt;If you've worked with adaptive load balancing in production — especially anything with relative or percentile-based scoring — I'd be curious what threshold strategies held up under WAN jitter.&lt;/p&gt;

</description>
      <category>python</category>
      <category>huddlecluster</category>
      <category>load</category>
      <category>balancer</category>
    </item>
  </channel>
</rss>
