5G device to device communication is such a product of progressive thinking, a network that uses both LTE communication scenario in conjugation with Wi-Fi low band communication. The main idea for conjunction of two different types of network is based on the fact that base stations suffer large amount of traffic and tend to drop data and information in such cases. Apart from these facts another main stream goal is to provide security for such a communication technology. The network is based on the transitioning nodes, a set of cluster head communicates with another cluster head using base stations and nodes in between transfer from one cluster head to another. Gray hole attack is a situation in which the attacker inserts a malicious node into cluster head and steals information. This paper is based on the performance of 5G networks and effects of gray hole attacks on 5G networks.