NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

State diagram for bootup with DHCP Only on Primary Interface

If the primary interface on a Linux RT target is set to DHCP only, and the device boots with possibly no DHCP server available, what are the states the system will go through?

From what I gather it looks somehting like this:

1. Power On, OS starts to boot up

2. DHCP client starts, and issues n discover messages (what are the default timeouts and number of retries for Linux RT?)

3a. If the DHCP client retrieves an address the RT application is started afterwards (?)

3b. If the client fails to get an IP address (n retries all time out...), the Real-Time application is started anyway (at least as far as I can see) - what is the state of the network interface now?

4. If the RT application checks the state of the network interface, what values will the system config api read for IP Address Mode, IP address etc.?

Based on previous experience with VxWorks targets I kind of expected it to return a non-DHCP address mode and/or an IP address of 0.0.0.0 (on VxWorks I never could set DHCP only, so the address would be a link local address, but in this case I cannot accept fallbacks to link local so I'm using DHCP Only)...But that's not what I'm seeing.

What should I expect and/or what would be the best way to check whether the DHCP client suceeded in retrieveing an address?

Would the state diagram look different depending on whether the network is disconected or connected, but with the DHCP server unavailable?

0 Kudos
Message 1 of 3
(3,348 Views)

To answer one of the questions here myself (based on tests I just ran on a cRIO-9030);

When the DHCP client has failed to retrieve an address, and the RT App starts, the system config api will return the IP, subnet, gateway and DNS as 0.0.0.0. The address mode will still say DHCP Only.

0 Kudos
Message 2 of 3
(2,781 Views)

As far as I know, the DHCP client retries forever. By Real-Time application, do you mean an application that is set to run at startup? If so, then it doesn't matter whether the target has an IP address or not, it will start as soon as LabVIEW RT is executed.

Using system config API is a good way of determining whether the DHCP client succeeded.

Edit: As for how the system config API reads the IP status, when using DHCP only there's no difference between no DHCP server available and cable disconnected.

Message 3 of 3
(2,781 Views)