程序代做CS代考 dns DHCP cache Pieces of the Puzzle – cscodehelp代写
Pieces of the Puzzle
EE450: Introduction to Computer Networks Professor A. E450, USC, Zahid 1
Burning Questions
How does a host/router get the MAC address of another host/router on the same LAN?
Answer: Address Resolution Protocol: ARP
How does a host get the IP address of another
host across the Internet?
Answer : Domain Name System: DNS How does a host get it‟s own IP address?
Answer: Dynamic Host Configuration Protocol (DHCP)
How do we distinguish between two or more applications running on the same host?
Answer: Port Numbers/Sockets
EE450, USC, Zahid 2
IP & MAC Addresses
A has a Packet to send to B.
A has the IP address of B and
it knows that B is located on the same network.
A
223.1.1.1
223.1.1.2 223.1.1.4
223.1.2.1
223.1.2.9
A encapsulate the packet inside B a link-layer frame
223.1.3.27
223.1.2.2
223.1.3.2
C
frame source & destination addresses
223.1.1.3
Packet source &223.1.3.1 destination addresses
B‟s MAC addr
A‟s MAC addr
A‟s IP addr
B‟s IP addr
IP payload
FCS
Packet frame
EE450, USC, Zahid
3
IP & MAC Addresses (Cont.)
MAC address allocation administered by IEEE
Manufacturer buys portion of MAC address space
(to assure uniqueness)
analogy:
MAC address: like Social Security Number IP address: like postal address
MAC is a flat address ➜ portability
can move LAN card from one LAN to another
IP is a hierarchical address ➜ not portable
address depends on IP subnet to which node is attached
EE450, USC, Zahid 4
IP & MAC Addresses (Cont.)
32-bit IP address:
network-layer address for interface
used for layer 3 (network layer) forwarding
Decimal (base 10) notation (each “numeral” represents 8bits)
e.g.: 128.125.7.11
MAC (or LAN or physical or Ethernet) address:
function: used „locally” to get frame from one interface to another physically-connected interface (same network, in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM, also sometimes software settable
e.g.: 1A-2F-BB-76-09-AD
hexadecimal (base 16) notation
(each “numeral” represents 4 bits) EE450, USC, Zahid 5
Question #1:
How does a Host/Router get the MAC address of another Host/Router on the same LAN?
EE450, USC, Zahid 6
Address Resolution Protocol
Each IP node (Host, Router) on LAN has ARP module/table
ARP Cache Table: IP/MAC address mappings for some LAN nodes
Cache lifetime ~ 20 min
Question: how to determine MAC address of B
given B‟s IP address?
EE450, USC, Zahid 7
ARP (Continued)
Address Resolution Protocol binds an IP address to a media (link) address
ARP is a simple request-response protocol
Host “A” broadcasts a request packet containing IP address of “B”. Broadcast MAC address is FF:FF:FF:FF:FF:FF. All hosts receive the ARP inquiry
Host “B” recognizes its IP address
Host “B” sends a response (not a broadcast) packet to
first host containing its MAC address
Host “A” caches address mapping for later use
ARP is a local, “Plug and Play” Protocol. Nodes create
their ARP tables without intervention from net administrator EE450, USC, Zahid 8
ARP Operation
EE450, USC, Zahid 9
ARP Packet
EE450, USC, Zahid 10
Four Cases of ARP use
EE450, USC, Zahid 11
Four Cases of ARP use (Cont.)
EE450, USC, Zahid 12
Proxy ARP
EE450, USC, Zahid 13
Question #2:
How does a Host get the IP address of another Host across the Internet?
EE450, USC, Zahid 14
Domain Name Services (DNS)
DNS is a TCP/IP client server application protocol that allow host and name servers to communicate in order to provide host name to IP address translation
DNS uses a distributed, hierarchical naming structure by defining several Domains. A domain is a collection of sites that are related in some manner
DNS use the services of UDP, port # 53
Application protocols such as HTTP, FTP, SMTP,
etc… use the services of DNS
EE450, USC, Zahid 15
Domain Name Space (Distributed)
Root Name Server
com net edu org mil gov Top Level Domains
usc
ucla mit
Distributed Hierarchy of Name Servers
aludra milly
EE450, USC, Zahid 16
Domains
EE450, USC, Zahid 17
Domains and Zones
EE450, USC, Zahid 18
Domain Names & Labels
EE450, USC, Zahid 19
Name Servers
Local Name Servers: This is the default name server (in
department, university, company, residential ISP, etc…) that
will receive the DNS query from the host
The IP address of the default local name server is configured manually (or Dynamically by DHCP) in the host
Root Name Servers: There are 13 root name servers most of which are located in US (two of them in Rey). When a local name server can‟t satisfy the query from a host, it will behave as a DNS client and queries one of the root servers. If the root name server can‟t satisfy the query, it consult with
Authoritative Name Server: This is where the host register its name/IP address
EE450, USC, Zahid 20
Root Name Servers
Contacted by local name server that can not resolve name Root name server:
o Contacts authoritative name server if name mapping not known o Gets mapping
o Returns mapping to local name server
e NASA Mt View, CA
f Internet Software C. Palo Alto, CA (and 36 other locations)
b USC-ISI Marina del Rey, CA l ICANN Los Angeles, CA
a Verisign, Dulles, VA
c Cogent, Herndon, VA (also LA) d U Maryland College Park, MD g US DoD Vienna, VA
h ARL Aberdeen, MD
j Verisign, ( 21 locations)
k RIPE London (also 16 other locations)
i Autonomica, Stockholm (plus 28 other locations)
m WIDE Tokyo (also Seoul, Paris, SF)
EE450, USC, Zahid
21
TLD and Authoritative Name Servers
Top-level domain (TLD) servers:
Responsible for com, org, net, edu, etc, and all
top-level country domains uk, fr, ca, jp, in, cn
Network Solutions maintains servers for com TLD
Educause for edu TLD
Authoritative DNS servers:
Organization‟s DNS servers, providing authoritative hostname to IP mappings for organization‟s servers (e.g., Web, mail).
Can be maintained by organization or service provider
EE450, USC, Zahid 22
Local Name Server
Does not strictly belong to hierarchy Each ISP (residential ISP, company,
university) has one.
also called “default name server”
when host makes DNS query, query is sent to its local DNS server
acts as proxy, forwards query into hierarchy
EE450, USC, Zahid 23
Recursive DNS
Host “A” whose name is John.yahoo.com wants the IP address of another host “B” whose name is Mary.usc.edu
Host “A” Contacts its local DNS server, dns.yahoo.com
Root Name Server
dns.yahoo.com contacts root Local Name Server
Authoritative Name Server
dns.usc.edu
EE450, USC, Zahid
24
2
3
4
6
5
name server, if necessary
Root name server contacts authoritative name server, dns.usc.com, if necessary
dns.yahoo.com
1
Requesting Host
John.yahoo.com
Mary.usc.edu
Iterative DNS
Contacted server replies with name of server to contact
2
3
Root Name Server
iterated query
4 5
Intermediate Name Server
dns.usc.edu
6
Authoritative Name Server
dns.ee.usc.edu
“I don‟t know this name, but ask this server”
Local Name Server
dns.yahoo.com
1
Requesting Host
john.yahoo.com
7
8
EE450, USC, .ee.usc.edu 25
Pure Iterative Resolution
EE450, USC, Zahid 26
DNS Caching
Once (any) name server learns mapping, it caches mapping
Cache entries timeout (disappear) after some time
TLD servers typically cached in local name servers
Thus root name servers not often visited
EE450, USC, Zahid 27
Why not Centralized DNS?
A centralized DNS represent a single point of failure. If the name server crashes so would the entire internet
All traffic volume would have to be handled by this name server
A single name server can‟t be close to all query clients increased delays World Wide Wait !!!!!
Maintaining and updating a single name server is a huge task. Just dealing wit authentication/authorization is a nightmare
A single Name Server doesn‟t scale !
EE450, USC, Zahid 28
DNS Records
EE450, USC, Zahid 29
Question #3:
How does a Host get an IP address?
EE450, USC, Zahid 30
Host Configuration
Problem of managing IP addresses within a customer network
Assigning IP address
Reclaiming IP addresses
Manual management of IP addresses
is difficult
Error-prone Mobility of hosts
EE450, USC, Zahid 31
Dynamic Host Configuration Protocol (DHCP)
DHCP is a client/server application designed to provide a centralized approach to configuring and maintaining IP addresses
Four basic steps involved in obtaining an IP address:
Discovery Phase Offer Phase
Request Phase Acknowledgement Phase
EE450, USC, Zahid 32
DHCP Exchange Messages
EE450, USC, Zahid 33
DHCP Client/Server Scenario
A
223.1.1.1
223.1.1.2 223.1.1.4
DHCP Server
223.1.2.9
223.1.2.1
B
223.1.1.3
223.1.3.1
223.1.3.27
223.1.2.2
223.1.3.2
E
arriving DHCP client needs address in this (223.1.2.0) network
EE450, USC, Zahid
34
DHCP Client/Server Scenario
EE450, USC, Zahid 35
DHCP Basic Operations (When Both the Client and the Server are on same Network
DHCP Relay Agent (Needed when the Client and the Server are located on different Networks
DHCP Message Format
EE450, USC, Zahid 38
DHCP State Transition
EE450, USC, Zahid 39
Question #4:
How does a Process (Application) “identify” the other process with which it wants to communicate?
EE450, USC, Zahid 40
Client/Server Paradigm
application
transport
network
data link
physical
application
transport
network
data link
physical
application
transport
network
data link
physical
EE450, USC, Zahid 41
Process-to-Process Communications
Host-to-Host Communications: IP
IP delivery is incomplete. Message must be delivered to the correct process running in destination host
Both local and remote hosts can be running several processes at the same time we need to be able to distinguish between these processes
For communications to take place we need to define
Local host/Local process
Remote host/remote process
Transport layer protocol providing transport
services
EE450, USC, Zahid 42
Port Numbers
Port Numbers allow receiving host to determine to which local process the message be delivered
Port numbers are integers between 0 and 65,535
Client process defines itself with a port number chosen randomly by the underlying transport layer protocol.
Server process defines itself by a well-known port number. The ports ranging from 0~1023 are well- known port numbers and are assigned and controlled by ICANN.
EE450, USC, Zahid 43
Socket Address
The combination of the IP address, the port number and the transport layer protocol defines the “Socket Address” which uniquely defines the communications between the client process and the server process
Domain of TCP/UDP
Process
client
Process
Process
Process
server
Domain of IP
EE450, USC, Zahid
44