A routing framework for energy harvesting wireless nanosensor networks in the Terahertz Band