https://github.com/f-corvaro/netpractice
"Master the essentials of network configuration and troubleshooting."
https://github.com/f-corvaro/netpractice
42roma 42romaluiss 42school common-core common-core-cursus ip ipaddressing network networking protocols routing simulation subnetting tcp tcp-ip
Last synced: about 1 month ago
JSON representation
"Master the essentials of network configuration and troubleshooting."
- Host: GitHub
- URL: https://github.com/f-corvaro/netpractice
- Owner: f-corvaro
- License: mit
- Created: 2024-07-28T08:04:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-10T08:56:31.000Z (10 months ago)
- Last Synced: 2025-04-10T09:47:37.241Z (10 months ago)
- Topics: 42roma, 42romaluiss, 42school, common-core, common-core-cursus, ip, ipaddressing, network, networking, protocols, routing, simulation, subnetting, tcp, tcp-ip
- Homepage: https://github.com/f-corvaro
- Size: 5.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
"Master the essentials of network configuration and troubleshooting."
Index
Introduction
Overview
Folder Structure
Project Requirements - Mandatory Part
Getting Started
Training Levels
Theoretical Background
Quick Overview
Fundamentals of Computer Networks
Basic Operations on Computer Networks
Types and Topologies of Computer Networks
Reference models
Open Systems Interconnection (OSI) - A Theoretical Perspective
TCP/IP (Transmission Control Protocol/Internet Protocol) - A Practical Approach
Data Sharing
Network nodes
B Mask : 11111111 11111111 00000000 00000000 : 255.255.0.0
Classless IP Addressing (CIDR)
Levels explanation
Evaluation Process
Peer-Evaluations
Developed Skills
References
Support and Contributions
Author
## Introduction
NetPractice is a technical project focused on developing and refining networking skills through practical exercises and scenarios.
This designed to equip students with a profound understanding of network configuration and troubleshooting.
### Overview
The project covers a wide range of topics, including IP addressing, subnetting, routing, and network troubleshooting.
You will have to configure small-scale networks, which requires a solid understanding of how TCP/IP addressing works.
The project consists of 10 levels (i.e., 10 exercises) that you will complete and submit to your Git repository.
The networks you will work with are not real; instead, they will be available via a training interface that you will access through your web browser.
This setup allows for a controlled environment where you can practice and hone your networking skills.
The purpose of this project is to solve networking problems and ensure the smooth operation of a network.
## Folder Structure
```
.
├── netpractice
│ └── level1.json
│ └── level2.json
│ └── level3.json
│ └── level4.json
│ └── level5.json
│ └── level6.json
│ └── level7.json
│ └── level8.json
│ └── level9.json
│ └── level10.json
├── resources
│ └── net_practice.1.5.tgz
├── LICENSE
└── README.md
```
## Project Requirements - Mandatory Part
### Getting Started
First, download the project file from Intra page or directly from [this link](https://github.com/f-corvaro/NETPRACTICE/blob/main/resources/net_practice.1.5.tgz).
Next, extract the files to a folder of your choice. In this folder, open the `index.html` file. This will launch the interface in your web browser:
## Theoretical Background
I know that the theoretical aspects are taken very broadly, but I firmly believe that it is necessary to have a cultural basis on these topics. Feel free to skip some parts or read the whole thing. Enjoy it!
### Quick Overview
The Internet, a vast network of networks, comprises millions of both public and private networks spanning commercial, academic, and governmental sectors. Individuals typically access the Internet via Internet Service Providers (ISPs), which themselves form networks connecting homes, businesses, and other entities within specific geographic areas. These ISPs also connect to higher-level ISPs to gain broader Internet access, creating a hierarchical structure with a handful of level 1 ISPs at the top and hundreds of thousands of lower-level ISPs at the base. The coverage of ISPs can range from global to local scales. Large content providers, such as Google, often establish their own networks and connect directly to lower-level ISPs to reduce costs and enhance connection speeds for their users.
### Fundamentals of Computer Networks
**Node:** In the context of computer networks, a node is any device that can send, receive, or forward information over the network. This includes computers, routers, and switches.
**Links (connection between nodes):** Nodes are connected to each other through various telecommunication technologies (phisical mediums) including wired (e.g., Ethernet or coaxial cables), optical (e.g., fiber optics), and wireless (e.g., radio waves) methods. The process include these steps: **Digitisation**, **Modulation**, **Transmission** and **Demodulation & Decoding**. The first step is the digitisation of data. This means converting information, which can be text, images, video or any other type of data, into a sequence of bits (0 and 1). Each bit represents an electrical state (on or off) or a light pulse. Once digitised, the data is modulated on a carrier signal. This carrier signal can be an electromagnetic wave (used in wireless transmissions) or a beam of light (used in fibre optics). Modulation consists of modifying certain characteristics of the carrier signal, such as amplitude, frequency or phase, so that digital data ‘travels over’ it. The modulated signal is then transmitted through the physical medium (cables, optical fibres, radio waves). Upon reception, the signal is demodulated to extract the original digital data. Subsequently, this data is decoded and made comprehensible to the receiving device.
**Computer Networks:** The connections between nodes form the network's structure, a collection of interconnected devices that share resources and communicate with each other using common communication protocols. Computer networks enable a wide range of applications and services, including access to the World Wide Web, digital video and audio streaming, shared use of application and storage servers, printers, and fax machines, as well as email and instant messaging.
**Protocols:** Each node in a computer network, whether it's a computer, router, or switch, is identified by a unique network address and may also have a hostname, a memorable label typically assigned during initial setup. These nodes use protocols to send, receive, or forward information over the network. Protocols are sets of rules that dictate how data should be formatted, addressed, transmitted, and received. They also define how to handle transmission errors. Network addresses are used by these protocols, such as the Internet Protocol (IP), to locate and identify nodes. Some common protocols include TCP/IP, HTTP, and FTP.
A **network address** could be an IP address like `192.168.1.1`. This is a unique identifier used by devices to communicate within a network. The **Dynamic Host Configuration Protocol(DHCP) server** is responsible for assigning IP addresses to devices on a network. When a device connects to the network, it sends a request to the DHCP server, which then assigns an available IP address to the device. The DHCP server keeps track of which IP addresses are currently in use, ensuring that each device on the network gets a unique IP address. If a device disconnects from the network, its IP address is returned to the pool of available addresses and can be reassigned to a different device.
**IP (Internet Protocol):**: Used to identify devices on a network and to route data packets from one device to another. It is a logical address that can change.This is used to communicate between different networks, over the Internet. When you send an email or browse a website, your device uses its IP address to reach remote servers. An IP address serves as an identifier for a specific network interface, rather than the device itself.
**IPv4** is the fourth version of the Internet Protocol. Although the latest version is IPv6, which introduces a new addressing system, IPv4 remains widely used. An IPv4 address is a `32-bit` integer, represented as four octets separated by dots. Each octet, a positive number, corresponds to 8 bits. For instance, consider the address `198.42.214.5`. Here, `198` is the decimal representation of the first octet, `42` of the second, and so forth. In binary, this address would be:
`11000110.00101010.11010110.00000101`
Given the 32-bit limitation, the IPv4 address space is finite. The smallest possible address is 0.0.0.0, and the largest is 255.255.255.255:
| Decimal | Binary |
| --------------- | ----------------------------------- |
| 0.0.0.0 | 00000000 00000000 00000000 00000000 |
| 255.255.255.255 | 11111111 11111111 11111111 11111111 |
**IPv6** expands the IP address length from 32 bits to 128 bits, significantly increasing the number of available addresses. With 128 bits, we can have over 340 sextillion addresses.
IPv6 addresses are represented as hexadecimal numbers. Each address consists of eight groups, each containing 16 bits (2 octets), separated by colons (":").
`2001:0db8:0000:85a3:0000:0000:ac1f:8001`
We can shorten the notation by removing some non-significant zeros:
`2001:db8:0:85a3:0:0:ac1f:8001`
**MAC (Media Access Control):** Used to identify a physical device on the local network. It is a unique and immutable physical address. It is used locally, within the same network, to communicate between devices. For example, when you connect an Ethernet cable to your computer, your network card uses its MAC address to communicate with the network switch.
A **hostname** is a more human-friendly label for a device on a network. For example, a server might have the hostname `webserver1`. This hostname can be used to access the server on a local network, provided the network's DNS (Domain Name System) is set up to associate that hostname with the server's IP address.
**DNS (Domain Name System):** It is like a phone book for the internet. Imagine having to remember the IP address (a long sequence of numbers) for every Web site you want to visit, it would be an impractical task. DNS solves this problem by allowing us to use easy-to-remember names such as `www.google.it` instead of a complicated IP address.
**HTTP (Hypertext Transfer Protocol):** is the protocol used for transmitting hypertext over the World Wide Web. It defines how messages are formatted and transmitted, and what actions web servers and browsers should take in response to various commands. For example, when you enter a URL in your browser, this actually sends an HTTP command to the web server directing it to fetch and transmit the requested web page. HTTP uses a stateless request-response model, meaning that each request from a client to a server is processed independently, without any knowledge of the requests that came before it. HTTP is not secure, so it is often replaced by HTTPS, a secure version that uses SSL/TLS protocols to encrypt the communication.
### Basic Operations on Computer Networks
**Addressing** is the process of assigning a unique identifier, such as an IP address, to each device (node). This allows for precise communication between specific devices. Data is sent across the network in small units called **packets**. Each packet contains a portion of the data being sent, along with metadata such as the source and destination addresses. **Routing** is the process of determining the best path for these packets to take from the source to the destination. This is typically handled by devices called routers, which analyze the network's topology and traffic conditions to make this decision. Finally, the **Domain Name System (DNS)** translates human-friendly domain names (like `www.google.com`) into the IP addresses that networks use to route traffic. This makes it easier for users to access websites without having to remember complex IP addresses.
### Types and Topologies of Computer Networks
Computer networks can be categorized based on their size and the geographical area they cover. **Local Area Networks (LANs)** are networks that connect devices over a relatively short distance, such as within a building or campus. **Wide Area Networks (WANs)** cover larger geographical areas, often spanning cities, countries, or even the globe. **Metropolitan Area Networks (MANs)** are larger than LANs but smaller than WANs, typically covering a city or suburb. **Wireless Local Area Networks (WLANs)** are similar to LANs, but use wireless communication methods instead of traditional wired connections. **Storage Area Networks (SANs)** are networks designed to provide access to consolidated, block-level data storage. **Controller Area Networks (CANs)** are vehicle bus standards designed to allow microcontrollers and devices to communicate with each other within a vehicle without a host computer.
se bit shifting for multiplication,
#### Open Systems Interconnection (OSI) - A Theoretical Perspective
The Open Systems Interconnection (OSI) model is a reference model from the International Organization for Standardization (ISO) that "provides a common basis for the coordination of standards development for the purpose of systems interconnection." In the OSI reference model, communications between systems are split into seven different abstraction layers: Physical, Data Link, Network, Transport, Session, Presentation, and Application.
Each intermediate layer serves a class of functionality to the layer above it and is served by the layer below it. Classes of functionality are implemented in software development using established communication protocols. Each layer in the OSI model has well-defined functions, and the methods of each layer communicate and interact with those of the layers immediately above and below as appropriate. Although the OSI model is largely theoretical and not all networks strictly adhere to its structure, it provides a useful way to understand and describe how different network protocols interact and co-operate to provide network services.
***Example:***
In this example, we simplify the model by considering only five layers. This approach makes it easier to understand how the model works. We've combined the Presentation, Session, and Transport layers into a single layer, referred to as the Transport layer.
#### TCP/IP (Transmission Control Protocol/Internet Protocol) - A Practical Approach
The **TCP/IP (Transmission Control Protocol/Internet Protocol) Model**, also known as **Internet Protocol suite**, is a more practical counterpart to the OSI model. It is the foundation upon which the internet and most commercial networks operate. The TCP/IP model consists of four layers: the Network Interface, Internet, Transport, and Application layers. The Network Interface layer corresponds to the combination of the Physical and Data Link layers in the OSI model. The Internet layer is equivalent to the Network layer in the OSI model, handling IP addressing and routing. The Transport layer is responsible for reliable data transmission, similar to its OSI counterpart. Finally, the Application layer of the TCP/IP model combines the functions of the Session, Presentation, and Application layers in the OSI model. It handles high-level protocols like HTTP and FTP, enabling user applications to interact with the network. It is named after the two most important protocols in the suite: the Transmission Control Protocol (TCP) and the Internet Protocol (IP). TCP/IP provides end-to-end connectivity specifying how data should be packetized, addressed, transmitted, routed, and received at the destination.
### Data Sharing
https://www.codequoi.com/en/binary-010-uses-of-bit-shifting-and-bitwise-operations/ctual intended message. Headers contain metadata essential for payload delivery, while the payload is extracted and used by an operating system, application software, or higher-layer protocols.
The packets are then sent over the network from the source node to the destination node. Along the way, they may pass through several intermediate nodes, such as routers and switches, which read the packet headers to determine the best path to the destination. This process is known as routing. Once all the packets reach the destination, they are reassembled in the correct order to form the original data. If any packets are lost or damaged during transmission, the error-checking data in the packet headers can be used to detect this and request retransmission of the affected packets. This ensures reliable data transmission over the network. The physical link technologies of packet networks typically limit the size of packets to a certain maximum transmission unit (MTU).
With packets, the bandwidth (the maximum rate of data transfer across a given path) of the transmission medium can be better shared among users than if the network were circuit-switched. When one user is not sending packets, the link can be filled with packets from other users, allowing the cost to be shared with relatively little interference, provided the link is not overused. Often, the route a packet needs to take through a network is not immediately available. In such cases, the packet is queued and waits until a link is free.
#### Network nodes
Every device connected to internet has at least one network interface, a network card that acts as bridge between the device and the physial medium connected to the rest of the network. A client typically has only one interface since it has only one network connection. A router usually has many, one for each of its network.
A **host** is any system connected to a network, whether it's a computer, a server, a smartphone, or even a specialized network device. It serves as a node or endpoint in the network, capable of sending and receiving data. A **client** is a computer, a smartphone, or some other type of connected device. A **server** is a more powerful machine which stores and distributes content over the Internet.
Each node in a network has a unique network address, which can be used to send data to that node. Nodes can be connected to each other in various ways, forming different network topologies. The way nodes are connected and interact with each other determines many properties of the network, such as its speed, reliability, and resilience to faults.
Like any other type of computer data, a packet is composed of a long series of bits. Each bit in a packet must be moved all the way to its destination (by physical media). Moving a packet’s bits from one physical medium to another is the **network switch**’s job. Along its route, a packets will no doubt pass through several switches.
**Routers** are used to route packets, which are not all going to the same destination. Much like a network switch, a router can transfer a packet from one physical medium to another. However, its capabilities extend beyond this. Typically, a router is connected to multiple network segments and possesses the intelligence to determine the optimal path for a packet based on its destination.
Next, we need to comprehend how a router decides the direction to send a packet. This decision-making process utilizes a forwarding table.
A router's primary role is to inspect the headers of incoming packets and determine their destination addresses. This informatihttps://www.codequoi.com/en/binary-010-uses-of-bit-shifting-and-bitwise-operations/
In this scenario, the router inspects the header of the incoming packet and consults its forwarding table to determine that the packet should be routed via interface number 2.
However, consider the fact that there are approximately 4 billion 32-bit IPv4 addresses. A router with a forwarding table containing entries for all 4 billion addresses would be highly inefficient and slow, even with an optimized routing algorithm. Wouldn't it be more efficient to determine the packet's destination by reading just the initial bits of the address? Precisely! This is one of the benefits offered by the concept of subnetworks.
An IP address is divided into two parts: the network prefix and the host identifier. The network prefix identifies the subnetwork to which the device belongs, while the host identifier specifies the particular device within that subnetwork. When a router receives a packet, it typically only needs to examine the network prefix to determine the packet's destination. To distinguish between the network prefix and the host identifier, a router uses a subnet mask. But how many bits does the network prefix comprise? The answer might be more complex than you think…
Internet is a network made of many subnetworks. IP addresses are assigned by range depending on the size of the subnetwork. Originally, address ranges were categorized into several classes: A for the largest networks, B for medium-sized networks and C for the smallest networks. So the 8, 16 or 24 first bits of the IPv4 address represented the subnetwork, and the following bits identified the host within that subnet.
## Evaluation Process
### Peer-Evaluations
Submit your assignment in your Git repository as usual. Only the work inside your repository will be evaluated during the defense. Double-check the names of your files to ensure they are correct.
Since there are 10 levels in the training interface, you need to submit 10 files in your repository (one file per level). Place them at the root of your repository. Make sure to enter your login in the training interface and export a file per level using the **Get my config** button. It is crucial that you enter your login in the interface.
During the defense, you will be required to successfully complete 3 random levels as specified on the training platform. You will have a limited time to do so. The use of external tools is not allowed during your evaluation. However, the use of a simple calculator such as `bc` is tolerated but will be the limit.
`bc` is a command-line calculator that supports arbitrary precision arithmetic. It is commonly used in Unix-like operating systems, including Linux. `bc` stands for "basic calculator" and can handle complex mathematical expressions, including floating-point calculations, making it a useful tool for quick computations directly from the terminal.
```bash
# Start bc in interactive mode
bc
# Perform a calculation
scale=2
5 / 3
# Output: 1.66
```
## Developed Skills
## References
- [CodeQuoi: Internet Layered Network Architecture](https://www.codequoi.com/en/internet-layered-network-architecture/) - A comprehensive guide to the architecture of Internet networks, explaining the different layers and their functions.
- [CodeQuoi: Binary 001 - Counting & Calculating Like a Computer](https://www.codequoi.com/en/binary-001-counting-calculating-like-a-computer/) - This resource provides a deep dive into the binary number system, which is fundamental to computer operations. It explains how computers use binary for counting and calculations, making it a valuable resource for understanding low-level computer operations.
- [Bit shifting](https://www.codequoi.com/en/binary-010-uses-of-bit-shifting-and-bitwise-operations/)
- [CodeQuoi: IPv4 Addresses, Routing, and Subnet Masks](https://www.codequoi.com/en/ipv4-addresses-routing-and-subnet-masks/) - Detailed explanation of IPv4 addressing, routing, and subnet masks, key concepts in network communication.
- [Wikipedia: Computer Network](https://en.wikipedia.org/wiki/Computer_network) - An overview of computer networks, including their history, types, and key principles.
- [Wikipedia: Datagram](https://en.wikipedia.org/wiki/Datagram) - Detailed explanation of datagrams, basic units of data transfer in packet-switched networks.
- [Wikipedia: Packet Switching](https://en.wikipedia.org/wiki/Packet_switching) - Detailed article on packet switching, the method used to send data across networks.
- [Wikipedia: OSI Model](https://en.wikipedia.org/wiki/OSI_model) - Comprehensive article on the OSI Model, a conceptual framework used to understand network interactions.
- [BMC Blog: Understanding the OSI Model](https://www.bmc.com/blogs/osi-model-7-layers/) - A blog post that breaks down the seven layers of the OSI Model and their functions.
- [Wikipedia: Internet Protocol Suite](https://en.wikipedia.org/wiki/Internet_protocol_suite) - Detailed article on the Internet Protocol Suite, also known as TCP/IP, the set of protocols used for the Internet.
- [Wikipedia: IP Address](https://en.wikipedia.org/wiki/IP_address) - Comprehensive article on IP addresses, unique identifiers for devices on a network.
- [Netpractice on Medium](https://medium.com/@imyzf/netpractice-2d2b39b6cf0a) - A Medium article discussing the concept of network practices.
- [New Subnetting on Medium](https://toufa7.medium.com/new-subnetting-34fadfb86c70) - A Medium article explaining the concept of subnetting in networking.
- [42bangkok-netpractice on GitHub](https://github.com/viruskizz/42bangkok-netpractice) - A GitHub repository.
- [NetPractice on GitHub](https://github.com/lpaube/NetPractice) - Another GitHub repository.
- [42-net-practice on GitHub](https://github.com/ricardoreves/42-net-practice) - Another GitHub repository.
- [Net_Practice on GitHub](https://github.com/tblaase/Net_Practice) - Another GitHub repository.
- [gh](https://github.com/caroldaniel/42sp-cursus-netpractice/tree/main)
- [youtube](https://www.youtube.com/watch?v=eHV1aOnu7oM)
- [github](https://github.com/ucefooo/net_practice?tab=readme-ov-file)
## Support and Contributions
If you find this repository helpful, please consider starring it to show your support. Your support is greatly appreciated!
## Author
