34.4. DHCP diagnostics, statistics and debug

34.4.1. DHCP diagnostics

This command reports the current situation of the DHCP resource:

[17:49:20] ABILIS_CPX:d d dhcp

RES:Dhcp ----------------------------------------------------------------------
       Dynamic_Host_Configuration_Protocol                                     
       STATE:ACTIVE           SERVER-LAN:1            RELAY-LAN:0
       - Server Bindings ------------------------------------------------------
       ------- Summary -------|------- Types ---------|------- States ---------
       MAX      |300          |ACT-STATIC  |0         |ACTIVE     |0          |
       USED     |0            |ACT-DYNAMIC |0         |EXPIRED    |0          |
       FREE     |300          |            |          |RELEASED   |0          |
       REUSABLE |0            |ALL-STATIC  |0         |ABANDONED  |0          |
                |             |ALL-DYNAMIC |0         |INCOMPLETE |0          |
                |             |            |          |INVALID    |0          |
       ------------------------------------------------------------------------

The meaning:

STATE

Current DHCP state:

  • DOWN - State set when registration to lower UDP port fail, better said when the "use" of UDP service is not possible.

  • INACT - The driver is "ready" to work (no errors with UDP service), but inactive (configuration parameter ACT:NO). All the incoming requests/responses will be silently dropped at their arrival, without requiring CPU time for their verification.

  • ACTIVE - The driver is fully ready to work.

  • STOP - Server mode only. The driver is fully ready to work but it cannot create/write the bindings file. Possible causes:

    • The file is corrupted.

    • The disk is corrupted.

    • The disk is write protected.

      [Note]Note

      Try to remove cause of stopped state end send the INIT command.

MAX

Number of all Entries in a binding table (it is equal to max-clients value from DHCP configuration).

USED

Number of all used binding entries.

FREE

Number of all free entries in the binding table.

REUSABLE

Number of all used entries in the binding table in not ACTIVE state (EXPIRED, ABANDONED, RELEASED, INVALID). They can be reused when free entries are ended.

ACT-STATIC

Total Number of used STATIC entries in ACTIVE and INCOMPLETE state.

ACT-DYNAMIC

Total Number of used DYNAMIC entries in ACTIVE and INCOMPLETE state.

ALL-STATIC

Total Number of all STATIC entries.

ALL-DYNAMIC

Total Number of all DYNAMIC entries.

ACTIVE

Total Number of used entries in ACTIVE state.

EXPIRED

Total Number of used entries in EXPIRED state.

RELEASED

Total Number of used entries in RELEASED state.

ABANDONED

Total Number of used entries in ABANDONED state.

INCOMPLETE

Total Number of used entries in INCOMPLETE state.

INVALID

Total Number of used INVALID entries.

34.4.2. DHCP statistics

This command can help to understand what is happening, in case of troubles:

[11:42:10] ABILIS_CPX:d s dhcp

RES:Dhcp ----------------------------------------------------------------------
       Dynamic_Host_Configuration_Protocol                                     
       --- Cleared 1 days 12:55:54 ago, on 28/09/2017 at 01:15:53 -------------
       ------------------------------------------------------------------------
       Server mode
       -----------|---INPUT---|--OUTPUT---|-----------|---INPUT---|--OUTPUT---|
       REQUESTS   |        182|           |RESPONSES  |           |        182|
       CHAR       |      56121|      54600|PCK        |        182|        182|
       LONG       |          0|          0|BAD-FORMAT |          0|           |
       UNK-IPPRES |          0|           |           |           |           |
       DISCOVER   |         57|           |OFFER      |           |         57|
       REQUEST    |         95|           |ACK        |           |        125|
       DECLINE    |          0|           |NAK        |           |          0|
       RELEASE    |          0|           |           |           |           |
       INFORM     |         30|           |
       ------------------------------------------------------------------------
       Relay mode
       -----------|---INPUT---|--OUTPUT---|-----------|---INPUT---|--OUTPUT---|
       REQUESTS   |          0|          0|RESPONSES  |          0|          0|
       HOP-EXCEED |          0|           |BAD-GW     |          0|           |
       ------------------------------------------------------------------------

With reference to the shown interval of time («Cleared 1 days 12:55:54 ago») these counters, about Server mode, show the number of:

REQUESTSAll DHCP messages received.
RESPONSESAll DHCP messages sent.
CHARReceived/sent characters in DHCP messages (UDP interface overhead excluded).
PCK Received/sent packets.
LONGIN - received packets which are too long for the configured MSGLEN. OUT - "not sent" packets because available buffer is too small.
BAD-FORMATPackets discarded because they were not "well formatted".
UNK-IPRESReceived packets with "unknown" IP.
DISCOVERReceived DHCPDISCOVER packets from the DHCP client.
OFFERSent DHCPOFFER packets to the DHCP client.
REQUESTReceived DHCPREQUEST packets from the DHCP client.
ACKSent DHCPACK packets to the DHCP client.
DECLINEReceived DHCPDECLINE packets from the DHCP client.
NAKSent DHCPNAK packets to the DHCP client.
RELEASEReceived DHCPRELEASE packets from the DHCP client.
INFORM Number of received DHCPINFORM packets from the DHCP client.

Statistics of relay mode only:

REQUESTSIN - good requests received from client. OUT - client's requests relayed to the servers.
RESPONSESIN - good responses received from server(s). OUT - server(s)'s responses relayed to the client.
HOP-EXCEEDDiscarded requests because the "hops number" value in the packet exceeded the threshold.
BAD-GWDiscarded responses for "not matching" gateway address ('giaddr' field).

34.4.3. DHCP debug

The following commands allow to purge INVALID bindings which may appear upon network configuration changes.

[20:57:46] ABILIS_CPX:debug res:dhcp

RES:Dhcp ----------------------------------------------------------------------
       Dynamic_Host_Configuration_Protocol                                     
       BufferLength:454    Date/Time:05/06/2015 10:03:54 TraceTime:2010508

Usage:
  LSN:0             - This help
  LSN:1             - Complete debug
  LSN:2             - Statistics
  LSN:3             - DHCP log
  LSN:3  CMD:CLR    - Clear DHCP log
  LSN:4             - Incoming datagrams dump
  LSN:4  CMD:CLR    - Clear incoming datagrams dump
  LSN:5             - Restore host table
  LSN:6  CMD:<MAC>  - Delete INV (invalid) bindings with specified MAC
  LSN:6  CMD:ALL    - Delete ALL INV (invalid) bindings

Type the following command to view the DHCP log:

[14:20:53] ABILIS_CPX:debug res:dhcp lsn:3

RES:Dhcp ----------------------------------------------------------------------
       Dynamic_Host_Configuration_Protocol                                     
       BufferLength:64512  Date/Time:02/08/2016 14:21:00 TraceTime:97203436

02/08 12:20:27 [SRV] Recv data remote IP:192.168.020.111, MAC:F0-79-59-68-76-5F
02/08 12:20:27 [SRV] Recv INFORM. DHCP cannot support it.
02/08 12:20:27 [SRV] "giaddr" is empty, use address of interface:192.168.020.254
02/08 12:20:27 [SRV] Network located
02/08 12:20:27 [SRV] INFORM. Subnet: net:192.168.020.000, mask:255.255.255.000
02/08 12:20:27 [SRV] Send ACK
02/08 12:20:27 [SRV] Send data remote IP:255.255.255.255, MAC:F0-79-59-68-76-5F
02/08 12:25:08 [SRV] Recv data remote IP:192.168.020.111, MAC:F0-79-59-68-76-5F
02/08 12:25:08 [SRV] Recv INFORM. DHCP cannot support it.
02/08 12:25:08 [SRV] "giaddr" is empty, use address of interface:192.168.020.254
02/08 12:25:08 [SRV] Network located
02/08 12:25:08 [SRV] INFORM. Subnet: net:192.168.020.000, mask:255.255.255.000
02/08 12:25:08 [SRV] Send ACK
02/08 12:25:08 [SRV] Send data remote IP:255.255.255.255, MAC:F0-79-59-68-76-5F
02/08 12:30:28 [SRV] Recv data remote IP:192.168.020.111, MAC:F0-79-59-68-76-5F
02/08 12:30:28 [SRV] Recv INFORM. DHCP cannot support it.
02/08 12:30:28 [SRV] "giaddr" is empty, use address of interface:192.168.020.254
02/08 12:30:28 [SRV] Network located
02/08 12:30:28 [SRV] INFORM. Subnet: net:192.168.020.000, mask:255.255.255.000
02/08 12:30:28 [SRV] Send ACK
02/08 12:30:28 [SRV] Send data remote IP:255.255.255.255, MAC:F0-79-59-68-76-5F
02/08 12:34:47 [SRV] Recv data remote IP:192.168.020.111, MAC:F0-79-59-68-76-5F
02/08 12:34:47 [SRV] Recv INFORM. DHCP cannot support it.
02/08 12:34:47 [SRV] "giaddr" is empty, use address of interface:192.168.020.254
02/08 12:34:47 [SRV] Network located
02/08 12:34:47 [SRV] INFORM. Subnet: net:192.168.020.000, mask:255.255.255.000
02/08 12:34:47 [SRV] Send ACK
02/08 12:34:47 [SRV] Send data remote IP:255.255.255.255, MAC:F0-79-59-68-76-5F