<?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: Sospeter Kinyanjui</title>
    <description>The latest articles on DEV Community by Sospeter Kinyanjui (@sospeter).</description>
    <link>https://dev.to/sospeter</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%2F3722041%2Fd575bc29-bf4b-43c8-aa5d-aaf269868cb0.jpg</url>
      <title>DEV Community: Sospeter Kinyanjui</title>
      <link>https://dev.to/sospeter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sospeter"/>
    <language>en</language>
    <item>
      <title>How BitTorrent Actually Works (a p2p network protocol)</title>
      <dc:creator>Sospeter Kinyanjui</dc:creator>
      <pubDate>Wed, 24 Jun 2026 08:38:37 +0000</pubDate>
      <link>https://dev.to/sospeter/how-bittorrent-actually-works-h8a</link>
      <guid>https://dev.to/sospeter/how-bittorrent-actually-works-h8a</guid>
      <description>&lt;p&gt;&lt;em&gt;You've probably used it. You almost certainly don't know what happened under the hood.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem With One Server
&lt;/h2&gt;

&lt;p&gt;Imagine a band releases their debut album for free. By morning, a million people are trying to download it. Their server buckles, downloads crawl, and the hosting bill becomes a catastrophe.&lt;/p&gt;

&lt;p&gt;This is what the internet looked like before BitTorrent. If you wanted to distribute a large file, you needed powerful, expensive servers. The bigger your audience, the more it cost you. Popularity was a punishment.&lt;/p&gt;

&lt;p&gt;BitTorrent looked at this problem and asked a different question entirely.&lt;/p&gt;




&lt;h2&gt;
  
  
  What If the Downloaders Were Also the Distributors?
&lt;/h2&gt;

&lt;p&gt;That one idea is the whole thing.&lt;/p&gt;

&lt;p&gt;When you download a file using BitTorrent, you simultaneously upload pieces of it to others who need them. The more people downloading, the faster everyone downloads. Popularity becomes a feature, not a problem.&lt;/p&gt;

&lt;p&gt;The file is split into thousands of small pieces pulled from different people at the same time, then reassembled into the complete file. This is a &lt;strong&gt;peer-to-peer&lt;/strong&gt; network — no single server in charge, everyone both a customer and a supplier.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1: The Torrent File (or Magnet Link)
&lt;/h2&gt;

&lt;p&gt;A &lt;code&gt;.torrent&lt;/code&gt; file is not the content itself — it's a map describing the content: the file name, its size, how many pieces it's split into, a &lt;strong&gt;checksum&lt;/strong&gt; fingerprint for each piece, and where to find people who have it. It doesn't contain the treasure. It tells you where to look and how to verify you found the real thing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Magnet links&lt;/strong&gt; do the same job with just a string of text — no file needed at all.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: The Tracker
&lt;/h2&gt;

&lt;p&gt;Your client contacts a &lt;strong&gt;tracker&lt;/strong&gt; — a server that keeps a list of everyone downloading or sharing a torrent. The tracker doesn't have the file. It's a matchmaker. You give it your address, it gives you a list of peers. It also registers you so future downloaders can find you.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Talking to Peers
&lt;/h2&gt;

&lt;p&gt;Your client connects to peers and they exchange piece lists. Your client is smart about this — it deliberately requests the &lt;strong&gt;rarest pieces first&lt;/strong&gt;, ensuring scarce pieces spread through the network before someone goes offline.&lt;/p&gt;

&lt;p&gt;You talk to many peers simultaneously, constantly dropping slow ones and finding faster ones. The full collection of everyone sharing a torrent is called the &lt;strong&gt;swarm&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Pieces and Checksums
&lt;/h2&gt;

&lt;p&gt;As pieces arrive, each one is verified against its checksum. The client runs a mathematical function on the received data and compares the result to what the torrent file says it should be. A match means the piece is genuine. A mismatch means it's silently discarded and requested again. You cannot be fooled into saving corrupted data.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 5: Seeding
&lt;/h2&gt;

&lt;p&gt;Once your download completes, keeping your client open means you're now uploading pieces to others — this is called &lt;strong&gt;seeding&lt;/strong&gt;. The system depends on it. If everyone stopped the moment they finished, the swarm would collapse.&lt;/p&gt;

&lt;p&gt;BitTorrent even has a tit-for-tat mechanism: peers who upload more get faster downloads in return. Generosity is rewarded. Freeloading is punished. It's elegant social engineering baked directly into the protocol.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Beautiful Part: What Happens Without a Tracker?
&lt;/h2&gt;

&lt;p&gt;Trackers are a single point of failure. If one goes down, new peers can't find each other.&lt;/p&gt;

&lt;p&gt;So the question became: &lt;em&gt;what if we didn't need a tracker at all?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The answer is a &lt;strong&gt;DHT — Distributed Hash Table&lt;/strong&gt;. Instead of one central directory, knowledge of who has what is spread across thousands of regular users' computers. Your client doesn't ask one server — it asks the network itself, hopping from node to node, each one pointing slightly closer to the answer.&lt;/p&gt;

&lt;p&gt;The result: no single entity can be shut down, taken offline, or pressured. The network is the server. It lives as long as people participate. This is not just engineering — it's a philosophy. Information can be free not because someone decided it should be, but because the architecture makes it structurally true.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Matters Beyond Piracy
&lt;/h2&gt;

&lt;p&gt;BitTorrent's ideas are everywhere: Linux distributions ship via torrent, IPFS is built on the same principles, blockchain networks use peer-to-peer distribution, and game studios use it for update delivery. The insight that &lt;em&gt;receivers can be distributors&lt;/em&gt; turned out to be one of the most durable ideas in networking.&lt;/p&gt;




&lt;h2&gt;
  
  
  Decentralization Didn't Stop at File Sharing
&lt;/h2&gt;

&lt;p&gt;BitTorrent proved something the industry hadn't accepted: &lt;strong&gt;you don't need a server to build a reliable system.&lt;/strong&gt; You need a protocol smart enough to turn participants into infrastructure.&lt;/p&gt;

&lt;p&gt;Today we call this &lt;em&gt;serverless computing&lt;/em&gt; — functions distributed across hundreds of edge locations with no single machine in charge. Amazon Lambda, Cloudflare Workers, Vercel Edge Functions are, at their philosophical core, children of the same thinking. The server is no longer a place. It's a role, and any node in the network can play it. Systems become faster, cheaper, and harder to destroy — because there is no single throat to choke.&lt;/p&gt;




&lt;h2&gt;
  
  
  Blockchain: BitTorrent's Philosophical Child
&lt;/h2&gt;

&lt;p&gt;If BitTorrent decentralized &lt;em&gt;file distribution&lt;/em&gt;, blockchain decentralized something far more ambitious — &lt;em&gt;truth itself&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The connection is architectural, not metaphorical. A blockchain is a ledger held simultaneously by thousands of computers. When a transaction happens, nodes reach agreement through &lt;strong&gt;consensus&lt;/strong&gt; — a mathematical vote — before writing it permanently. No single node can alter the record because it lives everywhere at once.&lt;/p&gt;

&lt;p&gt;The integrity mechanism mirrors BitTorrent's checksums directly. Every block contains a cryptographic fingerprint of the block before it. Change anything and every fingerprint after it breaks — the tampering becomes mathematically obvious to every node in the network.&lt;/p&gt;

&lt;p&gt;Bitcoin, Ethereum, every chain that followed — all fundamentally peer-to-peer networks with a shared ledger instead of a shared file. Satoshi Nakamoto described Bitcoin explicitly as a &lt;em&gt;peer-to-peer electronic cash system&lt;/em&gt;. The lineage from BitTorrent is direct.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Future Belongs to the Network
&lt;/h2&gt;

&lt;p&gt;Here's the uncomfortable truth: you don't control your data. Your messages, photos, and identity live on servers owned by corporations who can suspend or sell your presence at any moment. Centralization was the price of convenience when most people couldn't run their own server.&lt;/p&gt;

&lt;p&gt;That tradeoff is becoming harder to justify.&lt;/p&gt;

&lt;p&gt;The next generation of the web is an attempt to rebuild core infrastructure on peer-to-peer principles — cryptographic identities no company controls, files stored on networks where you hold the keys, transactions validated by the network rather than a bank. This is what decentralization actually promises: &lt;strong&gt;the right to participate without asking permission from an owner, because there is no owner.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;BitTorrent was the first large-scale proof this was possible — not theoretically, but in practice, at scale, used by millions of ordinary people who had no idea they were participating in one of the most resilient distributed systems ever built. Everything that followed is the same idea applied to larger domains.&lt;/p&gt;

&lt;p&gt;The architecture is the guarantee. Not a promise, not a policy — the structure of the network itself.&lt;/p&gt;

&lt;p&gt;We are still very early.&lt;/p&gt;




&lt;h2&gt;
  
  
  I'm Building One
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;emrent&lt;/strong&gt; started with a simple obsession: I wanted to understand BitTorrent from the inside. Not use it — understand it. The only way I know how to do that is to build it. It is not a production client. It will not replace qBittorrent.&lt;/p&gt;

&lt;p&gt;What it is — is PoC. Proof that the protocol is understandable, that the concepts in this article are not magic.&lt;/p&gt;

&lt;p&gt;Architecturally, emrent is organized as a Cargo workspace — a collection of focused crates each responsible for one layer of the protocol: tracker communication over both HTTP and UDP, the peer handshake and wire protocol, piece selection and download logic, checksum verification, and finally disk I/O. On top of that sits a desktop interface built with Tauri and React, making it a fully usable application, not just a library.&lt;/p&gt;

&lt;p&gt;If you're curious about how any of this translates into code, take a look at the repo: &lt;a href="https://www.github.com/emrent-rs/emrent" rel="noopener noreferrer"&gt;github.com/emrent-rs/emrent&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Thanks for reading. If something was unclear or you want to go deeper on any section, find me on &lt;a href="https://linkedin.com/in/sospeter" rel="noopener noreferrer"&gt;linkedin&lt;/a&gt; or my github account: &lt;a href="https://www.github.com/sospeter-57" rel="noopener noreferrer"&gt;github&lt;/a&gt; or by email: &lt;a href="mailto:sospeterkinyanjui57@gmail.com"&gt;sospeterkinyanjui57@gmail.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;until next time, peace, focus&lt;/p&gt;

</description>
      <category>bittorrent</category>
      <category>dht</category>
      <category>zone01kisumu</category>
      <category>lakehub</category>
    </item>
    <item>
      <title>Utilizing Oceans to Power Data Centers</title>
      <dc:creator>Sospeter Kinyanjui</dc:creator>
      <pubDate>Tue, 12 May 2026 15:14:14 +0000</pubDate>
      <link>https://dev.to/sospeter/utilizing-oceans-to-power-data-centers-4b18</link>
      <guid>https://dev.to/sospeter/utilizing-oceans-to-power-data-centers-4b18</guid>
      <description>&lt;p&gt;There are some global problems you don't want to think about. When it comes to processing artificial intelligence computing tasks, you don't wanna think about it too. Such energy consumption are truly demanding. I want us to share with you about Panthalassa, a data center that generates it's energy from ocean waves. As you'd expect, it's architecture is quite different from traditional, on land structures. This is it:&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.amazonaws.com%2Fuploads%2Farticles%2Fznlrwuzou5zo41v94r2l.webp" 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.amazonaws.com%2Fuploads%2Farticles%2Fznlrwuzou5zo41v94r2l.webp" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
and the part that's immersed in water looks like:&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.amazonaws.com%2Fuploads%2Farticles%2Fdz4f4fwjx1rtes1rgon8.jpg" 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.amazonaws.com%2Fuploads%2Farticles%2Fdz4f4fwjx1rtes1rgon8.jpg" alt=" " width="799" height="533"&gt;&lt;/a&gt;&lt;br&gt;
I want us to look at why it's promising, how it impacts AI computing tasks, how it's a clean alternative to other non-environmental friendly ways to curb these demands.&lt;/p&gt;

&lt;p&gt;My inspiration for this article came when I listened to Panthalassa's CEO and co-founder, Sheldon Coulson. Here are his inspirations:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Everyone wants to find the things that make it so that people have schools, and roads, and hospitals, food. All of the things that humans need, are all driven by energy. The question is can you find things that are much kinder to the planet or just try to find the things that work for humanity. You look out of the ocean and you see these millions of square miles and you start to calculate how much energy you can go and get and find it's a lot more than humans need. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But, think about it. We don't need energy in the middle of the ocean. So what does the machine do right or different.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"As it goes up and down with the waves, it causes water that's in that tube to be forced up into the top. Once it's in the ball, the water is forced through a turbine. The turbine spins, and that's what makes the electricity."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The computation happens on the spot as the energy is being generated. And then sends the output through the satellites. This eliminates the need to plat cooling systems because obviously the ocean is super cool. Again, it's significantly cheaper to construct compared to data centers on land. &lt;/p&gt;

&lt;p&gt;Ocean-3 is planned to be deployed this year. But it also arises the re-liabilities issues for several reasons: the waves can turn to storms and destroy it, salty water is corrosive to the machine or even gradual accumulation of microorganisms on it's surface. There are measures that have been taken in place to mitigate the effects. &lt;/p&gt;

&lt;p&gt;Myself I think it's a good move. Mainly because it's a way of generating unlimited, clean and locally sourced power directly from ocean waves to run computing AI at sea, by-passing land-based power shortages, cooling constraints and infrastructure limitations.&lt;/p&gt;

&lt;p&gt;You can find out more about Panthalassa and it's Ocean-2 on their website: &lt;a href="https://panthalassa.com/" rel="noopener noreferrer"&gt;https://panthalassa.com/&lt;/a&gt; and watch this video for more insights: &lt;a href="https://youtu.be/Q7Pmgq2JKbI?si=Lrj6bUFGpzMhWqDc" rel="noopener noreferrer"&gt;https://youtu.be/Q7Pmgq2JKbI?si=Lrj6bUFGpzMhWqDc&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Until next time, peace, focus.&lt;br&gt;
Happy coding.&lt;/p&gt;

</description>
      <category>sospeter</category>
      <category>zone01kisumu</category>
      <category>ai</category>
      <category>data</category>
    </item>
    <item>
      <title>Understanding TCP: The Backbone of Reliable Network Communication</title>
      <dc:creator>Sospeter Kinyanjui</dc:creator>
      <pubDate>Fri, 20 Mar 2026 09:03:41 +0000</pubDate>
      <link>https://dev.to/sospeter/understanding-tcp-the-backbone-of-reliable-network-communication-5684</link>
      <guid>https://dev.to/sospeter/understanding-tcp-the-backbone-of-reliable-network-communication-5684</guid>
      <description>&lt;p&gt;We’re in 2026 and just how fast and convenient it is to share computer resources and information across computer networks often goes unnoticed. It’s what inspired the first wide area network, ARPANET. The desire to share expensive and limited computing resources. The idea of allowing multiple users to access there resources remotely, sharing the processing power and data storage was revolutionary. I want us to look at the one thing that made all these possible, the TCP/IP protocol suite.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Definition of Terms&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Network&lt;/strong&gt;: two or more computers connected for the purpose of communication and sharing resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Protocol&lt;/strong&gt;: agreed upon set of rules that make communication between two computers on the same network possible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TCP&lt;/strong&gt;: a connection-oriented transport layer protocol that ensures reliable, ordered, and error-checked delivery of data packets between applications on an IP network.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IP&lt;/strong&gt;: the foundational set of rules governing how data packets are addressed, routed, and transmitted across networks, enabling global communication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Internet Protocol Suite&lt;/strong&gt;: is a framework for organizing the communication protocols used in the Internet and similar computer networks according to functional criteria.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;IP&lt;/strong&gt; establishes the ground on how information is carried across the network. &lt;strong&gt;TCP&lt;/strong&gt; &lt;em&gt;wraps around&lt;/em&gt; IP traffic to ensure the data transmitted reached the destination, intact and in the correct order. As a developer it should come without saying that every application must convey this behavior. In the coming paragraphs I want us to analyze the format of a TCP packet, so we can see how it has become reliable to send data, how the data is divided into packets and the packets reach still ordered and reassembled correctly, and finally how to cope with a situation where some bits of data inside a packets disappeared along the way.&lt;/p&gt;

&lt;p&gt;Theoretically a single TCP packet can carry, up to 65KB of data. But in practice due to fragmentation the Maximum Transmission Unit is usually 1.5KB. Just an overview, each packet contains, source port and address, sequence and acknowledgement number and data to be transmitted.&lt;br&gt;
Write on Medium&lt;/p&gt;

&lt;p&gt;In order to a single connection to be established there’s what we call a three way handshake. Let’s face it, two computers, a client and a server want to communicate. Let’s say the client by the help of a browser wants to request some web files. The protocol says, the client initializes the connection. A client sends a synchronization TCP packet with the SYN reserved word set. The server responds with a TCP packet with the ACK reserved word set. Eventually the client responds with SYN/ACK flags set. and the sequence numbers too. Think of the handshake as an introduction to a meeting:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-&amp;gt; Client: “Hi, I’m here.”

-&amp;gt; Server: “Hi, I’m here, nice to meet you.”

-&amp;gt; Client: “Nice to meet you too!”
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Now that we’re sure the connection is stable, the server starts sending HTML, CSS, JS, image, videos, music, PDF, and other formatted data.&lt;/p&gt;

&lt;p&gt;In order to ensure all the data reached the destination IP, the sequence number (a unique number) is assigned to each bit of data. This way both sides keep track of what data has been sent and received. If anything goes wrong the packet is re-transmitted while the others wait in the queue for assembling. If the receiver sees a gap between two sequence numbers for two packets, for example 134 and 136, the sender’s timer for 135 expires so it re-sends.&lt;/p&gt;

&lt;p&gt;Before TCP came along, early networks were chaotic: data could arrive out of order, get lost, or be duplicated, leaving users with garbled or incomplete information. There was no built-in way to detect errors, re-transmit missing pieces, or ensure that messages flowed in a steady, reliable stream. TCP changed all of that by introducing sequence numbers, acknowledgments, and retransmissions, which smooth out the bumps in the network. It reorders packets, fills in missing data automatically, and ensures that information reaches its destination accurately and in the right order, making network communication predictable and dependable instead of a messy guessing game.&lt;/p&gt;

&lt;p&gt;My team and I at &lt;a href="https://www.zone01kisumu.ke/" rel="noopener noreferrer"&gt;https://www.zone01kisumu.ke/&lt;/a&gt; had been working on a command line Chat Application Server. Sort of like netcat, apart from it neatly organizes chatters into chat rooms, persists chats for later retrieval, chatters can switch rooms and change their names, see whose in the room and much more. You can check it on github: &lt;a href="https://github.com/sospeter-57/net-cat-server" rel="noopener noreferrer"&gt;https://github.com/sospeter-57/net-cat-server&lt;/a&gt;. When creating the server we used the go’s standard package, net. We created a listener through net.Listener. We also specified that we wanted our server to strictly listen for incoming TCP connections.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;listener&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"tcp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;":"&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Port&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
 &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It worked because we were confident that every bit of message that the chatters received was in the correct order and complete. Even with interpolation of other language’s features such as goroutines. But let’s be real, the normal user will never care about the technicals of how he/she receives the message. What matters is probably the most convenient way.&lt;/p&gt;

&lt;p&gt;Speaking of such, TCP might be irreplaceable in today’s world, but it has it’s downsides too. To begin with, it’s slow but sure, I know it sounds good, but the bad side still exists, it’s slow. Another protocol designed specifically to solve this was created, &lt;strong&gt;User Datagram Protocol&lt;/strong&gt;. But UDP doesn’t promise you reliability. But wait, we also have &lt;strong&gt;QUIC&lt;/strong&gt; does what TCP and UDP does all at a go. But more on those ones in the coming articles. All in all, there’s a good reason why TCP over IP has has dominated over 75% of the entire traffic on the internet. Right now Transmission Control Protocol is 53 years old, 53 years from how will you and me still be using my beloved TCP. Let me picture that, I’ll be in my 70s or 80s, probably implanted a Neuralink chip now receiving data packets using a century old network protocol. What do you think? You know what? I’d like very much to be part of that future. Sure, it might not be TCP, the the love for keeping everyone connected, and securely, with unlimited access to information, is not stopping soon. In the last article I promised TCP, here is it. Next well look at IP on it’s own.&lt;/p&gt;

&lt;p&gt;You can find me on:&lt;br&gt;
Github: &lt;a href="https://github.com/Sospeter-M-Kinyanjui" rel="noopener noreferrer"&gt;https://github.com/Sospeter-M-Kinyanjui&lt;/a&gt;&lt;br&gt;
LinkedIn: &lt;a href="https://www.linkedin.com/in/sospeter-kinyanjui-6a091b2a5/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/sospeter-kinyanjui-6a091b2a5/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Until next time, peace, focus.&lt;/p&gt;

&lt;p&gt;Happy coding.&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>networking</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>HTTP: the web's protocol</title>
      <dc:creator>Sospeter Kinyanjui</dc:creator>
      <pubDate>Mon, 23 Feb 2026 23:55:08 +0000</pubDate>
      <link>https://dev.to/sospeter/http-the-webs-protocol-1b69</link>
      <guid>https://dev.to/sospeter/http-the-webs-protocol-1b69</guid>
      <description>&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/HTTP" rel="noopener noreferrer"&gt;HTTP&lt;/a&gt; (Hypertext Transfer Protocol) is an application-layer protocol for distributed, collaborative, hypermedia information systems. It is the foundational, stateless protocol used to transfer data (such as HTML documents, images, and videos) on the World Wide Web.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How HTTP Works&lt;/strong&gt;&lt;br&gt;
HTTP is a request-response protocol:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;Client Request&lt;/em&gt; - A browser or app sends a request to a server, specifying a method(GET, POST, etc.) and a source path.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Server Response&lt;/em&gt; - The server processes the request and returns a response containing a status code, headers, and an optical body.
Requests and responses are structured as messages, making them human-readable and extensible.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;HTTP Methods&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;GET&lt;/strong&gt; – Retrieve a resource. This method is safe (does not modify the resource) and idempotent (repeating it has the same effect). Typical use: loading a web page or fetching data from an API.&lt;br&gt;
&lt;strong&gt;POST&lt;/strong&gt; – Submit data to a server to create a new resource or trigger processing. Not idempotent. Example: submitting a form or posting a comment.&lt;br&gt;
&lt;strong&gt;PUT&lt;/strong&gt; – Replace a resource entirely with the request payload. Idempotent. Example: updating a file on a server.&lt;br&gt;
&lt;strong&gt;PATCH&lt;/strong&gt; – Apply a partial modification to a resource. Not necessarily idempotent. Example: updating a single field in a database record.&lt;br&gt;
&lt;strong&gt;DELETE&lt;/strong&gt; – Remove a resource. Idempotent. Example: deleting a user account.&lt;br&gt;
&lt;strong&gt;HEAD&lt;/strong&gt; – Same as GET but without the body. Used to fetch metadata (headers) about a resource, like checking if it exists or its size.&lt;br&gt;
&lt;strong&gt;OPTIONS&lt;/strong&gt; – Ask the server which methods are supported on a resource. Commonly used in CORS preflight requests in web applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Headers and Metadata&lt;/strong&gt;&lt;br&gt;
HTTP messages are more than just the request or response body — they carry headers, which provide metadata about the message or instructions on how to handle it. Headers make HTTP flexible and extensible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common Request Headers&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Host&lt;/strong&gt; – Specifies the domain name of the server. Required in HTTP/1.1 to handle virtual hosting.&lt;br&gt;
&lt;strong&gt;User-Agent&lt;/strong&gt; – Identifies the client software (browser, app, or bot). Useful for analytics or server behavior adjustments.&lt;br&gt;
&lt;strong&gt;Accept&lt;/strong&gt; – Indicates the content types the client can process, e.g., text/html or application/json.&lt;br&gt;
&lt;strong&gt;Authorization&lt;/strong&gt; – Carries credentials or tokens for authentication.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cookie&lt;/strong&gt; – Sends previously set cookies to the server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common Response Headers&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Content-Type&lt;/strong&gt;&lt;/em&gt; – The MIME type of the response body, e.g., text/html, application/json.&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Content-Length&lt;/strong&gt;&lt;/em&gt; – The size of the response body in bytes.&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Set-Cookie&lt;/strong&gt;&lt;/em&gt; – Instructs the client to store a cookie for future requests.&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Cache-Control&lt;/strong&gt;&lt;/em&gt; – Defines caching policies (e.g., no-cache, max-age=3600).&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Location&lt;/strong&gt;&lt;/em&gt; – Used in redirects to indicate the new URL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Special Header Categories&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Caching Headers&lt;/strong&gt;&lt;/em&gt; – ETag, Last-Modified, Expires. Help clients avoid downloading unchanged resources.&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Security Headers&lt;/strong&gt;&lt;/em&gt; – Strict-Transport-Security, Content-Security-Policy, X-Frame-Options. Protect against attacks like XSS and clickjacking.&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Custom / Application Headers&lt;/strong&gt;&lt;/em&gt; – Many APIs define headers like X-Request-ID for tracing requests or X-Rate-Limit for throttling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Headers Matter&lt;/strong&gt;&lt;br&gt;
Headers are what allow HTTP to be protocol-agnostic and extensible. Without headers:&lt;br&gt;
The client and server wouldn’t know content type, length, or caching policies.&lt;br&gt;
Authentication and session management would be impossible.&lt;br&gt;
Advanced features like partial content delivery, compression, and CORS would not work.&lt;br&gt;
In short, headers transform HTTP from a simple message-passing protocol into a fully-featured web communication framework.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTTP Versions&lt;/strong&gt;&lt;br&gt;
HTTP has evolved over time:&lt;br&gt;
&lt;em&gt;&lt;strong&gt;&lt;a href="https://datatracker.ietf.org/doc/html/rfc2616" rel="noopener noreferrer"&gt;HTTP/1.1&lt;/a&gt;&lt;/strong&gt;&lt;/em&gt; – Persistent connections, chunked transfers.&lt;br&gt;
&lt;em&gt;&lt;strong&gt;&lt;a href="https://datatracker.ietf.org/doc/html/rfc7540" rel="noopener noreferrer"&gt;HTTP/2&lt;/a&gt;&lt;/strong&gt;&lt;/em&gt; – Multiplexed streams, binary framing.&lt;br&gt;
&lt;em&gt;&lt;strong&gt;&lt;a href="https://datatracker.ietf.org/doc/html/rfc9114" rel="noopener noreferrer"&gt;HTTP/3&lt;/a&gt;&lt;/strong&gt;&lt;/em&gt; – Runs over &lt;a href="https://en.wikipedia.org/wiki/QUIC" rel="noopener noreferrer"&gt;QUIC&lt;/a&gt; for faster, more reliable connections.&lt;br&gt;
Despite differences, all versions follow the same basic request-response model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;br&gt;
HTTP is the language that makes the web possible. It defines how a client asks for something and how a server responds. Every time you open a website, load an image, submit a form, or use an API, HTTP is working underneath. Through its methods, it defines what action you want to perform. Through its headers, it carries instructions and metadata about how that data should be handled. Through its evolving versions, it improves speed, efficiency, and security — without changing its fundamental model. At its core, HTTP is simple: request and response.&lt;br&gt;
But from that simplicity, the entire modern web is built.&lt;/p&gt;

&lt;p&gt;Now you know what happens behind those backend systems. I'm going to be releasing articles for other network protocols. It's going to be a series one per week. Next week we'll look at TCP. Follow me on: &lt;a href="https://www.linkedin.com/in/sospeter-kinyanjui-6a091b2a5/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://github.com/Sospeter-M-Kinyanjui" rel="noopener noreferrer"&gt;Github&lt;/a&gt;.&lt;br&gt;
Until next time, peace, focus.&lt;/p&gt;

</description>
      <category>http</category>
      <category>sospeter</category>
      <category>zone01kisumu</category>
      <category>lakehub</category>
    </item>
    <item>
      <title>Leveraging io_uring for performant asynchronous linux applications.</title>
      <dc:creator>Sospeter Kinyanjui</dc:creator>
      <pubDate>Sun, 08 Feb 2026 23:52:24 +0000</pubDate>
      <link>https://dev.to/sospeter/leveraging-iouring-for-performant-asynchronous-linux-applications-4pl7</link>
      <guid>https://dev.to/sospeter/leveraging-iouring-for-performant-asynchronous-linux-applications-4pl7</guid>
      <description>&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.amazonaws.com%2Fuploads%2Farticles%2Fzlgcmb2byf45ktorv7oa.webp" 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.amazonaws.com%2Fuploads%2Farticles%2Fzlgcmb2byf45ktorv7oa.webp" alt="how the ring buffers for sequence queue entries and completion queue entries are laid in the shared memory in context to io_uring linux i/o system call" width="700" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;author: &lt;strong&gt;Sospeter Kinyanjui&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  intro
&lt;/h2&gt;

&lt;p&gt;For the longest time, in &lt;strong&gt;linux&lt;/strong&gt; there just existed &lt;code&gt;epoll&lt;/code&gt;, a I/O notification facility that enables applications to make read/write system calls to the linux kernel. &lt;code&gt;epoll&lt;/code&gt; first emerged in the Linux Kernel 2.5.44 back in 2002 which later gained mainstream adoption at 2.6 on 2003. &lt;code&gt;epoll&lt;/code&gt; uses the &lt;em&gt;readiness-model&lt;/em&gt; to make system calls to the kernel, &lt;code&gt;epoll_create&lt;/code&gt;, &lt;code&gt;epoll_ctl&lt;/code&gt; and &lt;code&gt;epoll_wait&lt;/code&gt;. The kernel notifies applications when resources are available in order for apps to submit tasks. This makes it O(1) complexity, which means it's speed stays the same whether you're watching 10 connections or 10,000 connections. And since making system calls are the only way for applications to communicate with the kernel to access computer resources, we might consider this behavior inefficient. And that presents the &lt;em&gt;syscall tax problem&lt;/em&gt;, making expensive &lt;em&gt;context switching system calls&lt;/em&gt; for every connections while switching between user mode and kernel mode. Not until 2019 was &lt;code&gt;io_uring&lt;/code&gt; Linux Kernel System call for I/O asynchronous operations came.&lt;/p&gt;

&lt;p&gt;First let's define &lt;strong&gt;asynchronous execution&lt;/strong&gt;: it's the ability of an application to start a long-running task and continue responsive execution rather than waiting for that task to finish. This makes better utilization of computer resources. Considering &lt;code&gt;epoll&lt;/code&gt; was event-driven, mimicking such behavior in programs can be considered an illusion. &lt;code&gt;io_uring&lt;/code&gt; aimed at making less system calls by batching multiple read/write requests then making one. as a result, multiple read and write operations do no have to wait for each other.&lt;/p&gt;

&lt;h2&gt;
  
  
  definition and implementation
&lt;/h2&gt;

&lt;p&gt;Technically, &lt;code&gt;io_uring&lt;/code&gt; exposes three calls: &lt;code&gt;io_uring_setup(2)&lt;/code&gt;, &lt;code&gt;io_uring_enter(2)&lt;/code&gt; and &lt;code&gt;io_uring_register(2)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A call to &lt;strong&gt;&lt;code&gt;io_uring_setup&lt;/code&gt;&lt;/strong&gt; initializes the &lt;code&gt;io_uring&lt;/code&gt; context by creating the submission queue (SQ) and completion queue (CQ), returning a file descriptor to the application. It takes parameters to configure it's primary data structures, rings, their sizes, the &lt;code&gt;head&lt;/code&gt;, &lt;code&gt;tail&lt;/code&gt;, &lt;code&gt;ring_mask&lt;/code&gt; and &lt;code&gt;ring_entries&lt;/code&gt;. As you can imagine a ring follows the FIFO thing. The first task on the sequence queue will be the first to be passed to the Completion Queue Entry. The CQEs are also structured similarly. A call to &lt;code&gt;io_uring_setup&lt;/code&gt; leads to a creation of a shared memory with the size specified comprising of SEQs and CQEs sections. For SEQs the user/application space only have writing permissios while kernel permissions are only granted for reading. For CQEs the kernel only has writing permissions while the user/application has just reading permissions. Apparently to keep things performant, they use the Single Producer / Single Consumer logic.&lt;/p&gt;

&lt;p&gt;A call to &lt;strong&gt;&lt;code&gt;io_uring_enter&lt;/code&gt;&lt;/strong&gt; is the engine starter for the whole operation. It tells the kernel: &lt;em&gt;"I've put some SQEs in the ring; go process them."&lt;/em&gt; This is how it looks like in the C structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;linux/io_uring.h&amp;gt;
    int io_uring_enter(unsigned int fd, unsigned int to_submit,
                   unsigned int min_complete, unsigned int flags,
                   sigset_t *sig);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If &lt;code&gt;io_uring_enter&lt;/code&gt; is the engine starter, &lt;strong&gt;&lt;code&gt;io_uring_register&lt;/code&gt;&lt;/strong&gt; is the &lt;em&gt;"VIP pass"&lt;/em&gt; for your data. It is a system call used to pre-register resources (like memory buffers or files) with the kernel. By doing this, you remove the overhead of the kernel having to "look up" or "map" these resources every time you perform an I/O operation. With those three pieces, asynchronous programming in linux has never been the same again. &lt;/p&gt;

&lt;p&gt;There are existing C wrappers around these kernel level calls, &lt;code&gt;liburing&lt;/code&gt; and &lt;code&gt;libc&lt;/code&gt; does a great job. But there is another hand in play for leveraging &lt;code&gt;io_uring&lt;/code&gt;'s capabilities in building asynchronous applications, Rust. Just imagine that, it solves the fundamental conflict: Completion Based I/O (the whole concept of &lt;code&gt;io_uring&lt;/code&gt;) but with memory safety. In &lt;code&gt;io_uring&lt;/code&gt;, the kernel takes control of your memory buffers to perform I/O asynchronously. This creates a "danger zone" where both the kernel and your application could try to access the same memory at once. The Rust compiler ensures your code cannot even touch that buffer until the kernel returns it in a Completion Queue Entry (CQE). Existing Rust wrappers for this Linux Kernel I/O API are some including tokio's &lt;code&gt;io-uring&lt;/code&gt;, &lt;code&gt;tokio-uring&lt;/code&gt; and &lt;code&gt;glammio&lt;/code&gt; among others.&lt;/p&gt;

&lt;h2&gt;
  
  
  there's more
&lt;/h2&gt;

&lt;p&gt;Implementing a Completion-Based mechanism for I/O operations at the kernel level can be more useful in today's real world not just for linux. Yeah, Windows has had such technology, it's called I/O completion ports (IOCP). Even though &lt;code&gt;iocp&lt;/code&gt; is asynchronous it still requires a system call for every request which makes the 'tax' a little higher compared to &lt;code&gt;io_uring&lt;/code&gt;'s.  The standard way for doing this in MacOS is by using the &lt;code&gt;kqueue&lt;/code&gt; API.  It is still readiness-based. You have to call &lt;code&gt;kevent&lt;/code&gt; to find out what is ready, then make separate system calls to actually perform the I/O. It suffers from the same syscall overhead that &lt;code&gt;io_uring&lt;/code&gt; was designed to kill. Which makes &lt;code&gt;io_uring&lt;/code&gt; a true asynchronous programming linux system calls API.&lt;/p&gt;

&lt;p&gt;But here's the thing about finding technological solutions, you don't have to solve everything. Someone I once looked up to once told me, "Be the best cog, but keep in mind you're not the only one in the machine." From my own point of view, I think the real problem lies in creating an asynchronous runtime that is &lt;em&gt;cross-platform&lt;/em&gt; and &lt;em&gt;completion-based&lt;/em&gt;. Such a technology exist, we have &lt;code&gt;compio&lt;/code&gt;, a &lt;strong&gt;Rust&lt;/strong&gt; framework for &lt;em&gt;asynchronous I/O operations&lt;/em&gt;. What makes it less perfect are two things: it's arguably doesn't have &lt;em&gt;zero-cost abstraction&lt;/em&gt; and it uses &lt;em&gt;fixed buffers&lt;/em&gt;(part of &lt;code&gt;io_urings&lt;/code&gt;'s design) which are immutable references. Most of the &lt;strong&gt;Rust ecosystem&lt;/strong&gt; is built on top of &lt;code&gt;std::io::Read&lt;/code&gt; and &lt;code&gt;std::io::Write&lt;/code&gt; traits which take this mutable references. Compio? It primarily emphasizes the ownership of buffers rather than borrowing them. Which as we've seen aligns with &lt;code&gt;io_uring&lt;/code&gt; completion-based model, but then it poses a real problem with integration with the rest of the ecosystem.&lt;/p&gt;

&lt;p&gt;But again, like I said, we just have to be here, implementing one solution at a time. By believing in ourselves even when it seems impossible. Until next time, peace, focus, desire.&lt;/p&gt;

&lt;p&gt;You can checkout others of my blogs.&lt;br&gt;
Follow me on:&lt;br&gt;
On &lt;strong&gt;github&lt;/strong&gt;: &lt;a href="https://github.com/Sospeter-M-Kinyanjui" rel="noopener noreferrer"&gt;https://github.com/Sospeter-M-Kinyanjui&lt;/a&gt;&lt;br&gt;
On &lt;strong&gt;LinkedIn&lt;/strong&gt;: &lt;a href="https://www.linkedin.com/in/sospeter-kinyanjui-6a091b2a5/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/sospeter-kinyanjui-6a091b2a5/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>iouring</category>
      <category>software</category>
      <category>sospeter</category>
    </item>
  </channel>
</rss>
