lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] DHCP server offer timing


From: kuwa
Subject: [lwip-users] DHCP server offer timing
Date: Tue, 09 Mar 2004 21:39:42 +0900 (LMT)

Hi,

I am using lwIP 0.7.1 and found a situation that seems to be related
to DHCP server offer timing.

The following is the excerpt from dhcp_discover().

    /* set receive callback function with netif as user data */
    udp_recv(dhcp->pcb, dhcp_recv, netif);

    udp_bind(dhcp->pcb, IP_ADDR_ANY, DHCP_CLIENT_PORT);
    udp_connect(dhcp->pcb, IP_ADDR_BROADCAST, DHCP_SERVER_PORT);
    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE, ("dhcp_discover: send()ing\n"));
    udp_send(dhcp->pcb, dhcp->p_out);   /* 1 */
    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE, ("dhcp_discover: bind()ing\n"));
    udp_bind(dhcp->pcb, IP_ADDR_ANY, DHCP_CLIENT_PORT);
    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE, ("dhcp_discover: connect()ing\n"));
    udp_connect(dhcp->pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);      /* 2 */

In general (In case of successful address lease),
the offer from DHCP server is received after 2nd udp_connect() call.
(marked as /* 2 */)

On the other hand,
after once address has leased and when it has not elapsed long time,
if I reboot the my CPU board (i.e. I push the CPU reset switch and
software includes lwIP is rebooting),
the offer from DHCP server will be received after udp_send() call
(marked as /* 1 */) before re- udp_bind() and re-udp_connect().

This offer packet comes into udp_input(), but fails to match its
address and port number with existing UPD-PCBs.
At the result, DHCP client fails to get server offer.

I am considering to introduce another UDP-PCB which will receive DHCP
offer.  But that is thought to be DHCP server's fast response.......
In our network, elapsed time from sending discover to receiving offer
is almost 500msec in the former case, and 1msec in the latter case.

How would you think about this?

--
Shuji KUWAHARA





reply via email to

[Prev in Thread] Current Thread [Next in Thread]