Device-to-device (D2D) communication is one of the promising solutions to increase the efficiency of future wireless cellular networks. Using cooperative device relaying, mobile devices can realize distributed D2D networks. However, one of the main challenges in the D2D networks is implementing D2D applications in a way that selfish users autonomously relay others’ data. Thus, in this research, the interaction among mobile users is theoretically modeled by game theory. Then, the distributed protocols for D2D applications are designed. For the non-cooperative applications, the collaborative real-time content-delivery and on-line cooperative virtual multiple-input-multiple-output antenna protocols are proposed. On the average, the collaborative real-time content-delivery protocol increases the energy efficiency up to 42% with respect to the multi-cast scenario; and, the on-line cooperative virtual multiple-input-multiple-output antenna protocol increases the energy efficiency up to 35% with respect to the single-input-multiple-output antenna protocol. For the cooperative application, a distributed algorithm is designed to find stable coalitions of machine type devices under stochastic change of the cellular network. The simulation results show that the proposed distributed coalition formation algorithm respectively optimizes the energy consumption and fail ratio up to 36% and 31% with respect to the non-cooperative scenario. Key Words 5G cellular network, device-to-device tier, game theory, mechanism design.