Generate next FTP, On-Off, VoIP, or video conference application traffic packet
Download Required: To use
first download the Communications Toolbox Wireless Network Simulation Library add-on.
generates the next FTP, On-Off, VoIP, or video application traffic pattern based on the
specified configuration object,
packetSize] = generate(
cfg. The object function returns the
time remaining to generate the next packet,
dt, and the size
of the current packet,
specifies the time elapsed,
packetSize] = generate(
since the previous call of this object function.
Generate VoIP Application Traffic Pattern Without Jitter
Create a VoIP application traffic pattern object, disabling modeling of jitter.
cfgVoIP = networkTrafficVoIP(HasJitter=false);
Generate a VoIP application traffic pattern.
[dt,packetSize] = generate(cfgVoIP);
Generate On-Off Application Traffic Pattern and Data Packet
Create an On-Off application traffic pattern object to generate an On-Off data packet.
cfgOnOff = networkTrafficOnOff(GeneratePacket=true);
Generate an On-Off application traffic pattern and data packet.
[dt,packetSize,packet] = generate(cfgOnOff);
cfg — Configuration object to generate FTP, On-Off, VoIP, or video application traffic pattern
networkTrafficFTP object |
networkTrafficOnOff object |
networkTrafficVoIP object |
Configuration object to generate FTP, On-Off, VoIP, or video application traffic
pattern, specified as a
elapsedTime — Time elapsed since previous call of this object function
Time elapsed in milliseconds since the previous call of this object function, specified as a nonnegative scalar.
dt — Time remaining to generate next packet
Time remaining in milliseconds to generate the next packet, returned as a nonnegative scalar.
packetSize — Size of current packet
Size of the current packet in bytes, returned as a positive scalar.
packet — Application data packet
column vector of integers in the range [0, 255]
Application data packet, returned as a column vector of integers in the range [0,
255]. This value contains the application data specified by the
ApplicationData property. If the
ApplicationData property is not specified,
packet is a column vector of 1s.
To enable this output argument,
GeneratePacket property of the input
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version HistoryIntroduced in R2020b
R2023a: Moved to Communications Toolbox Wireless Network Simulation Library from 5G Toolbox, WLAN Toolbox, and Bluetooth Toolbox
Previously, this network traffic object function required 5G Toolbox™, WLAN Toolbox™, or Bluetooth® Toolbox.