1 Introduction

In recent years, video streaming over wireless networks has become more popular due to advances in network access technologies [1]. More than 400 million mobile gadgets (e.g. Smartphones) which will account for a large amount of mobile video traffic by 2014 is a convincing reason for this assertion. Mobile video traffic will increase from 52 to 70 % of total mobile traffic by 2016 [2]. However, contention, interference, collision, node mobility and limited available bandwidth in wireless networks cause low video quality on these gadgets [3]. Analyzing the performance and the limitations of the previous solutions, we can conclude that an efficient video streaming application in a wireless network should consider the following four important points: bandwidth utilization, network communication, video streaming method and reliable wireless infrastructure.

Bandwidth utilization can be improved using an efficient video compression standard such as the H.264/MPEG-4 (Moving Picture Experts Group) [4]. Using this popular standard, the video encoder applies compression rules on video frames before arranging them into GoPs (Groups of Pictures). Figure 1 depicts a GoP based on the G12B2 structure including 12 frames with two B frames between frames I and P. I-Frame (Intra-frame) can be independently decoded because it is a reference frame. A P-frame can be decoded only when a previous frame I/P is successfully received and decoded. In contrast to P-frame, successful decoding of a B-frame requires the correct decoding of the previous and the following frames I/P. Although employing an efficient video compression standard permits nodes to consume less amount of bandwidth, existing decoding dependencies among video frames in a GoP can degrade the video quality [5]. For example, a node cannot playback a successfully received B-frame if the previous or the following frame I/P is not received yet. This increases video distortion which leads to low video quality.

Fig. 1
figure 1

A GoP consists of twelve frames (G12B2)

An efficient network communication approach which increase cooperation among nodes can reduce the effects of this problem on the perceived video quality [6]. In contrast to client–server and content delivery networks (CDNs) approaches [7], peer-to-peer (P2P) overlay networks [810] efficiently support this requirement [11]. Each peer in a P2P overlay not only playbacks video stream, but it also helps its neighbors by transferring existing video frames in its buffer to them simultaneously. In this regard, a peer can easily receive a missed video frame from its nearest neighbor in the overlay instead of requesting from the video source. This not only reduces end-to-end delay and required upload bandwidth in video source side, but it also decreases the amount of the exchanged traffic in the network which is very important in wireless communications. There are two types of P2P networks including Tree and Mesh. Mesh-based P2P network, contrary to Tree-based topology, provides high network throughput and is more resilient in peer churning [12]. Recently, P2P streaming has been of great interest among researchers and users in which many real-world P2P streaming systems such as [1317] are introduced.

Although mesh-based P2P networking can degrade the effects of decoding dependency on the video quality, a peer can be concurrently downloaded from more than one upstream peer and serve many downstream peers. In this regard, there are always risks that peers receive the same content from their neighbors. Therefore, they need to make the content held by different upstream peers consistent before downloading. This refers to content reconciliation which wastes the limited available bandwidth in peers. Random network coding (RNC) [18] efficiently addresses this issue in a P2P streaming system, because it omits the need for content reconciliation among peers [19]. Moreover, RNC noticeably increases the network resilience in peer churning [20]. Many recent studies such as [1, 2123] have shown that network coding [24], particularly RNC, efficiently improves the video quality on nodes. Using RNC, each video frame can be divided into some segments, each of them further divided into \(n k\)-byte original blocks. Then, the RNC-Encoder arranges \(n^{2}\) random values in a coefficient matrix and generates \(n k\)-byte encoded blocks as we discussed in our previous study [25]. A receiver can successfully decode a segment if it receives \(n\) linearly independent encoded blocks. Based on the findings of recent studies such as [26, 27], although RNC efficiently exploits the broadcast nature of wireless medium and addresses the highlighted guidelines to mitigate the side effects of wireless channels and P2P communications, it is impossible to ignore the effect of the employed wireless infrastructure on the perceived video quality. A stable and reliable topology is required to mitigate the dynamic conditions of wireless networks.

Wireless mesh networks (WMNs) are introduced to fulfill this requirement as they are employed in some recent real-world projects such as Guifi [28], AWMN [29] and FunkFeuer [30]. WMNs is similar to P2P network in some aspects such as routing, forwarding and peer churning [31]. Hence, they can prepare many features for improving the performance of peer-to-peer applications over them by providing routing and forwarding algorithms like P2P networks. High resilience in peer churning, reliable coverage area due to multi-hop forwarding technique, easier maintenance and better network throughput are other benefits of using WMNs as an infrastructure network in P2P live video streaming [31]. Consequently, using P2P networks over WMN improves the overall performance of the network for many applications, especially video streaming in large network sizes [32]. This removes the necessity of applying some changes in the underlying network to adopt it to the employed video streaming application in the overlay [33]. Self-healing, self-configuration, low up-front cost, easy network maintenance and robustness in peer churning are the most important characteristics of WMNs [34, 35]. There are three different classifications of WMNs including client-based, infrastructure and hybrid, however, hybrid WMNs are more flexible and realistic in their implementation [36]. This is due to this fact that they can include mobile mesh nodes with multi-hopping capability and STA nodes. Nodes in a hybrid WMN can be connected to each other in case of near distance (one hop-count) and through mesh routers in case of long distance. This lets the network become more scalable. Moreover, because of multi-hopping and less infrastructure cost, video streaming over hybrid WMNs is more reasonable. Actually, it could be adapted to potential extensions of the users that a WMN has. A hybrid WMN consists of two types of devices including Mesh Routers (MRs) and Mesh Clients (MCs) [37, 38]. Mesh routers form a stable wireless topology in the backbone. Depending on the capabilities of the mesh clients, we can differentiate between mesh and STA nodes. STA nodes, which do not perform any routing or forwarding operation, are directly connected to MRs, and have low speed (e.g. pedestrians). Moreover, they can be stationary for a random time. Mesh nodes are constantly moving with higher speed and are able to perform routing and forwarding.

What can be inferred from this section is that P2P live video streaming over hybrid WMNs using RNC can provide good video quality on mobile mesh and STA nodes, because all four points are considered in such an efficient system. However, there are some challenges in efficient video streaming using RNC which need to be addressed. Next section categorizes these challenges and their effects on the perceived video quality on wireless nodes, especially small gadgets (e.g. Smartphones and iPods). Our previous work shows that MATIN framework [25] efficiently addresses these challenges for high quality P2P live video streaming over wired mesh networks. However, this study adopts MATIN framework for P2P live video streaming over hybrid WMNs as follows. To the best of our knowledge, employing RNC for disseminating live video stream in a P2P overlay over hybrid WMN is not precisely and completely studied yet. Therefore, findings of this research not only can show the efficiency of RNC in this type of wireless network, but they also help researchers to find better solutions for adapting RNC with WMNs and P2P networks characteristics in future deployments. We equipped MRs and mesh nodes with a distributed locator for answering the important question of which STA node is connected to which MR. This lets a hybrid WMN support more STA nodes without imposing additional routing overhead. MATIN includes a novel coefficient matrix generation and inversion method that overcomes the existing challenges in the conventional RNC. In this regard, we evaluate and compare MATIN with the conventional RNC using a precise simulation in OMNeT++ [39]. The results show that MATIN considerably increases the perceived video quality on wireless nodes in a hybrid WMN by improving video distortion, frame dependency distortion, initial start-up delay, and end-to-end delay metrics.

The rest of the paper is organized as follows. Section 2 discusses the problem statement. Sections 3 and 4 explain proposed solutions in previous studies and MATIN framework, respectively. The evaluation of this framework in P2P live video streaming over hybrid WMNs is presented in Sect. 5 using the OMNeT++ simulator. Finally, the paper is concluded in Sect. 6.

2 Problem Statement

The suitability of RNC in a wireless network is mainly due to its ability to efficiently address the link breakage [26] and wireless packet retransmission problems [40]. Unfortunately, RNC introduces new challenges. In the following, we categorize them and explain the effects of these issues on the perceived video quality on wireless nodes.

The existence of linear dependency among received coefficient vectors is a problem which can decrease the number of innovative video blocks in receivers [41, 42]. Therefore, receivers need to send additional request for receiving a missed encoded block. Obviously, each additional transmission in wireless networks can increase the amount of interference, collisions, and resource consumption. Moreover, the performance of RNC is negative when less than 66 % of original blocks in a segment are selected for encoding. This is due to this fact that linear dependency can frequently occur among them [43].

RNC imposes high transmission overhead on the system due to attaching large coefficient vectors to the encoded blocks. Therefore, wireless nodes not only should assign more upload bandwidth for transmitting the video blocks to others, but they also have to perform more transmissions which lead to more interference in the network. Using aggregation approach, more packets need to be transmitted. On the other hand, without packet aggregation, large packet size are more likely to be corrupted. In both cases, video interference increases which results in higher video distortion and lower video quality. Aggregation is an encapsulation technique in which each packet can include more than one video encoded block. In addition, nodes need higher power batteries if large headers attach to the encoded blocks.

By employing the Gauss–Jordan elimination method [44] in the decoding step, considerable computational complexity can be imposed on a wireless node. These wireless gadgets (e.g. Smartphone and IPod) are obliged to perform many arithmetic operations when they employ RNC [45, 46]. Therefore, they need more powerful central processing units (CPUs) and cannot efficiently assign more CPU time to other running tasks. Moreover, the execution of these operations incur battery consumption. It is worth noting that one of the most important issues in wireless communication is the energy consumption of wireless devices [46, 47]. For example, encoding and decoding processes consume 33 % of battery energy in iPod Touch 2G [48].

Altogether, these challenges noticeably degrade the performance of RNC in video streaming over WMNs which also have mobile devices. Thus, current RNC in use does not seem appropriate for operation in wireless gadgets. As a result, it is necessary to address existing challenges in RNC for efficient video streaming over WMNs. In addition to video streaming and file sharing applications, recent studies have employed RNC in wireless networks for other purposes such as multicast routing [26], multiple unicast sessions in multi-channel/multi-interface networks [49], fault-tolerance routing [27] and packet retransmission problem in multiple channel networks [40]. Each of these applications can undoubtedly experience better performance if existing challenges in RNC can be addressed.

3 Related Work

Encoding and decoding processes in RNC are explained in our previous study (MATIN). Based on these processes and previous section, there are some open issues in RNC. Recent studies proposed some solutions to cope with the decoding computational complexity and the linear dependency problem in RNC as follows:

  1. 1.

    In order to decrease the linear dependency probability in receivers, the finite field size \(m\) can be increased. The parameter \(m\) in \(\hbox {GF}(2^{m})\) is an integral value which is usually set to 8. In fact, it is possible to select random values from a larger range when the value of \(m\) augments. For example, considering \(m=8\) and \(m=16\), it is possible to select random values from range [0.255] and [0.65535], respectively. Therefore, the probability of linear dependency between two coefficient vectors can be decreased. Although large values of \(m\) can increase the decoding probability to close to 1, the consumed amount of bandwidth and the imposed computational complexity in encoding/decoding step sharply increase [42]. Moreover, the necessity of checking linear dependency remains.

  2. 2.

    Previous studies proposed four different solutions for addressing the decoding computational complexity issue in RNC. The first solution is to reduce the packet batch size \((n)\). Actually, this solution tries to reduce decoding computational complexity by decreasing the number of encoded blocks. Although this action results in lower computational complexity and transmission overhead, the size of the encoded blocks \((k)\) increases, because the segment size does not change. To make this clearer, suppose that there is a 1,000 byte segment. Block size will be 100 and 200 bytes when we divides this segment into ten and five blocks, respectively. Actually, larger block sizes are expected to be more prone to errors and end-to-end delay in wireless transmissions [50]. Moreover, this solution considerably reduces the main advantages of RNC which are higher network throughput and frame diversity in the network [51]. As the second solution, a sparse matrix, which is a matrix that contains a high number of zeroes in its coefficients vectors, is also proposed [52]. Although coding is using this matrix, the SPARSITY problem [53] of finding such a matrix is an NP-complete problem. The imposed complexity of this method is very high and equals \(\hbox {O}(n^{N}(nN^{2}))\) where \(N\) is the number of nodes. In mathematics, the \(O\) notation (big-O) can describe the limiting behavior of a function when the considered variable tends toward infinity or a particular value. The mathematical definition of big-O is as follows [54]. Suppose that \(T(t)\; (T(t)>0, \forall \;t)\) is the execution time of an algorithm with \(t\; (t>0)\) input data. Based on [37, “T(t) is O(f(t)) if it is at most a constant multiplied by f(t) with the exception of some values of t”. Suppose that \(f(t)\) can be defined as a function over positive values of \(t\), in this regard,

    $$\begin{aligned} \hbox {T}(\hbox {t}) \hbox {is O}(\hbox {f}(\hbox {t})) \leftrightarrow \exists \hbox {t}_{\mathrm{o}}, \hbox {c} > 0: \forall \hbox { t} \ge \hbox {t}_{\mathrm{o}}\hbox {T}(\hbox {t}) \le \hbox {cf}(\hbox {t}) \end{aligned}$$

    As the third solution, some previous studies employed parallel decoding algorithms [55, 56] or graphical processing unit (GPU) feature [57] for increasing the Gauss–Jordan elimination decoding speed. These methods consume considerable battery energy sources on nodes. Based on the fact that energy consumption is one the most important concerns in wireless communication, it cannot be considered as an efficient solution [42]. Moreover, some gadgets are not equipped with multi-core or GPU capability. Finally, another study introduces a strategy for applying RNC on those packets which can be more useful for others [58]. Using this strategy, each node has a set of values \((N, i, o)\) in which \(N\) is the current node and \(i\)/\(o\) are the number of input/output links of node \(N\). Node \(N\) can perform network coding if \(i\ne 0, o\ne 0\), and \(i>\mathrm{o}\). Although it slightly decreases the overall complexity of RNC, the performances of their method can be affected by time-varying channels in WMNs. Moreover, analyzing the proposed strategy in each node may outweigh the saving in CPU power and processing time.

The fact is that none of these solutions tackles the transmission overhead problem which is the most important open issue in efficiently using RNC in wireless communications. Next section introduces MATIN as a RNC based framework for efficiently and effectively addressing existing challenges in RNC in which it can be more useful for wireless networks.

4 Matin Framework

4.1 Overview

MATIN is a framework that simplifies the requirements for the execution of RNC. MATIN has some features that make it appropriate for WMNs as explained in sections A.2 to A.4 in our previous study [25]. Particularly, a wireless mesh network and its attached gadgets can benefit from the MATIN’s characteristics in the following ways.

  1. 1.

    By avoiding the linear dependency among the coefficient vectors, no additional request will be sent for retransmitting a successfully received encoded block in which its coefficient vector is in linear dependency with another coefficient vectors of an encoded block. This is due to this fact that the packet innovation can be increased and no retransmission due to the linear dependency between the two received encoded blocks is required. Moreover, wireless nodes can generate encoded blocks using any number of existing original blocks of a segment. This can be very important for wireless nodes, because end-to-end delay is an important parameter in video streaming over a WMN. In this case, better video quality is expected to be provided on receivers.

  2. 2.

    The transmission overhead due to sending large coefficient vectors is sharply reduced. The less the transmission overhead is, the fewer the transmissions. Thus, wireless nodes can assign a large portion of their upload/download bandwidth for sending/receiving encoded video blocks to/from other nodes. The availability of the wireless medium will report in a decrement of the number of collisions and amount of interference, which in turn, will improve the network performance. It is worth noting that the wireless medium is associated with a more reduced bandwidth in comparison with wired connections.

  3. 3.

    Finally, wireless nodes experience very low decoding computational complexity. Therefore, the necessity of employing powerful CPU in gadgets can be completely ignored. In addition, these gadgets do not need high battery energy sources.

MATIN is introduced for efficiently addressing these open issues. In summary, previous studies showed that RNC noticeably outperforms traditional streaming method by increasing perceived video on receivers. However, there are open issues in RNC which are mentioned by these studies. By addressing these open issues, RNC can be more applicable and useful in wireless communications as follows:

  1. 1.

    Gadgets (e.g. Smartphones) with low CPU processing power can easily exploit the advantages of RNC using low battery energy sources, because MATIN sharply reduces the imposed decoding computational complexity. Therefore, these nodes can save their battery energy sources for running other running applications.

  2. 2.

    The necessity of checking any linear dependency in the generated coefficients matrix in RNC can be completely removed if RNC uses the MATIN rules in coefficient matrix generation step. This increases the number of innovative video blocks in the network which results in less video distortion. Therefore, better video quality can be provided.

  3. 3.

    The imposed transmission overhead due to attaching large coefficient vectors to the encoded block in RNC can be sharply reduced, because just one instead of \(n\) bytes is attached as header to each encoded block. This decreases the packet length. Therefore, more video blocks can be embedded in a packet which results in fewer transmissions and less interference in WMNs. Network throughput can be also increased. In summary, better video quality can be provided in a wireless network by addressing transmission overhead issue in RNC.

4.2 Adapted MATIN Framework for WMNs

Figure 2 shows the MATIN framework which is consists of some components in two tiers. Using this framework P2P overlay is generated over the underlying hybrid WMN. Therefore, in the rest of this paper, a node can be defined as a peer and refers to both mesh and STA nodes. In this framework,

Fig. 2
figure 2

The proposed framework

  1. 1.

    Dashed and solid lines refer to the control messages and data streams, respectively.

  2. 2.

    The H.264/MPEG media player not only generates GoPs before sending them for storing in the buffer, but it also decodes the received video frames from the buffer for replay using media player software installed on gadgets.

  3. 3.

    The RNC-Encoder divides the received video frames from the buffer into some segments (e.g. 1 s video length). Each segment can be divided into \(n k\)-byte video original blocks. Padding is allowed for the last segment. Padding means a peer adds zero bits to the end of the last segment to make its size the same as others (if necessary). This component sends the value of \(n\) to the coefficient matrix generator component for generating the coefficient matrix \(C_{n\times n}\). All \(n k\)-byte video encoded blocks can be produced as soon as RNC-Encoder receives matrix \(C_{n\times n}\) (see Eq. 1 in [25]). It is necessary to be pointed out that each intermediate node can re-encode the received packets prior to sending them using the proposed coefficient matrix generation method. In this regard, the receiver first decodes the re-encoded blocks. Then, the original blocks can be decoded.

  4. 4.

    Upload and download managers are responsible for transferring and receiving encoded blocks to and from neighbors, respectively. They employ first-in-first-out (FIFO) queue.

  5. 5.

    RNC-Decoder progressively starts decoding process as soon as the first encoded blocks receives. The inverted coefficient matrix component receives the extracted coefficient entry from the header and generates the related coefficient vector as we showed in our previous study [25]. Finally, the decoded video segment can be sent to the buffer. The buffer manager generates video frames based on the received decoded video segments. As discussed in our previous study, the coefficient matrix generator component generates and inverts coefficients matrix \(C_{n\times n}\) using the proposed novel method in [25].

  6. 6.

    All operations related to peer joining, leaving and churning are handled by the peer manager. When a peer joins the network, it receives a partial list of the existing peers in the overlay from a Tracker server based on the model introduced in [59]. Then, it sends a connection request to some of these peers randomly and establishes its connection with them as its neighbors.

  7. 7.

    The fact is that most of the nodes in a WMN are STA so it is necessary to efficiently support them. In other words, a routing protocol in a hybrid WMN needs to know to which mesh router a STA node is attached [60]. We design an efficient distributed locator service for this purpose. Each MR and mesh node keeps a localization table including the addresses of STA nodes. Each record of this table indicates which STA node is connected to which MR. We implemented this service as an agent in the 802.11s mesh module. Suppose that STA node 5 moves from MR1 to MR2. The following steps will be run as soon as MR2 finds that STA 5 is under its coverage area:

    • It reactively alerts other MRs in the backbone and all mesh nodes under its coverage area by broadcasting the address of STA 5 to them. Each broadcasted message includes a unique sequence number. Therefore, there is no infinite loop in the network, because each MR will discard a duplicate message.

    • A MR or mesh node updates its localization table as soon as a new update message for STA 5 is received.

    • Now, MR2 is responsible for replying to the RREQ (Route Request) message on behalf of STA 5. As MR1 receives alert message from MR2, it can immediately redirect a received packet for STA 5 to MR2 if the sender has not informed about this change yet.

There are many advantages in employing the localization tables as follows:

  • Hybrid WMN can support many STA nodes, because forwarding table is independent of their number. It is recognized that STA nodes (e.g. Smartphones, Laptops, or Tablets) are not efficiently supported by current WMNs.

  • Without this service, it is necessary to exchange many RREQ and RREP (Route Reply) messages for finding the location of a STA node. This imposes high routing overhead which depends on the number of STA nodes. On the other hand, our locator service decreases the unnecessary transmissions of RREQ and RREP messages for finding the new locations of STA nodes in the network.

5 Performance Evaluation

5.1 Simulation Parameters

In order to evaluate the performance provided by MATIN in RNC, a precise simulator is designed using OMNeT++ framework. OMNeT++ is a discrete-event-based simulator which employs different frameworks to simulate computer networks. For example, OVERSIM and INETMANET frameworks can be used to build overlays and simulate wireless networks, respectively. Figure 3 shows the structure of the designed code in OMNeT++ for MATIN simulation. The related codes to video streaming application are based on the OVERSIM/DENACAST open source codes [61]. The live video source disseminates the STAR WAR IV, a single-layer live video stream available from [62] to peers in the P2P overlay. This video stream is based on the G16B1 structure in which the quantization parameter (QP) and the frame per second (FPS) equal 8 and 30, respectively. We generated a random mesh-based P2P network over the hybrid WMN because this network is usually generated randomly [63]. Each peer can join the overlay by sending a JOIN request to the Tracker server based on the model introduced in [59]. Then, the new joined peer sends connection request to the mentioned peers in the given list by the Tracker server and they will accept or reject its request according to their policies such as the maximum number of allowed neighbors for each peer in the P2P overlay. In fact, these peers are STA and mesh nodes in the underlying network which are randomly connected to each other for generating a mesh-based P2P overlay over the hybrid WMN. Two neighbor peers in the overlay are not necessarily real neighbors in the hybrid WMN. The hybrid WMN is constructed in INETMANET framework. The related code to RNC encoding/decoding processes are implemented in RNC section of Fig. 3. Each peer in the developed mesh-based P2P overlay can run the RNC code. Comparing Fig. 3 with the TCP/IP model in Fig. 4, the mesh-based P2P overlay is constructed in the application layer of TCP/IP model.

Fig. 3
figure 3

MATIN simulation in OMNeT++

Fig. 4
figure 4

OSI and TCP/IP models

Live video streaming application in the application layer sends video frames to the Internet layer. Internet layer in TCP/IP model is a subset of network layer in Open System Interconnection (OSI) model [64] (see Fig. 3). In the Internet layer, RNC-Encoder divides video frames into some fixed-sized video segments, each further divided into fixed-sized original video blocks. Then, RNC-Encoder encodes these original video blocks and generates encoded blocks. These encoded blocks are packetized in some Internet-layer-packets for routing by the employed routing protocol. In receivers, link-layer frames generate the Internet-layer packets. Then, encoded video blocks can be extracted from these received packets in the decapsulation process of TCP/IP model. RNC-Decoder decodes received encoded blocks and generates video segments. These video segments will be sent to the application layer for generating video frames. The video player can playback video frames as soon as the H.264/MPEG-4 decoder successfully decodes the received video frames.

Table 1 indicates all considered simulation parameters and conditions in the performed evaluation of MATIN in P2P live video streaming over hybrid WMNs. Based on this table:

Table 1 Considered parameters and their values in the simulation
  • Three different scenarios are considered, and each include a different number of STA and mesh nodes. In the designed simulation, there is only one live video source in the network and the IEEE 802.11g (54Mbps) is used as the wireless communication standard. Therefore, based on various simulation results, more than 26 peers in the network considerably reduce the video quality in the P2P overlay due to the fact that not enough bandwidth can be provided by the video source. On the other hand, these simulation results show that considering less than 15 peers provides the same performance in terms of video quality. Therefore, the number of STA and mesh nodes vary between 15 and 26 in which the number of STA nodes is always greater than the number of mesh nodes. In this regard, it is possible to evaluate how different routing protocols exploit the advantages of the designed STA locator by this research. This study considers three scenarios based on the number of STA and Mesh nodes, because contention, interference, and path failure probability increase in a WMN when the number of nodes, especially mobile nodes, increases.

  • In contrast to STA nodes, mesh nodes move at high speed which is considered between 2 and 6 m/s. Therefore, peer churning occurs in the network due to node mobility. High mobility speed of mesh nodes lets this research evaluate the network in high dynamic condition. Each peer randomly selects a value in the considered range for mobility speed and changes its position in the network. STA nodes (e.g. a pedestrian) can stop for a random time between 0 and 60 s. This not only simulates the real behavior of a pedestrian who uses a gadget (STA nodes), but is also allows network evaluation when there are some fixed nodes in the network which only request the video stream.

  • More than 30 s of initial buffering is not useful in live video streaming [65]. On the other hand, high video distortion will be experienced if peers do not buffer a part of the video stream before starting playback. Therefore, this research consider 15 s for initial buffering as a value between 0 and 30 s.

  • Usually, the number of neighbors for each peer varies between 3 and 5 in the designed P2P overlay [66]. As a result, this study also considers this range for neighbor selection.

  • Three different block sizes (128, 512 and 1,024 bytes) are considered as it is also considered by previous studies such as [67]. Smaller block size allows the network to be evaluated in more heavy traffic. Hence, it is possible to evaluate the performance of MATIN when the amount of exchanged traffic is high in the WMN. Mirshokraie and Hefeeda show that 512-byte block size is be the best size in RNC [6].

  • Based on the considered number of nodes and their mobility behavior, a \(1{,}000 \times 1{,}320\) square-meter area is considered. This size can reflect the usual size of a campus.

  • In the designed hybrid WMN, mobile nodes use Random WayPoint (RWP) model [68], the most commonly used mobility model in the literature, for mobility. RWP is fully randomized and simple in implementation.

  • This study employs Additive interference model [69] for path loss because it is more realistic and considers the worst case for SNR (Signal-to-Noise Ratio) where there are different amounts of SNRs in a moment. In this regard, the network can be tested in the worst case in terms of interference. The fact is that, contrary to threshold model, Additive model is used in many previous studies and does not affect the results in different runs of the simulation [70].

  • Considering an efficient propagation model, the Two Ray model [71] is also more suitable than free space model. Actually, the main reason in selecting RWP and Two Ray models is that they are reproducible by other researches in other simulator tools.

  • MSDU is set to 1,500 bytes in all evaluation processes for all phases, because it does not need to fragment the packet in intermediate routers. Actually, this size of MSDU is common in routers over the Internet and private computer networks [72].

  • According to the employed routing protocol in the designed WMN, we disabled the path accumulation in DYMO [73] so that its behavior is like AODV as a routing protocol in the designed hybrid WMN. DYMO, when acts as a reactive routing protocol, provides better performance than that of proactive, HWMP and spanning tree routing protocols where there are mobile nodes in a WMN [7477]. The performance of a proactive routing protocol is considerably reduced in very dynamic networks (high mobility) [77]. High path failure due to node mobility rate considerably degrades the video quality on nodes. Proactive protocols have also slow reaction in case of path failure [36].

Finally, the simulation was ran seven times and the averaged results are shown in the following figures with 95 % confidence interval (CI). In this study, all arithmetic operations in the simulation are performed over GF\((2^{8})\). The goal of this evaluation is to analyze how the proposed encoding framework behaves under different mobility conditions and network sizes. Thus, we have set three different scenarios based on the number of STA and mesh nodes in the network.

5.2 Simulation Results and Discussion

We compare the performance of the RNC in two cases: (i) supported by the Gauss–Jordan elimination (RNC_GJE) method and (ii) supported by the MATIN framework. Moreover, the performances of the framework and RNC_GJE are compared with CoolStreaming [15] which does not employ network coding for video streaming. In order to evaluate the performance of a video streaming system, it is necessary to measure some important metrics including Video Distortion (VD), End-to-End Delay (EED) and Initial Startup Delay (ISD) [5]. Moreover, as there are decoding dependencies among video frames in a GoP, we also measure the Frame Dependency Distortion (FDD) metric. These performance metrics can be defined as follows:

  • Video Distortion (VD) The capacity of the frames which are not playback divided by the capacity of all video frames. The capacity is measured in bytes while the VD metric is shown in percent.

  • End-to-End Delay (EED) Transmitting a video frame from the video source to a peer needs time. EED refers to this time in seconds elapsed from the time the source generated the frame until it reaches the destination.

  • Initial Startup Delay (ISD) When a peer joins the network, it starts to buffer a part of the video stream before starting to playback. This takes time to finish. ISD refers to this time in seconds.

  • Frame Dependency Distortion (FDD) As mentioned before, there are dependencies among video frames. In this regard, it is possible that a frame arrives, but the decoder cannot decode it because of its dependency on previous/next erroneous or not received frames. For instance, suppose that peer \(Q\) completely and correctly receives frame B1, while frames I and P1 from the same GoP have not been received yet. Under these circumstances, the video decoder and the media player neither decode nor does playback B1, respectively, because successful decoding of frame B1 is dependent on successfully receiving and decoding frame I and P1. The Dependency Distortion indicates the capacity of frames such as B1 divided by the total capacity of video frames. FDD is also shown in percent.

As depicted in Table 1, there are three different scenarios based on the number of existing STA and mesh nodes in the network. We divide this section into three subsections; each of them evaluates the related results for each scenario. Because of the considered MSDU and block sizes, this study uses an aggregation method in the packet encapsulation process so that each packet can contain more than one encoded video block. Suppose that \(P_{M}\) and \(P_{G}\) show the number of encapsulated blocks in a packet using the proposed framework and the RNC_GJE methods, respectively. Therefore, \(G_{M}\) in Eq. 1 and \(G_{G}\) in Eq. 2 show the number of required packets for transmitting a video segment using the proposed framework and the RNC_GJE, respectively.

$$\begin{aligned} P_M&= \left\lfloor {\frac{MSDU}{1+k}} \right\rfloor \quad \rightarrow \quad G_M =\left\lceil {\frac{n}{P_M }} \right\rceil \end{aligned}$$
(1)
$$\begin{aligned} P_G&= \left\lfloor {\frac{MSDU}{n+k}} \right\rfloor \quad \rightarrow \quad G_G =\left\lceil {\frac{n}{P_G }} \right\rceil \end{aligned}$$
(2)

Thus, for \(n,k\ge 1,\;n,k\in \mathrm{N}\):

$$\begin{aligned} \frac{G_M }{G_G }\le \frac{1+k}{n+k}\;\le \;1\quad \rightarrow \quad G_M \le G_G \end{aligned}$$
(3)

If \(G_{M}=G_{G}\), using the same segment and block sizes, it is clear that the total capacity of all \(G_{M}s\) is always greater than that of the \(G_{G}s\). Therefore, Eq. 3 indicates that MATIN always generates lesser traffic than that of the RNC_GJE. In other words, MATIN always generates fewer number of packets. This leads to a better perceived video quality in both wired and wireless networks (e.g. WMN).

5.2.1 The First Scenario

As can be seen in Fig. 5, the proposed framework provides better video quality on STA and mesh nodes than that of RNC_GJE. The imposed transmission overhead on the network sharply increases when the block size is 128-byte. However, using the proposed framework, transmission overhead is very low which leads to lesser amount of video distortion, even if the block size equals 128-byte. For example, suppose that the size of segment \(S\) is 16,000 bytes. In this case, 125 128-byte blocks will be arranged in matrix \(B_{n\times k}\). In this case, the imposed transmission overhead by RNC_GJE and the proposed framework will be 49.4 and 0.77 %, respectively. Based on this example and the amount of MSDU (MAC Service Data Unit), the amounts of \(G_{M}\) and \(G_{G}\) will be equal to 12 and 25, respectively. In this regard, using the proposed framework, applicants receive the same number of video blocks, but in a fewer number of packet transmissions (exactly 52 % less). Obviously, lesser amounts of interference and collisions will occur in the network when the number of transmissions decreases. In all cases, the proposed framework introduces lesser amounts of video distortion than that of the RNG_GJE, especially for small block size. Considering the previous example, the amounts of \(G_{M}\) and \(G_{G}\) will be equal to 16 when the block size is 512 bytes. In this case, the RNC_GJE introduces larger amount of video distortion than that of the proposed framework, because the lengths of video packets are longer. This is the same for block size 1,024 bytes. Although the number of video packets is the same, the effects of fading and interference on the exchanged video packets can be degraded when the sizes of video packets are smaller. According to Figs. 4, 8 and 12, the differences between the provided performances by the proposed framework and RNC_GJE increases for block sizes 512 and 1,024 when the number of nodes increases. This fact shows that the framework can increase the network scalability and supports more nodes in the network while the video quality does not degrade. According to Fig. 6, less distortion due to dependencies among video frames (FDD) is introduced to STA and mesh nodes using the proposed framework. This shows that nodes receive more video frames especially frames I and P. FDD is one of the most important reasons for the low video quality on nodes. This not only increases the video distortion, but also decreases the bandwidth utilization. This is due to the fact that a node successfully receives a video frame but it cannot decode it because of frame decoding dependency.

Fig. 5
figure 5

Video distortion in percent in scenario 1

Therefore, the proposed framework considerably increases bandwidth utilization and video quality in the system which is very important in wireless networking. High mobility speed of mesh nodes is another important reason for video distortion. Actually, the probability of path failure will be increased when a mesh node moves moment by moment with high speed. In this case, the mesh node will continually lose its neighbors. This increases the churn rate in the network. Figure 6 depicts that the proposed framework improves the FDD metric 67.10, 10.03, and 11.37 % on STA nodes when the block size is 128, 512, and 1,024 bytes, respectively. These values are 67.27, 18.96, and 8.44 % for mesh nodes, respectively.

Fig. 6
figure 6

FDD in percent in scenario 1

What can be inferred is that the proposed framework increases the network resiliency even at high churn rates. Interestingly, according to Figs. 7 and 8, the introduced amounts of ISDs and EEDs by the proposed framework are less than that of the RNC_GJE in all cases. It means that the framework provides better video quality in lower end-to-end delay and allows nodes to finish their initial buffer time earlier which leads to lesser amount of ISD. All of these are very important in a WMN for providing high video quality on nodes. Finally, it is necessary point out that, in scenario 1, the amounts of VD, FDD, ISD and EED are improved on average by about 36.89, 43.15, 6.48, and 16.63 % using the MATIN framework.

Fig. 7
figure 7

ISD in seconds in scenario 1

Fig. 8
figure 8

EED in seconds in scenario 1

5.2.2 The Second Scenario

In this scenario, dynamic nature and competition for available resources in the network increases as the number of STA and mesh nodes are also augmented by 50 and 43 %, respectively. As can be seen in Fig. 9, the proposed framework provides better video quality on STA and mesh nodes. The amount of video distortion increases when the block size decreases. The main reason is that the imposed transmission overhead on the network sharply increases when the block size is small. Using the proposed framework, on the other hand, the amount of transmission overhead sharply decreases which leads to lesser amount of video distortion. This is more visible when the number of nodes increases in the network. Considering the given example in the first scenario, applicants receive the same number of video frames but in fewer packet transmissions. According to this example, using MATIN framework, the traffic due to sending the video packet decreases about 98 % when the block size is 128-byte. What can be inferred from Fig. 10 is that the proposed framework improves the average frame dependency distortion metric by about 34 and 30.38 % in STA and mesh nodes, respectively.

Fig. 9
figure 9

Video distortion in percent in scenario 2

Fig. 10
figure 10

FDD in percent in scenario 2

Based on the obtained results in Fig. 11, the amount of ISD decreases when the proposed framework is employed in the network. According to Fig. 12, this is the same for end-to-end delay. In other words, the framework permits both STA and mesh nodes to receive required video frames in lower and approximately the same amount of end-to-end delay. Basically, the length of a video packet will be larger in bytes when the framework encapsulates 128-byte blocks, because more blocks can be encapsulated in a video packet. However, EED will be increased marginally. Obviously, the framework introduces lesser amounts of EED and ISD than that of the RNC_GJE if aggregation is not used in the network. This refers to the fact that in all cases the transmission overhead sharply decreases using the framework. Using aggregation technique, it encapsulates more video blocks in a packet than that of the RNC_GJE. Actually, packet length will be lesser if the same number of video blocks is encapsulated in a packet.

Fig. 11
figure 11

ISD in seconds in scenario 2

Fig. 12
figure 12

EED in seconds in scenario 2

Finally, it is necessary to note that, in scenario 2, the amount of VD, FDD, ISD and EED are improved, on average, by about 31.22, 36.64, 7.98, and 20.38 % using the MATIN framework, respectively.

5.2.3 The Third Scenario

In order to evaluate the performance of the framework more precisely, we increased the number of STA and mesh nodes in the third scenario to about 75 and 20 % more than that of the first and the second scenarios, respectively. In this case, as all nodes playback the video stream, traffic will increase. Similar to other scenarios, the proposed framework provides better video quality, especially when the block size is 128 bytes. The probability of path failure increases if the network area remains constant and the number of mesh nodes increases. According to Fig. 13, the framework decreases the average video distortion on STA and mesh nodes by about 34.23 and 33.25 % in comparison with the introduced values of the RNC_GJE, respectively. This is also true for distortion due to frame dependency (Fig. 14). Moreover, lower amounts of ISD and EED are introduced to the system as depicted in Figs. 15 and 16. This clearly shows that MATIN increases the network resiliency in high dynamic networks which can be a great advantage in a wireless network. Finally, it is necessary to note that we increased the number of STA and mesh nodes to more than 14 and 12, respectively. The results show that the framework always provides better performance in terms of the VD, FDD, ISD, and EED in the network in which these metrics are improved 37.74, 41.06, 14.37, and 26.44 %, respectively. The higher the number of nodes, the more traffic will be exchanged.

Fig. 13
figure 13

Video distortion in percent in scenario 3

Fig. 14
figure 14

FDD in percent in scenario 3

Fig. 15
figure 15

ISD in seconds in scenario 3

Fig. 16
figure 16

EED in seconds in scenario 3

5.3 Complementary Discussion

Recent studies show that video quality can be considerably increased using RNC. In order to verify this assertion, this study compares the proposed framework and the RNC_GJE with CoolStreaming, which is one of the most popular live video streaming systems. The comparison is done under the same network conditions. The special feature of CoolStreaming is that it does not use any network coding for live video streaming. Taking into account that high quality video streaming is the main goal of a video streaming system, we compare the amount of the video distortion using these methods as shown in Fig. 17. The results show that the proposed framework considerably outperforms CoolStreaming and RNC_GJE. In this figure, the average values of different block sizes in each scenario are depicted for the RNC_GJE and the proposed framework (MATIN). In Scenario 2 for STA nodes, the RNC_GJE introduces more video distortion than that of CoolStreaming. What can be inferred is that the existing challenges in RNC can decrease its performance on some special conditions. The proposed framework provides better video quality than that of CoolStreaming in the second scenario. As a result, it can be concluded that our framework effectively solves the existing problems in using RNC for live video streaming over wireless networks.

Fig. 17
figure 17

Average amounts of video distortion in percent by CoolStreaming, RNC_GJE and MATIN

The obtained results show that the proposed framework is a possible solution for the mentioned challenges in efficient live video streaming over WMNs propounded in this study. Actually, it imposes very low transmission overhead and computational complexity on the system and provides better video quality while decreasing the amounts of EED and ISD, even if the number of nodes increases and nodes move with high speed. We compared the decoding time using MATIN and the Gauss–Jordan elimination method for different matrix dimensions. This evaluation is performed 1,000 times on a laptop with Core i7 CPU, 1.6 GHz and 4GB memory. Figure 18 shows that MATIN, contrary to the Gauss–Jordan elimination method, imposes a bit computational complexity on each peer.

Fig. 18
figure 18

Decoding delay in milliseconds using MATIN and Gauss–Jordan elimination

Our paper analyses the convenience of applying MATIN so that better video quality can be provided on wireless gadgets connected to wireless mesh networks. MATIN seems especially beneficial for the wireless gadgets as the technique allows them to assign their limited processing power to other tasks.

Because of very low transmission overhead, the results show that the proposed framework provides better video quality on wireless nodes in terms of video distortion. Alternatively, video distortion due to frame dependency has been considerably decreased using the proposed framework. Moreover, wireless nodes do not require a high computational complexity in the decoding step, and thus do not need powerful processors. The simplifications due to MATIN reduce the energy consumption in wireless gadgets, especially in the transmission and the decoding step.

According to Fig. 18, using MATIN framework, decoding times are improved 99.43 and 99.99 % in block sizes 64 and 768, respectively. Finally, Fig. 19 shows how the MATIN improves average performance metrics in percent for considered block sizes in different scenarios in comparison with RNC_GJE.

Fig. 19
figure 19

Improvement comparison of scenarios for different metrics using MATIN

What can be inferred from this figure is that MATIN not only permits peers to experience better video quality, but it also lets a hybrid WMN be more scalable. In other words, although the number of nodes increases in the third scenario, better improvements are achieved in different metrics due to imposing very low transmission overhead on the network. Actually, the results show that transmission overhead affects the performance of the network, especially when the number of nodes increases. According to this figure, existing nodes in the P2P overlay over the hybrid wireless mesh network experience an average of 35.28, 40.28, 9.61, and 21.15 % improvement in video distortion, FDD, ISD, and EED metrics in all considered scenarios and block sizes, respectively. Therefore, the proposed framework efficiently addresses the transmission overhead problem by RNC_GJE.

5.4 Packet Error Rate Analysis

The packet error rate (PER) can be defined as the number of incorrectly received video packets divided by the total number of received video packets. A video packet can be considered incorrect even if only one bit of it is erroneous. Pp and Pe depict packet and bit error probability of a video packet length of \(L\) bits, respectively. So,

$$\begin{aligned} \hbox {P}_{\mathrm{p}}=1-(1-\hbox {P}_{\mathrm{e}})^{\mathrm{L}} \end{aligned}$$
(4)

Now, suppose that each video packet includes one \(k\)-byte video encoded block, the amount of \(L\) is equal to \((8\times (1+k))\) and \((8\times (n+k))\) bits using MATIN and conventional RNC methods (RNC_GJE), respectively [25]. Obviously, according to Eq. 4 and the amount of \(L\), the amount of Pp is bigger in conventional RNC than that of the MATIN. In Eq. 5, suppose that \(P_{pM}\) and \(P_{pR}\) depict the packet error probability in MATIN and RNC_GJE, respectively. Therefore,

$$\begin{aligned} \frac{\hbox {P}_{\mathrm{pM}} }{\hbox {P}_{\mathrm{pR}} }=\frac{1-\left( {1-\hbox {P}_\mathrm{e} } \right) ^{(8+8\mathrm{k})}}{1-\left( {1-\hbox {P}_\mathrm{e} } \right) ^{(8\mathrm{n}+8\mathrm{k})}} \end{aligned}$$
(5)

Equation 6 is always true, because each segment should be divided into at least two blocks \((n\ge 2), k >0\) and \((1-P_{e})<1\).

$$\begin{aligned} \hbox {P}_{\mathrm{pM}} < \hbox {P}_{\mathrm{pR}} \end{aligned}$$
(6)

Video quality can be considerably affected by the number of successfully received video packets. Total number of successfully received video packets decreases with increase in the video packet length in a WMN. Moreover, Feeney and Nilsson show that energy consumption of an interface in the IEEE 802.11 standard can be directly affected by the packet size in point-to-point and broadcasting transmissions [79]. Hence, MATIN can provide better video quality on peers, because it sharply decreases the packet length by attaching one instead of \(n\) bytes coefficient vectors to each \(k\)-byte encoded blocks. Obtained results in next section confirm this assertion. Moreover, we discussed the imposed computational complexity and transmission overhead of our method in detail in our previous study and compared them with other methods.

6 Conclusion

Recent studies have confirmed that RNC can provide better video quality on wireless nodes, but it introduces some new challenges to the system. Large numbers of arithmetic operations in decoding and checking linear dependency among the vectors of matrix \(C_{n\times n}\) impose high computational complexity on the network. Moreover, the high transmission overhead due to sending all coefficient vector entries can degrade the performance of the system, especially in a live video streaming system. These problems are especially relevant in wireless networks, where there exists limited bandwidth and the mobile devices have simple computational resources. In order to address these open issues for hybrid wireless mesh networks, we evaluate the use of the MATIN framework. MATIN generates the coefficients matrix \(C_{n\times n}\) using \(n\) instead of \(n^{2}\) entries in which there is no linear dependency among its vectors. Linear dependency decreases the number of innovative packets in a network. In fact, one instead of \(n\) coefficient entries will be sent as the header of encoded blocks which results in very low transmission overhead. The decoder progressively produces the matrix \(C^{-1}_{n\times n}\) using fewer arithmetic operations which results in very low computational complexity in the system. In this regard, gadgets can assign more CPU (Central Processing Unit) time to other tasks. Moreover, we equipped mesh nodes and mesh routers with an efficient distributed locator for efficiently supporting STA nodes. In order to examine the performance of the proposed framework, we simulated under different network conditions using OMNeT++. Four important performance metrics including video distortion (VD), video distortion due to frame dependency (FDD), initial startup delay (ISD) and end-to-end delay (EED) were considered. We also considered different numbers of nodes in three scenarios. The results showed that the proposed framework noticeably outperforms the CoolStreaming system and the RNC_GJE which does not use network coding and employs the Gauss–Jordan elimination method in the decoding step, respectively. Actually, it provides better video quality because it introduces less video distortion. Peers start the playback of the video stream earlier as they can finish their initial buffer time earlier. Therefore, the framework allows RNC method to be more effective and efficient in wireless data streaming, especially video streaming.