Entropy, complexity, and spatial information Abstract We pose the central problem of defining a measure of complexity, specifically for spatial systems in general, city systems in particular. The measures we adopt are based on Shannon's (in Bell Syst Tech J 27:379-423, 623-656, 1948) definition of information. We introduce this measure and argue that increasing information is equivalent to increasing complexity, and we show that for spatial distributions, this involves a trade-off between the density of the distribution and the number of events that characterize it; as cities get bigger and are characterized by more events-more places or locations, information increases, all other things being equal. But sometimes the distribution changes at a faster rate than the number of events and thus information can decrease even if a city grows. We develop these ideas using various information measures. We first demonstrate their applicability to various distributions of population in London over the last 100 years, then to a wider region of London which is divided into bands of zones at increasing distances from the core, and finally to the evolution of the street system that characterizes the built-up area of London from 1786 to the present day. We conclude by arguing that we need to relate these measures to other measures of Complexity by its very nature is an impossible term to define. Anderson (1972) , whose seminal paper 'More is Different' written 40 years ago, poses this dilemma in the very title of his paper. Complex systems defy definition in that they are intrinsically unpredictable and depend on innovations that occur in the future and cannot be forecast. Any definition of complexity should take into account its fundamentally anthropomorphic nature. When we seek to describe a system, we implicitly define an object-the system, and a subject-the observer or modeller. The object or rather its representation is analysed into parts whose interactions are to be studied and modelled. The definition of object and model is a matter of choice, and thus, its complexity is dependent on this choice and the state of knowledge associated with the observer (Badii and Politi 1997). More recently, Anderson (2011) has followed his earlier speculation saying that complexity ''… is the search for general concepts, principles and methods for dealing with systems which are so large and intricate that they show autonomous behaviour which is not just reducible to the properties of the parts of which they are made' ' (pp. 364-365) .. There is a sense in all of this that as systems change, they vary in their complexity and that as cities grow for example and their populations get richer, they get 'more complex'. This poses the question as to whether it is possible to present a measure of complexity sufficiently general to pick up change in scale and size and of course diversity (which is a key idea in complexity) that unequivocally show how cities change in these terms. We would expect, for example, that as cities get larger, they get more complex although this is by no means certain. There are examples in history of empires that have grown while their cities have collapsed and their complexity has probably fallen. Indeed, when populations have fallen through dispersion from the core, or where epidemics have led to such reductions, complexity has probably decreased and thus we need a measure that depends not only on numbers, scale and size, but also on the way that their populations are distributed spatially.. In this paper, we will begin with the simplest and most general of measures, arguing that the generic formula for information due to Shannon (1948) is a good starting point. Shannon's measure links fundamentally to the relations between complexity, Ashby's variety, entropy, and cybernetics which has been cogently argued by Casti (1996) and more recently set in its historical context by Gershenson et al. (2013) . The concept of entropy is also familiar in spatial analysis from the development of entropy-maximizing spatial interaction models (Wilson 1970) although our treatment of these origins is peripheral to the argument here. As the number of events increases, information increases according to this formula, but at the same time the distribution of events-the way they are ordered-also affects the measure. When something is entirely ordered, hence completely predictable, it is no longer complex, and we would expect the measure to be low relative to a situation of extreme unpredictability. However, we can also argue that something that is entirely ordered has great complexity in that to simply hold this order together in far-from-equilibrium systems, considerable intricacy in structure and relations is required. This is in contrast to a situation where events are completely unpredictable, hence in one sense quite disordered and possibly of low complexity in that random forces dominate.. This dilemma of interpretation is central to our argument for it suggests that there are many kinds of complexity dependent upon the perspective one is taking. Here, highly ordered events with great predictability are regarded as much less complex than those where we are unable to predict their order, and it is in this sense that we say these sets of disordered events are more complex. The Shannon information measure relates to semantic information through the variables used to define its underlying probability distribution; in this case, the variables are area and population and this defines the analytic perspective that is at a higher level of abstraction than the application of semantic information to urban artefacts as described by Haken and Portugali (2003) . The measure, in its statistical mechanical context as argued by Jaynes (1965) , is anthropomorphic in the sense discussed above.. We will see that the measures we propose meet these criteria, but our analysis is elementary at this stage. It might be argued that population and size in terms of the way populations are defined are far from the kinds of complexity that the complexity sciences are currently focused upon. Nevertheless, we see this as a starting point, picking up on a long tradition of measuring and using information in spatial analysis while at the same time, providing new directions with respect to how complex systems such as cities are evolving. In this sense, our focus is on the dynamics of cities because dynamics raises the question of increasing (or decreasing) complexity (Batty 2010) . In essence, although Shannon's measure of information pertains in general to closed systems, we admit increasing complexity into our system by handling growth through additional numbers of events (locations), thus letting the measure vary with respect to size and scale as well as the intrinsic distribution of the events. In conventional applications, the number of events is regarded as fixed but here we will relax these for as cities grow, the number of locations that define them increases. In a time when the world's population will be largely living in cities by the end of this century, our concern for this kind of measurement would appear appropriate.. We will first present standard information measures, defining information for the one-dimensional case, a city strung out on a line for example or a series of events whose spatial relations and interactions are one dimensional. We then examine relative information, introducing the concept of partitioning information or entropy into two key components-a spatial entropy that largely deals with the distribution of information (Batty 1974; Esmer 2011) and an information density that deals with size. These measures illustrate how the various components of distribution, numbers of events and their density trade-off against one another as the system changes in size and scale. In this sense, we are able to show that cities can grow in size but change in the distribution of their populations, leading to either an increase or a decrease in their complexity. We will then explore these notions for population change in Greater London using several different data based on different measures of population and area at different temporal cross-sections.. First, we will look at population change in the 33 London boroughs over the last 100 years from 1901 to 2001. The area units-the boroughs-do not change in size or shape (because we have normalised the areas to current 2001 boundaries), and thus, the analysis focuses on defining information that reflects changes in population density, not the number of areal units. Then, for the same data, we will explore the pattern at single cross-section in 2001 with respect to how information changes as we keep the population fixed while varying the number of zones from 2 to 33. In this way, we examine how complexity changes with the number of events, searching for points at which the complexity of the metropolis falls even when the number of zones increases. Our example makes the point, but as this is somewhat unrealistic, we then move to examine a much larger region centred on London based on 1,767 zones which comprises the entire metropolitan area at 2001. We change the numbers of zones which we arrange in 11 zonal bands at different distances from the centre, and with this wide range of variation in population density and numbers of zones, we search for distinct changes in complexity in spatial terms. To evaluate the trade-off between population density and numbers of zones, we then use a very different data set which measures the number of street intersections on a regular grid, where the data are equivalent to street density. These data are available for nine time periods from 1786 until 2010. As the number of zones increases through time, we use a threshold to determine densities of significance which increase through time as the city grows and consolidates its form. In this last example, we can see the trade-off between the density and the number of events. We then conclude with suggestions as to how this kind of analysis might be taken forward for interactions between locations, moving these ideas from the one-dimensional to the two-dimensional realm which will constitute the basis of future work.

B O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O B O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O B O B O O O O O B O O O O O O O B O O O O O O B B O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O


Looking back at dense linear algebra software Over the years, computational physics and chemistry served as an ongoing source of problems that demanded the ever increasing performance from hardware as well as the software that ran on top of it. Most of these problems could be translated into solutions for systems of linear equations: the very topic of numerical linear algebra. Seemingly then, a set of efficient linear solvers could be solving important scientific problems for years to come. We argue that dramatic changes in hardware designs precipitated by the shifting nature of the marketplace of computer hardware had a continuous effect on the software for numerical linear algebra. The extraction of high percentages of peak performance continues to require adaptation of software. If the past history of this adaptive nature of linear algebra software is any guide then the future theme will feature changes as well -changes aimed at harnessing the incredible advances of the evolving hardware infrastructure. Over the decades, dense linear algebra has been an indispensable component of science and engineering. While the mathematical foundations and application methodology has changed little, the hardware has undergone a tumultuous transition. The latter precipitated a number of paradigm shifts in the way the linear algebra software is implemented. Indeed, the ever evolving hardware would quickly render old code inadequate in terms of performance. The external interfaces to the numerical software routines have undergone only minor adjustment which is in line with the unchanged mathematical formulation of the problem of solving a system of linear equations. The internal implementation of these interfaces was changing to accommodate drastic redesign of the underlying hardware technology. The internals have been modularized to ease the implementation process. These modules over time have become the building blocks of new generations of the numerical linear algebra libraries and made the effort more manageable in the long run. Over time, the number and functionality of these building blocks have increased but the delegation of responsibilities between various modules inside the software stack has been retained. The most recent increase in hardware parallelism further altered the established composition process of the modules by necessitating the use of explicit scheduling mechanism which needed to be handled manually in the composing code or externally with a software scheduler. The rapid transformation of computer hardware has not been ongoing and is expected to be continuing into the future. With it, the software will evolve further and our hope is that the design decision made in the past will allow for a smooth transition by reusing the tested and optimized libraries we have become accustomed to.

O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O


Biological Networks: Comparison, Conservation, and Evolution via Relative Description Length We describe a new approach for comparing cellular-biological networks and finding conserved regions in two or more such networks. Our distance measure is based on the description length of one network, given the description of the other one, and it is efficiently computable. We employ these distances as inputs for generating phylogenetic trees. Using KEGG's metabolic networks as our starting point, we obtained trees that are not perfect, but are very good (considering the characteristics of the inputs). Our approach enables us to identify conserved regions among more than a dozen metabolic networks, and among two protein interaction networks. These conserved regions appear to be biologically relevant, proving the viability of our approach. We presented a novel method for comparing cellular-biological networks and finding conserved regions in two or more such networks. We implemented our method, and produced a number of interesting biological results. It is clear that the information contained in networks is different from sequence information. This work opens up a number of algorithmic and biological questions.. The procedure we described here is biologically reasonable, and indeed gave meaningful results. Still, we believe that certain modifications of our procedure may improve speed or accuracy. We also believe that the best variant of the procedure, and the exact parameters used for finding conserved regions, may depend on the input type. For example, in the case of metabolic networks, we discovered empirically that by skipping stage .3/ in the procedure Describe.G 1 given G 2 ), the accuracy decreases by a few percentage points, while the time complexity becomes close to linear. Such shortcut may be suitable for larger inputs.. The experimental work here concentrated mainly on metabolic networks, taken from the KEGG database. Of course, there is no reason to consider only KEGG, and only metabolic networks. We plan to examine our methods on additional protein interaction networks, regulatory networks, and possibly a mixture thereof.. Our representation of the networks followed that of Jeong et al. (2000) and ignored the edge labels (enzyme names in metabolic networks). However, in the case of the conserved metabolic subgraphs we described in this work, the edges were also conserved (namely, the edges usually were identical in all the conserved graphs). Yet, it is desirable to include edge labels explicitly. Indeed, the RDL approach allows such modification at relative ease. A more meaningful extension is to consider labels not just as equal or unequal. A continuous scale of similarity, as implied for example from the chemical description of substrates, can be used. Different representations of the directed graph (e.g., children instead of parents) are also possible. Other algorithms, based on variants of labeled subgraph isomorphism, can be considered as well. However, their efficiency should be carefully analyzed.. When dealing with database of biological networks, we should always keep in mind that they are still in their infancy. They are noisy, due to experimental conditions, and they are partial, due to budgetary limitations and biases of the researchers. Thus the precision of the results is likely to evolve and improve, as more reliable data is gathered.

B I O O O O O B I I O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O B I O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O


Stimulation-induced ectopicity and propagation windows in model damaged axons Neural tissue injuries render voltage-gated Na + channels (Nav) leaky, thereby altering excitability, disrupting propagation and causing neuropathic pain related ectopic activity. In both recombinant systems and native excitable membranes, membrane damage causes the kineticallycoupled activation and inactivation processes of Nav channels to undergo hyperpolarizing shifts. This damage-intensity dependent change, called coupled left-shift (CLS), yields a persistent or "subthreshold" Nav window conductance. Nodes of Ranvier simulations involving various degrees of mild CLS showed that, as the system's channel/pump fluxes attempt to re-establish ion homeostasis, the CLS elicits hyperexcitability, subthreshold oscillations and neuropathic type action potential (AP) bursts. CLS-induced intermittent propagation failure was studied in simulations of stimulated axons, but pump contributions were ignored, leaving open an important question: does mild-injury (small CLS values, pumps functioning well) render propagation-competent but still quiescent axons vulnerable to further impairments as the system attempts to cope with its normal excitatory inputs? We probe this incipient Nerve damage and its connection to neuropathic pain and its complications are under intense scrutiny. A model of incipient mild nerve injury provides fertile ground to study a host of pain-related phenomena, including allodynia-like amplification of normally benign stimuli. Here, we have studied the interaction of a stimulated node and a one-or three-node damaged zone in a mildly damaged axon.. Damage was modeled as an irreversible coupled leftshift (CLS) of activation and inactivation processes in the Nav channels, a form of Nav-leak that a growing body of evidence links to mechanical or chemical injuries in various types of excitable cells (Sun et al. 2006; Wang et al. 2009; Park et al. 2012 ; see also Susuki 2013) . Depending on the magnitude of LS, two behaviors were observed: either the unstimulated system settled to a fixed point or its damaged node immediately exhibited periodic ectopic firing. There were no situations where it started firing ectopically only after a delay.. These two dynamical behaviors underlie our two main findings observed in the presence of pulsatile (AP-like) stimulation. Firstly, we showed that a mildly damaged node of Ranvier, below the range of LS values that lead to ectopic firing in the absence of stimulation, can switch behavior and become an ectopic site once the K + concentration gradient is sufficiently depleted (Fig. 1) . This resembles an afterdischarge (Coggan et al. 2011 ) but occurs before the end of the stimulus. This result provides a mechanism by which a small stimulus (normally causing 6 APs in the case illustrated on Fig. 1a) triggers ectopicity and causes the axon to fire dozens of APs. The postsynaptic neuron would respond as if the stimulus was much greater than it is in reality. If such a phenomenon occurs in a sensory neuron, it could be responsible for painful amplification of normally benign stimuli, typical of clinically observed conditions like allodynia or hyperalgesia (Costigan et al. 2009 ).. This result is consistent with observations showing that changes in gene expression are insufficient to cause neuropathic pain, that abberrant Nav activity alone can lead to allodynia, and that blocking Nav channels in animal models is neuroprotective and delays the onset of neuropathic pain (Shankarappa et al. 2012) . Our model predicts that the onset of ectopicity can occur not long after the damage, and still occur as long as the neuron lives. Therefore, it can be compared with observations done both before and after central sensitization takes place. In the latter case, it could explain why some patients' tactile allodynia needs to be set off by scratching or some other stimuli (Ross 2011) .. We point out that Fig. S2 shows that the onset of ectopic behaviour can be linked to a change in E K alone. Various mechanisms that were left out of our model, such as diffusion or glial K + buffering, are expected to change the rate at which E K is diminished upon stimulation, but not the fact that ectopicity is eventually triggered.. Extending the damage to three adjacent nodes shifts the onset of ectopicity towards lower LS values (see Fig. S3 , an extension of Fig. 1b , in Online Resource 2). It has no other noticeable effect on the phenomenon reported here, which should therefore be expected in experiments despite the method used to damage the axon and the physical extent of the trauma produced (as long as it remains mild enough). We should also note that, according to Fig. 1b , a large decline of E K should trigger ectopicity even in an intact axon, as V rest depolarizes towards threshold (see also Müller and Somjen 2000; Hao et al. 2013 ). This occurs sooner in damaged nodes because threshold is hyperpolarized by the CLS-induced window conductance shift. Thus, even though we are dealing with a "sodium leak", E K plays a fundamental role in the excitability dysfunction.. Our second finding concerns the possibility of spike train propagation despite the presence of an ectopic site: while the ectopic node of Ranvier sends APs in both directions in a non-stimulated axon, high frequency stimulation (i.e., higher than the ectopic rate) can enslave the ectopic site by causing it to become phase locked to the incoming signal, a phenomenon similar to behaviors seen in damaged sciatic nerve (Lisney and Devor 1987) . Once the short transient period necessary to overcome retropropagating APs passes, the incoming spike train is transmitted with minimal alteration. Note that this occurs in the same way regardless of whether the ectopicity was spontaneous or triggered by stimulation. Interestingly, these results imply that neurons that typically fire at high frequency should be less affected by CLS-type damage. Additionally, this faithful high frequency propagation could mask unhealthy dynamics, emphasising the need to test the frequency dependence of excitability in neurodiagnostic techniques such as threshold tracking (Vucic and Kiernan 2006) .. It is important to note that our model as constructed (notably with r=20 cm 2 /μL) will see its gradients depleted when firing occurs over an extended period of time, whether in the healthy (Fig. S1d in Online Resource 2) or damaged state ( Fig. S9b in Online Resource 2): as Fig. 1b shows for LS=0, the healthy system becomes ectopic if f stim ≥20 Hz, revealing sufficient E K depletion, but keeps firing continuously with steady state reversal potentials if f stim ≤13.3 Hz. Our results indicate that the propagation window will eventually disappear because of the depletion of the gradients (this was done here in an exaggerated manner by neglecting homeostatic mechanisms regulating external K + concentration and by choosing a large ratio r, as explained in Online Resource 2). Nevertheless a stream of temporally segregated stimuli such as bursts generated at the soma would have a higher likelihood of propagation due the recovery of the gradients during the pauses. One wonders whether there may be a link between these depletion recovery dynamics and the "shooting pain"-type perception of neuropathic stimuli coming in waves (eg. Baron et al. 2010) .. This "frequency window" of reliable propagation, where ectopicity is overridden, is a robust phenomenon that should be expected in experiments. Indeed, it still occurs when there are a few consecutive ectopic nodes (Fig. 4b) , it resists high levels of jitter in the incoming train ( Fig. 6a ) and it is even fortified by mild levels of noise in the channel currents (Fig. 6b ) through a stochastic resonance effect. In the presence of sustained high frequency input, the 1:1 phase locking of the ectopic site can only be lost if E K becomes strongly diminished ( Fig. S9 in Online Resource 2). This robust prediction can also lead to a reinterpretation of clinical observations that might have been overlooked. One might conjecture that some behaviors (eg. frenetic scratching or other intense stimulus) practiced by people with tactile allodynia elicit high frequency firing in affected neurons; this firing phase locks 1:1 and produces an expected, and thus normal-feeling, sensation.. We should finally stress that our results are expected to be generally applicable to all neurons. All frequencies and results covered in this article are "scalable" if the model parameters are adjusted. In other words, onset of ectopicity or a propagation window should both be expected in all axons whatever their maximum frequencies are. Ectopic activity can be triggered by stimulation Consider an axon, unstimulated at first, including a single mildly damaged node 6 (0<LS<3.5 mV), all simulations beginning with E Na , E K , V, m, h and n at their LS=0 rest state. For this LS range, no ectopic activity occurs, the CLS-induced Nav channels leaks being small enough that pumps are able to keep up and the system simply settles to a new rest state (slightly depolarized compared to the healthy axon's). However, stimulation can trigger ectopic behavior, as seen in Fig. 1a for LS=3 mV: apart from a small increase in speed through node 6, the six first APs propagate normally. If stimulation stopped after the fifth AP, the system would return to quiescence, but the sixth AP triggers ectopic behavior (asterisks, Fig. 1a ). After this onset, retropropagated APs initiated in node 6 collide with "normal" incoming APs and cancel them. This can be seen on Fig. 1a by following the AP generated by the last stimulus, at t=570 ms : it dies at node 3, along with a retropropagated AP initiated at node 6. This behaviour results in complex wave fronts in the first half of the axon and complete domination of the damaged node over the second half. When stimulation ends, ectopic activity persists until dozens of APs have fired and gradient rundown renders the system unexcitable (t≈2000 ms). Na/K pumps then slowly bring it back to its initial quiescent state. This triggered ectopicity is a novel phenomenon, as ectopicity was previously thought to appear immediately when an axon is damaged (Roza et al. 2003) .. This onset of ectopicity can be understood from the fact that, at a sufficiently high propagation frequency, APs deplete ionic gradients faster than Na/K pumps can restore them, so all nodes run down at similar rates (see E Na and E K on Fig. S1 in Online Resource 2). Further, with a diminished initial E K ( Fig. S2 in Online Resource 2), the system shows periodic ectopic firing with no stimulation (Yu et al. 2012) . (This is not surprising since removing the K + currents in a membrane at rest leaves the Na + currents out of balance; see also Figs S2 and S3 in Online Resource 2.). For an intact postsynaptic neuron, the consequence of stimulation-triggered ectopicity in the pre-synaptic neuron would be the arrival of≈90 additional APs, beyond the 6 delivered by an intact pre-synaptic neuron in the illustrated case. This induced ectopic behavior could thus "amplify" a stimulus; occuring in an algoneuron, the brain could interpret a minor stimulus as pain (Fried et al. 2011) .. The onset of ectopic activity due to normal AP traffic would take a long time for mildly damaged axons, because the ectopicity-triggering number of spikes (only six in Fig. 1a ) would then be high. Fig. 1b shows this number as a function of LS for a few stimulation frequencies. The same occurs when three consecutive nodes (5-7) are damaged; the graph is then qualitatively identical to Fig. 1b , apart from a small horizontal compression towards smaller LS values ( Fig. S3 in Online Resource 2). Ectopicity was detected when the total number of APs reaching node 10 at all t>t stim was different in the control and damaged systems. The number of spikes propagated is the main determinant for the onset of ectopicity: for all LS> 2.5 mV and all f stim >20 Hz, this ectopicity-triggering number of spikes depends on LS alone. It appears to also depend on frequency, but only when f stim <20 Hz and LS is low, because Na/K pumps then have some time to partially replenish gradients between successive APs.. High frequency periodic stimulation can drive the ectopic node(s) We now consider axons where the damaged node(s) exhibit(s) spontaneous ectopic firing (3.75 mV < LS < 10.75 mV). We will show that propagation can still be achieved by overriding the ectopic site. We first consider simulations where E Na and E K are fixed at their healthy values and later expand to dynamic Nernst potentials. (Numerically, this was done by temporarily setting to zero the surface to volume ratio r.) Stimulation is periodic unless otherwise node 6 remains non ectopic if 5 APs or less are propagated, but becomes subtly but distinctly ectopic otherwise (asterisks); note the wave fronts shape change. Stimulation is applied 10 times, every 30 ms, starting at t stim =300 ms. Wave fronts are drawn by connecting maxima of corresponding APs in adjacent nodes. (b) Minimal number of APs required to trigger ectopicity. Curves are notably f stim -dependent only for low f stim and large number of APs (because Na/K pump action between spikes is then consequential) specified. Below, f Q denotes the ectopic firing frequency or "resonant frequency" of damaged node 6 in the unstimulated axon, and f 6 its frequency when stimulated. When LS> 3.75 mV ( Fig. 2a , blue diamonds curve), ectopic firing occurs spontaneously and frequency f Q increases monotonically as a function of LS.. With no stimulation, the ectopic APs originating in damaged node 6 propagate forward and backward (see both Fig. 2b and c before stimulation begins). With stimulation, f 6 can differ from its unstimulated value f Q , as the two sources of APs (nodes 1 and 6), compete to stimulate the other nodes. When f stim >f Q , complex interplays take place in nodes 1-6. Eventually, however, retropropagation stops and 1:1 phase locking occurs with f 6 =f stim (Fig. 2a , right part of curves with green triangles and dark red squares; see also Fig. 2b ). When f stim <f Q , retropropagation never stops and the damaged node dominates the axon's output. This output, at frequency f Q , shows no f stim -dependence. Furthermore, no anterograde AP originating in node 1 can reach node 10, since these collide and annihilate with retrograde APs from node 6 ( Fig. 2a , left part of curves with green triangles and dark red squares; see also Fig. 2c ). Note that 1:1 phase locking becomes unachievable if f Q exceeds the maximum propagation frequency f max of the axon (LS>10.75 mV on Fig. 2a ).. When stimulating with f stim >f Q , f 6 does not instantaneously switch from f Q to f stim . Rather, a long "settling time" is required, during which APs from node 1 still collide with the retropropagating APs from node 6. Successive collisions occur further down the axon until the collision point reaches the damaged node, which is thenceforth driven at f stim (Fig. 2b) .. Under those conditions, the output frequency at node 10 is determined by the stimulus at node 1, as if it were an intact axon, but with a phase shift.. The situation is entirely different when f stim <f Q : the ectopic node fully dominates the output of the axon (Fig. 2c ). The firing frequency of node 6 does not change after stimulation begins, while node 1 fires erratically. This means that APs in nodes 7 to 10 originated in the damaged node and are completely independent from the stimulus at node 1.. Sources of input-output disruption under phase locking conditions When f stim >f Q , the steady-state frequency is identical to the control system's but there are, nevertheless, differences between output spike trains in the control and damaged cases. As seen in Fig. 3a , there is a non zero settling time, during which output APs in the control and damaged systems differ. Further, there is a phase shift (Fig. 3b) . The combined effect of these two phenomena causes output infidelity which we define below. Figure 3a shows that with increased LS and with reduced f stim , settling times become longer (recall that increasing LS elevates f Q ). The long settling times are linked to the more robust ectopic firing at such increased f Q . The ectopic node thus generates more retropropagated APs that need to be annihilated by input APs before steady-state 1:1 phase locking is achieved. Further, for a given LS, the settling time decreases with increasing f stim , reaching its minimal value for f stim =f max , the maximum 1:1 propagation frequency (see Fig. 2 and Fig. S1c in Online Resource 2). Thus, the settling time can never be zero, because f stim cannot be infinite. During settling (b), with f stim <f Q . Note that f 6 never changes after t stim . Inset : nodes 1-3 show the interplay of input APs with retropropagated APs. Note how some of the latter reach node 1 and cause a stimulation failure (absence of AP fired in node 1 at the time of some stimulations), as in Fig. 1a time, output spike trains from control and damaged systems can differ significantly. The phase difference between the outputs of the control and damaged systems (also an increasing function of LS) is mostly due to the altered excitability of node 6, resulting in locally accelerated propagation; but it also results from the interplay occurring between nodes 1 and 6. Close inspection reveals that, for the illustrated LS value, the damaged node fires before the incoming AP reaches it (Fig. 3b ). This shows that the phase locking is not a local phenomenon; it involves the interplay of all nodes up to the damaged one.. A "propagation window" where output infidelity is minimal A quantitative evaluation of output infidelity requires taking both settling time and phase shift into account. To do so, we generated "output spike trains" (i.e. list of times when maxima of APs occur at node 10) for the damaged and control system fed the same input, and we compared them using the "VP distance" (i.e. the cost-based metric introduced in Victor and Purpura 1996). The VP distance is the minimal "cost" of transforming a spike train into another; if adding or removing a spike is assigned an arbitrary unitary cost while shifting a spike by Δt costs qΔt. Details and an example are given in Online Resource 2 (see Fig. S4 therein) . Note how q, an arbitrary parameter with units of cost per ms, weighs the importance given to shifts in spike timings relative to changes in spike count. Physiologically, this q parameter could therefore indicate the resolution of a postsynaptic neuron acting as a coincidence detector: when qΔt is very low, a spike shifted by Δt could still be detected as coincident with a spike received from another neuron; otherwise, the two spikes would be considered independent. In extreme cases, when q=0, the VP distance equals the difference in spike count, while for large q, it equals the sum of both spike counts. This VP distance will hereafter be called "output infidelity": the higher it is, the more different the two compared spike trains. Note that its use is not restricted to periodic patterns.. The effect of LS and f stim on output infidelity was investigated. Periodic stimulation was applied for t ∈ [300, 800] ms. Since 1.2 ms per internode was allowed for propagation, and there are 9 internodes, output trains were compared for t ∈ [310.8, 810.8] ms. Thus, the calculation of output infidelity includes the settling time but not ectopic spikes fired before/ after the stimulation period. Figs. 4, 5 and 6 used 500 ms of stimulation and q=0.2 ms −1 (see Online Resource 1), and results are independent of these choices ( Fig. S5 in Online Resource 2). Fig. 4a plots output infidelity as a function of f stim . When LS=3 mV (for which no ectopic firing occurs, see Fig. 2a ), output infidelity is nearly zero; spike trains propagate faithfully regardless of their frequency. Then over a range of LS values (3.75 mV<LS<10.75 mV) and f stim >f Q there is still 1:1 phase locking after a settling time (see Figs. 2 and 3). One therefore expects faithful propagation in the interval f Q <f stim < f max (Fig. 4a) . We define the "propagation window" as the wide and deep minimum of output infidelity that occurs in or around that interval. This window has a different width for each curve in Fig. 4 ; for example, when LS=4 mV, it begins around f stim = 55 Hz (when f stim increases past 55 Hz, the output infidelity drops from≈45 to≈6). When LS is increased from this value, the propagation window gets narrower (because f Q increases) and shallower (because the settling time gets longer). In vivo stretched axons would incur damage over several nodes. Fig. 4b, drawn with nodes 5-7 damaged, shows that a propagation window should still be expected in such situations. Note that replicating the damage over three nodes does not triple the infidelity in the propagation window, but barely increases it.. Increased axoplasmic conductance counteracts ectopicity An axon traumatized in vivo is expected to locally increase or decrease its radius due to immediate response to trauma or to its secondary degeneration (Povlishock and Pettus 1996; Greer et al. 2011; Smith et al. 2013 ). Since internodal axolemmal conductance is proportional to cross section area, we modeled this radius change by a local κ increase or decrease, affecting the internodes located each side of the damaged node. Figure 5 shows results for LS=4 mV (see Fig. S6 in Online Resource 2 for other LS values): local κ increase widens the propagation window, at least for the mildest damages, while local shrinking leads to opposite results.. These results follow from two mechanisms: 1) the local κ increase corresponds to an increased coupling between nodes 5 and 6, which reduces the phase shift described in Fig. 3b ; 2) the settling time is also reduced. The latter results from a new ectopic frequency f Q ′ which is reduced from f Q , due to the local κ increase (see red star on 150 % curve in Fig. 5 with propagation window f stim ≥50 Hz≈f Q ′, while Fig. 2a shows f Q ≈53 Hz for the same LS). This change in f Q occurs because a larger part of the charge leaking through Nav channels flows to neighboring nodes, making it harder to reach threshold in the damaged node.. Propagation window affected oppositely by stimulation jitter and weak dynamic noise So far, we used deterministic, periodic stimulation. We will now investigate two stochastic effects likely to appear in vivo: jitter in the stimulation timing (e.g., due to variability in AP generation upstream of the system's first node) and noise in the transmembrane currents (e.g., caused by stochastic behavior of the voltage-gated channels). The procedures used to simulate jitter and Gaussian noise are described in the Online Resource 2. Here, LS= 4 mV so that curves can be compared with the deterministic result (curve with green triangles in Fig. 4a, reproduced here) . Examples of jittered and noisy time series are shown in Fig. S7 in Online Resource 2.. As shown on Fig. 6 , the mildest jitter (standard deviation= 1 ms) has a negligible effect on infidelity. However, increasing the jitter further increases infidelity in the propagation window, eventually destroying the window completely. Dynamic noise has richer effects: while strong noise obliterates the propagation window, weak noise (A<0.015; two curves on Fig. 6b ) does the opposite: it improves the propagation band. Since the output infidelity is reduced in the propagation window, where 1:1 phase-locking already occurs, we infer that the noise reduces the phase shift. This resembles what happens following a local κ increase, but the exact mechanism is beyond the scope of this paper. We suspect that this could be a novel instance of "noise-assisted propagation" based on stochastic resonance (Longtin et al. 1991; Ochab-Marcinek et al. 2009 ), here in a pathological context.. Ionic gradient depletion gives 1:1 phase locking a finite lifetime Simulations in the ectopic regime reported in Figs. 2, 3, 4 , 5 and 6 were run with E Na and E K fixed at healthy values (implemented by using a zero surface to volume ratio, r). This simplification allowed for a steady state with a fixed f Q after a settling time, letting us examine propagation fidelity as a function of parameters characterizing damaged axons. However in reality the surface to volume ratio is non zero. In Fig. S8 from Online Resource 2, the curves shown in Fig. 4a for the output infidelity as a function of f stim are redrawn with r=20 cm 2 /μL, a high value chosen specifically to illustrate, in a reasonable simulation time, the importance of finite volumes. With this value, a propagation window is observed for short simulations but gradually gets shallower when the simulation is allowed to last longer. This indicates that 1:1 phase locking is lost within a few hundred ms. This loss results from the gradual increase of f Q associated with the diminishing E K values (see Fig. S2 in Online Resource 2), with 1:1 phase locking being lost once the condition, f stim >f Q , is no longer respected. This situation can be described by binning the simulation time, computing a time-dependent output infidelity (TDOI) and allowing the presence of a propagation window to be a time-dependent phenomenon.. Since nothing stops f Q from increasing beyond f max , recurrent transitory propagation windows can be expected in real axons for the duration of time when the Na/K pumps are unable to maintain E K . Thus the propagation window found under constant reversal potentials has a finite r-dependent lifetime. In other words only a stimulus of finite duration can be transmitted; for ongoing stimulation, the propagation window will appear and disappear via an interplay of stimulus and gradient depletion/recovery time scales. A myelinated axon is modeled as N=10 Hodgkin and Huxley (1952) nodes of Ranvier, each an isopotential compartment with membrane voltage V i (where i=node number), with adjacent nodes coupled by an internodal conductance κ (see Online Resource 1). Dynamic concentration-dependent Nernst potentials E Na and E K were implemented as in Kager et al. (2000) and Boucher et al. (2012) . Therefore, the model encompasses six transmembrane currents in total : the three currents from the Hodgkin-Huxley model (Na + , K + and unspecific leaks), the current caused by the Na/K pumps (modeled using Michaelis-Menten kinetics) and two specific leak currents (Na + and K + ) used to stabilize the rest state despite the pump current. The rate at which ion concentrations change is proportional to the nodal surface to volume ratio r.. All simulations begin with disconnected nodes. In the damaged model, node 6 (or nodes 5,6,7) is traumatized by applying CLS at t=0. Nodes are then connected together at t= t κ ; this ensures that the intact portion of the axon reaches its steady state before suffering the influence of the damaged node(s), which may or may not reach quiescence. Stimulation at node 1, if present, begins at t= t stim (see Online Resource 1). This ensures that the damaged node, if it fires periodically, has time to dominate the entire axon before external stimulation begins. Stimulation is applied at precise times, periodically or not, in the form of delta functions, each causing a discontinuous ΔV stim change of V 1 . In the intact (control) model, each delta function stimulus causes the first node to fire an action potential (AP) and each AP fired by that node propagates faithfully (1:1) to all other nodes, up to a "maximum 1:1 propagation frequency" f max . Additional details on model design and implementation in C language are given in the Additional Methods section of Online Resource 2, including explanations for choices of N, ΔV stim and κ values.

O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O


A characterization of definability of second-order generalized quantifiers with applications to non-definability We study definability of second-order generalized quantifiers. We show that the question whether a second-order generalized quantifier Q 1 is definable in terms of another quantifier Q 2 , the base logic being monadic second-order logic, reduces to the question if a quantifier Q 1 is definable in FO(Q 2 , <, +, ×) for certain first-order quantifiers Q 1 and Q 2 . We use our characterization to show new definability and non-definability results for second-order generalized quantifiers. We also show that the monadic second-order majority quantifier Most 1 is not definable in second-order logic. The notion of generalized quantifier goes back to Mostowski [1] and Lindström [2] . Generalized quantifiers were first mainly studied in the framework of model theory. The study of generalized quantifiers extended to the context of finite model theory via applications to descriptive complexity theory. We refer to [3] and [4] for surveys of first-order generalized quantifiers in finite model theory. Generalized quantifiers have been also extensively studied in the formal semantics of natural language (see [5] for a survey).. The study of second-order generalized quantifiers is a relatively new and unexplored area in finite model theory. On the other hand, second-order logic (SO) and its many fragments have been studied extensively starting from Fagin's characterization of NP in terms of existential second-order logic [6] . Second-order generalized quantifiers were first studied in the context of finite structures by Burtschick and Vollmer [7] . Shortly after, Andersson [8] studied the expressive power of families of second-order generalized quantifiers determined by the syntactic types of quantifiers. In [9] [10] [11] Kontinen studied definability questions of second-order generalized quantifiers. In the case of first-order quantifiers, definability of a quantifier Q in a logic L means that the class of structures, used to interpret Q , is axiomatizable in L. In the second-order case, the analogous concept of definability was formulated in [9, 10] . In this article, we give a computationally motivated characterization for the notion of definability of second-order generalized quantifiers. Burtschick and Vollmer [7] noticed that second-order generalized quantifiers can be used to logically characterize complexity classes defined in terms of so-called Leaf Languages. The leaf languages approach in computational complexity theory, introduced by Bovet, Crescenzi, and Silvestri [12] , is a unifying approach to define complexity classes. The central idea behind this approach is to generalize the conditions under which, e.g., a Turing machine or an automaton accepts its input. Many complexity classes can be defined in this context in terms of suitable leaf languages. On the other hand, a complexity class defined in terms of a leaf language B can be under certain conditions characterized logically by a logic of the form:. where Q B is a second-order generalized quantifier corresponding to the language B. In the context of leaf languages, polynomial time non-deterministic Turing machines can be sometimes replaced by non-deterministic finite automata (so-called finite leaf automata) without a significant decrease in complexity [13] . Galota and Vollmer [14] showed that complexity classes defined by finite leaf automata can be logically characterized in terms of monadic second-order generalized quantifiers. This result nicely extends the well known [15] [16] [17] characterization of regular languages in terms of monadic second-order logic (MSO).. The definability theory of second-order generalized quantifiers has some similarities and differences compared to that of first-order generalized quantifiers. For example, it was observed in [9] that the binary second-order existential quantifier cannot be defined in terms of any monadic second-order generalized quantifiers. This result is in contrast with the fact (a corollary of a result of Andersson [8] ) that all classes of finite first-order structures are already definable in terms of monadic second-order generalized quantifiers.. In this paper we prove a general result characterizing the question when a quantifier Q is definable in MSO(Q , +), where + denotes the built-in addition relation. We assume the built-in addition in order to unleash the expressive power embodied by MSO. Recall that, while MSO corresponds to regular languages over strings, MSO(+) corresponds to the linear fragment of the polynomial hierarchy (LINH) on strings [18] . Some of our results can be generalized to the case where the base logic is full second-order logic instead of MSO(+). Our characterization is based on the idea connecting oracle separation results with lower bound results for small constant depth circuits, see e.g., [19] [20] [21] [22] [23] . We show that a second-order generalized quantifier Q 1 is definable in the logic MSO(Q 2 , +) iff for certain first-order encodings Q i of Q i , Q 1 is definable in FO(Q 2 , +, ×). It is worth noting that the latter condition implies that Q 1 is AC 0 (Turing) reducible to Q 2 . We use our characterization to show new definability and non-definability results for second-order generalized quantifiers. In particular, we show that the monadic second-order majority quantifier Most 1 is not definable in second-order logic. This answers. the question left open in [24] (see also [25] ), where second-order generalized quantifiers were used to model collective quantification in natural language, for example:. 1. Most girls gathered. 2. All soldiers surrounded the Alamo.. The common strategy in formalizing collective quantification has been to define the meanings of collective determiners, quantifying over collections, using certain type-shifting operations. These operations, i.e., lifts, define the collective interpretations of determiners systematically from the standard meanings of quantifiers (see, e.g., [26, 27] ). In [24] we show that all these lifts are definable in second-order logic. In this paper we prove that some collective quantifiers (second-order generalized quantifiers) are not definable in second-order logic. Therefore, there is no second-order definable lift expressing their collective meaning. This is clearly a restriction of the type-shifting approach. One possible alternative would be to use second-order generalized quantifiers in the study of collective semantics, as we already proposed in [24] . However, as it follows from this paper the computational complexity of such approach is excessive and hence it may not be a plausible model of collective quantification in natural language (see [28] [29] [30] for a discussion of computational restrictions in natural language semantics). Hence, it may be wise to turn in the direction of another well-known way of studying collective quantification in natural language, the many-sorted (algebraic) tradition (see [31] ). Another linguistic interpretation of our results might be that computational complexity restricts the expressive power of everyday language (see [32] ). Namely, even though natural language can in principle realize collective quantifiers non-definable in second-order logic, its everyday fragment does not contain such constructions due to their high complexity. We have shown that definability of second-order generalized quantifiers can be reduced to definability of first-order generalized quantifiers. We have indicated a couple of corollaries to our characterization but surely there is more to be done here, e.g., with replacing the base logic MSO(+) by SO as in Theorem 3.8. In particular, Theorem 3.8 solves the open problem proposed in [24, 25] , where we studied the collective meanings of natural language quantifiers. It suggests, as we argued in [24] , that the type-shifting strategy [27] to define the meanings of natural language quantification might be too restricted in its computational power. It is likely that second-order logic is not enough to capture natural language semantics. Another interpretation would be that everyday language does not realize hard collective quantifiers (for sure they are marginal at best) due to their complexity.

O O O B O B I I O O O O O O B O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O B I I O O O O O O O B I O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O B I O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O B O O B I I O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O B O B I I O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O B I O O B O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O B I I O O O O O O O O B I O O O O O O B I O O O O O O O O O O O O O B I I O O O O B I O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O B I I O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O B O B I I O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O


Packet Classification with Hierarchical Cross-Producting Packet classification has become one of the most important application techniques in network security since the last decade. The technique involves a traffic descriptor or user-defined criteria to categorize packets to a specific forwarding class which will be accessible for future security handling. To achieve fast packet classification, we propose a new scheme, Hierarchical Cross-Producting. This approach simplifies the classification procedure and decreases the distinct combinations of fields by hierarchically decomposing the multi-dimensional space based on the concept of telescopic search. Analogous to the use of telescopes with different powers * * , a multiple-step process is used to search for targets. In our scheme, the multi-dimensional space is endowed with a hierarchical property which self-divides into several smaller subspaces, whereas the procedure of packet classification is translated into recursive searching for matching subspaces. The required storage of our scheme could be significantly reduced since the distinct field specifications of subspaces is manageable. The performance are evaluated based on both real and synthetic filter databases. The experimental results demonstrate the effectiveness and scalability of the proposed scheme. The expansion of IP traffic has been fast growing due to the fact that business on the Internet has moved from a convenience to a mission-critical platform. At the same time, network security service has become much more difficult, as broadband networking technologies substantially increased the capacity of networking and enabled a wide-range of feature-rich high-speed communication services. Since the firewalls and network intrusion detection systems (NIDSs) are the most commonly used network security systems, their capability to manage a large amount of incoming traffic is critical. A serious problem would arise if the search performance of network security systems cannot keep pace with the incoming traffic: attackers may overload the systems by injecting worst-case traffic. This problem has been recognized and approached by improving the search performance of packet classification [1] , [2] . The filters for packet classification consist of a set of fields and an associated action. Each field, in turn, corresponds to one field of packet headers. The value in each field could be a variable-length prefix, range, explicit value or wildcard. The five most common fields include source and destination IP address prefixes, source and destination port ranges of the transport protocol and a protocol type in a packet header [3] . Formally, we define a filter F with k fields as F = ( f 1 , f 2 , . . . , f k ). While performing packet classification, a packet header P is said to match a particular filter F if for all i, the i th field of the header satisfies f i . Each action has a cost that defines its priority among the actions of the matching filters, and only the least-cost action from the matching filters is applied [4] .. The problem of packet classification can be treated as a point location problem in a multidimensional space, i.e. finding the enclosing region of a point for a given set of regions. Unfortunately, even for non-overlapping regions, the bounds for N rules and k fields (k > 3) are O(log N) in time with O(N k ) space, or O(log k−1 N) time and O(N) space [5] . Consequently, scalability is one of the major issues in packet classification. Since the performance of packet classification might degrade severely as the filters increase in number, several heuristic proposals have been proposed to deal with a large number of filters; for instance, the hash-based schemes [6] and the decision-based schemes [7] , [8] . However, these algorithms do not perform well in either speed or space for certain filter databases and sometimes a tradeoff between time and storage is inevitable. By recognizing the limits of the previous schemes, we are motivated to develop a new scheme.. In this work, we adopt the concept of telescopic search to design our algorithm. Telescopic search refers to the use of a telescope to identify a target from distance, and it mainly consists of two steps. The first is the use of a low-power mode to identify a rough location of the target. This step provides a panorama that omits the details. Then, a more focused field of view under high-power is used to search for the target with more precision and clarity. On the basis of the telescopic search, we propose a new scheme, Hierarchical Cross-Producting (HCP), to improve the performance of five-dimensional packet classification. Our scheme improves storage efficiency by dividing a mul-tidimensional space into multiple subspaces. Each subspace could be divided into smaller subspaces whose number is controllable. Therefore, the cost of searching for a matching subspace is much lower than that for a matching filter. For every target, the procedure of packet classification is recursive until a matching filter has been found. Our scheme extends the scalability of cross-producting based schemes [5] , [9] and achieves fast lookup with minimum storage.. The rest of the paper is organized as follows. Section 2 presents related work. Section 3 explicates our new concept. The proposed scheme is presented in Sect. 4. Section 5 presents the experimental setup and results. Finally, Sect. 6 summarizes this work. Packet classification plays a crucial role in the applications of network security. Previous approaches tend to rely on hardware support to achieve fast classification. However, such prerequisite may not be always feasible for network applications; an example would be firewalls with large rule sets. To improve the feasibility of packet classification, we developed a new algorithm, Hierarchical Cross-Producting, to hierarchically decomposes the multidimensional space into smaller subspaces. For each subspace, a cross-product table, which is implemented by a hash table, is generated. Through controlling the number of distinct fields in each subspace, the required storage can be greatly reduced, especially for the sparse filters. We also demonstrated the speed and storage efficiency as compared with previously proposed algorithms. Our algorithm not only supports incremental updates but also improves the scalability of crossproducting by promoting space efficiency. Therefore, we believe that the applications of network security can benefit from our algorithm by the consolidation of data protection. Several algorithms for classifying packets have appeared in the literature [5] - [7] , [9] - [11] . These existing algorithms can be divided into four categories according to their approaches. The following subsections provide a brief description of the existing algorithms.

B I O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B I I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O


On the distribution of linear combinations of independent Gumbel random variables The distribution of linear combinations of independent Gumbel random variables is of great interest for modeling risk and extremes in the most different areas of application. In this paper we develop near-exact approximations for the distribution of linear combination of independent Gumbel random variables based on a shifted generalized near-integer gamma distribution and on the distribution of the difference of two independent generalized integer gamma distributions. These near-exact distributions are computationally appealing and numerical studies confirm their accuracy, as assessed by a proximity measure used in related studies. We illustrate the proposed approximations on applied problems in networks engineering, computational biology, and flood risk management.

O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O


Efficient peer-to-peer file sharing using network coding in MANET Mobile peer-to-peer (P2P) systems have recently got in the limelight of the research community that is striving to build efficient and effective mobile content addressable networks. Along this line of research, we propose a new peer-to-peer file sharing protocol suited to mobile ad hoc networks (MANET). The main ingredients of our protocol are network coding and mobility assisted data propagation, i.e., single-hop communication. We argue that network coding in combination with single-hop communication allows P2P file sharing systems in MANET to operate in a more efficient manner and helps the systems to deal with typical MANET issues such as dynamic topology and intermittent connectivity as well as various other issues that have been disregarded in previous MANET P2P researches such as addressing, node/user density, non-cooperativeness, and unreliable channel. Via simulation, we show that our P2P protocol based on network coding and single-hop communication allows shorter file downloading delays compared to an existing MANET P2P protocol.Index Terms: File swarming, mobile ad hoc networks (MANET), mobility-assisted, network coding, peer-to-peer (P2P), random linear code. Peer-to-peer (P2P) file sharing in mobile ad hoc networks has continuously gained popularity due to its strong adaptability in many practical applications. However, using existing P2P file sharing systems (such as Gnutella and BitTorrent) on mobile ad hoc networks (MANET) inherently contains some limitations since they are mainly developed for the wired networks. Recently, several P2P schemes targeting MANET have been proposed as in MANET-optimized versions of existing P2P as well as clean-slate designs. Most of the recently proposed MANET P2P protocols attempt to address the problems caused by dynamic topology through cross-layer optimization since MANET is characterized by highly dynamic topology; however, P2P protocols are encumbered with various other characteristics of MANET.. First problem is caused by the fact that the wireless channel is error prone. If a protocol is designed without considering potential errors, the performance of the protocol in real deployment will be seriously degraded. For example, TCP connections usually die out in multihop networks with lossy channel but most P2P protocols simply assume that TCP offers reasonable bandwidth. Secondly, number of users and user density should also be considered. In a file sharing scenario, the total number of users can scale up to tens of thousands of nodes, and theoretically, all of the nodes can be users running P2P protocols. Even with any cross-layer optimization, no conventional MANET routing protocols is expected to support such big networks. Possible non-cooperative nodes are another concern. Most MANET protocols are designed based on the assumption of node cooperativeness. Multihop routes can only be established when there are nodes willing to serve as relays for the sake of data sender. In a MANET built/maintained/owned by a single entity, such as a military tactical network or wireless mesh network, nodes can easily be forced to cooperate to achieve a common goal (e.g., providing a communication infrastructure). But in other types of MANET such as vehicular ad hoc networks (VANET) consisting of cars, trucks, or any other types of vehicles on the road, it is very likely that nodes are operated by different entities for their own good and thus it may not possible to force every node to cooperate each other. Lastly, IP addressing is non-trivial in large scale MANET. It is not clear how each node will be assigned an IP address in a large scale MANET such as VANET.. In this paper, we investigate the problem of running BitTorrent type P2P file sharing systems, i.e., file swarming protocols, in MANET. To remedy the issues identified above, we take a holistic approach. Put another way, instead of solving each issue separately as an independent problem, we design an entirely new protocol to address all these problems at once. As we can see, the use of existing MANET routing protocols in P2P file swarming give rise to most of the issues. In our design, we resort to single-hop communication. Multihop routes are never used and thus are not required to be maintained explicitly by any layer in the protocol stack. Rather, multihop communication is implicit. We restrict logical peers, i.e., nodes exchanging file pieces, to physical neighbors, yet data is propagated through the (overlay) network of peers of common interest, which is the basic concept of operation of P2P file sharing systems. The main problem of restricting logical peers to physical neighbors in MANET, however, is connectivity amongst peers. It might be difficult for a node to find peers of common interest. Even though some peers are found, there is no guarantee that those peers possess useful data. The main ingredients of our design are network coding and mobility assisted data propagation (e.g., [1] ). The two techniques allow our design to maintain enough connectivity among peers with low overhead such that users can download files in less time than existing protocols.. By network coding, we refer to the notion of performing coding operations on the contents of packets throughout a network. This notion is generally attributed to Ahlswede et al. [2] , who showed the utility of the network coding for multicast. The work of Ahlswede et al. was followed by other work by Koetter and Médard [3] that showed that codes with a simple, linear structure were sufficient to achieve the capacity of multicast connections in lossless, wireline networks. This result was augmented by Ho et al. [4] , who showed that a random construction of the linear codes was sufficient. The utility of such random linear code for wired P2P file sharing systems was soon realized in [5] . Network coding improves the performance of P2P file swarming systems since it mitigates the block transfer scheduling or piece selection problem especially when only local information is given and nodes dynamically join/depart. It helps increase the number of distinct pieces available in the network via coding, thus providing a higher chance for peers to pull useful pieces [5] , [6] . Recently, implementation and performance issues in network coding based P2P have been investigated in [7] - [9] . Our contribution in this lineage is that we show the utility of random linear code for P2P file swarming protocols "in MANET." Our work is inspired by [5] in which the performance advantage of using random linear code in "wired" P2P systems is investigated. Different from [5] , we show that network coding helps exploit unique opportunities offered in the MANET P2P environment, the broadcast nature of wireless medium and node mobility. Our file swarming protocol based on network coding and mobility assisted data propagation, i.e., single-hop communication, shows less download delay than an existing MANET file swarming protocol.. The rest of this paper is organized as follows. Section II illustrates our network coding based file swarming protocol and we evaluate the protocol through simulation in Section III. Section IV presents the related work and, finally, Section V concludes this paper. In this paper, we proposed a network coding based file swarming protocol named CodeTorrent offering less download delay than an existing file swarming protocol. We showed that network coding helped exploit unique opportunities offered in the MANET P2P environment, the broadcast nature of wireless medium and node mobility and by exploiting them in full we could have a very simple solution to the issues arising in MANET file swarming systems. We kept the system in the simplest form in this paper for clearer presentation of the main idea. Immediate future work includes exploring optimization opportunities that the proposed protocol allows. A major portion of MANET P2P works can be categorized as mobility-assisted content distribution techniques. A mobilityassisted protocol basically utilizes node mobility to disseminate/retrieve content or index. 7DS [14] aims at sharing web content among nodes based on a high locality of information access within a geographic area, even without Internet connectivity. A node can pull and carry content of interest from its neighbors, thus diffusing content into the network. In passive distributed index (PDI) [15] , mobility is exploited for disseminating and maintaining a distributed index of shared content. CodeTorrent is different from these work in that it provides a BitTorrent style content sharing mechanism based on network coding similar to [5] . We show in this paper that there are benefits of using network coding typical to the MANET content sharing scenario, which differentiates our work from [5] .. A group of MANET P2P works is classified as cross-layer techniques. Cross-layer techniques incorporate content indexing and routing as a single layer. Most protocols have been focused on overcoming the discrepancy between a logical overlay and a physical topology of mobile nodes. For example, XLGnutella [16] maps the logical overlay neighbors to physical neighbors. CarTorrent [11] , a BitTorrent style content sharing protocol in wireless networks, uses the proximity-driven piece selection which is known to perform better than the rarest first piece selection. Similarly, ORION [17] builds an on-demand content-based overlay, closely matching the topology of an underlying network. Unlike these approaches, CodeTorrent attempts to tackle dynamically changing topology and intermittent connectivity in MANET as well as various other issues that have been disregarded in previous mobile P2P researches such as addressing, node/user density, non-cooperativeness, and unreliable channel all together with the help of network coding and mobility assisted dissemination techniques.. Also cross-layer approaches can be found in in distributed hash table (DHT) inspired protocols. The VRR protocol is a clean slate approach for content based routing in MANET. VRR is implemented on the top of the link layer and provides a reliable routing as well as a native content addressable network [18] . Another DHT inspired approach is represented by the geographic hash tables [19] where the contents hare hashed into a geographic location and the retrieval is driven by the a geographic routing performed over the MANET.. Using network coding in P2P was first proposed in [5] and recent feasibility studies on network coding in real testbeds have been done in [7] , [9] , and [20] . Various performance enhancement techniques have been proposed [8] , [9] , and [21] . In [9] , authors propose the sparse network coding where each piece is selected for coding with a certain probability, thus reducing the number of pieces involved in coding. Maymounkov et al. show that one can decrease the generation size, yet can still effectively handle the coupon collection problem by using erasure codes at the generation level [21] . The coding technique proposed in [21] may alleviate the generation selection problem in our protocol. The technique allows the nodes to collect any m generations out of total k (bigger than m) generations instead of collecting each of m distinct generations. However, even with the technique in place, different node pairs still need to exchange coded frames belonging to different generations, reducing their chances to be helpful to each other. Shojania et al. in [8] introduced CPU acceleration techniques to improve the performance of network coding. Some other network coding researches relevant to our scenario are the opportunistic routing with network coding [22] and multicasting [23] in the wireless environment and network coding based message dissemination in delay tolerant networks [25] .

O O O O O B I O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I I I O O O O O O O B I O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O B I B I I I I B B I B I B I I B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O B I O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O B I I O O B I O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O B I O O O B I O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O B I O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O B I O O O O O O O O O O B I O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O B I O O O O O O O O O O B I O O O O O O O O O B I O O O O O O O O O