In wireless mobile communication, base station overloading is becoming a huge problem due to increasing multimedia file transferring by the end devices. At first, the device sends a request to the base station and then sends the data bit by bit until the full file transfer is complete. As number of users increase over time, it overloads the base station managing their file transmission. In order to offload the base station, the next-generation LTE-A device to device communication will be used to transfer files among multiple devices bypassing the base station, it will limit the frequency usage and will restrict unauthorized access by utilizing the licensed frequency band. In this paper, we propose a novel algorithm for D2D communication for traffic offloading of the base station. Simulations performed here show the step-by-step implementation and analysis of time consumption of this study and reveal the potentiality of the proposed algorithm.