TUTORIALS 》 Circular Ring Buffers Architecture - Linux Kernel - Device Drivers - Network Stack

A circular buffer, circular queue, cyclic buffer or ring buffer is a data structure is a fixed-size buffer as if it were connected end-to-end or can be a dynamic one if implemented via Linked Lists. This is a data-structure quite popularly used in many parts of Linux Kernel such as Device Drivers, especially Network Hardware drivers, Network Packet Buffer such as sk_buff and so on. We can use a Ring Buffer in user-space application programming too. These kind of buffers are more suited for holding steady stream of incoming data. For example Network Packets. If the buffer gets full, we can discard the oldest buffer elements (such as packets). And to avoid we can increase the buffer size. So circular ring buffers plays a major role especially in Network Appliances such as Routers, Firewalls, etc.

Here is an extensive Youtube video of mine on Circular Ring Buffers, its Architecture and the big picture:

Circular Ring Buffers Live Visual Demo | Linux Kernel | Device Drivers | Network Stack:
Here is yet another series of videos in which I did Live Visual Demo or animation of Circular Ring buffers. This depects real-world use-case scenarios such as Device Drivers, some Linux Kernel Data-structures, Network Stack Packet buffers and so on.

Also recommend to watch:

Featured Video:

Suggested Topics:

☆ Tutorials :: Arduino UNO Projects ↗

☆ Tutorials :: Network Software Development ↗

☆ Tutorials :: Research and Projects ↗

☆ Tutorials :: Linux (user-space), Systems Architecture ↗

☆ Tutorials :: Linux Kernel Software Development ↗

☆ Tutorials :: Linux Kernel Internals (PDFs) - by Ramin Farajpour ↗

☆ Tutorials :: Software Development (Programming) Tools ↗

☆ Tutorials :: Embedded Projects ↗

Join The Linux Channel :: Facebook Group ↗

Visit The Linux Channel :: on Youtube ↗

💗 Help shape the future: Sponsor/Donate

Recommended Topics:
Featured Video:
Watch on Youtube - [61//0] 278 The Linux Channel - Managing the Youtube channel and video content ↗

Code with Kiran - Live Coding | Linux Kernel Programming | Kernel Libraries ↗
Thursday' 29-Oct-2020
Here is a my multi-episode Youtube video series of me doing a live code (Code with Kiran Series). Linux Kernel source consists of many libraries within. For example such as to create and manage Linked Lists, String Operations, Encryption Algorithms, Compression Algorithms, and so on. In the Kernel, various Kernel Modules (including various Device Drivers) will use these Kernel inclusive Libraries. Unlike user-space programming, in Kernel Space when you code, you have to use these Libraries which are actually part of kernel (i.e sharing the same address space). And in some cases you can also make your own libraries and publish as well. In the case of user-space programs, we use third-party libraries (explicit or implicit), but that cannot happen when you code in kernel space. The libraries share the same address space and they are part of Linux Kernel mainline source. Hence it is important to understand the significance of using such library as demonstrated in my video series bel

What is a Linux Kernel Module - a Big Picture ↗
Thursday' 29-Oct-2020
Learning Linux Kernel Programming is always fascinating and yet challenging. So generally you may tend to learn Kernel Module programming, since such a module can be dynamically plugged into running Linux Kernel. But this will lead to confusion, and many assume kernel source is mostly a collection of these modules. Which in reality is not. Not just that, when we say Kernel Module, its a vaguely defined term. The term Module (as we know) is nothing but a collection of APIs, bunch of variables and associated data-structures. Which may or may not be a plugable kernel module. If you ask me, I am a fan of wiring Linux Kernel Modules, which may not be necessarily a pluggable kernel module. It all boils down to the address space at which these modules function inside a monolithic Linux Kernel. Which is nothing but Linux Kernel's address space. Hence here is my detailed multi-episode Youtube video series on Linux Kernel modules, a big picture and the significance of the

Raspberry Pi GPIO Pins - Raw Kernel Access via sysfs - GPIO Linux Kernel Drivers ↗
Thursday' 29-Oct-2020
Here is a my multi-episode Youtube video series of me doing a live code (Code with Kiran Series). Linux Kernel GPIO drivers of Raspberry Pi offers access/control directly via sysfs filesystem interface. But often people don't see this aspect, instead as a part of IoT, they assume these GPIO pins can be only accessed by some Python, Java or C/C++ code libraries. But in the real case those libraries are just an abstract layer written around the core Kernel GPIO driver's sysfs filesystem. So here is an attempt where we learn this aspect in systems architecture point of view. And then later try to attempt writing such user-space GPIO control code without any third-party libraries. Since the sysfs driver access is via regular files (user-space context), we can now use any language of our choice and access the same like any files. In that process we can attempt writing our own bunch of abstract APIs resembling a typical GPIO access library.

Multi-Client TCP Server with pthreads Mutex Synchronized - Code-walk of viewer code - Sekhar Pariga ↗
Thursday' 29-Oct-2020
Here is a code-walk of a git-hub source submitted by a viewer Sekhar Pariga, which is a Multi-client TCP Server with pthreads Mutex synchronized. Basically it is a Directory Listing Server, that serves ls, cd, pwd of directory functions to connecting TCP clients which are remotely (locally) executed by the server. Server is implemented using multi-thread pthread library, to serve multiple clients simultaneously. Server keeps the each accepted client session details in the queue data structure. Client session queue contains each clients socket-fd and present working directory as a queue node.

Adding your own Kernel Modules into Linux Kernel Source | Linux Kernel Programming ↗
Thursday' 29-Oct-2020
Whenever you do custom kernel modules, you can optionally make it a part of existing Linux Kernel source. This does not mean you are submitting your kernel module to the mainline kernel source (i.e kernel.org Linux Kernel Foundation). What I meant is, you can make your kernel module(s) part of Linux Kernel source so that when you compile your kernel you can automatically compile your kernel module(s) too. As well when you create/modify kernel .config configuration file (such as via make menuconfig, etc), you can enable or disable your kernel module(s) too.
To do the same you have to register (and include) your custom Kernel Module's Kconfig and Makefile to the existing Kconfig and Makefile of the Linux Kernel source Here is a detailed multi-episode video of mine which gives the overall idea and the big-picture.

Linux Software Development and Tools ↗
Thursday' 29-Oct-2020

Software Programming Standards (Coding Standards) ↗
Thursday' 29-Oct-2020

IP-in-IP Tunneling Demystified - VPN Tunnels ↗
Thursday' 29-Oct-2020
There can be many ways one can architect VPN Networks. The end objective is to tunnel private IP (typically LAN subnets) within public IP Networks (such as Internet). You can establish such a tunnel in various creative ways, such as Transport Mode, Tunnel Mode, IP-in-IP tunneling, etc. Also you can choose any transport layer protocol of your choice such as send VPN traffic via TCP, or via UDP and so on.

KERNEL - The Linux Channel - a High Performance Linux Kernel ↗
Thursday' 29-Oct-2020

Raspberry Pi OS with PIXEL ↗
Thursday' 29-Oct-2020

Trending Video:
Watch on Youtube - [61//0] 278 The Linux Channel - Managing the Youtube channel and video content ↗

Weekly News Digest - Week 4 - January 2018 ↗
Thursday' 29-Oct-2020
> MIPS Returns to Silicon Valley, Eyes Burgeoning AI Market > NLDWRTG the ULTIMATE WRT54G Expansion Board > How to use the nmcli command to gather network device information on Linux > Logic Supply Introduces ML350 Customizable Fanless Industrial Computer Based on Intel Apollo Lake Processor > Ubuntu Linux 18.04 'Bionic Beaver' LTS will default to Xorg

Recommended Video:
Watch on Youtube - [61//0] 278 The Linux Channel - Managing the Youtube channel and video content ↗