I'm looking at protocols like the Aloha protocol at the MAC level. How hard is it to programme such protocols (lets say in C language) for real life working devices.

where can i learn such low level programming? Does C language have special methods/classes/functions that would help programme MAC layer protocols?