arbitrary packets on an ethernet network

It's a little OT here but I think that some of you had ran in the same problem...

I use very limited microcontrollers (32kbyte rom, 1,5kbyte ram), and it's quite difficult to implement a complete tcp/ip stack and have also space for my application. So I'm thinking to use ethernet packets with a user-defined protocol.

I'm doing some test with PCs; I'm using an ethernet packet generator (packeth, ) and a sniffer (wireshark); I put in the ethernet header a random value (this value is 0800 for ip; 0806 for arp; I put 8959, wireshark tells it's an unknown one).

The test packet is correctly sent by packeth and correctly received by wireshark, and the other PCs on the network didn't complain about it, even if the ethernet destination address was 'ffffffffffff', broadcast.

My question is: can I use with no problems my protocol? There are things I should know? Some limitation I will run into? I have to use a particular ethernet packet type?

Thanks in advance and sorry for my english.

Best regards, BQ

Reply to
Loading thread data ...

Did you take a look at uIP of Adam Dunkels? This is a very minimalistic tcp/ip stack for old 8-bit-computers (e.g. Apple II, C64) which takes only some hundred bytes of memory while executing and has a very small memory footprint. You might be able to get the memory requirements down to 520 bytes and the code size down to 5,3 kB. But this environment isn't really good at doing ethernet in general... the memory is too small, I think.

8959h is not used yet (I looked at
formatting link
so you shouldn't run into problems.

Ethernet headers are used to find out the protocol the packet transports, so the OS can hand over the packet to the driver. If there is a packet with an unknown protocol, the packet should be ignored. I think every OS reacts this way, because there might be machines on the network which use a protocol not understood by that particular system.

If you don't use an assigned number, you should be safe. The limitations you'll more come across are your tight memory constrains, I think. As long as your Ethernet header is compliant, you shouldn't need to use some particular body, because every protocol is different and as such the bodies are also.

Regards, Sebastian

Reply to

Sebastian ha scritto:


This is my opinion too. thanks for your thoughts and advices Sebastian!

Reply to

One option would be to build your own protocol upon UDP. The IP and UDP header overhead in the ethernet frame is quite small and you would avoid any future compatibility problems. For testing with any PC, standard socket programming could also be used.


Reply to
Paul Keinanen

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.