Due to the energy scarcity that the wireless sensor networks currently face, many energy-efficient protocols have been developed and proposed in different layers, especially in the data link and network layers, as a large amount of energy consumed by the transceiver, idle-listening, collision, selecting the correct nodes to act as routers, long-distance transmission, etc., which are the responsibility of data link and network layers. Since these protocols address the reasons for energy loss in one layer and neglect the treatment of energy loss in other layers, as each layer of the TCP/IP module has its own features and has no control over the other layers. Therefore, there was a need for a cross-layer design. In this paper, an energy-efficient cross-layer between MAC layer and network layer has been proposed using slotted ALOHA based p-persistent CSMA MAC protocol and Enhance Energy Conservation based on Residual Energy and Distance (EECRED) in order to reduce energy consumption and increase the network lifetime. The performance of the proposed cross-layer protocol is evaluated by simulating the protocol using the MATLAB simulation. The simulation results are compared with the Fuzzy and Ant Colony Optimization (ACO) based MAC/Routing cross-layer protocol (FAMACRO), FAMACRO for wireless sensor networks (FAMACROW), fuzzy cross-layer LEACH, routing-MAC, and Energy-efficient Cross-layer-sensing Clustering Method (ECCM) protocols to ensure the efficiency of the proposed cross-layer. The simulation results show that the proposed cross-layer protocol is very energy efficient, provides stable networks, consumes little energy, and significantly increases the life of the network compared to the single-layer protocols where the improvement rate was 45%, 53%, 37%, 91%, and 28.72% compared to FAMACRO, FAMAROW, fuzzy cross-layer LEACH, routing-MAC, and ECCM protocols respectively in terms of the number of alive nodes or residual energy.