Page 1 of 1

Questions on implementing protocol with different Ethertype

Posted: Mon Nov 26, 2012 11:03 am
by sblair
How difficult is it to implement a protocol using a different Ethertype on the Netburner platform? i.e. a different protocol below the IP level. I've taken for granted how easy the RTOS makes it for doing UDP/TCP packet communications. I'm faced with possibly needing to implement a proprietary protocol that is below the IP layer with a different Ethertype and just curious what experiences others here have had in doing that?

Thanks.
Scott

Re: Questions on implementing protocol with different Ethert

Posted: Mon Nov 26, 2012 5:08 pm
by dciliske
If my assumption is correct and you're asking about implementing a custom protocol ontop of Ethernet, but not IP. If so, it's pretty simple, though not quite as simple as it could be (isn't that most of the world?). Basically you'll want to modify the DoRX function in ethernet.cpp and add a handle of the form

Code: Select all

if ( cp[6] == MY_ETHER_TYPE )
   {
        ... Do stuff ....
   }
where 'Do stuff' either handles the received packet or hands it off appropriately. For transmitting, simply create the Ethernet packet and send it using TransmitBuffer, for the given interface.

Is that enough to get you started?