-
Notifications
You must be signed in to change notification settings - Fork 0
Future Work
-
The current server configuration assigns IP addresses to incoming clients from a single address pool. This pool consists of IP addresses from only the server's subnet.
-
The function :
ApplicationContainer InstallDhcpServer (Ptr<NetDevice> netDevice, Ipv4Address serverAddr,
Ipv4Address poolAddr, Ipv4Mask poolMask,
Ipv4Address minAddr, Ipv4Address maxAddr,
Ipv4Address gateway = Ipv4Address ())
in
src/internet-apps/helper/dhcp-helper.h
sets all the attributes of the server including its own IP address. More information about this function can be found here : InstallDhcpServer -
This should be split into 2 separate functions :
-
ApplicationContainer InstallDhcpServer(Ptr<NetDevice> netDevice, Ipv4Address serverAddr, Ipv4Mask Mask)
This function allocates the server IP address to the Ptr argument passed, installs a default traffic control configuration, creates a DHCP server app and returns that pointer.
-
void AddAddressPool(ApplicationContainer dhcpServerApp, Ipv4Address minAddr, Ipv4Address maxAddr, Ipv4Address gateway)
This function adds the IP addresses in the given range i.e., between minAddr and maxAddr (both inclusive), as a pair along with the given gateway to m_availableAddresses (a map consisting of gateway and IP addresses allocatable in a subnet).
-
-
It is required to modify
void StartApplication (void)
insrc/internet-apps/model/dhcp-server.h
to map the gateway address of the incoming client subnet and the corresponding pool address. -
The function
void SendOffer (Ptr<NetDevice> iDev, DhcpHeader header, InetSocketAddress from)
insrc/internet-apps/model/dhcp-server.h
must be modified to extract the gateway IP address (giaddr) of the client subnet from the header using header.GetGiaddr().This value of giaddr is compared with the giaddr values in the map to retrieve the corresponding pool of IP addresses, from which one address is offered to the client.
-
Our current implementation supports only two subnets - one having the DHCP server and the other for incoming clients.
-
We have two functions in
src/internet-apps/helper/dhcp-helper.h
:Ipv4InterfaceContainer InstallFixedAddress (Ptr<NetDevice> netDevice, Ipv4Address addr, Ipv4Mask mask)
ApplicationContainer InstallDhcpRelay (Ptr<NetDevice> netDevice, Ipv4Address relayAddr, Ipv4Mask subMask, Ipv4Address dhcps)
to initialize the client and server sides of relay respectively.
-
To support clients from multiple subnets :
- We need to modify
void SendDiscover(Ptr<NetDevice> iDev,DhcpHeader header)
function insrc/internet-apps/model/dhcp-relay.cc
. - This is done so that for each incoming packet header, we set the gateway IP address attribute (giaddr) to be the IP address of the incoming NetDevice (iDev).
- We need to modify
-
void NetHandlerServer (Ptr<Socket> socket)
insrc/internet-apps/model/dhcp-relay.h
compares the Ipv4 address of the interface receiving the incoming packet. If this is equal to the relay's server side address, then we don't forward the DHCP DISCOVER message.