RTCS ipcfg, DHCP client, LLMNR, Network Address assignment, rebind, renew, link status

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

RTCS ipcfg, DHCP client, LLMNR, Network Address assignment, rebind, renew, link status

1,339件の閲覧回数
pmt
Contributor V

MQX4.1, 4.2, IP4

I'm very familiar with the MQX DHCP functionality, including using DHCP options to register a machine name (DHCP option 12), and DHCP callbacks for lease renewals, etc.  This is somewhat involved, and I'm trying to get a handle on if the 'ipcfg' library can do some or all of what I want.  Any comments would be appreciated:

I would consider this to be the most basic network functionality (i.e. something that should be built into ipcfg):

- Bind DHCP with machine host name registration (DHCP option 12) and either (at the user option):

      - fixed static IP address fallback

      - autoip/LLMNR fallback

   if the address assignment request fails

- Monitor the link status (cable connect and disconnect, PHY sleep mode).  Retry DHCP on re-connect, even after autoIP address fallback.

- Handle DHCP lease renewal, rebind

ipcfg_task_create handles the link monitoring, but it doesn't do binding, lease renewal, etc, as far as I can tell.  The ipcfg*dhcp functions are just one time, and don't do renew, rebind.

I am also confused by the auto_ip parameter in these functions.  This is just a static address that is passed into these functions, correct?  Is doesn't refer the AutoIP (a.k.a. bonjour, zeroconf, AutoIP/mDNS) protocols, correct?

Next, do DHCP client and LLMNR play together, or is it 'either or', or do these multi-home?

Thanks,

PMT

ラベル(1)
2 返答(返信)

778件の閲覧回数
pmt
Contributor V

I've done some experimentation and answered some of my questions:

ipcfg_bind_dhcp_wait() and the ipcfg link status task will do continuous DHCP with static IP address fallback.  It will retry DHCP on cable reconnect.

The static fallback takes 60 seconds to get assigned because the default DHCP timeout is 60 seconds.  This is somewhat annoying, but can be changed by setting the _RTCS_dhcp_term_timeout from application code.

ipcfg will not do host name registration, but it can be added by modifying ipcfg_bind_dhcp_internal to include DHCPOPT_DOMAINNAME:

    unsigned char               parm_options[] = {DHCPOPT_MASK, DHCPOPT_DNSSERVER, DHCPOPT_ROUTER, DHCPOPT_TFTPSERVER, DHCPOPT_BOOTFILENAME, DHCPOPT_DOMAINNAME};

DHCP_option_variable (&optptr, &optlen, DHCPOPT_PARAMLIST, parm_options, sizeof (parm_options));
DHCP_option_string  (&optptr, &optlen, DHCPOPT_HOSTNAME, ipcfg_RequestedHostName);

Where ipcfg_RequestedHostName is the requested host name.

-- (FEATURE REQUEST) --

It would be nice to add a function like this to ipcfg to allow a requested host name to be set:

void ipcfg_set_dhcpclient_hostname(const char *RequestedHostName);

It would also be nice that ipcfg allow retrieval of the assigned host name. 

PMT

778件の閲覧回数
rajbatra
Contributor IV

I'm not seeing DHCP renewal if I set static IP fallback.

Using the shell demo this is what I tried:

1. With network cable disconnected,

     a. ipconfig init

     b. ipconfig dhcp 169.254.0.3 255.255.255.0 169.254.0.1  (this will assign the IP to be 169.254.0.3 as no cable connected - )

     c.   (start the dhcp poller)

2. Plug network cable in

     d. type ipconfig and I don't see the address updating. It's still at 169.254.0.3

This will work, if in step b. I do just an ipconfig dhcp

Let me know if you're seeing something different.

0 件の賞賛
返信