Thread based simultion of csma/ca