[En-Nut-Discussion] DHCP startup problem

Dave Smart smart at cedarnet.org
Mon Sep 23 03:03:51 CEST 2002


Hello All,

Apologies for the rather verbose network trace below. I'm trying to get
Ethernut to startup and acquire IP info from a Linksys router/DHCP server,
and I'm having some problems...

The functions of interest, and apparently the area of my confusion, are:
	NutNetIfConfig( )
	NutIpRouteAdd( )
	NutDnsConfig( )
	NutNetAutoConfig( )

	A comment in httpserv.c indicates that if I pass IP-address and IP-mask as
zero, it will enable DHCP.

Harald: I didn't see this as a possibility in the Help file "nutosnet.chm".
Perhaps just not there yet.

Having clipped and pasted from the samples, I've been trying this -
	NutRegisterDevice(&devEth0, 0x8300, 5);
	//NutNetIfConfig("eth0", my_mac, inet_addr("192.168.1.102"),
inet_addr("255.255.255.0"));
	NutNetIfConfig("eth0", my_mac, inet_addr("0.0.0.0"), inet_addr("0.0.0.0"));
	NutIpRouteAdd(0, 0, inet_addr(my_gate), &devEth0);
	NutDnsConfig(0, 0, inet_addr(my_dnssvr));

I examined the DHCP clients table in my router, and did not see any bad
entries.

Basically, the first form (with fixed address and mask), works. The second,
using "0.0.0.0" does not. Below is the ethereal capture of the 2nd form.

Can anyone see what I'm doing wrong?

thanks,
Dave Smart

Start of Capture

Frame 1 (286 on wire, 286 captured)
    Arrival Time: Sep 22, 2002 20:12:58.546594000
    Time delta from previous packet: 0.000000000 seconds
    Time relative to first packet: 0.000000000 seconds
    Frame Number: 1
    Packet Length: 286 bytes
    Capture Length: 286 bytes
Ethernet II
    Destination: ff:ff:ff:ff:ff:ff (ff:ff:ff:ff:ff:ff)
    Source: 00:06:98:01:00:a8 (egnite_01:00:a8)
    Type: IP (0x0800)
Internet Protocol, Src Addr: 0.0.0.0 (0.0.0.0), Dst Addr: 255.255.255.255
(255.255.255.255)
    Version: 4
    Header length: 20 bytes
    Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)
        0000 00.. = Differentiated Services Codepoint: Default (0x00)
        .... ..0. = ECN-Capable Transport (ECT): 0
        .... ...0 = ECN-CE: 0
    Total Length: 272
    Identification: 0x0000
    Flags: 0x00
        .0.. = Don't fragment: Not set
        ..0. = More fragments: Not set
    Fragment offset: 0
    Time to live: 64
    Protocol: UDP (0x11)
    Header checksum: 0x79de (correct)
    Source: 0.0.0.0 (0.0.0.0)
    Destination: 255.255.255.255 (255.255.255.255)
User Datagram Protocol, Src Port: 68 (68), Dst Port: bootp (67)
    Source port: 68 (68)
    Destination port: bootp (67)
    Length: 252
    Checksum: 0xb1d5 (correct)
Bootstrap Protocol
    Message type: Boot Request (1)
    Hardware type: Ethernet
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0xbe030000
    Seconds elapsed: 0
    Broadcast flag: 0x0000
    Client IP address: 0.0.0.0 (0.0.0.0)
    Your (client) IP address: 0.0.0.0 (0.0.0.0)
    Next server IP address: 0.0.0.0 (0.0.0.0)
    Relay agent IP address: 0.0.0.0 (0.0.0.0)
    Client hardware address: 00:06:98:01:00:a8
    Server host name not given
    Boot file name not given
    Magic cookie: (OK)
    Option 53: DHCP Message Type = DHCP Discover
    End Option

Frame 2 (60 on wire, 60 captured)
    Arrival Time: Sep 22, 2002 20:12:58.547793000
    Time delta from previous packet: 0.001199000 seconds
    Time relative to first packet: 0.001199000 seconds
    Frame Number: 2
    Packet Length: 60 bytes
    Capture Length: 60 bytes
Ethernet II
    Destination: ff:ff:ff:ff:ff:ff (ff:ff:ff:ff:ff:ff)
    Source: 00:20:78:d5:af:ad (Runtop_d5:af:ad)
    Type: ARP (0x0806)
    Trailer: 00000000000000000000000000000000...
Address Resolution Protocol (request)
    Hardware type: Ethernet (0x0001)
    Protocol type: IP (0x0800)
    Hardware size: 6
    Protocol size: 4
    Opcode: request (0x0001)
    Sender hardware address: 00:20:78:d5:af:ad
    Sender protocol address: 192.168.1.1
    Target hardware address: 00:00:00:00:00:00
    Target protocol address: 192.168.1.105

Frame 3 (590 on wire, 590 captured)
    Arrival Time: Sep 22, 2002 20:12:59.548053000
    Time delta from previous packet: 1.000260000 seconds
    Time relative to first packet: 1.001459000 seconds
    Frame Number: 3
    Packet Length: 590 bytes
    Capture Length: 590 bytes
Ethernet II
    Destination: ff:ff:ff:ff:ff:ff (ff:ff:ff:ff:ff:ff)
    Source: 00:20:78:d5:af:ad (Runtop_d5:af:ad)
    Type: IP (0x0800)
Internet Protocol, Src Addr: 192.168.1.1 (192.168.1.1), Dst Addr:
255.255.255.255 (255.255.255.255)
    Version: 4
    Header length: 20 bytes
    Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)
        0000 00.. = Differentiated Services Codepoint: Default (0x00)
        .... ..0. = ECN-Capable Transport (ECT): 0
        .... ...0 = ECN-CE: 0
    Total Length: 576
    Identification: 0x0000
    Flags: 0x00
        .0.. = Don't fragment: Not set
        ..0. = More fragments: Not set
    Fragment offset: 0
    Time to live: 150
    Protocol: UDP (0x11)
    Header checksum: 0x6104 (correct)
    Source: 192.168.1.1 (192.168.1.1)
    Destination: 255.255.255.255 (255.255.255.255)
User Datagram Protocol, Src Port: bootp (67), Dst Port: 68 (68)
    Source port: bootp (67)
    Destination port: 68 (68)
    Length: 556
    Checksum: 0x5e02 (correct)
Bootstrap Protocol
    Message type: Boot Reply (2)
    Hardware type: Ethernet
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0xbe030000
    Seconds elapsed: 0
    Broadcast flag: 0x0000
    Client IP address: 0.0.0.0 (0.0.0.0)
    Your (client) IP address: 192.168.1.105 (192.168.1.105)
    Next server IP address: 0.0.0.0 (0.0.0.0)
    Relay agent IP address: 0.0.0.0 (0.0.0.0)
    Client hardware address: 00:06:98:01:00:a8
    Server host name not given
    Boot file name not given
    Magic cookie: (OK)
    Option 53: DHCP Message Type = DHCP Offer
    Option 1: Subnet Mask = 255.255.255.0
    Option 3: Router = 192.168.1.1
    Option 6: Domain Name Server
        IP Address: 204.127.202.4
        IP Address: 216.148.227.68
    Option 15: Domain Name = "mchsi.com"
    Option 51: IP Address Lease Time = 1 day
    Option 54: Server Identifier = 192.168.1.1
    End Option
    Padding

Frame 4 (298 on wire, 298 captured)
    Arrival Time: Sep 22, 2002 20:12:59.551073000
    Time delta from previous packet: 0.003020000 seconds
    Time relative to first packet: 1.004479000 seconds
    Frame Number: 4
    Packet Length: 298 bytes
    Capture Length: 298 bytes
Ethernet II
    Destination: ff:ff:ff:ff:ff:ff (ff:ff:ff:ff:ff:ff)
    Source: 00:06:98:01:00:a8 (egnite_01:00:a8)
    Type: IP (0x0800)
Internet Protocol, Src Addr: 0.0.0.0 (0.0.0.0), Dst Addr: 255.255.255.255
(255.255.255.255)
    Version: 4
    Header length: 20 bytes
    Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)
        0000 00.. = Differentiated Services Codepoint: Default (0x00)
        .... ..0. = ECN-Capable Transport (ECT): 0
        .... ...0 = ECN-CE: 0
    Total Length: 284
    Identification: 0x0001
    Flags: 0x00
        .0.. = Don't fragment: Not set
        ..0. = More fragments: Not set
    Fragment offset: 0
    Time to live: 64
    Protocol: UDP (0x11)
    Header checksum: 0x79d1 (correct)
    Source: 0.0.0.0 (0.0.0.0)
    Destination: 255.255.255.255 (255.255.255.255)
User Datagram Protocol, Src Port: 68 (68), Dst Port: bootp (67)
    Source port: 68 (68)
    Destination port: bootp (67)
    Length: 264
    Checksum: 0xebd1 (correct)
Bootstrap Protocol
    Message type: Boot Request (1)
    Hardware type: Ethernet
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0xbe030000
    Seconds elapsed: 0
    Broadcast flag: 0x0000
    Client IP address: 0.0.0.0 (0.0.0.0)
    Your (client) IP address: 0.0.0.0 (0.0.0.0)
    Next server IP address: 0.0.0.0 (0.0.0.0)
    Relay agent IP address: 0.0.0.0 (0.0.0.0)
    Client hardware address: 00:06:98:01:00:a8
    Server host name not given
    Boot file name not given
    Magic cookie: (OK)
    Option 53: DHCP Message Type = DHCP Request
    Option 50: Requested IP Address = 192.168.1.105
    Option 54: Server Identifier = 192.168.1.1
    End Option

Frame 5 (590 on wire, 590 captured)
    Arrival Time: Sep 22, 2002 20:12:59.553197000
    Time delta from previous packet: 0.002124000 seconds
    Time relative to first packet: 1.006603000 seconds
    Frame Number: 5
    Packet Length: 590 bytes
    Capture Length: 590 bytes
Ethernet II
    Destination: ff:ff:ff:ff:ff:ff (ff:ff:ff:ff:ff:ff)
    Source: 00:20:78:d5:af:ad (Runtop_d5:af:ad)
    Type: IP (0x0800)
Internet Protocol, Src Addr: 192.168.1.1 (192.168.1.1), Dst Addr:
255.255.255.255 (255.255.255.255)
    Version: 4
    Header length: 20 bytes
    Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)
        0000 00.. = Differentiated Services Codepoint: Default (0x00)
        .... ..0. = ECN-Capable Transport (ECT): 0
        .... ...0 = ECN-CE: 0
    Total Length: 576
    Identification: 0x0001
    Flags: 0x00
        .0.. = Don't fragment: Not set
        ..0. = More fragments: Not set
    Fragment offset: 0
    Time to live: 150
    Protocol: UDP (0x11)
    Header checksum: 0x6103 (correct)
    Source: 192.168.1.1 (192.168.1.1)
    Destination: 255.255.255.255 (255.255.255.255)
User Datagram Protocol, Src Port: bootp (67), Dst Port: 68 (68)
    Source port: bootp (67)
    Destination port: 68 (68)
    Length: 556
    Checksum: 0x39d4 (correct)
Bootstrap Protocol
    Message type: Boot Reply (2)
    Hardware type: Ethernet
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0xbe030000
    Seconds elapsed: 0
    Broadcast flag: 0x0000
    Client IP address: 0.0.0.0 (0.0.0.0)
    Your (client) IP address: 0.0.0.0 (0.0.0.0)
    Next server IP address: 0.0.0.0 (0.0.0.0)
    Relay agent IP address: 0.0.0.0 (0.0.0.0)
    Client hardware address: 00:06:98:01:00:a8
    Server host name not given
    Boot file name not given
    Magic cookie: (OK)
    Option 53: DHCP Message Type = DHCP NAK
    Option 54: Server Identifier = 192.168.1.1
    End Option
    Padding

Frame 6 (60 on wire, 60 captured)
    Arrival Time: Sep 22, 2002 20:12:59.556754000
    Time delta from previous packet: 0.003557000 seconds
    Time relative to first packet: 1.010160000 seconds
    Frame Number: 6
    Packet Length: 60 bytes
    Capture Length: 60 bytes
Ethernet II
    Destination: ff:ff:ff:ff:ff:ff (ff:ff:ff:ff:ff:ff)
    Source: 00:06:98:01:00:a8 (egnite_01:00:a8)
    Type: ARP (0x0806)
    Trailer: 00000000000000000000000000000000...
Address Resolution Protocol (request)
    Hardware type: Ethernet (0x0001)
    Protocol type: IP (0x0800)
    Hardware size: 6
    Protocol size: 4
    Opcode: request (0x0001)
    Sender hardware address: 00:06:98:01:00:a8
    Sender protocol address: 0.0.0.0
    Target hardware address: ff:ff:ff:ff:ff:ff
    Target protocol address: 192.168.1.1

Frame 7 (60 on wire, 60 captured)
    Arrival Time: Sep 22, 2002 20:13:00.044823000
    Time delta from previous packet: 0.488069000 seconds
    Time relative to first packet: 1.498229000 seconds
    Frame Number: 7
    Packet Length: 60 bytes
    Capture Length: 60 bytes
Ethernet II
    Destination: ff:ff:ff:ff:ff:ff (ff:ff:ff:ff:ff:ff)
    Source: 00:06:98:01:00:a8 (egnite_01:00:a8)
    Type: ARP (0x0806)
    Trailer: 00000000000000000000000000000000...
Address Resolution Protocol (request)
    Hardware type: Ethernet (0x0001)
    Protocol type: IP (0x0800)
    Hardware size: 6
    Protocol size: 4
    Opcode: request (0x0001)
    Sender hardware address: 00:06:98:01:00:a8
    Sender protocol address: 0.0.0.0
    Target hardware address: ff:ff:ff:ff:ff:ff
    Target protocol address: 192.168.1.1

Frame 8 (60 on wire, 60 captured)
    Arrival Time: Sep 22, 2002 20:13:00.544784000
    Time delta from previous packet: 0.499961000 seconds
    Time relative to first packet: 1.998190000 seconds
    Frame Number: 8
    Packet Length: 60 bytes
    Capture Length: 60 bytes
Ethernet II
    Destination: ff:ff:ff:ff:ff:ff (ff:ff:ff:ff:ff:ff)
    Source: 00:06:98:01:00:a8 (egnite_01:00:a8)
    Type: ARP (0x0806)
    Trailer: 00000000000000000000000000000000...
Address Resolution Protocol (request)
    Hardware type: Ethernet (0x0001)
    Protocol type: IP (0x0800)
    Hardware size: 6
    Protocol size: 4
    Opcode: request (0x0001)
    Sender hardware address: 00:06:98:01:00:a8
    Sender protocol address: 0.0.0.0
    Target hardware address: ff:ff:ff:ff:ff:ff
    Target protocol address: 192.168.1.1

Frame 9 (60 on wire, 60 captured)
    Arrival Time: Sep 22, 2002 20:13:01.044766000
    Time delta from previous packet: 0.499982000 seconds
    Time relative to first packet: 2.498172000 seconds
    Frame Number: 9
    Packet Length: 60 bytes
    Capture Length: 60 bytes
Ethernet II
    Destination: ff:ff:ff:ff:ff:ff (ff:ff:ff:ff:ff:ff)
    Source: 00:06:98:01:00:a8 (egnite_01:00:a8)
    Type: ARP (0x0806)
    Trailer: 00000000000000000000000000000000...
Address Resolution Protocol (request)
    Hardware type: Ethernet (0x0001)
    Protocol type: IP (0x0800)
    Hardware size: 6
    Protocol size: 4
    Opcode: request (0x0001)
    Sender hardware address: 00:06:98:01:00:a8
    Sender protocol address: 0.0.0.0
    Target hardware address: ff:ff:ff:ff:ff:ff
    Target protocol address: 192.168.1.1

End of Capture




More information about the En-Nut-Discussion mailing list