{"id":19053292,"url":"https://github.com/jotavare/net_practice","last_synced_at":"2025-06-13T23:38:09.737Z","repository":{"id":181343893,"uuid":"666620695","full_name":"jotavare/net_practice","owner":"jotavare","description":"Networking exercises with a focus on IP addresses and subnet masks.","archived":false,"fork":false,"pushed_at":"2024-06-26T23:32:10.000Z","size":2242,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-02T10:45:34.385Z","etag":null,"topics":["ip","ipcalc","ipv4","network","router","routing","subnet","subnets","tcp"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jotavare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-15T02:57:05.000Z","updated_at":"2024-07-23T16:56:37.000Z","dependencies_parsed_at":"2023-12-02T19:26:25.008Z","dependency_job_id":"b426781e-5f58-412a-abdc-b131cef4dbe7","html_url":"https://github.com/jotavare/net_practice","commit_stats":null,"previous_names":["jotavare/netpractice"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotavare%2Fnet_practice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotavare%2Fnet_practice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotavare%2Fnet_practice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotavare%2Fnet_practice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jotavare","download_url":"https://codeload.github.com/jotavare/net_practice/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240109717,"owners_count":19749181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ip","ipcalc","ipv4","network","router","routing","subnet","subnets","tcp"],"created_at":"2024-11-08T23:29:59.530Z","updated_at":"2025-02-22T01:16:08.386Z","avatar_url":"https://github.com/jotavare.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/jotavare/jotavare/blob/main/42/banners/piscine_and_common_core/github_piscine_and_common_core_banner_net_practice.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"https://img.shields.io/badge/status-finished-success?color=%2312bab9\u0026style=flat-square\"/\u003e\n\t\u003cimg src=\"https://img.shields.io/badge/evaluated-25%20%2F%2009%20%2F%202023-success?color=%2312bab9\u0026style=flat-square\"/\u003e\n\t\u003cimg src=\"https://img.shields.io/badge/score-100%20%2F%20100-success?color=%2312bab9\u0026style=flat-square\"/\u003e\n\t\u003cimg src=\"https://img.shields.io/github/languages/top/jotavare/netpractice?color=%2312bab9\u0026style=flat-square\"/\u003e\n\t\u003cimg src=\"https://img.shields.io/github/last-commit/jotavare/netpractice?color=%2312bab9\u0026style=flat-square\"/\u003e\n\t\u003ca href='https://www.linkedin.com/in/joaoptoliveira' target=\"_blank\"\u003e\u003cimg alt='Linkedin' src='https://img.shields.io/badge/LinkedIn-100000?style=flat-square\u0026logo=Linkedin\u0026logoColor=white\u0026labelColor=0A66C2\u0026color=0A66C2'/\u003e\u003c/a\u003e\n\t\u003ca href='https://profile.intra.42.fr/users/jotavare' target=\"_blank\"\u003e\u003cimg alt='42' src='https://img.shields.io/badge/Porto-100000?style=flat-square\u0026logo=42\u0026logoColor=white\u0026labelColor=000000\u0026color=000000'/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"#about\"\u003eAbout\u003c/a\u003e •\n\t\u003ca href=\"#how-to-use\"\u003eHow to use\u003c/a\u003e •\n\t\u003ca href=\"#practice-and-evaluation\"\u003ePractice and Evaluation\u003c/a\u003e •\n\t\u003ca href=\"#subnet\"\u003eSubnet\u003c/a\u003e •\n\t\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e •\n\t\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\n\u003c/p\u003e\n\n## ABOUT\nThis is a practical networking exercise aimed at exploring the fundamentals of networking. In this project, I configured a small-scale network and delved into the world of TCP/IP addressing. The goal is to complete 10 levels, each designed to challenge and enhance my networking knowledge.\n\n- [Subject](https://github.com/jotavare/netpractice/blob/main/subject/en_subject_netpractice.pdf) `PDF`\n- [References](https://github.com/jotavare/42-resources#04-netpractice) `GitHub`\n\n## HOW TO USE\n#### 1º - Change directory\n```bash\ncd netpractice/netpractice/exercises/\n```\n\n#### 2º - Open the index.html file\n\u003e It doesn't work well in Firefox.\n```bash\nopen -a \"Google Chrome\" index.html\n```\n\n## PRACTICE AND EVALUATION\n#### UTILITY\n\u003e This utility will help us understand more about Address Manipulation:\n\n```\nbrew install ipcalc\nipcalc 172.30.0.69/30\n```\n\n#### COMPLETE ALL 10 LEVELS\n\u003e There will be a practice and evaluation mode:\n\n- `Practice mode` - Insert your 42 intra username. You will do all 10 levels.\n- `Evaluation mode` - 3 random levels from level 6 to level 10. You only have 15 minutes for all.\n\n\u003e [!WARNING]\n\u003e Before moving to the next level, don’t forget to export your configuration using the `Get My Config` button so you can put it in your Git repository.\n\n#### BUTTONS\n\u003e There will be 2 buttons on the top left corner (3 if you completed a level):\n\n- `Check again` - Verify whether your configuration was correct or not.\n- `Get my config` - Download your configuration. It will be needed to turn in your assignment.\n- `Next level` - Click on this button to get to the next level.\n\n## SUBNET\n\u003e A **subnet or subnetwork** is a *network inside a network*. Subnets make networks more efficient.\n\n**Subnetting** is the process of stealing bits from the HOST part of an IP address to divide the large network into smaller ones called subnets. After subnetting, we end up with **NETWORK SUBNET HOST** fields, and we always reserve an IP address to *identify the subnet* and another one to *identify the broadcast subnet address*, and through subnetting, network traffic can travel a shorter distance without passing through unnecessary routes to reach its destination.\n\n#### CALCULATE SUBNET MASK FROM IP ADDRESS\n\u003e 1º - Find Subnet Number (we are gonna use the IP address `10.20.4.13/29` for this example):\n```\nSubtract prefix number from /32\n32 - 29 = 3\n\nCalculate Subnet Mask:\n8 bits - 3 bits = 5 bits (Network bits turned on)\n\nYou might be asking why 8 bits, 8 bits are required for each octet.\n\n|-------|-------|-------|-------|-------|-------|-------|-------|\n| 128   | 64    | 32    | 16    | 8     | 4     | 2     | 1     |\n|-------|-------|-------|-------|-------|-------|-------|-------|\n| 1     | 1     | 1     | 1     | 1     | 0     | 0     | 0     |\n|-------|-------|-------|-------|-------|-------|-------|-------|\n| 128 + | 64 +  | 32 +  | 16 +  | 8     | =       248           |\n|-------|-------|-------|-------|-------|-------|-------|-------|\n\nSubnet Mask = 255.255.255.248\n```\n\n\u003e 2º - Find Subnet Size:\n```\nRaise 2 to the power of deduction (8 - 3 = 5) -\u003e Let's call it n.\n\n2 ** n    = Subnet Size.\n2 ** 3    = Subnet Sizes for each subnet.\n2 * 2 * 2 = 8\n\nNOTE: 8 is the block size for the subnet, so for example:\nthe increments will now be 0 8 16 24 32 and so on (we add 8 each time)\n```\n\n\u003e 3º - Find Broadcast Address:\n```\nSubnet size - 1\n(2 ** n) - 1  = Broadcast Address\n(2 ** 3) - 1  = (8 - 1) = 7\n```\n\n\u003e 4º - Locate IP Address Subnet:\n```\nIdentify subnet block for IP address:\n-\u003e Where in each increment is the address 10.20.4.13/29 located (0 8 16 32 40)?\n\n13 falls between 8 and 16 and therefore the address is in the valid host range of the subnet 10.20.4.8/29\n```\n\n\u003e 5º - Calculate The Valid Hosts:\n```\nSubnet size - 2\n(2 ** n) - 2 = Valid Host Range\n(2 ** 3) - 2 = (8 - 2) = 6\n```\n\n\u003e And from these steps, we can know 4 important things:\n```\nSubnet Address    -\u003e 10.20.4.8/29\nMin Host Address  -\u003e 10.20.4.9/29\nMax Host Address  -\u003e 10.20.4.14/29\nBroadcast Address -\u003e 10.20.4.15/29\n```\n\n#### SUBNET MASK TABLE\n\u003e Here is a quick reference table for help when subnetting.\n\n|Subnet Mask \t|CIDR      |\tBinary Notation                    |Network Bits  |Host Bits | Available Addresses |\n| -             | -        | -                                     | -    | -     | -           | \n|255.255.255.255| \t/32| \t11111111.11111111.11111111.11111111| \t32| \t0 | \t1       |\n|255.255.255.254| \t/31| \t11111111.11111111.11111111.11111110| \t31| \t1 | \t2       |\n|255.255.255.252| \t/30| \t11111111.11111111.11111111.11111100| \t30| \t2 | \t4       |\n|255.255.255.248| \t/29| \t11111111.11111111.11111111.11111000| \t29| \t3 | \t8       |\n|255.255.255.240| \t/28| \t11111111.11111111.11111111.11110000| \t28| \t4 | \t16      |\n|255.255.255.224| \t/27| \t11111111.11111111.11111111.11100000| \t27| \t5 | \t32      |\n|255.255.255.192| \t/26| \t11111111.11111111.11111111.11000000| \t26| \t6 | \t64      |\n|255.255.255.128| \t/25|    11111111.11111111.11111111.10000000| \t25| \t7 | \t128     |\n|255.255.255.0  | \t/24| \t11111111.11111111.11111111.00000000| \t24| \t8 | \t256     |\t\t\n|255.255.254.0  | \t/23| \t11111111.11111111.11111110.00000000| \t23| \t9 | \t512     |\n|255.255.252.0  | \t/22| \t11111111.11111111.11111100.00000000| \t22| \t10| \t1024    |\n|255.255.248.0  | \t/21| \t11111111.11111111.11111000.00000000| \t21| \t11| \t2048    |\n|255.255.240.0  | \t/20| \t11111111.11111111.11110000.00000000| \t20| \t12| \t4096    |\n|255.255.224.0  | \t/19| \t11111111.11111111.11100000.00000000| \t19| \t13| \t8192    |\n|255.255.192.0  | \t/18| \t11111111.11111111.11000000.00000000| \t18| \t14| \t16384   |\n|255.255.128.0  | \t/17| \t11111111.11111111.10000000.00000000| \t17| \t15| \t32768   |\n|255.255.0.0    | \t/16| \t11111111.11111111.00000000.00000000| \t16| \t16| \t65536   |\t\n|255.254.0.0    | \t/15| \t11111111.11111110.00000000.00000000| \t15| \t17| \t131072  |\n|255.252.0.0    | \t/14| \t11111111.11111100.00000000.00000000| \t14| \t18| \t262144  |\n|255.248.0.0    | \t/13| \t11111111.11111000.00000000.00000000| \t13| \t19| \t524288  |\n|255.240.0.0    | \t/12| \t11111111.11110000.00000000.00000000| \t12| \t20| \t1048576 |\n|255.224.0.0    | \t/11| \t11111111.11100000.00000000.00000000| \t11| \t21| \t2097152 |\n|255.192.0.0    | \t/10| \t11111111.11000000.00000000.00000000| \t10| \t22| \t4194304 |\n|255.128.0.0    | \t/9 | \t11111111.10000000.00000000.00000000| \t9 | \t23| \t8388608 |\n|255.0.0.0      |       /8 | \t11111111.00000000.00000000.00000000| \t8 | \t24| \t16777216|\n\n## CONTRIBUTING\n\nIf you find any issues or have suggestions for improvements, feel free to fork the repository and open an issue or submit a pull request.\n\n## LICENSE\n\nThis project is available under the MIT License. For further details, please refer to the [LICENSE](https://github.com/jotavare/net_practice/blob/master/LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjotavare%2Fnet_practice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjotavare%2Fnet_practice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjotavare%2Fnet_practice/lists"}