The wireless communication revolution is profoundly impacting the fields of data networks, telecommunications, and integrated networks. Personal area networks, wireless local area networks, cellular networks, and cellular systems all offer the possibility of fully distributed portable computing and communication, and this promise is driving their development. The data transmission operations between the sensor nodes and the gateway can account for a significant part of the total energy consumption of a WSN. The approaches of optimization give the results in Modified Monarch Butterfly Optimization (MMBO) throughput, packet delivery ratio, average delay, and energy consumption. Adequate performance is verified by using the simulation analysis in the network nodes.