Main Content

Generate and Visualize FTP Application Traffic Pattern

This example shows how to generate a file transfer protocol (FTP) application traffic pattern based on the IEEE® 802.11ax™ Evaluation Methodology [ 1 ] and the 3GPP TR 36.814 specification [ 2 ].

FTP Application Traffic Model

Multinode communication systems involve modeling of different application traffic models. Each application is characterized by parameters such as the data rate, packet inter arrival time, and packet size. To evaluate various algorithms and protocols, standardization bodies such as IEEE and 3GPP define certain application traffic patterns such as Voice over Internet Protocol (VoIP), video conferencing, and FTP. This example generates and visualizes an FTP application traffic pattern.

The FTP application traffic pattern is modeled as a sequence of file transfers separated by reading time. The reading time specifies the time interval between two successive file transfers. The file is generated as multiple packets separated by packet inter arrival time. The packet inter arrival time specifies the time interval between two successive packet transfers.

The 11ax Evaluation Methodology [ 1 ] specifies this FTP application traffic model:

  • Local FTP traffic model - This model is characterized by truncated Lognormal file size and exponential reading time.

The 3GPP TR 36.814 specification [ 2 ] specifies these FTP application traffic models:

  • FTP traffic model 2 - This model is characterized by 2/0.5 megabytes file size and exponential reading time. This figure shows the traffic pattern of this FTP model.

  • FTP traffic model 3 - This model is characterized by a 0.5 megabytes file, exponential reading time, and Poisson packet arrival rate. This figure shows the traffic pattern of this FTP model.

This example demonstrates the local FTP traffic model specified in 11-ax Evaluation Methodology [ 1 ]. Similarly, you can use the FTP traffic models 2 and 3 specified in 3GPP TR 36.814 specification [ 2 ] using the file size and packet arrival rate properties.

Configure FTP Application Traffic Pattern Object

Create a configuration object to generate the FTP application traffic pattern.

% Create FTP application traffic pattern object with default properties
ftpObj = networkTrafficFTP;

% Set exponential distribution mean value for reading time in milliseconds
ftpObj.ExponentialMean = 50;

% Set truncated Lognormal distribution mu value for file size calculation
ftpObj.LogNormalMu = 10;

% Set truncated Lognormal distribution sigma value for file size calculation
ftpObj.LogNormalSigma = 1;

% Set truncated Lognormal distribution upper limit in megabytes
ftpObj.UpperLimit = 5;

% Display object
disp(ftpObj);
  networkTrafficFTP with properties:

               LogNormalMu: 10
            LogNormalSigma: 1
                UpperLimit: 5
           ExponentialMean: 50
    PacketInterArrivalTime: 0
            GeneratePacket: 0

Generate and Visualize FTP Application Traffic Pattern

Generate FTP application traffic pattern using the generate object function of the networkTrafficFTP object.

% Set simulation time in milliseconds
simTime = 10000;

% Set step time in milliseconds
stepTime = 1;

% Validate simTime, simTime must be greater than or equal to stepTime
validateattributes(simTime, {'numeric'}, {'real', 'scalar', 'finite', '>=', stepTime});
rng('default');

% Time after which the generate method must be invoked again
nextInvokeTime = 0;

% Generated packet count
packetCount = 0;

% Initialize arrays to store outputs for visualization
% Packet generation times in milliseconds
generationTime = zeros(5000, 1);

% Time interval between two consecutive packet transfers in milliseconds
packetIntervals = zeros(5000, 1);

% Packet sizes in bytes
packetSizes = zeros(5000, 1);

% Loop over the simulation time, generating FTP application traffic pattern
% and saving the dt and packet size values for visualization
while simTime
    if nextInvokeTime <= 0           % Time to generate the packet
        packetCount = packetCount+1; % Increment packet count
        % Call generate method and store outputs for visualization
        [packetIntervals(packetCount), packetSizes(packetCount)] = generate(ftpObj);
        % Set next invoke time
        nextInvokeTime = packetIntervals(packetCount);
        % Store packet generation time for visualization
        generationTime(packetCount+1) = generationTime(packetCount) + packetIntervals(packetCount);
    end

    % Update next invoke time
    nextInvokeTime = nextInvokeTime - stepTime;

    % Update simulation time
    simTime = simTime - stepTime;
end

Visualize the generated FTP application traffic pattern. In this plot, dt is the time interval between two successive FTP application packets.

% Packet Number Versus Packet Intervals (dt)
% Stem graph to see packet intervals
pktIntervalsFig = figure('Name', 'Packet intervals', 'NumberTitle', 'off');
pktIntervalsAxes = axes(pktIntervalsFig);
stem(pktIntervalsAxes, packetIntervals(1:packetCount));
title(pktIntervalsAxes, 'Packet Number Versus dt');
xlabel(pktIntervalsAxes, 'Packet Number');
ylabel(pktIntervalsAxes, 'dt in Milliseconds');

% Plot to see different packet sizes
pktSizesFig = figure('Name', 'Packet sizes', 'NumberTitle', 'off');
pktSizesAxes = axes(pktSizesFig);
plot(pktSizesAxes, packetSizes(1:packetCount), 'marker', 'o');
title(pktSizesAxes, 'Packet Number Versus Packet Size');
xlabel(pktSizesAxes, 'Packet Number');
ylabel(pktSizesAxes, 'Packet Size in Bytes');

% Stem graph of FTP application traffic pattern (Packet sizes of different files
% at different packet generation times)
ftpPatternFig = figure('Name', 'FTP application traffic pattern', 'NumberTitle', 'off');
ftpPatternAxes = axes(ftpPatternFig);
stem(ftpPatternAxes, generationTime(1:packetCount), packetSizes(1:packetCount), 'Marker', 'o');
title(ftpPatternAxes, 'Packet Generation Time Versus Packet Size');
ylabel(ftpPatternAxes, 'Packet Size in Bytes');
xlabel(ftpPatternAxes, 'Time in Milliseconds');

Further Exploration

This example generates an FTP traffic pattern as per the 11ax Evaluation Methodology [ 1 ] and 3GPP specification [ 2 ]. Similarly, you can use networkTrafficVoIP and networkTrafficOnOff objects to generate VoIP and On-Off application traffic patterns, respectively. You can use these different application traffic patterns in system-level simulations to accurately model the real-world data traffic.

References

  1. IEEE 802.11-14/0571r12 . "11ax Evaluation Methodology". IEEE P802.11. Wireless LANs.

  2. 3GPP TR 36.814. "Evolved Universal Terrestrial Radio Access (E-UTRA). Further advancements for E-UTRA physical layer aspects". 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

See Also

Objects