• 沒有找到結果。

Chapter 3 H-Q Equation

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 to effect other network traffic. Therefore we propose advanced AFEC (AAFEC) having self-close AFEC scheme can release network bandwidth if necessarily.

Chapter 5

Analysis and Comparison

5.1 Analysis

We propose a mathematical equation, which named H-Q equation, to adaptively control the number of redundant packets in AFEC. We use this equation to propose three AFEC schemes – SAFEC, DAFEC, and DAFEC, to adaptive deal with random loss network environment effectively.

5.1.1 SAFEC

The H-Q equation is used to design the adaptive controller of AFEC, which called static AFEC (SAFEC). It is compared SAFEC with non-AFEC in Figure 5.1, SAFEC has better receiving quality and performance to tolerate more packet loss rate than non-AFEC, because SAFEC quality curve is always higher than non-AFEC. We set receiving quality lower bound is 90%, so that the adaptive controller do not start when packet loss rate is lower than 10%.

Thus the SAFEC curve is similar to non-AFEC when loss rate is lower than 10%. In this case, SAFEC can only tolerate network loss rate below 20% if we set receiving quality lower bound is 90%. When loss rate is larger than 70%, RTCP report may lost in this network environment, so that the static AFEC can not adjust redundant packets immediately.

SAFEC Performance

Figure 5.1 SAFEC vs. non-AFEC

A

B

Generally, as the transmission overhead (H) increase the receiving quality (Q) increasing too. But we can not increase H boundless, because H has great effect upon the packet redundancy. By the way, in our adaptive control design program, we set redundant packets transmission can be interrupt when new RTCP report packets are received. Therefore redundant packets of each transmission block should be limited. Figure 5.2 shows our analysis of Q vs. H up-bound. We can find that maximum H=2 has better receiving quality in different packet loss rate. Therefore we set maximum H=2 to analysis following 3 AFEC schemes simulation.

From above analysis we know that transmission block size also have great effect of receiving quality in our H-Q equation design. H up-bound is set to constant 2, and then the transmission block size is related to original data block size. Figure 5.3 analyzes the effect of data block size versus the receiving quality in different packet loss rate when we fix number of redundant packets. We can find that small data block size has better receiving quality but higher packet redundancy. In packet redundancy illustrate, Figure 5.4, we expect that packet redundancy can be 0% when packet loss rate is lower than 10%. When packet loss rate is too large, it is expected that adaptive controller can stop redundant packet scheme in order to release network bandwidth.

Performance

Figure 5.3 SAFEC performance analysis

SAFEC Performance

Figure 5.4 SAFEC packet redundancy analysis

SAFEC has better performance than non-AFEC in packet loss rate tolerably. The performance of adaptive controller is related to the receiving quality tolerate value, redundant overhead up bound, and original data block size. General multimedia transmission can tolerate packet loss 8%~10%, so that we set our threshold receiving quality is 90%. According to our simulation result we set up-bound of H to 2, because it has better receiving quality in

A

B

our design program although it has higher packet redundancy. Finally, we find that original data block size has effect upon the receiving quality. We can let original data block size larger when packet loss rate is lower than 10% to reduce packet redundancy. On the other hand, small original data block size has more redundant packets per unit time, according to simulation result that it can tolerate more packet loss rate but it also increase packet redundancy.

5.1.2 DAFEC

It is added dynamic original data block size scheme in adaptive controller of AFEC. We combine dynamic H-Q model into AFEC to be dynamic AFEC (DAFEC). Figure 5.5 shows that DAFEC can tolerate 30% packet loss rate to maintain receiving quality higher than 90%.

It shows that DAFEC has better performance than SAFEC. The DAFEC curve is similar to non-AFEC when L≦10%, because we expect DAFEC do not inject too much redundant packets in our design when receiving quality Q≧90%. In Figure 5.6 we can find that packet redundancy still below 5% at L=10%. The receiving quality maintain 91% at L=32%, but packet redundancy is 62% this moment. The maximum tolerate packet redundancy we concerned, as the case may be.

DAFEC Performance

Figure 5.5 DAFEC performance

A

B

DAFEC Performance

Figure 5.6 DAFEC packet redundancy

DAFEC has better performance than SAFEC and non-AFEC. The packet redundancy is lower than 65% in our design program. We still can adjust the redundancy up-bound by setting H of DAFEC. As the packet loss rate increasing, the receiving quality can not fit our threshold quality (90%). DAFEC still can not release the network bandwidth. The H-Q model is still working even though receiving quality too bad to reach QW. It may effect others network traffic when we inject too much useless redundant packets.

5.1.3 AAFEC

Although DAFEC has good performance, it can not release network bandwidth in worse network environment. Therefore we add self-close functionality into DAFEC to be AAFEC.

In Figure 5.7, we set the criteria of self-close scheme is Q≦50%. The adaptive controller will start self-close scheme when receiving quality lower than 50%. Because the packet loss rate is oscillatory, the AAFEC curve is not immediately release network bandwidth when 0.5≦L≦0.7. The adaptive controller will check the gape between Q and QW when the receiving quality higher than 50%. If the gape is too large, we will re-estimate packet loss rate.

Otherwise, we will base on the RTCP report to compute new H. If the Q is better than QW, means that network environment is better than before, so that we try to reduce the R and raise original data block size. On the other hand, we will reduce Nori and increase redundant packets to converge the Nred transmission interval time. Finally, we take new H and new original data block size to compute number of R.

AAFEC Performance

Figure 5.7 AAFEC performance

AAFEC Performance

Figure 5.8 AAFEC packet redundancy

The Figure 5.8 shows that packet redundancy is 0% at L≧0.7, because the self-close scheme is stop the advanced H-Q model to inject redundant packets. At this time, AAFEC is similar to non-AFEC. AAFEC don’t start adaptive controller, until receiving quality Q≧50%.

The different between AAFEC and DAFEC is that AAFEC has self-close scheme to prevent critical network congestion. It not only inherits all the advantage from DDAFEC, but also concern about others network traffic during network congestion. The most advantage of AAFEC is that it can release network bandwidth when network congestion.

A

B

C

D

5.2 Performance Analysis

We propose a H-Q equation and develop three AFEC schemes which have efficiently enhancement of receiving quality performance within network packet random loss. Figure 5.9 shows three versions AFEC and non-AFEC performance comparison. The receiving quality of theses three AFEC schemes are higher than non-AFEC. It shows that we propose adaptive controller can efficiently enhance receiving quality. DAFEC performance is the best of all, but it is also shows that adaptive controller is still working even though network congestion occurred. AAFEC inherit DAFEC advantage, its curve is fit DAFEC when L≦0.5. The most

We propose a H-Q equation and develop three AFEC schemes which have efficiently enhancement of receiving quality performance within network packet random loss. Figure 5.9 shows three versions AFEC and non-AFEC performance comparison. The receiving quality of theses three AFEC schemes are higher than non-AFEC. It shows that we propose adaptive controller can efficiently enhance receiving quality. DAFEC performance is the best of all, but it is also shows that adaptive controller is still working even though network congestion occurred. AAFEC inherit DAFEC advantage, its curve is fit DAFEC when L≦0.5. The most

相關文件