Open Access

HCOR: a high-throughput coding-aware opportunistic routing for inter-flow network coding in wireless mesh networks

EURASIP Journal on Wireless Communications and Networking20142014:148

Received: 22 April 2014

Accepted: 25 August 2014

Published: 11 September 2014


Coding-aware routing is an effective approach to create more coding opportunities in inter-flow network coding. To the best of our knowledge, most of the coding-aware routing schemes focus on maximizing the coding opportunities. However, for opportunistic transmission, the throughput is not always increased with the increase of coding opportunities. In this paper, we explore why this case will happen and how to measure the benefits of network coding in the opportunistic routing. According to the above conclusions, we propose a novel high-throughput coding-aware opportunistic routing (HCOR) to achieve the maximal throughput gain in wireless mesh networks. HCOR is based on anypath routing and takes advantage of the network coding gain to find out the route with minimal anypath cost reasonably. Meanwhile, it is also a ‘multihop’ network coding and changes the route with dynamical data loads adaptively. Simulation results demonstrate that HCOR has better performance than coding opportunity-aware routing and also obtains a significant throughput gain in wireless mesh networks.


Inter-flow network coding Opportunistic routing Coding-aware routing ‘Multihop’ network coding

1 Introduction

Network coding (NC) is gaining popularity as a new transmission method that can improve network performance in terms of increasing throughput at the coding level. NC was first proposed by Ahlswede et al. [1] in 2000, and is basically classified into two types. One is called intra-flow network coding (IANC) which encodes multiple packets belonging to the same flow. The other is called inter-flow network coding (IRNC) which encodes multiple packets from different flows. IANC is a kind of reliable transmission method. For n native packets sent from one flow, the sources and intermediate nodes are allowed to encode these packets together before sending them to the destinations. The generated encoded packets are redundant against lossy links until the destination receives and decodes n independent encoded packets for recovering all native packets. By doing this, packet losses are masked and data transmissions are robust [2]. Different from IANC, IRNC is an efficient transmission method. Intermediate nodes encode the native packets from different flows and broadcast the encoded packets to different destinations. By exploiting the broadcast nature of wireless channel, destinations can overhear some of side information of the encoded packets before decoding them. So the coding nodes can broadcast the encoded packets to different destinations for different flows at the same time. By making use of this free-ride transmission [3], IRNC saves many time slots to send different flows at intermediate nodes simultaneously. In this paper, we only focus on and discuss IRNC. So the term ‘network coding’ which appears in the following only means IRNC.

Much work points out that the benefits of network coding are different for the same flow by using different routes. So the question of how to find out the best route with network coding is still open until now. Most of the coding-aware routing schemes are based on deterministic routing protocols [3, 4]. Due to the characteristic of network coding, these schemes cannot work well when the data flows change frequently. The reason is that route must be preprogrammed in deterministic routing protocols. However, network coding depends on the flows and routes simultaneously. So doing coding-aware routing in deterministic routing protocols must bind flows and routes together. This causes low stability of routes when the state of flows (such as on or off, or the rate of flow) is changed frequently. For example, assume that the best NC-aware route is R a for flow a to be encoded with flow b. When flow b is end, R a may not be the best route for a. The follow-on problems are that high delay will be caused if a does the rerouting at this time or the throughput will be degraded if a still uses R a as its route.

Network coding-aware opportunistic routing (NCOR) has been proposed recently [58]. Unlike classical deterministic routing, opportunistic routing (OR) always finds potentially feasible paths as the route. In OR, every packet is forwarded by a forwarding list which is composed of the neighbors closer to the destination. Hence, unstable routing problem can be solved in opportunistic routing. Meanwhile, due to the forwarding list adopted, which means many nexthops can be considered in a coding structure, more coding opportunities may be found in an opportunistic transmission. Conventional NCOR schemes [5, 8] only consider the maximum coding opportunities as the selection mechanism for the coding node. For example, the authors in [5] propose that they use the number of the neighbor nodes that can decode a coding pattern as the coding gains of that coding pattern. In IRNC, the maximum number of the neighbor nodes that can be the decoding nodes suggests the maximum coding opportunities. The authors in [8] claim that if a node with the most coding opportunities can be chosen as the forwarder in each packet transmission, the throughput of network will be greatly improved as a result. From our study, however, this mechanism is not very suitable for incorporating NC into OR. When multiple packets are encoded together, the receivers of this encoded packet should be determined. After that, the set of ‘new receivers’ may be possibly shrunken from the set of original receivers. As we know, the shrinkage of a forwarding list will reduce the transmission gain in an opportunistic transmission. So in this case, is the network coding still beneficial for this transmission? How should we decide which is the best choice, coding or not? In addition, if we consider the gain of opportunistic transmission in doing network coding, how to determine the forwarder list is complicated.

In this paper, aiming to address the above problems, we study the network coding in anypath routing [9] which provides a calculation method to compute the gain of opportunistic transmission. Our main contributions are summarized as follows:

  • According to the definition and coding condition of IRNC, we figure out two following solutions to help design a coding-aware opportunistic routing. The first is which nodes should be in the forwarding list for sending an encoded packet. The second is how to measure the price of network coding in an opportunistic transmission.

  • We propose a novel coding-aware opportunistic routing scheme called HCOR, which is based on anypath routing and finds out the minimal anypath cost path as the route with network coding. Compared with conventional NCOR schemes, HCOR is more feasible on choosing the coding opportunities. Meanwhile, HCOR is designed on a ‘multihop’ network coding structure, in which much more coding opportunities can be collected than with a ‘local’ coding structure [3].

  • We implement the HCOR scheme in ns-2 and carry out extensive evaluation to show the performance of HCOR.

The remainder of this paper is organized as follows. Section 2 reviews some related work. Section 3 is the overview of HCOR. In Section 4, we show some basic knowledge and key technologies used in this paper. In Section 5, we discuss the characteristic of incorporating NC into opportunistic routing and give a computing method to calculate the cost of network coding. We present the details of HCOR implementation in Section 6. The simulations performed to evaluate the performance of HCOR are discussed in Section 7. Finally, we conclude this paper in Section 8.

2 Related work

Ahlswede in [1] presented that the network capacity can be increased significantly by employing network coding. Since then, many various studies have proved the benefits of network coding [10, 11] and given many coding methods to achieve the gain of network coding for different networks [1217]. For inter-flow network coding, COPE [18] was proposed in 2008 as the first practical XOR (exclusive or)-based network coding scheme. Authors in [11] showed the coding opportunities of COPE in a multihop wireless network. For practical wireless network coding, authors of [19] gave the bound of ‘encoding number’ and the gain of throughput in a general class system of random access mechanisms. In lossy networks, the performance of inter-flow network codinga has been widely studied. The work on XOR-based IRNC was proposed in [20]. Wu studied the case of random linear network coding-based IRNC with the number of sessions M≤3 in [21]. Wang extended Wu’s study to the case with M>3 in [22]. Amerimehr and Ashtiani analyzed the trade-off between delay and throughput for opportunistic network coding in a two-way relay network [23]. Yang et al. gave a study of binary multiuser NC to improve the symbol error probability in a N-way relay network [24].

Coding-aware routing has been regarded as an effective approach to actively create more coding opportunities [35, 2527]. In [25] and [27], authors proposed coding-aware routing methods based on COPE. Their methods detect coding opportunities from a ‘local’ coding structure. In [3], authors proposed a coding-aware routing method called distributed coding-aware routing (DCAR) based on (dynamic source routing) DSR [28] routing protocol. DCAR works in more general cases than the COPE-based method. The coding opportunities are detected in the routing process. So more coding opportunities can be detected from ‘multiple’ coding structure. Free-ride-oriented routing metric (FORM) [4] is a variation of DCAR and also works on multiple coding structure. Most of the above coding-aware routing schemes are focused on the deterministic routing protocols. Recently, network coding-aware opportunistic routing schemes were proposed to achieve more throughput in wireless networks [5, 8, 2931]. Authors of CORE [5] proposed an NCOR method by combining hop-by-hop opportunistic forwarding and localized inter-flow network coding. Authors of [8] proposed a practical NCOR scheme for wireless mesh networks. Authors of [31] gave a multi-rate approach to realize NCOR in wireless mesh networks. Authors of [29] proposed a reliable multicast protocol based on NCOR to achieve high throughput and fairness in lossy wireless networks. In [32], authors gave a general survey of coding-aware routing in wireless networks. Compared with these NCOR schemes, HCOR considers the network coding cost in an opportunistic transmission and does coding-aware opportunistic routing based on anypath cost.

3 Overview of HCOR

HCOR is a coding-aware opportunistic routing method. It mainly works between Internet Protocol (IP) and media access control (MAC) layers and inserts a coding layer to do the calculation of coding gain and serve the sending and receiving of encoded packets. HCOR adopts the XOR-based coding method. The foundation of HCOR is a distributed system based on anypath routing. As illustrated in Figure 1, HCOR aims to solve whether the network coding should be done and which nodes should be used as the coding nodes to achieve the maximal throughput gain. To realize HCOR, every node will calculate a temporary anypath cost independently for each encoded flow. This temporary anypath cost is surviving on this flow and marks this node with this cost. All flows always choose the lowest anypath cost path as their transmission route. Each potential encoded packet uses opportunistic coding, in which a node aims to achieve the maximal throughput but not maximize the number of network coding in a single transmission. HCOR is also a ‘multihop’ network coding scheme. That means HCOR has the ability of detecting coding opportunities from a multihop network topology. The multihop coding opportunity detection is an extension of local overheard information detection. HCOR uses learning neighbor state which is a guessing method used in COPE for local detection and transmits this neighbor state on the path. So we need a neighbor state maintenance mechanism which is very common in ad hoc routing protocols. If a node makes an incorrect guess occasionally, which possibly causes the encoded packet to be undecodable at decoding nodes, the relevant native packet should be retransmitted to help decode this encoded packet. To make HCOR easy, we leverage routing pre-computation to compute the delivery probability between every pair of nodes and use it to identify link status. Routing pre-computation works before anypath routing. That means the status of all links is known when we begin to do the anypath routing. Before delving into details, we define the terms used in the rest of the paper and list them in Table 1.
Figure 1

Conceptual view of HCOR. A flow f SD is generated from S to D. Assuming a multihop coding structure, node C is a coding node and encodes f SD into other flows. The nodes with red color are other potential coding nodes for f SD . The encoded flow is denoted by f. The blue circle presents the forwarding list of C to D. The red circle presents the decoding set of f to achieve f SD . The decoding set may be smaller than the forwarding list. So the anypath cost of forwarding f SD by the decoding set may be more expensive than that by the forwarding list. The red dashed arrow presents doing network coding. The blue dashed arrow presents forwarding f SD without network coding.

Table 1

Definitions of terms used in this paper



Native packet (flow)

A non-encoded packet (flow)

Encoded packet (flow)

A packet (flow) that is the XOR of multiple native packets (flows)

Virtual native packet (flow)

The native packet (flow) that is XORed in an encoded packet (flow)

Overheard information

The set of nodes which have overheard the native packet (flow)

Coding node

The node which encodes native packets together

Decoding node

The node which decodes the encoded packets

Forwarding lists of an encoded packet

The set of forwarding lists for the virtual native packets

Packet ID

A 32-bit hash of the packet’s IP source address and IP sequence number

Output queue

A FIFO queue at each node to buffer the packets that need to be sent

Packet pool

A buffer where a node stores all packets sent and overheard in the past T seconds

4 Network coding and anypath cost

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 C i p for forwarding packet p at node i by
C i p = c iJ p + C J p ,
where c iJ p is the broadcast cost from i to a forwarding list J, and C J p is the anypath cost of J. According to the ETX metric [33] and assuming that the loss for each link is independent, cost c iJ p can be calculated by
c iJ p = 1 1 j J 1 d ij ,
where d ij is the packet delivery ratio (PDR) from i to j. The remaining anypath cost C J p is defined as a weighted average of the costs of the nodes in forwarding set J by
C J p = j J w ij C j p ,
where the weight w ij is the probability of node j being the relaying node of p from node i and j J w ij = 1 . Let J={1,2,…,n} with anypath cost C 1 p C 2 p C n p , the weight w ij is simplified to
w ij = d ij k = 1 j 1 1 d ik 1 j J 1 d ij .

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 C i J C iJ 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 C1C2≤…≤C k . If Ci(j) is the cost from node i via forwarding set {1,2,…,j}, for 1≤jk, 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 f ij . A path P ij means a set of links connecting node i to node j. We say a flow on a path P ij 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 P ij , we say f cd is distinguishable from f ab on P ij if and only if f cd is not on P ij . 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.


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.


If node m is the decoding node of a virtual native flow f i 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 f j , 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 P ij of flow f ij , we denote the upstream part of P ij 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 O i ( f ) = j U i ( f ) N j { j } , 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 Ω f k f j i = O i f j D i f k , and similarly Ω f j f k i = O i f k D i f j , then f j and f k can be encoded together and the following should hold:
Ω f j f k i · Ω f k f j i 0 .

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.

5 Network coding in anypath routing

After giving the definition of inter-flow network coding, we remain to use the word of network coding instead of inter-flow network coding for clarity. The key question of incorporating NC into anypath routing is how to calculate the anypath cost.

According to characteristics of NC and anypath routing, HCOR mainly overcomes the two following challenges.

  • What nodes should be contained in the forwarding set of a coding node in HCOR?

  • What nodes should be the coding nodes in HCOR?

5.1 Forwarding set of a coding node

In anypath routing, when an intermediate node receives a packet from a flow, only the destination of this packet and the nexthop which implies the neighbors of the coding node can be known as the downstream of this flow. According to the coding condition, the potential decoding nodes of this packet are only from its nexthops and destination. Hence, we have

Theorem 5.1.

In opportunistic transmission (or say anypath transmission), if we denote the forwarding set of a coding node i for a virtual native flow f by J, and the forwarding set of node i for the native flow f by J, we must have JJ.


If the decoding node is the destination, we easily have J=J since all the forwarding nodes just need to forward this packet without doing the decoding. If the decoding node is not the destination, we denote the anypath cost for f at node i by C i and that for f at node i by C i . According to the anypath transmission, we should have
max j J C j C i C i .

In Lemma 4.1, we know that each neighbor j of node i is in the forwarding set J if and only if C j C i . So we have JJ.

5.2 Network coding price in anypath transmission

In this paper, we focus the issues of network coding only on the routing layer. So we study the cost of network coding on the transmission level and ignore the cost on the coding level, such as additional coding header or additional computation for network coding.

From our research, the main network coding price in anypath routing is from the shrinkage of the forwarding set. As illustrated in Figure 2, we consider a case with two-flow network coding. According to the coding condition, because some of the nodes in the forwarding sets J and K may be not the decoding nodes of this encoded flow, the forwarding sets J and K for encoded flow are not equal to J and K possibly. Hence, the forwarding set of each native flow will be changed after doing the network coding. According to Theorem 5.1, the new forwarding sets J and K are the subsets of J and K, respectively. That means, according to the Lemma 4.2, the costs of C J and C K will be greater than or equal to those of C J and C K , respectively. So additional price should be paid by doing network coding in this anypath transmission.
Figure 2

The change of forwarding set after doing network coding. Node i is a relay node. The solid line means unicast, and J and K are the forwarding sets of flow f j and f k with unicast, respectively. The dashed line means broadcast, and J and K are the forwarding sets of f j and f k after doing the network coding, respectively.

Let C i f j , f k be the anypath cost of sending f j and f k at relay i with unicast. Let C i f j , f k be the anypath cost of sending encoded flow f j f k with broadcast, where f j and f j are the virtual native flows of f j and f k , respectively. Based on anypath routing, the anypath cost C i f j , f k can be calculated by
C i f j , f k = C i j + C i k = c iJ + c iK + C J + C K .
Similarly, we define the anypath cost C i f j , f k by
C i f j , f k = c i J , K + C J , K .
Now, the question is which one is more expensive, C i f j , f k or C i f j , f k . To this question, we discuss from two cases. The first case is that the destinations of virtual native flows are the decoding nodes. In this case, the encoded flow will always be decoded finally whatever node is the forwarder. So the forwarding sets J and K are equal to J and K. Due to the ‘free-ride’ transmission of network coding, we know that ci{J,K} is always lower than c iJ +c iK . Hence, C i f j , f k is always more expensive in this case. The second case is that at least one of the destinations is not the decoding node. According to coding condition, decoding nodes are only from the forwarding set or destinations because the downstream is only composed of them in anypath routing. So there may be a forwarding set only composed of the decoding nodes, and we call this decoding forwarding set. The nodes in the decoding forwarding set are called decoding forwarding nodes. Apparently, if destinations are not the decoding nodes, there is no forwarding set which contains both forwarding nodes and decoding forwarding nodes. So in the second case, at least one of the virtual native flows f j and f k has the decoding forwarding set. According to Lemma 4.4, if at least one of J and K is the decoding forwarding set, we have JK=. From this, Equation 8 is transformed to
C i f j , f k = c i J , K + C J + C K .
According to Equation 2 of [34], we have
c i J , K = c i J + c i K c i J c i K c i J + c i K 1 .

Based on the calculation of anypath cost and the above discussion, we know c i J , K < c iJ + c iK and C J + C K C J + C K . Hence, which one of C i f j , f k and C i f j , f k is more expensive is unknown in the second case. In summary, due to the existence of network coding price in opportunistic routing, we should check whether it is worth to do the network coding even if a network coding opportunity is there.

6 HCOR design

In this section, we present the implementation details of HCOR in a practical distributed network system. Some definitions of terms used in the following can be found in Table 1.

6.1 Multihop overheard information

In the previous sections, we have mentioned that HCOR has a multihop coding structure. The key of realizing multihop network coding is to do multihop detection of overheard information (OI). Traditional network coding schemes use local OI detection [18], in which every node gets the OI only from its neighborhood, such as opportunistic listening or learning neighbor states in COPE. We call this local detection for simplicity. As illustrated in Figure 3, local detection misses many coding opportunities in the multihop networks. In [3], authors proposed a multihop OI detection method, say multihop detection for simplicity. Their multihop detection is based on local detection and works in the routing procedure. The OI of a flow is collected by local detection and transmitted with routing control packets to all the nodes on this route. The OI keeps being updated by adding some new OI from each hop. This process can be considered as a combination of two procedures, detecting OI locally and forwarding it to the route. However, this method has two defects. First, it is dependent on the routing procedure. For opportunistic routing methods which have no routing procedure, this method cannot work without routing control packets. Second, this method is not accurate. If the route is not broken but the neighbor nodes of this route have changed, then the OI detected by this method will be not right since the routing update does not begin.
Figure 3

Limitation of local detection in multihop topology. There are two flows f AD and f EG in this multihop topology. Node C is a coding node because ({A,G}, C, {D,E}) can be made as a coding structure of X topology. However, nodes B and F cannot overhear each other. This coding structure cannot be found if local detection is used. Hence, many coding opportunities are missed in this case.

Considering the above problems, HCOR uses each packet itself to piggyback its own OI. Before source node sending a packet, an OI list will be added into the control header of this packet. When a forwarder receives this packet, the OI list will be updated by adding its own OI before forwarding. The cost of inserting an OI list into the control header may be sensitive if we consider a large-scale intensive network. However, compared with broadcasting the receiving reports periodically, our method is still beneficial for reducing the packet collisions and control packet scheduling. In HCOR, every node maintains a neighbor table. Before sending a packet, the node will guess which nodes will overhear this packet from its neighbors. Only the neighbor with high PDR will be chosen (we set 0.7 as the default). If a node makes an incorrect guess occasionally, the relevant native packet should be retransmitted to help decode this encoded packet.

6.2 Virtual flow list

In HCOR, each node maintains a virtual flow list. The virtual flow list records the flows which are passing this node. The format of a virtual flow list is shown in Figure 4. Source and Destination identify a flow uniquely. Coding Flag marks that the virtual flow is a potential encoded flow, or say being an encoded status. Coding Expire is the expired time of this flow being the encoded status. Forwarding List is the temporary forwarding list of this encoded flow. It contains the anypath cost of every potential nexthop and is set to null if no network coding happens. Expire is the expired time of this virtual flow.
Figure 4

Format of virtual flow list.

When a node received the first packet from a new flow, it will create a virtual flow in its virtual flow list. Every following packet from this flow will trigger an update of this virtual flow. There are two different updates for a virtual flow in HCOR. One is normal update which is triggered by every packet from the native flow. In normal update, only the flag of Expire will be reset. The other is coding update which begins only after receiving an ACK packet from a coding node (we will discuss this ACK process in the following section). In the coding update, the Coding Flag will be set to 1, Coding Expire will be reset, and the Forwarding List will be modified. In every node, there is a timer to purge the virtual flow list. The virtual flow will be removed if it is expired. The Coding Flag will be set to 0 if this virtual flow is not being an encoded flow.

6.3 Coding procedure and coding feedback

Whenever a node i receives a new packet p k from flow f k , it executes the coding procedure illustrated in Algorithm 1.

Line 24 implies the coding condition and Lemma 4.4. The costs C i k , j and C i k , j obey Equations 7 and 8. In line 27, we use anypath cost as the judging criteria of network coding. Meanwhile, as we analyzed in Section 5.2, we always do network coding if the decoding node is the destination for each virtual native flow. As mentioned in Section 4.3, this coding procedure only realizes two-flow XORing. For m>2 flow XORing, if the calculation of anypath cost can be expanded to the multiple flow case, it can be realized with greedy strategy by only removing the word ‘native’ in line 5

When node i does the network coding, after sending m encoded packets in a period of time (we set 0.1 s as default in our simulation), an ACK packet is fed back from i to the previous hop of p k . This ACK can be considered as a kind of routing feedback, and we call it coding feedback. Coding feedback contains three attributes in its control header: src, dst, and cost. The src and dst record the source and destination of p k , respectively. The pair of src and dst identifies the flow f k . The cost records the anypath cost of f k after doing network coding. In Equation 8, anypath cost C i k , j is related to both f k and f j . Meanwhile, the gain of network coding is only from one broadcast of the encoded packet p. Hence, we define the temporary anypath cost of f k after doing network coding by
C i k = d j C i k , j d k + d j ,

where d k is the PDR of encoded packet p from i to nexthop k . After the neighbor of i receives this coding feedback, its virtual flow list will be updated. The virtual flow (src, dst) updates its forwarding list by modifying the anypath cost of nexthop i to cost. After doing this, the anypath cost of node i for flow f k is updated to C i k = α C i k + 1 α C i k , where α=1 if 0 < C i k < C i k , and α=0 otherwise. Based on the update of virtual flow list, the nexthops recorded in the virtual flow will be more competitive to achieve a high priority to forward this packet. If network coding disappears, no coding feedback causes no virtual flow update. After reaching the expiration time, virtual flow will be purged, and then the new packet from this flow will be forwarded following its original anypath cost.

6.4 Decoding

In HCOR, every node works in the promiscuous mode and stores all packets sent and overheard by itself in the past T seconds in its Packet Pool. The decoding process happens when an encoded packet arrives at a node and the address of this node is in the decoding. Because we use the XOR coding method, the encoded packet can be decoded only by XORing any of the virtual native packets, such as p1=(p1p2)p2.

7 Experiment results

This section uses a ns-2 simulator to present the performance evaluation. We study the performance of HCOR by comparing with one non-NC scheme and one network coding scheme. The non-NC scheme is just the anypath routing scheme without doing any network coding. The NC scheme is called COOR, which is a kind of coding opportunity-aware OR method and runs on a multihop coding structure. The difference between HCOR and COOR is that COOR does the network coding whenever a coding opportunity happens, while HCOR does network coding only if a gain can be achieved.

In our simulations, all the nodes are set to the promiscuous mode with a modified IEEE 802.11 standard as the MAC protocol which supports the opportunistic transmission. We use User Datagram Protocol (UDP) traffic sources, and all the flows are constant bit rate (CBR), with a fixed packet size of 512 bytes. The transmission range is set to 250 m, and the interference range is set to 550 m with the TwoRayGround propagation model [35].

7.1 Results from illustrative scenarios

We present the performance of HCOR compared with the non-NC scheme in some basic topologies. Firstly, we study the chain topology with bidirectional flows shown in Figure 5a.
Figure 5

Illustrative scenarios. (a) Chain topology. (b) X topology. (c) Multihop topology.

We set all links with a fixed PDR. Two symmetrical loads have the same rate from A to B and B to A, respectively. The measurements of average end-to-end throughput are plotted in Figure 6. The throughput gain is about 23% after symmetrical load running in the saturation levels shown in Figure 6a. The reason why HCOR and non-NC have different variation trends in Figure 6b is because the relay node in non-NC suffers from bottleneck, and hence, the bandwidth of its output links will be saturated when the loads keep increasing. In HCOR, the relay node mixes the two flows together and sends this mixture as one flow. So the rate of output is always lower than that of input. If input and output links have the same bandwidth, there is no bottleneck problem in HCOR because output links are always starved.
Figure 6

End-to-end throughput performance in chain topology. (a) Throughput performance with a fixed PDR of 0.8 and varying loads from 10 kb/s to 1 mb/s. (b) Throughput performance with fixed loads of 400 kb/s and varying PDR from 0.3 to 1.

Next, we study X topology shown in Figure 5b. The measurement results are plotted in Figure 7. We can see that the throughput gain is still significant and about 21% in X topology. Different from the chain scenario, there are overhearing links in the X scenario. In our simulation, we set the threshold of guessing a successful overhearing to 0.7 as default. That means a node guesses one of its neighbors can overhear the packets it sends if the PDR from it to this neighbor is more than 0.7. Hence, we can see that the performance of HCOR and non-NC is similar when PDR is no more than 0.7 in Figure 7b. After that, a gain can be achieved by HCOR.
Figure 7

End-to-end throughput performance in X topology. (a) Throughput performance with a fixed PDR of 0.8 and varying loads from 10 kb/s to 1 mb/s. (b) Throughput performance with a fixed rate of 400 kb/s for each load and varying PDR from 0.3 to 1.

At last, a simple multihop scenario is studied to present the multihop structure of HCOR. This multihop topology is shown in Figure 5c. We plot the simulation results in Figure 8. The gain of HCOR is not as much as the above two scenarios. The reason may be the gain from bottleneck is diluted by bandwidth consumption from multihop transmission. But we can still have more than 10% gain for total end-to-end throughput over non-NC. In Figure 8b, HCOR almost always has a gain over non-NC because multihop topology has multiple coding structure, such as (A, B, C), (G, F, C), and ({B,E}, C, {F,D}), where (A, B, C) and (G, F, C) are not affected by the overhearing links.
Figure 8

End-to-end throughput performance in multihop scenario. (a) Throughput performance with a fixed PDR of 0.8 and varying loads from 10 kb/s to 1 mb/s. (b) Throughput performance with a fixed rate 400 kb/s for each load and varying PDR from 0.3 to 1.

7.2 Results from specific scenarios

In this section, we want to present how flexible HCOR is. We aim to point out the benefit of HCOR compared with COOR. To do this, we design two specific scenarios. One is cellular scenario with a hexagon topology. The other is diamond scenario with a double-diamond topology.

As shown in Figure 9a, there are seven nodes and two flows f23 and f65 with the same rate in the cellular scenario. The PDR of links (2,1), (2,4), (1,3), (6,7), (6,4), and (7,5) is set to 0.8. The PDR of links (4,1) and (4,7) is set to 0.4. The PDR of links (4,5) and (4,3) is set to 0.5. The PDR of links (2,5) and (6,3) is set to 1. The potential forwarding nodes for f23 are nodes 1 and 4. The potential forwarding nodes for f65 are nodes 7 and 4. Apparently, there is a coding opportunity at node 4 because the overhearing links (2,5) and (6,3) have very good quality. But the output links of node 4 are very poor. So intuitively, it seems that there is no gain for doing network coding at node 4. The simulation results plotted in Figure 9b demonstrate that our intuition is correct. COOR shows a poor performance in this scenario and has about 30% lower throughput gain than HCOR.
Figure 9

Cellular scenario. (a) Hexagon topology. (b) Throughput performance.

In the Figure 10a, we present a diamond scenario with two symmetrical loads f67 and f21. The PDR of links (5,7), (2,5), (6,3), and (3,1) is set to 0.9. The PDR of links (6,4), (2,4), (4,7), and (4,1) is set to 0.7. The PDR of links (4,5) and (4,3) is set to 0.63. According to anypath routing, node 5(3) is the forwarder of node 4 for flow f67(f21) since node 5(3) has better PDR to the destination than node 4. The structure composed of 6, 3, 4, 2, and 5 is a basic coding structure of X topology. So there is still a coding opportunity at node 4. The simulation results show that there is no coding gain in this scenario. The performance of COOR is 28% lower than that of HCOR.
Figure 10

Diamond scenario. (a) Double-diamond topology. (b) Throughput performance.

7.3 Results from random scenario

At last, we consider the performance of HCOR in a larger random mesh network. We construct ten 50-node random topologies with size 1,000 × 1,000 and 20 random loads for each topology. All these loads have random sources and destinations with the same rate and random time of duration. The PDR of all links in these topologies is set to the ‘lowest bound PDR’, which means the PDR of every link is set randomly but higher than the lowest bound PDR value. We compare HCOR with COOR and plot the average throughput performance of these ten topologies in Figure 11. We first set the lowest bound PDR to 0.6 and show the throughput performance with increasing loads in Figure 11a. The results show that HCOR has more than 25% gain over COOR in this case. In another case, we vary the lowest bound PDR from 0.3 to 1 and use a fixed load rate of 400 kb/s. The throughput performance of the second case is shown in Figure 11b. We can see that the gain of HCOR is 13% higher than that of COOR, and the promotion is obvious between 0.5 to 0.8 of PDR.
Figure 11

Throughput performance of random scenario. (a) Throughput vs. offered loads. (b) Throughput vs. PDR.

8 Conclusion

In this paper, we proposed a novel coding-aware opportunistic routing scheme HCOR. We study the characteristic of incorporating NC into opportunistic routing and figure out some conclusions to help design a coding-aware opportunistic routing. Taking advantage of anypath cost, we give a computing method to calculate network coding cost in opportunistic transmission. Based on the above study, we design a distributed routing scheme to realize HCOR, which considers the multihop coding structure in the design. We implement the HCOR scheme in ns-2 and carry out extensive simulations to show the good performance of HCOR. The property of our work may be useful for future coding-aware opportunistic routing design; in particular, our work leaves wide open on the design of coding-aware opportunistic schemes with encoding of more than two native flows together.


a Some also call it inter-session network coding.

b In the following of this paper, we simplify C i p to C i if we do not emphasize the packet or flow in the calculation of anypath cost.



This work is financially supported by National Natural Science Foundation of China under grant numbers 61301130, 61401059, 61303210, and 61172058; the Fundamental Research Funds for the Central Universities under grant numbers DUT13JS09 and DUT14QY04; and the Specialized Research Fund for the Doctoral Program of Higher Education of China under grant number 20120041110011.

Authors’ Affiliations

Faculty of Electronic Information and Electrical Engineering, DUT


  1. Ahlswede R, Cai N, Li SYR, Yeung RW: Network information flow. IEEE Trans. Inf. Theory 2000, 46(4):1204-1216. 10.1109/18.850663MathSciNetView ArticleMATHGoogle Scholar
  2. Chachulski S, Jennings M, Katti S, Katabi D: Trading structure for randomness in wireless opportunistic routing. In Proc. of ACM SIGCOMM’07,. Kyoto, Japan,; 27–31 August 2007)Google Scholar
  3. Le JL, Lui JCS, Chiu DM: DCAR: distributed coding-aware routing in wireless networks. IEEE Trans. Mobile Comput 2010, 9(4):596-608.View ArticleGoogle Scholar
  4. Guo B, Li HK, Zhou C, Cheng Y: Analysis of general network coding conditions and design of a free-ride-oriented routing metric. IEEE Trans. Vehicular Technol 2011, 60(4):1714-1727.View ArticleGoogle Scholar
  5. Yan Y, Zhang BX, Zheng J, Jian M: CORE: a coding-aware opportunistic routing mechanism for wireless mesh networks [accepted from open call]. IEEE Wireless Commun 2010, 17(3):96-103.View ArticleGoogle Scholar
  6. Benfattoum Y, Martin S, Al K Agha: IROCX: interference-aware routing with opportunistically coded exchanges in wireless mesh networks. In Wireless Communications and Networking Conference (WCNC) 2011 IEEE.. (Quinyana-roo, Mexico; 28–31 March 2011:1113-1118. doi:10.1109/WCNC.2011.5779287View ArticleGoogle Scholar
  7. Lin YJ, Huang CC, Huang JL: PipelineOR: a pipelined opportunistic routing protocol with network coding in wireless mesh networks. In IEEE 71st Vehicular Technology Conference, VTC 2010-Spring. Taipei, Taiwan; 16–19 May 2010:1-5. doi:10.1109/VETECS.2010.5494225Google Scholar
  8. Yan Y, Zhang BX, Mouftah HT, Ma J: Practical coding-aware mechanism for opportunistic routing in wireless mesh networks. In IEEE International Conference on Communications, ICC ‘08. Beijing, China; 19–23 May 2008:2871-2876. doi:10.1109/ICC.2008.541View ArticleGoogle Scholar
  9. Laufer R, Dubois-Ferrière H, Kleinrock L: Polynomial-time algorithms for multirate anypath routing in wireless multihop networks. IEEE/ACM Trans. Netw 2012, 20(3):742-755.View ArticleGoogle Scholar
  10. Agarwal A, Charikar M: On the advantage of network coding for improving network throughput. In IEEE Information Theory Workshop, ITW ‘04. San Antonio, TX, USA; 24–29 Oct 2004:247-249. doi:10.1109/ITW.2004.1405308View ArticleGoogle Scholar
  11. Chi KK, Jiang XH, Horiguchi S: Network coding opportunity analysis of cope in multihop wireless networks. In IEEE Wireless Communications and Networking Conference. WCNC 2008,. Las Vegas, NV, USA; 31 March – 3 April 2008:2858-2863. doi:10.1109/WCNC.2008.500View ArticleGoogle Scholar
  12. Koetter R, Medard M: An algebraic approach to network coding. IEEE/ACM Trans. Netw 2003, 11(5):782-795. 10.1109/TNET.2003.818197View ArticleGoogle Scholar
  13. Jaggi S, Sanders P, Chou PA, Effros M, Egner S, Jain K, MGM L: Polynomial time algorithms for multicast network code construction. IEEE Trans. Inf. Theory 2005, 51(6):1973-1982. 10.1109/TIT.2005.847712View ArticleMathSciNetMATHGoogle Scholar
  14. Effros M, Tracey H, Sukwon K: A tiling approach to network code design for wireless networks. In IEEE Information Theory Workshop, 2006. Punta del Este, Uruguay; 13–17 March 2006:62-66. doi:10.1109/ITW.2006.1633782View ArticleGoogle Scholar
  15. Baidas M, MacKenzie A: Many-to-many space-time network coding for amplify-and-forward cooperative networks: node selection and performance analysis. EURASIP J. Wireless Commun. Netw 2014(1): 48 (2014). doi:10.1186/1687-1499-2014-48Google Scholar
  16. Nabaee M, Labeau F: Quantized network coding for correlated sources. EURASIP J. Wireless Commun. Netw 2014(1): 40 (2014). doi:10.1186/1687-1499-2014-40Google Scholar
  17. Lv T, Li S, Geng W: Combining cooperative diversity and network coding in uplink multi-source multi-relay networks. EURASIP J. Wireless Commun. Netw 2013(1): 241 (2013). doi:10.1186/1687-1499-2013-241Google Scholar
  18. Katti S, Rahul H, Wenjun H, Katabi D, Medard M, Crowcroft J: XORs in the air: practical wireless network coding. IEEE/ACM Trans. Netw 2008, 16(3):497-510.View ArticleGoogle Scholar
  19. Le JL, Lui JCS, Chiu DM: On the performance bounds of practical wireless network coding. IEEE Trans. Mobile Comput 2010, 9(8):1134-1146.View ArticleGoogle Scholar
  20. Khreishah A, Khalil I, Ostovari P, Wu J: Flow-based XOR network coding for lossy wireless networks. IEEE Trans. Wireless Commun 2012, 11(6):2321-2329. doi:10.1109/TWC.2012.041912.112105View ArticleGoogle Scholar
  21. Wu Y: Broadcasting when receivers know some messages a priori. In IEEE International Symposium on Information Theory, ISIT 2007. Nice, France; 24–29 June 2007:1141-1145. doi:10.1109/ISIT.2007.4557377View ArticleGoogle Scholar
  22. Wang CC: On the capacity of wireless 1-hop intersession network coding: a broadcast packet erasure channel approach. IEEE Trans. Inf. Theory 2012, 58(2):957-988.View ArticleMathSciNetGoogle Scholar
  23. Amerimehr MH, Ashtiani F: Delay and throughput analysis of a two-way opportunistic network coding-based relay network. IEEE Trans. Wireless Commun 2014, 13(5):2863-2873.View ArticleGoogle Scholar
  24. Yang A, Fei ZS, Xing CW, Xiao M, Yuan JH, Kuang JM: Design of binary network codes for multiuser multiway relay networks. IEEE Trans. Vehicular Technol 2013, 62(8):3786-3799.View ArticleGoogle Scholar
  25. Jhang MF, Lin SW, Liao WJ: C2AR: coding and capacity aware routing for wireless ad hoc networks. In IEEE International Conference on Communications (ICC’10). Cape Town, South Africa; 23–27 May 2010:1-5. doi:10.1109/ICC.2010.5502401View ArticleGoogle Scholar
  26. Xie LF, Chong PHJ, Liew SC, Guan YL: CEO: consistency of encoding and overhearing in network coding-aware routing. IEEE Wireless Commun. Lett 2(2013):187-190. doi:10.1109/WCL.2012.122612.120770Google Scholar
  27. Sengupta S, Rayanchu S, Banerjee S: An analysis of wireless network coding for unicast sessions: the case for coding-aware routing. In 26th IEEE International Conference on Computer Communications, INFOCOM 2007. Anchorage, AK; 6–12 May 2007:1028-1036. doi:10.1109/INFCOM.2007.124View ArticleGoogle Scholar
  28. Johnson DB, Maltz DA: Dynamic source routing in ad hoc wireless networks. The Kluwer Int. Series in Eng. Comput. Sci. Mobile Comput 1996, 353: 153-181. 10.1007/978-0-585-29603-6_5View ArticleGoogle Scholar
  29. Li P, Guo S, Yu S, Vasilakos A: Reliable multicast with pipelined network coding using opportunistic feeding and routing. IEEE Trans. Parallel Distributed Syst 2014, PP(99):1-1. doi:10.1109/TPDS.2013.2297105Google Scholar
  30. Chen T, Zhong S: An enforceable scheme for packet forwarding cooperation in network coding wireless networks with opportunistic routing. IEEE Trans. Vehicular Technol PP(2014):1-1. doi:10.1109/TVT.2014.2312171Google Scholar
  31. Aajami M, Park H-R, Suk J-B: Combining opportunistic routing and network coding: a multi rate approach. In IEEE Wireless Communications and Networking Conference, WCNC 2013. Shanghai, China; 7–10 April 2013:2208-2213. doi:10.1109/WCNC.2013.6554904View ArticleGoogle Scholar
  32. Iqbal MA, Dai B, Huang B, Hassan A, Yu S: Survey of network coding-aware routing protocols in wireless networks. J. Netw. Comput. Appl 2011, 34(6):1956-1970. 10.1016/j.jnca.2011.07.012View ArticleGoogle Scholar
  33. Couto D, Aguayo D, Bicket J, Morris pR: A high-throughput path metric for multi-hop wireless routing. In Proc. of the 9th Annual International Conference on Mobile Computing and Networking, MobiCom ‘03. San Diego, USA; 14–19 Sept 2003:134-146.View ArticleGoogle Scholar
  34. Ni B, Santhapuri N, Zhong ZF, Nelakuditi S: Routing with opportunistically coded exchanges in wireless mesh networks. In 2nd IEEE Workshop on Wireless Mesh Networks, WiMesh 2006. Reston, VA, USA; 25–28 Sept 2006:157-159. doi:10.1109/WIMESH.2006.288636View ArticleGoogle Scholar
  35. Yang T, Mino G, Barolli L, Durresi A, Xhafa F: Comparison evaluation for mobile and static sensor nodes in wireless sensor networks considering tworayground and shadowing propagation models. In 14th International Conference on Network-Based Information Systems, NBiS 2011. Tirana, Albania; 7–9 Sept 2011:186-193. doi:10.1109/NBiS.2011.35View ArticleGoogle Scholar


© Hai et al.; licensee Springer. 2014

This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly credited.