Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Simulate the working of DHCP server using a client-server architecture. Requirements: 1. Create a C-based client-server architecture using a UDP socket 2. The dhcp server

Simulate the working of DHCP server using a client-server architecture. Requirements:

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

2. The dhcp server should be able to receive message from multiple clients

3. The server should run on cse01.cse.unt.edu machine and the client can run on any cse machines

4. Demonstrate client requesting IP address and DHCP server offering at least three available IP addresses

5. The client should randomly pick an IP address and send a DHCP request to the server

6. The DHCP server should register the client selected IP address is taken and should acknowledge the client

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

8. Simulate several clients requesting IP address from the DHCP server.

Procedure:

1. Create a C-based server that can accept data from multiple clients using UDP sockets

2. Make sure the server runs on cse01.cse.unt.edu and the format to start the server is as follows dhcp gateway: subnet_mask: where dhcp is the UDP server executable and port_number is the port number on which the UDP server can accept data. The gateway is the IP address from which the DHCP server starts offering the IP addresses to the clients.

3. Create a C-based client that can communicate with the server using UDP sockets

4. The client can run on any cse machine and sends and receives messages to the server as follows client 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 responds with three IP address offers, transaction ID, and a lifetime (generally 3600 seconds). The offer IP addresses starts from the next available IP address. For example, if the gateway is 192.168.1.1 and the subnet mask is 255.255.255.0 then the available IP address is between the range 192.168.1.2 192.168.1.255

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

8. The DHCP server responds with an ack confirming the chosen IP address. The DHCP server registers that the IP address is taken

9. Every new client connection to the DHCP server will start a new DHCP server transaction and an offer. Test for new client requesting IP address 1

0. When the simulation is in progress, do not close the server or clients and if the DHCP server is killed all the IP allocations are lost

11. Print all the communication between the DHCP server and the client on the terminal console

12. A structure can be used to store the IP addresses, transaction ID, and the lifetime as shown below. The structure is then used for all the communications

13. An example DHCP transaction is shown below in Figure 1

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

Students also viewed these Databases questions