Wireless sensor networks have a vast amount of applications including environmental monitoring, military, ecology, agriculture, inventory control, robotics and health care. This paper focuses on the area of monitoring, and protection of oil, gas, and water pipelines using wireless sensor networks. ROLS: a routing protocol for linear structure wireless sensor networks is presented along with a new hierarchical addressing scheme for this type of networking environment. The networking framework and associated protocols are optimized to take advantage of the linear nature of the network to decrease installation, and maintenance cost, decrease energy requirements, increase reliability and improve communication efficiency. In addition, simulation experiments using the proposed model are presented.