dns_dhcp

Upload: tanya-verma

Post on 06-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 DNS_DHCP

    1/16

    1Spring Semester 2009, Dept. of Computer Science, Technion

    Internet NetworkingInternet Networking

    recitation #2recitation #2

    DNS and DHCPDNS and DHCP

  • 8/3/2019 DNS_DHCP

    2/16

    2

    Domain Name SystemDomain Name System -- DNSDNS

    Provides mapping from ASCII domain names to IP

    addresses

    Hierarchical naming system.

    The set of names is divided into mutually exclusive parts.

    Supplies mechanism forglobal data storage and

    information retrieval.

    Most important principles:

    Distributed system set of servers sharing information. Efficiency - most of the requests resolved by local servers.

    Use of Caching.

    Reliability works even if some of the servers fail.

  • 8/3/2019 DNS_DHCP

    3/16

    3

    DNS treeDNS tree

    root

    orgcom gov net il

    cnnibm govcoac

    tautechnion

  • 8/3/2019 DNS_DHCP

    4/16

    4

    Reliability overUDPReliability overUDP

    DNS is an application whichruns overUDP

    Advantage: not as complex as TCP.

    Disadvantage: requires reliability implementation at

    application level .

    Reliability scheme:

    Time out.

    Retransmissions - resends timed out query to a different

    server.

  • 8/3/2019 DNS_DHCP

    5/16

    5

    DNS TermsDNS Terms

    Domain name: any name represented in the DNSformat

    mail.yahoo.com

    \.name.example

    DNS label: each string between two ".

    ac.il 2 labels

    DNS zone: a set of names that are under the sameauthority

    cs.technion.ac.il,ee.technion.ac.il andwww.technion.ac.il

    Delegation: transferof authority fora domain

    example.org is a delegation from org.

  • 8/3/2019 DNS_DHCP

    6/16

    6

    DNS ElementsDNS Elements

    Resolver:

    stub: simple, only asks questions;

    recursive: takes simple query and makes all necessarysteps to get the full answer.

    Server (some perform bothroles at the same time): authoritative: the servers that contain the zone file fora

    zone, one Primary, one ormore Secondaries;

    caching: a recursive resolver that stores priorresults andreuses them.

  • 8/3/2019 DNS_DHCP

    7/16

    7

    How Does DNS Work?How Does DNS Work?

    The resolversends a DNS request message overUDP to a local

    domain name server.

    DNS caches store data fora short time defined by TTL on the

    Record.

    When a name serverdoes not have the requested information,

    it starts at longest match on query name it has when looking for

    data.

    The root serverknows the IP address of each second-level

    domain name server.

    Every serverknows how to reach servers that are authorities fornames furtherdown the hierarchy.

    The resolver follows delegations until it receives an answer.

  • 8/3/2019 DNS_DHCP

    8/16

    8

    DNS query example (from IETF slides)DNS query example (from IETF slides)

    Root Server

    Ietf.org Server

    Org

    Server

    Ask org NS

    Ask ietf.org NS

    www.ietf.org A

    65.256.255.51

    www.ietf.org A

    65.256.255.51

    Recursive

    Resolver

    www.ietf.org

    Stub resolver

  • 8/3/2019 DNS_DHCP

    9/16

    9

    Dynamic Host Configuration ProtocolDynamic Host Configuration Protocol -- DHCPDHCP

    RFC 2131

    Runs overUDP as well

    Provides automaticconfiguration of the host

    connected to network orbooted

    Provides hosts with initial configuration information

    upon bootup:

    IP address with subnet mask,

    default gateway,

    IP address of the DNS server .

  • 8/3/2019 DNS_DHCP

    10/16

    DHCP (cont.)DHCP (cont.)

    server Aclient

    server B

    determine

    configuration

    determine

    configuration

    DHCP discoverDHCP discover

    DHCP offerDHCP offer

    select configuration

    DHCP requestDHCP request

    DHCP ack

    Initialization completes

    graceful shutdownDHCP release

    discard lease

    using the allocated configuration

    (selected)(not selected)

  • 8/3/2019 DNS_DHCP

    11/16

    11

    DHCP MessagesDHCP Messages

    DHCPDISCOVER The client broadcasts message in search of available DHCP

    servers.

    DHCPOFFER

    The serverresponse to the client DHCPDISCOVER with offerof

    configuration parameters . DHCPREQUEST

    The client broadcasts to the server,requesting offered parameters

    from one serverspecifically.

    Confirms correctness of previously allocated address after, e.g.,

    system reboot.

    Extends the lease on a particularnetwork address.

    DHCPRELEASE

    The client-to-servercommunication,relinquishing network address

    and canceling remaining lease.

  • 8/3/2019 DNS_DHCP

    12/16

    12

    DHCPACK

    The server-to-client communication withconfiguration parameters,

    including committed network address.

    DHCPNAK

    Server to client indicating client's notion of network address is

    incorrect (e.g.,client has moved to new subnet) orclient's lease asexpired

    DHCPDECLINE

    The client-to-servercommunication, indicating that the network

    address is already in use.

    DHCPINFORM The client-to-servercommunication, asking foronly local

    configuration parameters that the client already has externally

    configured as an address.

    DHCP Messages (Cont.)DHCP Messages (Cont.)

  • 8/3/2019 DNS_DHCP

    13/16

    13

    DHCP message formatDHCP message format

    xid

    Transaction ID.

    ciaddr

    Client IP address

    yiaddr

    Your IP address.

    siaddr

    Server IP address. chaddr

    Client MAC address

  • 8/3/2019 DNS_DHCP

    14/16

    14

    DHCP message format (cont.)DHCP message format (cont.)

    Transaction ID - a random number that is used by the clientto match incoming DHCP messages with pending requests.

    Client IP address - used when client knows its IP address.

    Your IP address - the DHCP serverwill place the offeredclient IP address in this field, if the client IP address is 0.0.0.0.

    Server IP address - the DHCP serveraddress, if it is known.Otherwise, it is used in DHCPOFFER and DHCPACK.

    options - DHCP defines a 'client identifier' option that is used to

    pass an explicit client identifier to a server.

  • 8/3/2019 DNS_DHCP

    15/16

    15

    DHCP message filteringDHCP message filtering

    DHCPOFFER Only the client waiting for this message will accept it in

    UDP layer.

    But what if two clients are waiting for the offer

    simultaneously?

    The filtering is possible only at the application layer. The transaction ID field is responsible for this filtering.

    DHCPREQUEST

    The message is broadcasted to all the servers.

    The serverknows if its offerwas accepted only uponreading the server identifier field in the DHCP message.

  • 8/3/2019 DNS_DHCP

    16/16

    16

    DHCP as UDP applicationDHCP as UDP application

    DHCP server - port 67,client - port 68

    Reliability is not provided by UDP.

    Client is responsible forreliability

    Th

    eclient implements time

    rto measu

    re timeout fo

    rth

    emessages that were not responded.

    The client adopts a retransmission strategy that incorporates

    a randomized exponential backoff algorithm to determine the

    delay between retransmissions.

    Every next message acts as an acknowledgment for the

    previous step.

    Forexample, DHCPREQUEST is an ACK forDHCPOFFER.