Resource Allocation Based on Interference Awareness for Device-to-Device Communication in Cellular Networks