-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
874 lines (751 loc) · 32.4 KB
/
index.html
File metadata and controls
874 lines (751 loc) · 32.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NetPractice - Master Computer Networking</title>
<!-- Meta Tags for SEO -->
<meta name="title"
content="NetPractice 42 Project Guide – Full Networking Solutions, OSI Model, Subnetting, and Routing (2025)">
<meta name="description"
content="Master the NetPractice 42 project with this comprehensive guide. Includes subnetting, OSI model, IP routing, CIDR, and all networking fundamentals.">
<meta name="keywords"
content="NetPractice 42, NetPractice 42 guide, NetPractice full solution, 42 network project, 42 networking cursus, OSI model 42 project, network layers explained, TCP/IP vs OSI model, IP routing tutorial, network routing basics, subnetting guide, IP address classes, CIDR notation explained, IPv4 vs IPv6, default gateway tutorial, netmask and wildcard mask, static routing examples, binary to decimal IP, networking for beginners, OSI 7 layers explained, router configuration 42, ping traceroute explain, VLAN vs LAN, network simulation 42, netpractice walkthrough, network topology basics, switch vs router, ARP and DNS protocols, MAC address vs IP address, port numbers networking, NAT and PAT tutorial, packet switching 42, network performance issues, packet capture with Wireshark, client-server model, DHCP and DNS roles, IP fragmentation, firewall basics, NAT configuration 42, CSMA/CD explained, ARP table vs routing table, ICMP protocol in ping, networking challenges 42, netpractice cheat sheet, network debugging techniques, netpractice step-by-step, 42 project help, 42 school network cursus">
<meta name="author" content="Yassine Ajagrou">
<meta name="robots" content="index, follow">
<link rel="icon" href="fav-icon.png" type="image/x-icon">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--bg-primary: #0a0e1a;
--bg-secondary: #1a1f35;
--bg-tertiary: #2d3748;
--accent-primary: #64ffda;
--accent-secondary: #7c3aed;
--text-primary: #e2e8f0;
--text-secondary: #cbd5e0;
--text-muted: #a0aec0;
--border-color: #4a5568;
--code-bg: #1e293b;
--success: #48bb78;
--warning: #ed8936;
--glass-bg: rgba(255, 255, 255, 0.05);
--glass-border: rgba(255, 255, 255, 0.1);
}
body {
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
line-height: 1.7;
overflow-x: hidden;
}
/* Animated background */
body::before {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background:
radial-gradient(circle at 20% 80%, rgba(120, 58, 237, 0.15) 0%, transparent 50%),
radial-gradient(circle at 80% 20%, rgba(100, 255, 218, 0.15) 0%, transparent 50%),
radial-gradient(circle at 40% 40%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
z-index: -1;
animation: gradientShift 20s ease infinite;
}
@keyframes gradientShift {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.8;
}
}
/* Header */
header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1000;
background: rgba(10, 14, 26, 0.9);
backdrop-filter: blur(20px);
border-bottom: 1px solid var(--glass-border);
transition: all 0.3s ease;
}
.header-content {
max-width: 1400px;
margin: 0 auto;
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 1.5rem;
font-weight: 700;
background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.nav-menu {
display: flex;
gap: 2rem;
list-style: none;
}
.nav-menu a {
color: var(--text-secondary);
text-decoration: none;
padding: 0.5rem 1rem;
border-radius: 0.5rem;
transition: all 0.3s ease;
position: relative;
}
.nav-menu a:hover {
color: var(--accent-primary);
background: var(--glass-bg);
}
/* Progress bar */
.progress-bar {
position: fixed;
top: 0;
left: 0;
height: 3px;
background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
z-index: 1001;
transition: width 0.3s ease;
}
/* Main content */
main {
margin-top: 80px;
max-width: 1000px;
margin-left: auto;
margin-right: auto;
padding: 2rem;
}
/* Hero section */
.hero {
text-align: center;
padding: 4rem 0 6rem;
position: relative;
}
.hero h1 {
font-size: clamp(2.5rem, 5vw, 4rem);
font-weight: 800;
margin-bottom: 1.5rem;
background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
animation: fadeInUp 1s ease;
}
.hero .subtitle {
font-size: 1.25rem;
color: var(--text-secondary);
margin-bottom: 2rem;
animation: fadeInUp 1s ease 0.2s both;
}
.badges {
display: flex;
gap: 1rem;
justify-content: center;
margin-bottom: 3rem;
flex-wrap: wrap;
animation: fadeInUp 1s ease 0.4s both;
}
.badge {
padding: 0.5rem 1rem;
background: var(--glass-bg);
border: 1px solid var(--glass-border);
border-radius: 2rem;
color: var(--accent-primary);
text-decoration: none;
font-weight: 600;
backdrop-filter: blur(10px);
transition: all 0.3s ease;
display: inline-flex;
align-items: center;
gap: 0.5rem;
}
.badge:hover {
transform: translateY(-2px);
box-shadow: 0 10px 40px rgba(100, 255, 218, 0.2);
}
/* Table of contents */
.toc {
background: var(--glass-bg);
border: 1px solid var(--glass-border);
border-radius: 1rem;
padding: 2rem;
margin: 3rem 0;
backdrop-filter: blur(10px);
}
.toc h2 {
color: var(--accent-primary);
margin-bottom: 1.5rem;
font-size: 1.5rem;
}
.toc ol {
list-style: none;
counter-reset: toc-counter;
}
.toc li {
counter-increment: toc-counter;
margin-bottom: 0.5rem;
}
.toc a {
color: var(--text-secondary);
text-decoration: none;
display: block;
padding: 0.75rem 1rem;
border-radius: 0.5rem;
transition: all 0.3s ease;
position: relative;
}
.toc a::before {
content: counter(toc-counter, decimal-leading-zero);
color: var(--accent-primary);
font-weight: 600;
margin-right: 1rem;
font-size: 0.875rem;
}
.toc a:hover {
background: var(--glass-bg);
color: var(--accent-primary);
transform: translateX(0.5rem);
}
/* Section styling */
.section {
margin: 4rem 0;
opacity: 0;
transform: translateY(2rem);
animation: fadeInUp 0.8s ease forwards;
}
.section h2 {
font-size: 2.5rem;
margin-bottom: 1.5rem;
background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
position: relative;
}
.section h2::after {
content: '';
position: absolute;
bottom: -0.5rem;
left: 0;
width: 4rem;
height: 3px;
background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
border-radius: 2px;
}
.section h3 {
font-size: 1.75rem;
margin: 2rem 0 1rem;
color: var(--accent-primary);
}
.section h4 {
font-size: 1.25rem;
margin: 1.5rem 0 0.75rem;
color: var(--text-primary);
}
.section h5 {
font-size: 1.1rem;
margin: 1rem 0 0.5rem;
color: var(--accent-secondary);
}
.section p {
margin-bottom: 1.5rem;
color: var(--text-secondary);
max-width: 70ch;
}
/* Image styling */
.section img {
max-width: 100%;
height: auto;
border-radius: 1rem;
margin: 2rem 0;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
transition: transform 0.3s ease;
}
.section img:hover {
transform: scale(1.02);
}
/* Code blocks */
pre {
background: var(--code-bg);
border: 1px solid var(--border-color);
border-radius: 1rem;
padding: 1.5rem;
margin: 1.5rem 0;
overflow-x: auto;
position: relative;
}
pre::before {
content: '';
position: absolute;
top: 1rem;
right: 1rem;
width: 12px;
height: 12px;
background: var(--success);
border-radius: 50%;
box-shadow:
-20px 0 0 var(--warning),
-40px 0 0 #ef4444;
}
code {
font-family: 'Fira Code', 'JetBrains Mono', monospace;
font-size: 0.9rem;
color: var(--accent-primary);
}
p code {
background: var(--code-bg);
padding: 0.25rem 0.5rem;
border-radius: 0.25rem;
font-size: 0.875rem;
}
/* Lists */
ul,
ol {
margin: 1.5rem 0;
padding-left: 2rem;
}
li {
margin-bottom: 0.75rem;
color: var(--text-secondary);
}
/* Info cards */
.info-card {
background: var(--glass-bg);
border: 1px solid var(--glass-border);
border-radius: 1rem;
padding: 2rem;
margin: 2rem 0;
backdrop-filter: blur(10px);
position: relative;
overflow: hidden;
}
.info-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 4px;
height: 100%;
background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
}
/* Responsive design */
@media (max-width: 768px) {
.header-content {
padding: 1rem;
}
.nav-menu {
display: none;
}
main {
padding: 1rem;
}
.hero {
padding: 2rem 0 4rem;
}
.badges {
flex-direction: column;
align-items: center;
}
.toc {
padding: 1.5rem;
}
}
/* Animations */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(2rem);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Scroll animations */
.animate-on-scroll {
opacity: 0;
transform: translateY(2rem);
transition: all 0.8s ease;
}
.animate-on-scroll.animated {
opacity: 1;
transform: translateY(0);
}
/* Custom scrollbar */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
background: var(--accent-primary);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--accent-secondary);
}
/* Highlight box for important content */
.highlight-box {
background: linear-gradient(135deg, rgba(100, 255, 218, 0.1), rgba(120, 58, 237, 0.1));
border: 1px solid var(--accent-primary);
border-radius: 1rem;
padding: 1.5rem;
margin: 2rem 0;
position: relative;
}
.highlight-box::before {
content: '💡';
position: absolute;
top: -10px;
left: 20px;
background: rgba(87, 198, 213, 0.924);
border-radius: 100px;
padding: 0 0.5rem;
font-size: 1.2rem;
}
/* Network diagram styles */
.network-diagram {
background: var(--glass-bg);
border: 1px solid var(--glass-border);
border-radius: 1rem;
padding: 2rem;
margin: 2rem 0;
text-align: center;
backdrop-filter: blur(10px);
}
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
</head>
<body>
<!-- Progress bar -->
<div class="progress-bar" id="progressBar"></div>
<!-- Header -->
<header>
<div class="header-content">
<div class="logo">NetPractice</div>
<nav>
<ul class="nav-menu">
<li><a href="#home">Home</a></li>
<li><a href="#osi-model">OSI Model</a></li>
<li><a href="#tcp-ip">TCP/IP</a></li>
<li><a href="#ip-addresses">IP & Subnets</a></li>
<li><a href="#devices">Devices</a></li>
<li><a href="#data-travel">Data Flow</a></li>
</ul>
</nav>
</div>
</header>
<main>
<section class="hero" id="home">
<h1>Master Computer Networking</h1>
<p class="subtitle">Complete guide to understanding networks, protocols, and data communication</p>
<div class="badges">
<a href="https://iaceene.github.io/42_Subjects/?subject=NetPractice" class="badge">
<i class="fas fa-key"></i> 42 Subject
</a>
<a href="https://iaceene.github.io/Net_Practice_42" class="badge">
<i class="fas fa-circle online-dot"></i> Online Simulator
</a>
<a href="https://github.com/iaceene" class="badge">
<i class="fab fa-github fa-2x"></i> Github
</a>
</div>
</section>
<div class="toc animate-on-scroll">
<h2><i class="fas fa-list"></i> Table of Contents</h2>
<ol>
<li><a href="#osi-model">OSI Model</a></li>
<li><a href="#tcp-ip">TCP/IP Protocol Suite</a></li>
<li><a href="#ip-addresses">IP Addresses & Subnet Masks</a></li>
<li><a href="#devices">Network Devices</a></li>
<li><a href="#data-travel">How Data Travels</a></li>
</ol>
</div>
<!-- OSI Model Section -->
<section class="section animate-on-scroll" id="osi-model">
<h2>🧩 OSI Model</h2>
<div class="network-diagram">
<img src="https://cf-assets.www.cloudflare.com/slt3lc6tev37/6ZH2Etm3LlFHTgmkjLmkxp/59ff240fb3ebdc7794ffaa6e1d69b7c2/osi_model_7_layers.png"
alt="OSI Model 7 Layers" />
</div>
<p>The OSI (Open Systems Interconnection) model is a conceptual framework that standardizes the functions of
a telecommunication or networking system, dividing it into seven layers. This model helps in
understanding how different network components interact to enable communication between devices,
regardless of their underlying technology.</p>
<div class="highlight-box">
<p><strong>Key Concept:</strong> Created by ISO (International Organization for Standardization), think
about layers like steps to communicate between devices. These steps happen in both devices - the
sender and receiver do these steps in reverse. If the sender goes from 7 to 1, receiver goes from 1
to 7.</p>
</div>
<div class="info-card">
<h3>Data Transformation Process</h3>
<p><strong>At sender:</strong> At each layer, a header can be added to the data unit. At layer 2 a
trailer is added as well. When formatted data unit passes through physical layer it is changed into
an electromagnetic signal and transported along physical link.</p>
<p><strong>Encapsulation:</strong> A packet (header and data) at level 5 is encapsulated in a packet in
level 4, and so on. The data portion of packet at level N-1 carries the whole packet (data and
header/trailer) from level N.</p>
<p><strong>At destination:</strong> Data then moves back up through the layers. Headers and trailers
attached to data at the corresponding layer are removed (decapsulated) and action appropriate to
that layer are taken. At layer 5 the message is again in form appropriate to the application and is
made available to user.</p>
</div>
<h3>OSI Layers Breakdown</h3>
<h4>1. Physical Layer</h4>
<p>The physical layer is responsible for movements of individual bits from one hop (node) to the next.</p>
<ul>
<li><strong>Physical characteristics:</strong> Defines the interface between devices and media,
including transmission media type</li>
<li><strong>Representation of bits:</strong> Defines how 0s and 1s are changed to signals</li>
<li><strong>Data rate:</strong> Defines number of bits sent per second and duration of bits</li>
<li><strong>Synchronization:</strong> Sender and receiver must use same bit rate and synchronized clocks
</li>
<li><strong>Line configuration:</strong> Point-to-point or multipoint connections</li>
<li><strong>Physical topology:</strong> Star, mesh, bus, ring, or hybrid topology</li>
<li><strong>Transmission mode:</strong> Simplex, half-duplex, or full-duplex</li>
</ul>
<h4>2. Data Link Layer (Hop to Hop Delivery)</h4>
<p>The data link layer is responsible for moving frames from one hop (node) to the next.</p>
<ul>
<li><strong>Framing:</strong> Divides bit stream into data units called frames</li>
<li><strong>Physical addressing:</strong> Adds header with sender and receiver addresses</li>
<li><strong>Flow control:</strong> Prevents overwhelming the receiver</li>
<li><strong>Error control:</strong> Detects and retransmits damaged or lost frames</li>
<li><strong>Access control:</strong> Determines which device controls the link</li>
</ul>
<div class="highlight-box">
<p><strong>MAC Address Example:</strong> Known as the MAC or link address, it's the address of a node as
defined by its LAN or WAN. Ethernet uses 6-bytes (48-bits) physical address imprinted on the NIC.
</p>
</div>
<h4>3. Network Layer (End to End Delivery)</h4>
<p>The network layer is responsible for the delivery of individual packets from source host to destination
host across multiple networks.</p>
<ul>
<li><strong>Logical addressing:</strong> Adds unique identifier (IP address) to packets</li>
<li><strong>Routing:</strong> Provides routing mechanism for routers to route packets to final
destination</li>
</ul>
<div class="info-card">
<p><strong>IP Addresses:</strong> IP addresses are necessary for universal communications independent of
physical network. No two host addresses on the internet can have the same IP address. IP addresses
are 32-bit addresses that uniquely define a host connected to the Internet.</p>
<p><strong>Key Point:</strong> Physical addresses change from hop to hop, but logical addresses remain
the same.</p>
</div>
<h4>4. Transport Layer</h4>
<p>Responsible for process-to-process delivery of the entire message.</p>
<h4>5. Session Layer</h4>
<p>The session layer is responsible for dialog control and synchronization.</p>
<ul>
<li><strong>Dialog control:</strong> Allows communication in half or full duplex</li>
<li><strong>Synchronization:</strong> Adds checkpoints for recovery in case of failure</li>
</ul>
<h4>6. Presentation Layer</h4>
<p>The presentation layer is responsible for translation, compression, and encryption.</p>
<ul>
<li><strong>Translation:</strong> Converts between sender and receiver formats</li>
<li><strong>Encryption-Decryption:</strong> Ensures privacy and security</li>
<li><strong>Compression:</strong> Reduces number of bits for multimedia transmission</li>
</ul>
<h4>7. Application Layer</h4>
<p>The application layer provides services to the user such as:</p>
<ul>
<li>Mail services</li>
<li>File transfer and access</li>
<li>Remote log-in</li>
<li>Accessing the web (WWW)</li>
<li><strong>Telnet:</strong> Remote system login</li>
<li><strong>HTTP:</strong> Web file transfers</li>
<li><strong>SMTP:</strong> Electronic mail</li>
</ul>
</section>
<!-- TCP/IP Section -->
<section class="section animate-on-scroll" id="tcp-ip">
<h2>🌐 TCP/IP Protocol Suite</h2>
<p>The layers in the TCP/IP protocol suite do not exactly match those in the OSI model. However, when TCP/IP
is compared to OSI, we can say that the TCP/IP protocol suite is made of five layers: physical, data
link, network, transport, and application.</p>
<div class="info-card">
<h3>Physical Addressing in TCP/IP</h3>
<p>Most local-area networks use a 48-bit (6-byte) physical address written as 12 hexadecimal digits;
every byte (2 hexadecimal digits) is separated by a colon:</p>
<pre><code>07:01:02:01:2C:4B</code></pre>
<p>A 6-byte (12 hexadecimal digits) physical address.</p>
</div>
</section>
<!-- IP Addresses Section -->
<section class="section animate-on-scroll" id="ip-addresses">
<h2>🏠 IP Addresses & Subnet Masks</h2>
<p>Let us first look at the working definition of computer networks: Computer networks can be defined as the
exchange of network packets between computing machines across the world with the help of data lines like
wire cables, optical fibers, etc.</p>
<h3>Commonly Used Terms in Computer Networks</h3>
<h4>Nodes</h4>
<p>Nodes in computer networks mean any computing device such as computers, mobile phones, tablets, etc which
try to send and receive network packets across the network to another similar device.</p>
<h4>Network Packets</h4>
<p>Network packets are nothing but the information or units of data that a source node wants to send/receive
to/from the destination node.</p>
<h4>Internet Protocol (IPs)</h4>
<p>Consider you want to send a birthday gift to your friend on their birthday, where will you send it? To
their street address right? Same is the case here. An IP of a computer device is the address of that
device in a computer network.</p>
<div class="highlight-box">
<p><strong>Technical Definition:</strong> An IP address is a 32-bit number used which identifies devices
in a network. All communication to and from the device in that network will be done in terms of its
IP address.</p>
</div>
<h3>IP Address Types</h3>
<ul>
<li><strong>IPv4:</strong> 32 bits (four bytes). Example: 104.244.42.129 (twitter.com's IPv4)</li>
<li><strong>IPv6:</strong> Eight hexadecimal numbers separated by ":". Example:
2001:0cb8:85a3:0000:0000:8a2e:0370:7334</li>
</ul>
<h3>IP Address Classes</h3>
<p>IPv4 is classified into five classes named Class A, B, C, D, E.</p>
<div class="info-card">
<h4>Class A</h4>
<p>First bit of first octet is constant and is "0"</p>
<ul>
<li>Default subnet mask: 255.0.0.0</li>
<li>Network bits: 8, Host bits: 24</li>
<li>Usable network bits: 7 (8-1 for class identification)</li>
<li>Number of networks: 2^7 - 2 = 126</li>
<li>Hosts per network: 2^24 - 2 = 16,777,214</li>
<li>Range: 1.x.x.x to 126.x.x.x</li>
</ul>
</div>
<div class="info-card">
<h4>Class B</h4>
<p>First 2 bits are constant (10)</p>
<ul>
<li>Range: 128.0.x.x to 191.255.x.x</li>
</ul>
</div>
<div class="info-card">
<h4>Class C</h4>
<p>First 3 bits are constant (110)</p>
<ul>
<li>Range: 192.0.0.x to 223.255.255.x</li>
</ul>
</div>
<h3>Static vs Dynamic IP Addresses</h3>
<ul>
<li><strong>Static:</strong> IP addresses that remain constant for a device over time. Used for servers.
</li>
<li><strong>Dynamic:</strong> IP addresses that change over time. Allocated by DHCP servers.</li>
</ul>
<div class="highlight-box">
<p><strong>Important Note:</strong> A device can have multiple IP addresses at the same time. IP
addresses are assigned to interfaces, not directly to computers.</p>
</div>
<h3>Network Address Translation (NAT)</h3>
<p>Network address translation is a technique used by routers to provide internet service to more devices
with less usage of public IPs. A router is assigned a single IP address by the ISP and assigns private
IPs to all connected devices.</p>
<div class="info-card">
<h4>NAT Example</h4>
<p>If you're accessing medium.com (72.14.204.147) from your computer (192.168.1.100):</p>
<pre><code>Private connection: 192.168.1.100:37641 → 72.14.204.147:80
Public connection: 104.244.42.129:59273 → 72.14.204.147:80</code></pre>
</div>
<h3>Dynamic Host Configuration Protocol (DHCP)</h3>
<p>DHCP is responsible for assigning dynamic IP addresses to hosts. The DHCP server is maintained by the ISP
or router and handles automatic IP allocation.</p>
<h3>Domain Name System (DNS)</h3>
<p>A Domain Name Server contains huge records of domain name to IP address mappings. When you type a URL,
DNS servers translate the domain name to the corresponding IP address.</p>
<div class="info-card">
<h4>How DNS Works</h4>
<ol>
<li>DNS is managed by your ISP</li>
<li>When you type a URL, packets travel to your ISP's DNS server</li>
<li>DNS server looks up the domain in its database</li>
<li>If not found, it queries other DNS servers</li>
<li>Returns the IP address or throws an error</li>
</ol>
</div>
<h3>Internet Service Providers (ISPs)</h3>
<p>ISPs provide internet access and are organized in a hierarchical structure:</p>
<ul>
<li><strong>Tier 1 ISPs:</strong> Major highways of the internet, connected to almost every network</li>
<li><strong>Tier 2 ISPs:</strong> Regional ISPs that provide services to organizations and consumers
</li>
<li><strong>Tier 3 ISPs:</strong> Local ISPs that purchase bandwidth from Tier 2 ISPs</li>
</ul>
</section>
<!-- Network Devices Section -->
<section class="section animate-on-scroll" id="devices">
<h2>🔧 Network Devices</h2>
<p>Network devices are physical devices that allow hardware on a computer network to communicate and
interact with each other. They ensure efficient communication between connected devices by controlling
data transfer, boosting signals, and linking different networks.</p>
<h3>Functions of Network Devices</h3>
<ul>
<li>Send and receive data between different devices</li>
<li>Allow devices to connect
</ul>
</section>
<!-- Add any additional sections if needed -->
</main>
<script>
// Add JavaScript functionality here if needed
// For example, the progress bar functionality:
window.onscroll = function () {
var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
var scrolled = (winScroll / height) * 100;
document.getElementById("progressBar").style.width = scrolled + "%";
};
// Animation on scroll
const animateElements = document.querySelectorAll('.animate-on-scroll');
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('animated');
}
});
}, { threshold: 0.1 });
animateElements.forEach(el => observer.observe(el));
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "HowTo",
"name": "Complete Guide to NetPractice - 42 Network Project",
"description": "This is a step-by-step guide to mastering the 42 NetPractice project, covering IP routing, subnetting, and OSI model.",
"author": {
"@type": "Person",
"name": "Yassine Ajagrou"
},
"publisher": {
"@type": "Organization",
"name": "42 Network Resources"
},
"datePublished": "2025-07-01"
}
</script>
</body>
</html>