This question is asked to eventually allow developing a device driver that will take as input IPv6 data that has had 6LoWPAN header compression and data segmentation done on it. To help me understand how to make data sent by an application have 6LoWPAN adaptation performed on it, and how to receive said data for this prospective driver I want to make a server/client pair in which the data exchanged has 6LoWPAN adaptation performed on it.
I've always learned more from taking an example and breaking and fixing it, but I am a little unsure on whether an example could even be assembled in this case. I have made TCP and UDP server/client pairs in the past for similar (learning for eventual development) purpose, and in trying to figure out how to implement 6LoWPAN between a TCP server/client using IPv6 addressing I copied https://gist.github.com/inaz2/0e77c276a834ad8e3131.
I have found FOSS 6LoWPAN implementations on Contiki and in the Linux Kernel. From http://contiki.sourceforge.net/docs/2.6/a01794.html, "[6LoWPAN] is called by the MAC process when a 6lowpan packet is received, and by the tcpip process when an IPv6 packet needs to be sent." Then, is 6LoWPAN adaptation invoked before sending from a server, and that the client would need to be listening for 802.15.4? Or is there some interface configuration done to let the operating system know that this data should be formatted in 6LoWPAN?
The linux kernel 802.15.4 documentation (https://www.kernel.org/doc/html/latest/networking/ieee802154.html) mentions fake mac drivers for development, which seem like what I'm hoping for.
So my question is whether my understanding as expressed sounds correct, and if so I would follow with a request for direction toward something that can be used as a starting point for making a TCP IPv6 server direct output to 6LoWPAN adaptation, and/or an example of the fake mac drivers in use.