You can refer the function MAC11a_Receive() in SoraSDK2.0\src\umxsdrbrick\mac.cpp.
Please note that the the back-off implementation is not exactly matching 802.11 standard, because it does not monitor the channel during sending a packet. If it find a missing ACK packet, it will think conflict happens.