RSSAmplifier

Blog

saminiir's hacker blog

Yet Another Hacker Blog (YAHB). UNIX, Networking, Self-Improvement.

saminiir.comRSS feed ↗10 posts

Latest posts

Paper storage and recovery of GPG keys

To avoid disastrously losing your private keys, they should be redundantly backed up in a robust manner in a safe location. As one possible approach, we will store the GPG keyring as QR codes, print them on paper, and demonstrate recovering the keyring. Do note that this method excludes backing up the trust database. For general GPG usage, consult my previous post on handling GPG keys . Contents…

Let's code a TCP/IP stack, 5: TCP Retransmission

At this point we have a TCP/IP stack that is able to communicate to other hosts in the Internet. The implementation so far has been fairly straight-forward, but missing a major feature: Reliability. Namely, our TCP does not guarantee the integrity of the data stream it presents to applications. Even establishing the connection can fail if the handshake packets are lost in transit. Introducing…

Let's code a TCP/IP stack, 4: TCP Data Flow & Socket API

Previously, we introduced ourselves to the TCP header and how a connection is established between two parties. In this post, we will look into TCP data communication and how it is managed. Additionally, we will provide an interface from the networking stack that applications can use for network communication. This Socket API is then utilized by our example application to send a simple HTTP request…

Configuring Arch Linux on Dell XPS 15

In the previous post , we’ve successfully booted into Arch Linux from our encrypted root partition. Let’s now configure it to our (my) liking. Contents User management Arch User Repository X11 and Window Manager: dwm Terminal: xterm Input: Trackpad gestures (libinput) Sound Storage: NVMe SSD Graphics: Nvidia and Bumblebee Power Management Powertop Battery status Backlight Laptop mode…

Installing Arch Linux on Dell XPS 15

So after using a Fedora/Macbook for a while, I got a new work laptop. This time I opted for the Dell XPS 15 with all the bells and whistles 1 . It has received great reviews and has been compared to the quality of the Macbook Pro’s. Installing a UNIX distro is always time-consuming and depending on your desires, the configuration varies a lot. This applies especially to bare-bones distros like…

Let's code a TCP/IP stack, 3: TCP Basics & Handshake

Now that our userspace TCP/IP stack has minimal implementations for Ethernet and IPv4, it is time to look into the dreaded Transmission Control Protocol (TCP). Operating on the fourth OSI networking layer 1 , transport , TCP is responsible for repairing erroneous connections and faults in packet delivery. Indeed, TCP is the workhorse of the Internet, providing reliable communications in virtually…

Let's code a TCP/IP stack, 2: IPv4 & ICMPv4

This time in our userspace TCP/IP stack we will implement a minimum viable IP layer and test it with ICMP echo requests (also known as pings ). We will take a look at the formats of IPv4 and ICMPv4 and describe how to check them for integrity. Some features, such as IP fragmentation, are left as an exercise for the reader. For our networking stack IPv4 was chosen over IPv6 since it is still the…

Let's code a TCP/IP stack, 1: Ethernet & ARP

Writing your own TCP/IP stack may seem like a daunting task. Indeed, TCP has accumulated many specifications over its lifetime of more than thirty years. The core specification, however, is seemingly compact 1 - the important parts being TCP header parsing, the state machine, congestion control and retransmission timeout computation. The most common layer 2 and layer 3 protocols, Ethernet and IP…

OpenVPN puts packets inside your packets

I realized I do not know exactly how OpenVPN does its magic in Linux. I mean, sure, it encrypts and tunnels the packets to another endpoint, but can you describe the exact steps to achieve this? If not, read on. In fact, read on anyway for good measure. This is the general idea I had pictured in my mind how OpenVPN works: Receive packets Encrypt them Tunnel them Send to destination Several…

Establish your online identity using GnuPG

I have a confession to make. I do not have an online identity. I have Twitter, Facebook (yeah I know) and this homepage, but still, my online presence is undermined by the fact that I or others cannot verify my identity. The remedy to this is public-key cryptography 1 . Contents About PGP Using GPG Creating the master key Key management Creating a revocation certificate Creating subkeys Evacuating…