4.1 Opportunistic transmission and anypath cost
In opportunistic transmission, a packet sent from one node may be received possibly by any of its neighbors. The forwarders are the nodes in these neighbors which have received this packet and are closer to the destination. A forwarder has higher priority to do the forwarding if it is closer to the destination. A forwarding list (or say a forwarding set) is the set of forwarders. Apparently, more forwarders which a forwarding list has cause a higher probability of forwarding a packet successfully. In anypath routing [9], authors design a calculation method of anypath cost to present this relationship. They define an anypath cost for forwarding packet p at node i by
(1)
where is the broadcast cost from i to a forwarding list J, and is the anypath cost of J. According to the ETX metric [33] and assuming that the loss for each link is independent, cost can be calculated by
(2)
where d
ij
is the packet delivery ratio (PDR) from i to j. The remaining anypath cost is defined as a weighted average of the costs of the nodes in forwarding set J by
(3)
where the weight w
ij
is the probability of node j being the relaying node of p from node i and . Let J={1,2,…,n} with anypath cost , the weight w
ij
is simplified to
(4)
With the above settings, some conclusions can be achieved in the anypath cost.
Lemma 4.1
For a fixed transmission rate, let C
iJ
be the costb of a node i via forwarding set J and set Ci,J be the cost via forwarding set J′=J∪{k}. We have if and only if C
i
≥C
k
.
Lemma 4.1 is the key conclusion in anypath routing. With this lemma, if we want to reduce the cost of a forwarding set, we need to add a new forwarder which has lower cost into the forwarding set. In other words, the cost of a forwarding set is optimal if and only if there is no node in the neighbors with lower cost than that of this sender.
Lemma 4.2
For a fixed transmission rate, assume a forwarding set {1,2,…,k} with cost C1≤C2≤…≤C
k
. If Ci(j) is the cost from node i via forwarding set {1,2,…,j}, for 1≤j≤k, then we always have Ci(1)≥Ci(2)≥…≥Ci(k)=δ
i
, where δ
i
is the optimal cost of node i.
Lemma 4.2 shows the variation tendency of anypath cost with varying number of forwarders. It is the extension of Lemma 4.1 to demonstrate that the reduction of the forwarders in a forwarding list will cause the increase of the anypath cost of this opportunistic transmission.
4.2 Inter-flow network coding
Before discussing the issues of IRNC in opportunistic routing, we would like to give a definition of IRNC formally. For a network coding structure, w.l.o.g., we assume that there is only one coding node and multiple decoding nodes. All potential encoded flows should be encoded at the coding node and decoded at the decoding nodes. Considering a multihop wireless network, a flow runs possibly on a multihop path which starts at a source and ends at a destination. We denote a flow from source i to destination j by f
ij
. If a native flow f
ij
is encoded into an encoded flow, we mark it as a virtual native flow by . A path means a set of links connecting node i to node j. We say a flow on a path if and only if this flow passes the nodes i and j. According to the denotation of a flow, we distinguish a flow on a path by the start and end of this path. For example, given two flows f
ab
and f
cd
, if f
ab
is on the path , we say f
cd
is distinguishable from f
ab
on if and only if f
cd
is not on . Based on this setting of path distinction, we give the definition of IRNC by
Definition 4.1.
For path identifiable flows, we say a network coding is inter-flow network coding if and only if all virtual native flows of one encoded flow are distinguishable on the paths from coding node to the decoding nodes.
Definition 4.1 can be used as the rule to distinguish IANC and IRNC. Based on the definition of IRNC, we can achieve two following lemmas.
Lemma 4.3.
In inter-flow network coding, for each encoded flow, the decoding nodes for achieving different native flows must be different.
Proof.
This lemma is easy to be proved by Definition 4.1. If two virtual native flows have the same decoding node, they cannot be distinguished on the path from the coding node to decoding node
Lemma 4.4.
In inter-flow network coding, for each encoded flow, no node is both the decoding node of one virtual native flow and also the forwarding node of another virtual native flow.
Proof.
If node m is the decoding node of a virtual native flow from the encoded flow f
i
⊕f
j
, this suggests m has overheard f
j
. If m is also the forwarding node of the encoded flow for the other decoding node to obtain , it implies m is the potential decoding node of f
j
. This contradicts Lemma 4.3
4.3 General coding condition
Considering an intermediate node k on the path of flow f
ij
, we denote the upstream part of at k by U
k
(f
ij
) and the corresponding downstream part by D
k
(f
ij
). Before doing network coding, the coding node must guarantee that the encoded flow is decodable. That means there is at least one node in the downstream which can decode this encoded flow. For doing this, the coding node must know the decoding knowledge before making any coding decision. In inter-flow network coding, decoding knowledge is the flow’s overheard information which is defined by a set of possible nodes which had or overheard this flow. This information can be achieved by learning neighbor state method. We denote the overheard information of flow f before node i by , where N
j
is the neighbor of node j with a high PDR. The nodes in O
i
(f) can be considered as the potential decoding nodes for the flows which are encoded with f. Hence, the general coding condition is given as follows.
Coding condition.
For f
k
and f
j
intersecting at node i, if we denote that f
k
can be encoded into f
j
by , and similarly , then f
j
and f
k
can be encoded together and the following should hold:
(5)
For encoding m>2 flows together, every two of them should hold the coding condition. Intuitively, the more flows are encoded together, the more NC gain can be achieved. How to encode the maximum flows together, however, can be summarized as finding the maximum clique in an undirected graph [3]. The maximum clique problem is NP-complete. In [19], authors point out that the maximum number of flows that can be encoded with a given flow is bounded by a small number. Meanwhile, the probability of encoding m>2 flows is very low with random flows in multihop networks. For example, if we assume that every flow is generated randomly and with probability p to encode with another flow, the probability of encoding m>2 flows together is only pm(m−1)/2. Moreover, from our work, encoding more flows together will cost more OR price in the transmission (we will discuss this issue in following sections). So it seems to be not worth to design an encoding multiple flow scheme for OR. Hence, in this paper, we only consider a two-flow encoding case, and we believe that the multiple flow encoding case can be achieved by extending our work.