A method of a gateway for controlling data flow in a wireless body area network, the method comprising: receiving sensor data from a plurality of sensor nodes at the gateway via a first transmission channel from a first set of transmission channels , using a multiplexing technique, wherein the sensor data comprises beacon packet loss information corresponding to the first transmission channel; transmitting beacon data from the gateway to the plurality of sensor nodes via the first transmission channel from the first set of transmission channels , wherein the beacon data comprises acknowledgement data and sensor packet loss information corresponding to the first transmission channel; determining channel packet loss information of the first transmission channel based on the beacon packet loss information and the sensor packet loss information using, for each of the sensor nodes, a weightage for that sensor node; comparing the channel packet loss information with a packet loss threshold ; and generating at the gateway a decision to switch flow of the sensor data and the beacon data through a second transmission channel from a second set of transmission channels different from the first set of transmission channels , instead of the first transmission channel, if the channel packet loss information is greater than the packet loss threshold; communicating the decision to switch the flow of the sensor data and the beacon data to the plurality of sensor nodes via the beacon data, wherein the beacon data comprises a time instant for switching and a transmission frequency corresponding to the second transmission channel; and switching the flow of the sensor data and the beacon data through the second transmission channel. receiving sensor data from a plurality of sensor nodes at the gateway via a first transmission channel from a first set of transmission channels , using a multiplexing technique, wherein the sensor data comprises beacon packet loss information corresponding to the first transmission channel; transmitting beacon data from the gateway to the plurality of sensor nodes via the first transmission channel from the first set of transmission channels , wherein the beacon data comprises acknowledgement data and sensor packet loss information corresponding to the first transmission channel; determining channel packet loss information of the first transmission channel based on the beacon packet loss information and the sensor packet loss information using, for each of the sensor nodes, a weightage for that sensor node; comparing the channel packet loss information with a packet loss threshold ; and generating at the gateway a decision to switch flow of the sensor data and the beacon data through a second transmission channel from a second set of transmission channels different from the first set of transmission channels , instead of the first transmission channel, if the channel packet loss information is greater than the packet loss threshold; communicating the decision to switch the flow of the sensor data and the beacon data to the plurality of sensor nodes via the beacon data, wherein the beacon data comprises a time instant for switching and a transmission frequency corresponding to the second transmission channel; and switching the flow of the sensor data and the beacon data through the second transmission channel. <EOS>