A novel detection algorithm for random multiple access based on physical-layer network coding