42-NetPractice Project
Find a file
2026-04-30 15:12:26 +01:00
evaluation-solutions All exercises done. Must finish README before delivery. 2026-04-27 16:03:27 +01:00
media All exercises done. Must finish README before delivery. 2026-04-27 16:03:27 +01:00
standard-solutions All exercises done. Must finish README before delivery. 2026-04-27 16:03:27 +01:00
LICENSE Changed LICENSE to CC BY-NC 4.0 as it makes more sense for this project. 2026-04-30 15:10:53 +01:00
net_practice.1.9.tgz All exercises done. Must finish README before delivery. 2026-04-27 16:03:27 +01:00
README.md Finished README. Project should be good for delivery. 2026-04-30 15:12:26 +01:00

This project has been created as part of the 42 curriculum by grui-ant.

📥 42-NetPractice 📤

A network simulation exercise as an introduction to computer networks.

"Close the world, open the nExt." - Tagline found in Serial Experiments Lain

Description

NetPractice is an exercise-based project with the purpose of introducing one to the basic computer networking. In particular, the IPv4 protocol.

IPv4 is the original Internet Protocol, which dictates how machines should connect to each other, both at an internal level, and at a global level. It was created in 1980, and is still the most widely used communication protocol, despite its limitation: there are only 4,294,967,296 possible public IPv4 addresses. This is the same limitation behind the Y2K38 Problem in Unix Time.

Given how much the Internet usage exploded in the last decades, this limit has already been reached long ago, hence why a newer version of the protocol was created in 1995: IPv6. However, we won't work with it on this project.

Instructions

Running the exercises

To run the provided NetPractice program, you will first need to extract it from its archive, by switching into the directory containing the archive, and running the following command on your Terminal:

  • tar -xzfv net_practice.1.9.tgz

Once that's done, cd into the new directory, and start the script:

  • cd net_practice && ./run.sh

This will boot up a Python webserver on your computer, and open your web browser on the corresponding localhost port. (You might need to install python3 beforehand).

You will be greeted with the following interface:

homepage.png

You have access to two modes:

  • Training, where you do all 10 exercises in order;
  • Evaluation, which will simulate the same environment as a real evaluation for project delivery, with a set of 3 exercises to complete within 15 minutes.

Exporting configs and submission

You can export a config file of your current exercise at all times. This config file will be exported in a json format, and will include all the values you filled in for each device interface, route, etc of your current exercise. You should ideally export your config once you've solved your current exercise: you'll know you've succeeded when all Goals are listed with an OK status, and a "Next level" option will appear.

In order to submit this project for delivery, all you have to do is export all 10 completed exercises from the Training mode to the root of your delivery git repository, and submit the repository. It is important however that you enter your 42 login username in the interface at the beginning of the exercises.

Resources

The following concepts are useful for succeeding in this project:

  • TCP/IP Addressing;
  • Subnet Masks;
  • Default Gateways;
  • Routers;
  • Switches;
  • OSI Layers.

License

All files in this repository are licensed under the terms of the CC BY-NC 4.0, with the exception of the net_practice.1.9.tgz archive, whose contents fall under 42's respective licensing.