Networks & Security — DSSSB TGT CS Notes
Must-know bullets, comparisons, and MCQ traps. Concise exam focus.
1. Network Types
| Type | Scope | Example |
|---|---|---|
| LAN | Single building / campus | School lab, office |
| MAN | City / metro | Cable TV network across city |
| WAN | Countries / continents | Internet, bank branches |
| PAN | Personal (metres) | Bluetooth, USB tether |
| CAN | Campus | Multiple buildings linked |
Trap: MAN is not larger than WAN. Order by size: PAN < LAN < CAN < MAN < WAN.
2. Topologies
| Topology | Idea | Pro | Con |
|---|---|---|---|
| Bus | Single backbone cable | Cheap, simple | Cable cut = whole net down |
| Star | Central hub/switch | Easy to add nodes; fault isolation | Hub/switch failure = all down |
| Ring | Closed loop | Equal access | One break can disrupt (unless dual ring) |
| Mesh | Many/all connected | Highly reliable | Costly cabling |
| Tree | Hierarchical stars | Scalable | Root failure impact |
| Hybrid | Mix of above | Flexible | Complex design |
Exam favourite: Star is most common today (switch at centre). Full mesh needs (n(n-1)/2) links.
3. Network Devices
| Device | Layer (approx.) | Function |
|---|---|---|
| Repeater | Physical | Amplifies / regenerates signal (extends distance) |
| Hub | Physical | Broadcasts to all ports (shared collision domain) |
| Switch | Data link | Forwards by MAC; separate collision domains |
| Bridge | Data link | Connects similar LANs; filters by MAC |
| Router | Network | Routes by IP; connects different networks |
| Gateway | Multi / Application | Protocol translation between dissimilar networks |
| Modem | Physical | Modulates/demodulates (digital ↔ analog) for phone/cable |
Traps:
- Hub = dumb broadcast; Switch = MAC learning.
- Router ≠ switch (IP vs MAC).
- Gateway is broader than router (can convert protocols).
- Repeater does not filter traffic.
4. OSI 7 Layers + TCP/IP 4 Layers
OSI (bottom → top)
| # | Layer | PDU / focus | Key protocols / examples |
|---|---|---|---|
| 1 | Physical | Bits, cables, signals | RJ-45, fibre, hubs, repeaters |
| 2 | Data Link | Frames, MAC | Ethernet, PPP, switches, bridges |
| 3 | Network | Packets, routing | IP, ICMP, routers |
| 4 | Transport | Segments / datagrams | TCP, UDP |
| 5 | Session | Dialogs, sessions | RPC, NetBIOS (classic) |
| 6 | Presentation | Format, encryption, compression | SSL/TLS often mapped here/app, JPEG, ASCII |
| 7 | Application | User services | HTTP, FTP, SMTP, DNS, DHCP |
Mnemonic: Please Do Not Throw Sausage Pizza Away.
TCP/IP model (4 layers)
| TCP/IP | Maps roughly to OSI | Protocols |
|---|---|---|
| Network Access / Link | 1–2 | Ethernet, Wi-Fi |
| Internet | 3 | IP, ICMP, ARP |
| Transport | 4 | TCP, UDP |
| Application | 5–7 | HTTP, FTP, SMTP, DNS, DHCP |
Trap: OSI has 7 layers; TCP/IP commonly taught as 4 (sometimes 5 with separate physical/data link). DNS and HTTP are application layer, not transport.
5. IP Addressing Basics (IPv4)
- Address: 32 bits → 4 octets (e.g.
192.168.1.10). - Classes (legacy classful):
| Class | First octet | Default mask | Hosts (approx.) |
|---|---|---|---|
| A | 1–126 | 255.0.0.0 (/8) | ~16M |
| B | 128–191 | 255.255.0.0 (/16) | ~65K |
| C | 192–223 | 255.255.255.0 (/24) | 254 |
| D | 224–239 | — | Multicast |
| E | 240–255 | — | Experimental |
- 127.0.0.0/8 = loopback (127.0.0.1 = localhost). 0 and 255 in class A first octet historically reserved (exam often: 1–126 for A).
- Private ranges (RFC 1918):
10.0.0.0–10.255.255.255172.16.0.0–172.31.255.255192.168.0.0–192.168.255.255
- Subnet mask: separates network vs host portion. Longer prefix = more networks, fewer hosts.
- Broadcast: all host bits 1. Network ID: all host bits 0.
Trap: 172.32.x.x is not private (only 172.16–31). Class D is multicast, not “for large companies.”
6. TCP vs UDP
| TCP | UDP | |
|---|---|---|
| Connection | Connection-oriented | Connectionless |
| Reliability | ACK, retransmit | Best-effort |
| Order | Sequenced | No guarantee |
| Overhead | Higher | Lower, faster |
| Use | HTTP, FTP, SMTP, SSH | DNS (often), DHCP, streaming, VoIP |
Trap: DNS commonly uses UDP port 53 (TCP for zone transfers). “Faster” ≠ always better for file transfer.
7. Common Application Protocols
| Protocol | Port (default) | Role |
|---|---|---|
| HTTP | 80 | Web (clear text) |
| HTTPS | 443 | HTTP over TLS |
| FTP | 20 (data), 21 (control) | File transfer |
| SMTP | 25 | Send email |
| POP3 | 110 | Retrieve mail (download) |
| IMAP | 143 | Retrieve mail (server-side) |
| DNS | 53 | Name → IP |
| DHCP | 67/68 | Auto IP config |
| SSH | 22 | Secure remote shell |
| Telnet | 23 | Insecure remote (avoid) |
Traps: SMTP sends; POP/IMAP receive. HTTPS is not a separate L7 app inventing encryption alone — it uses SSL/TLS. DHCP assigns IP, mask, gateway, DNS.
8. Circuit Switching vs Packet Switching
| Circuit | Packet | |
|---|---|---|
| Path | Dedicated path for call | Packets share links |
| Resource | Reserved | On demand |
| Delay | Setup delay; then steady | Variable (queuing) |
| Example | Traditional PSTN | Internet (IP) |
| Efficiency | Wasteful if idle | Better for bursty data |
Trap: Internet uses packet switching. ATM/frame relay are packet-oriented variants (exam usually contrasts with circuit).
9. Transmission Media
Guided (wired):
- Twisted pair (UTP/STP) — cheap LAN
- Coaxial — bus/legacy cable TV
- Fibre optic — high bandwidth, EMI immune, long distance
Unguided (wireless): radio, microwave, infrared, satellite.
Comparisons: Fibre > copper for speed/distance/noise. Infrared needs LOS. Microwave is line-of-sight point-to-point.
10. Network Security Essentials
CIA triad
- Confidentiality — only authorised read (encryption, access control).
- Integrity — data not altered unnoticed (hashing, signatures).
- Availability — services usable when needed (redundancy, anti-DoS).
Firewall
- Filters traffic by rules (IP, port, protocol); can be hardware/software.
- Packet filter vs stateful vs application (proxy) — know names.
Antivirus
- Detects/removes malware (signatures + heuristics/behaviour).
Cryptography basics
| Symmetric | Asymmetric | |
|---|---|---|
| Keys | Same key encrypt/decrypt | Public + private pair |
| Speed | Fast | Slower |
| Use | Bulk data (AES) | Key exchange, signatures (RSA, ECC) |
| Problem | Key distribution | Computational cost |
Digital signature
- Sender signs with private key; anyone verifies with public key.
- Provides integrity + authenticity + non-repudiation (not confidentiality alone).
Hashing
- One-way fixed-size digest (MD5 legacy, SHA-256 etc.).
- Same input → same hash; tiny change → different hash.
- Used for integrity checks, password storage (with salt).
Trap: Hashing ≠ encryption (no decryption). Digital signature ≠ encrypting the whole message for secrecy.
Threats / attacks
- Phishing — fake sites/emails to steal credentials.
- Hacking — unauthorised access (broad term).
- DoS / DDoS — flood to deny availability.
- Malware — virus, worm, Trojan, ransomware.
- Man-in-the-middle — intercept/alter communications.
VPN
- Encrypted tunnel over public network; remote secure access to private net.
SSL / TLS
- Secure channel for apps (HTTPS uses TLS).
- Handshake establishes keys; then symmetric crypto for data.
- Provides confidentiality + integrity of the session.
Trap: SSL is older name; modern exams say TLS. VPN ≠ antivirus. Firewall does not replace patching/user awareness.
Quick MCQ Checklist
- Device layer: hub/repeater L1; switch L2; router L3.
- OSI count = 7; TCP/IP = 4.
- Private IP ranges memorise.
- TCP reliable; UDP fast/unreliable.
- SMTP send; DNS name resolution; DHCP auto config.
- Packet switching = Internet.
- CIA: Confidentiality, Integrity, Availability.
- Symmetric = one key; asymmetric = two keys.
- Sign with private; verify with public.
- HTTPS port 443; HTTP 80; DNS 53.