MAC layer: resource sharing principles and algorithms