Peer-to-peer (P2P) electricity trading has become the next generation of energy management strategies that economically benefits prosumers by trading electricity as goods and services. The P2P electricity market is expected to support the grid to minimize reserve requirements, lower investment and operational costs, reduce peak demand, and improve reliability. This study proposes a peer-to-peer (P2P) energy trading framework for an autonomous DC microgrid. The motivation is to overcome several issues related to P2P reported in the literature: the lack of physical microgrid modeling, absence of an energy management system (EMS) before the P2P trading simulation, and full autonomy of P2P participants. To address these shortcomings, a framework that integrates physical layer (modeling of the microgrid), information layer (EMS), and application layer (P2P trading scheme) is suggested. The P2P market clearance utilizes a non-cooperative game theory incorporating the alternating direction method of multipliers (ADMM) algorithm. To demonstrate the proposed framework, the P2P trading of four households (prosumers) that consists of rooftop PV, local energy storage (LES), and independent community energy storage (CES) is simulated. The objective is to prove the effectiveness of P2P trading in comparison with a framework without it. The MATLAB simulation results show that the system that utilizes P2P trading can reduce the daily overall cost of energy by 47.48 %, that is, from $28.85 (without P2P) to $15.15 (with P2P). This study demonstrated the benefits of P2P energy trading for prosumers and promoted the development of the energy market.