2. simulation of data traffic and video traffic.pdf

Upload: abi

Post on 01-Jun-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 2. SIMULATION OF DATA TRAFFIC AND VIDEO TRAFFIC.pdf

    1/14

    13

    AIM:

    To simulate the data traffic for multiple users and to obtaini. Time slot vs bandwidth plot.

    ii. Time slot vs error rate plot.

    iii. The optimum buffer size for which error rate will be less than stipulated value.

    REQUIREMENTS:

    1. MATLAB

    2. PERSONAL COMPUTER

    ALGORITHM:

    1. Start

    2. Assigning user and channel.

    3. Random matrix is generated. Range is given as (0-50).

    4. Bit rate is calculated.

    5. If the Ton [[0],[t]] is in between 0 and 2 , then d is used.6. If it is in between 2 and 5, then d (2) is used. If total is calculated d(4) is used if it is bit 8

    and 5.

    7. Thus, error is calculated.

    8. G (t) is more than 1.5 Mbps than error has occurred (or) error is not occurred.

    9. Stop

    THEORY:

    A traffic generation model is a stochastic model of traffic flow or data sources in a

    communication network, such as a cellular network or a computer network. A packet generation

    model is a traffic generation model of the packet flows or data sources in a packet-switched

    network. For example, a web traffic model is a model of the data that is sent or received by a

    Ex. No.2.(a) GENERATION OF DATA TRAFFIC Date:

  • 8/9/2019 2. SIMULATION OF DATA TRAFFIC AND VIDEO TRAFFIC.pdf

    2/14

    14

    user's web-browser. These models are useful during development of telecommunication

    technologies, to analyze the performance and capacity of various protocols, algorithms and

    network topologies. There are three types of data that are used to produce pages for comments.

    Information Data:

    This is also known as plain data and enables the pages to be created which comprise strings

    of fixed sized character form a limited character set.

    Formatted Data:

    This is also known as rich data and enables pages and complete documents to be created

    which comprise of strings of the characters of different styles sizes and shapes with tables,

    graphics and images inserted at appropriate points.

    Hyper Data:

    This enables an integrated set of the documents to be crated which have defined linkages

    between them.

  • 8/9/2019 2. SIMULATION OF DATA TRAFFIC AND VIDEO TRAFFIC.pdf

    3/14

    15

    PROGRAM:-

    clear all; close all;clc;

    % Get the no of useruse=input('enter the no of user:');%G the no of time slotts=input('enter the no of time slot:');on=0.35;ton=zeros(use,ts);n=ton;for i=1:usefor j=1:ts

    ton(i,:)=poissrnd((on*10),1,ts);if (ton(i,j)>=3.5)

    n(i,j)=1;endend

    endtest=randint(use,ts,[1,1000]);data=n;for i=1:use

    for j=1:tsif n(i,j)==1

    if test(i,j)>=1 & test(i,j)980 & test(i,j)990 & test(i,j)

  • 8/9/2019 2. SIMULATION OF DATA TRAFFIC AND VIDEO TRAFFIC.pdf

    4/14

    16

    %TIME SLOT VS ERROR RATEe=zeros(1,ts);

    bm=1540000;for i=1:ts

    if d(i)>bme(i)=d(i)-bm;end

    endfigure(2);

    bar(e);xlabel('time slot');ylabel('error rate(bps)');avg=sum(e')/ts;

    ber=avg/bm; buff=0;

    disp('average bit error without buffering:');disp(ber);while ber>1e-6

    buff=buff+10; bm=bm+10;for i=1:ts

    if e(i)>0e(i)=d(i)-bm;

    endends=sum(e');

    ber=s/(ts*bm);enddisp('bit error rate with buffer:');disp(ber);disp('optinum buffer size:');disp(buff);

  • 8/9/2019 2. SIMULATION OF DATA TRAFFIC AND VIDEO TRAFFIC.pdf

    5/14

    17

    OUTPUTEnter the no of user: 80

    Enter the no of time slot: 120

    Average bit error without buffering:

    0.6274

    Bit error rate with buffer:

    9.8282e-007

    Optimum buffer size:

    1851600

  • 8/9/2019 2. SIMULATION OF DATA TRAFFIC AND VIDEO TRAFFIC.pdf

    6/14

    18

    SAMPLE OUTPUT:

    0 20 40 60 80 100 120 1400

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    1.8

    2x 10

    6 TIME SLOT VS ERROR RATE

    time slot in seconds

    e r r o r r a t e i n

    b p s

    0 20 40 60 80 100 120 1400

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    1.8

    2x 10

    6 TIME SLOT VS ERROR RATE

    time slot in seconds

    e r r o r r a t e i n b p s

  • 8/9/2019 2. SIMULATION OF DATA TRAFFIC AND VIDEO TRAFFIC.pdf

    7/14

    19

    EXERCISE

    GENERATION OF DATA TRAFFIC:

    Enter the no of user:

    Enter the no of time slot:

    Find the Error rate with buffer

    Find the Average errorwithout buffering

    Find the Optimum buffer

    size

    RESULT:

    Thus the data traffic was simulated and the following results obtained.

    i. Time slot Vs bandwidth plot.

    ii. Time slot Vs error rate plot.

    iii. The optimum buffer size for which error rate will be less than stipulated value.

  • 8/9/2019 2. SIMULATION OF DATA TRAFFIC AND VIDEO TRAFFIC.pdf

    8/14

    20

    AIM:To simulate the video traffic for multiple users and to obtain

    i. Time slot vs bandwidth plot.

    ii. Time slot vs error rate plot.

    iii. The optimum buffer size for which error rate will be less than stipulated value.

    REQUIREMENTS:

    1. MATLAB

    2. PERSONAL COMPUTER

    ALGORITHM:

    1. Start the program.

    2. Takes the time slot value from 1 to 20.

    3. Set the data rate from 5 to 6 Mbps.

    4. For 5 to 6 Mbps, check for self contained JPEG encoded still pictures

    5. For 3 to 4 Mbps, find out predictive frames

    6. For 2 to 3 Mbps, find out the unidirectional frame which is the difference between the last

    and next frame.

    7. Plot the graph between time slots x axis and data rate in Mbps along y axis

    8. Stop.

    THEORY:

    The Moving Pictures Experts Group abbreviated MPEG is part of the International

    Standards Organization (ISO), and defines standards for digital video and digital audio. The primal task of this group was to develop a format to play back video and audio in real time from

    a CD1. Meanwhile the demands have raised and besides the CD, the DVD2 needs to be

    supported as well as the transmission equipments like satellites and networks. All this

    operational uses are covered by a broad selection of standards. Well known are the standards

    Ex. No.2.(b) GENERATION OF VIDEO TRAFFIC Date:

  • 8/9/2019 2. SIMULATION OF DATA TRAFFIC AND VIDEO TRAFFIC.pdf

    9/14

    21

    MPEG-1, MPEG-2, MPEG-4 and MPEG-7. Each standard provides levels and profiles to

    support special applications in an optimized way.

    MPEG-2 video is an ISO/IEC3 standard that specifies the syntax and semantics of an

    enclosed video bit stream. These include parameters such as bit rates, picture sizes and

    resolutions which may be applied, and how it is decoded to reconstruct the picture. The range of

    possibilities of the MPEG-2 standard is so wide that not all features of the standard are used for

    all applications. MPEG-2 forms the heart of broadcast-quality digital television for both

    standard-definition and high-definition television (SDTV and HDTV). MPEG-2 video was

    designed to encompass MPEG-1 and to provide high quality with interlaced video sources at bit-

    rates in the range of 4-30 Mbit/s.

    H.264/AVC is the latest joint project of the ITU-T VCEG and ISO/IEC MPEG. The

    H.264/AVC design covers a Video Coding Layer (VCL) and a Network Adaptation Layer

    (NAL). Although the VCL design basically follows the design of prior video coding standards

    such as MPEG-2, H.263, and MPEG-4, it contains new features that enable it to achieve a

    significant improvement in compression efficiency in relation to prior coding standards.

  • 8/9/2019 2. SIMULATION OF DATA TRAFFIC AND VIDEO TRAFFIC.pdf

    10/14

    22

    PROGRAM:-

    clear all;close all;clc;

    % Get the Number of Useruse=input('enter the no of user:');% Get the Number of time slotts=input('enter the no of time slot:');on=0.35;ton=zeros(use,ts);n=ton;for i=1:usefor j=1:ts

    ton(i,:)=poissrnd((on*10),1,ts);if (ton(i,j)>=3.5)

    n(i,j)=1;end

    endendtest=randint(use,ts,[1,1000]);data=n;for i=1:use

    for j=1:tsif n(i,j)==1

    if test(i,j)>=1 & test(i,j)bm

  • 8/9/2019 2. SIMULATION OF DATA TRAFFIC AND VIDEO TRAFFIC.pdf

    11/14

    23

    e(i)=d(i)-bm;end

    endfigure(2);

    bar(e);

    xlabel('time slot');ylabel('error rate(bps)');avg=sum(e')/ts;

    ber=avg/bm; buff=0;disp('Average bit error without buffering:');disp(ber);while ber>1e-6

    buff=buff+10; bm=bm+10;for i=1:ts

    if e(i)>0e(i)=d(i)-bm;end

    end

    s=sum(e'); ber=s/(ts*bm);enddisp('Bit error rate with buff:');disp(ber);disp('Optimum buffer size:');disp(buff);

  • 8/9/2019 2. SIMULATION OF DATA TRAFFIC AND VIDEO TRAFFIC.pdf

    12/14

    24

    OUTPUT:

    Enter the no of user: 60

    Enter the no of time slot: 100

    Average bit error without buffering:0.2464

    Bit error rate with buff:

    9.8120e-007

    Optimum buffer size:

    1211730

  • 8/9/2019 2. SIMULATION OF DATA TRAFFIC AND VIDEO TRAFFIC.pdf

    13/14

    25

    SAMPLE OUTPUT

    0 20 40 60 80 100 1200

    2

    4

    6

    8

    10

    12

    14

    16

    18x 10

    5 TIME SLOT VS ERROR RATE

    Time Slot in seconds

    E r r o r R a t e i n b p s

    0 20 40 60 80 100 1200

    0.5

    1

    1.5

    2

    2.5

    3

    3.5x 10

    6 TIME SLOT VS BANDWIDTH

    Time slot in seconds

    B a n d w

    i d t h i n b p s )

  • 8/9/2019 2. SIMULATION OF DATA TRAFFIC AND VIDEO TRAFFIC.pdf

    14/14

    26

    EXERCISE

    GENERATION OF VOICE TRAFFIC:

    Enter the no of user:

    Enter the no of time slot:

    Find the Error rate with buffer

    Find the Average errorwithout buffering

    Find the Optimum buffersize

    RESULT:

    Thus the multiple rate video traffic was simulated for multiple users and the following

    results obtained.

    i. Time slot vs bandwidth plot.

    ii. Time slot vs error rate plot.

    iii. The optimum buffer size for which error rate will be less than stipulated value.