Loading...
Loading...
Network: Do ya zyada devices jo communicate kar sakein aur resources share kar sakein.
Network Types: | Type | Range | Example | |------|-------|---------| | PAN | < 10m | Bluetooth, USB | | LAN | Building | Office WiFi, Ethernet | | MAN | City | City fiber network | | WAN | Country/World | Internet |
Layer 7: Application → HTTP, FTP, SMTP, DNS, SSH
Layer 6: Presentation → SSL/TLS, Encryption, JPEG, ASCII
Layer 5: Session → Session establishment, NetBIOS
Layer 4: Transport → TCP, UDP, Port numbers
Layer 3: Network → IP, Routing, ICMP
Layer 2: Data Link → Ethernet, MAC, ARP, Switches
Layer 1: Physical → Cables, WiFi, bits as signals
Mnemonic: "All People Seem To Need Data Processing"
Encapsulation (Top to Bottom):
Data → Segment (+ port) → Packet (+ IP) → Frame (+ MAC) → Bits
Features:
✅ Connection-oriented (3-way handshake)
✅ Reliable delivery (acknowledgments)
✅ Ordered delivery (sequence numbers)
✅ Flow control (sliding window)
✅ Congestion control (slow start, AIMD)
Header fields:
- Source Port (16-bit), Dest Port (16-bit)
- Sequence Number (32-bit)
- Acknowledgment Number (32-bit)
- Flags: SYN, ACK, FIN, RST, PSH
- Window Size
Three-way Handshake:
Client ──SYN(seq=x)──────────────► Server
Client ◄─SYN-ACK(seq=y, ack=x+1)── Server
Client ──ACK(ack=y+1)────────────► Server
[Connection Established]
Four-way Termination:
Client ──FIN──► Server
Client ◄──ACK── Server
Client ◄──FIN── Server
Client ──ACK──► Server
Header: Src Port, Dst Port, Length, Checksum (8 bytes total)
No connection, no reliability, just speed
Use cases:
DNS (quick lookup), DHCP, VoIP, Video streaming
Online gaming (tolerate some packet loss)
Broadcast/Multicast
DNS uses UDP port 53 for queries (fast)
TCP port 53 for zone transfers (reliable)
32-bit address: 192.168.10.25
Binary: 11000000.10101000.00001010.00011001
Classes:
A: 1-126.x.x.x /8 → 16M hosts (large org)
B: 128-191.x.x.x /16 → 65K hosts (medium org)
C: 192-223.x.x.x /24 → 254 hosts (small network)
D: 224-239 Multicast
E: 240-255 Reserved
Private ranges (not routed on internet):
10.0.0.0/8
172.16.0.0/12 (172.16.0.0 – 172.31.255.255)
192.168.0.0/16
Given: 192.168.1.0/24, need 4 subnets
Borrow 2 bits from host → /26
Subnet mask: 255.255.255.192 (11000000)
Hosts per subnet: 2^6 - 2 = 62
Subnets:
192.168.1.0/26 → hosts 1-62, broadcast .63
192.168.1.64/26 → hosts 65-126, broadcast .127
192.168.1.128/26 → hosts 129-190, broadcast .191
192.168.1.192/26 → hosts 193-254, broadcast .255
Formula: 2^n subnets (n = borrowed bits)
2^h - 2 hosts (h = remaining host bits)
128-bit: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Simplified: 2001:db8:85a3::8a2e:370:7334
~340 undecillion addresses
No NAT needed
Built-in IPSec
Simplified header (40 bytes fixed)
Algorithm: Bellman-Ford
Metric: Hop count (max 15)
Update: Every 30 seconds broadcast
Problem: Slow convergence, count-to-infinity
Used: Small networks
RIP routing table:
Dest Network | Next Hop | Hops
10.0.0.0/8 | 192.168.1.2 | 2
172.16.0.0 | 192.168.1.3 | 3
Algorithm: Dijkstra (SPF)
Metric: Cost (based on bandwidth)
Each router: knows full topology
LSA (Link State Advertisement) floods entire area
Fast convergence
OSPF Areas:
Area 0 (Backbone) — all areas connect here
ABR (Area Border Router) — connects areas
ASBR — connects to external networks
Path Vector protocol
Used between ISPs / Autonomous Systems (AS)
Internet's routing protocol
Attributes: AS-PATH, MED, LOCAL_PREF
Policy-based routing (not just shortest path)
Query: www.google.com → 142.250.195.4
Hierarchy:
Root (.) → .com → google.com → www.google.com
Resolution steps:
1. Client checks local cache
2. Query → Local DNS Resolver (ISP)
3. Resolver queries Root Server
4. Root → .com TLD Server
5. TLD → google.com Authoritative Server
6. Returns IP → cached → client
Record types:
A → IPv4 address
AAAA → IPv6 address
CNAME → Canonical name (alias)
MX → Mail exchange
NS → Nameserver
TXT → Text (SPF, verification)
HTTP Request:
GET /index.html HTTP/1.1
Host: www.example.com
User-Agent: Chrome/120
Accept: text/html
HTTP Response:
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1234
[HTML body]
Status Codes:
200 OK, 201 Created, 204 No Content
301 Moved Permanently, 302 Found (redirect)
400 Bad Request, 401 Unauthorized, 403 Forbidden
404 Not Found, 405 Method Not Allowed
500 Internal Server Error, 503 Service Unavailable
HTTP/2: multiplexing, header compression, server push
HTTP/3: QUIC (UDP-based), 0-RTT
| Attack | Description | Prevention | |--------|-------------|-----------| | DDoS | Flood with traffic | CDN, rate limiting | | ARP Spoofing | Fake ARP replies, MITM | Dynamic ARP Inspection | | DNS Spoofing | Fake DNS responses | DNSSEC | | SYN Flood | Half-open connections | SYN cookies | | Packet Sniffing | Capture traffic | Encryption (TLS) |
Firewall: traffic filtering by rules
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP
IDS (Intrusion Detection System): detect & alert
IPS (Intrusion Prevention System): detect & block
WAF (Web Application Firewall): HTTP-level filtering
Q: NAT kya hai aur kyun use karte hain? A: Network Address Translation — private IP ko public IP mein translate karta hai. IPv4 address shortage solve karta hai. Router pe hota hai. SNAT, DNAT, PAT (port-based).
Q: Ping command kya check karta hai?
A: ICMP Echo Request bhejta hai, Echo Reply wait karta hai. Connectivity test, RTT (Round Trip Time) measure, packet loss detect. ping 8.8.8.8 Google DNS test karta hai.
Q: Traceroute kaise kaam karta hai? A: TTL (Time To Live) ko 1 se badhata hai. Har router TTL decrement karta hai. TTL=0 pe ICMP Time Exceeded bhejta hai — router ka IP pata chalta hai. Poora path map ho jaata hai.
Complete Computer Networks notes for B.Tech IT Sem 4 — OSI Model, TCP/IP, IP Addressing, Subnetting, Routing Protocols, DNS, HTTP, Network Security with viva Q&A.
46 pages · 2.3 MB · Updated 2026-03-11
OSI 7 layers (Application, Presentation, Session, Transport, Network, Data Link, Physical) — theoretical reference model. TCP/IP 4 layers practical implementation. Application layer = OSI ki top 3, Network Access = OSI ki bottom 2.
TCP: connection-oriented, reliable, ordered delivery, flow/congestion control, slow. UDP: connectionless, unreliable, fast, no overhead. TCP: web, email, FTP. UDP: video streaming, DNS, gaming, VoIP.
CIDR notation: 192.168.1.0/24 — /24 means 24 bits network. Host bits = 32-24 = 8, hosts = 2^8 - 2 = 254. Subnet mask = 255.255.255.0. Subnetting: /24 ko /26 mein divide = 4 subnets of 62 hosts each.
ARP (Address Resolution Protocol) IP address se MAC address dhundhta hai. Broadcast: 'Who has IP 192.168.1.10?' → Owner responds with MAC. Cache mein store hota hai.
TCP connection establishment: Client → SYN → Server → SYN-ACK → Client → ACK. Ab data transfer start. Connection terminate: FIN, FIN-ACK, ACK exchange.
Operating System Complete Notes + Viva Questions — IT Sem 4
Operating System
Digital Electronics — Complete Notes IT Sem 1
Digital Electronics
Java Programming — Complete Notes for B.Tech IT Semester 3
Java Programming
Web Technologies — HTML, CSS, JavaScript, Node.js Complete Notes
Web Technologies
Cloud Computing Notes — B.Tech IT Sem 5
Cloud Computing
Your feedback helps us improve notes and tutorials.