The technology of sensor devices and networks is evolving rapidly with significant advances in size, processing power, memory, and energy efficiency. In addition, the cost of sensors is constantly decreasing making it possible to use large quantities of these sensors in a wide variety of important applications in environmental, military, commercial, health care, and other fields. In order to monitor certain types of infrastructures. Many of these applications involve lining up the sensors in a linear form, making a special class of these networks which are defined in this work as Linear Sensor Networks (LSNs). In a previous paper, we introduced the concept of LSNs along with a classification of the different types of LSNs, a sample of their applications and the motivation for designing specialized protocols that take advantage of the linearity of the network to enhance their communication efficiency, reliability, fault tolerance, energy savings, and network lifetime. This paper presents a distributed topology discovery algorithm for a hierarchical two-level LSNs. New definitions for important structure and design parameters are introduced. The proposed protocol allows the nodes to construct an ordered list of the nodes in the network which can be used to create an efficient routing table. In addition, it would be useful for simplifying, and enhancing the reliability and robustness of the routing process by taking advantage of the linear alignments of the nodes. Furthermore, the protocol does not require the nodes to have location detection capabilities such as GPS, which would lead to a more complex design and higher cost of the sensor nodes.