• 沒有找到結果。

Chapter 2 Related Work

2.6 Summary

In this paper, we propose an equation based on the Poisson error model to evaluate the perception quality and adjust redundancy to transmitted data at the sender. Based on the equation, three AFEC schemes are also designed for the adaptive control module in AFEC.

The three schemes are simulated on Real-Time Transport Protocol (RTP) data streams using NS-2 to improve the perception quality and reduce the packet redundancy. In the following sections, we depict the proposed equation, followed by the three schemes to adjust packet redundancy in AFEC.

Chapter 3 H-Q Equation

As mentioned in the above sections, trade-off exists in the perception quality and transmission overhead. In this paper, we propose a mathematical equation based on the changes between the transmission overhead (H) and quality (Q) to adaptively track the optimum of redundancies and provide better quality with lower overhead. The proposed equation is then named as H-Q equation. Before detailing the proposed equation, the notations used in this paper are briefed in Table 3.1.

Table 3.1 Notation Definition

Notation Description B Original data block, the number of packets to be transmitted in a data block

BL Lost packets, the number of lost packets in original data block R Redundant packets, the number of redundant packets

N Transmitted packets, the total number of packets, including original and redundant packets

ri Packet redundancy, the number of redundant packets for packet Pi

E(r) Expected packet redundancy, the expected value of packet redundancy L Loss rate, the rate for packet loss during network transmission

Q Receiving quality, the perception quality in receiver's side

QW Worse receiving quality, the worse quality that can be tolerated by receiving applications

D Network delay time, the delay time (ms) in real network

Dmax Maximum network delay time that can be tolerated by applications

T Maximum processing time (ms) in receiver’s side, including queuing, searching, etc

H Transmission overhead, the overhead resulting from injecting the redundant packets

In the proposed equation, we assume that the redundant packets are randomly chosen from the packets, P1, P2… PB, in original data block and the packet redundancy, ri, is depending on

the previous receiving quality, Q, as shown in Figure 3.1. In this figure, R redundant packets are appended to the original data block, P1, P2… PB, and thus the total number of packets to be transmitted become N, the summation of B and R.

Figure 3.1 Transmitted packets

Since the packet redundancy, ri, is assumed to be depending on the previous receiving quality, Q, the expected value of packet redundancy, E(r), can be used to compute receiving quality and estimate the loss rate.

Assume that the redundant packets are randomly chosen from P1, P2… PB, the expected value of the packet redundancy, E(r), can be derived according to the following equation Eq (1). Since E(r) represents the ratio of redundant packets and original packets, it can be considered as the transmission overhead, H, which is introduced by injecting redundant packets, as shown in Eq (2).

B r R E

H = ( )= Eq (2) In other words, an overhead H means there are H redundancies for each packet. In such a case, for each packet, there are totally H+1 copies transmitted over the network. Only if the H+1 packets are totally lost, the receiving quality, Q, is affected. Therefore, it comes out the following equation, Eq (3), named as H-Q equation.

) 1

( − +1

= LH

Q Eq (3) Furthermore, the overhead (H) and loss rate (L) can be derived from the above equation, as shown in Eq (4) and (5), respectively.

) 1 log(

) 1 log(

= L

H Q Eq (4)

1 ) ) 1 (log(

10

+

=

H Q

L

Eq (5) From the above equations, it is clear that the higher the loss rate is, the worse the receiving quality. To improve the receiving quality, it is possible to raise the redundancies, which result in higher overhead in the system. However, when injecting too many redundant packets, it makes network congestion and packet redundancy even worse. It helps nothing in improving the receiving quality. Figure 3.2 shows the relationship among receiving quality (Q), redundant overhead (H) and network loss rate (L). When transmission overhead is zero, receiving quality is monotonic decrease as packet loss rate gets higher. This H-Q equation can improve this situation. By injecting more transmission overhead, receiving quality curve can be enhanced. But receiving quality enhancement has limit, the curve through point A and B is an exponential curve which end off ∞ when packet loss rate gets higher.

Figure 3.2 Relationship among H, L and Q

It is clear that the receiving quality is bad when loss rate becomes high. The

improvement of receiving quality is limited even we inject more redundant packets and raise the transmission overhead. Thus, it is important to dynamically adjust the redundancies according to the loss rate and get the optimum in overhead and receiving quality.

In AFEC, it is important to get the balance between the perception quality and overhead, according to the packet loss rates. In this paper, the H-Q equation is proposed based on the above factors to implement the adaptive control in AFEC (Figure 3.3), described in the following sections.

Start

Initial

Send RTP packets

Adaptive control

Receive BYE

End Yes

Yes No

Receive RTCP report

Figure 3.3 Adaptive control of AFEC in sender side

3.1 Static AFEC (SAFEC)

The proposed static AFEC (SAFEC) can be applied to applications with static sized data blocks. It repeatedly estimates the receiving quality and packet loss rate to determine the packet redundancies to get an optimal between overhead and receiving quality. In SAFEC, shown in

Figure 3.4, it checks current receiving quality to see if it reaches the worse receiving quality (QW) or not. If QW≦Q, it means that network status is better than expected, and the packet redundancies can be reduced according to the equation, Eq(4), where Q equals to QW. This lowers down the network congestion and packet redundancy. On the contrary, when the packet loss rate is worse than expected, the packet loss rate should be re-estimated according to the status reports. After that, the transmission overhead needs to be re-calculated to adjust the packet redundancies, R. According to Eq(2), R can be derived from a multiplication of the transmission overhead and data block size. In such a condition, more redundant packets need to be injected into network to improve the receiving quality. The following flowchart illustrates the process of SAFEC for adaptive controlling the packet redundancies.

Figure 3.4 Adaptive control of SAFEC flowchart

From the above flow chart, it is observed that the adjustment of packet redundancies in SAFEC is sensitive to not only the transmission overhead and network loss rate, but also the original data block size. When applying to applications with various data block sizes, the packet redundancies are affected accordingly. To count in the factor of data block size, a dynamic AFEC mechanism is introduced in the following section.

3.2 Dynamic AFEC (DAFEC)

Dynamic AFEC, shown in Figure 3.5, is designed based on SAFEC but is able to dynamically adjust the data block size to provide better receiving quality. From the simulation, it is observed that when the network status becomes worse, reducing data block size helps improve the receiving quality. Therefore, in DAFEC, if the current quality reported from receiving side is getting worse, that is Q<QW, the original data block size can be shrink to the minimum value to improve the quality. Otherwise, when Q>QW, the original data block is increased to reduce packet redundancy.

Figure 3.5 Adaptive control of DAFEC flowchart

3.3 Advanced AFEC (AAFEC)

It is still injected the redundant packets of DAFEC into the network even though network environment getting worse. The redundant packets become serious overhead to the network, so that we have to release network bandwidth when network environment is too worse to be enhancement. We provide self-close scheme into adaptive control of AFEC to be advanced AFEC (Figure 3.6) which can stop transmission useless redundant packets to release network bandwidth. In our design, we set the self-close scheme threshold is Q=50%, and the self-close scheme starts when Q≦50%.

Figure 3.6 Adaptive control of advanced AFEC flowchart

3.4 Summary

The most important thing is that the equation within we propose three AFEC variances are simply than others. Some paper proposed forward control method using expected value of receiving quality. Some of them have unrealistic assumption of their simulation environment, because the equation of computing receiving quality expected value is too complex. We propose three AFEC variances using number of redundant packets expected value to compute receiving quality, therefore it is simpler to use in adaptive forward control.

Chapter 4 Simulation

In the proposed adaptive control mechanisms for AFEC, the maximum processing time (T) for packet recovery is also considered in our simulations. In this paper, we propose a mathematical method to design three AFEC variances which are implemented in RTP session which is including RTP and RTCP agent. When receiver receive RTP packets, RTP agent start to recover lost packets and calculate receiving quality and loss rate. Then RTCP get RTP computing result of receiving quality, it send receiver report to sender with receiving quality.

The RTCP agent of sender will catch this receiver report and start to analysis receiving quality if it gets better or not before it pass this information to RTP agent. Traditionally, RTCP bandwidth has to be kept fewer than 5% of the data bandwidth.

4.1 Configuration

Most of the real-time application such as audio and video stream uses UDP (User Datagram Protocol) as their underlying transmission protocol. The reasons to use UDP for real-time transmission are described as follows.

1. The retransmission scheme of TCP (Transmission Control Protocol) causes larges delays.

2. TCP does not support multicast.

3. TCP congestion control mechanism decreases the congestion window when packet loss is detected. However, audio and video have natural rate that cannot be suddenly decreased.

4. TCP header is 32 bytes larger than UDP.

5. TCP doesn’t contain the necessary timestamp and encoding information needed by the receiving application.

6. TCP doesn’t allow packet loss. In A/V however loss of 1% ~ 20% is tolerable.

We hire RTP on top of the UDP to provide real-time transmission. Under real-time constraint issues, we use redundant RTP packets to replace retransmission and QoS provision schemes. In this paper we focus on end-to-end packet-level transmission (Figure 4.1) when we simulate multimedia transmission performance with H-Q equation for AFEC. The performance of AFEC is related to maximum tolerate network packet loss rate with quality constraint. Network packet lost events are using random loss model in our simulation

environment. The random loss model is based on three assumption of Poisson counting process as follow:

¾ Poisson counting process assumption

„ At most one event can occur at any time instant

„ Event count are mutually independent random variables for any interval

„ Event count may depend on the interval length, but it is independent of the time instants for any interval

Because of the random packet lost obviously exists in real network environment when queuing buffer of network routers is full or network congestion occurred. We use redundant RTP to solve the random packet lost problem by information of RTCP report packets.

Figure 4.1 Simulation environment

4.2 Simulation

We propose H-Q equation for accurate adaptive controller which are related to packet loss rate, receiving quality, transmission overhead, worse quality value, redundant packet procedure, original data block size, number of redundant packets, receiver recover procedure (sorting scheme, queuing size), adaptive control computing error (underflow), receiver report inter-arrival time, and receiver report suffer from network delay, loss and jitter effect. In our simulation environment, the amount of bandwidth allocated to RTCP in an RTP session is 5%

of the session bandwidth. (RFC 3556)

4.2.1 NS-2 Files

NS-2 provides many network agents, so all we have to do is adding H-Q equation into network agents. These agents are written by C++ and the behavior of agent-to-agent and network environment are written by Tcl (Tool Command Language). The NS-2 simulator can download from “http://www.isi.edu/nsnam/dist/ns-allinone-2.29.tar.gz”. The ns-allinone includes all the components of NS-2 like ns-2.29, nam-1.11, lib, otcl-1.11, tcl-8.4.11, tclcl-1.17, and tk-8.4.11. The files we modified of NS-2 in this thesis as follow:

~/ns-2.29/common/session-rtp.cc:

The functionality of RTP session includes RTP local source, building report, receiving RTP packets, receiving control (RTCP packets), source lookup, RTP session command, packet sequence number handler, adaptive control of AFEC, packet queue handler, packet lost queue handler, and RTCP report packet check.

~/ns-2.29/tcl/rtp/session-rtp.tcl:

This file describes the behavior of RTP session including RTP/RTCP event trigger, reaction, event handler, and time-out.

~/ns-2.29/tcp/rtp.cc:

The functionality of RTP agent includes RTP agent class, RTP start/stop, sending message, sending/receiving packets, RTP command, rate change, making packets, and timeout.

~/ns-2.29/tcp/rtcp.cc:

The functionality of RTCP agent includes sending/receiving packets, RTCP start/stop, and RTCP command.

~/ns-2.29/tcl/lib/ns-default.tcl:

This file is used to define the parameters initial value and bind parameters between C++ and Tcl.

4.2.2 RTP Sessions

We propose H-Q equation to be AFEC adaptive controller in RTP session in our NS-2 simulator. RTP and RTCP agent can pass information by OTcl (Object Tool Command Language). The functionality of each agent is as follow:

Sender:

RTP:

1. Estimate network packet loss rate

2. Adaptive forward error correction (AFEC) 3. Calculate number of redundant packets (R) 4. Send packets = B + R

RTCP:

1. Receive receiving quality from receiver report

Receiver:

RTP:

1. Receive RTP packets

2. Compute loss rate and receiving quality 3. Packet loss recovery

RTCP:

1. Send receiving quality report (receiver report)

Receiver

Figure 4.2 RTP session with AFEC of NS-2

Network simulation environment is as follow:

Network bandwidth: 1.5Mb Network delay: 50ms Packet size: 512 bytes

Session bandwidth fraction: 0.05sec Sender bandwidth fraction: 0.25sec Receiver bandwidth fraction:

1- (Sender bandwidth fraction) Interval sender bandwidth fraction:

1/ (sender bandwidth fraction)

Interval receiver bandwidth fraction:

1/ (receiver bandwidth fraction) Minimum rtp time: 0.8sec Average size: 128 bytes Session bandwidth: 400kb/s

4.2.3 Tcl Scripts

The implement of our network simulation of NS-2 is designed by Tcl as follow:

1. Start NS-2 simulator with multicasting.

set ns [new Simulator -multicast on]

2. Set output file.

set f0 [open out0.tr w]

set f1 [open out1.tr w]

3. Build two network node named as n0 and n1.

set n0 [$ns node]

set n1 [$ns node]

4. Set color of node. The flow id (fid) of RTP=0 and RTCP=32.

$ns color 32 green

$ns color 0 blue

5. Store the event of the simulation trace data into “rtp-out.tr”.

set f [open rtp-out.tr w]

$ns trace-all $f

#$ns eventtrace-all $f

6. Store the trace data of simulation for “nam” into file “out.nam”.

set nf [open out.nam w]

$ns namtrace-all $nf

7. Set duplex link between two node, bandwidth=1.5Mb, network delay=50ms, and the procedure is drop tail when queue is full.

$ns duplex-link $n0 $n1 1.5Mb 50ms DropTail

8. Set the node position of “nam”.

$ns duplex-link-op $n0 $n1 orient right

9. Position of queue (queuePos) is defined as the angle of the queue line with horizontal.

$ns duplex-link-op $n0 $n1 queuePos 0.5

10. Error model setup. Set network packet loss event is random and its rate is 80%.

set prob_ 0.8

set em [new ErrorModel]

$em unit pkt

$em set rate_ $prob_

$em ranvar [new RandomVariable/Uniform]

$em drop-target [new Agent/Null]

$ns lossmodel $em $n0 $n1

11. Set prototypes for functions common to several modules is dense mode (DM).

set mproto DM

set mrthandle [$ns mrtproto $mproto {}]

set group [Node allocaddr]

12. Set RTP session.

set s0 [new Session/RTP]

set s1 [new Session/RTP]

13. Set session bandwidth is 400kb/s.

$s0 session_bw 400kb/s

$s1 session_bw 400kb/s

14. Attach RTP session setting into the nodes.

$s0 attach-node $n0

$s1 attach-node $n1

15. “record” process is to catch the parameters of the nodes and then put into file.

proc record { } {

global f0 s0 s1 ns set ns [Simulator instance]

set time 200

set dataloss0 [$s0 set dataloss_]

set npkt0 [$s0 set npkt_]

set datapkt0 [$s0 set datapkt_]

set datablock0 [$s0 set datablock_]

set h0 [$s0 set h_]

set count_data_packets0 [$s0 set count_data_packets_]

set dataloss1 [$s1 set dataloss_]

set datapkt1 [$s1 set datapkt_]

set npkt1 [$s1 set npkt_]

set nloss1 [$s1 set nloss_]

set packet_count1 [$s1 set packet_count_]

set packet_loss1 [$s1 set packet_loss_]

set now [$ns now]

puts $f0 "$now $dataloss1 $count_data_packets0 $nloss1 $npkt1 $packet_loss1 $packet_count1 $h0 $datablock0"

$ns at [expr $now+$time] "record"

}

16. Set random variable

set r3 [new RandomVariable/Uniform]

set rng [new RNG]

$rng seed 0

17. Set the RTP session behavior when simulation. The simulation stop at 200 second.

$ns at 0.0 "record"

$ns at 0.0 "$s0 join-group $group"

$ns at 0.0 "$s0 start"

$ns at 0.0 "$s0 transmit 400kb/s"

$ns at 0.0 "$s1 join-group $group"

$ns at 0.0 "$s1 start"

$ns at 200 "finish"

18. “finish” process is to stop simulation and run NAM.

proc finish {} { global ns f nf

close $f

close $nf

puts "running nam..."

exec nam out.nam &

exit 0

}

19. Run simulation

$ns run

4.3 Simulation Results

We add H-Q equation into RTP/RTCP agent in RTP session of NS-2 simulator. Event tracing file is “rtp-out.tr” including packet type, size, statement, sequence number, and flow id.

NS-2 provides network animator (NAM) a GUI according to NAM tracing file.

4.3.1 Output Files

¾ The partial event tracing file “rtp-out.tr” of our simulation as follow:

d 64.6 0 1 rtcp 96 --- 32 0.2 -2147483647.-1 -1 6631 + 64.6 1 0 rtcp 76 --- 32 1.2 -2147483647.-1 -1 6632 - 64.6 1 0 rtcp 76 --- 32 1.2 -2147483647.-1 -1 6632

d 64.60416 0 1 rtp 512 --- 0 0.1 -2147483648.-1 3179 6633 r 64.605691 0 1 rtp 512 --- 0 0.1 -2147483648.-1 3173 6626 + 64.6144 0 1 rtp 512 --- 0 0.1 -2147483648.-1 3180 6634 - 64.6144 0 1 rtp 512 --- 0 0.1 -2147483648.-1 3180 6634 r 64.615931 0 1 rtp 512 --- 0 0.1 -2147483648.-1 3170 6627 d 64.62464 0 1 rtp 512 --- 0 0.1 -2147483648.-1 3177 6635

The RTCP packet, packet id is 6631, which from node “1” to “0” was lost at 64.2 second, and another RTCP packet, packet id is 6632, was created by node “1” at the same time. The event of RTP, packet id from 6633 to 6637, statement can be record at this list. Finally, the RTCP, packet id is 6632, was received at 64.650405 by node “0”.

¾ The partial of “out.nam”

Network animator of NS-2 [25] accords to the data of this file to show graph user interface (GUI). The partial symbol table of Nam as follow:

Symbol Description

-a packet color attribute id -x comment

Table 4.1 Nam partial symbol table

¾ The sample of analysis data of our AFEC schemes as follow:

Simulatio

Table 4.2 H-Q equation for AFEC schemes analysis data list

Table 4.2 analyze packet loss rate (L) from 0 to 0.9. We set total simulation time is 200 second. We use number of data packets loss/receiving to compute receiving quality which is defined as (1- BL/B) in this thesis. The packet redundancy can be analyzed by number of data

packets and total packets receiving which is defined as (1-(B of AFEC)/(B of non-AFEC)) in this thesis.

4.3.2 Network Animator

Figure 4.3 is the network animator (NAM) result of our AFEC in RTP session of NS-2.

We can simulate the RTP and RTCP packet transmission with Ethernet and packet loss event.

Because of RTCP report packets may be loss in our simulation environment, it’s more close to real world network environment. We can also control the time of node join RTP session by Tcl (Tool Command Language) in NS-2, it means that we can discuss about multicast AFEC in our future work.

Figure 4.3 AFEC simulation

Random loss is the most familiar event of network transmission when network congestion occurred. We assume that packet random loss is Poisson distribution. Poisson counting process has three assumption 1)At most one event can occur at any time instant 2)Event count are mutually independent random variables for any interval 3)Event count may depend on the interval length, but it is independent of the time instants for any interval.

4.4 Summary

We propose a H-Q equation to design three AFEC schemes– static AFEC (SAFEC), dynamic AFEC (DAFEC), and advanced AFEC (AAFEC). SAFEC is simply use H-Q equation as adaptive controller in sender, but its original data block size is static. According to our simulation result that original data block size is also has effective to receiving quality in our H-Q equation, so that we modify SAFEC to be DAFEC. DAFEC can dynamically change original data block size by computing network packet loss rate. One more important thing is that it is needed to reduce the transmission overhead when network environment too worse to match our expected receiving quality, because it may cause more serious network congestion

We propose a H-Q equation to design three AFEC schemes– static AFEC (SAFEC), dynamic AFEC (DAFEC), and advanced AFEC (AAFEC). SAFEC is simply use H-Q equation as adaptive controller in sender, but its original data block size is static. According to our simulation result that original data block size is also has effective to receiving quality in our H-Q equation, so that we modify SAFEC to be DAFEC. DAFEC can dynamically change original data block size by computing network packet loss rate. One more important thing is that it is needed to reduce the transmission overhead when network environment too worse to match our expected receiving quality, because it may cause more serious network congestion

相關文件