SShortSingh.
Back to feed

How BibaVPN Handles Flow Control and Receive Buffers in a Rust TCP Multiplexer

0
·5 views

BibaVPN, an experimental Rust-based tunnel, implements a TCP multiplexer that carries multiple logical streams over a shared WebSocket connection. The system uses per-stream receive state and separate directional pumps to prevent any single stream's socket speed from blocking others. A negotiated byte-credit extension tracks outstanding data, only returning flow-control credit to a peer after a write_all() call completes to avoid buffer overruns. A session-level 64 MiB admission budget caps how many streams can reserve local receive windows simultaneously. The implementation also accounts for bytes::Bytes backing-allocation behavior, which can cause a short slice to retain a much larger underlying memory block if not explicitly compacted.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer Builds Multiplayer Tic-Tac-Toe Backend in Go Without AI Coding Assistants

A software developer intentionally built a multiplayer Tic-Tac-Toe backend in Go without the help of AI coding agents, choosing instead to design and debug every component manually. The project used HTTP endpoints and WebSocket connections to handle game creation, player turns, move validation, and real-time state broadcasting. The developer structured the codebase in layered responsibilities — HTTP handler, GameManager, Game, and Board — to keep logic cleanly separated and easier to reason about. A GameManager layer was introduced to handle multiple concurrent games without burdening the HTTP layer with state management. The author's stated goal was to use a simple, well-understood problem domain to focus on backend architecture decisions rather than complex business logic.

0
ProgrammingDEV Community ·

How TCP Turns an Unreliable Network Into a Trustworthy Data Stream

TCP (Transmission Control Protocol) is designed to deliver reliable, ordered data over IP, a network layer that makes no guarantees about packet delivery, order, or duplication. It achieves this through a combination of sequence numbers, acknowledgements, retransmissions, and reordering logic that together simulate a dependable byte stream for applications. Before any data is exchanged, TCP requires a three-way handshake to verify connectivity in both directions, which costs a full round trip and explains why connection reuse is critical in performance-sensitive systems. Unlike message-based protocols, TCP is a byte-stream protocol and does not preserve application-level message boundaries, so higher-level protocols like HTTP must define their own framing. Flow control and congestion control are kept as separate mechanisms because they address distinct problems: preventing a slow receiver from being overwhelmed versus preventing the network itself from becoming congested.

0
ProgrammingDEV Community ·

Why Consistent Source ID Validation Prevents Silent Failures in Content Pipelines

Automated publishing pipelines can silently drop valid content cards when source ID validators are outdated or inconsistently applied across readers. The problem arises when systems evolve from simple ID formats like SRC-ANDROID to multi-segment readable IDs like SRC-WORKER-SOURCEID-2026, but older regex patterns only accept a single segment after the prefix. Engineers are advised to define a single, strict ID grammar — specifying allowed characters, segment separators, and prefix rules — and apply it uniformly across every pipeline component that reads source identifiers. A shared TypeScript validator using one regular expression ensures candidate discovery, revision lookup, and publication auditing all operate on the same contract. Partial pattern matches that truncate multi-segment IDs can cause lookup failures even when the original source card exists, making complete value capture equally critical.

0
ProgrammingDEV Community ·

Apache Iceberg Delivers Data Portability, Not Full Vendor Lock-in Freedom

Apache Iceberg, the open table format widely adopted across platforms like AWS, Databricks, Snowflake, and Microsoft Fabric, has significantly improved data portability by opening up file formats, metadata management, and access APIs that were previously locked within proprietary services. The format stores schemas, snapshots, and partition specs in open metadata files backed by standard storage like Parquet and S3, making the data layer largely interoperable. However, the Iceberg spec does not standardize the atomic commit mechanism used to swap metadata pointers, leaving that responsibility to individual catalog implementations. The REST Catalog Protocol was introduced to create a common API across languages and engines, shifting commit responsibility from the client to the server, but it leaves authorization models — such as access control and permission structures — undefined. Real-world catalog products fill this gap with proprietary features like row- and column-level security, data discovery, and lineage tracking, which remain a source of vendor dependency.