Networking For DevOps
Windows vs Mac
13 min read
Read TimeMay 17, 2024
Published OnI promise you, this time I didn’t try to clickbait you into reading this article. This article is about the actual networking fundamentals, as in Wi-Fi. Yes, that’s the first thing that comes to my mind when I want to emphasize that kind of networking, as opposed to the “your network is your net worth” one.
Networking is actually the second topic in the DevOps track after Red Hat Linux, which it seems that I’m writing in [::-1] order. For you non-Pythonistas, it just means in reverse order. Expect more Python references as I’m growing my PyJa (Python Jargon).
Btw and just FYI, I don’t have a particular content schedule. I’m just writing and uploading whatever’s on my mind, and that I want to share on this blog. And the only reason I’m writing about networking fundamentals is because I just remembered that I have to present what I’ve learned about this topic to my wingman next week. Since I will need to prepare for that presentation, I might as well dump all of my thoughts in this article, and present this article to him next week, or if you’re reading this Marco, can we then just skip the presentation? 🙂
Now I know that I still haven’t written the article about the DevOps track itself, but to give you an idea, the DevOps track consists of two parts, each lasting roughly 8 weeks. The first 8 weeks are all about the fundamentals, such as Linux, Networking, Python etc., and the next 8 weeks is one huge practical assignment where we basically have to build a pipeline. I’m sharing this because when I went through the networking fundamentals course, and while learning about ethernet cables, routers and the like, I sincerely had a “wax on, wax off” expectation, because I couldn’t make the connection (no pun intended) to DevOps.
So I googled it, and I found an interesting article here, and as it turns out, it is actually a “wax on, wax off” kind of moment, meaning that you’ll have a better understanding when you cross that bridge. For me at this point, it’s just a tad too early to fully comprehend the relevancy of Networking in DevOps. Even after reading the above article. It’s a bit similar to what Robin Williams said to Matt Damon’s character in the movie Good Will Hunting about reading about something versus actually experiencing that something.
Having said that, I did complete the Networking Fundamentals course, but I don’t think you want to read how to ping Google from your terminal. So instead, I will share the assignment we did at the end of the course.
But before that, I quickly want to share what operating system I'm using in the traineeship, because from my experience it does matter if you're using Windows or Mac.
Windows vs Mac
I have used both Windows and Mac, and I personally prefer to work with Mac. One of the many benefits you'll get when you start working at Devoteam is the option to choose between a (borrowed) laptop from the company or a so-called "bring your own device allowance" of x amount per month. Depending on availability and your role within the company, this can be either a Windows or a Mac machine. The option for a DevOps trainee is only Windows. I opted to use a company laptop.
Now you may wonder, why, since I prefer working on a Mac. And the reason is not that I don't want the extra allowance or that I don't want to diminish the lifetime of my personal laptop on work related tasks. The reason has to do with the fact that everyone else in the traineeship is using Windows.
Why is this important, you may wonder. Well, I know from the information available about the traineeship that Linux will be part of it, and as preparation, I tried to install Linux using VirtualBox on my Mac, which I just couldn't get to work.
My concern is that if I use Mac, then good chances are that no one else will be able to help me if I ever get stuck during the traineeship. So while I would love to use my Mac and take the allowance, I believe it's a wiser decision to follow the crowd in this case.
Alright, let's get back to the assignment.
There are a couple of exercises, but one of them is setting up a simple HTTP web server and accessing that web server through a web browser and via the command line.
The exercise doesn't mention if we need to do this on Windows or Linux, but my wingman asked me to create a Virtual Machine, install Linux on it, and do the exercises using Linux on the Virtual Machine.
Virtual Machine
A virtual machine (VM) is essentially a digital version of a physical computer.
In order to create a VM you will need a hypervisor, which is a program to run and manage one or more VMs. There are different programs that can act as a hypervisor, but my wingman asked me to install VirtualBox as the hypervisor, which is open-source and offers a free license for personal, educational, or evaluation use. It's also the same hypervisor I previously used to install Linux on my Mac, which I couldn't get to work.
My personal laptop is the MacBook Air M1, which uses Apple's own silicon chip that uses the ARM architecture. The latest version of VirtualBox only supports Intel's x86 architecture for Mac. There is an older build or version of VirtualBox that supposedly does support the M1 chip, but like I said, I just couldn't get Linux installed. I was able to install VirtualBox, but when I tried to install Linux, it kept going back to the Linux installation window.
Good thing that I opted for the company laptop, because I had to install the latest version of VirtualBox, which I was able to do.
However, I did run into a small "error", and that was missing dependencies during the installation of VirtualBox. Apparently, VirtualBox is expecting the Python Core package and the win32api bindings to be installed first.
The win32api bindings makes it possible for other programming languages (e.g. Python) to interact with the Win32 API on Windows. The library for Python is called pywin32 and can be installed using PIP by running the command pip install pywin32
from the command line. PIP is a package manager for Python packages.
However, PIP doesn't come pre-installed, so I had to install PIP first. I ran into an error when I ran pip -V
to see if pip was correctly installed, which is that pip was not added to the Windows Environment Variables. So I copied the path from the warning message I got when I installed PIP, and added that as a new path under system variables.
Windows environment variables are dynamic named values that store information about the system environment, such as system paths, program locations, and configuration settings. They are used by the operating system and applications to locate required files, configure behavior, and manage various aspects of system operation.
So now that both Python and pywin32 are installed, I was able to successfully install VirtualBox.
Linux
The next step is to create a VM and install Linux on it. I'm using openSUSE-Leap, which I have downloaded from their original website, and I was able to install Linux without any problems.
While I'm still learning to work with Linux, as I have only been using it for a couple of days, I must say that it works wonderfully out of the box. The requirements for the exercises are that Python 3, Curl and Nslookup are installed, and apparently all three of them come pre-installed with Linux, or at least with openSUSE-Leap.
Starting a web server
You can start a HTTP web server with the command python3 -m http.server
I then accessed the webserver using a web browser. I'm using Firefox, because this one also came pre-installed. You can access the web server by typing in localhost
followed by the port or the IP address of your machine on the local network followed by the port, which you can find by running the command hostname -I
or ip addr
. You can get the port number from the terminal output when you start your web server.
Alternatively, you can also access the web server from within the terminal using curl. When you run curl -v
, you will make what's called a verbose request, and this will give you additional information in the headers for both the request and response.
When I inspect the headers in both the request and response, I get an HTTP/1.1 for the request and HTTP/1.0 for the response.
Doing a Google Search, I now know that HTTP 1.1 is a persistent connection and HTTP 1.0 is a non-persistent connection. There are some differences between the two, but one major difference is that HTTP 1.0 by default will establish a new connection between the client and the server for each request/response cycle, which creates overhead. HTTP 1.1 as mentioned above supports persistent connections, where multiple requests and responses can be sent over the same connection, thus reducing overhead. Think how important this becomes when you have a website with multiple resources (e.g. images, scripts, stylesheets etc.) on a single page. And perhaps important to mention, but HTTP is an application layer protocol (layer 7 from the OSI model) that allows web applications to communicate and exchange data via a request response cycle. It's a TCP/IP based protocol, and TCP is what gives it reliability.
The Networking Fundamentals explained all of this from IPv4 vs IPv6 to the OSI Model, and everything in between. The networking exercise was a good supplementary exercise to end this topic, and with that, I will also end this blog post.
Bye for now.