This action might not be possible to undo. Are you sure you want to continue?
Gustavo Alonso & Timothy Roscoe Frühjahrssemester 2010
© Systems Group | Department of Computer Science | ETH Zürich
Overview: Naming in Computer Systems
– Indirection – Binding
• Naming model Naming model
– Scheme, namespace, etc.
• • • • • •
Naming operations Types of lookup Default and explicit contexts, qualified names Path names, naming networks, recursive resolution Path names naming networks recursive resolution Multiple lookup y Name discovery
• Much of this lecture is from Much of this lecture is from Chapter 2 of Saltzer and Kaashoek • Naming is much simpler in Naming is much simpler in Computer Science (and Mathematics) than the real world! than the real world! • Evidence:
– Course in General Linguistics (Ferdinand de Saussure) Course in General Linguistics (Ferdinand de Saussure) – A Theory of Semiotics (Umberto Eco) – Philosophy from Wittgenstein onwards ☺ Philosophy from Wittgenstein onwards ☺
• Nevertheless: naming in computer systems is: Nevertheless: naming in computer systems is:
– Complex – Fundamental
• Computer systems are composed of many, many layers of different name systems.
Goal of today Goal of today • Explain naming concepts and patterns in Explain naming concepts and patterns in systems • Give you a toolkit for – Understanding – Designing ‐ complex computer systems in terms of names .
6789). Create a new object Give it a name .Basics: We need to name objects d b Socket clientSocket = new Socket("hostname".
Could be any socket we have now .getOutputStream()).Naming provides indirection Naming provides indirection DataOutputStream outToServer = new DataOutputStream(clientSocket.
Indirection • Well‐known quote by David Wheeler: Well known quote by David Wheeler: “All problems in computer science can be solved by All problems in computer science can be solved by another level of indirection” • Might be less elegantly paraphrased as: “Any problem in computer science can be recast as a sufficiently complex naming problem sufficiently complex naming problem” .
the binding isn t immediately visible –M t Most people miss it. .Binding • The association between a name and a value The association between a name and a value is called a binding. and are objects themselves. • In most cases the binding isn’t immediately In most cases. or d ’t k l i it don’t know it exists it i t – Often conflated with creating the value itself • Sometimes bindings are explicit.
A General Naming Model A General Naming Model .
Name space: what names are valid? 2. 1.A general model of naming A general model of naming • Designer creates a naming scheme Designer creates a naming scheme. Universe of values: what values are valid? 2 Universe of values: what values are valid? 3. Name mapping algorithm: what is the association of names to values? association of names to values? • Mapping algorithm also known as a resolver • Requires a context .
General model General model N1 N2 N3 N4 N5 N6 N7 Name mapping pp g algorithm Foo Bar Gronk Baz Context A .
“Herr Blocher” are names that you here Herr Blocher are names that require a context to be useful • Any naming scheme must have ≥ 1 context • Context may not be stated: always look for it! y y .Context • “you”. “here”.
64‐bit numbers) • Universe of values Universe of values: – Physical memory addresses (e.g. 64‐bit numbers) • Mapping algorithm: – Translation via a page table • Context: – Page table root g .Example naming scheme: Virtual address space l dd • Name space: Name space: – Virtual memory addresses (e.g.
43:4435 – Local context: only valid on a particular link/port – Many contexts! . multiple contexts • IPv4 addresses: IPv4 addresses: – E.102. 129. sort of… • ATM i t l i it/ th id tifi ATM virtual circuit/path identifiers – E. multiple contexts Single vs.132.54 – Single (global) context: routable from anywhere Single (global) context: routable from anywhere – Well.g.Single vs.g.
Naming operations Naming operations .
Resolution • Basic operation: Basic operation: – value ← RESOLVE(name context) ← RESOLVE(name. resolution mechanism depends on context: – value ← context. context) • In practice.RESOLVE(name) .
5.10.Resolution example Resolution example • Problem: Problem: – How does A determine B’s MAC address given its IP address? A’s IP addr: 10.23 Ethernet: 00:1e:c9:74:db:63 • Mapping algorithm: – ARP the Address ARP: the Address Resolution protocol .10.9.41 Ethernet: 00:1f:3b:3a:73:55 • Name space: – IP addresses dd • Universe of values: – Eth Ethernet MAC addresses t MAC dd B’s IP addr: 10.
replies to A with its (B s) physical layer address • A caches (saves) IP‐to‐physical address pairs until information becomes old (times out) information becomes old (times out) • “Soft state” protocol – information times out (goes away) unless refreshed 20 . containing B's IP address – all machines on LAN receive ARP query • B receives ARP packet. wants MAC address of B • A broadcasts ARP query packet. replies to A with its (B's) physical B receives ARP packet.ARP protocol ARP protocol • A knows B's IP address.
value.Managing bindings Managing bindings • Typical operations: Typical operations: – status ← BIND(name value context) status ← BIND(name. context) – status ← UNBIND(name. context) • May fail according to naming scheme rules • Unbind may need a value .
Example • Unix file system (more on this later): Unix file system (more on this later): $ ln target new_link • Binds “new_link” to value obtained by i d “ li k” l b i db resolving “target” in the current context (working directory) ( ki di ) $ rm new_link • Removes binding of “new_link” in cwd Actually called unlink at the system call level • Actually called unlink at the system call level .
Enumeration • Not always available: – list ← ENUMERATE(context) • Return all the bindings (or names) in a context .
Example enumeration Example enumeration $ ls $ ls or C:/> dir .
Comparing names Comparing names – result ← COMPARE(name1. name2) • But what does this mean? – Are the names themselves the same? – Are they bound to the same object? Are they bound to the same object? – Do they refer identical copies of one thing? • All these are different! • Requires a definition of “equality” on objects • In general. impossible… .
ch://home/troscoe/public_html/bio.ch://home/troscoe/hg/personal/websites/ eth/bio.Examples • Different names same referent: Different names.ethz.inf.txt .txt / / ~/bio.txt _ free.ethz.inf. same content: cixous. same referent: / /home/troscoe/bio.txt • Different names.
Naming policy alternatives Naming policy alternatives .
How many values for a name? (in a single context) (i i l ) • If 1 mapping is injective or “1‐1” If 1. mapping is injective or 1 1 – Car number plates – Virtual memory addresses Virtual memory addresses • Otherwise: multiple values for a name – Phone book (people have more than 1 number) – DNS names (can return multiple ‘A’ records) .
How many names for a value? How many names for a value? • Only one name for each value Only one name for each value – Names of models of car – IP protocol identifiers IP protocol identifiers • M lti l Multiple names for the same value f th l – Phone book again (people sharing a home phone) – URLs (multiple links to same page) .
bindings can never be changed • Useful: can always determine identity of two Useful: can always determine identity of two objects – Social security numbers Social security numbers – Ethernet MAC addresses • A8:7B:39:*:*:* → Nokia corporation p • A8:7B:39:DC:8C:50 → Mothy’s phone’s WiFi interface .Unique identifier spaces and stable bindings d bl b d • At most one value bound to a name At most one value bound to a name • Once created.
Types of lookup Types of lookup .
Name mapping algorithms Name mapping algorithms 1. Recursive lookup (pathnames) 3. Table lookup Table lookup – – Simplest scheme Analogy: phone book 2. Multiple lookup (search paths) 3 Multiple lookup (search paths) .
Table lookup: other examples Table lookup: other examples Processor registers are named by small integers. Ethernet interfaces are named by MAC addresses Ethernet interfaces are named by MAC addresses IP addresses are named by DNS names Unix accounts are named by small (16bit) numbers (userids) • Unix userids are named by short strings • Unix sockets are named by small integers • • • • • . Processor registers are named by small integers Memory cells are named by numbers.
Default and explicit contexts. qualified names .
Per name (qualified name) . Per object 2. Constant: built in to the resolver 2. Variable: from current environment (state) 2 Variable: from current environment (state) 2. Explicit: supplied by the object 1. Default (implicit): supplied by the resolver 1 Default (implicit): supplied by the resolver 1.Where is the context? Where is the context? 1.
… .Constant default context Constant default context • Universal name space: Universal name space: e. DNS • Short answer: Short answer: • Longer answer: Longer answer: – /etc/hosts.barrelfish. WINS resolver.conf.g.in. domain search p .org – context is the DNS root server • Even longer answer: Even longer answer: – /etc/nsswitch. path. plus DNS root server gruyere.
Variable default context Variable default context • Example: current working directory Example: current working directory $ pwd /home/troscoe/svn /h /t / $ ls osnet/ $ cd osnet $ l ls archive/ lecture/ organisation/ svnadmin/ assignments/ legis/ recitation sessions/ svn-commit.pptx l t t chapter10/ chapter3/ chapter6/ chapter9/ chapter11/ chapter4/ chapter7/ dates.xls $ .tmp $ ls lecture chapter1/ h t 1/ chapter2/ chapter5/ chapter8/ t h t 2/ h t 5/ h t 8/ template.
ch $ dig @129.earthlink.ethz.ch $ di @ 1 dig @ns1.ethz.12 -q a cixous.net -q a cixous thli k t i .132.Explicit per object context Explicit per‐object context • Note: context reference is a name! Note: context reference is a name! – Sometimes called a base name • Examples Examples: $ finger firstname.lastname@example.org.
name) = qualified name • Recursive resolution process: – Resolve context to a context object – Resolve name relative to resulting context • Examples: – email@example.com – /var/log/syslog .ethz.Explicit per name context Explicit per‐name context • Each name comes with its context Each name comes with its context – Actually. the name of the context – (context.
naming networks.Path names. recursive resolution .
Path names Path names • Recursive resolution ⇒ path names Recursive resolution ⇒ path names • N. can be written forwards or backwards – Examples: • Recursion must terminate: – Either at a fixed known context reference Either at a fixed. known context reference • (the root) – Or at another name. g • Example: relative pathnames • Syntax gives clue (leading ‘/’) . naming a default context .B.
.Naming networks Naming networks . . .. . bin lib share … .. troscoe alonso schuepbach … . / usr home … .
names resolve to values – Values may be names in a different naming scheme (usually are…) scheme (usually are ) • Names can resolve to other names in the Names can resolve to other names in the same scheme: –U i Unix symbolic links (ln –s). Email) . WWW.“Soft links” Soft links • So far names resolve to values So far. Windows “short cuts” b li li k (l ) Wi d “h t t” – Forwarding addresses (Die Poste.
Multiple lookup Multiple lookup .
Sometimes. but not in the Google sense… . or search path – try several contexts in order • Union mounts overlay two or more contexts Union mounts: overlay two or more contexts • Examples: – binary directories in Unix – resolving symbols in link libraries • Somewhat controversial… • Note: “search”. one context is not enough… h • Multiple lookup or “search path” Multiple lookup.
“Search path” example Search path example $ echo $PATH /home/troscoe/bin:/local/bin:/usr/local/bin:/usr/bin: /bin:/sbin:/usr/sbin:/etc:/usr/bin/X11:/etc/local: /usr/local/sbin:/home/netos/tools/bin:/usr/bin: /home/netos/tools/i686-pc-linux-gnu/bin $ which rackboot.sh /home/netos/tools/bin/rackboot.sh $ .
Name Discovery Name Discovery .
– Resolve some other name to a name space –I Introduction d i – Physical rendezvous • Often reduces to another name lookup… . – Query (google search) – B d t th Broadcast the query.How to find a name in the first place? l • Many options: Many options: – Well‐known. – Broadcast the name Broadcast the name.
but a poor master..Warning • Don’t get look to closely at names Don t get look to closely at names • Almost everything can be viewed as naming – Thi d This does not mean it should b t it h ld be. t . “All problems in computer science can be solved by another level of indirection” another level of indirection” “.except for the problem of too many layers of indirection.. indirection ” • A naming model is a good servant.
Conclusion • Naming is everywhere in Computer Systems g y p y – Name spaces – Contexts – R l ti Resolution mechanisms h i • When understanding a system. it will help stop you making (some) silly mistakes! . ask: – What are the naming schemes? What are the naming schemes? – What’s the context? – What’s the policy? • When designing a system.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.