Local Server Hosting
Using Python (Simple HTTP Server)
To quickly host a local server, you can use Python’s built-in HTTP server module.
Steps
-
Open Terminal.
-
Navigate to the directory you want to serve:
-
Start the server:
- For Python 3.x:
- Access the server: Open a browser and navigate to
http://<your-local-ip>:8000
.
SSH into Your Local Server
Ensure SSH Server is Running
- Check if SSH is enabled
- Enable if it is off
- Get your local ip adress(its usually en0
- SSH into the machine
Network Structure/Organization
Basics of Networking
- IP Addresses: Unique identifiers for devices on a network.
- IPv4:
192.168.1.1
- IPv6:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
- IPv4:
- Subnets and Subnet Masks: Subdividing a network.
- Example Subnet Mask:
255.255.255.0
- Example Subnet Mask:
- DNS (Domain Name System): Translates domain names to IP addresses.
Common Networking Protocols
- HTTP/HTTPS: Web communication protocols. HTTPS is secure.
- TCP/IP: Fundamental protocol suite for the internet.
- UDP: Connectionless protocol for speed over reliability.
- SSH (Secure Shell): Securely access remote machines.
Tools and Commands
HTTP Requests
- cURL: Command-line tool for transferring data with URLs.
Network Information
- ifconfig/ip: Displays network configuratio
- ping: Tests connectivity between devices.
- traceroute: Traces the path packets take to a destination.
- netstat: Displays network connections, routing tables, interface statistics.
SSH
- SSH Commands: Connecting, copying files, running remote commands
Network Analysis
- Wireshark: GUI tool for network protocol analysis.
- tcpdump: Command-line packet analyzer.
Network Organization
Local Network Structure
- Router: Central device that connects devices within a local network.
- Switch: Device to expand the number of devices on a network.
- Subnetting: Dividing a network into smaller sub-networks.
Internet Network Structure
- ISP (Internet Service Provider): Provides internet access.
- Backbone: High-capacity data transmission lines that carry internet traffic.
- DNS Servers: Translate domain names to IP addresses.
- CDNs (Content Delivery Networks): Distribute content to reduce latency.
Advanced Topics
HTTP/2 and HTTP/3
- HTTP/2: Multiplexing, header compression, efficient use of resources.
- HTTP/3: Based on QUIC, reduced latency, improved security.
Firewalls and Security
- iptables/nftables: Tools for configuring Linux kernel firewall
- SSL/TLS: Secure communication protocols.
Programming and Network Code
- Python: Libraries like
requests
for HTTP,socket
for low-level operations.
Resources
- Books:
- “TCP/IP Illustrated” by W. Richard Stevens.
- “Networking for Systems Administrators” by Michael W. Lucas.
- Online Courses:
- Networking courses on Coursera and edX.
- Tutorials on Codecademy and Udemy.
- Documentation:
- Official docs for tools like cURL, Wireshark, tcpdump.
- RFC documents for detailed protocol specifications.