INFO 253B: Backend Web Architecture

Kay Ashaolu

Telephone Numbers

  • Specify a device, not necessarily a person
  • But to call a person, we eventually need to call a device
  • How do we map between a person and their phone?

Hostnames -> IP Addresses

  • Just like my telephone number, we associate names like to a number
  • Association is done using Domain Name Service (DNS)
  • DNS has a hierarchy for finding who can authoritatively provide an IP address, and typically has caching once the question has been answered

Parts of a hostname

  • Top Level Domain: highest level in domain hierarchy:
    .com .org .edu .uk .cn
  • Subdomain: labels specifying the hierarchy reading from right to left
  • Hostname: domain name with an IP address

Hostnames -> Addresses

  • To find a mapping, a client asks a root name server
  • The nameservers will recursively direct the client to the domain authority
  • Authority will return an IP address, client may optionally cache

Hostnames -> IP Addresses


Kays-MacBook-Air:~ Professor$ host -v -t A
Trying ""
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16909
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;	IN	A


Received 85 bytes from in 59 ms

Mapping Types

  • A: IP Address (main record type)
  • CNAME: alias for another domain name
  • MX: mail transfer agents
  • TXT: meta data

Why separate names & addresses?

  • Different semantic meaning
  • May want other mappings: names to street addresses
  • They don't have to be the same, so keep flexibility


  • Inefficient to always start at the root
  • Instead, ask a "local" server
  • "local" server does the recursive lookup, caches result


  • Type in a URL with domain name (eg.
  • Browser uses DNS to find IP address (eg.
  • Connects to address on a port (eg. 80)
  • Sends packets of data containing GET / HTTP/1.1

IP is unreliable

  • Best effort delivery
  • No guarantees
  • How do we build a reliable Web on it?

Transport Control Portocol (TCP)

  • Correctness: prevent data corruption
  • Reliability: ensure delivery or error
  • Ordering: add sequence numbers
  • Congestion: back off


  • Take the bits in a message
  • Add them up
  • Append the sum
  • Example: "kay" = 107 + 97 + 121 = 325


  • When a machine receives a packet, it acknowledges it
  • If a machine does not receive an ack, it resends
  • To keep track of messages, uses a sliding window


  • Packets can be sent out of order because of congestion, retry, etc.
  • How do we know the right order?
  • Agree on a starting number, send numbered packets
  • Client will keep track of packets received, deliver data in order to app

Three-Way Handshake

  • SYN: Synchronize using a random starting number
  • SYN-ACK: Acknowledge syn packet with an ack number and its own random starting number
  • ACK: Acknowledge the SYN-ACK packet


  • Why are packets delayed?
  • Often it is because the system is overwhelmed
  • So back off! If it is still overwhelmed, back off more!


  • TCP/IP most commonly used, but not the only ones!
  • UDP (User Datagram) used for DNS
  • Real-time protocols (voice, video) may value timeliness over correctness


  • Internet is a network of networks
  • IP used to send packets between two addresses
  • DNS maps names to addresses
  • TCP ensures reliable communication
  • Web built on Internet technology


Made with