## 1 Introduction  
Wireless Sensor Networks (WSNs) are potentially one of the most important technologies of this century [1]. Due to a combination of advances in electronics, nanotechnology, wireless communications, computing, networking, and robotics, it is now possible to design advanced sensors and sensor systems that can be used in various application areas: environmental monitoring; object and event detection; military surveillance; precision agriculture; transportation, _etc._[2]. WSNs constitute a pervasive and distributed computing technology with a wide range of applications. A WSN consists of (potentially) thousands of tiny, low-cost and low-power nodes, colloquially referred to as \"motes\", which can sense the environment through sensors. The motes get information about some physical parameters from the environment and wirelessly send it to one or several base stations, where it can be analyzed. Wireless sensor networks act as the senses of a huge nervous system that allows real information to be felt, stored and analyzed in an ICT system. Recent advances in these kinds of systems, with a strong focus on the achievement of strict Quality of Service (QoS) requirements, make WSNs a promising technology for the Critical Infrastructure Protection (CIP) field [3]. Infrastructures such as power distribution and generation, nuclear power plants, railways, water distribution and management, etc. can take advantage of WSN deployments. Proof of this is that the U.S. Department for Homeland Security stated, in the 2004 National Plan for Research and Development in Support for CIP, that one of the strategic goals was \"to provide a National Common Operating Picture (COP)\" for Critical Infrastructures, where the core of the systems would be an intelligent, self-monitoring, and self-healing sensor network. The Australian government, by means of the Cooperative Research Center for Security (CRC-SAFE), is examining and developing solutions to security problems in CIP systems, including WSNs [4]. Finally, European projects related to CIP have grown considerably in the last five years [5, 6]. A good example of a critical infrastructure where WSNs can be applied are railways. As any other kind of infrastructure, they are affected by the aging process. For example, large sections of the railway lines in the United States were built in the late 19 th century or beginning of the 20 th century. In Europe large sections of the railway lines were rebuilt after the Second World War. Therefore, it is really important to regulate maintenance and restoration guidelines to ensure safety in railway transport. In this regard, more attention has been paid to this issue from the late 20 th century onwards. In Europe, the guidelines for the maintenance of railway lines are regulated in documents 96/48/CE and 2001/16/CE. Following these guidelines, in Spain, for example, a visual inspection of the elements of the infrastructure needs to be carried out every 15 years by specialized technicians. Furthermore, a general visual inspection is completed each year by non-specialized railway line guards. This may be sufficient for most railway elements, but in structures with unusual topology or particularly high/long bridges, the information on the evolution of defects is more limited. Moreover the visual inspections are much more difficult to carry out and require a temporary closure to traffic. In these structures, it is common to check the state of the structure using specialized equipment or even install a permanent monitoring system, e.g., fiber optic instrumentation with Brillouin Optical Time Domain Analysis (BOTDA) or distributed sensor instrumentation. One of the main disadvantages of these systems is their high cost, which means that they can only be installed at a few sites. Moreover, if there is no mobile coverage then data acquired by the system cannot be sent to the remote control center.