Q5Computer Networks
Question
Q.5. (a) Draw and explain Domain Name System (DNS) record structure. [8]
(b) Differentiate leaky bucket and token bucket implementation. [8]
Answer
Domain Name System (DNS) Record Structure
| Field | Description |
|---|---|
| Name | The domain name to which this resource record applies (e.g., www.example.com) |
| Type | The type of resource record (A for an IPv4 address, AAAA for an IPv6 address, CNAME for a canonical name alias, MX for a mail exchange server, NS for a name server, and similar record types) |
| Class | The protocol family the record applies to, almost universally 'IN' (Internet) in practice |
| TTL (Time To Live) | The duration, in seconds, that this record may be cached by a resolver before it must be re-queried from the authoritative name server |
| Value (RDATA) | The actual data associated with this record, whose format depends on the record Type (for example, an IP address for an A record, or a domain name for a CNAME or NS record) |
The Domain Name System (DNS) maintains a globally distributed database mapping human-readable domain names (such as www.example.com) to their corresponding IP addresses and other associated information, organized as a hierarchical collection of resource records, each following the standard record structure summarized in the table above. When a DNS resolver queries a name server for information about a given domain name, the name server responds with one or more resource records matching the queried name and record type, each record specifying the queried domain Name, the record Type (determining how the Value field should be interpreted), the Class (almost always 'IN' for Internet), a Time-To-Live (TTL) value indicating how long the record may be cached before requiring re-verification, and the actual record Value (RDATA) itself.
Common DNS record types include the A record (mapping a domain name directly to an IPv4 address), the AAAA record (mapping a domain name to an IPv6 address), the CNAME record (mapping a domain name as an alias pointing to another canonical domain name, useful for allowing multiple domain names to resolve to the same underlying server without duplicating address records), the MX record (specifying the mail server(s) responsible for accepting email for the domain, along with a priority value determining preferred mail server order), and the NS record (specifying which name servers are authoritative for the domain, allowing DNS resolution queries to be correctly delegated to the appropriate authoritative source). This hierarchical, distributed, and cacheable record structure is what allows the DNS to scale to resolve billions of domain name lookups daily across the global Internet, with the TTL-based caching mechanism substantially reducing the query load on authoritative name servers by allowing intermediate resolvers to serve repeated queries for the same domain name directly from their local cache until the TTL expires.
Leaky Bucket vs Token Bucket Implementation
The leaky bucket algorithm regulates the rate at which data packets are admitted onto a network by conceptually modeling incoming traffic as water poured into a bucket with a small hole in the bottom, through which water (packets) leaks out at a constant, fixed rate regardless of how much water is currently in the bucket or how fast it is being poured in; if the bucket overflows (incoming traffic exceeds the bucket's buffering capacity), excess packets are simply discarded. This produces perfectly smooth, constant-rate output traffic from potentially bursty input traffic, but has the significant limitation that it cannot accommodate any burstiness in the output traffic at all - even if the network has spare capacity momentarily available, the leaky bucket's fixed output rate cannot be exceeded to take advantage of it.
The token bucket algorithm instead maintains a bucket of tokens, with new tokens added to the bucket at a constant rate (representing the average allowed transmission rate) up to a maximum bucket capacity; each transmitted packet must consume one (or more, proportional to packet size) tokens from the bucket, and a packet can only be transmitted if sufficient tokens are currently available. Critically, if the bucket has accumulated tokens during a period of low traffic (since tokens continue accumulating up to the bucket capacity even when no packets are being sent), this allows a subsequent burst of traffic to be transmitted immediately, up to the number of currently accumulated tokens, before being throttled back to the steady average rate - this ability to accommodate bounded traffic bursts while still enforcing a long-term average rate limit is the key practical advantage of token bucket over leaky bucket traffic shaping, which is why token bucket (or refinements of it) is the traffic-shaping and policing mechanism most widely used in modern quality-of-service-aware network equipment and traffic engineering standards.
It is worth noting that DNS caching, governed by each record's TTL value, involves a fundamental trade-off directly analogous to caching trade-offs found throughout computer systems more generally: a longer TTL reduces load on authoritative name servers and speeds up subsequent lookups by allowing more aggressive caching, but also means that any change to the underlying record (such as moving a website to a new server with a different IP address) takes longer to propagate to all resolvers currently holding a cached copy of the old record, requiring network administrators to carefully balance TTL duration against the anticipated frequency of legitimate record changes for each specific domain.
The token bucket's burst-tolerance advantage over the leaky bucket becomes particularly significant in modern network traffic engineering contexts involving highly variable-bit-rate traffic sources, such as compressed video streaming, where the token bucket's ability to absorb natural traffic burstiness (video frames of widely varying compressed size, for example) without either excessive smoothing delay or unnecessary packet discard makes it far better suited to shaping and policing such traffic than the leaky bucket's rigid, constant-output-rate behavior.
Modern DNS deployments increasingly incorporate additional security-focused record types beyond the basic set described above, most notably DNSSEC-related records (such as RRSIG and DNSKEY records), which add cryptographic signatures to DNS responses specifically to protect against DNS spoofing and cache-poisoning attacks, addressing a well-known security weakness of the original, unauthenticated DNS protocol design, and illustrating that the DNS record structure has continued to evolve substantially since its original design to address newly identified security requirements as the DNS has grown into critical global Internet infrastructure.
Together with DNSSEC, these evolving DNS record types illustrate how the DNS continues to be actively extended to meet new security and functional requirements decades after its original design.