1. Define two new host parameter for the nodes, named Ttlive and Nstatus (just like node id).
2. Add the ttlive parameter to your config file and assign it the required value in seconds (representing time for which the node must be alive).
3. Add the Nstatus parameters to your config file and set its default value to 1 (representing node status enabled/alive).
3. During the network setup phase, read the Ttlive and Nstatus values from the config file and assign it to the Ttlive and Nstatus parameters of the host, respectively.
4. On mac layers, write code that checks the value of Nstatus on packet sending or receiving. If the value is 1 (node is alive) then allow the packets, otherwise drop the packets.
5. Schedule a self-message (with small timer say 1 sec) and whenever this event occurs, compare the current time with the Ttlive time, for example, (if system.time < system.time+Ttlive). If the time is not reached, then re-schedule the self-message, otherwise set the value of Nstatus=0 (meaning that timer is reached and node is no more active).