Problem:

Implement a DHCP server using a client-server architecture.

Requirements:

1.Create a C/ Java based client-server architecture using UDP socket

2.The DHCP server should be able to receive messages from multiple clients

3.The server should be run on cse01.cse.unt.edu machine and the clients should be run on any machine between cse02.cse.unt.edu and cse06.cse.unt.edu. The IP address of cse01.cse.unt.edu is 129.120.151.94. The clients dont need to broadcast the DHCP discover packet. They can use DHCP servers IP address

4.Demonstrate that a client is requesting an IP address and DHCP server is offering an IP address from the list of currently available IP addresses

5.The DHCP server should register the clients IP address and should acknowledge the client

6.The client should randomly generate the transaction ID. The lifetime should be set to 3600 seconds

Procedure:

1.Create a C/ Java based server that can accept multiple clients requests using UDP socket.

2.Make sure the server runs on cse01.cse.unt.edu and the format to start the server is as follows:

dhcp < port_number>

where DHCP is the UDP server executable and port_number is the port number on which the UDP server can accept data

3.Create a C/ Java based client that can communicate with the server using UDP socket

4.The client can run on any CSE machines (other than cse01) and sends and receives messages to the server as follows:

client < port_number>

where client is the client executable, port_number is the port number on which the client sends messages to the DHCP server

5.The client tries to request an IP address from the DHCP server by contacting the server and sending a packet with yiaddr: 0.0.0.0 and a randomly generated transaction ID

6.The DHCP server should maintain a list of 10 IP addresses in a separate file named IPaddress.txt. It responds with an IP address from the list of currently available IP addresses, the transaction ID, and a lifetime (generally 3600 seconds)

7.The client responds with a DHCP request by choosing the IP address and a new transaction ID (old transaction ID + 1)

8.The DHCP server responds with an ack confirming the IP address. The DHCP server registers that the IP address is taken, removes that IP address from the IPaddress.txt file.

9.DHCP server can assign IP addresses to maximum 10 clients. When the IPaddress.txt file becomes empty, the server will send error message to the clients.

10.Print all the communication between the DHCP server and the client on the terminal console. A sample message transaction scenario is given below

11.Test the DHCP server and client to make sure the demonstrations are working

12.A sample IPaddress.txt file is available on Blackboard for reference

13.Sample C and Java UDP socket code is available on Blackboard for reference see image.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.