views:

351

answers:

3

I'm designing a device which will be connected to a computer using ethernet. It already has a mac controller built in. When I attach the device, all that happens is the computer broadcasts a bunch of DHCP discover packets and some other packets I guess in an attempt to find the device and establish the connection. I assume I need to make my device respond at this point with some sort of acknowledgement packets but I'm not sure what? Has anyone done something like this before? Thanks

I'm using wireshark to see the packets. The output looks something like this:

     time       source                 destination       protocol              info
 1 0.000000    0.0.0.0               255.255.255.255       DHCP     DHCP Discover - Transaction ID 0xc82a69f
 2 4.000064    0.0.0.0               255.255.255.255       DHCP     DHCP Discover - Transaction ID 0xc82a69f
 3 10.688469   0.0.0.0               255.255.255.255       DHCP     DHCP Discover - Transaction ID 0xb452266b
 4 14.690625   0.0.0.0               255.255.255.255       DHCP     DHCP Discover - Transaction ID 0xb452266b
 5 22.690576   0.0.0.0               255.255.255.255       DHCP     DHCP Discover - Transaction ID 0xb452266b
 6 38.690605   0.0.0.0               255.255.255.255       DHCP     DHCP Discover - Transaction ID 0xb452266b
 7 62.652821   my_ip                 XXX.XXX.255.255       BROWSER  Local Master Announcement MYLAPTOP, Workstation, Server, Print Queue Server, NT Workstation, Potential Browser, Master Browser
 8 65.555281   my_ip                 XXX.XXX.255.255       BROWSER  Domain/Workgroup Announcement MY, NT Workstation, Domain Enum
 9 352.692192  0.0.0.0               255.255.255.255       DHCP     DHCP Discover - Transaction ID 0xa23d42a4
10 356.692376  0.0.0.0               255.255.255.255       DHCP     DHCP Discover - Transaction ID 0xa23d42a4
11 364.692421  0.0.0.0               255.255.255.255       DHCP     DHCP Discover - Transaction ID 0xa23d42a4
12 381.692442  0.0.0.0               255.255.255.255       DHCP     DHCP Discover - Transaction ID 0xa23d42a4
13 665.557507  my_ip                 XXX.XXX.255.255       BROWSER  Domain/Workgroup Announcement MY, NT Workstation, Domain Enum
14 686.724951  0.0.0.0               255.255.255.255       DHCP     DHCP Discover - Transaction ID 0xbe3a7bdb
15 691.724307  0.0.0.0               255.255.255.255       DHCP     DHCP Discover - Transaction ID 0xbe3a7bdb
16 698.724276  0.0.0.0               255.255.255.255       DHCP     DHCP Discover - Transaction ID 0xbe3a7bdb
17 715.724291  0.0.0.0               255.255.255.255       DHCP     DHCP Discover - Transaction ID 0xbe3a7bdb
18 783.295682  my_ip                 XXX.XXX.255.255       BROWSER  Local Master Announcement MYLAPTOP, Workstation, Server, Print Queue Server, NT Workstation, Potential Browser, Master Browser
19 908.920831  my_ip                 XXX.XXX.255.255       BROWSER  Get Backup List Request
20 908.920940  my_ip                 XXX.XXX.255.255       NBNS     Name query NB MY<1b>
A: 

"DHCP Discover" means your PC is asking any device connected to the Ethernet Link for an IP address it could use. Obviously your device is not a DHCP-server. Instead, as a first step, you should assign both your pc and your device static IP addresses, preferably from the private IP ranges like 192.168.x.x.

If your device has a working IP-stack, it should then answer to pings.

You can ignore the BROWSER and NBNS packets. Thats just Windows trying to talk to another Windows.

Correction: It's not completely clear, which device broadcasts the DHCP Discover, it's most likely your PC, but it could as well be the device (if it has a built-in DHCP-Client), or any other device on the same Ethernet link. You need to include the MAC Adresses in the Wireshark dump to be sure.

edgar.holleis
A: 

It looks like what is happening is that your device is trying to get an IP number from a DHCP server, but there is no DHCP server responding.

EDIT: I say it is the device because if I am reading the trace right, your computer already has an IP number. It might be instructive to look at the underlying Ethernet frames -- I believe Wireshark lets you do that.

peejaybee
+1  A: 

If your computer is broadcasting DHCP packets it's because it needs a DHCP server to get an address. It is not looking for your device. Did you take the computer off the main network and hook it up on a private network with your device?

Your computer knows nothing about your embedded device and will not try and make a connection with it. The first thing you need to do is decide what the connection will do and then write or obtain software to create the connection. Typically the embedded device will create a server socket and wait for a client (you computer) to connect to it. Telnet is an example of a client/server tcp connection.

It is apparent from your post that you are unsure about what your embedded device is doing. You need to elaborate more about your embedded device and how it should function.

FLY135
you are correct. I know what I want my device to do, but I don't have a great understanding of transmitting data using ethernet. Basically, I will be sending video from my device to be stored on a pc. Any suggestions wil be extremely appreciated.
bobbyb
Sending video is a wide open question. You have many choices.1) Streaming on demand using TCP and 1 stream per client.2) UDP streaming either unicast or multicast.You can use either TCP or UDP to stream video data. You can stream using RTP or raw data. MPEG-2 can be streamed raw data like MPEG-2 Transport stream because the timing information is embedded. Video like MPEG-4 or H.264 can be streamed using RTP, which adds time stamps. But they also require other mechanisms like SDP files or RTSP to get essential configuration data.
FLY135
A player such as VideoLan Client (VLC) is an excellent tool for the client side to test your embedded device. Search for RFCs that describe RTP and RTSP as a starting point.
FLY135