Aug 08, 2019
Not too long ago, I decided to take the time to revisit all of the Computer Science topics I never formally learned about. In my quest to fill in my holes of knowledge, I began reading "Computer Networking: A Top-down Approach". So far, I've been finding the book very enlightening: the author does a great job explaining the various elements in a simple and easy-to-understand way.
Most recently, I completed the chapter on the Application Layer. It was a great read, and I was super happy to finally understand many of the technologies I had been working with over the years. At the end of the chapter, readers are presented with a series of assignments to help solidify what was just read. Below are my implementation of these projects.
Everything was written in Python, and the results are rudimentary at best. Also note that I have done very little testing, keeping things mostly to my own localhost. In any case, check them out and let me know what you think!
This web server project is a barebones server that only accepts
GET requests. It listens for
http requests on the port of your choosing and upon receiving one fetches files from a data directory. Under the hood, it does the following:
There are a few other things going on as well, but this is the gist of it. To test this out, you can clone the project and run the server:
git clone https://github.com/chickenn00dle/cntda-web-server.git [project-name] cd [project-name] ./server.py --port 8081
After this, you can send a request using something like HTTPie
The UDP pinger project is a bit simpler than the web server project above. It runs as both the server and client depending on the included flag. As the server, the pinger:
As the client the pinger:
To get this bad mammajamma up and running, you can clone the project and run the server:
git clone phttps://github.com/chickenn00dle/cntda-udp-pinger.git [project-name] cd [project-name] ./ping.py --run-server
And in a separate shell, initiate the ping:
This one is a bit more involved as it requires setting up a gmail account for testing. The mail client project is a simplified client that is only capable of sending simple text emails. I also made it interactive as it was becoming a bit cumbersome to include so many arguments when calling the script.
Under the hood, the mail client does the following:
Finally, to get this one running, you can clone the project, and run the program alongwith the necessary arguments:
git clone phttps://github.com/chickenn00dle/cntda-udp-pinger.git [project-name] cd [project-name] ./mail-client.py [_email address from above_] [_mail server_]
I've only tested this using a dummy gmail account. To test things out, I suggest doing the same. You'll need to also be sure to allow less secure apps to access your test gmail account.
As previously mentioned, all of these network apps are super rudimentary, and nowhere near production quality. Mostly, I just wanted to quickly get something running that would give me exposure to the technologies used in actual apps. And overall, I'd say mission accomplished. I learned a ton from these projects and have a much better understanding of the protocols that underly much of the internet.
As always, feel free to reach out with any questions or feedback!