Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
NaminginNetworking
JenniferRexford
COS316GuestLecture
Names
2
TypeofName ExampleUniform Resource Locator http://www.cs.princeton.edu/
~jrex/foo.htmlE-mail [email protected] www.cs.princeton.eduInternet Protocol 128.112.7.156Media Access Control 00:15:C5:49:04:A9
Today’s lecture focuses on the last three!
InternetProtocolLayers
3
Best-effort local packet delivery
Best-effort global packet delivery
Reliable streams
Applications
Messages
Link
Network
Transport
Application Hostname
IP address
MAC address
InternetProtocolStack
4
HTTP
TCP
IP
Ethernetinterface
HTTP
TCP
IP
Ethernetinterface
IP IP
Ethernetinterface
Ethernetinterface
Opticalinterface
Opticalinterface
host host
router router
HTTP message
TCP segment
IP packet IP packetIP packet
Ethernet frame Ethernet frame
What’sinaName?• Humanreadable?– Ifendusersinteractwiththenames
• Fixedlength?– Ifnamesmustbeprocessedathighspeed
• Largenamespace?– Ifmanynodesneeduniquenames
• Hierarchicalnames?– Ifthesystemisverylargeand/orfederated
• Self-certifying?– Ifpreventing“spoofing”isimportant 5
DifferentLayers,DifferentNames
• Hostname (e.g.,www.cs.princeton.edu)– Mnemonic,variable-length,appreciatedbyhumans– Hierarchical,basedonorganizations
• IPaddress (e.g.,128.112.7.156)– Numerical32-bitaddressappreciatedbyrouters– Hierarchical,basedonorganizationsandtopology
• MACaddress (e.g.,00:15:C5:49:04:A9)– Numerical48-bitaddressappreciated byadapters– Non-hierarchical,unrelatedtonetworktopology
6
HierarchicalAllocationProcesses
• Hostname: www.cs.princeton.edu– Domain:registrarforeachtop-leveldomain(e.g.,.edu)– Hostname:localadministratorassignstoeachhost
• IPaddresses: 128.112.7.156– Prefixes:ICANN,regionalInternetregistries,andISPs– Hosts:staticconfiguration,ordynamicusingDHCP
• MACaddresses: 00:15:C5:49:04:A9– Blocks:assignedtoequipmentvendorsbytheIEEE– Adapters:assignedbythevendorfromitsblock
7
HostNamesvs.IPAddresses
• Namesareeasier(forus!)toremember– www.cnn.comvs.64.236.16.20
• IPaddressescanchangeunderneath– E.g.,renumberingwhenchangingproviders
• NamecouldmaptomultipleIPaddresses– www.cnn.comtomultiplereplicasoftheWebsite
• Maptodifferentaddressesindifferentplaces– E.g.,toreducelatency,orreturndifferentcontent
• Multiplenamesforthesameaddress– E.g.,aliaseslikeee.mit.eduandcs.mit.edu
8
IPvs.MACAddresses
• LANsdesignedforarbitrarynetworkprotocols– NotjustforIP(e.g.,IPX,Appletalk,X.25,…)– DifferentLANsmayhavedifferentaddressschemes
• Ahostmaymovetoanewlocation– So,cannotsimplyassignastaticIPaddress– Instead,mustreconfiguretheadapter
• Mustidentifytheadapterduringbootstrap– NeedtotalktotheadaptertoassignitanIPaddress
9
Hostname,IP,andMACHostname IP Address MAC Address
Example www.cs.princeton.edu 128.112.7.156 00:15:C5:49:04:A9
Size Hierarchical, human readable, variable length
Hierarchical, machine readable, 32 bits (in IPv4)
Flat, machine readable, 48 bits
Read by Humans, hosts Internet routers LAN switches
Allocation, top-level
Domain name assigned by registrar (e.g., for .edu)
Variable-length prefixes, assigned by ICANN, RIR, or ISP
Fixed-sized blocks, assigned by IEEE to vendors (e.g., Dell)
Allocation, low-level
Host name assigned by local administrator
Interface, by DHCPor local administrator
Interface, by equipment vendor
10
Directory:TranslateNametoAddress
11
linksession
path
name
address
Directory
• Akey-valuestore– Key:name,value:address(es)– Answerqueries:givenname,returnaddress(es)
• Cachingtheresponse– Reusetheresponse,foraperiodoftime– Betterperformanceandloweroverhead
• Allowentriestochange– Updatingtheaddress(es)associatedwithaname– Invalidatingorexpiringcachedresponses
12
DirectoryDesign:ThreeExtremes• Floodthequery(e.g.,ARP)– Thenamednoderespondswithitsownaddress– But,highoverheadinlargenetworks
13
AddressResolutionProtocol(ARP)
• EveryhostinaLANmaintainsanARPtable– (IPaddress,MACaddress)pair
• Consultthetablewhensendingapacket–MapdestinationIPaddresstodest MACaddress– TransmittheIPpacketwithinanEthernetframe
14
1.2.3.4 1.2.3.19
00:15:C5:49:04:A9 78:9A:B5:23:5D:98
LocalAreaNetwork
AddressResolutionProtocol(ARP)
• But,whatifthekeyisnotinthetable?– Senderbroadcast:“WhohasIPaddress1.2.3.19?”– Receiveranswer:“MACaddress78:9A:B5:23:5D:98”– SendercachestheresultinitslocalARPcache
15
1.2.3.4 1.2.3.19
00:15:C5:49:04:A9 78:9A:B5:23:5D:98
LocalAreaNetwork
AddressResolutionProtocol(ARP)
• ManagingtheARPcache– Storingallkey-valuepairsintroducesoverhead– Entriesbecomestale(e.g.,IPassignedtonewhost)– Removeanentryifnotusedforsomeperiodoftime
16
1.2.3.4 1.2.3.19
00:15:C5:49:04:A9 78:9A:B5:23:5D:98
LocalAreaNetwork
DirectoryDesign:ThreeExtremes• Floodthequery(e.g.,ARP)– Thenamednoderespondswithitsaddress– But,highoverheadinlargenetworks
• Pushdatatoallnodes(e.g.,/etc/hosts)– Allnodesstoreafullcopyofthedirectory– But,highoverheadformanynamesandupdates
• Centraldirectoryserver– Alldataandquerieshandledbyonenode– But,poorperformance,scalability,andreliability
17
DistributedDirectoryDesign
• Hierarchicaldirectory(e.g.,DNS)– Followthehierarchyofthenamespace– Distributethedirectory,distributethequeries– Enabledecentralizedupdatestothedirectory
• DistributedHashTable(e.g.,P2Papplications)– Directoryasahashtablewithflatnames– Eachdirectorynodehandlesrangeofhashoutputs– Usehashtodirectquerytothedirectorynode
18
DomainNameSystem(DNS)
• PropertiesofDNS– Hierarchicalnamespacedividedintozones– DistributedoveracollectionofDNSservers
• HierarchyofDNSservers– Rootservers– Top-leveldomain(TLD)servers– AuthoritativeDNSservers
• Performingthetranslations– LocalDNSserversandclientresolvers
19
DistributedHierarchicalDatabase
20
com edu org ac uk zw arpa
unnamed root
bar
west east
foo my
ac
cam
usr
in-addr
12
34
56
generic domains country domains
my.east.bar.edu usr.cam.ac.uk
12.34.56.0/24
DNSRootServers
21
• 13rootservers(seehttp://www.root-servers.org/)• LabeledAthroughM
B USC-ISI Marina del Rey, CAL ICANN Los Angeles, CA
E NASA Mt View, CAF Internet Software C. PaloAlto, CA (and 17 other locations)
I Autonomica, Stockholm (plus 3 other locations)
K RIPE London (also Amsterdam, Frankfurt)
m WIDE Tokyo
A Verisign, Dulles, VAC Cogent, Herndon, VA (also Los Angeles)D U Maryland College Park, MDG US DoD Vienna, VAH ARL Aberdeen, MDJ Verisign, ( 11 locations)
TLDandAuthoritativeDNSServers
• GlobalTop-leveldomain(gTLD)servers– Genericdomains(e.g.,.com,.org,.edu)– Countrydomains(e.g.,.uk,.fr,.ca,.jp)– Managedprofessionally(e.g.,Verisignfor.com.net)
• AuthoritativeDNSservers– Providepublicrecordsforhostsatanorganization– Fortheorganization’sservers(e.g.,Webandmail)– Canbemaintainedlocallyorbyaserviceprovider
22
UsingDNS
• LocalDNSserver(“defaultnameserver”)– Usuallyneartheendhostswhouseit– Localhostsconfiguredwithlocalserver(e.g.,/etc/resolv.conf)orlearntheserverviaDHCP
• Clientapplication– Extractservername(e.g.,fromtheURL)– Dogethostbyname() orgetaddrinfo()togetaddress
• Serverapplication– ExtractclientIPaddressfromsocket– Optionalgethostbyaddr() totranslateintoname
23
DNSQueries
24
Hostatcis.poly.edu wantsIPaddressforgaia.cs.umass.edu
requesting hostcis.poly.edu
gaia.cs.umass.edu
root DNS server
local DNS serverdns.poly.edu
1
23
4
5
6
authoritative DNS serverdns.cs.umass.edu
78
TLD DNS server
Recursive query: #1Iterative queries: #2, 4, 6
Recursivevs.IterativeQueries
• Recursivequery– Askservertogetanswerforyou
– E.g.,request1andresponse8
• Iterativequery– Askserverwhotoasknext
– E.g.,allotherrequest-responsepairs
25
requesting hostcis.poly.edu
root DNS server
local DNS serverdns.poly.edu
1
23
4
5
6
authoritative DNS serverdns.cs.umass.edu
78
TLD DNS server
DNSCaching• DNSquerylatency
– E.g.,1seclatencybeforestartingadownload
• Cachingtoreduceoverheadanddelay– Small#oftop-levelservers,thatchangerarely
– Popularsitesvisitedoften
• Wheretocache?– LocalDNSserver– Browser
26
requesting hostcis.poly.edu
root DNS server
local DNS serverdns.poly.edu
1
23
4
5
6
authoritative DNS serverdns.cs.umass.edu
78
TLD DNS server
DNSCacheConsistency
• Cacheconsistency– Ensuringcacheddataisuptodate
• DNSdesignconsiderations– Cacheddatais“readonly”– Explicitinvalidationwouldbeexpensive
• Avoidingstaleinformation– Responsesincludea“timetolive”(TTL)field– DeletethecachedentryafterTTLexpires
27
SettingtheTimeToLive(TTL)
• TTLtrade-offs– SmallTTL:fastresponsetochange– LargeTTL:highercachehitrate
• Followingthehierarchy– Topofthehierarchy:daysorweeks– Bottomofthehierarchy:secondstohours
• Tensioninpractice– SetlowTTLsforloadbalancingandfailover– Browserscachefor15-60seconds
28
NegativeCaching
• Brokendomainnamesareslowtoresolve–Misspellingslikewww.cnn.comm andwww.cnnn.com
– Thesecantakealongtimetofailthefirsttime• Rememberthingsthatdon’twork– Goodtorememberthattheydon’twork– …sothefailuretakeslesstimeinthefuture
• Butdon’trememberfortoolong– Useatime-to-livetoexpire
29
DNSReliability
• DNSserversarereplicated– Nameserviceavailableifatleastone replicaisup– Queriescanbeloadbalancedbetweenreplicas
• Retransmissionoflostqueries– Noresponsetoaquery?Tryagain!
• Tryalternateserversontimeout– Exponentialback-offwhenretryingsameserver
30
Conclusions
• Networknames– Toidentifyremoteend-points– Readability?Format?Length?Hierarchy?– Hostnames,IPaddresses,andMACaddresses
• Networkdirectories– Key-valuestorestomapnametoaddress– Flooding(ARP),localcopy,centralserver– Hierarchical(DNS)ornon-hierarchical(DHT)
• Moreonprotocollayersinafewweeks!
31