∑GateAndNet
PlannerSign Up
ADVANCEDFrequently Tested 4 min read 7 views

Networks 2027 Rank-Decider: Token Bucket Burst Math, TCP Wrap-Around, BGP Policies & DNS RTTs

Token Bucket vs Leaky Bucket maximum burst duration formula, 32-bit TCP sequence wrap-around time on high-speed fiber, Distance-Vector 3-node count-to-infinity, BGP AS valley-free routing, and DNS + HTTP RTTs.

1. Traffic Shaping: Leaky Bucket vs Token Bucket (GATE NAT Classic)

  • Leaky Bucket: Smooths bursty traffic into a strictly constant output rate ρ\rho regardless of how full the bucket is (cannot send bursts faster than ρ\rho!).
  • Token Bucket (Capacity CC, Token Rate ρ\rho, Peak Output Link M>ρM > \rho): Starts full with CC tokens. Draining at peak rate MM while refilling at ρ\rho exhausts the bucket at S=CM−ρS = \frac{C}{M - \rho} seconds!
    • Quick Example: C=1 MB,  ρ=2 MB/s,  M=10 MB/s  ⟹  S=110−2=0.125 sC = 1\text{ MB},\; \rho = 2\text{ MB/s},\; M = 10\text{ MB/s} \implies S = \frac{1}{10 - 2} = \mathbf{0.125\text{ s}}, transmitting 10×0.125=1.25 MB10 \times 0.125 = \mathbf{1.25\text{ MB}} at peak speed before throttling to 2 MB/s2\text{ MB/s}!

2. Routing Nuances: OSPF vs RIP vs BGP-4

ProtocolScope & AlgorithmTransport CarrierMetric & Critical Exam Nuance
RIPIntra-AS (IGP) • Distance VectorUDP Port 520Hop count (max 1515; 16=∞16 = \infty); Poisoned Reverse fails on ≥3\ge 3-node cycles!
OSPFIntra-AS (IGP) • Link-State (Dijkstra)Directly over IP (Proto 89)Bandwidth/cost; floods LSAs to all routers in area
BGP-4Inter-AS (EGP) • Path-VectorTCP Port 179Policy + AS-PATH attribute (prevents loops in O(1)\mathcal{O}(1) by checking own ASN!)

3. End-to-End Web Page Load RTT Formula (DNS + TCP + HTTP)

Suppose visiting a page requires kk uncached iterative DNS lookups (RTT1,…,RTTk\text{RTT}_1, \dots, \text{RTT}_k), followed by fetching a base HTML file + mm embedded images from an origin server at RTT0\text{RTT}_0 (ignoring transmission delay):

  • Non-Persistent HTTP/1.0 (Serial): ∑i=1kRTTi+2 RTT0 (HTML)+m⋅(2 RTT0)\sum_{i=1}^k \text{RTT}_i + 2\,\text{RTT}_0\text{ (HTML)} + m \cdot (2\,\text{RTT}_0)!
  • Persistent HTTP/1.1 without Pipelining: ∑RTTi+RTT0⏟TCP SYN+RTT0⏟HTML+m⋅RTT0\sum \text{RTT}_i + \underbrace{\text{RTT}_0}_{\text{TCP SYN}} + \underbrace{\text{RTT}_0}_{\text{HTML}} + m \cdot \text{RTT}_0.
  • Persistent HTTP/1.1 WITH Pipelining (or HTTP/2 Multiplexing): ∑RTTi+RTT0 (TCP)+RTT0 (HTML)+1⋅RTT0 (all m objects together!)\sum \text{RTT}_i + \text{RTT}_0\text{ (TCP)} + \text{RTT}_0\text{ (HTML)} + \mathbf{1 \cdot \text{RTT}_0}\text{ (all } m \text{ objects together!)}.
Key Formulas Summary
Token Bucket Maximum Burst Duration S & Maximum Burst Traffic
C+ρ⋅S=M⋅S  ⟹  S=CM−ρ,Max Burst Bytes=M⋅S=M⋅CM−ρC + \rho \cdot S = M \cdot S \implies S = \frac{C}{M - \rho}, \qquad \text{Max Burst Bytes} = M \cdot S = \frac{M \cdot C}{M - \rho}
Note: C = bucket capacity, rho = token arrival rate, M = maximum output link rate (M > rho)!
TCP 32-Bit Byte Sequence Number Wrap-Around Time
Twrap=232 bytesBbytes/sec=232×8 bitsBbits/secT_{\text{wrap}} = \frac{2^{32} \text{ bytes}}{B_{\text{bytes/sec}}} = \frac{2^{32} \times 8 \text{ bits}}{B_{\text{bits/sec}}}
Note: Must enforce T_wrap > MSL (Maximum Segment Lifetime, e.g. 60s-120s), else use TCP PAWS timestamp option!
#Computer Networks#Token Bucket#TCP Wrap-Around#BGP#OSPF#DNS#GATE CS 2027

Practice Questions on This Chapter (2)

Q1GATE CS 2027 Expected NATNATMEDIUM
+2M • 0 Neg

A Token Bucket shaper has bucket capacity C=500 KBC = 500\text{ KB}, token refill rate ρ=4 MB/s\rho = 4\text{ MB/s}, and maximum output link rate M=24 MB/sM = 24\text{ MB/s}. Starting with a full bucket, what is the maximum burst duration SS in milliseconds during which the output can transmit continuously at 24 MB/s24\text{ MB/s}?

Q2GATE CS 2026–27 ExpectedNATMEDIUM
+2M • 0 Neg

A high-speed TCP connection transmits continuously at 1 GigaByte/sec1\text{ GigaByte/sec} (230 bytes/sec2^{30}\text{ bytes/sec}). In how many seconds does the 3232-bit TCP sequence number space (232 bytes2^{32}\text{ bytes}) wrap around completely?

Previous TopicTCP 3-Way Handshake, AIMD Congestion Control & Routing (Distance Vector vs OSPF)