Networks and Operating Systems Chapter 11: Naming Chapter 11: Naming


Gustavo Alonso & Timothy Roscoe Frühjahrssemester 2010

© Systems Group | Department of Computer Science | ETH Zürich

Overview:  Naming in Computer Systems
• Introduction
– 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 .

  Create a new  object Give it a name .Basics:  We need to name objects d b Socket clientSocket = new Socket("hostname". 6789).

getOutputStream()).Naming provides indirection Naming provides indirection DataOutputStream outToServer =  new DataOutputStream(clientSocket.  Could be any socket  we have now .

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” .

. and are  objects themselves. • In most cases the binding isn’t immediately In most cases.Binding • The association between a name and a value The association between a name and a value  is called a binding. 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. the binding isn t immediately  visible –M t Most people miss it.

A General Naming Model A General Naming Model .

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 . Universe of values: what values are valid? 2 Universe of values: what values are valid? 3. 1.A general model of naming A general model of naming • Designer creates a naming scheme Designer creates a naming scheme. Name space: what names are valid? 2.

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”.

Example naming scheme: Virtual address space l dd • Name space: Name space:  – Virtual memory addresses (e. 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 .g.

 sort of… • ATM i t l i it/ th id tifi ATM virtual circuit/path identifiers – E. multiple contexts • IPv4 addresses: IPv4 addresses:  – E.g. multiple contexts Single vs.Single vs. 43:4435 – Local context: only valid on a particular link/port – Many contexts! .102.54 – Single (global) context: routable from anywhere Single (global) context: routable from anywhere – Well. 129.g.132.

Naming operations Naming operations .

Resolution • Basic operation: Basic operation: – value ← RESOLVE(name context) ← RESOLVE(name.RESOLVE(name) . resolution mechanism depends on  context: – value ← context. context) • In practice.

10.Resolution example Resolution example • Problem: Problem:  – How does A determine  B’s MAC address given  its IP address? A’s IP addr: Ethernet: 00:1e:c9:74:db:63 • Mapping algorithm: – ARP the Address ARP: the Address  Resolution protocol .5.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.

 wants MAC address of B  • A broadcasts ARP query packet. 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 .ARP protocol ARP protocol • A knows B's IP address. containing B's IP address  – all machines on LAN receive ARP query  • B receives ARP packet. replies to A with its (B's) physical B receives ARP packet.

 value.Managing bindings Managing bindings • Typical operations: Typical operations: – status ← BIND(name value context) status ← BIND(name. context) • May fail according to naming scheme rules • Unbind may need a value . context) – status ← UNBIND(name.

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… .

Examples • Different names same referent: Different names.txt .inf.txt • Different _ free.ethz. same referent: / /home/troscoe/bio.txt / / ~/ eth/bio. same content: cixous.ethz.inf.

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) .

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. 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  .

Types of lookup Types of lookup .

Name mapping algorithms Name mapping algorithms 1. Multiple lookup (search paths) 3 Multiple lookup (search paths) . Table lookup Table lookup – – Simplest scheme Analogy: phone book 2. Recursive lookup (pathnames) 3.

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 • • • • • .Table lookup: other examples Table lookup: other examples Processor registers are named by small integers. Processor registers are named by small integers Memory cells are named by numbers.

qualified names .Default and explicit contexts.

Explicit: supplied by the object 1. Constant: built in to the resolver 2. Default (implicit): supplied by the resolver 1 Default (implicit): supplied by the resolver 1.Where is the context? Where is the context? 1. Variable: from current environment (state) 2 Variable: from current environment (state) 2. Per object 2. Per name (qualified name) .

 WINS resolver.Constant default context Constant default context • Universal name space: Universal name space:  e. … path.conf. domain search  p .barrelfish. DNS • Short answer: Short answer:  • Longer answer: Longer answer: – /etc/hosts. plus DNS root server – context is the DNS root server • Even longer answer: Even longer answer: – /etc/nsswitch.

tmp $ ls lecture chapter1/ h t 1/ chapter2/ chapter5/ chapter8/ t h t 2/ h t 5/ h t 8/ template.pptx l t t chapter10/ chapter3/ chapter6/ chapter9/ chapter11/ chapter4/ chapter7/ dates.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.xls $ .

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 troscoe@cixous.12 -q a $ di @ 1 dig -q a cixous thli k t i $ dig @129.

ch – /var/log/syslog . the name of the context – (context.ethz.Explicit per name context Explicit per‐name context • Each name comes with its context Each name comes with its context – = qualified name • Recursive resolution process: – Resolve context to a context object – Resolve name relative to resulting context • Examples: – troscoe@inf.

 naming networks.Path names.  recursive resolution .

 known context reference  • (the root) – Or at another name.B. g • Example: relative pathnames • Syntax gives clue (leading ‘/’) . naming a default context .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.

. . / usr home … . troscoe alonso schuepbach … .Naming networks Naming networks . .. .. bin lib share … .

 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). Windows “short cuts” b li li k (l ) Wi d “h t t” – Forwarding addresses (Die Poste. WWW.“Soft links” Soft links • So far names resolve to values So far. Email) .

Multiple lookup Multiple lookup .

 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”. but not in the Google sense… . one context is not  enough… h • Multiple lookup or “search path” Multiple lookup.Sometimes.

“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 /home/netos/tools/bin/ $ .

Name Discovery Name Discovery .

– Broadcast the name Broadcast the name.How to find a name in the first  place? l • Many options: Many options: – Well‐known. – Query (google search) – B d t th Broadcast the query. – Resolve some other name to a name space –I Introduction d i – Physical rendezvous • Often reduces to another name lookup… .

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. but a poor  master.. indirection ” • A naming model is a good servant.except for the problem of too many layers of  indirection. t .. “All problems in computer science can be solved by  another level of indirection” another level of indirection” “.

 it will help stop you  making (some) silly mistakes! .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. ask: – What are the naming schemes? What are the naming schemes? – What’s the context?  – What’s the policy? • When designing a system.

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer: Get 4 months of Scribd and The New York Times for just $1.87 per week!

Master Your Semester with a Special Offer from Scribd & The New York Times