Karst show caves – how DTN technology as used in space assists automatic environmental monitoring and tourist protection – experiment in Postojna Cave

Abstract. The paper presents an experiment demonstrating a novel and successful application of delay- and disruption-tolerant networking (DTN) technology for automatic data transfer in a karst cave early warning and measuring system. The experiment took place inside the Postojna Cave in Slovenia, which is open to tourists. Several automatic meteorological measuring stations are set up inside the cave, as an adjunct to the surveillance infrastructure; the regular data transfer provided by the DTN technology allows the surveillance system to take on the role of an early warning system (EWS). One of the stations is set up alongside the railway tracks, which allows the tourist to travel inside the cave by train. The experiment was carried out by placing a DTN "data mule" (a DTN-enabled computer with WiFi connection) on the train and by upgrading the meteorological station with a DTN-enabled WiFi transmission system. When the data mule is in the wireless drive-by mode, it collects measurement data from the station over a period of several seconds as the train without stopping passes the stationary equipment, and delivers data at the final train station by the cave entrance. This paper describes an overview of the experimental equipment and organization allowing the use of a DTN system for data collection and an EWS inside karst caves where there is regular traffic of tourists and researchers.

1 The wider scope of the successful experiment Large karst caves attract and will attract many tourists.One such cave is the Postojna Cave in Slovenia with a tradition of tourist visits since 1819, and in recent years more than 500 000 visitors per year.Mass tourism goes hand in hand with stricter requirements concerning both the safety of the tourists and the impact of different physical conditions inside a cave on the tourists' health, as well as monitoring the potential impact that the tourists have on the cave's microclimate.To satisfy both requirements we are setting up an environmental measuring system (for measuring various parameters including micro-meteorology and hydrology, CO 2 concentrations and radon levels).Additionally, these measuring systems can serve another purpose.They can provide protection to the tourists in case of severe deviation of the measured parameters (e.g. a rapid rise in the water level, increased CO 2 or radon concentration, or similar).Information is based on prognosis of meteorological parameters including solar energy budget and forecast of ambient air quality conditions of outer atmosphere over the cave region (Božnar et al., 2012a).This is called an automatic monitoring-based early warning system (EWS).The problem of establishing communication lines also arises in the case of large caves (in the case of the Postojna system the train travels 2 kilometres from the entrance to the beginning of the tourist trail).Only near-real-time data transfer would allow the data monitoring system to qualify as an early warning system.

F. Gabrovšek et al.: Karst show caves
The problem of establishing communication lines is particularly complicated in karst caves that are subject to environmental protection laws, where cable installations are either prohibited or only allowed to a minimum extent or where the cable installation would be too expensive.Automatic data transfer is particularly demanding at sites where there is no cable network (neither copper nor optical cables) installed.The complex geometry of caves is a completely different world from the open terrain above ground.A wireless transmission distance, which can easily be achieved above ground using WiFi (IEEE 802.11),WiMAX (IEEE 802.16) or other radio equipment, is far more difficult to bridge with conventional techniques in the interior of the cave with its intertwined narrow passages and tunnels.An additional barrier to communication is the power consumption, particularly in the case of battery-powered electrical devices installed at sites without permanent mains power supply.Longrange WiFi, which operates at relatively high frequency, is limited to "line of sight".The lack of line of sight is a key characteristic of the connecting tunnels inside karst caves.In part, the problem can be solved by long-wavelength (lowerfrequency) radio communication; however, the supported information throughput is significantly lower than is desirable when the system is to be used to provide an EWS.There is also very high relative humidity (100 % in practice) present in the cave that seriously affects the quality of wireless communications.In the paper presented by Mottola et al. (2010) it has been shown that data packet delivery ratio is significantly affected.Up to 9 % of data are not well transmitted when threshold of more than 90 % of relative humidity is exceeded.
In addition to the safety early warning function, the communication lines are also used to supervise the operation of the automatic measurement system.Prompt detection of measuring equipment errors and failures is important, since continuity in the recorded data set is of key importance for in-depth research.Periodic patrols to retrieve the measurements by local manual transfer can be error prone, and the longer intervals between collections compared with the DTN (delay-and disruption-tolerant networking) solution can result in larger lacunae in the data record.
We came to the realization that the DTN data transmission technology, which we used to carry out research in the scope of the N4C FP7 project funded by the EU, would be perfect for such a demanding environment (N4C, 2013, http: //www.n4c.eu).DTN is an evolution of the type of networking originally proposed by Vinton Cerf (one of the founding fathers of the conventional Internet) and NASA researchers as a way to extend the capabilities of the Internet into the interplanetary domain where long delays and discontinuous links are unavoidable due to the long paths, celestial mechanics and interference by weather.It soon became clear that there were scenarios in terrestrial networking where the same issues of unavoidable delay and disruption affect communications.These include various data transfer applications for remote parts of the Earth that are only periodically populated by nomads or tourists, as well as other parts of the continents that are poorly equipped with communications and power infrastructure, where economic factors push the availability of conventional networks far into the future.
This article focuses on one possible DTN technology application, namely the novel use of DTN technology for data transfer from a micro-meteorological station inside a karst cave to the cave entrance by exploiting a tourist train that transports tourists from the cave entrance to the beginning of the tourist track located in a more interesting section of the cave.
The research is an interdisciplinary approach, since the idea initially existed at MEIS and underwent technical development there prior to its successful final realization.The project was executed by implementing a DTN routing protocol known as PRroPHET defined by RFC6693 (Lindgren et al., 2012)  The successful data transfer experiment is an innovation for the speleologists, as well as DTN researchers.The technology employed is suitable for other similar applications in large tourist caves around the world.
The article opens with a simplified explanation of the essence of DTN communications, which is followed by a description of the research from the beginning of DTN application in Sweden to DTN application in the Postojna Cave in Slovenia, and finishes off by placing the implementation of the current DTN into the present state of the science in the world.A short description of the characteristics of the employed automatic measuring system will follow together with the cave geometry and the tourist railway route, which is the key to the overall execution of the project.The introductory paragraphs will be followed by the core problema detailed description of the experiment in a manner that allows replication by other researchers around the world.

A brief speleological and historical overview of the
Postojna Cave system

History and characteristics of touristic use of the Postojna Cave system
Postojnska jama (Postojna Cave system) is the secondlongest known cave in Slovenia.The system is over 20 km long and has five known entrances.The cave has been known since dawn of humanity.In the Palaeolithic era, people lived in the entrance part of the cave.The oldest inscriptions found in the cave date back to the 13th century.In 1818 the inner parts of the cave were discovered, and as early as 1819 the cave was opened for tourist visits.Over 35 million visitors have visited the cave since then.Currently over 500 000 tourists visit the cave yearly.The Postojna Cave system has been always at the forefront of technological innovations in show caves.For example, an electric lighting had already been introduced in 1883.As such, the Postojna Cave system ranks among the most important tourist attraction in Slovenia and as one of the most important show caves in the world.The infrastructure supporting tourist access includes a battery-powered electric train (without electric power line) which brings visitors about 2 km into the interior of the cave.The total length of tourist routes in the cave system is 5 km, of which 3.8 km is negotiated by train with a maximal speed of 13 km h −1 and 1.2 km on foot.A typical visit lasts about 90 min.

Geological and speleological overview
The system extends within Upper Cretaceous bedded limestone between the flysch Pivka basin and northernmost active Dinaric polje, Planinsko polje (Fig. 1).The cave has been formed by an allogenic river, the Pivka, which remains the main recharger for the system (average discharge about 5 m 3 s −1 ).The system extends along two principal levels, the upper level comprised of older inactive passages, and a lower level where the active stream of the Pivka river can be followed for about 3.5 km.The flow continues through a series of sumps and fully flooded channels towards Planinska jama (Planina Cave), a large spring cave at the rim of Planinsko polje (Planina polje).The two caves have not yet been connected by diving, but the connection has been proven by dye tracing.The complete vertical extent of the system is 115 m.Structurally, the cave is situated within the anticline between two important dinaric folds, Idrija and Predjama folds.The geometry of the cave is strongly influenced by major tectonic lineaments.These are dominantly right strike-slip faults along the so-called Dinaric SE-NW trend and left strike-slip faults in the cross-Dinaric direction.The principal cave passages on both levels show general alignment with these directions, which gives the general pattern as shown in Fig. 1.Cave passages follow the strike and dip of the bedding planes on both sides of the anticline.The central part of the cave includes some of the largest galleries and chambers.Their formation is related to the fractured and crushed zones.Allogenic cave sediments have played an important role in the cave development.Many of the galleries have been partially or fully filled by sediments.Paragenetic (above sediment ceiling solution) features can be observed at many places.The tourist-accessible part of the cave follows a line of large galleries and includes all the largest chambers in the cave.
The average annual temperature in Postojna is about 8.5 • C and the average rainfall is over 1500 mm.The river Pivka is characterized by large flow rate variations.The active passages are frequently flooded; however the floods do not reach the upper level.The part of the cave used for tourism is within the upper level.

Monitoring of microclimate
To estimate the potential impact of tourism on the cave environment, a set of meteorological stations has been installed in different parts of the cave.Two stations were installed along the main tourist path, with another two away from the publicly accessible part, one presenting a very dynamic environment and the other a presumed static environment.The main goal of the monitoring is to delineate the main microclimatic processes and assess the potential influence of tourist visits to the cave.Atmospheric parameters, such as temperature, CO 2 content and wind velocity, are good and prompt indicators of state and changes in the underground microclimate.Continuous monitoring ensures recognition of climate pattern changes due to different activities in the cave as well as providing a baseline for the assessment of different hazards for cave guides and tourists, such as potentially high CO 2 and radon concentrations (Gregorič et al., 2013) .

Basics of DTN technology contrasted with conventional Internet functions
The key characteristics of the conventional Internet, often known as the (well-)connected Internet, are that it is possible to establish a continuous, relatively low delay path between any pair of end points (nodes) and there is a high probability that this path will be maintained for as long as is necessary for whatever communications are intended.The protocols used also usually expect that paths are bidirectional."Low delay" here is not specified exactly but is interpreted as meaning that a human user will not lose patience with a data exchange and the TCP protocol will be able to operate satisfactorily over the link, which requires a bidirectional path and a round trip time (RTT) of, at most, a few seconds.A disruption to one section of the data pathway forming the channel, slow operation of part of the data pathway or the overall transmission path being too long will disrupt the protocols normally used in the well-connected Internet and prevent communication.This is the case with communication to and from spacecraft in outer space (deep space), where we are faced with long to extremely long transfer times (measured in hours for craft in the outer solar system), as well as with numerous interferences or interruptions due to the geometrical position of the celestial bodies.An automated system that will cope with the delays and disruptions is needed to maintain communications with the growing number of spacecraft and the increasing volume and sophistication of control and data exchanged with these devices.In the well-connected Internet messages are divided into packets and are, in general, routed through a chain of intermediate nodes ("routers") that can provide time-limited queuing of packets to adapt to variations in data rates and allow a combination of multiple incoming data streams onto a single outgoing stream.Routers do not provide any longterm storage and, if a queue becomes full because of peaks in the incoming data rates overloading the outgoing link, packets will simply be dropped.This would not be appropriate behaviour for nodes in DTN.
With DTN, it is very likely that when a node receives an incoming message, the outgoing link that ought to be used is not currently connected, although the node is aware that it will or might be expected to be available at some later time.A DTN node will therefore try to store the incoming message until the link becomes available and forward it when the link opens.Also DTN transmits complete information objects or messages combined with message "metadata" such as destination address and security details as a complete unit or "bundle" rather than splitting it into packets.These differences give DTN the capacity to operate despite interruptions and delays; however, it does not necessarily enable "instant" access to the data and services as does the conventional Internet.On the other hand, DTN will work equally well and at a similar speed to standard Internet protocols over the wellconnected Internet where there are no delays or disruptions.Where the network is not well-connected, DTN provides a solution to numerous problems, which cannot be solved using standard Internet mechanisms.
DTN transfer includes the source translating information into packages with their destination elsewhere in the DTN system.The packages are transferred via the network by data mules.These are any type of carriers which can accept computer data and submit them at another location.Tourists, tour guides, buses, trains, helicopters, or virtually anyone or anything can act as a carrier.The condition is that the data mule moves freely between potential data sources and data destinations, which are usually, but not necessarily, local static computers (nodes).In the case of the Postojna Cave, the data source is a computer located at the automatic meteorological cave station and the data destination is a surveillance computer at the cave's entrance.The data mule is a computer mounted on a tourist train.When possible, a data mule receives a bundle via a non-physical transfer (which is particularly important in a cave environment with relatively high humidity levels), e.g.via a WiFi ad hoc network and submitting it to other nodes along the way, where other data mules can pick it up, whereas one of the data mules will very likely sooner or later deliver the bundles to the destination "node".The logistics of bundle exchange between the data mules and the nodes are overseen by different routing algorithms adapted to various topologies.
The topology of the Postojna Cave is fairly simple.A data mule is mounted on a tourist train taking tourists 3.8 km from the cave entrance to the beginning of the tourist walking trail; during its journey the moving train passes the fixed meteorological station along the way without stopping.The mule and the station have to exchange data in a short time frame of mutual "visibility" inside the tunnel when a WiFi connection can be made from one to the other (for example see videos available on the following webpages: http://e-learning.si/lectures/Introduction-01/Introduction-01.html,http://e-learning.si/).The mule is afterwards taken together with the tourists to the beginning of the tourist trail and is returned back with the train in the opposite direction to the entrance, where the tourists are taken after the cave tour.This return trip provides a second short window of opportunity for the mule to communicate with the station.The completion of the bundle's journey, which will not be described in detail, occurs when the mule on a train reaches the cave's entrance and transfers the data to the surveillance computer at the entrance; conditions for this transfer are less demanding because the train comes to rest at the entrance.
Detailed requirements of the experiments are particularly linked to the fact that the transfer must take place with no physical contact, namely via WiFi ad hoc connection technology.A short window of interaction between the data mule and the station inside the passage takes approximately 10 s, and the train travels past the station with an approximate speed of 12 km h −1 .The measuring station is a standard cave micro-meteorological station (MicroStep-MIS, 2013) with additional interface for DTN transfer (static DTN node based on embedded router manufactured at MEIS).The requirement of fast and contactless transfer is the most important one.
This method of DTN transfer from the data source to the data mule, which was tested for feasibility with a successful experiment, opens up numerous possibilities for comparable or less demanding transfers under similar situations.The train is an extremely fast method of transporting the data mule, which is particularly suitable for on-going near-on-line transfer.The train frequency during the usual visiting hours, between 9 a.m. and 5 p.m., ranges between once and several times per hour, depending on the season.Instead of a train the transfer could be carried out by the tour guides via their smartphones, netbooks or tablets, who would only need to walk past the stations on their regular route without having to worry about the data transfer or any need for stopping at the stations.This situation is usually present in tourist caves, since mass tourism goes hand in hand with tour guides and the need for EWS functions.The DTN solution using guides as data mules would allow for the frequent retrieval of data, which supports both long-term research and the EWS function of the cave's automatic measuring system (however, if we decide to make periodical manual data readings, the system is not really viable for an EWS).
The majority of the experiment's description consists of the technical details which would allow the experiment to be replicated anywhere in the world.
We would like to point out that this experiment was carried out on 13 October 2011 in the presence of the authors of this article.The analysis of the data transfer performance verified that such a transfer protocol is suitable for conventional automatic monitoring technology, as well as technologies with an EWS function.

The history of DTN from Mars to the Postojna karst cave
The initial formulation for the architecture of a delaytolerant network (DTN) was formalized with the Internet draft "Delay-Tolerant Network Architecture: The Evolving Interplanetary Internet", which was published by Vinton G. Cerf and colleagues in 2002 (Cerf et al., 2002).As indicated by the document's title the origin of DTN is found in the area of space communications.In itself, it is notable that our communications have for some time reached beyond our home planet.Additionally, manual management of these communications becomes unwieldy as the number of contacts grows.(The manual management of space communications can be compared to when earlier telephone traffic relied on operators who manually created the connections.)As communication between planets and spacecraft gradually grew into a concern of practical consequence, interest rose for automated communications that would be able to handle the "delays" that occur as result of the distances and other "disturbances and disruptions" in space, as compared to end-to-end connectivity on Earth.DTN was the second step of defining applicable standards, namely as "a generalization of the architecture designed for the Interplanetary Internet" (Cerf et al., 2002).It was realized that the solution originally developed for space communications had relevance for many terrestrial scenarios as well.Ideas had emerged in different settings about how this network paradigm could be retrieved from the space communication area and made useful on Earth.It was noted by Cerf et al. (2002): "A class of challenged networks, . ..is becoming important and may not be well served by the current end-to-end TCP/IP model.These networks typically serve environments in which it is either impractical or impossible to configure a communication environment that supports the assumptions on which the TCP/IP suite depends."(Cerf et al., 2002).
A somewhat peculiar side effect of DTN's genesis is that the term "terrestrial" is regularly used in DTN circles, to define the type of use scenario targeted.While the assumption would in most circumstances be that communication on Earth is the normal case, and thus not as such necessary to define, it could, at least initially, be viewed as a a "special case" of the interplanetary scenario.One of the projects that supported the insight that the interplanetary-network technology can be of use on Earth was an initiative in the Arctic, northern Scandinavia.Cerf et al. (2002) describe the relations between the original DTN creators and this initiative, together with the details of the case pursued: "An individual seeking a networking solution for a particularly intriguing and challenging environment has recently approached us to determine if the DTN architecture was right for the following environment.The Sámi people in Lapland live in widely dispersed communities in remote areas and are not well served by either wired, fixed wireless, or satellite Internet service.They do, however, frequently travel on snowmobiles from community to community, and congregate at work sites and larger towns."(Cerf et al., 2002) The Sámi are an indigenous population in northern Scandinavia and northwest Russia.One of the main traditional Sámi livelihoods is reindeer husbandry.The background to the technically challenging situation is that the herders and their families regularly work, travel and live in wilderness areas.Still, they need to keep pace with society at large and be able to handle business, social and other contacts in a way that corresponds to what is expected from a Scandinavian citizen today (Udén, 2008).The reindeer husbandry scenario was gradually defined and in parallel it came to serve as a template for theoretical DTN research and development from 2002 (Lindgren et al., 2004), with practical orientation starting from 2004 when the Sámi Network Connectivity project was launched and tangible co-operation with the group of local Sámi that had inspired the idea started (Udén and Doria, 2007).The first real-life test was carried out in 2006, in the area traditionally used by this group for their summer camps, which is also a nature reserve known as the Padjelanta National Park.In this trial the data traffic was transported on foot, with researchers, students, locals and volunteers equally involved.The services deployed were e-mail and cached web, which the local Sámi and also a small number of tourists that were hiking in the national park had the opportunity to try out.A blog was also administered from the remote site (Lindgren et al., 2008;Udén, 2012).In 2008, the legacy of SNC was taken further in the project N4C funded by the European Union's Seventh Framework Programme.A European consortium supported by an international advisory board developed the DTN solutions further and validated their functionality in real-life field tests with sites in Sweden and Slovenia as primary locations (Davies, 2011;Näslund et al., 2010;Udén, 2012).The Swedish site was the same as in SNC, a mountainous wilderness area.During three consecutive summers, e-mail and web access were again provided, together with some new services including radio podcasts.This time, per arrangement with a local transportation company, helicopters were used as data mules that during the summer months regularly shuttle between the main tourist stations and Sámi summer camps.This enabled a quicker round trip and delivery of messages with the DTN system (Grasic and Lindgren, 2013).In Slovenia, focus was on expanding the reach of the automated meteorological and environmental surveillance systems by the use of DTN.In the Postojna Cave, one of Slovenia's major tourist attractions, a train takes tourists into the depths of this amazing natural scenery.The idea was conceived that this train could be used as a data mule and pick up micrometeorological data from surveillance sensors on its round trip in the cave.The viability was confirmed in a successful trial reported in this paper.

Automation of data retrieval using DTN
The efficient and timely retrieval of the collected data is a significant challenge for the medium to long-term collection of environmental data from situations such as extensive cave systems and underground mines.Installing cabling, especially for a temporary deployment, will generally be prohibitively expensive.Accordingly data retrieval will require either a local physical connection to the data monitoring controllers or a wireless access method.The physical situation in which the monitoring equipment has to be placed may be inconvenient for regular access and the local humidity is often high, so that having regularly exposed external connectors on the monitoring equipment is undesirable.Thus a form of wireless access to the data would seem to be desirable.
Unfortunately, underground tunnels provide very poor propagation conditions for radio signals especially at frequencies such as those used for IEEE 802.11 wireless local area networking (WLAN) or WiFi.Linking the monitoring equipment directly to the surface or cave entrance using WiFi would typically necessitate multiple relays, and these would require regular maintenance in addition to the actual monitoring equipment, assuming that the equipment has to be battery powered.Using alternative lower-frequency equipment that might propagate further has a number of other drawbacks, including requiring higher-power transmitters, lower data rates, requirement for transmitter licensing (WiFi operates in an open band that does not require a licence) and less readily available equipment.
The solution that we have adopted allows data to be transferred automatically from the static monitoring station to a mobile station during a brief encounter.Standard WiFi wireless technology is used giving a range of 10-20 m.The stations only need to be in contact for a few seconds and no operator intervention is required.

Protocol basics of DTN
The protocols used in today's global Internet, especially TCP, do not work well for connections with very long roundtrip times or where the connection is frequently disrupted.The concept of delay-and disruption-tolerant networking (known as DTN) was originally developed for communications between spacecraft and Earth stations.The distances in space mean that interplanetary probes may be many lightminutes or light-hours away (for example, the transmission time to the Voyager spacecraft is currently approximately 15 h): clearly networking is up against our current understanding of basic physics here.
Subsequently DTN has proven useful in a variety of terrestrial situations, either where there is no permanent communications infrastructure or where local mobile-to-mobile communication can be used to extend the capacity or improve the delivery time of the local infrastructure.
The Internet can be described as a "buffer and forward" network, where the buffering is very short term.DTN on the other hand is described as a "store, carry and forward" network.It can be considered as an extended form of machineto-machine e-mail system.
Unlike the IP network, information objects (i.e.messages or data chunks) are treated as single entities throughout a DTN network rather than being split up into a multiplicity of smallish packets.The message data are combined with various metadata, including addressing information and, optionally, integrity protection and encryption support constructing the fundamental unit used by DTN networks known as the bundle.
The DTN architecture that is used here has been developed cooperatively by the DTN research group (DTNRG, 2013) of the Internet Research Task Force (the research offshoot of the Internet Engineering Task Force, or IETF).The architecture championed by the DTNRG has been published as an RFC (request for comments) at the IETF under the code RFC4838 (Cerf et al., 2007) and the basic protocol used to communicate using bundles is specified as an experimental protocol, "The Bundle Protocol", in RFC5050 (Scott and Burleigh, 2007).
The equipment that supports DTN implements a "bundle protocol agent" (BPA).Applications wishing to send bundles present the bundle data and any relevant metadata, including the destination address, to the BPA which builds a bundle that can be forwarded when a suitable opportunity arises.All BPAs have the ability to store bundles for a significant period.The source will specify the lifetime for the bundle -BPAs are at liberty to discard bundles that have exceeded their lifespan.

Opportunistic networking
In the original space scenario for DTN, delays are guaranteed to be long and communication opportunities intermittent, but are deterministically scheduled in accordance with celestial mechanics and the availability of ground station time give or take weather disruptions and equipment failures.Data retrieval from underground caves and many other terrestrial DTN applications represent a different scenario known as "opportunistic networking".In this scenario some of the network nodes are expected to be mobile (so-called data mules) and all nodes are equipped with short-range communication facilities, typically wireless using WiFi or Bluetooth, but data can also be carried on USB keys (e.g. in the pockets of human data mules or sent by traditional letter post) in conjunction with a passive BPA that are plugged into static nodes and parasitize the node, communicating with the resident BPA (Vrbinc et al., 2010).In the course of time mobile nodes are expected to come into communication range with other nodes (either static or mobile) and a "contact opportunity" occurs allowing the nodes to exchange bundles during the encounter.
The BPAs on the nodes orchestrate the encounter, establishing a local connection typically using TCP when the communication is wireless and determining which bundles should be passed to the other party according to the destination address of the bundle and the availability of resources on the recipient node.
BPAs have a choice of routing mechanisms to determine whether a bundle should be passed to an encountered contact.In very simple cases routes can be statically configured when the nodes are installed or an "epidemic" strategy can be employed, where nodes pass over any bundles that the encountered node does not currently have (effective but wasteful of resources in a large system), but the preferred mechanism for opportunistic scenarios is the PRoPHET (Probabilistic Routing Protocol for Intermittently Connected Networks) routing protocol RFC6693 (Lindgren et al., 2012).This protocol uses the history of contact opportunities to build a table of "delivery predictabilities" for known nodes.During encounters the nodes exchange tables and use the information to update their view of the likelihood of a bundle for a specific destination being delivered by the node.The values of the delivery predictability in the encountering nodes are compared for each bundle destination, and the bundle is either retained or passed to the encountered node if the predictability indicates that the encountered node has a better chance of delivering the bundle.
After a small number of encounters it is expected that the destination node will be encountered and the bundle delivered.However, depending on the mobility pattern, delivery is not absolutely guaranteed before the lifetime of the bundle expires.RFC 5050 allows the sender of a bundle to set flag bits in the Bundle Processing Control word (see Sect. 4.2 of RFC 5050; Scott and Burleigh, 2007) to request acknowledgement that the bundle has been delivered to its destination.There are two options which either request the BPA to acknowledge that it has delivered the bundle to an application (bit 14) or request the application to send an acknowledgement when it receives the bundle (bit 6).In either case an administrative bundle is sent back to the source EID of the requesting bundle.Using these facilities allows the system to avoid loss of data by triggering a resend of the bundle if an acknowledgement is not received within a reasonable time, but note that this may be quite long depending on the expected delays in the system.
The PRoPHET routing protocol also spreads acknowledgements of bundle delivery epidemically through the net- work with the intention of suppressing unnecessary replication of the bundle once a copy has been delivered.In principle, these acknowledgments could be used to trigger retransmission, but this could entail a "layer violation" as the routing protocol information would not normally be passed up to applications.

Strategy of usage in the Postojna Cave
Environmental sensors are connected to several static data collection stations.These stations will be equipped with DTN BPA and WiFi communication equipment.One of them located near the railway is already equipped.This collection station is placed within the communication range of a mobile station that is carried on one of the trains used to convey visitors to the caves through the passages.The data collection station generates bundles at regular intervals containing the readings from the various sensors connected to the station.
Data can then be retrieved whenever the tourist train passes by the data collection stations.This allows frequent data retrieval, which is desirable if the data are needed for continuous on-line monitoring rather than just for later statistical analysis.Operation of the system will be totally automatic and no operator intervention will be required to trigger data retrieval.

DTN in karst cave experiment details
In this chapter technical details of the successful DTN experiment in Postojna Cave will be presented.The details will reveal the story of the DTN data mule attached to the train with tourists passing by the automatic meteorological station, exchanging data with this station's computer in "drive-by" mode and later on delivering the data to the cave entrance where the train has a station (see Fig. 2).The key information of the experiment is how to establish a successful DTN data exchange in drive-by mode using open-source DTN implementation PLUTI (Luleå University of Technology, 2013), COTS (commercial off-the-shelf) computers, WiFi in ad hoc mode, and no physical contact, in the very limited space and time of the possible communication.DTN data flow is presented in Fig. 3.

Description of the drive-by test
The drive-by test was performed in the Postojna Cave near the entrance to the cave where the train full of tourists passes the stationary cave meteorological station.The situation and location of the equipment used in the drive-by test are illustrated in Fig. 4. A static DTN node (cave meteorological station) was installed near the entrance to the cave close to the railway (Fig. 5).A mobile DTN node on the moving train in the cave was installed as presented in Fig. 6.The drive-by test was repeated twice using approximately the same full speed of the train, 12 km h −1 , a DTN node based on an Atom embedded computer as the train passed the cave meteorological station in two different directions: -1st repetition: on the way into the cave, -2nd repetition: on the way out of the cave.
For all repetitions an epidemic routing algorithm was used to force the exchange of data bundles between nodes.Epidemic means that at each encounter of two nodes both nodes exchange all the bundles they have on board that the other node does not have.
In each repetition the time of connection between DTN nodes and the number (and size) of successfully exchanged bundles was determined from the analysis of the log files generated by the DTN service and the operating system.The results are presented in the following chapter.
For the DTN service an instance of LTU's DTN implementation named PLUTI (Luleå University of Technology, 2013) was used because it is easily transferable between dif- ferent operating systems, it is easily configured and it is optimized for TCP/IP convergence layer communications and slow storage device computers.

Static DTN node
The static DTN node is based on a Gateworks Cambria router board.It is a highly durable low-power embedded computer for extreme environmental temperatures based on an ARM Xscale processor and operated by an OpenWRT (OpenWrt, 2013) operating system that supports a variety of router boards.The main features of the Gateworks Cambria (In-tel®XScale®IXP435 667MHz Processor, 128Mb DRAM) are -Power consumption: ca.6 W; input voltage range: 8 to 48 VDC; PoE, -two v2.0 host USB ports (used for the RS232 to USB device, WiFi stick), -operating system: Linux-based firmware for embedded devices (OpenWrt or other similar or based on Open-Wrt, like DD-WRT, X-Wrt . ..).
The static DTN node is made in the form of a meteorological cave station (Božnar et al., 2012b;Grašič et al., 2011a).It comprises a meteorological station with sensors, an embedded computer (router board) and a power management system.For test purposes the automatic meteorological station AMS-111 produced by MicroStep-MIS (MicroStep-MIS, 2013) was used.Power management is described in a paper by Grašič et al. (2011b).From the static DTN node, every hour one bundle is generated to be sent to a Gateway node located in the MEIS offices.This bundle contains measured 1 h meteorological data: air temperatures at different levels, rock temperatures, relative humidity, light detection, CO 2 concentration, wind speed and wind direction.It is expected that a cave train will be passing the station at least once a day; therefore during the connection with the station node at least 24 bundles must be transferred to the mobile node on the train.
For the test, 200 bundles with measured data were generated, stored in bundle storage and waiting for the connection with the mobile node.

Mobile DTN node
For the mobile DTN node an Intel Atom embedded computer was used.It was selected according to the results of previous drive-by tests performed at MEIS's offices.The results of previous drive-by tests show that for a mobile DTN node a computer that has a fast storage device and a reliable WiFi network adapter supporting a ad hoc mode should be used.Gateworks Cambria has a good WiFi network adapter but a slow storage device, while standard notebooks have fast storage devices but very poor support of the ad hoc mode within the WiFi network adapter.Finally, it was decided to use a radiological DTN node (Grašič et al., 2010(Grašič et al., , 2011a;;Vrbinc et al., 2010) where an Intel Atom embedded computer (standard HDD for a fast storage device) and a good ad hoc support WiFi network adapter (Atheros 6th generation of WiFi card) was used.A picture of the uGaRaMo node as we named the unit is presented in Fig. 7.The Atheros WiFi card was installed to fulfil the above-stated requirements specifically for the purpose of the drive-by test.measuring gamma dose rate for other purposes; its basic task in the experiment is to act as the 6 mobile DTN "data mule" node for carrying data from cave to entrance).7 Fig. 7. Mobile DTN node based on Intel Atom embedded computer mounted in a simple case with radiological probe and simple LCD display presenting the current date and time, number of connections, number of bundles and last measured radioactivity (the node is measuring gamma dose rate for other purposes; its basic task in the experiment is to act as the mobile DTN "data mule" node for carrying data from cave to entrance).

Results of drive-by test
The results of the drive-by test were made according to the analysis of the log files captured during the test repetitions.For connecting the DTN services and the number of exchanged data bundles, DTN services log files were used.
In the following subsections for each repetition of the test several important timeline indicators are presented (this represents crucial steps in the DTN data exchange procedure on encounters with the static and mobile nodes): -start of connection, -start of HELLO, -end of HELLO, -first data bundle sent or received, -last data bundle sent or received, -end of connection.All these indicators were determined from the DTN service log files.

1st repetition: train direction into the cave
The initiator of the connection was the static node (see Figs. 8  and 9).At the beginning, the quality of the connection was very poor, which resulted in two unsuccessful connections before the third good connection was finally made after approximately 10 s.The delay before the HELLO procedure  started on the mobile node was relatively short.After this delay the HELLO procedure took approximately 0.650 s on both nodes, which indicates a very good quality of connection.Sending data packets from a static node took about 7.0 s and receiving at mobile node took about 7.8 s.During this data packet exchange, 371 data bundles (285Kbytes in size) of the 393 requested were exchanged (22 data packets remained undelivered), which also indicated that the quality of connection was good.There was also 1 bundle successfully received by static node (AMS) originating from mobile node (train).
From these results we estimated that the duration of a good-quality connection was approximately 10 s, which gives approximately 33 m of length where the connection is satisfactory at a train speed of 12 km h −1 (see Fig. 10).
The timescale in all figures was selected at 30 s according the expected duration of the connection which was determined from laboratory testing.

2nd repetition: train direction out of the cave
The initiator of the connection was again the static node (see Figs. 11 and 12).It took 7 s and 3 unsuccessful connection attempts by the static node to connect to the train mule mobile node.At the beginning the quality of the connection was much better than in the 1st repetition which resulted in 0.5 s of delay before the HELLO procedure started on the mobile node.After this the HELLO procedure took approximately 0.754 s on both nodes, which indicates a very good quality of connection.Sending data packets from the static node took about 5.0 s and receiving at mobile node took about 7.5 s.During this data packet exchange, 24 data bundles (2.426 mbytes in size) of the 24 requested were exchanged (22 data packets that remained undelivered from the 1st repetition and 2 new data packets), which also indicates that the quality of the connection was good.There was also 1 bundle successfully received by static node (AMS) originating from mobile node (train).
We estimate that the duration of the good-quality connection was approximately 14 s, which gives approximately 47 m of total length, where the connection is satisfactory at a train speed of 12 km h −1 (see Fig. 13).

Experiment discussion and proposals
Using a node based on an Intel Atom embedded computer and an advanced WiFi network adapter supporting the ad hoc mode as a mobile DTN node proved to be a good solution for -For drive-by connections the bundles should be fragmented into smaller fragments that can be reliably transferred during each connection that has a limited duration and a limited size of data transfer.In our test, bundles larger than 2.5 mbytes could not be exchanged through this kind of connection.For reliability, fragments of an approximate maximum size of 1 mbyte are suggested.
-During the first repetition, almost half of the available time (about 10 s) for the connection was spent on discovery because the LTU's DTN implementation PLUTI has a deterministic discovery algorithm where the nodes compete for establishing the connection.Because of the relatively low quality of the WiFi connection at the beginning, too much time was spent on this process.It has been suggested that the discovery algorithm be upgraded to be deterministic where it is determined which node must create a connection before the nodes see each other.The proposed deterministic discovery algorithm is described in the next paragraph.
-To make the most of the TCP/IP stack implementation that differs slightly on different operating systems, two TCP/IP connections during each DTN connection are recommended to be made; each TCP/IP connection should be controlled by a separate thread where only one is used for data transmission and the other only for data reception.During the improvements of the LTU's DTN implementation PLUTI, it was determined by the authors of the programme that data cannot be received and transmitted by two threads at the same time over one TCP/IP connection.
-Routing of data should be made configurable in the DTN implementation for a special kind of node such as a static meteorological node where the bundles should only be transmitted from the node, while no data bundles should be received in order to make the most of the short drive-by connections.
Proposed deterministic discovery algorithm: -When a node is broadcasting its presence using UDP packets, the content of the UDP packets should contain the following: the port where the connection is available, the IP address where the connection is available (optional, if not defined the connection should be made to address where the UDP packet came from), the broadcasting period (in milliseconds), and the EID (end ID of the node, i.e. train.cave.si).
-If the received broadcasting period from a discovered node is higher (the discovered node broadcasts its presence more often) than our broadcasting period, then we will make a connection to the discovered node.If the connection cannot be made during the time of its five periods (receiving its five UDP packets), we wait for five of its periods (receiving its five UDP packets) to make a connection to our node.If this fails we will wait an additional five periods and then repeat the whole process (5:us-5:him-5:wait).
-If the received broadcasting period from the discovered node is lower than our broadcasting period, then we will wait for the discovered node to make a connection to us.If the connection is not made during the time of our five periods (broadcasting of our five UDP packets), then we will try to make a connection to it in the time of five of our periods.If this fails we will wait an additional five of our periods and then repeat the whole process (5:him-5:us-5:wait).
-If the received broadcasting period is the same as the period of the discovered node, then from its and our EID a MD5 key is generated.The connection is started by the node that has a higher MD5 key.7 Future improvements for the overall solution in the Postojna Cave Data retrieval can also be carried out by nodes carried by an individual.This may be relevant for monitoring stations in more remote parts of a cave system.As with the traincarried nodes, no operator intervention would be required so that any person present in the area could retrieve the data rather than requiring specially trained operatives or the actual experimenters.
For autonomous equipment that is expected to operate without a mains power supply, battery lifetime is an important factor.Automated data retrieval is not so advantageous if it is necessary to replace batteries frequently.A key improvement for the system would be a very low power wakeup receiver that allows the transmitter part of the data collection stations to go into a very low power sleep mode until awakened by a passing mobile node or periodically to carry out data collection.Maintaining a permanent alert status for WiFi beacon transmissions is more power consuming than is really desirable.Using a schedule of the mobile nodes (trains or tour guides) passing by the station as a wake-up event is not an option in our case because schedules are not rigid enough.Schedules are on a daily basis adapted to the cur-rent number of tourists, which depends on the season of the year, weather and other similar factors.There are also several different trains driving on the same railway not all equipped with mobile nodes, so it is not possible to plan a certain time at which a particular mobile node on a train will pass the station.And in addition we have also used this train-based use case as an example of the more general problem of data transfer at arbitrary time drive-by encounters of static node and data mule.
To enhance the measuring system information content further studies of cave microclimatology and air pollution conditions are planned.They will include enhancement of local air quality forecast based on numerical weather prediction techniques for fine resolution as well as artificial-neuralnetwork-based techniques (Mlakar and Božnar, 2011;Petelin et al., 2013).

Conclusions
We have presented the framework and details from the world's first successful experiment of DTN communication technology employment for the transfer of automatically measured data from deep within a karst cave to the surface.The experiment is particularly valuable due to the proven successful performance of the drive-by mode of transfer.The data mule for data transfer was mounted on the train taking tourists from the entrance of the cave to the start of the scenic walk, driving past the conventional automatic cave meteorological station without stopping by the station.The transfer was rapid and complex in terms of time and was carried out with contactless ad hoc WiFi technology.The implementation confirmed its effectiveness in an extremely demanding time frame.As a result, we envisage potentially broad application using less specialized devices as the the data mules; it is highly likely that smartphones or tablets could be used instead of our larger equipment and they would be carried by the tour guides when walking past the stations -the data source -and would not have to stop specifically by the station.This can ensure the efficient and regular batch transfer of data without imposing additional work on the tour guides or other staff.

Fig. 2 .
Fig. 2. Overview of the drive-by data collection test in Postojna cave.

Fig. 4 .
Fig. 4. Indication of WiFi coverage area of the monitoring station during the drive-by test in Postojna Cave (red dot is cave monitoring station; yellow circle (45m radius) shows area where a WiFi connection to the station could be made as measured using notebook computer, with static measurements along the main path of the tourist railway, which slows down at this point).

Fig. 5 .
Fig. 5. Picture of static DTN node mounted by the railway in the cave where the train passes the cave meteorological station several times each day.

Figure 6 .Fig. 6 .
Figure 6.View of mobile DTN node mounted on a train 3 Fig. 6.View of mobile DTN node mounted on a train.
Figure 7. Mobile DTN node based on Intel Atom embedded computer mounted in a simple 3 case with radiological probe and simple LCD display presenting the current date and time, 4 number of connections, number of bundles and last measured radioactivity (the node is 5

Fig. 8 .
Fig. 8. Timeline of events on the mobile node (horizontal timescale in seconds after the start of connection).

Fig. 9 .
Fig. 9. Timeline of events on the static node (initiator of connection, horizontal timescale in seconds after the start of connection).

Fig. 10 .
Fig. 10.Estimated radius of good-quality connection for first repetition along the main path of the railway.

Fig. 11 .
Fig. 11.Timeline of events on the mobile node (horizontal timescale in seconds after the start of connection).

Fig. 12 .
Fig. 12. Timeline of events on the static node (initiator of connection, timescale in horizontal in seconds after the start of connection).

Fig. 13 .
Fig. 13.Estimated radius of good-quality connection for second repetition along the main path of the railway.
in the PLUTI (name of DTN software implementation) communication component (Luleå University of Technology, 2013) originally developed at Luleå University of Technology (LTU) in the scope of the SNC (Sámi Network Connectivity) project overseen by Folly Consulting Ltd and extended during N4C.The entire project was carried out within the scope of a research project offer implementing the Postojna Cave's automatic measuring infrastructure led by the Karst Research Institute.