Complete guide to networking concepts – click a topic to jump
What is a network? A computer network is a set of devices (nodes) connected by communication links to share resources and information. Networks can be classified by size: PAN, LAN, MAN, WAN.
Key concepts: Data transmission, protocols (rules), addressing, switching, routing.
नेटवर्क क्या है? कंप्यूटर नेटवर्क में कई डिवाइस आपस में जुड़े होते हैं ताकि वे डेटा और संसाधन साझा कर सकें। यह LAN (छोटा क्षेत्र), MAN (शहर), WAN (देश/दुनिया) हो सकता है।
# Basic network commands (Linux/Windows) ping google.com # check connectivity ipconfig / ifconfig # show IP configuration
Topology is the arrangement of elements in a network. Common types:
टोपोलॉजी का मतलब है नेटवर्क में डिवाइस कैसे आपस में जुड़े हैं। मुख्य प्रकार: बस (एक केबल), स्टार (हब से जुड़े), रिंग (घेरा), मेश (सभी आपस में), ट्री (पेड़ जैसा)।
// No code, just conceptual diagrams
The Open Systems Interconnection (OSI) model is a conceptual framework that standardizes network communication into seven layers. Each layer performs specific functions and serves the layer above.
OSI मॉडल 7 परतों में बंटा है: फिजिकल (केबल, बिट्स), डेटा लिंक (MAC एड्रेस), नेटवर्क (IP एड्रेस), ट्रांसपोर्ट (TCP/UDP), सेशन, प्रेजेंटेशन, एप्लिकेशन (HTTP)। हर परत ऊपर वाली को सेवा देती है।
// Mnemonic: Please Do Not Throw Sausage Pizza Away // (Physical, Data Link, Network, Transport, Session, Presentation, Application)
The TCP/IP model is the practical framework used on the internet. It has four layers:
TCP/IP मॉडल इंटरनेट पर वास्तव में उपयोग होता है। इसमें 4 परतें: नेटवर्क एक्सेस, इंटरनेट (IP), ट्रांसपोर्ट (TCP/UDP), एप्लिकेशन।
// Example: HTTP (Application) over TCP (Transport) over IP (Internet) over Ethernet (Link)
Deals with transmission of raw bits over a communication channel. Defines hardware specifications: cables (coaxial, twisted pair, fiber optic), connectors, signaling (voltage levels), data rates, and topology.
यह परत बिट्स (0/1) को भेजने के भौतिक माध्यम से जुड़ी है: केबल, कनेक्टर, वोल्टेज, डेटा रेट।
// Types of cables - Twisted Pair (Ethernet) - Fiber Optic (long distance, high speed) - Coaxial (TV cable)
Responsible for node-to-node delivery. It packages data into frames, adds physical addresses (MAC addresses), handles error detection/correction, and flow control. Divided into two sublayers: LLC (Logical Link Control) and MAC (Media Access Control).
यह परत एक डिवाइस से दूसरे डिवाइस तक फ्रेम भेजने का काम करती है। MAC एड्रेस का उपयोग करती है, त्रुटियों की जाँच करती है।
# MAC address format 00:1A:2B:3C:4D:5E (6 bytes, first 3 = OUI, last 3 = device specific)
Ethernet is the most common LAN technology. It operates at the physical and data link layers. Uses CSMA/CD (Carrier Sense Multiple Access with Collision Detection) for media access. Modern Ethernet uses switches (full duplex) instead of hubs.
इथरनेट LAN में सबसे ज्यादा इस्तेमाल होने वाली तकनीक है। यह CSMA/CD का उपयोग करता था, अब स्विच के साथ फुल डुप्लेक्स में काम करता है।
// Ethernet frame (simplified) [Preamble][Destination MAC][Source MAC][Type][Data][CRC]
Handles host-to-host delivery and routing. It uses logical addresses (IP addresses) and determines the best path for packets. Key protocols: IP (Internet Protocol), ICMP, ARP, and routing protocols (RIP, OSPF).
यह परत पैकेट को स्रोत से गंतव्य तक पहुँचाने का काम करती है। इसमें IP एड्रेस होता है और रूटिंग तय होती है।
// IP packet header fields (simplified) [Version][IHL][Type of Service][Total Length][Identification][Flags][Fragment Offset][TTL][Protocol][Header Checksum][Source IP][Destination IP][Options][Data]
IPv4 addresses are 32-bit numbers, usually written in dotted decimal (e.g., 192.168.1.1). They have two parts: network and host. Classful addressing (A, B, C, D, E) and classless (CIDR). Subnet mask defines the network portion.
Special addresses: loopback (127.0.0.1), private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16).
IPv4 एड्रेस 32 बिट का होता है, जैसे 192.168.1.1। इसमें नेटवर्क और होस्ट भाग होता है। सबनेट मास्क से पता चलता है कि कितने बिट नेटवर्क के हैं।
// Example: IP 192.168.1.100 with subnet mask 255.255.255.0 (/24) Network: 192.168.1.0 Broadcast: 192.168.1.255 Hosts: 192.168.1.1 - 192.168.1.254
IPv6 uses 128-bit addresses to overcome IPv4 exhaustion. Written in hexadecimal colon format (e.g., 2001:db8::1). Features: larger address space, simpler header, built-in security (IPsec), autoconfiguration.
IPv6 128 बिट का एड्रेस है, ताकि एड्रेस खत्म न हों। यह हेक्साडेसिमल में लिखा जाता है, जैसे 2001:db8::1।
# IPv6 loopback ::1
ARP (Address Resolution Protocol): resolves IP address to MAC address on a local network.
ICMP (Internet Control Message Protocol): used for error reporting and diagnostics (e.g., ping uses echo request/reply).
ARP IP एड्रेस से MAC एड्रेस पता करता है। ICMP त्रुटि रिपोर्ट और डायग्नोस्टिक (ping) के लिए।
# View ARP cache arp -a # Ping ping 8.8.8.8
Routing protocols determine the best path for packets. Types:
रूटिंग प्रोटोकॉल पैकेट के लिए सबसे अच्छा रास्ता तय करते हैं। RIP (हॉप गिनती), OSPF (लिंक स्टेट), BGP (इंटरनेट पर)।
// Example OSPF configuration (simplified) router ospf 1 network 192.168.1.0 0.0.0.255 area 0
Provides end-to-end communication and data transfer between applications. Two main protocols:
TCP कनेक्शन ओरिएंटेड, विश्वसनीय, डेटा सही क्रम में पहुँचाता है। UDP बिना कनेक्शन के, तेज लेकिन बिना गारंटी के।
// Common port numbers HTTP: 80 (TCP) HTTPS: 443 (TCP) DNS: 53 (UDP) FTP: 21 (TCP)
Flow control: Prevents sender from overwhelming receiver. Uses sliding window protocol (window size advertised by receiver).
Congestion control: Prevents network overload. Algorithms: Slow Start, Congestion Avoidance, Fast Retransmit, Fast Recovery.
फ्लो कंट्रोल: रिसीवर की क्षमता से ज्यादा डेटा न भेजे। कंजेशन कंट्रोल: नेटवर्क में भीड़ न होने दे।
// TCP header fields (simplified) [Source Port][Destination Port][Sequence Number][Acknowledgment Number][Flags (SYN, ACK, FIN)][Window Size][Checksum][Urgent Pointer][Options][Data]
UDP is a simple, connectionless protocol. It has no handshaking, no acknowledgments, no retransmission. Used where speed is critical and some loss is acceptable (streaming, gaming, DNS).
UDP बिना कनेक्शन के डेटा भेजता है, कोई गारंटी नहीं, लेकिन तेज है। जैसे वीडियो स्ट्रीमिंग, DNS।
// UDP header (8 bytes) [Source Port][Destination Port][Length][Checksum][Data]
Provides network services to user applications. Common protocols:
एप्लिकेशन लेयर में वे प्रोटोकॉल आते हैं जिनका उपयोग यूजर करता है – HTTP (वेब), FTP (फाइल), DNS (नाम से IP), SMTP (ईमेल भेजना), POP3 (ईमेल पढ़ना)।
# Example: HTTP request GET /index.html HTTP/1.1 Host: www.example.com
DNS translates human-friendly domain names (e.g., google.com) to IP addresses. It is a hierarchical, distributed database. Record types: A (IPv4), AAAA (IPv6), CNAME (alias), MX (mail exchange), NS (name server).
DNS डोमेन नाम (जैसे google.com) को IP एड्रेस में बदलता है। यह एक वितरित डेटाबेस है।
# DNS lookup nslookup google.com dig google.com
HTTP (HyperText Transfer Protocol): used for web communication. Methods: GET, POST, PUT, DELETE. Status codes: 200 OK, 404 Not Found, 500 Internal Server Error.
HTTPS: HTTP over SSL/TLS, encrypts data for security.
HTTP वेब पेज लाने का प्रोटोकॉल है। HTTPS सुरक्षित (एन्क्रिप्टेड) वर्जन है।
// HTTP response example HTTP/1.1 200 OK Content-Type: text/html <html>...</html>
Key security concepts: confidentiality, integrity, availability. Threats: eavesdropping, man-in-the-middle, DoS. Security measures: firewalls, VPNs, encryption (TLS/SSL), authentication.
सुरक्षा में डेटा गोपनीयता, अखंडता और उपलब्धता शामिल है। फायरवॉल, VPN, एन्क्रिप्शन से बचाव करते हैं।
# Firewall rule (iptables example) iptables -A INPUT -p tcp --dport 22 -j ACCEPT # Allow SSH
हब – सभी पोर्ट पर डेटा भेजता है। स्विच – MAC एड्रेस से डेटा भेजता है। राउटर – IP एड्रेस से अलग-अलग नेटवर्क को जोड़ता है।
// Router routing table (simplified) Destination Gateway Interface 192.168.1.0 0.0.0.0 eth0 0.0.0.0 192.168.1.1 eth0
Wireless LANs use radio waves. IEEE 802.11 standards: a/b/g/n/ac/ax. Security: WEP (broken), WPA2, WPA3. Access points (AP) connect wireless devices to wired network.
वायरलेस नेटवर्क में रेडियो तरंगों का उपयोग होता है। WPA2 सुरक्षा मानक है। एक्सेस प्वाइंट वायरलेस डिवाइस को वायर्ड नेटवर्क से जोड़ता है।
# View wireless networks (Linux) iwlist wlan0 scan
Essential commands for troubleshooting:
ping – test connectivitytraceroute / tracert – show path to hostipconfig / ifconfig – IP configurationnetstat – network statisticsnslookup / dig – DNS lookuparp – ARP cacheroute – routing tableनेटवर्क समस्या सुलझाने के लिए कमांड्स: ping, traceroute, ipconfig, netstat, nslookup, arp, route.
# Examples ping -c 4 google.com traceroute google.com netstat -an | grep LISTEN