BCS603 / KCS603 · BTech Sem VI

Computer
Networks

Complete exam-focused notes based on syllabus analysis and PYQ patterns (2023-24 & 2024-25)

Unit I — Physical Layer Unit II — Data Link Unit III — Network Unit IV — Transport Unit V — Application
01Intro & Physical Layer 02Data Link & MAC 03Network Layer 04Transport Layer 05Application Layer
Unit I · 8 Lectures
Introductory Concepts & Physical Layer
OSI model, TCP/IP, topologies, transmission media, switching techniques
OSI Reference Model ★ VERY HIGH
What is the OSI Model?

The Open Systems Interconnection model is a conceptual framework developed by ISO that divides network communication into 7 distinct layers. Each layer has specific responsibilities and communicates with the layers directly above and below it. The key principle is encapsulation — data is wrapped with headers at each layer on the sending side and unwrapped (de-encapsulated) at each layer on the receiving side.

LAYER 7 Application LAYER 6 Presentation LAYER 5 Session LAYER 4 Transport LAYER 3 Network LAYER 2 Data Link LAYER 1 Physical PDU Data Data Data Segment Packet Frame Bits KEY PROTOCOLS / DEVICES HTTP, FTP, DNS, SMTP, Telnet SSL/TLS, JPEG, MPEG, ASCII NetBIOS, RPC, PPTP TCP, UDP → Gateway IP, ICMP, ARP, OSPF → Router Ethernet, 802.11, PPP → Switch, Bridge Cables, Radio, Hubs, NIC → Hub, Repeater LAYER 7 Application LAYER 6 Presentation LAYER 5 Session LAYER 4 Transport LAYER 3 Network LAYER 2 Data Link LAYER 1 Physical SENDER RECEIVER Physical transmission medium (cable / wireless) ENCAPSULATION ▼ DE-ENCAPSULATION ▲
Application (7)
User interface. Provides services like web browsing, email, file transfer. Protocols: HTTP, FTP, SMTP, DNS.
Presentation (6)
Data translation, encryption/decryption, compression. Ensures data is in readable format (JPEG, MPEG, ASCII).
Session (5)
Manages sessions (dialog control). Establishes, maintains, terminates connections between apps.
Transport (4)
End-to-end delivery, segmentation, error recovery, flow control. Protocols: TCP (reliable), UDP (fast).
Network (3)
Logical addressing (IP), routing, path determination. Devices: Router. Protocols: IP, ICMP, ARP.
Data Link (2)
Physical addressing (MAC), framing, error detection, flow control. Devices: Switch, Bridge.
Physical (1)
Raw bit transmission — electrical/optical/radio signals. Defines cables, connectors, signal voltage. Devices: Hub, Repeater, NIC.
Mnemonic: "Please Do Not Throw Sausage Pizza Away" → Physical, Data Link, Network, Transport, Session, Presentation, Application (bottom to top)
TCP/IP Model vs OSI Model PYQ 2023-24
OSI MODEL (7 Layers) Application Presentation Session Transport Network Data Link Physical TCP/IP MODEL (4 Layers) APPLICATION LAYER HTTP · FTP · DNS · SMTP · Telnet (combines OSI 5, 6, 7) TRANSPORT LAYER TCP · UDP INTERNET LAYER IP · ICMP · ARP · RARP NETWORK ACCESS LAYER Ethernet · WiFi · Physical medium (combines OSI 1 & 2)
FeatureOSI ModelTCP/IP Model
Layers74
Developed byISO (1984)DARPA (1970s)
TypeReference model (theoretical)Implementation model (practical)
ProtocolProtocol independentProtocol specific (TCP/IP suite)
Application layer3 separate layers (5,6,7)Single Application layer
UsageTroubleshooting, teachingInternet (real-world)
Network Topologies PYQ Both Years
BUS Single backbone ✓ Easy to install ✗ Single point failure STAR SW ✓ Easy fault detect ✗ Hub = single failure RING ✓ Equal access ✗ One break = full fail MESH (Full) Links = n(n-1)/2 ✓ Highly reliable ✗ Expensive wiring TREE ✓ Hierarchical ✗ Root = single fail
MESH TOPOLOGY — PYQ 2024-25 (2 marks)
Links = n(n-1) / 2
For n = 10 nodes: Links = 10 × 9 / 2 = 45 links
I/O ports per node = n - 1 = 9 ports
Switching Techniques
Circuit Switching
Dedicated path established before data. Used in telephone networks. Phases: connection setup → data transfer → teardown. Wasteful if no data to send.
Packet Switching
Data split into packets. Each routed independently. Two types: Datagram (each packet independent) and Virtual Circuit (path pre-established). Used in Internet.
Message Switching
Entire message stored at each node before forwarding (store-and-forward). No dedicated path. Used in email. Slower than packet switching.
Transmission Delay & Latency PYQ 2024-25
TOTAL LATENCY FORMULA — PYQ 2024-25 (7 marks numerical)
Total Latency = Propagation Delay + Transmission Delay + Queuing Delay + Processing Delay

Propagation Delay = Distance / Propagation Speed
Transmission Delay = Message Size / Bandwidth

PYQ Solution: 4 MB frame, 1000 km, 2 Mbps, 5 routers (1μs + 2μs each)
Transmission = (4×8×10⁶) / (2×10⁶) = 16 s
Propagation = 1000×10³ / (2×10⁸) = 0.005 s
Router delays = 5 × (1 + 2) μs = 0.000015 s
Total ≈ 16.005015 s
SIGNAL ATTENUATION — PYQ 2024-25
Attenuation (dB) = 10 · log₁₀(P_out / P_in)
−3 dB ≈ half the power
PYQ: P_in = 2W, attenuation = −3 dB
P_out = 2 × 10^(−3/10) = 2 × 0.501 ≈ 1.002 W ≈ 1 W
Unit II · 8 Lectures
Data Link Layer & MAC
Framing, error detection, flow control, ALOHA, CSMA, bridges, LAN standards
CRC — Cyclic Redundancy Check ★ BOTH YEARS
How CRC Works

CRC is a powerful error detection technique. The sender appends a checksum (remainder) to the data. The receiver performs the same division — if remainder ≠ 0, an error occurred. The "generator polynomial" acts as the divisor. Division uses XOR, not regular subtraction.

  • Represent data as binary: Convert the polynomial/bit stream to binary. x⁸+x⁶+x³+x²+x+1 → 1 0 1 0 0 1 1 1 1
  • Append zeros: Append (degree of generator) zeros to the message. Generator x⁴+x²+x+1 → degree 4, so append 4 zeros.
  • XOR division: Divide augmented message by generator using binary XOR. Bring down bits one by one just like long division.
  • Get remainder (CRC): The remainder after division is the CRC checksum — append it to the original message.
  • Receiver check: Receiver divides received codeword by generator. If remainder = 0000 → no error. If ≠ 0 → error detected.
  • PYQ 2024-25 — CRC EXAMPLE (7 marks)
    Message : x⁸+x⁶+x³+x²+x+1 → 1 0 1 0 0 1 1 1 1
    Generator : x⁴+x²+x+1 → 1 0 1 1 1
    Append 4 zeros → Dividend: 1 0 1 0 0 1 1 1 1 0 0 0 0

    Perform XOR long division → Get 4-bit remainder (CRC)
    Transmitted codeword = Original message + CRC remainder

    Error detection: Invert the 3rd bit, then divide at receiver.
    Non-zero remainder → Error detected ✓
    Key Point: CRC can detect all single-bit errors, all double-bit errors, all odd number of errors, and all burst errors shorter than the generator polynomial degree.
    Flow Control — ARQ Protocols PYQ 2023-24
    STOP & WAIT ARQ Sender Receiver Frame 0 → ← ACK 0 Frame 1 → idle GO-BACK-N ARQ (Window=4) Sender Receiver 0 → 1 → 2 → 3 → LOST ← NAK 3 3,4,5... re-sent → Efficiency: η = W/(1+2a) W = window size a = Tp/Tt
    ProtocolWindow SizeOn ErrorEfficiency
    Stop & Wait1Retransmit 1 frameLow — sender idle waiting for ACK
    Go-Back-NUp to 2ⁿ⁻¹Retransmit from error frame onwardBetter — W/(1+2a)
    Selective RepeatUp to 2ⁿ⁻¹Retransmit only lost frameBest — most efficient
    Piggybacking: When node B receives a frame from A and also has data to send back, B's acknowledgment (ACK) is attached to (piggybacked on) the outgoing data frame. This saves bandwidth by combining ACK + data in one frame instead of sending ACK separately. PYQ 2024-25
    ALOHA Protocols ★ BOTH YEARS
    PURE ALOHA A: B: C: Frame A Frame B COLLISION retransmit A retransmit B Frame C ✓ S = G·e^(-2G) Max throughput ≈ 18.4% (at G = 0.5) SLOTTED ALOHA ▼ Slot boundaries — stations may only transmit at slot start t1 t2 t3 t4 A: Frame A ✓ B: Frame B ✓ C: Frame C ✓ S = G·e^(-G) Max throughput ≈ 36.8% (at G = 1)
    PYQ 2024-25 — SLOTTED ALOHA NUMERICAL (7 marks)
    Given: 10% of slots are idle → P(idle) = 0.10
    P(idle) = e^(-G) → 0.10 = e^(-G) → G = -ln(0.10) ≈ 2.303

    (i) Channel load G ≈ 2.303
    (ii) Throughput S = G·e^(-G) = 2.303 × 0.10 ≈ 0.23 = 23%
    CSMA/CD vs CSMA/CA: CSMA/CD (Collision Detection) used in wired Ethernet — station listens while transmitting and stops on collision. CSMA/CA (Collision Avoidance) used in wireless (802.11 WiFi) — cannot detect collision so avoids it using backoff and RTS/CTS.
    Bridge & Spanning Tree PYQ 2023-24
    How a Learning Bridge Works

    A bridge connects two LAN segments at the Data Link layer. It maintains a forwarding table (MAC address → port mapping). When a frame arrives, it reads the source MAC and records it. Then checks the destination MAC: if found → forward to correct port (filtering); if not found → flood (broadcast to all ports). This self-learning process eliminates the need for manual configuration.

    Spanning Tree Algorithm (STA): Used to eliminate loops in networks with multiple bridges. One bridge is elected as Root Bridge (lowest Bridge ID). A shortest-path tree is built from root to all other bridges. Ports not on the tree are blocked. This prevents broadcast storms while maintaining redundancy.
    Unit III · 8 Lectures
    Network Layer
    IP addressing, subnetting, ARP/DHCP/ICMP, routing algorithms, IPv6
    IPv4 Header Format PYQ 2023-24
    IPv4 DATAGRAM HEADER (Minimum 20 bytes = 160 bits) VERSION 4 bits IHL 4 bits TYPE OF SERVICE (TOS) 8 bits TOTAL LENGTH 16 bits (max 65,535 bytes) IDENTIFICATION 16 bits — identifies fragments of same datagram FLAGS 3 bits FRAGMENT OFFSET 13 bits TTL 8 bits (hop limit) PROTOCOL 8 bits (TCP=6, UDP=17) HEADER CHECKSUM 16 bits — error detection of header only SOURCE IP ADDRESS — 32 bits (e.g. 192.168.1.1) DESTINATION IP ADDRESS — 32 bits OPTIONS (if IHL > 5) + PADDING (variable) DATA (Payload — up to 65,515 bytes) Key Fields: VERSION: 4 for IPv4 IHL: Header length in 32-bit words TTL: Decremented at each hop FLAGS: DF (Don't Fragment), MF PROTOCOL: Next layer protocol CHECKSUM: Header error check only
    Subnetting & CIDR ★ PYQ 2024-25
    Subnetting Concept

    Subnetting divides a large IP address block into smaller sub-networks. Borrowing bits from the host part increases the network prefix. Each borrowed bit doubles the number of subnets (halves hosts per subnet). CIDR (Classless Inter-Domain Routing) allows arbitrary prefix lengths like /26 instead of strict class boundaries.

    PYQ 2024-25 — 192.168.10.0/24 divided into 4 subnets (7 marks)
    Need 4 subnets → borrow 2 bits (2² = 4) → new prefix = /26
    Hosts per subnet = 2⁶ - 2 = 62 usable hosts

    Subnet 1: 192.168.10.0 – 192.168.10.63 (Network: .0, Broadcast: .63)
    Subnet 2: 192.168.10.64 – 192.168.10.127 (Network: .64, Broadcast: .127)
    Subnet 3: 192.168.10.128 – 192.168.10.191 (Network: .128, Broadcast: .191)
    Subnet 4: 192.168.10.192 – 192.168.10.255 (Network: .192, Broadcast: .255)

    Subnet mask for /26 = 255.255.255.192
    ARP, RARP, DHCP, ICMP PYQ 2024-25
    ARP — Address Resolution Protocol
    Resolves IP address → MAC address. Sender broadcasts "Who has IP X?" — Owner replies with its MAC. ARP table cached for efficiency. Used within same subnet only.
    RARP — Reverse ARP
    Resolves MAC address → IP address. Used by diskless workstations that know their MAC but not IP. Now replaced by DHCP/BOOTP.
    DHCP — Dynamic Host Config
    Automatically assigns IP, subnet mask, gateway, DNS to hosts. Process: DISCOVER → OFFER → REQUEST → ACK (DORA). Leases IPs for a time period.
    ICMP — Internet Control Message
    Reports errors and diagnostics. Used by ping (Echo Request/Reply) and traceroute (TTL exceeded). Not for data delivery — only control messages.
    Distance Vector Routing ★ BOTH YEARS
    Bellman-Ford Algorithm

    Each router maintains a routing table (distance vector) listing the best known distance to every other router and the next hop. Periodically, routers share their tables with neighbours. On receiving a neighbour's table, update own table: new_cost = cost_to_neighbour + neighbour's_cost_to_dest. Pick the minimum. Used by RIP protocol.

    PYQ 2024-25 — DISTANCE VECTOR NUMERICAL (7 marks)
    Router C receives:
    From B (delay to C = 6): vector (5, 0, 8, 12, 6, 2) → A,B,C,D,E,F
    From D (delay to C = 3): vector (16,12, 6, 0, 9, 10)
    From E (delay to C = 5): vector (7, 6, 3, 9, 0, 4)

    C's new delay to A = min(6+5, 3+16, 5+7) = min(11,19,12) = 11 via B
    C's new delay to B = min(6+0, 3+12, 5+6) = min(6,15,11) = 6 via B
    C's new delay to D = min(6+12,3+0,5+9) = min(18,3,14) = 3 via D
    C's new delay to E = min(6+6, 3+9, 5+0) = min(12,12,5) = 5 via E
    C's new delay to F = min(6+2, 3+10,5+4) = min(8,13,9) = 8 via B
    Count-to-Infinity Problem: In DVR, if a link fails, routers keep advertising stale (outdated) routes — the distance count increases to infinity before routers realize the destination is unreachable. Fix: Split Horizon (don't advertise a route back to the router you learned it from) or Poison Reverse (advertise broken routes with infinite metric).
    IPv6 Features PYQ 2024-25
    Larger Address Space
    128-bit addresses (vs 32-bit IPv4). Written as 8 groups of 4 hex digits. Virtually unlimited addresses — 340 undecillion.
    Simplified Header
    Fixed 40-byte header (vs variable IPv4). No checksum (done by transport layer). No fragmentation by routers — only end hosts. Faster processing.
    Extension Headers
    Optional features (routing, fragmentation, authentication) moved to extension headers chained after main header. Each has "Next Header" field pointing to next extension.
    Other Improvements
    Built-in IPSec security, autoconfiguration (SLAAC), better multicast, anycast support, no NAT needed, flow labels for QoS.
    Unit IV · 8 Lectures
    Transport Layer
    TCP, UDP, connection management, congestion control, flow control
    TCP Segment Header ★ BOTH YEARS
    TCP SEGMENT HEADER (Minimum 20 bytes) SOURCE PORT 16 bits DESTINATION PORT 16 bits SEQUENCE NUMBER — 32 bits (byte ordering for reassembly) ACKNOWLEDGMENT NUMBER — 32 bits (next expected byte) DATA OFFSET 4 bits RESV 6 bits CONTROL FLAGS — 6 bits URG · ACK · PSH · RST · SYN · FIN WINDOW SIZE 16 bits (flow control) CHECKSUM 16 bits — header + data error detection URGENT POINTER 16 bits (valid when URG flag set) OPTIONS + PADDING (variable, multiple of 32 bits) Flag Bits: SYN — Synchronize sequence # ACK — Acknowledgment valid FIN — No more data to send RST — Reset the connection PSH — Push data immediately URG — Urgent data present
    TCP Connection Management — 3-Way Handshake ★ BOTH YEARS
    CLIENT SERVER CLOSED LISTEN SYN (seq = x) SYN_SENT state ① SYN+ACK (seq=y, ack=x+1) SYN_RECEIVED state ② ACK (ack = y+1) ESTABLISHED ③ ESTABLISHED ESTABLISHED Connection establishment complete — data transfer can begin CLOSED→ SYN_SENT →ESTABLISHED
    4-Way Termination (Connection Release): FIN → ACK → FIN → ACK. Either side can initiate. After sending FIN, enters TIME_WAIT state (waits 2×MSL) to ensure all packets are delivered before closing.
    Congestion Control — Leaky Bucket & Token Bucket ★ BOTH YEARS
    LEAKY BUCKET pkt pkt pkt Bursty input ← OVERFLOW (if bucket full, packets dropped) Fixed rate output Smooths traffic — always constant TOKEN BUCKET Token generator r tokens/sec Variable rate (bursty allowed!) Can transmit if token available
    FeatureLeaky BucketToken Bucket
    Output rateConstant (fixed rate)Variable (bursty allowed up to token count)
    Burst trafficNot allowed — excess droppedAllowed if tokens available
    Use caseStrict rate limiting (VoIP)Flexible rate with burst (most networks)
    Token conceptNo tokensTokens generated at rate r; bucket capacity b
    Max burstNoneb (bucket size = max burst size)
    Silly Window Syndrome: TCP sends tiny segments, wasting header overhead. Nagle's Algorithm (Sender fix): Buffer small data, send only when window ≥ MSS or previous ACK received. Clark's Algorithm (Receiver fix): Don't send window update until window ≥ MSS or half the buffer is free. PYQ 2024-25
    TCP vs UDP
    FeatureTCPUDP
    ConnectionConnection-oriented (3-way handshake)Connectionless
    ReliabilityReliable — ACK, retransmissionUnreliable — no guarantee
    OrderingIn-order delivery guaranteedNo ordering
    SpeedSlower (overhead)Faster (low overhead)
    Use caseHTTP, FTP, SMTP, SSHDNS, DHCP, VoIP, Video streaming, Gaming
    Header size20–60 bytes8 bytes (fixed)
    Unit V · 8 Lectures
    Application Layer
    DNS, HTTP, FTP, email protocols, SNMP, cryptography, RSA
    DNS — Domain Name System PYQ 2024-25
    How DNS Works

    DNS is the Internet's "phone book" — it translates human-readable domain names (www.google.com) to IP addresses (142.250.82.46). DNS is hierarchical and distributed. The hierarchy: Root → TLD (.com, .in) → Second-level (google) → Subdomain (www). Resolution is recursive (client asks resolver, resolver asks root, then TLD, then authoritative server) or iterative.

    CLIENT www.google.com? Local DNS Resolver ①query Root DNS Server 13 root server clusters TLD Server (.com) Top-level domain server Authoritative DNS google.com DNS server ② ③ref. ④ ⑤ref. ⑥ ⑦IP ⑧ IP addr DNS Resource Records A — Maps name → IPv4 addr AAAA — Maps name → IPv6 addr MX — Mail exchanger NS — Name server CNAME — Alias / canonical name PTR — Reverse DNS (IP → name)
    RSA Cryptography ★ BOTH YEARS
    Public Key Cryptography

    Each user has a key pair: Public key (shared with everyone) and Private key (kept secret). What is encrypted with the public key can only be decrypted by the corresponding private key, and vice versa. Eliminates the key distribution problem of symmetric cryptography.

    Advantages: No shared secret needed, digital signatures possible, scalable for N users.
    Disadvantages: Computationally expensive, vulnerable to man-in-the-middle without PKI, key management required.

    ALICE Plaintext M wants to send ENCRYPT C = Mᵉ mod n Bob's PUBLIC key (e,n) C (ciphertext) ✓ unreadable in transit DECRYPT M = Cᵈ mod n Bob's PRIVATE key (d,n) BOB Gets M ✓
    RSA ALGORITHM STEPS — PYQ BOTH YEARS
    Step 1: Choose two large primes p and q
    Step 2: n = p × q (modulus)
    Step 3: φ(n) = (p − 1)(q − 1) (Euler's totient)
    Step 4: Choose e: 1 < e < φ(n) and gcd(e, φ(n)) = 1
    Step 5: Find d: d × e ≡ 1 (mod φ(n)) [using Extended Euclidean Algorithm]
    Step 6: Public Key = (e, n), Private Key = (d, n)
    Step 7: Encrypt: C = Mᵉ mod n
    Step 8: Decrypt: M = Cᵈ mod n

    Example: p=3, q=11 → n=33, φ(n)=20, e=7 (gcd(7,20)=1)
    d × 7 ≡ 1 (mod 20) → d = 3 (since 3×7=21≡1 mod 20)
    Encrypt M=2: C = 2⁷ mod 33 = 128 mod 33 = 29
    Decrypt C=29: M = 29³ mod 33 = 24389 mod 33 = 2 ✓
    SNMP — Simple Network Management Protocol ★ BOTH YEARS
    SNMP Components
    Manager (NMS): Central station that monitors network. Polls agents, receives traps, queries MIB.

    Agent: Software on managed device (router, switch). Maintains MIB, responds to manager.

    MIB (Management Information Base): Hierarchical database of managed objects (variables) on each device.
    SNMP PDU Operations
    GetRequest: Manager requests value of MIB object from agent.
    GetNextRequest: Get next object in MIB tree.
    SetRequest: Manager sets value of MIB object.
    GetResponse: Agent replies to Get/Set requests.
    Trap: Agent sends unsolicited alert to manager (e.g. link down, cold start).
    Key Application Protocols PYQ Both Years
    ProtocolPortTransportPurposeKey Feature
    HTTP80TCPWeb pages transferStateless; uses GET, POST, PUT methods
    HTTPS443TCPSecure webHTTP over SSL/TLS encryption
    FTP21 (ctrl), 20 (data)TCPFile transferTwo connections: control + data channel
    SMTP25TCPSend emailPush protocol; uses MIME for multimedia
    POP3110TCPReceive emailDownloads and deletes from server
    IMAP4143TCPReceive emailKeeps mail on server; supports folders
    DNS53UDP (mainly)Name resolutionHierarchical distributed database
    DHCP67/68UDPIP auto-assignmentDORA process (Discover-Offer-Request-ACK)
    Telnet23TCPRemote loginUnencrypted — use SSH instead
    SNMP161/162UDPNetwork managementManager-Agent model, MIB database
    SMTP & MIME: SMTP was originally text-only. MIME (Multipurpose Internet Mail Extensions) extends it to handle images, audio, video, and binary files by encoding them in Base64 and adding Content-Type headers. This is how email attachments work. PYQ 2024-25
    IMAP4 vs POP3: POP3 downloads mail and deletes from server — works offline but no sync across devices. IMAP4 keeps mail on server, supports folders, flags, partial download — better for multiple devices. PYQ 2024-25
    Data Compression PYQ Both Years
    Lossless Compression
    Original data recovered perfectly after decompression. Used for text, executables. Algorithms: Huffman coding (variable-length codes based on frequency), LZW (Lempel-Ziv-Welch used in GIF/ZIP), Run-length encoding.
    Lossy Compression
    Some data discarded — cannot recover original. Used for images, audio, video where slight quality loss is acceptable. Algorithms: JPEG (images), MP3 (audio), MPEG (video). Much higher compression ratios.
    HUFFMAN CODING — Basic Concept
    More frequent symbols → shorter codes
    Less frequent symbols → longer codes
    Build binary tree bottom-up from frequency table
    Left edge = 0, Right edge = 1
    Result: No code is a prefix of another (prefix-free code)
    Average code length = Σ(frequency × code_length)
    Quick Exam Formula Sheet
    MESH LINKS
    n(n-1)/2
    PURE ALOHA
    S = G·e^(-2G) max ≈ 18.4%
    SLOTTED ALOHA
    S = G·e^(-G) max ≈ 36.8%
    ATTENUATION
    dB = 10·log₁₀(P_out/P_in)
    TOTAL LATENCY
    Prop + Trans + Queue + Process
    RSA ENCRYPT/DECRYPT
    C = Mᵉ mod n | M = Cᵈ mod n
    SUBNETTING (4 subnets from /24)
    /24 → borrow 2 bits → /26
    DISTANCE VECTOR
    D(x,y) = min{c(x,v) + D(v,y)}
    Unit I — Deep Dive
    Transmission Media, Encoding & Multiplexing
    Guided vs unguided media, signal encoding, TDM/FDM/WDM multiplexing
    Transmission Media Classification
    Twisted Pair (UTP/STP)
    Two insulated copper wires twisted together to reduce EMI. UTP = Unshielded, STP = Shielded. Categories: Cat5e (1 Gbps), Cat6 (10 Gbps up to 55m). Most common for LAN wiring (RJ-45 connector). Cost-effective, easy to install. Susceptible to crosstalk and external interference.
    Coaxial Cable
    Central copper conductor surrounded by insulation, braided metal shield, outer plastic jacket. Better noise immunity than UTP. Used in cable TV (75Ω) and old 10Base2/10Base5 Ethernet (50Ω). Higher bandwidth than twisted pair. More expensive and harder to install.
    Fiber Optic
    Transmits light pulses through glass/plastic core via total internal reflection. Single-mode: one light path, long distance (100+ km), laser source. Multi-mode: multiple paths, short distance, LED source. Immune to EMI, no crosstalk, highest bandwidth (100+ Gbps), lightest, but most expensive.
    MediumMax BandwidthMax DistanceAttenuationCostUse Case
    UTP1–10 Gbps100 mHighLowLAN, telephone
    Coaxial10 Gbps500 mMediumMediumCable TV, old LAN
    Single-mode Fiber100+ Gbps100+ kmVery LowHighWAN, backbone, ISP
    Multi-mode Fiber10 Gbps2 kmLowMedium-HighCampus LAN, data centers
    Radio (WiFi)9.6 Gbps~100 m indoorsHigh (obstacles)LowWLAN, mobile
    MicrowaveGbps~50 km (LOS)MediumMediumBackhaul, point-to-point
    SatelliteMbpsGlobalHighHighRemote areas, GPS
    Signal Encoding Schemes
    Encoding1 represented as0 represented asAdvantageDisadvantage
    NRZ-LHigh voltageLow voltageSimpleDC component, sync issues on long same-bit runs
    NRZ-ITransition at bit startNo transitionNo baseline wander from 1-stringsLong 0 strings lose sync
    ManchesterLow→High mid-bitHigh→Low mid-bitSelf-clocking (sync always present)Requires double bandwidth
    Diff. ManchesterNo transition at bit startTransition at bit startNoise resistant, polarity independentComplex decoding
    AMI (Bipolar)Alternating +V and −VZero voltageNo DC component, error detection if lone zeroLong 0-strings lose sync
    4B/5BEvery 4 data bits mapped to 5-bit code (no more than 1 leading 0 or 2 trailing 0s)Guarantees transitions for sync20% overhead
    Why Manchester Encoding is used in Ethernet: Every bit has a transition in the middle (Low→High for 1, High→Low for 0). This built-in transition allows the receiver to recover the clock signal from the data itself — no separate clock wire needed. Used in 10Base-T Ethernet.
    Multiplexing — FDM, TDM, WDM, CDMA
    FDM — Frequency Division Multiplexing
    Divides total bandwidth into frequency sub-bands. Each user gets a dedicated, non-overlapping band. Guard bands between channels prevent interference. Simultaneous transmission — all channels transmit at same time. Analog. Used in: AM/FM radio, cable TV, ADSL (different upload/download bands), traditional telephone (POTS).
    TDM — Time Division Multiplexing
    Divides time into slots. Each user gets a slot per frame. All users share full bandwidth but at different moments. Digital. Synchronous TDM: fixed slots assigned even if user has no data (wasteful). Statistical TDM: slots assigned on demand (more efficient). Used in: T1/E1 lines, SONET/SDH, ISDN.
    WDM — Wavelength Division Multiplexing
    Multiplexing over fiber optic cables using different light wavelengths (colors). DWDM (Dense WDM) carries 160+ channels on a single fiber pair. Each wavelength is essentially a separate FDM channel. Terabit/s capacity. Used in long-distance backbone networks between cities and continents.
    CDMA — Code Division Multiple Access
    All users transmit simultaneously on the same frequency band. Each user's data is multiplied by a unique orthogonal spreading code (chip sequence). Receiver uses the same code to extract intended signal. Used in: 3G mobile networks (WCDMA), GPS, military communications. Highly resistant to jamming and interference.
    Unit II — Deep Dive
    Error Detection, LAN Standards & MAC Deep Dive
    Parity, checksum, Hamming code, CSMA variants, Ethernet frame, LAN standards
    Error Detection — All Methods Compared
    Simple Parity Check (VRC)
    Adds 1 bit so total 1-bits = even (even parity) or odd (odd parity).

    Example: 1010001 → three 1s → add parity bit 1 → 10100011 (even parity).

    Detects: All single-bit errors, all odd-number errors.
    Misses: Even number of errors (2, 4…).
    2D Parity (LRC+VRC)
    Organise data as a 2D matrix. Add parity bit per row (VRC) and per column (LRC). Much stronger coverage.

    Detects: All 1, 2, and 3-bit errors; most burst errors.
    Misses: Specific 4-bit patterns in 2×2 corners.
    Internet Checksum
    Used by TCP, UDP, IP. Sender: add all 16-bit words (1's complement arithmetic) → complement → attach. Receiver: sum all including checksum → should be all 1s (FFFF).

    Advantage: Simple, software-efficient.
    Weakness: Can miss some errors CRC would catch.
    HAMMING CODE — SINGLE BIT ERROR CORRECTION
    Minimum redundancy bits r: 2ʳ ≥ m + r + 1 (m = data bits)
    For m=4: r=3 gives 2³=8 ≥ 4+3+1=8 ✓ → Total codeword = 7 bits

    Redundancy bit positions: powers of 2 → positions 1, 2, 4
    Data bit positions: 3, 5, 6, 7

    Each parity bit covers positions whose binary representation has that bit set:
    P1(pos1): covers 1,3,5,7 → P2(pos2): covers 2,3,6,7 → P4(pos4): covers 4,5,6,7

    Error detection: Compute syndrome = XOR of positions of all failing parity bits
    Syndrome value = exact bit position of error → flip that bit to correct
    CSMA/CD vs CSMA/CA — Detailed Comparison
    FeatureCSMA/CD (802.3 Ethernet)CSMA/CA (802.11 WiFi)
    Full formCarrier Sense Multiple Access / Collision DetectionCarrier Sense Multiple Access / Collision Avoidance
    MediumWired (can measure signal on wire)Wireless (cannot detect collision — half-duplex, own signal drowns received)
    Collision handlingDetect collision while transmitting, send JAM signal, back offAvoid collision before it happens using backoff + optional RTS/CTS
    DIFS/SIFSNot usedDIFS = wait before transmit; SIFS = short wait before ACK
    RTS/CTSNot usedOptional: Request To Send → Clear To Send (solves hidden node problem)
    ACKNo explicit ACK (collision = retransmit)Every frame must be ACKed; no ACK → retransmit
    EfficiencyHigh when load is lowLower due to overhead of avoidance mechanisms
    Min frame size64 bytes (ensures collision detected in time)No similar constraint (no collision detection)
    Hidden Node Problem (WiFi): Station A can hear Access Point (AP) but not Station C. C can hear AP but not A. A and C both think channel is idle and transmit simultaneously → collision at AP. Solved by RTS/CTS: A sends RTS to AP; AP broadcasts CTS heard by all stations; C waits during A's transmission.
    Ethernet Frame Structure & IEEE 802 Standards
    ETHERNET II FRAME (IEEE 802.3) PREAMBLE 7 bytes sync bits SFD 1 byte 10101011 DEST MAC 6 bytes 48-bit address SRC MAC 6 bytes sender address ETHERTYPE 2 bytes 0x0800=IPv4 DATA (PAYLOAD) 46–1500 bytes (padded if <46) MTU = 1500 bytes FCS (CRC-32) 4 bytes error detection
    StandardTechnologySpeedMediumUse Case
    IEEE 802.3Ethernet (CSMA/CD)10 Mbps to 400 GbpsTwisted pair, fiber, coaxWired LAN — universally used
    IEEE 802.3uFast Ethernet100 MbpsCat5 UTP or fiber100Base-TX, office LAN
    IEEE 802.3abGigabit Ethernet1 GbpsCat5e/Cat6 UTP1000Base-T, enterprise LAN
    IEEE 802.11b/g/nWi-Fi 1/2/411/54/600 Mbps2.4 GHz radioHome and office WiFi
    IEEE 802.11acWi-Fi 5Up to 3.5 Gbps5 GHz radioHigh-speed WLAN
    IEEE 802.15.1Bluetooth1–3 Mbps2.4 GHz, 10m rangeWPAN: peripherals, headsets
    IEEE 802.15.4Zigbee250 Kbps2.4 GHz, low powerIoT sensors, smart home
    IEEE 802.16WiMAXUp to 1 Gbps2–66 GHz radioWMAN: city-wide broadband
    IEEE 802.1DSTP (Spanning Tree)——Loop prevention in switched LANs
    IEEE 802.1QVLAN Tagging——Virtual LANs on shared switches
    Spanning Tree Protocol (STP) — Deep Dive
    Why Spanning Tree Protocol?

    In networks with multiple bridges/switches, there can be multiple paths between nodes. This creates broadcast storms: a broadcast frame loops endlessly causing network meltdown. STP prevents this by building a logical loop-free tree while maintaining physical redundancy.

  • Root Bridge Election: Bridge with lowest Bridge ID (priority + MAC address) becomes root. All ports on root bridge are designated (forwarding).
  • Root Port Selection: Each non-root bridge selects the port with least cost to root as its Root Port. Cost based on link speed (1 Gbps = cost 4, 100 Mbps = cost 19, 10 Mbps = cost 100).
  • Designated Port Selection: For each network segment, the bridge with lowest root path cost has its port as Designated Port (forwarding). The other end becomes Blocked Port.
  • Blocked Ports: Ports not in Root or Designated role are put in Blocking state — they receive BPDUs but don't forward data frames. Redundancy maintained without loops.
  • Port States: Blocking → Listening → Learning → Forwarding (and Disabled). Convergence takes ~30-50 seconds in classic STP. RSTP (802.1w) converges in <1 second.
  • Unit III — Deep Dive
    Routing Algorithms, IPv6 & Advanced Network Layer
    Dijkstra, RIP, OSPF, BGP, IPv6 headers, VPN, NAT, ICMP in detail
    IP Address Classes & Classless Addressing
    ClassFirst Octet RangeDefault MaskNetwork BitsHost BitsMax HostsUse
    A1 – 126255.0.0.0 (/8)82416,777,214Very large orgs, ISPs
    B128 – 191255.255.0.0 (/16)161665,534Medium-large orgs
    C192 – 223255.255.255.0 (/24)248254Small orgs, home networks
    D224 – 239N/A———Multicast groups
    E240 – 255N/A———Research/reserved
    SUBNETTING RULES — KEY FORMULAS
    Number of subnets = 2^(borrowed bits)
    Hosts per subnet = 2^(remaining host bits) - 2 (subtract network & broadcast)
    Subnet mask = all 1s in network portion, all 0s in host portion

    CIDR notation: /n means first n bits are network bits
    Block size = 256 - last octet of subnet mask

    Special addresses:
    127.0.0.0/8 = Loopback (localhost)
    10.0.0.0/8 = Private Class A
    172.16.0.0/12 = Private Class B
    192.168.0.0/16 = Private Class C
    0.0.0.0 = This host (unspecified)
    255.255.255.255 = Limited broadcast
    VLSM (Variable Length Subnet Masking): Unlike fixed subnetting, VLSM allows different subnets to have different prefix lengths within the same IP block. This allows efficient allocation — give large subnets to big departments and small subnets to point-to-point WAN links (which only need 2 hosts, /30). Requires classless routing protocols (OSPF, RIPv2, BGP) that carry prefix length info in routing updates.
    ARP, RARP, DHCP, ICMP — Detailed Working
    ARP — Address Resolution Protocol
    Problem: You know destination IP but need MAC address for local delivery.

    Process:
    1. Check ARP cache — if found, use it
    2. Broadcast ARP Request: "Who has IP X? Tell me (my MAC)"
    3. Owner replies with ARP Reply (unicast) containing its MAC
    4. Sender caches IP→MAC mapping

    ARP Spoofing: Attacker sends fake ARP replies to associate their MAC with victim's IP → man-in-the-middle attack.
    DHCP — Dynamic Host Configuration
    DORA Process:
    1. DISCOVER — Client broadcasts "Any DHCP server?" (UDP, src 0.0.0.0, dst 255.255.255.255)
    2. OFFER — Server offers: IP, mask, gateway, DNS, lease time
    3. REQUEST — Client accepts offer (still broadcast, other servers notified)
    4. ACK — Server confirms assignment

    Client uses IP for lease duration; sends RENEW at 50% of lease time. Releases IP on clean shutdown.
    ICMP — Internet Control Message Protocol
    Purpose: Error reporting and network diagnostics. Carried inside IP packets (Protocol = 1).

    Key Message Types:
    Type 0/8 — Echo Reply/Request (ping)
    Type 3 — Destination Unreachable (port/host/net)
    Type 5 — Redirect (use better route)
    Type 11 — Time Exceeded (TTL=0, used by traceroute)
    Type 12 — Parameter Problem

    Traceroute works by sending packets with TTL=1,2,3… Each router that decrements TTL to 0 sends ICMP Type 11 back, revealing the path.
    NAT — Network Address Translation
    Purpose: Allows multiple private IP addresses to share one public IP. Conserves IPv4 address space.

    How it works: Router maintains NAT table mapping (private IP, private port) ↔ (public IP, public port). Outgoing: replaces private src IP/port. Incoming: looks up table, replaces public dst with private.

    Problem: Breaks end-to-end connectivity; complicates P2P applications. Not needed with IPv6.
    Routing Protocols — RIP, OSPF, BGP Deep Dive PYQ 2023-24
    FeatureRIP v2OSPFBGP-4
    TypeIGP (intradomain)IGP (intradomain)EGP (interdomain)
    AlgorithmDistance Vector (Bellman-Ford)Link State (Dijkstra SPF)Path Vector
    MetricHop count (max 15; 16 = ∞)Cost = 10⁸/bandwidthPath attributes (AS-PATH, LOCAL-PREF, MED)
    ConvergenceSlow (minutes)Fast (seconds)Slow (policy-driven)
    TransportUDP port 520Directly over IP (Protocol 89)TCP port 179
    Update triggerEvery 30 seconds (full table)On topology change (LSA flooding)On change (incremental updates)
    ScaleSmall networks (<15 hops)Large enterprise (areas/hierarchy)Internet-scale (entire global routing)
    FeaturesSimple, easy configAreas, DR/BDR, VLSM, authPolicy-based, multi-homing, confederations
    Loop preventionSplit horizon, poison reverseSPF guarantees loop-free treeAS-PATH attribute (own AS = discard)
    OSPF Areas: Large networks are divided into areas. Area 0 (backbone area) connects all other areas. Routers within an area have identical LSDB. Area Border Routers (ABRs) connect areas. Autonomous System Boundary Routers (ASBRs) connect OSPF to external routing protocols. This hierarchical design reduces flooding scope and speeds convergence.
    IPv6 — Complete Coverage PYQ 2024-25
    IPv6 HEADER (Fixed 40 bytes) VERSION 4 bits = 6 TRAFFIC CLASS 8 bits (like TOS) FLOW LABEL 20 bits — QoS flow identification (NEW in IPv6) PAYLOAD LENGTH 16 bits (excludes 40-byte header) NEXT HEADER 8 bits (TCP=6,UDP=17…) HOP LIMIT 8 bits (= TTL) SOURCE ADDRESS — 128 bits (16 bytes) DESTINATION ADDRESS — 128 bits (16 bytes) EXTENSION HEADERS (optional, chained via Next Header field) + DATA PAYLOAD IPv6 improvements: NO Checksum field (handled by transport layer) · NO Fragmentation by routers · Fixed 40-byte header = faster processing
    IPv6 Extension Headers
    Optional features moved to chained extension headers:
    Hop-by-Hop Options: Options for every router on path
    Routing Header: Source routing (specify intermediate nodes)
    Fragment Header: Only source can fragment (routers cannot)
    Auth Header (AH): Data integrity, authentication
    ESP Header: Encryption + auth (IPSec)
    Destination Options: Info for final destination only

    Each header has a Next Header field pointing to the next one in chain.
    IPv6 Address Types & Notation
    Notation: 8 groups of 4 hex digits separated by colons
    Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
    Compressed: 2001:db8:85a3::8a2e:370:7334 (:: = consecutive zeros)

    Address types:
    Unicast — single interface (global, link-local, loopback)
    Multicast — group of interfaces (FF00::/8)
    Anycast — nearest of a group (same address, multiple nodes)
    No broadcast in IPv6 — replaced by multicast

    SLAAC: Stateless Address Autoconfiguration — device generates own IPv6 address using prefix + MAC-derived Interface ID (EUI-64). No DHCP needed.
    VPN — Virtual Private Network PYQ 2024-25
    VPN Architecture & Tunneling

    A VPN creates an encrypted tunnel through a public network (Internet). The private IP packet is encapsulated inside a public packet — this is tunneling. The VPN gateway at the receiving end decapsulates and decrypts. From the application's perspective, the remote device appears to be on the local private network.

    VPN TypeDescriptionProtocolUse Case
    Site-to-SiteConnects two entire LANs. Gateways handle encryption transparently.IPSec (Tunnel mode)Branch office connectivity
    Remote AccessIndividual user connects to corporate network from home.SSL/TLS, IPSec, OpenVPNWork from home, travel
    MPLS VPNService provider creates virtual circuits using labels.MPLS + BGPEnterprise WAN, ISP services
    IPSec Modes: Transport mode — encrypts only the payload (IP header unchanged); used for host-to-host. Tunnel mode — encrypts entire IP packet and adds new IP header; used for VPN gateways (site-to-site). IPSec uses AH (Authentication Header) for integrity without encryption, and ESP (Encapsulating Security Payload) for encryption + authentication.
    Unit IV — Deep Dive
    TCP Congestion Control, QoS & Transport Layer Complete
    Slow start, AIMD, QoS mechanisms, UDP header, port numbers
    UDP Header & Comparison with TCP
    UDP DATAGRAM HEADER (Fixed 8 bytes) SOURCE PORT 16 bits (0–65535) DESTINATION PORT 16 bits LENGTH 16 bits (header + data) CHECKSUM 16 bits (optional in IPv4) UDP header = only 8 bytes vs TCP's 20+ bytes → much lower overhead → faster transmission
    FeatureTCPUDP
    ConnectionConnection-oriented (3-way handshake required)Connectionless (no setup)
    ReliabilityGuaranteed delivery via ACK + retransmissionBest-effort, no guarantee
    OrderingSequence numbers ensure in-order deliveryPackets may arrive out of order
    Error controlChecksum + ACK + retransmitChecksum only (optional)
    Flow controlSliding window (receiver advertises buffer)None
    Congestion controlSlow start, AIMD, fast retransmitNone (can overwhelm network)
    Header size20–60 bytes (variable due to options)8 bytes (fixed)
    SpeedSlower (overhead, wait for ACKs)Very fast (fire and forget)
    Suitable forHTTP, HTTPS, FTP, SMTP, SSH — anything requiring reliabilityDNS, DHCP, VoIP, video streaming, online gaming, SNMP
    TCP Congestion Control — Complete AIMD Algorithm
    AIMD — Additive Increase Multiplicative Decrease

    TCP's congestion control follows AIMD: increase window additively when no congestion (add 1 MSS per RTT in Congestion Avoidance), decrease window multiplicatively when congestion detected (halve cwnd on 3 dup ACKs; reset to 1 on timeout). This creates the characteristic "sawtooth" pattern of TCP throughput over time.

    PhaseTriggercwnd behaviorGrowth
    Slow StartConnection start or timeout recoveryDoubles every RTT (cwnd += 1 per ACK)Exponential
    Congestion Avoidancecwnd ≥ ssthreshIncreases by 1 MSS per RTT (cwnd += MSS²/cwnd per ACK)Linear (additive)
    Timeout eventTimer expires (severe congestion)ssthresh = cwnd/2; cwnd = 1 MSS; restart Slow StartDrastic reset
    3 Dup ACKs (Fast Retransmit)3 same ACKs received (mild congestion)ssthresh = cwnd/2; cwnd = ssthresh (TCP Reno: Fast Recovery)Multiplicative decrease
    Fast Recovery (TCP Reno)After 3 dup ACKsSkip Slow Start; enter Congestion Avoidance at new ssthreshLinear from ssthresh
    TCP THROUGHPUT APPROXIMATION (Mathis Formula)
    Throughput ≈ (1.22 × MSS) / (RTT × √Loss_Rate)

    Where:
    MSS = Maximum Segment Size (typically 1460 bytes for Ethernet)
    RTT = Round Trip Time
    Loss_Rate = probability of packet loss

    This shows throughput degrades with higher RTT and higher loss rates.
    Port Numbers — Well-Known, Registered, Dynamic
    RangeCategoryExamples
    0 – 1023Well-Known Ports (assigned by IANA, require root/admin)20/21 FTP, 22 SSH, 23 Telnet, 25 SMTP, 53 DNS, 67/68 DHCP, 80 HTTP, 110 POP3, 143 IMAP, 161/162 SNMP, 443 HTTPS
    1024 – 49151Registered Ports (registered with IANA, apps can request)1433 MS SQL Server, 3306 MySQL, 3389 RDP, 5432 PostgreSQL, 8080 HTTP alternate, 27017 MongoDB
    49152 – 65535Dynamic/Ephemeral Ports (assigned temporarily to clients)Automatically assigned by OS to client-side of connections; released after connection closes
    Connection Identification: A TCP connection is uniquely identified by a 4-tuple: (Source IP, Source Port, Destination IP, Destination Port). This allows one server to handle thousands of simultaneous connections on the same destination port (e.g. port 80), since each client has a unique source port.
    Quality of Service — Mechanisms Deep Dive PYQ 2023-24
    Scheduling Algorithms
    FIFO (First In First Out): Simple queue, no priority. All flows treated equally. Prone to head-of-line blocking — one slow flow blocks all behind it.

    Priority Queuing: Multiple queues with priorities. High-priority queue always served first. Low-priority may starve.

    WFQ (Weighted Fair Queuing): Each flow gets a proportional share of bandwidth based on its weight. Prevents starvation. Used in routers for QoS. Fair but complex.
    Traffic Control Mechanisms
    Traffic Shaping: Delays packets to conform to a rate (smooth bursty traffic). Buffer needed. Leaky bucket is the classic shaper.

    Traffic Policing: Drops or marks packets that exceed rate (no buffering). Immediate enforcement. Token bucket is a policer.

    RED (Random Early Detection): Router drops packets probabilistically as queue fills — before it's completely full. Signals senders to slow down. Avoids global synchronization (all TCP flows slowing together).

    RSVP (Resource Reservation Protocol): Reserves bandwidth along the path for a specific flow. Signaling protocol — routers must support it.
    Unit V — Deep Dive
    Application Layer Protocols — Complete Coverage
    HTTP methods & versions, FTP modes, email security, SNMP MIB, full RSA, data compression algorithms
    HTTP — Complete Coverage PYQ Both Years
    HTTP/1.0 vs HTTP/1.1 vs HTTP/2
    HTTP/1.0: Non-persistent — new TCP connection per object. Very inefficient for pages with many images/CSS/JS files.

    HTTP/1.1: Persistent connections (keep-alive) + pipelining (send multiple requests without waiting for each response). Much more efficient. Most widely supported.

    HTTP/2: Binary framing, multiplexing (many streams on 1 TCP conn, no head-of-line blocking), server push, header compression (HPACK). Major performance improvement.

    HTTP/3: Uses QUIC (UDP-based), built-in TLS 1.3, faster connection setup, no TCP head-of-line blocking.
    HTTP Request/Response Format
    Request:
    GET /page.html HTTP/1.1
    Host: www.example.com
    Accept: text/html
    Connection: keep-alive

    Response:
    HTTP/1.1 200 OK
    Content-Type: text/html
    Content-Length: 1234
    (blank line)
    (body: HTML content)

    Cookies: HTTP is stateless — cookies stored client-side allow state persistence. Session cookies expire on close; persistent cookies have expiry date.
    HTTP MethodPurposeIdempotent?Has Body?Safe?
    GETRetrieve resourceYesNoYes (no side effects)
    POSTSubmit data (form, create resource)NoYesNo
    PUTCreate or replace resource entirelyYesYesNo
    PATCHPartially update resourceNoYesNo
    DELETERemove resourceYesNoNo
    HEADSame as GET but no body returned (check headers)YesNoYes
    OPTIONSQuery allowed methods for a resourceYesNoYes
    FTP — Detailed Architecture PYQ Both Years
    FTP CLIENT Control Process (PI) Data Transfer (DTP) User Interface (commands: get, put, ls, cd, bye…) FTP SERVER Control Process (PI) Data Transfer (DTP) File System Port 21 (control) Port 20 (data active) Control Connection (TCP port 21) Commands: USER, PASS, LIST, RETR, STOR, QUIT… Data Connection (TCP port 20 — Active Mode) Actual file content transfer — new connection per file/directory listing Active Mode: Server initiates data conn FROM port 20 to client's port → firewall issues Passive Mode: Client initiates both connections → firewall friendly → most common today
    SNMP — Complete Architecture ★ BOTH YEARS
    NMS — MANAGER (Network Management Station) SNMP Manager Software MIB Browser UDP port 162 (receives traps) AGENT (Router) SNMP Agent Process MIB (local database) UDP port 161 AGENT (Switch) SNMP Agent Process MIB — counters, status vars MIB — Object Types system— hostname, uptime interfaces— if speed, packets ip— routing table, fragments tcp— connections, segments udp— datagrams in/out snmp— SNMP statistics OID (Object ID) identifies each variable Get/Set Response TRAP (unsolicited alert)
    SNMP PDUDirectionPurpose
    GetRequestManager → AgentRequest value of one or more MIB variables
    GetNextRequestManager → AgentGet next OID in MIB tree (used for table traversal)
    GetBulkRequestManager → AgentRetrieve large blocks of MIB data efficiently (SNMPv2c+)
    SetRequestManager → AgentSet value of a MIB variable (configure device)
    GetResponseAgent → ManagerReply to Get/Set requests with values or error status
    TrapAgent → ManagerUnsolicited notification of important event (cold start, link down, auth failure)
    InformRequestAgent → ManagerLike Trap but requires acknowledgment (SNMPv2c+)
    SNMP Versions: SNMPv1 — basic, weak community string security (plaintext). SNMPv2c — adds GetBulk, 64-bit counters, better error handling, still community string auth. SNMPv3 — adds strong security: authentication (MD5/SHA), privacy/encryption (DES/AES), access control. Used in all modern enterprise network management.
    Data Compression — Detailed Algorithms PYQ Both Years
    Huffman Coding (Lossless)
    Idea: Frequent characters get shorter codes; rare characters get longer codes. Result is a variable-length prefix-free code.

    Algorithm:
    1. Count frequency of each character
    2. Build min-heap (priority queue) of all symbols by frequency
    3. Repeatedly extract 2 nodes with lowest frequency; combine into parent (sum of frequencies); re-insert
    4. Repeat until single root remains
    5. Assign 0 to left branches, 1 to right (or vice versa)
    6. Path from root to leaf = code for that symbol

    Example: If 'a'=5, 'b'=2, 'c'=1: 'a'→0, 'b'→10, 'c'→11
    Run-Length Encoding (Lossless)
    Idea: Replace runs of identical characters with (count, character) pair.

    Example:
    Original: AAABBBBBCCDDDDD (15 chars)
    Encoded: 3A5B2C5D (8 chars) → 47% compression!

    Very effective for images with large uniform areas (FAX, BMP, TIFF). Used in PCX format and as preprocessing step for JPEG/PNG.

    Ineffective for already-varied data (may increase size).
    LZW — Lempel-Ziv-Welch (Lossless)
    Dictionary-based compression. Builds a codebook dynamically from the input data. Repeated patterns are assigned shorter codes.

    Used in: GIF images, ZIP files, PDF, Unix compress command.

    No need to transmit the dictionary — receiver rebuilds it from the compressed stream using the same algorithm. Effective for text files and binary data with repeating patterns.
    JPEG / MPEG (Lossy)
    JPEG (images): Divide into 8×8 blocks → DCT (Discrete Cosine Transform) to convert to frequency domain → quantize (discard high-frequency details) → Huffman encode. Human eye less sensitive to high-frequency detail. Quality setting controls how much is discarded.

    MPEG (video): Exploits temporal redundancy between frames. I-frames (full), P-frames (predicted from previous), B-frames (bidirectional). Typically 10–50x compression vs raw video.
    Cryptography — Symmetric Algorithms Deep Dive
    AlgorithmKey SizeBlock SizeStatusNotes
    DES56 bits64 bitsBroken (1999)Only 2⁵⁶ keys — brute-forced in <24h today
    3DES (Triple DES)112 or 168 bits64 bitsDeprecatedApply DES 3 times: encrypt-decrypt-encrypt. Slow.
    AES128, 192, or 256 bits128 bitsCurrent standardRijndael algorithm. Fast in hardware & software. Used in WPA2, TLS, disk encryption.
    RC4Variable (40–2048 bits)Stream cipherDeprecatedWas used in WEP WiFi (broken) and SSL/TLS (deprecated).
    ChaCha20256 bitsStream cipherModern/activeUsed in TLS 1.3, WireGuard VPN. Fast on mobile CPUs without AES hardware acceleration.
    COMPLETE RSA WITH EXTENDED EUCLIDEAN — EXAM LEVEL
    Step 1: p = 5, q = 11 → n = 55, φ(n) = (5-1)(11-1) = 40
    Step 2: Choose e = 3 (gcd(3,40)=1 ✓)
    Step 3: Find d: 3d ≡ 1 (mod 40)
      Extended Euclidean: 40 = 13×3 + 1 → 1 = 40 - 13×3
      d = -13 mod 40 = 27 (check: 3×27=81=2×40+1 ✓)
    Step 4: Public key=(3,55), Private key=(27,55)

    Encrypt M=2: C = 2³ mod 55 = 8
    Decrypt C=8: M = 8²⁷ mod 55
      8² = 64 mod 55 = 9
      8⁴ = 9² = 81 mod 55 = 26
      8⁸ = 26² = 676 mod 55 = 16
      8¹⁶ = 16² = 256 mod 55 = 36
      27 = 16+8+2+1 → 8²⁷ = 36×16×9×8 mod 55
      = 576×72 mod 55 = 26×17 mod 55 = 442 mod 55 = 2 ✓

    In exam: use small numbers and show each step of modular exponentiation
    Complete Exam Preparation Roadmap
    Based on BCS603 PYQ 2023-24 & 2024-25 pattern analysis — prioritised for maximum marks in 3 hours
    Section A — 2 Marks Each (All Compulsory — 14 marks)
  • Mesh topology: Links = n(n-1)/2 — for 10 nodes = 45
  • dB attenuation: 10·log₁₀(Pout/Pin), −3dB ≈ half power
  • Piggybacking: ACK attached to outgoing data frame to save bandwidth
  • Contention MAC: suitable for low load, bursty, decentralized networks
  • OSI model: draw all 7 layers with PDU names and example protocols
  • Congestion policies: slow start, congestion avoidance, fast retransmit, leaky bucket, token bucket, RED, RSVP, ECN
  • RPC stub: client stub marshals params; server stub unmarshals and calls function
  • Token bucket: tokens generated at rate r; packet can send if token available; bursts allowed up to bucket size b
  • Fixed framing: fixed size blocks (ATM 53 bytes); Variable framing: length field or flag bytes delimit frames
  • Bridge: learns MAC→port by observing source MACs; forwards/filters frames
  • Section B — 7 Marks Each (Choose 3 of 5 — 21 marks)
  • CRC: polynomial → binary → append r zeros → XOR division → remainder = CRC → transmitted = msg+CRC → verify at receiver
  • Subnetting: /24 → 4 subnets → borrow 2 bits → /26 → list all 4 ranges with network and broadcast addresses
  • Leaky Bucket vs Token Bucket: define both, draw diagrams, compare (constant vs bursty output), applications
  • RSA: full 8-step algorithm, numerical example with encryption and decryption verification
  • SNMP+DNS+Compression: ~2.3 marks each — SNMP manager/agent/MIB/PDUs; DNS hierarchy/resolution/records; compression lossless/lossy algorithms
  • Section C — Q3–Q7 Recommended Choices
  • Q3a: Slotted ALOHA diagram + P(idle)=0.1 → G=2.303, S=23%. Q3b: Latency = Trans+Prop+Router delays
  • Q4a: Count-to-infinity (explain problem + split horizon fix). Q4b: DVR table calculation given 3 neighbour vectors
  • Q5a: IPv6 — 128-bit, fixed 40B header, no checksum, extension headers, SLAAC, no broadcast, flow label. Q5b: RARP+DHCP(DORA)+VPN
  • Q6a: Silly Window Syndrome + Nagle (sender) + Clark (receiver). Q6b: TCP header fields + 3-way handshake SYN→SYN+ACK→ACK
  • Q7a: SMTP+MIME (multimedia email) + IMAP4 vs POP3 advantages. Q7b: FTP (2 connections, active/passive) + HTTP (methods, stateless) + Telnet (port 23, insecure)
  • Draw From Memory — Exam Diagram Checklist
  • OSI 7-layer model (layers, PDU names, protocols, devices)
  • TCP/IP 4-layer model vs OSI comparison
  • Network topologies: bus, star, ring, mesh, tree (all 5)
  • IPv4 header (all fields with bit sizes)
  • TCP segment header (all fields with sizes)
  • TCP 3-way handshake (SYN, SYN+ACK, ACK with seq numbers)
  • Leaky bucket and Token bucket (both diagrams)
  • DNS resolution flow (client→local→root→TLD→authoritative)
  • Slotted vs Pure ALOHA timeline comparison
  • CRC long division step-by-step
  • RSA encrypt/decrypt flow (Alice→Bob with keys labeled)
  • TCP congestion control sawtooth graph (slow start, CA, events)
  • COMPLETE FORMULA QUICK REFERENCE — ALL 5 UNITS
    Mesh links = n(n-1)/2 | Attenuation: dB = 10·log₁₀(Pout/Pin)
    Latency = Propagation + Transmission + Queue + Processing
    Propagation = Distance/Speed | Transmission = FrameSize/Bandwidth
    Pure ALOHA: S = G·e^(-2G), max 18.4% at G=0.5
    Slotted ALOHA: S = G·e^(-G), max 36.8% at G=1 | P(idle) = e^(-G) → G = -ln(P_idle)
    Go-Back-N efficiency η = W/(1+2a) | a = Tp/Tt, W = window size
    Hamming: 2^r ≥ m+r+1 | Subnetting: hosts = 2^hostbits - 2
    DVR Bellman-Ford: D(x,y) = min_v{c(x,v) + D(v,y)}
    OSPF Cost = 10^8 / bandwidth
    RSA: n=pq, φ(n)=(p-1)(q-1), ed≡1 mod φ(n) | C=M^e mod n, M=C^d mod n
    TCP throughput ≈ 1.22·MSS / (RTT·√loss) | Effective window = min(cwnd, rwnd)