Device-to-device (D2D) communication facilitates two users in close proximity to communicate directly, bypassing the Evolved Node B (eNB). It provides several advantages like increased spectral efficiency, energy efficiency, decreased transmission delay, and traffic offloading from eNBs. Native support of D2D communications in the emerging fifth generation cellular systems raises significant challenges, like interference, mode selection, resource allocation, and security. Ratification of standards and collaborative research works between industries and academia are now focusing to gradually resolve these challenges. In this paper, we present a novel survey of D2D communications. Our survey provides a new classification of major research works in D2D communications on the basis of frequency and control. Subsequently, major D2D architectures, protocols, and relevant applications are discussed. We also make a detailed review of the analysis techniques and point out open research challenges.