Lecture 04
Lecture 04
Lecture 04
Distributed Systems
Lecture 4: Naming
Instructor: YU Haifeng
Today’s Roadmap
Chapter 5 of textbook
P2P and DHT is a important topic and will be covered in a
separate lecture
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 2
Motivation for Naming
Example: We want to visit www.nus.edu.sg
The web server is located in some room that we don’t know
There may be multiple web servers
ISP’s may want to serve the content from their own
machines – Akamai
www.nus.edu.sg ip address some physical machine
(with specific MAC address)
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 3
Basic Concepts in Naming
General definition for naming:
We have a “name” and we want to find/locate the “entity”
Definitions in the textbook is unnecessarily convoluted, and
sometimes circular – please ignore those
A lot of things can be called “naming” – just a definition issue – no
need to draw a black-and-white boundary
Name space: The set of all possible names in the given context
Naming system: The system that enables you to find the “entity”
Name resolution
The naming system can be either non-distributed or distributed
Same tradeoff as before…
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 4
Different Kinds of Names
Every name is a bit string
Some are human-friendly
Alias
Multiple names for the same entity
Similar as symbolic links
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 5
Merging Name Spaces
We have two different name spaces
Now we want to define a unified name space
Name space merging
Generalizes to multiple name spaces…how?
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 6
Solution 1: New Root Node
Merge by adding a new root node and make existing
root nodes its children
In principle, you always have to start in the new root
But you can avoid this by including the identifier of node
from where resolution should start
Example, ~/XXX
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 7
Example: New Root Node
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 8
Solution 2: Mounting
Introduce nodes that contain the name of a node in a
“foreign” name space
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 9
Example of Mounting
Mounting
Point
Mount Point
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 10
Simple Naming: Broadcast
The “naming system” may or may not be a stand-
alone software module
Drawback: performance
Alleviated but not fully addressed by using multicast
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 11
Simple Naming: Forwarding Pointers
Forwarding pointers: Same idea as mail forwarding
The machine A with ip_addr1 was initially the web server for
www.nus.edu.sg
We want to use another B machine now with ip_addr2 as the server
Drawback:
A needs to stay there forever
The forwarding chain can become long
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 12
Simple Naming: Home-Based Approach
Each entity has a “home”
The entity will register its IP address (which may change)
with its home
Drawback:
The home needs to be there forever (i.e., have a fixed IP
address)
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 13
Example: Home-Based Approach
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 14
Domain Name System: DNS
For looking-up IP addresses
Example: what ip address www.nus.edu.sg corresponds to
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 15
Side-track: The Role of Case Studies
RMI: Case study for RPC
DNS: Case study for naming system
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 16
DNS Name Space
www.comp.nus.edu.sg/~yuhf
label (max length 63)
Top-level domains
com, edu, net, org, etc.
sg, cn, fr, etc.
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 17
The DNS Tree
(from http://www.rhyshaden.com/dns.htm)
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 18
Relative Names in DNS
Not supported in DNS specification
However:
Your local software may automatically append the omitted
part
Example, you can type ssh suna on any SoC unix machine,
and you will connect to suna.comp.nus.edu.sg
If suna.comp.nus.edu.sg does not exist, ssh will try to
connect to “suna” (which does not exist either)
Sometimes the local software may try appending different
suffixes
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 19
Domains in DNS
A domain is a name space for which there is a single overall
administrative authority to assignment the DNS names
Example, the collection of all XXX.nus.edu.sg is a domain
Potential confusion
A DNS name is sometime called domain name, which is different
from domain’s name defined above
We will only use DNS name and domain’s name to avoid confusion
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 20
Resolving DNS Names:
The Perspectives of a Client
Web browser
Make query to DNS server (how to find the DNS server?) to
resolve www.nus.edu.sg into an IP address
Send HTTP request to that IP address at port 80
Reverse resolution:
Translate an IP address into a DNS name
Only for IP addresses within the local domain
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 21
Resolving a DNS Request
The client needs to know the “local DNS server”
The IP address of this server is given to you by your ISP
Bootstrapping
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 22
Root DNS servers
If no, S will send quest to the root DNS server
How does S know where to find the root DNS server?
https://www.iana.org/domains/root/servers
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 23
Resolving a DNS Request
The root DNS server sends back to S the IP address of the DNS
server responsible for the domain “sg”
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 24
Critical Design Decisions in DNS
Delegation of responsibility
Allow individual domains to assignment their own DNS
names
Hierarchical naming strcuture
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 25
Vulnerability of DNS
The root servers – “single points” of failure
Target of DoS attacks
Already happened
Alternatives:
Completely decentralized distributed naming system for the
Internet
Already possible technically, but backward-compatibility
issues need to be addressed
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 26
History Readings (Non-compulsory)
DNS root servers under attack
http://en.wikipedia.org/wiki/DNS_Backbone_DDoS_Attacks
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 27
The Fundamental Need
for Bootstrapping in Naming
To resolve a name, you need to know at least one
bootstrapping point
Broadcast: Bootstrapping point not needed (or every
machine is a bootstrapping point?)
Forwarding pointers: The first machine you contact
Home-base approach: The home
DNS: Your local DNS server and the root DNS servers
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 28
Today’s Summary
Haifeng Yu, CS5223, Some Contents Adapted (with permission) from © R.Ayani, G.Tan 29