Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20688 Discussions

DHCP HostName definition in a socket server eth project

Altera_Forum
Honored Contributor II
1,043 Views

Hi all, 

 

I have developed a Nios FW with MicroC/OS-II and NicheStack TCP/IP, like the "simple socket server". 

Now I have enabled the DHCP option and the system runs correcty because the Router assign to it the IP dinamically. 

The problem is that the Router doesn't recognize the HostName of my system. 

 

How can I implement the hostname in order to have the possibility to connect by the client to the server through the HostName and not the IP address? 

 

Thanks, 

Christian 

 

0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
293 Views

Hi Christian, 

 

this functionality you have to implement within the client user application. After the DHCP server has assigned an IP-address to your Nios Host you can see the matching MAC-address in the rooting table. So you will be able to identify the connected Nios Host by his MAC-address. The lower 3 Bytes of the MAC-adress you can specify in the Nios firmware using get_mac_adddress(). 

 

Jens
0 Kudos
Altera_Forum
Honored Contributor II
293 Views

Thank you Jens, 

 

but if I would connect by a client like Telnet without knowing the IP Address, Can I add in the my Nios system some functions that permits to cummunacte an HostName to the Router? 

However I have useg the function get_mac_adddress() in my Nios firmware. 

 

Best Regards, 

Christian
0 Kudos
Altera_Forum
Honored Contributor II
293 Views

Christian, 

I think a DNS-server should running at your router. You have to provide its address to the network stack (Interniche). May be there is a function in the NicheStack to tell a DNS-Server the hostname during DHCP. I have never used that so I can not help in detail. 

 

 

Jens
0 Kudos
Altera_Forum
Honored Contributor II
293 Views

Thank you very much Jens

0 Kudos
Reply