Translating Addresses: Computer Networks
Translating Addresses: Computer Networks
Translating Addresses: Computer Networks
Computer Networks
DNS queries
Iterative queries
Recursive queries
IP addresses
Numerical address appreciated by routers
Fixed length, binary number
Hierarchical, related to host location
Examples: 64.236.16.20 and 193.30.227.161
5
E NASA Mt View, CA
F Internet Software C. Palo
Alto, CA (and 17 other
locations)
A Verisign, Dulles, VA
C Cogent, Herndon, VA (also Los Angeles)
D U Maryland College Park, MD
G US DoD Vienna, VA
K RIPE London (also Amsterdam, Frankfurt)
H ARL Aberdeen, MD
I Autonomica, Stockholm
J Verisign, ( 11 locations)
(plus 3 other locations)
m WIDE Tokyo
11
com
edu
org
generic domains
bar
uk
ac
zw
arpa
country domains
ac
inaddr
west
east
cam
12
foo
my
usr
34
my.east.bar.edu
usr.cam.ac.uk
56
12
12.34.56.0/24
Using DNS
Local DNS server (default name server)
Usually near the end hosts who use it
Local hosts configured with local server (e.g.,
/etc/resolv.conf) or learn the server via DHCP
Client application
Extract server name (e.g., from the URL)
Do gethostbyname() to trigger resolver code
Server application
Extract client IP address from socket
Optional gethostbyaddr() to translate into name 13
Example
root DNS server
Host at cis.poly.edu
wants IP address for
gaia.cs.umass.edu
2
3
dns.poly.edu
requesting host
cis.poly.edu
Recursive query
Ask server to get
answer for you
E.g., request 1
and response 8
Iterative query
Ask server who
to ask next
E.g., all other
request-response
pairs
2
3
requesting host
cis.poly.edu
15
DNS Caching
Performing all these queries take time
And all this before the actual communication takes place
E.g., 1-second latency before starting Web download
Negative Caching
Remember things that dont work
Misspellings like www.cnn.comm and www.cnnn.com
These can take a long time to fail the first time
Good to remember that they dont work
so the failure takes less time the next time around
17
Type=NS
Type=CNAME
name is alias name for some
canonical (the real) name
www.ibm.com is really
servereast.backup2.ibm.com
DNS Protocol
DNS protocol : query and reply messages, both with
same message format
Message header
Identification: 16 bit # for
query, reply to query uses
same #
Flags:
Query or reply
Recursion desired
Recursion available
Reply is authoritative
19
Reliability
DNS servers are replicated
Name service available if at least one replica is up
Queries can be load balanced between replicas
20
21
;; AUTHORITY SECTION:
edu.
2D IN NS
edu.
2D IN NS
edu.
2D IN NS
edu.
2D IN NS
edu.
2D IN NS
edu.
2D IN NS
edu.
2D IN NS
edu.
2D IN NS
L3.NSTLD.COM.
D3.NSTLD.COM.
A3.NSTLD.COM.
E3.NSTLD.COM.
C3.NSTLD.COM.
G3.NSTLD.COM.
M3.NSTLD.COM.
H3.NSTLD.COM.
22
23
host ...
DNS
host
host ...
DNS
5.6.7.0/24
1.2.3.0/24
1.2.3.19
router
router
router
24
host ...
DNS
host
host ...
DNS
5.6.7.0/24
1.2.3.0/24
1.2.3.19
router
router
router
25
27
IP addresses
Configured, or learned dynamically
Like a postal mailing address
Hierarchical name space of 32 bits (e.g., 12.178.66.9)
Not portable, and depends on where the host is attached
Used to get a packet to destination IP subnet
28
LAN
71-65-F7-2B-08-53
= adapter
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
29
Bootstrapping Problem
Host doesnt have an IP address yet
So, host doesnt know what source address to use
host ...
host
DHCP server
30
Broadcasting
Broadcasting: sending to everyone
Special destination address: FF-FF-FF-FF-FF-FF
All adapters on the LAN receive the packet
31
32
arriving
client
DHCP server
233.1.2.5
33
Performance trade-offs
Short lease time: returns inactive addresses quickly
Long lease time: avoids overhead of frequent renewals
35
1.2.3.156
host ...
Web
IP packet
1.2.3.53
1.2.3.156
router
38
www.cnn.com
A sends packet to R, and R sends packet to B.
39
Basic Steps
Host A must learn the IP address of B via DNS
Host A uses gateway R to reach external hosts
Host A sends the frame to Rs MAC address
Router R forwards IP packet to outgoing interface
Router R learns Bs MAC address and forwards frame
A
B
R
www.cnn.com 40
41
Ethernet frame
From A: 111.111.111.111
To B: 222.222.222.222
From A: 74-29-9C-E8-FF-55
To gateway: ????
42
43
44
Ethernet frame
From A: 111.111.111.111
To B: 222.222.222.222
From A: 74-29-9C-E8-FF-55
To R: E6-E9-00-17-BB-4B
45
46
Ethernet frame
47
R Sends Packet to B
Router Rs learns the MAC address of host B
ARP request: broadcast request for 222.222.222.222
ARP response: B responds with 49-BD-D2-C7-56-2A
48
Ethernet frame
49
Conclusion
Domain Name System
Distributed, hierarchical database
Distributed collection of servers
Caching to improve performance
50