We have implemented custom protocol for a sensors network on STM32 microcontroller platform and it came a time that it would be nice to port that protocol stack into the linux kernel.
The situation is this: We have a custom radio transmitter with very little built-in functionality (NRF24L01+). But at the same time we have high requirements for bandwith and power consumption, so we designed and implemented Time sharing algorithm (DTDMA) on top of the simple NRF24L01+ functions. Also for connection reliability we have implemented transport layer protocol which takes cares of the retransmissions (using a little modified sliding-window protocol). Our network has a star topology so routing is not needed here and seems that it will not change in the future.
Also note, that the other end has too little resources to implement full TCP/IP protocol stack. So custom lightweight protocol is mandatory :(.
So in essence we have three layers:
- Hardware Driver (NRF24L01+)
- Time Division algorithm
- Packet control algorithm
So the question is where (architecturely) should time sharing algorithms be?
As I understand, the best way to implement NRF driver is to use linux/netdevice.h interface and for the Packet control (sliding window) is to use linux/net.h interface (using struct proto_ops). But I can`t figure out how and where should time division fit.
Any help is highly appreciate. Thanks in advance :).