Group A — Short Answer Questions (1 Mark Each)
Ans: A Computer Network is a collection of independent computers and devices (nodes) interconnected by communication links (wired or wireless) that allows them to exchange data and share resources.
Ans: Business applications (email, e-commerce), home applications (smart home, IoT, social networks), and mobile users (smartphones, tablets, wireless connectivity).
Ans: Network hardware refers to physical components used for connectivity: NIC (Network Interface Card), repeaters, hubs, switches, routers, bridges, and gateways.
Ans: Network software includes protocols (TCP/IP), operating system network modules, middleware, and applications that enable communication over the network. It is organized in layers.
Ans: Network architecture is the design specification that defines how network components (hardware, software, protocols) are organized and interact. It includes layering principles, protocols, interfaces, and services.
Ans: Layering decomposes the complex networking problem into manageable sub-problems. Each layer provides services to the layer above using services from the layer below. It enables modularity and interoperability.
Ans: A protocol is a set of rules governing data communication between entities in different systems. It defines syntax (format), semantics (meaning), and timing (when and how fast).
Ans: An interface defines the operations and services that a lower layer provides to an upper layer. A service is the set of operations that the lower layer provides to the upper layer.
Ans: Connectionless (e.g., IP/UDP): Each packet is independent, no setup needed, unreliable delivery. Connection-oriented (e.g., TCP): Requires setup (3-way handshake), guarantees delivery, uses sequence numbers.
Ans: Service primitivesREQUEST, INDICATION, RESPONSE, CONFIRMATION.
Ans: Three types: Connection-oriented reliable (TCP), Connectionless reliable (ATM), Connectionless unreliable (UDP/IP).
Ans: Physical → Data Link → Network → Transport → Session → Presentation → Application. Mnemonic: "All People Seem To Need Data Processing".
Ans: Link (Network Interface) → Internet → Transport → Application.
Ans: OSI has 7 layers and is a reference model (theoretical); TCP/IP has 4 layers and is a practical model used in the Internet. OSI separates Session and Presentation layers; TCP/IP merges them into Application layer.
Ans: X.25 is an early packet-switching WAN protocol (ITU-T standard). It uses virtual circuits and operates at physical, data link, and packet (network) layers.
Ans: Frame Relay is a high-performance WAN protocol that operates at the data link layer. It uses packet switching and virtual circuits but does not perform error correction (assumes reliable physical layer).
Ans: ATM is a cell relay protocol using fixed-size 53-byte cells (48-byte payload + 5-byte header). It supports both voice and data, provides QoS, and uses virtual circuits (PVC/SVC).
Ans: ISDN (Integrated Services Digital Network) is a circuit-switched digital telephone network. It provides two 64 kbps B-channels and one 16 kbps D-channel (2B+D = 144 kbps).
Ans: B-ISDN (Broadband ISDN) supports high data rates (155 Mbps to 622 Mbps) using ATM technology. It provides integrated services (voice, video, data) over a single network.
Ans: ADSL (Asymmetric Digital Subscriber Line) is a broadband access technology using copper telephone lines. Download speeds are faster than upload (asymmetric), typically up to 8 Mbps downstream and 1 Mbps upstream.
Ans: A Cable Modem provides broadband Internet access over coaxial cable TV infrastructure. It uses DOCSIS standard, offering shared bandwidth with speeds up to 100 Mbps.
Ans: ARPANET (Advanced Research Projects Agency Network) was the precursor to the Internet, funded by the US DoD. It first connected UCLA, Stanford, UCSB, and Utah in 1969 using packet switching.
Ans: An ISP (Internet Service Provider) is an organization that provides Internet access to users and organizations. Examples: Airtel, Jio, BSNL. ISPs form the Internet backbone through peering and transit agreements.
Ans: Classful addressing divides the 32-bit IPv4 address space into 5 classes: A (0–127, 16.7M hosts), B (128–191, 65K hosts), C (192–223, 254 hosts), D (multicast), E (reserved).
Ans: Classless addressing uses a prefix length (e.g., /24) instead of class boundaries. CIDR notation: IP/Prefix. It allows flexible allocation of address blocks of any size.
Ans: A subnet (subnetwork) is a logical subdivision of an IP network. It is created by borrowing host bits and uses a subnet mask. It reduces broadcast domains and improves address utilization.
Ans: Supernetting (route aggregation) combines multiple contiguous networks into a single larger network by borrowing from the network ID. It reduces routing table size.
Ans: NAT (Network Address Translation) maps private IP addresses to a public IP address. It allows multiple devices to share one public IP. Types: Static NAT, Dynamic NAT, PAT/NAPT.
Ans: ICMP (Internet Control Message Protocol) is used for diagnostic and error-reporting functions at the Network layer. Tools: ping (ICMP Echo Request/Reply) and traceroute.
Ans: ARP (Address Resolution Protocol) maps an IPv4 address to a MAC address. It broadcasts an ARP Request and caches the result in an ARP table. RARP does the reverse mapping.
Ans: DHCP (Dynamic Host Configuration Protocol) automatically assigns IP addresses and network configuration to devices. The DORA process: Discover → Offer → Request → Acknowledgment.
Ans: RARP (Reverse Address Resolution Protocol) maps a MAC address to an IP address. Used by diskless workstations to obtain their IP at boot. Largely replaced by BOOTP and DHCP.
Ans: Cryptography is the science of protecting information by transforming it into a secure format. It provides confidentiality, integrity, authentication, and non-repudiation.
Ans: A Block Cipher encrypts fixed-size blocks of plaintext (e.g., 128 bits) into ciphertext blocks of the same size. Examples: AES, DES, 3DES. Contrast: Stream Cipher encrypts bit by bit.
Ans: AES (Advanced Encryption Standard) is a symmetric block cipher using key sizes of 128, 192, or 256 bits with 128-bit block size. It replaced DES and uses substitution-permutation network.
Ans: Public Key Cryptography (asymmetric) uses a key pair: a public key (shared openly) for encryption and a private key (kept secret) for decryption. Examples: RSA, Diffie-Hellman, ECC.
Ans: RSA (Rivest-Shamir-Adleman) is a public key algorithm based on the difficulty of factoring large numbers. Key generation: choose two primes \(p,q\), compute \(n=pq\) and \(\phi(n)=(p-1)(q-1)\), choose \(e\) coprime to \(\phi(n)\), compute \(d = e^{-1} \bmod \phi(n)\).
Ans: A Digital Signature provides authentication and non-repudiation. The sender hashes the message and encrypts the hash with their private key. The receiver decrypts with the sender's public key and compares hashes.
Ans: DNS (Domain Name System) translates human-readable domain names (e.g., google.com) to IP addresses. It uses a hierarchical distributed database. Record types: A, AAAA, MX, CNAME, NS.
Ans: The Application Layer (Layer 7) provides network services directly to end-user applications. Protocols: HTTP, DNS, SMTP, FTP, SSH, Telnet.
Group B — Descriptive Questions (5 Marks Each)
Ans: The OSI Reference Model is a 7-layer framework for understanding network communications:
| Layer | Name | Function |
|---|---|---|
| 7 | Application | Network services to applications (HTTP, DNS, SMTP) |
| 6 | Presentation | Data format, encryption, compression |
| 5 | Session | Dialog control, session management |
| 4 | Transport | End-to-end delivery, TCP/UDP |
| 3 | Network | Routing, IP, logical addressing |
| 2 | Data Link | Framing, MAC addressing, error detection |
| 1 | Physical | Bits over physical medium (copper, fiber, wireless) |
Ans: Key differences between the two models:
| Aspect | OSI Model | TCP/IP Model |
|---|---|---|
| Layers | 7 layers | 4 layers |
| Nature | Reference model (theoretical) | Practical implementation model |
| Session/Presentation | Separate layers (5 & 6) | Merged into Application layer |
| Network Layer | Connection-oriented only | Both connectionless (IP) and connection-oriented (TCP) |
| Development | Developed by ISO | Developed by DoD/ARPANET |
| Usage | Less used in practice | Basis of the Internet |
Ans: Classful Addressing divides IPv4 into 5 classes:
- Class A: 0xxx xxxx — 0.0.0.0 to 127.255.255.255 (16M hosts)
- Class B: 10xx xxxx — 128.0.0.0 to 191.255.255.255 (65K hosts)
- Class C: 110x xxxx — 192.0.0.0 to 223.255.255.255 (254 hosts)
- Class D: 1110 xxxx — 224.0.0.0 to 239.255.255.255 (multicast)
- Class E: 1111 xxxx — 240.0.0.0 to 255.255.255.255 (reserved)
Classless Addressing (CIDR) uses prefix notation (e.g., 192.168.1.0/24), allowing flexible allocation without class boundaries. Supernetting aggregates multiple networks into one prefix.
Ans: Subnetting divides a large network into smaller logical networks (subnets) by borrowing host bits. This reduces broadcast traffic and improves security.
Example: Network 200.1.1.0/24 with subnet mask 255.255.255.0. If we borrow 2 bits (subnet mask /26 = 255.255.255.192):
- Subnet 0: 200.1.1.0 – 200.1.1.63 (62 usable hosts)
- Subnet 1: 200.1.1.64 – 200.1.1.127
- Subnet 2: 200.1.1.128 – 200.1.1.191
- Subnet 3: 200.1.1.192 – 200.1.1.255
Ans: DHCP (Dynamic Host Configuration Protocol) uses a 4-step process called DORA:
- Discover: Client broadcasts DHCPDISCOVER to find available DHCP servers.
- Offer: Server responds with DHCPOFFER containing an available IP address and lease details.
- Request: Client broadcasts DHCPREQUEST accepting the offered address.
- Acknowledgment: Server sends DHCPACK confirming the lease with configuration details (IP, subnet mask, gateway, DNS).
Ans: ARP (Address Resolution Protocol) maps IP addresses to MAC addresses:
- Sender checks its ARP cache for the destination IP's MAC address.
- If not found, it broadcasts an ARP Request containing the target IP.
- All hosts on the LAN receive it; the owner responds with an ARP Reply (unicast) containing its MAC address.
- Sender caches the IP-MAC mapping in its ARP table.
RARP is the reverse: a host with only a known MAC address requests its IP from a RARP server.
Ans:
- Bus: All nodes share a single communication line. Simple but collision-prone. Example: 10BASE2.
- Star: All nodes connect to a central hub/switch. Easy to manage; hub failure disrupts network.
- Ring: Each node connects to two neighbors; data travels in one direction. Uses token passing.
- Mesh: Every node connects to every other node. High redundancy, expensive. Used in WANs.
- Tree: Hierarchical combination of star topologies. Used in large organizations.
- Hybrid: Combination of two or more topologies.
Ans: Caesar Cipher: Each letter is shifted by a fixed number of positions. Example with shift 3: A→D, B→E, … X→A, Y→B, Z→C. Encryption: \(C = (P + k) \bmod 26\). Decryption: \(P = (C - k) \bmod 26\).
Monoalphabetic Substitution: Each letter maps to a unique substitute letter. The key is a permutation of 26 letters. Vulnerable to frequency analysis.
Playfair Cipher: Encrypts digraphs (pairs of letters). Uses a 5×5 key square. Stronger than simple substitution.
Ans: AES (Advanced Encryption Standard) is a symmetric block cipher:
- Block size: 128 bits (16 bytes)
- Key sizes: 128, 192, or 256 bits
- Rounds: 10 (128-bit key), 12 (192-bit), or 14 (256-bit)
Each round applies: SubBytes (S-box substitution), ShiftRows (row shifting), MixColumns (column mixing), AddRoundKey (XOR with round key). Last round omits MixColumns.
Ans: RSA (Rivest-Shamir-Adleman) algorithm:
- Choose two large primes \(p\) and \(q\). Compute \(n = p \times q\).
- Compute Euler's totient: \(\phi(n) = (p-1)(q-1)\).
- Choose public exponent \(e\) such that \(1 < e < \phi(n)\) and \(\gcd(e, \phi(n)) = 1\).
- Compute private exponent \(d = e^{-1} \bmod \phi(n)\).
- Public key: \((e, n)\). Private key: \((d, n)\).
Encryption: \(C = M^e \bmod n\). Decryption: \(M = C^d \bmod n\). Security relies on the difficulty of factoring large \(n\).
Ans: A Digital Signature ensures message authenticity and non-repudiation:
- Sender computes a hash of the message: \(H = \text{hash}(M)\).
- Sender encrypts the hash with their private key: \(S = H^d \bmod n\). This is the signature.
- Receiver decrypts signature with sender's public key: \(H' = S^e \bmod n\).
- Receiver independently computes hash of received message and compares with \(H'\). Match → authentic.
Ans: TCP establishes a connection using a 3-step handshake:
- SYN: Client sends SYN (seq=x) to server.
- SYN-ACK: Server responds with SYN-ACK (seq=y, ack=x+1).
- ACK: Client sends ACK (seq=x+1, ack=y+1). Connection established.
Ans: The UDP header is 8 bytes with four fields:
- Source Port (16 bits): Sender's port number
- Destination Port (16 bits): Receiver's port number
- Length (16 bits): Header + Data length in bytes
- Checksum (16 bits): Optional error detection (covers header + data + pseudo-header)
UDP is connectionless, lightweight, and provides no reliability guarantees.
Ans: The TCP header is 20–60 bytes with fields:
- Source/Dest Port (16 bits each): Application endpoints
- Sequence Number (32 bits): Byte stream position
- Acknowledgment Number (32 bits): Next expected byte
- Data Offset (4 bits): Header length in 32-bit words
- Flags (9 bits): URG, ACK, PSH, RST, SYN, FIN
- Window Size (16 bits): Receive buffer space
- Checksum (16 bits): Error detection
- Urgent Pointer (16 bits): Points to urgent data
Ans: Reliable Data Transfer ensures data arrives correctly despite an unreliable channel:
- Error detection: Checksums detect corrupted packets.
- Acknowledgments: Receiver confirms receipt of data.
- Retransmission: Sender retransmits unacknowledged data after timeout.
- Sequence numbers: Identify duplicate or out-of-order packets.
Implemented through protocols: Stop-and-Wait, Go-Back-N, Selective Repeat.
Ans: In Stop-and-Wait, the sender transmits one frame and waits for an ACK before sending the next. A timer is set; if ACK not received before timeout, the frame is retransmitted.
Utilization: \(U = \dfrac{T_{frame}}{T_{frame} + T_{ACK} + T_{prop} + T_{proc}}\). For large bandwidth-delay products, utilization drops significantly.
Ans: Go-Back-N (GBN) allows the sender to transmit up to \(N\) frames before needing an ACK (sliding window of size \(N\)).
- If a frame is lost or damaged, all subsequent frames (including correctly received ones) are retransmitted.
- Receiver only accepts frames in order.
- Cumulative ACK acknowledges all frames up to a sequence number.
Ans: Selective Repeat is more efficient than GBN. The receiver buffers out-of-order frames and sends individual ACKs for each correctly received frame. Only the lost/damaged frame is retransmitted (not all subsequent frames). Requires window size \(N \leq 2^{k-1}\) where \(k\) is sequence number bits.
Ans: TCP uses a sliding window for flow control. The receiver advertises its available buffer space (rwnd). The sender can have at most min(cwnd, rwnd) unacknowledged bytes in flight. As ACKs arrive, the window slides forward, allowing new data to be sent.
Ans: TCP uses Jacobson's congestion control algorithm:
- Slow Start: cwnd starts at 1 MSS. For each ACK, cwnd increases by 1 MSS (exponential growth). At threshold ssthresh, switches to congestion avoidance.
- Congestion Avoidance: cwnd increases by \(1/\text{cwnd}\) per RTT (linear growth: additive increase).
- On loss: ssthresh = cwnd/2, cwnd = 1 (returns to slow start).
Ans: Fast Retransmit: When the sender receives 3 duplicate ACKs, it retransmits the missing segment immediately (without waiting for the timeout).
Fast Recovery: After fast retransmit, ssthresh = cwnd/2, cwnd = ssthresh + 3, then cwnd = ssthresh for each additional duplicate ACK (additive increase). On new ACK, cwnd = ssthresh.
Ans: Packet Switching divides data into packets that are routed independently through the network. Two approaches:
- Datagram Networks: Each packet is routed independently. No connection setup. Packets may take different paths and arrive out of order. Used by IP (Internet).
- Virtual Circuit Networks: A logical path is established before data transfer. All packets follow the same path with the same sequence number. Used by Frame Relay and ATM.
Ans: DNS translates domain names to IP addresses using a hierarchical distributed system:
- Client sends a query to its local DNS server (recursive query).
- Local server checks cache. If miss, it queries root servers, then TLD servers (.com, .org), then authoritative servers.
- Response is cached and returned to client.
DNS uses UDP port 53 for queries and TCP port 53 for zone transfers.
Ans: Email uses three main protocols:
- SMTP (Simple Mail Transfer Protocol, port 25): Used to send email between servers and from client to server. Push-based, text-based, ASCII only.
- POP3 (Post Office Protocol v3, port 110): Used to retrieve email. Downloads and optionally deletes from server. Simple, single-device.
- IMAP (Internet Message Access Protocol, port 143): Retrieves email while keeping it on the server. Supports folders, multiple devices, partial downloads.
Ans: IPv6 uses 128-bit addresses (vs 32-bit in IPv4) and a simplified 40-byte fixed header:
- Version (4 bits): 6
- Traffic Class (8 bits): QoS priority
- Flow Label (20 bits): Identifies packet flow for QoS
- Payload Length (16 bits): Upper-layer payload size
- Next Header (8 bits): Type of extension header or upper-layer protocol
- Hop Limit (8 bits): Replaces TTL
- Source/Dest Address (128 bits each)
Improvements: larger address space, no NAT needed, built-in IPSec, simpler header, efficient routing.
Group C — Long Answer Questions (15 Marks Each)
Ans: The OSI Reference Model is a 7-layer framework standardized by ISO (ISO 7498) that defines how data flows from one application to another across a network. Each layer performs a specific function and communicates only with its peer layer on the receiving system.
7 Layers of OSI Model:
| Layer | Name | PDU | Key Functions |
|---|---|---|---|
| 7 | Application | Data | Network services to applications (HTTP, DNS, SMTP, FTP) |
| 6 | Presentation | Data | Data format conversion, encryption, compression, character encoding |
| 5 | Session | Data | Dialog control, session establishment/termination, synchronization |
| 4 | Transport | Segment | End-to-end reliability, flow control, error recovery (TCP/UDP) |
| 3 | Network | Packet | Routing, logical addressing, fragmentation (IP) |
| 2 | Data Link | Frame | Framing, MAC addressing, error detection/correction (Ethernet, PPP) |
| 1 | Physical | Bits | Transmission of raw bits over physical medium |
TCP/IP Reference Model:
| Layer | Name | Protocols |
|---|---|---|
| 4 | Application | HTTP, DNS, SMTP, FTP, Telnet |
| 3 | Transport | TCP, UDP |
| 2 | Internet | IP, ICMP, ARP |
| 1 | Link | Ethernet, Wi-Fi, PPP |
Comparison:
| Aspect | OSI | TCP/IP |
|---|---|---|
| Layers | 7 | 4 |
| Session/Presentation | Separate layers | Merged into Application |
| Network Layer | Connection-oriented only | Connectionless (IP) + Connection-oriented (TCP) |
| Standard Body | ISO | DoD/ARPANET |
| Implementation | Reference model | Practical Internet model |
HTTP, DNS, SMTP"] T3["Transport
TCP, UDP"] T2["Internet
IP, ICMP, ARP"] T1["Link
Ethernet, Wi-Fi"] T4 --> T3 --> T2 --> T1 end O7 -.-> T4 O6 -.-> T4 O5 -.-> T4 O4 -.-> T3 O3 -.-> T2 O2 -.-> T1 O1 -.-> T1
Ans:
Classful Addressing:
IPv4 is a 32-bit address divided into network and host portions:
| Class | First Bits | Network ID | Host ID | Range |
|---|---|---|---|---|
| A | 0 | 8 bits | 24 bits | 0.0.0.0 – 127.255.255.255 |
| B | 10 | 16 bits | 16 bits | 128.0.0.0 – 191.255.255.255 |
| C | 110 | 24 bits | 8 bits | 192.0.0.0 – 223.255.255.255 |
| D | 1110 | — | — | 224.0.0.0 – 239.255.255.255 (Multicast) |
| E | 1111 | — | — | 240.0.0.0 – 255.255.255.255 (Reserved) |
Classless Addressing (CIDR):
CIDR notation: IP-Address/Prefix-Length (e.g., 192.168.1.0/24). Number of addresses = \(2^{(32 - \text{prefix})}\).
Example: 172.16.0.0/16 has \(2^{16} = 65536\) addresses. Subnet mask: 255.255.0.0.
Subnetting Example:
Given: 200.10.10.0/24. Create 4 subnets.
Borrow 2 bits: new prefix = /26. Subnet mask = 255.255.255.192.
Subnets: 200.10.10.0/26, 200.10.10.64/26, 200.10.10.128/26, 200.10.10.192/26. Each has 62 usable hosts.
Supernetting Example:
Aggregate 200.10.10.0/24, 200.10.11.0/24, 200.10.12.0/24, 200.10.13.0/24 into one route.
Common prefix: /22 (200.10.10.0/22). This is a supernet — reduces routing table entries.
Ans: Error detection and correction are essential at the Data Link layer.
1. Parity Check:
A single parity bit is added to detect single-bit errors. In even parity, the total number of 1s including the parity bit must be even. Detects single-bit errors but cannot correct or detect double-bit errors.
Probability of detecting a \(k\)-bit error: \(P_d = 1 - 2^{-k}\).
2. Hamming Code:
Hamming code adds \(r\) redundant bits to a \(m\)-bit message, forming an \((m+r)\)-bit codeword. The condition is:
Redundant bits are placed at positions \(2^0, 2^1, 2^2, \dots\) (positions 1, 2, 4, 8, ...). Each redundant bit checks specific data bits using XOR. If the parity checks fail, the position of the error is given by the sum of positions with wrong parity.
Example: For 4 data bits (\(m=4\)), need \(r=3\) (\(2^3 = 8 \geq 4+3+1\)). Codeword positions: \(d_1, d_2, r_1, d_3, d_4, d_5, r_2, d_6, d_7, r_3\).
3. CRC (Cyclic Redundancy Check):
CRC uses polynomial division modulo-2. A \(k\)-bit frame is treated as a polynomial of degree \(k-1\). A generator polynomial \(G(x)\) of degree \(n\) is agreed upon:
- Append \(n\) zero bits to the data (multiply by \(x^n\)).
- Divide by \(G(x)\) using XOR (modulo-2 division).
- Remainder (CRC) is appended to the data.
- At receiver, divide the received frame by \(G(x)\). If remainder = 0, no error.
Common polynomials: CRC-32 (Ethernet), CRC-16 (USB). CRC detects all single-bit, double-bit, odd-length, and burst errors up to \(n\) bits.
Ans: TCP uses a sliding window protocol for flow control at the transport layer.
Sliding Window Mechanism:
The receiver advertises its rwnd (receive window) — the available buffer space. The sender maintains a window of size \(W = \min(\text{cwnd}, \text{rwnd})\).
- Bytes within the window can be sent immediately.
- As ACKs arrive, the window slides forward.
- Bytes beyond the window must wait.
(Sent & Acked)"] --> S2["Bytes 1001-2000
(Sent, Unacked)"] --> S3["Bytes 2001-3000
(Window Boundary)"] --> S4["Bytes 3001+
(Not Yet Sent)"] end subgraph Receiver ["Receiver Window (rwnd)"] direction LR R1["Bytes 1-1000
(Read by App)"] --> R2["Bytes 1001-2000
(Buffer)"] --> R3["Next Expected: 2001
(rwnd=1000)"] end
Flow Control:
Receiver controls sender via rwnd in every ACK. Prevents sender from overwhelming receiver's buffer.
Congestion Control:
TCP maintains cwnd (congestion window):
- Slow Start: cwnd = 1 MSS. Doubles each RTT (exponential).
- Congestion Avoidance: After ssthresh, increases by 1 MSS per RTT (linear).
- Fast Retransmit: 3 duplicate ACKs → retransmit immediately.
- Fast Recovery: Set ssthresh = cwnd/2, cwnd = ssthresh + 3.
Ans: Routing algorithms determine the best path from source to destination.
1. Link State (Dijkstra's Shortest Path First):
Each router knows the complete topology and link costs. Uses Dijkstra's algorithm:
- Initialize: Set cost to self = 0, others = infinity.
- Find the node with minimum cost not yet processed.
- Update costs to all neighbors: \(cost(v) = \min(cost(v), cost(u) + w(u,v))\).
- Repeat until all nodes processed.
Convergence: Fast. Overhead: High (flooding LS packets). Used in: OSPF.
2. Distance Vector (Bellman-Ford):
Each router maintains a distance vector (distance to all destinations via each neighbor). Periodically exchanges vectors with neighbors:
Where \(D_x(y)\) = cost from \(x\) to \(y\), \(c(x,v)\) = cost to neighbor \(v\).
Convergence: Slow (count-to-infinity problem). Used in: RIP.
3. RIP (Routing Information Protocol):
RIP is a distance vector protocol using hop count as metric (max 15 hops, 16 = unreachable). Updates every 30 seconds using periodic broadcasts.
- Metric: Hop count (max 15)
- Convergence: Slow (up to several minutes)
- Split horizon: Don't advertise a route back to the neighbor it came from
4. OSPF (Open Shortest Path First):
OSPF uses Dijkstra's algorithm within an autonomous system. Divides AS into areas. Uses link-state advertisements (LSA). Converges faster than RIP.
Ans:
ALOHA:
Pure ALOHA: Stations transmit whenever they have data. If collision detected (no ACK), wait a random time and retransmit. Throughput: \(S = G e^{-2G}\) (max 18.4% at \(G=0.5\)).
Slotted ALOHA: Time is divided into slots. Stations can only transmit at slot boundaries. Throughput: \(S = G e^{-G}\) (max 36.8% at \(G=1\)).
CSMA (Carrier Sense Multiple Access):
Before transmitting, a station listens to the medium. If idle, transmits; if busy, waits. Variants:
- 1-persistent: Transmit immediately when idle (high collision probability).
- Non-persistent: Wait a random time if busy (lower collision, lower efficiency).
- p-persistent: Transmit with probability \(p\) when idle; defer with probability \(1-p\).
CSMA/CD (Collision Detection):
Used in wired Ethernet (IEEE 802.3). Stations listen while transmitting. If collision detected:
- Stop transmitting immediately.
- Send a jam signal to ensure all stations detect collision.
- Wait a random backoff time (binary exponential backoff).
- Retry up to 16 times, then abort.
k = min(count, 10)
Wait 0-2^k slot times"] J --> B I -->|"No"| K["Abort - Channel Failure"]
CSMA/CA (Collision Avoidance):
Used in wireless (IEEE 802.11/Wi-Fi). Stations cannot detect collisions (hidden terminal problem), so they avoid them:
- Send RTS (Request to Send) before data.
- Receiver responds with CTS (Clear to Send).
- After DIFS (DCF Inter-Frame Space), transmit data.
- Use NAV (Network Allocation Vector) to defer transmission when others are communicating.
| Protocol | Medium | Collision Handling | Efficiency |
|---|---|---|---|
| ALOHA | Shared | No sensing | ~18% |
| Slotted ALOHA | Shared | No sensing, timed slots | ~37% |
| CSMA | Bus/Star | Carrier sensing | Better |
| CSMA/CD | Wired (Ethernet) | Collision Detection | High (up to 98%) |
| CSMA/CA | Wireless (WiFi) | Collision Avoidance | Moderate |
Ans: RSA (Rivest-Shamir-Adleman, 1978) is an asymmetric cryptographic algorithm based on the computational difficulty of factoring large integers.
Key Generation:
- Choose two large primes: \(p = 3\), \(q = 11\)
- Compute \(n = p \times q = 3 \times 11 = 33\)
- Compute \(\phi(n) = (p-1)(q-1) = 2 \times 10 = 20\)
- Choose \(e\) such that \(1 < e < \phi(n)\) and \(\gcd(e, \phi(n)) = 1\). Let \(e = 7\)
- Compute \(d = e^{-1} \bmod \phi(n)\):
7d \equiv 1 \pmod{20} \Rightarrow 7d = 1 + 20k \Rightarrow d = 3
Public Key: \((e, n) = (7, 33)\). Private Key: \((d, n) = (3, 33)\).
Encryption:
Plaintext: \(M = 2\). Ciphertext: \(C = M^e \bmod n = 2^7 \bmod 33 = 128 \bmod 33 = 29\).
Decryption:
Ciphertext: \(C = 29\). Plaintext: \(M = C^d \bmod n = 29^3 \bmod 33 = 24389 \bmod 33 = 2\).
The decrypted plaintext matches the original. For real-world RSA, \(p\) and \(q\) are 1024–4096 bit primes.
Ans: HTTP (HyperText Transfer Protocol) is the application-layer protocol for the World Wide Web. It follows a client-server model where the client (browser) sends requests and the server responds.
HTTP Operations:
- GET: Retrieve a resource from server.
- POST: Submit data to server (form data, upload).
- PUT: Replace a resource on server.
- DELETE: Remove a resource.
- HEAD: Same as GET but without body (headers only).
- OPTIONS: Query supported methods.
- PATCH: Partial update of a resource.
HTTP/1.0:
- New TCP connection for each request-response.
- No persistent connections by default.
- Headers are not case-insensitive.
HTTP/1.1:
- Persistent connections by default (keep-alive).
- Pipelining (send multiple requests without waiting).
- Host header for virtual hosting.
- Chunked transfer encoding.
HTTP/2:
- Binary framing (replaces text-based format).
- Multiplexing: Multiple streams over one TCP connection.
- Header compression (HPACK).
- Server Push: Server can proactively send resources.
- Stream prioritization.
Ans: The Data Link Layer (Layer 2) is responsible for reliable communication over a physical link.
Design Issues:
- Framing: Delimiting data into frames with Start/End flags or length fields.
- Physical Addressing: MAC addresses (48 bits, OUI-based).
- Flow Control: Preventing fast sender from overwhelming slow receiver.
- Error Control: Detecting and correcting transmission errors.
- Multiple Access: Coordinating shared-medium access (CSMA/CD, Token Ring).
Error Detection:
| Technique | Method | Detects |
|---|---|---|
| Parity Check | Single bit for odd/even count | Single-bit errors |
| Checksum | Sum of data words | Some multi-bit errors |
| CRC | Polynomial division | All single, double, odd-length, burst errors |
Error Correction:
Hamming Code: For a message with \(m\) bits, need \(r\) redundant bits where \(2^r \geq m+r+1\). The code can detect and correct single-bit errors.
Flow Control Protocols:
- Stop-and-Wait: Send one frame, wait for ACK.
- Sliding Window: Send multiple frames before ACK (Go-Back-N or Selective Repeat).
Ans: IPv6 was developed by IETF to address IPv4 limitations.
Motivations for IPv6:
- Address exhaustion: IPv4 has ~4.3 billion addresses (32 bits). IPv6 has \(2^{128}\) addresses.
- No NAT required: Every device can have a globally routable address.
- Simplified header: Fixed 40-byte header vs variable IPv4 header.
- Built-in security: IPSec support at the network layer.
- Better QoS: Flow Label field for traffic prioritization.
- Efficient routing: Hierarchical addressing reduces routing table size.
IPv6 Address Types:
- Unicast: One-to-one communication (2001:0db8::1).
- Multicast: One-to-many (FF02::1 = all nodes on link).
- Anycast: One-to-one-of-many (nearest node).
IPv6 Header (40 bytes, fixed):
| Field | Bits | Purpose |
|---|---|---|
| Version | 4 | IP version (6) |
| Traffic Class | 8 | QoS priority |
| Flow Label | 20 | Identify packet flow |
| Payload Length | 16 | Upper-layer data size |
| Next Header | 8 | Extension/upper-layer protocol |
| Hop Limit | 8 | Max routers to traverse |
| Source Address | 128 | Sender address |
| Destination Address | 128 | Receiver address |
Transition Strategies:
- Dual Stack: Hosts run both IPv4 and IPv6 simultaneously.
- Tunneling: IPv6 packets encapsulated within IPv4 packets (6to4, 6in4).
- Translation: NAT-PT (Network Address Translation - Protocol Translation) converts between IPv4 and IPv6 headers.
Ans: Ethernet is the dominant LAN technology, standardized by IEEE 802.3.
Original Ethernet (10 Mbps):
- 10BASE5: Thick coaxial cable, 500m max segment, bus topology.
- 10BASE2: Thin coaxial (Thinnet), 185m max, cheaper alternative.
- 10BASE-T: Twisted pair (Cat-3), star topology with hub, 100m max.
Fast Ethernet (100 Mbps):
- 100BASE-TX: Two pairs of Cat-5 UTP, star topology with switch.
- 100BASE-FX: Two strands of multimode fiber.
- Uses CSMA/CD (though switches reduce collisions).
- Auto-negotiation for speed/duplex.
Gigabit Ethernet (1000 Mbps / 1 Gbps):
- 1000BASE-T: Four pairs of Cat-5e/Cat-6 UTP, 100m.
- 1000BASE-SX: Short wavelength (850nm) multimode fiber, up to 550m.
- 1000BASE-LX: Long wavelength (1310nm) single-mode fiber, up to 5km.
- Full-duplex only (no CSMA/CD in switched networks).
Key Differences:
| Feature | 10BASE-T | 100BASE-TX | 1000BASE-T |
|---|---|---|---|
| Speed | 10 Mbps | 100 Mbps | 1000 Mbps |
| Cable | Cat-3 UTP | Cat-5 UTP | Cat-5e/6 UTP |
| Topology | Star (hub) | Star (switch) | Star (switch) |
| CSMA/CD | Yes | Yes | No (full-duplex) |
Ans: A VLAN (Virtual LAN) is a logical grouping of devices on the same physical network into separate broadcast domains.
Motivation:
- Reduce broadcast traffic (smaller broadcast domains).
- Improve security by isolating traffic between groups.
- Flexibility — group by function, not physical location.
Types of VLANs:
- Port-based VLAN: Ports statically assigned to VLANs. Most common.
- MAC-based VLAN: Devices assigned based on MAC address.
- Protocol-based VLAN: Based on network layer protocol type.
- IP Subnet VLAN: Based on IP subnet address.
Configuration:
Switches use 802.1Q tagging (4-byte VLAN tag inserted in Ethernet frame). The tag includes VLAN ID (12 bits, up to 4094 VLANs). Trunk ports carry tagged frames for multiple VLANs. Access ports carry untagged frames for a single VLAN.
Advantages:
- Broadcast domain segmentation.
- Security isolation.
- Easy reconfiguration without physical rewiring.
- Simplified network management.
Ans: Three fundamental switching paradigms:
1. Circuit Switching:
A dedicated end-to-end circuit is established before data transfer. Used in traditional telephone networks (PSTN).
- Setup phase: Dedicated path established.
- Data transfer: Full bandwidth reserved.
- Teardown: Circuit released after use.
- Inefficient for bursty data (bandwidth wasted during silence).
2. Packet Switching:
Data is divided into packets that are routed independently. Two types:
- Datagram: Each packet routed independently (IP).
- Virtual Circuit: Logical path established (Frame Relay, ATM).
Efficient for bursty data, shared bandwidth, no wasted capacity.
3. Message Switching:
Entire message is stored at each intermediate node (store-and-forward) and forwarded when the next link is available. Used in telegraph systems. No dedicated path.
4. Broadcast Switching:
In LANs, broadcasts reach all stations. Multicasting reaches a selected group. Broadcasting reaches all nodes on the network. Managed via switches (flooding initially, then MAC address learning).
| Feature | Circuit Switching | Packet Switching | Message Switching |
|---|---|---|---|
| Dedicated path | Yes | No | No |
| Bandwidth reservation | Yes | No (shared) | No |
| Store-and-forward | No | Yes | Yes |
| Efficiency for bursty data | Low | High | Medium |
Ans: Multiple Access Protocols coordinate how multiple stations share a common communication channel.
Random Access Protocols:
| Protocol | Method | Collision Handling |
|---|---|---|
| Pure ALOHA | Transmit whenever | Random retransmit after timeout |
| Slotted ALOHA | Transmit at slot boundaries | Random retransmit after timeout |
| CSMA | Listen before transmit | No detection (wait for timeout) |
| CSMA/CD | Listen + detect collisions | Jam + binary exponential backoff |
| CSMA/CA | Listen + avoid collisions | RTS/CTS, NAV, backoff |
Controlled Access Protocols:
- Token Ring (IEEE 802.5): A token circulates around the ring. Only the station holding the token can transmit. Deterministic, no collisions.
- Token Bus (IEEE 802.4): Logical ring over physical bus topology. Stations pass a token in logical order.
Channelization Protocols:
- FDMA (Frequency Division): Channel divided into frequency bands. Each station gets a dedicated band. Used in analog cellular (1G).
- TDMA (Time Division): Channel divided into time slots. Each station gets a slot in a frame. Used in GSM (2G).
- CDMA (Code Division): All stations use full bandwidth simultaneously with unique spreading codes. Used in 3G (UMTS).
Throughput Calculations:
\text{Slotted ALOHA Throughput: } S = G e^{-G} \quad \text{(max 36.8\%)}
Ans: The Network Layer (Layer 3) provides host-to-host communication across multiple networks.
Network Layer Services:
- Routing: Determining the path from source to destination.
- Forwarding: Moving a packet from router input to appropriate output.
- Logical Addressing: IP addresses for host identification.
- Fragmentation/Reassembly: Dividing large packets at routers and reassembling at destination.
IP Protocol:
IPv4 Header (minimum 20 bytes):
- Version (4 bits): 4
- IHL (4 bits): Header length in 32-bit words
- Total Length (16 bits): Header + Data (max 65535 bytes)
- TTL (8 bits): Max router hops
- Protocol (8 bits): Upper-layer protocol (6=TCP, 17=UDP)
- Header Checksum (16 bits): Header error detection
- Source/Dest IP (32 bits each)
Fragmentation and Reassembly:
When a packet is too large for the next link's MTU, the router fragments it:
- Identification (16 bits): Same for all fragments of one packet.
- Flags (3 bits): DF (Don't Fragment), MF (More Fragments).
- Fragment Offset (13 bits): Position of fragment in original packet (in 8-byte units).
\text{Offset}_i = \text{Offset}_{i-1} + \frac{\text{Data}_{i-1}}{8}
Reassembly:
Only the destination host reassembles fragments. Uses the Identification field to group fragments, and Fragment Offset + MF flag to order them.
Routing Algorithms:
- RIP: Distance vector, hop count metric, 30s updates, max 15 hops.
- OSPF: Link state, Dijkstra's SPF, areas, fast convergence.
- BGP: Path vector, inter-AS routing, policy-based.
Multicast Routing:
Multicast delivers packets to a group of interested receivers. Uses IGMP for group management and PIM/DVMRP/MOSPF for multicast routing.