Skip to content
GATEiit

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

    OSI: A, P, S, T, N, DL, PhTCP/IP: App, Transport, Internet, Link

    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

    η=payloadpayload+∑headers (and trailers)

    Each layer adds its own header; the link layer may also add a trailer (e.g. CRC).

Switching and performance metrics

  • Transmission delay

    Tt=LB

    L = packet length in bits, B = bandwidth in bits/s. Watch units: 1 KB = 8×1024 bits but 1 Mbps = 106 bits/s.

  • Propagation delay

    Tp=dv

    d = distance, v = signal speed (about 2×108 m/s in cable unless given). Independent of packet size.

  • Total nodal delay

    dtotal=Tt+Tp+dqueue+dproc

    Queueing and processing are usually taken as 0 unless given.

  • RTT and bandwidth-delay product

    RTT=2Tp,BDP=B×Tp

    BDP = bits in flight on the link one way; some questions use B×RTT (bits needed to keep the pipe full). Check the question.

  • Store-and-forward, one packet

    T=h(LB+Tp)

    h = number of links (h−1 routers), identical links, no queueing or processing delay.

  • Store-and-forward, P packets

    T=(h+P−1)LpB+h Tp

    Message split into P equal packets of Lp bits (including headers) over h identical links: pipelining effect.

  • Circuit switching

    T=tsetup+LB+∑Tp

    Data is not stored at intermediate switches; one transmission delay for the whole message.

  • Virtual circuit

    setup phase+store-and-forward of packets on fixed path

    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

    detect d: dmin⁡≥d+1correct t: dmin⁡≥2t+1

    dmin = minimum Hamming distance between any two valid codewords.

  • Hamming code check bits

    2r≥m+r+1

    m data bits, r parity bits for single-error correction. Parity bits sit at positions 1, 2, 4, 8, …

  • Single parity bit

    detects all odd-numbered bit errors

    Fails for any even number of flipped bits.

  • CRC procedure

    T(x)=xrM(x)+[xrM(x) mod G(x)]

    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

    all single-bit, all bursts of length≤r

    Assumes G(x) has a non-zero x0 term (then all single-bit errors and all bursts of length ≤ r are caught). Also all odd-numbered errors if (x+1) 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

    checksum=one’s complement sum of 16-bit words‾

    Receiver adds all words including checksum; result all 1s means no detected error.

Flow control and medium access

  • Stop-and-wait efficiency

    η=TtTt+2Tp=11+2a,a=TpTt

    Ignores ACK transmission and processing time; add them to the denominator if given. Throughput = ηB.

  • Sliding window efficiency

    η=min⁡(1, W1+2a)

    W = sender window in frames, error-free channel. Same for GBN and SR.

  • Window for full utilisation

    W≥1+2a

    Sender must keep transmitting for a full Tt+2Tp.

  • Window size limits (k-bit seq. no.)

    GBN: Ws≤2k−1, Wr=1SR: Ws=Wr≤2k−1

    Stop-and-wait: Ws=Wr=1, needs 1 bit.

  • Sequence bits for window W

    GBN: k=⌈log⁡2(W+1)⌉SR: k=⌈log⁡2(2W)⌉

    Follows from the window limits above. Example: W = 7 needs 3 bits for GBN but 4 bits for SR.

  • Stop-and-wait with errors

    η=1−p1+2a

    p = probability a frame (or its ACK) is lost; expected transmissions per frame = 1/(1−p), assuming timeout ≈ Tt+2Tp.

  • Pure ALOHA

    S=G e−2G,Smax⁡=12e≈0.184 at G=0.5

    Vulnerable time 2Tt. G = frames attempted per frame time.

  • Slotted ALOHA

    S=G e−G,Smax⁡=1e≈0.368 at G=1

    Vulnerable time Tt. Probability exactly one of N stations (each prob p) transmits = Np(1−p)N−1.

  • CSMA/CD minimum frame

    Lmin⁡=2 Tp×B

    Transmission must last at least one round-trip so a collision is detected while still sending.

  • CSMA/CD efficiency

    η≈11+6.44 a

    Standard textbook approximation for Ethernet, a=Tp/Tt.

  • Binary exponential backoff

    K∈{0,1,…,2min⁡(n,10)−1},wait=K×slot time

    After the n-th collision; give up after 16 attempts. Slot time = 512 bit times (51.2 µs at 10 Mbps).

  • Ethernet frame facts

    64≤frame≤1518 bytes,46≤payload≤1500

    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

    Dx(y)=min⁡v∈N(x){c(x,v)+Dv(y)}

    Distance vector: each node shares its vector only with neighbours. Used by RIP (hop count, infinity = 16).

  • Count-to-infinity

    bad news travels slowly

    Occurs after a link cost increase or failure in DV. Split horizon and poison reverse fix two-node loops, not all loops.

  • Link state

    flood LSPs → Dijkstra O(n2)

    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

    addresses=232−n,usable hosts=232−n−2

    Prefix /n. The all-0 host part is the network address, all-1 is directed broadcast.

  • Network and broadcast address

    net=IP & mask,bcast=net ∣ ¬ mask

    Bitwise AND / OR with the subnet mask.

  • Subnetting

    borrow s bits⇒2s subnets of 232−n−s addresses

    Modern (CIDR) counting allows all 2s subnets; old classful rules excluded all-0 and all-1 subnets (2s−2).

  • CIDR block validity

    first address≡0(mod232−n)

    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

    forward on the matching entry with the largest n

    If no specific entry matches, use the default route 0.0.0.0/0.

  • Classful ranges

    A:0–127, B:128–191, C:192–223, D:224–239, E:240–255

    First octet. Default masks /8, /16, /24. Class D is multicast.

  • Private ranges (NAT)

    10.0.0.0/8,172.16.0.0/12,192.168.0.0/16

    NAT/NAPT maps (private IP, port) to (public IP, port); about 64K connections per public IP via 16-bit ports.

  • IPv4 header

    20≤header≤60 bytes,HLEN=header bytes4

    Total length field is 16 bits: datagram ≤ 65535 bytes. TTL decremented and checksum recomputed at every router.

  • Fragment data size

    Df=⌊MTU−H8⌋×8

    Every fragment except the last carries a multiple of 8 data bytes. H = IP header (usually 20).

  • Number of fragments

    N=⌈DDf⌉

    D = data (payload) bytes of the original datagram, not total length. Each fragment gets its own IP header.

  • Fragment offset

    offset=byte position of fragment data in original8

    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

    20≤header≤60 bytes,seq. no. counts bytes

    SYN and FIN each consume one sequence number; pure ACKs consume none. UDP header is 8 bytes.

  • Sequence wrap-around time

    Twrap=232bandwidth in bytes/s

    To avoid wrap within lifetime LT, seq. bits k need 2k≥B×LT (bytes).

  • Advertised window limit

    Wmax⁡=65535×2S bytes, S≤14

    16-bit window field; S = window scale option (0 if absent).

  • Throughput bound

    throughput≤WRTT

    Effective sender window W=min⁡(cwnd,rwnd).

  • Slow start

    cwnd←cwnd+1 MSS per ACK ⇒ doubles every RTT

    Starts at 1 MSS and runs while cwnd < ssthresh.

  • Congestion avoidance

    cwnd←cwnd+1 MSS per RTT

    Additive increase once cwnd ≥ ssthresh.

  • On timeout

    ssthresh=cwnd2,cwnd=1 MSS

    Same in Tahoe and Reno; slow start begins again.

  • On 3 duplicate ACKs (Reno)

    ssthresh=cwnd2,cwnd=ssthresh (+3)

    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

    server: socket→bind→listen→acceptclient: socket→connect

    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 53, HTTP 80, HTTPS 443, SMTP 25, FTP 20/21

    DNS queries normally use UDP (TCP for zone transfers and large replies); HTTP uses TCP.

  • Non-persistent HTTP

    T=(N+1)(2 RTT+Tt)

    Base page + N objects fetched serially; each needs TCP handshake RTT + request/response RTT.

  • Persistent HTTP

    no pipelining: 2RTT+N⋅RTTpipelining: 2RTT+RTT

    Plus transmission times. One TCP connection reused for all objects; pipelined requests for N objects need about one RTT.

  • DNS resolution

    iterative: TDNS=∑servers queriedRTTi

    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.

Where marks come fromTopic-wise PYQ analysis →Use the formulasPractise PYQs on this subject →For numerical answersGATE virtual calculator →