Back to Study Material GATE Exam

Last Minute Notes Computer Networks

For last-minute network revision, consolidate the key formulas and protocol behaviors that GATE tests most frequently. Start with the physical layer. Shan...

Last Minute Notes Computer Networks

Quick Revision: Physical and Data Link Layer

For last-minute network revision, consolidate the key formulas and protocol behaviors that GATE tests most frequently. Start with the physical layer.

Shannon capacity: C = B log2(1 + SNR). Nyquist capacity (noiseless): C = 2B log2 V. Bandwidth is in Hz; capacity is in bits per second. Always distinguish between bandwidth (Hz) and data rate (bps) — they are related by encoding but are not the same quantity.

Transmission delay (also called serialization delay) is the time to push all bits of a frame onto the wire: Tt = frame size (bits) divided by link bandwidth (bps). Propagation delay is the time for a bit to travel from sender to receiver: Tp = link length divided by propagation speed. Processing delay and queuing delay also exist at routers but are usually given directly in GATE problems.

Stop-and-wait efficiency: 1/(1 + 2a) where a = Tp/Tt. For window W: efficiency = W/(1 + 2a) if W less than (1 + 2a), else 1. Remember: Go-Back-N window max = 2 raised to n minus 1; Selective Repeat window max = 2 raised to (n minus 1), where n is the number of bits in the sequence number field.

Error detection: parity adds 1 bit and detects all odd-bit errors. CRC can detect all burst errors shorter than the generator polynomial degree r, all burst errors of exactly r+1 bits with probability 1 minus 2 raised to (negative r), and all burst errors longer than r with probability 1 minus 2 raised to (negative r). Hamming code with r parity bits corrects single-bit errors in words up to 2 raised to r minus r minus 1 data bits long.

CSMA/CD (used in Ethernet): before transmission, check if channel is idle. If collision detected, send jam signal, back off using binary exponential backoff (wait 0 to 2 raised to k minus 1 slot times after the kth collision), and retry. Slot time must be at least 2 times Tp (round-trip propagation) to ensure the transmitter still occupies the channel when a collision signal returns.

Quick Revision: Network Layer and IP Concepts

IP subnetting shortcut: given IP address A.B.C.D/n, the block size for the last relevant octet is 256 minus the subnet mask octet value. For /26, mask is 255.255.255.192; block size = 256 minus 192 = 64. Subnets start at multiples of 64 in the last octet: 0, 64, 128, 192.

Private IP ranges (not routable on the internet): 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0 to 172.31.255.255), 192.168.0.0/16. The loopback range is 127.0.0.0/8.

IPv6 uses 128-bit addresses written as eight groups of four hexadecimal digits separated by colons. A double colon (::) compresses one or more groups of all zeros. IPv6 eliminates NAT by providing enough address space for every device globally. It has no broadcast; multicast replaces broadcast for one-to-many communication.

ICMP: type 0 = Echo Reply, type 8 = Echo Request (used by ping), type 11 = Time Exceeded (used by traceroute), type 3 = Destination Unreachable. TTL starts at a sender-specified value (commonly 64 or 128) and is decremented by each router. When TTL reaches zero, the router discards the packet and sends ICMP Time Exceeded back to the source.

Routing protocol families: Interior Gateway Protocols (IGP) route within an autonomous system — RIP (distance-vector, hop count metric, max 15 hops), OSPF (link-state, Dijkstra's algorithm, supports VLSM). Exterior Gateway Protocols (EGP) route between autonomous systems — BGP (path-vector, uses AS-path attribute for loop prevention).

Dijkstra's algorithm for link-state routing: initialize all nodes as unvisited with cost infinity except the source (cost zero). Repeatedly select the unvisited node with minimum known cost, update its neighbors' costs if a shorter path exists through this node, and mark it visited. This gives the shortest path tree from the source in O(V squared) time with a simple implementation or O(E log V) with a priority queue.

Quick Revision: Transport and Application Layer Essentials

TCP versus UDP: TCP provides reliable delivery, connection-oriented service, flow control (receive window), congestion control, in-order delivery, and full-duplex communication. UDP provides unreliable, connectionless, low-overhead datagram service with no flow or congestion control. Well-known TCP ports: HTTP 80, HTTPS 443, FTP 21 (control) and 20 (data), SSH 22, SMTP 25, DNS 53 (also UDP). DNS uses both TCP and UDP on port 53 — UDP for queries under 512 bytes, TCP for larger responses or zone transfers.

TCP three-way handshake: SYN (client to server, seq = x), SYN-ACK (server to client, seq = y, ack = x+1), ACK (client to server, ack = y+1). After this, data transfer begins. Connection close: initiator sends FIN, receiver sends ACK, receiver sends FIN, initiator sends ACK and waits in TIME_WAIT state for 2*MSL (Maximum Segment Lifetime) before closing fully, to handle delayed packets.

TCP congestion control: slow start — cwnd starts at 1 MSS and doubles per RTT until ssthresh. Congestion avoidance — after ssthresh, cwnd grows by 1 MSS per RTT. On triple duplicate ACK (Reno): ssthresh = cwnd/2, cwnd = ssthresh, enter congestion avoidance. On timeout: ssthresh = cwnd/2, cwnd = 1 MSS, restart slow start.

TCP throughput approximation: throughput = (MSS / RTT) times (1 / sqrt(loss rate)). This is the Mathis formula, occasionally referenced in GATE for approximate bandwidth calculations.

DNS hierarchy: root servers (13 clusters) → TLD servers (.com, .in, etc.) → authoritative servers (example.com). Recursive resolver does all lookups on behalf of the client. Iterative resolver returns referrals for the client to follow. DNS caching stores records with a Time-To-Live (TTL); cached records are reused until TTL expires. Negative caching stores the fact that a domain does not exist for NXDOMAIN responses.