Though there aren’t many Q’s , in CN, but add 4-5 Q’s after each revision , Almost all
are done
Leave , not so imp , Cn , if know basics and revised well , DSA +SQL Focus
R-1: Done Upar upar se , but do once more after react
1. Basics of Networking
1. Network = Group of connected devices (computers, servers, phones).
2. Protocols: Rules for communication (HTTP, TCP, IP).
. Types of Networks:
PAN: Personal (Bluetooth).
LAN: Small/local area (home, office), Connects devices in buildings, Wired (Ethernet cables) or
Wireless (Wi-Fi), Enterprise LANs for organizations.
MAN: Covers a city.(Metropolitan Area Network) WAN: Country/continent (Internet)- Wide
area Netwo
GAN: Global via satellites.
2. IP Addressing:
1. IP Address: A logical address used to identify a device on a network
2. IPv4: 32-bit (e.g., [Link]), limited addresses.
3. IPv6: 128-bit (e.g., 2001:db8::1), huge address space.
4. Subnetting: Dividing a network into smaller parts for efficiency.
3. OSI Model (7 Layers):
J2R: All People seem to need Data Processing
Application -> Presentation ->Session ->Transport -> Network -> Data link -> Physical
Protocols at Each OSI Layer:
Application Layer
o User-facing services and applications. Browser uses HTTP/HTTPS to request the web
page.
o Protocols: HTTP/HTTPS (Hypertext Transfer Protocol), SMTP (Simple Mail Transfer
Protocol), FTP (File Transfer Protocol), DNS (Domain Name System), POP3, IMAP.
Presentation Layer
o Translates data formats, handles encryption/compression.
o Protocols: SSL (Secure Sockets Layer)/TLS (Transport Layer Security), JPEG/GIF/MPEG.
Session Layer
o Manages sessions (start, maintain, terminate communication).
o Protocols: RPC (Remote Procedure Call), SIP (Session Initiation Protocol, used in VoIP).
Transport Layer
o Ensures end-to-end delivery, reliability, flow control.
o Protocols: TCP (reliable, connection-oriented), UDP (fast, connectionless).
Network Layer
o Main job: End-to-End logical delivery (host to host) (IP Addressing) , Responsible for
(routing) → choosing best path through routers, Splits data into packets and ensures
they can move across different networks.
o Think: “How do I get from my laptop ([Link]) to Google’s server ([Link])
across the internet?”
o Protocols: IPv4/IPv6(Internet Protocol), IPsec (security), ICMP (Internet Control Message
Protocol), IPsec (security), RIP (Routing Information Protocol).
Data Link Layer:
o Main job: Node-to-Node physical delivery (hop to hop).
o Think: “How does this packet actually get from my laptop’s NIC to the router’s NIC
inside my Wi-Fi/Ethernet network?”
o Deals with frames, MAC addressing, error detection.
o Protocols: Ethernet (frame part), ARP (Address Resolution Protocol), PPP (Point-to-Point
Protocol)
Physical Layer
o Concerned with raw transmission of bits (0s and 1s).
o Protocols/Standards: Ethernet (physical part), Wi-Fi(Wireless- Fidelity), USB, Bluetooth,
radio specs, DSL(Digital Subscriber Line)
J2R: In Reverse Order “Please Do Not Try SPA”
5. TCP/IP Model (J2R: NITA -> network , Internet , Transport , Application )
How does TCP map to OSI layer: ( Just read no need to remember ) the mapping of OSI to TCP layer
Simpler 4-layer model:
Application (HTTP, DNS)
Transport (TCP/UDP)
Internet (IP, ICMP)
Network Access (Ethernet, Wi-Fi)
6. What happens when you enter [Link] in the web browser?
Below are the steps that are being followed: (First read basic, then after 1-2 Revision read whole of
the Process )
Check the browser cache first if the content is fresh and present in cache display the same.
If not, the browser checks if the IP of the URL is present in the cache of (browser and OS) if
not then request the OS to do a DNS lookup using UDP to get the IP address of the URL from
the DNS server to establish a new TCP connection.
A new TCP connection is set between the browser and the server using three-way
handshaking.
An HTTPS request is sent to the server using the TCP connection.
The web servers running on the Servers handle the incoming HTTPS request and send the
response.
The browser processes the HTTPS response sent by the server and may close the TCP
connection or reuse the same for future requests.
If the response data is cacheable then browsers cache the same.
Browser decodes the response and renders the content .
Extra: If you type [Link] →The browser will first try HTTP (unencrypted), but Google
immediately redirects you to HTTPS.
Application → HTTP, DNS, rendering, caching Transport → TCP (handshake, reliable
transfer), UDP (DNS)
Internet → IP (addressing, routing) Network Access → Ethernet/Wi-Fi (frames,
signals)
Sequence Number :
7. TCP vs UDP:
TCP: Used in web browsing, email. Connection-oriented, reliable but slower.
UDP: Used in video streaming, gaming. Connectionless, less reliable but fast.
1. MSS (Maximum Segment Size):
largest chunk of data in one TCP
segment.
2. RTT (Round Trip Time): time for a
packet to go client → server → client.
3. Timeout & Retransmission: if ACK
not received in time, resend packet.
->ACKs (Acknowledgments):
confirm receipt of packets.
4. Threshold: Called ssthresh → slow
start threshold.
It’s the cutoff point that decides whether TCP uses:
-> Slow Start (exponential growth) or
-> Congestion Avoidance (linear growth).
Uses algorithms like Slow Start, AIMD (Additive Increase Multiplicative Decrease).
Flow Control = protects the receiver. Congestion Control = protects the network.
7. IP (Internet Protocol) Address:
Definition: A logical address used to identify a device on a network.
Nature: Software-assigned, can change (dynamic or static).
Purpose: Tells where the device is located in the network (like a postal address).
J2R: Network can be very big like MAN (whole City) or whole Country (WAN) and where specifically it is located , just like pin code it is
not Exact location but an idea of the address
MAC (Media Access Control) Address: Used in Data Link Layer.
Definition: A physical/hardware address burned/hard coded into the NIC (Network Interface Card) by the manufacturer.
Nature: Permanent (though can be spoofed).
Purpose: Tells which device it is (unique identifier, like a fingerprint).
8.. Switching & Routing & Hub & Gateway:
Switch vs Router:
Switch: Connects devices within a LAN (uses MAC address).
Router: Connects different networks (uses IP address).
Hub vs Switch: Hub broadcasts to all; switch sends only to the right device .
Router vs Gateway:
Router: Connects different networks. (Router vs Gateway)
Gateway: Connects networks with different protocols.
9. DNS (Domain Name System) : Maps domain names (like [Link]) into IP addresses. Works like a phonebook for the Internet.
10. HTTP vs HTTPS: HTTP: Plain communication, not secure. Vs. HTTPS: Encrypted with SSL/TLS (secure)
11. Firewalls: Security systems that filter traffic (allow/block data). Can be hardware or software.
12. Proxy Server: Acts as an intermediary between user and Internet. Provides anonymity, caching, and access control.
13. VPN (Virtual Private Network): Creates a secure tunnel over the Internet. Encrypts data, hides IP, allows remote secure access
14. Subnet Mask: Defines which part of IP is network and which is host. Example: [Link] → first 3 blocks are network, last
block is host. People confuse it as part of the IP itself, but it’s more like a rule to separate network vs host portion.
15. ARP & RARP: ARP (Address Resolution Protocol): Finds MAC(Exact adresss) from IP(From pin Code) and vice – versa for
RARP
16. Transmission Types: Unicast: one → one. Anycast: one → nearest one. Multicast: one → many selected. Broadcast: one → all.
17. ipconfig vs ipconfig: ipconfig: Windows. vs. ifconfig: Linux/Unix/Mac.
18. ICMP: Error reporting, ping. vs. DHCP: Auto assigns IP, mask, DNS (port 67).
19. 6. Network Topologies
Bus: all devices on one line; failure breaks all. Star: central hub; easy to troubleshoot.
Ring: circular; break affects all. Mesh: each connected to many; robust, costly.
Tree: hierarchy (star + bus). Hybrid: mix for flexibility.
20. IPv4 & Classes
32-bit address, 4 octets.
Classes: A: 0–127 → Large networks B: 128–191 → Medium C: 192–223 → LANs
D: 224–239 → Multicast E: 240–255 → Research
21. Private & Special IPs
Private: A → 10.x.x.x, B → 172.16–31.x, C → 192.168.x.x. Special: 127.x.x.x = loopback/test.