Advances in low power and low cost sensor net works have led to solutions mature enough for use in a broad range of applications, requiring various degrees of reliability. To facilitate this, a broad range of options are possible to tune reliability, throughput or energy cost in the IEEE 802.15.4 standard defining the medium access control (MAC) and physical layer for sensor networks. Knowing how to tune those knobs however requires detailed models of the protocol behavior under different conditions. In our earlier work, we have proposed a very accurate model for the slotted Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) access scheme of the IEEE 802.15.4 standard for the unacknowledged transmission mode. Because of the design of the 802.15.4 carrier sensing mechanism, modeling the performance of the network in case of acknowl edged transmissions is not a trivial extension. In this paper, we hence derive such model and illustrate through simulations that it is extremely accurate. Next, using the model, guidelines are derived to optimize the energy or throughput performance of sensor networks using the IEEE 802.15.4 standard.