Lab3 - DNS client, server

From Inforail
Jump to: navigation, search

Keywords

client, server, UDP, IP, address, BSD sockets, protocol, RFC, DNS

Objectives

Familiarize yourself with UDP, learn how to send and receive datagrams. Understand the difference between TCP and UDP. To do that, you will tinker with the DNS protocol, which uses UDP at the transport layer. See Alternative path for other options.

Overview

  • The program will be given a host name (ex: xkcd.com), and it must return the IP address that corresponds to that name (ex: 72.26.203.98).

Note: DNS is a complex protocol, you will only need to implement a subset of it, the minimal part that is enough to map a name to an address, nothing else (unless you really want to).


Generic requirements

  • The program must rely on the BSD sockets API, not some other library which is an abstraction on top of BSD sockets.


Client requirements

  • Your DNS client will connect to an existing DNS server and retrieve the IP address that corresponds to a host name.

Server requirements

  • When your server is queried, it will rely on the following logic:
    • Find the IP address in a local table and return it
    • If the address is not found, retrieve the address from another DNS server
    • If the address is still not found, return the address of your personal site


Grading policy

Assuming that everything works right,

  • 8 - for successfully performing a DNS query;
  • 9 - for successfully serving a DNS query;
  • 10 - for explaining how such a custom DNS server can be used to (specify at least three different points):
    • make money (legally :-)
    • infringe on people's privacy
    • protect people's privacy


A partially implemented feature that does not work 100% right may still be accepted as fully implemented, provided that your report describes the nature of the problem and provides some guesses about what the solution is supposed to be.

References


Examples

Alternative path

  • Write a program that can generate a "magic packet" and turn a computer in the LAN using WOL (Wane-On-LAN)


Grading policy
  • 8 - for successfully generating and broadcasting a magic packet;

For a higher grade, consider implementing some features from the "primary path".


References