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 IEEE® 802.11ax™ Evaluation Methodology [1] and 3GPP TR 36.814 [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.

A sequence of file transfers of file size (S) and separated by the reading time (D) characterize the FTP application traffic pattern. The reading time specifies the time interval between the end of a file transmission and the start of the subsequent file transmission.

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

  • Local FTP Traffic Model — A truncated log-normal file size and exponential reading time characterize this model.

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

  • FTP Traffic Model 2 — A file size of 0.5 megabytes and exponential reading time characterize this traffic model.

MicrosoftTeams-image (1).png

  • FTP Traffic Model 3 — A file size of 0.5 megabytes and Poisson inter-arrival time (sum of transmission time and reading time) characterize this traffic model [3].

This table shows how to set the networkTrafficFTP object parameters for 11ax and 5G systems.


This example demonstrates how to configure the local FTP traffic model. You can also try running the example with the FTP traffic models 2 and 3.

Configure FTP Application Traffic Pattern Object

Check if the Communications Toolbox Wireless Network Simulation Library support package is installed.


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

% Reset the random number generator

selectFTPTrafficModel = 'localFTPModel';

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

if  strcmp(selectFTPTrafficModel, 'localFTPModel')
    % Set truncated log-normal distribution mu value for file size calculation
    ftpObj.LogNormalMu = 10; 

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

    % Set truncated log-normal distribution upper limit in MB
    ftpObj.UpperLimit = 5;

    % Set exponential distribution mean value for reading time in milliseconds
    ftpObj.ExponentialMean = 100;
    % Set file size in MB
    ftpObj.FixedFileSize = 0.5;

    if strcmp(selectFTPTrafficModel, 'ftpModel2')
        % Set exponential distribution mean value for reading time in milliseconds
        ftpObj.ExponentialMean = 100;
    else % FTP Model 3
        % Set exponential distribution mean value for reading time in milliseconds
        ftpObj.PoissonMean = 100;


Generate and Visualize FTP Application Traffic Pattern

Generate an FTP application traffic pattern using the generate object function of the networkTrafficFTP object. You can also use the addTrafficSource method to add an FTP traffic pattern to New Radio and wireless local area network nodes.

% Set simulation time in milliseconds
simTime = 500;

% Simulation time left
remSimTime = simTime;

% Validate simulation time

% Generated packet count
packetCount = 0;

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

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

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

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

% TCP/IP header size
tcpIPHeaderSize = 40;

% FTP file size in bytes
fileSizes = zeros(simTime,1);

dt = 0; % Time remaining to generate next packet

% Loop over the simulation time, generating FTP application traffic
% pattern and saving the dt and packet size values for visualization.
while remSimTime > 0
    packetCount = packetCount+1; % Increment packet count
    % Call generate method and store outputs for visualization
    [dt, packetSizes(packetCount)] = generate(ftpObj, dt);
    packetIntervals(packetCount) = dt;
    % Remove the TCP/IP header
    packetSizes(packetCount) = packetSizes(packetCount) - tcpIPHeaderSize;
    % Store packet generation time for visualization
    generationTime(packetCount+1) = ...
        generationTime(packetCount) + packetIntervals(packetCount);
    sumPacketSizes(packetCount+1) = ...
        sumPacketSizes(packetCount) + packetSizes(packetCount);
    if dt > 0
        fileSizes(simTime-remSimTime+1) = sumPacketSizes(packetCount+1);
        sumPacketSizes(packetCount+1) = 0;
    % Update simulation time
    remSimTime = remSimTime - dt;

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)
% Plot graph to see packet intervals
pktIntervalsFig = figure(Name='Packet intervals',NumberTitle='off');
pktIntervalsAxes = axes(pktIntervalsFig);
grid on;
title(pktIntervalsAxes,'Packet Number Versus Reading Time');
xlabel(pktIntervalsAxes,'Packet Number');
ylabel(pktIntervalsAxes,'Reading Time in Milliseconds');

% Plot to see different packet sizes
pktSizesFig = figure(Name='Packet sizes',NumberTitle='off');
pktSizesAxes = axes(pktSizesFig);
grid on;
title(pktSizesAxes,'Packet Number Versus Packet Size');
xlabel(pktSizesAxes,'Packet Number');
ylabel(pktSizesAxes,'Packet Size in Bytes');

Visualize the FTP traffic based on the offered traffic and a rough estimate of the transmission time.

% To obtain a correct plot, configure offeredTraffic so that the reading
% time is greater than the transmission time.

% Offered traffic per user in bits per second
offeredTraffic = 40e6;

% Find all file sizes
% Calculate transmission times of the packet in milliseconds
txTime = ceil((fileSizes(tIdx)*8/(offeredTraffic))*1e3);

% Estimate step increment per millisecond
stepIncr = fileSizes(tIdx)./txTime;

% Update file size after each step increment
for i = 1:numel(tIdx)
    fileSizes(tIdx(i)+1:tIdx(i)+txTime(i)) = max(fileSizes(tIdx(i))-a*stepIncr(i),0);

% Stem graph of FTP application traffic pattern (Packet sizes
% different files at different packet generation times)
ftpPatternFig = figure(Name='FTP application traffic pattern', ...
ftpPatternAxes = axes(ftpPatternFig);
stem(ftpPatternAxes, ...
grid on;
title(ftpPatternAxes,'Packet Generation Time Versus File Size');
ylim([0 1.5*max(fileSizes)]);
ylabel(ftpPatternAxes,'File Size in Bytes');
xlabel(ftpPatternAxes,'Time in milliseconds');

Further Exploration

This example generates an FTP traffic pattern, as defined in the 11ax Evaluation Methodology [ 1 ] and 3GPP specification [ 2 ]. Try running the example with these modifications.

  • Use networkTrafficVoIP to generate a voice over internet protocol (VoIP) application traffic pattern.

  • Use networkTrafficOnOff to generate an On-Off application traffic pattern.

  • Use networkTrafficVideoConference to generate a video conference application traffic pattern.

  • Generate FTP acknowledgements by modeling an FTP traffic pattern with fixed packet size of 40 bytes [ 1 ] from client to server.


[ 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.

[ 3 ] 3GPP TR 36.889, "Study on Licensed-Assisted Access to Unlicensed Spectrum", 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

See Also

| |