GATE CSE Computer Networks formula sheet
Key formulas and rules for GATE CSE Computer Networks: layering, delays and switching, error detection, flow control and MAC, routing, IPv4 addressing and fragmentation, TCP, and DNS/HTTP.
56 formulas · updated 2026-11-14 · reviewed 2026-11-14 · Spotted an error? Tell us
Principles of layering
OSI and TCP/IP layers
PDUs: segment (transport), packet/datagram (network), frame (data link), bits (physical). Routers work up to layer 3, switches layer 2, hubs layer 1.
Header overhead
Each layer adds its own header; the link layer may also add a trailer (e.g. CRC).
Switching and performance metrics
Transmission delay
L = packet length in bits, B = bandwidth in bits/s. Watch units: 1 KB = 8×1024 bits but 1 Mbps = bits/s.
Propagation delay
d = distance, v = signal speed (about m/s in cable unless given). Independent of packet size.
Total nodal delay
Queueing and processing are usually taken as 0 unless given.
RTT and bandwidth-delay product
BDP = bits in flight on the link one way; some questions use (bits needed to keep the pipe full). Check the question.
Store-and-forward, one packet
h = number of links (h−1 routers), identical links, no queueing or processing delay.
Store-and-forward, P packets
Message split into P equal packets of bits (including headers) over h identical links: pipelining effect.
Circuit switching
Data is not stored at intermediate switches; one transmission delay for the whole message.
Virtual circuit
Packets follow one path and arrive in order; datagram packets may take different paths and arrive out of order.
Data link layer: error detection
Hamming distance condition
= minimum Hamming distance between any two valid codewords.
Hamming code check bits
m data bits, r parity bits for single-error correction. Parity bits sit at positions 1, 2, 4, 8, …
Single parity bit
Fails for any even number of flipped bits.
CRC procedure
G(x) of degree r: append r zeros, divide (mod-2, XOR), replace zeros by the r-bit remainder. Receiver accepts if remainder is 0.
CRC detection power
Assumes G(x) has a non-zero term (then all single-bit errors and all bursts of length ≤ r are caught). Also all odd-numbered errors if divides G(x); all double errors if G(x) is suitably chosen (e.g. has a primitive factor) and the frame is short enough.
Internet checksum
Receiver adds all words including checksum; result all 1s means no detected error.
Flow control and medium access
Stop-and-wait efficiency
Ignores ACK transmission and processing time; add them to the denominator if given. Throughput = .
Sliding window efficiency
W = sender window in frames, error-free channel. Same for GBN and SR.
Window for full utilisation
Sender must keep transmitting for a full .
Window size limits (k-bit seq. no.)
Stop-and-wait: , needs 1 bit.
Sequence bits for window W
Follows from the window limits above. Example: W = 7 needs 3 bits for GBN but 4 bits for SR.
Stop-and-wait with errors
p = probability a frame (or its ACK) is lost; expected transmissions per frame = , assuming timeout ≈ .
Pure ALOHA
Vulnerable time . G = frames attempted per frame time.
Slotted ALOHA
Vulnerable time . Probability exactly one of N stations (each prob p) transmits = .
CSMA/CD minimum frame
Transmission must last at least one round-trip so a collision is detected while still sending.
CSMA/CD efficiency
Standard textbook approximation for Ethernet, .
Binary exponential backoff
After the n-th collision; give up after 16 attempts. Slot time = 512 bit times (51.2 µs at 10 Mbps).
Ethernet frame facts
Header 14 bytes + CRC 4 bytes (preamble and SFD, 8 bytes, not counted). MAC address 48 bits. Manchester coding: baud rate = 2 × bit rate.
Routing: distance vector and link state
Bellman-Ford update
Distance vector: each node shares its vector only with neighbours. Used by RIP (hop count, infinity = 16).
Count-to-infinity
Occurs after a link cost increase or failure in DV. Split horizon and poison reverse fix two-node loops, not all loops.
Link state
Every node knows the whole topology; no count-to-infinity. Used by OSPF. Flooding message cost O(nE).
IPv4: addressing, fragmentation and NAT
Hosts in a subnet
Prefix /n. The all-0 host part is the network address, all-1 is directed broadcast.
Network and broadcast address
Bitwise AND / OR with the subnet mask.
Subnetting
Modern (CIDR) counting allows all subnets; old classful rules excluded all-0 and all-1 subnets ().
CIDR block validity
A block must have a power-of-2 size and start at a multiple of its size. Aggregation needs contiguous blocks satisfying this.
Longest prefix match
If no specific entry matches, use the default route 0.0.0.0/0.
Classful ranges
First octet. Default masks /8, /16, /24. Class D is multicast.
Private ranges (NAT)
NAT/NAPT maps (private IP, port) to (public IP, port); about 64K connections per public IP via 16-bit ports.
IPv4 header
Total length field is 16 bits: datagram ≤ 65535 bytes. TTL decremented and checksum recomputed at every router.
Fragment data size
Every fragment except the last carries a multiple of 8 data bytes. H = IP header (usually 20).
Number of fragments
D = data (payload) bytes of the original datagram, not total length. Each fragment gets its own IP header.
Fragment offset
MF = 1 on all but the last fragment; DF = 1 forbids fragmentation (packet dropped, ICMP sent). Reassembly only at destination.
TCP: flow and congestion control, sockets
TCP header and sequence numbers
SYN and FIN each consume one sequence number; pure ACKs consume none. UDP header is 8 bytes.
Sequence wrap-around time
To avoid wrap within lifetime LT, seq. bits need (bytes).
Advertised window limit
16-bit window field; S = window scale option (0 if absent).
Throughput bound
Effective sender window .
Slow start
Starts at 1 MSS and runs while cwnd < ssthresh.
Congestion avoidance
Additive increase once cwnd ≥ ssthresh.
On timeout
Same in Tahoe and Reno; slow start begins again.
On 3 duplicate ACKs (Reno)
Fast retransmit + fast recovery. Tahoe instead sets cwnd = 1 MSS. GATE questions often use cwnd = ssthresh without the +3.
RTT estimation (Jacobson)
Typically α = 1/8, β = 1/4. Update Dev using the old SRTT. Basic (older) scheme: RTO = 2 × SRTT.
Socket API order
accept() blocks and returns a new socket per connection. UDP uses socket, bind, sendto/recvfrom with no listen/accept/connect needed.
DNS and HTTP
Well-known ports
DNS queries normally use UDP (TCP for zone transfers and large replies); HTTP uses TCP.
Non-persistent HTTP
Base page + N objects fetched serially; each needs TCP handshake RTT + request/response RTT.
Persistent HTTP
Plus transmission times. One TCP connection reused for all objects; pipelined requests for N objects need about one RTT.
DNS resolution
Recursive: each server queries the next on the client's behalf. Caching (with TTL) removes most lookups; DNS lookup time adds to HTTP response time.