주요 콘텐츠

addTrafficSource

Add data traffic source to 5G NR node

Since R2023a

    Description

    addTrafficSource(nrNode,trafficSource) adds a data traffic source, trafficSource, to a new radio (NR) node, nrNode. Note that nrNode automatically calls the generate object function associated with the specified traffic pattern object to generate the corresponding application traffic. This feature also requires the Wireless Network Toolbox™ product.

    addTrafficSource(___,Name=Value) specifies additional options by using name-value arguments, in addition to the input arguments in the previous syntax. For example, LogicalChannelID=5 sets the logical channel identifier to 5.

    Note

    • Each time you call this object function, you add a traffic generator (source) to a 5G NR node. You can add multiple traffic sources to a node, directing them to the same or different destination nodes.

    • Reusing the same traffic source object in another addTrafficSource object function call results in an error.

    example

    Examples

    collapse all

    Initialize wireless network simulator.

    networkSimulator = wirelessNetworkSimulator.init;

    Create a gNB node with these specifications.

    • Duplex mode — Time division duplex

    • Channel bandwidth — 20 MHz

    • Subcarrier spacing — 30 KHz

    gnb = nrGNB(ChannelBandwidth=20e6,DuplexMode="TDD",SubcarrierSpacing=30e3);

    Create a UE node with a transmit power of 20 dBm.

    ue = nrUE(TransmitPower=20);

    Add a random way point mobility model to the UE node.

    addMobility(ue,BoundaryShape="rectangle")

    Establish a connection between the UE and gNB nodes.

    connectUE(gnb,ue)

    Create a voice over Internet protocol (VoIP) application traffic pattern object.

    traffic = networkTrafficVoIP;

    Add the data traffic source to the gNB node. Set the destination node as the UE node.

    addTrafficSource(gnb,traffic,DestinationNode=ue)

    Add the gNB node to the wireless network simulator.

    addNodes(networkSimulator,gnb)

    Add the UE node to the wireless network simulator.

    addNodes(networkSimulator,ue)

    Specify the simulation time, in seconds.

    simulationTime = 0.3;

    Run the simulation for the specified simulation time.

    run(networkSimulator,simulationTime)

    Obtain the statistics for the gNB and UE nodes.

    gnbStats = statistics(gnb);
    ueStats = statistics(ue);

    Input Arguments

    collapse all

    5G NR node, specified as one of these options:

    • nrGNB object. You can assign only a scalar nrGNB object.

    • nrUE object. You can assign one or more nodes of type nrUE by passing a vector of nrUE objects. This allows you to install uplink application traffic on multiple UEs simultaneously.

    Traffic pattern object, specified as one of these options.

    Note that the GeneratePacket property of the traffic objects does not apply to the NR nodes because the NR nodes always generates an application packet with payload.

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: addTrafficSource(nrNode,trafficSource,LogicalChannelID=5) adds a traffic source to logical channel 5 of the specified NR node

    Destination node, specified as an nrUE object or nrGNB object. If nrNode is an nrGNB, you must set the destination node to an nrUE object. If nrNode is an nrUE object, setting this name-value argument is optional. If you do not specify this name-value argument in the case nrNode is an nrUE object, the object function automatically sets DestinationNode to the nrGNB object with which the UE has already established a connection.

    You can add downlink application traffic to multiple UEs by specifying the destination node as a vector of objects of type nrUE. (since R2026a)

    Logical channel identifier, specified as an integer in the range [4, 32]. The function maps the added traffic to the specified logical channel.

    If you do not specify LogicalChannelID, the function maps the added traffic to the established logical channel with the smallest ID number.

    Data Types: double

    References

    [1] 3GPP TS 38.321. “NR; Medium Access Control (MAC) protocol specification.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

    Version History

    Introduced in R2023a

    expand all

    See Also

    Objects

    Functions

    Topics