The Final Project of Internet Applications- DHCP Server & Client Goal of the project

The Final Project of Internet Applications 2017.05

Project Title: DHCP Server & Client Goal of the project

  •   Deeply understand the details of DHCP (Dynamic Host Configuration Protocol).
  •   Complete a DHCP server program and run it in one Ubuntu virtual machine.
  •   Complete a DHCP client program and run it in another Ubuntu virtual machine.

    DHCP Server & Client Program Model

    Basic Requirements of the project

1. General requirements

  1. a)  Support DHCP messages: DISCOVER/OFFER/REQUEST/ACK, RELEASE,

    REQUEST/NAK, REQUEST/ACK, INFORM/ACK.

  2. b)  Support DHCP options:

    1 (Subnet Mask Value)
    3 (Router addresses)
    6 (DNS Server addresses)
    51 (IP Address Lease Time)
    53 (DHCP Message Type)
    54 (DHCP Server Identification)
    55 (Parameter request list)
    58 (DHCP Renewal Time T1)
    59 (DHCP Rebinding Time T2)
    60 (Class Identifier, please set as your student number) 255 (END)

  3. c)  Four messages during address acquisition can be delivered on broadcast packets.
  4. d)  Support the following DHCP Procedures:

Fig. 1 release + address acquisition

Fig. 2 successful lease renew

Fig. 3 failed lease renew (with an abnormal IP address)+address acquisition again

Fig. 4 failed lease renew (server down)

Fig. 5 inform

  1. DHCP server functions
    1. a)  Listen to UDP port 67.
    2. b)  For first request, select free IP address from IP address pool and reply to client.
    3. c)  For INFORM request, reply ACK with option value.
    4. d)  IP range and value of options are stored in IP address pool (dhcp.config file),

      Assigned IP, client mac address and timestamp are stored in IP lease pool

      (dhcp.lease file).

    5. e)  Print log messages.
  2. DHCP client functions
    1. a)  Listen to UDP port 68.
    2. b)  User can specify command line arguments to control actions of client program. User

      can combine “sleep x” command with client program to control expire time, such as

      “./dhcpclient –default; sleep 10; ./dhcpclient –renew”.

    3. c)  Client program can obtain IP address, netmask, gateway, dns server address, dhcp

      server ID and IP address lease time from DHCP server and configure IP address in

      client OS.

    4. d)  Print log messages.
  3. Detailed design document and user manual.
  4. Detailed annotation of code and nice programming style.
  5. Two persons as a group.

Additional Requirements of the project

  1. Stable and friendly to users, and be able to handle error commands.
  2. DHCP client program can be run in interactive mode when specified with “–interact”.

    When under interactive mode, client program can renew by two methods:

    1. a)  Automatically request renewal triggered by T1 or T2 expiration event.
    2. b)  Manually request renewal by input renew.
  3. DHCP OFFER and ACK during address acquisition can be delivered on unicast packets.

Environment of the project

  1. C language
  2. Linux operation system
  3. gcc compiler and gdb debug tool

Steps of the project

1. Prepare network environment for the project a) Clone VM in virtualbox.

  1. b)  Change the second NIC of VMs.
  2. c)  Modify the configuration file of eth1.
  3. d)  Add iptables rule and save it.
  1. Develop DHCP server program in Ubuntu.
    1. a)  Refer to your UDP server program code.
    2. b)  Construct DHCP packets.
    3. c)  Test your server program using “dhclient” in another VM.
  2. Develop DHCP client program in Ubuntu.
    1. a)  Refer to your UDP client program code.
    2. b)  Construct DHCP packets.
    3. c)  “sudo killall dhclient” before starting your client program.
  3. Complete the additional functions.

Report Submission

  1. Upload your report to FTP server
    a) Server: ftp://10.3.255.85, port:21
    b) User name: gjxy2017 password: student
  2. Name your file as: BUPTID1+BUPTID2-name1+name2-v[number].pdf e.g., 2011010276+2011010276-ZhangXi+LiLei-v1.pdf

3. Deadline:
before 17:00, 2017-06-18 (UTC+8)