Skip to main content

Posts

How do programs work on a computer? (Part 1/2)

Let's take a very simple program for understanding how this system works. The following example is a very basic C code that assigns 2 variables (x and y) and then adds them to generate a value 'z'.  Note: We do not output anything in this program void main() { int x = 3; int y = 4; int z = x + y; } But we have a pressing question. Computers inherently work on electronics and logic, so how does it understand and execute the program? The answer is not very simple and you have to bear with me through a tiny journey. Basic Logic Circuits Let's first begin with a very basic Circuit which implements AND logic and OR logic (skip if you are familiar)  As seen in the circuits above, for the left circuit, the LED lights up only when both switches are on. This is AND logic as "Switch 1 AND Switch 2 need to be on". In the circuit on the right, either of the switch will switch on the LED. Note that in the
Recent posts

The future of Web Acceleration and Security #2: DPDK

Most of you would have noticed by now that my content is heavily focused on Computer Networks and systems. And yes, I love these subjects (although my grades might say otherwise). I started this blog because the technology I deal with on a day to day basis usually does not have a tutorial targeted at people who do not already have multiple years of relevant industry experience under their belts. It is not trivial for most newbies (including myself) to understand concepts like SmartNICs , eBPF  and other stuff. And while writing this blog, I try to be as accurate as my knowledge allows me to be. Source and Attribution That being said, let us first understand the limitations because of which DPDK has become necessary. Pre-Requisites Before we begin, you should already know the basics of what a network packet is and how it's transmitted. If you are not aware of it, please visit the links below (both are necessary): Life of a packet Life of a packet - Deep Dive Now that you have unde

Dynamically extending the Linux Kernel! An introduction to eBPF

A simple Google search of "eBPF" will tell you that it stands for "extended Berkeley Packet Filter". The words "packet filter" in the name makes me think this has something to do with Computer Networks. But, while it started as a packet filter system, it has extended much beyond that functionality since then. Facebook also had Whatsapp, Instagram, Oculus etc., under its belt, and hence the board decided to rename the company to Meta to symbolise this. In the same way, maybe eBPF should be renamed to represent what it is! So, what exactly is eBPF? To understand eBPF, let us first understand why it is required. A short video explaining eBPF can be found here . Pre-requisites In this journey, the first thing to learn is the difference between userspace and kernel space. This  sub-section of my previous post gives you an overview. As mentioned there, you don't want your user application to have access to any data of any other running application unless spe

The future of Web Acceleration and Security: SmartNICs

Since 2016, India has been one of the fastest-growing markets for the internet. It almost doubled its internet penetration in half a decade (2016-2020), and the average broadband speeds increased by 77% in just one year (2016-2017), while mobile speeds improved by 42% in the same year ( source ). In 2020, Amazon was hit with the then-largest known DDoS attack of 2.3Tbps, while the very next year, an attack of 2.4Tbps was defended by Microsoft. Have you ever wondered about the changes under the hood required to support such high bandwidths and mitigate such an attack? If yes, this post will introduce you to some of the technologies involved. Note: This post is not comprehensive by any means and barely covers the beginning of the surface of the technologies involved. The Bandwidth Problem Let us first begin by u nderstanding the most fundamental problem of the internet. Bandwidth. What is bandwidth? Source and Attribution: https://commons.wikimedia.org/wiki/File:Bandwidth.png The above i

Photos to Photons

Heya there, Mike here! I hope you remember me from the previous story of "Photons to Photos". If not, please read that story here . Let's continue from where we left off! So, it turns out that the owners of the DSLR wanted to revisit us. For that, they had removed our permanent place of residence, the SD card, from the DSLR and put it in their laptop. So, now it was another entity who claimed it was from another DMA controller who would take us to another RAM, this time belonging to the laptop. And so we are off again, this time to meet the owners of the DSLR. In the RAM, we saw a lot of pictures already present alongside us. And more of them were coming in. We were all being loaded into some application that would enable the DSLR Owners to see us and even change us! The first contact As soon as the application had loaded us, it sent us to a chamber called "JPEG Decompression" (remember JPEG Compression chamber from the previous story?). We were asked to hand o

Photons to Photos

Hello, I am a photon, and my name is Mike! And today, I am going to describe how my friends and I became immortal. Well, almost immortal. As you see, my current state is very similar to Lord Voldemort. I have multiple copies of myself today, and if all of those copies die, I die. But no, I am not evil and certainly not a child murderer. So, let's begin! The beginning I do not remember where I was born. All I remember is that I was suddenly travelling at about 299792458 m/s, travelling through emptiness. There were, I don't know know how many of us there. It was about 500 seconds later that we suddenly slowed down a bit. And instead of travelling straight, we were starting to go off in different directions! We had just entered the atmosphere of a planet the natives call "Earth", and the others call "TerraForma" or "Terra" for short. This planet had an atmosphere, and because of it, many of my peer travellers deviated somewhere else or lost energy o

Travelogue of the click (Deep Dive)

 Warning: This article goes scuba diving into the depths of computer systems, networks, security, and many other fields and is not for the faint-hearted. It is okay if not everything in this article makes sense to you, especially if you are an undergraduate or have just graduated. Also, this article will take a lot of deviations to go explain some technology in detail. This article will refer to the previous two articles and their sections: Everything that happens when you search on Google (Part 1/2) Everything that happens when you search on Google (Part 2/2) Attribution and License:  https://www.flickr.com/photos/138248475@N03/23827490171 Touch Input Most of today's smartphones contain a capacitive touch screen. A capacitive touchscreen comprises 2 layers, each having a grid of units of some conductive material. One of the layer's units are connected row-wise, and the other's column-wise. Those 2 layers are separated by an insulator, and one of the layers is negatively ch