主要内容

wlanRateControlARF

Auto rate fallback algorithm

Since R2026a

    Description

    The wlanRateControlARF object enables you to implement the auto rate fallback (ARF) rate control algorithm in a wireless network simulation of a WLAN device.

    Creation

    Description

    arf = wlanRateControlARF creates a default ARF rate control algorithm object.

    arf = wlanRateControlARF(PropertyName=Value) sets properties using one or more name-value arguments. For example, SuccessThreshold=5 sets the value of the successful transmission threshold for the rate increment to 5.

    example

    Properties

    expand all

    Successful transmission threshold for the rate increment, specified as an integer. This value specifies the number of successful transmissions required before the algorithm increments the rate.

    Data Types: single | double

    Failure transmission threshold for the rate decrement, specified as an integer. This value specifies the number of transmission failures required before the algorithm decrements the rate.

    Data Types: single | double

    Examples

    collapse all

    Create an auto rate fallback (ARF) rate control algorithm using the wlanRateControlARF object, and integrate this algorithm into a wireless local area network (WLAN) simulation to dynamically adapt transmission rates.

    Create the network simulator.

    networksimulator = wirelessNetworkSimulator.init;

    Create the ARF rate control object.

    myRC = wlanRateControlARF(SuccessThreshold=5,FailureThreshold=2);

    Create the device configuration for the AP node, and add the custom rate control algorithm.

    deviceCfg = wlanDeviceConfig(Mode="AP",BeaconInterval=5,RateControl=myRC);

    Create an AP node with the custom device configuration.

    apNode = wlanNode(Name="AP",Position=[0 10 0],DeviceConfig=deviceCfg);

    Create an STA node with the default configuration.

    staNode = wlanNode(Name="STA",Position=[5 0 0]);
    

    Add mobility to the STA node.

    addMobility(staNode,BoundaryShape="circle",Bounds=[5 0 60])

    Associate the STA node with the AP node.

    associateStations(apNode,staNode)

    Configure the network for On-Off traffic.

    traffic = networkTrafficOnOff(DataRate=10,PacketSize=10,OnExponentialMean=1.3);
    addTrafficSource(apNode,traffic,DestinationNode=staNode)

    Add the AP and STA nodes to the simulator.

    addNodes(networksimulator,{apNode staNode})

    Run the simulation for 0.4 seconds.

    simulationTime = 0.4;
    run(networksimulator,simulationTime)

    Retrieve the APP, MAC, and PHY statistics at each node by using the statistics object function.

    stats = statistics([apNode staNode],"all");

    Version History

    Introduced in R2026a

    See Also

    Classes