Network Basics

Loading concept...

๐ŸŒ Network Basics: The Secret Language of Computers

Imagine a Giant Post Officeโ€ฆ

Think of the internet like a magical post office that delivers letters between millions of houses in seconds. Every computer is a house, every message is a letter, and there are special rules everyone follows to make sure letters arrive safely.

Letโ€™s explore how this magical system works!


๐Ÿ“š The OSI Model: Seven Floors of a Post Office Building

Imagine a 7-story building where each floor handles a different job to deliver your letter:

graph TD A["7๏ธโƒฃ Application - You write letter"] --> B["6๏ธโƒฃ Presentation - Translator"] B --> C["5๏ธโƒฃ Session - Keeps conversation going"] C --> D["4๏ธโƒฃ Transport - Splits into pieces"] D --> E["3๏ธโƒฃ Network - Adds address"] E --> F["2๏ธโƒฃ Data Link - Local delivery"] F --> G["1๏ธโƒฃ Physical - Actual wires/roads"]

What Each Floor Does:

Floor Name Job Security Concern
7 Application You write your message Bad apps can steal data
6 Presentation Translates/encrypts Weak encryption = danger
5 Session Keeps chat alive Hackers can hijack sessions
4 Transport Breaks into packets Packets can be intercepted
3 Network Adds addresses (IP) Addresses can be spoofed
2 Data Link Local network delivery ARP attacks possible
1 Physical Actual cables/signals Wire tapping

๐Ÿ” OSI Security - Protecting Each Floor

Simple Example:

  • Floor 7 Attack: A fake website pretends to be your bank
  • Floor 3 Attack: Someone pretends to have your address
  • Floor 1 Attack: Someone cuts the cable

Real Life Protection:

  • Use HTTPS (locks at Floor 6-7)
  • Use firewalls (guards at Floor 3-4)
  • Use secure cables (physical security at Floor 1)

๐Ÿš— TCP/IP: The Rules of the Road

If OSI is the building, TCP/IP is the actual road system computers use today!

The 4-Layer Cake

graph TD A["๐Ÿฐ Application Layer - Your apps"] --> B["๐Ÿš› Transport Layer - TCP or UDP"] B --> C["๐Ÿ—บ๏ธ Internet Layer - IP addresses"] C --> D["๐Ÿ›ฃ๏ธ Network Access - Physical stuff"]

TCP vs UDP - Two Types of Delivery

TCP UDP
๐Ÿ“ฌ Registered mail ๐Ÿ“ฎ Postcard
Confirms delivery No confirmation
Slower but reliable Fast but risky
Banking, email Video calls, games

๐Ÿ” TCP/IP Security

The Problem: TCP was made when everyone trusted each other. Now we need extra protection!

TCP Attacks:

  • SYN Flood: Sending thousands of โ€œhelloโ€ requests to overwhelm a server
  • Session Hijacking: Stealing someoneโ€™s conversation

Protection:

  • Firewalls filter bad traffic
  • TLS/SSL encrypts everything
  • Rate limiting stops floods

Simple Example:

Normal: Hello โ†’ Hi! โ†’ Let's talk โ†’ OK!
Attack: Hello Hello Hello Hello... (server crashes)

๐Ÿ  IP Addressing: Every House Needs an Address

Just like your home has an address, every device needs an IP address.

IPv4 Address (Old Style)

192.168.1.100
 โ”‚   โ”‚   โ”‚  โ”‚
 โ”‚   โ”‚   โ”‚  โ””โ”€โ”€ Your device (0-255)
 โ”‚   โ”‚   โ””โ”€โ”€โ”€โ”€โ”€ Your street (0-255)
 โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Your neighborhood (0-255)
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Your city (0-255)

Real Example:

  • 192.168.1.1 โ†’ Your home router
  • 8.8.8.8 โ†’ Googleโ€™s server
  • 127.0.0.1 โ†’ Yourself (localhost)

Special Address Ranges

Range Purpose
10.x.x.x Private (home/office)
172.16-31.x.x Private (companies)
192.168.x.x Private (home networks)
127.0.0.1 Yourself

๐Ÿ”ข Subnetting: Dividing Neighborhoods

What is it? Splitting a big network into smaller parts.

Simple Analogy:

  • A city has neighborhoods
  • Each neighborhood has streets
  • Each street has houses

Subnet Mask: Tells where neighborhood ends, house begins.

IP:     192.168.1.100
Mask:   255.255.255.0
        โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€
        Network    โ”‚ Host

Common Masks:

Mask Meaning Hosts
/24 (255.255.255.0) 256 addresses 254 usable
/16 (255.255.0.0) 65,536 addresses 65,534 usable
/8 (255.0.0.0) 16+ million Huge!

๐Ÿšช Ports: Doors in Your House

If IP address is your house, ports are the doors.

Common Ports to Know

graph LR A["Your Computer"] --> B["Port 80: Web HTTP"] A --> C["Port 443: Secure Web HTTPS"] A --> D["Port 22: SSH Remote Access"] A --> E["Port 25: Email SMTP"] A --> F["Port 53: DNS Names"]

Port Ranges

Range Type Example
0-1023 Well-Known 80=HTTP, 443=HTTPS
1024-49151 Registered 3306=MySQL
49152-65535 Dynamic Your browser uses these

๐Ÿ” Port Security

Danger: Open ports = open doors for hackers!

Protection:

  • Close unused ports (lock doors you donโ€™t use)
  • Use firewalls (hire a security guard)
  • Change default ports (move your door)

Simple Example:

Bad:  Port 22 open to everyone โ†’ Hackers try passwords
Good: Port 22 open only to your IP โ†’ Much safer!

๐Ÿ”„ NAT: The Magic Translator

NAT = Network Address Translation

The Problem

There arenโ€™t enough public IP addresses for every device. Your house has 10 devices but only 1 public address!

How NAT Works

graph LR A["Phone 192.168.1.2"] --> R["Router with NAT"] B["Laptop 192.168.1.3"] --> R C["TV 192.168.1.4"] --> R R --> I["Internet sees: 203.0.113.5"]

Simple Analogy:

  • Your family lives at one address
  • Mail comes to the house
  • Parents sort it to the right person

Types of NAT

Type What It Does
Static NAT 1 private = 1 public (permanent)
Dynamic NAT Pool of public IPs shared
PAT (most common) Many devices share 1 public IP

๐Ÿ” NAT Security Benefits

Good News: NAT hides your devices!

  • Outsiders only see routerโ€™s address
  • Internal IPs stay private
  • Natural โ€œfirewallโ€ effect

Example:

Hacker sees: 203.0.113.5
Reality: 50 devices hidden behind it!

๐ŸŽญ Proxy Servers: The Middle Person

A proxy is like a friend who passes messages for you.

How Proxies Work

graph LR A["You"] -->|Request| P["Proxy Server"] P -->|Request| W["Website"] W -->|Response| P P -->|Response| A

Why Use a Proxy?

Reason Example
Privacy Website sees proxy, not you
Access Control Block bad websites at work
Caching Speed up common requests
Security Filter malware

Types of Proxies

Forward Proxy: You โ†’ Proxy โ†’ Internet

  • Hides who you are
  • Used in companies to filter web access

Reverse Proxy: Internet โ†’ Proxy โ†’ Your Server

  • Hides your server
  • Used to protect web servers

๐Ÿ” Proxy Security

Benefits:

  • Hides your real IP
  • Can inspect traffic for threats
  • Blocks malicious websites

Risks:

  • Proxy can see your traffic
  • Bad proxy = data theft
  • Must trust your proxy provider

Simple Example:

Without proxy: Website knows you're at 203.0.113.5
With proxy: Website only sees proxy at 198.51.100.1

๐Ÿ›ก๏ธ Putting It All Together

The Complete Picture

graph TD Y["You at 192.168.1.5"] --> F["Firewall checks ports"] F --> N["NAT translates address"] N --> P["Proxy hides identity"] P --> I["Internet via TCP/IP"] I --> W["Website at 93.184.216.34:443"]

Security Checklist

โœ… OSI Security: Protect all 7 layers โœ… TCP/IP Security: Use TLS, firewalls โœ… IP/Subnetting: Donโ€™t expose internal IPs โœ… Port Security: Close unused ports โœ… NAT: Keeps devices hidden โœ… Proxy: Extra privacy layer


๐ŸŽฏ Key Takeaways

  1. OSI Model = 7-layer framework for network communication
  2. TCP/IP = Real protocols computers use today
  3. IP Addresses = Unique identifiers for devices
  4. Subnetting = Dividing networks into smaller pieces
  5. Ports = Doors for different services
  6. NAT = Translates private to public addresses
  7. Proxies = Middle-persons for privacy and security

๐Ÿš€ You Did It!

You now understand how computers talk to each other AND how to keep those conversations safe!

Remember: Every layer is a chance for securityโ€”and a chance for attack. Good security means protecting them all! ๐Ÿ›ก๏ธ

Loading story...

Story - Premium Content

Please sign in to view this story and start learning.

Upgrade to Premium to unlock full access to all stories.

Stay Tuned!

Story is coming soon.

Story Preview

Story - Premium Content

Please sign in to view this concept and start learning.

Upgrade to Premium to unlock full access to all content.

Interactive Preview

Interactive - Premium Content

Please sign in to view this concept and start learning.

Upgrade to Premium to unlock full access to all content.

Interactive - Premium Content

Please sign in to view this interactive content and start learning.

Upgrade to Premium to unlock full access to all interactive content.

Stay Tuned!

Interactive content is coming soon.

Cheatsheet Preview

Cheatsheet - Premium Content

Please sign in to view this concept and start learning.

Upgrade to Premium to unlock full access to all content.

Cheatsheet - Premium Content

Please sign in to view this cheatsheet and start learning.

Upgrade to Premium to unlock full access to all cheatsheets.

Stay Tuned!

Cheatsheet is coming soon.

Quiz Preview

Quiz - Premium Content

Please sign in to view this concept and start learning.

Upgrade to Premium to unlock full access to all content.

Quiz - Premium Content

Please sign in to view this quiz and test your knowledge.

Upgrade to Premium to unlock full access to all quizzes.

Stay Tuned!

Quiz is coming soon.

Flashcard Preview

Flashcard - Premium Content

Please sign in to view this concept and start learning.

Upgrade to Premium to unlock full access to all content.

Flashcard - Premium Content

Please sign in to view flashcards and reinforce your learning.

Upgrade to Premium to unlock full access to all flashcards.

Stay Tuned!

Flashcards are coming soon.