Hi,
I understand that you are trying to reduce the latency values.
The example you have pointed out calculates the latency observed at the receiver node's application.
You can try any combination of the following suggestions to reduce the latency values.
Queueing delay reduction:
- This is the amount of time spent by the packet in the queue (of the MAC layer) waiting for its turn for transmission.
- To reduce this delay, application traffic rate should be as low as possible so that the packets do not get accumulated waiting for other packets to be sent out. See this example to know how to add custom application traffic with configurable data traffic rate. Simulate an 802.11ax Network with Uplink and Downlink Application Traffic
Channel Contention reduction:
- This is the amount of time spent by the MAC layer contending for the medium before it can start the transmission on the wireless channel
- Contention time can be reduced by lower number of transmitters and lower contention parameters. You can try setting either only downlink or only uplink traffic and using low values for CWMin, CWMax, and AIFS values. See wlanDeviceConfig for contention parameters configuration. See Simulate an 802.11ax Network with Uplink and Downlink Application Traffic example for setting unidirectional traffic.
Packet Transmission Time reduction:
- This is the time taken for the packet to be transmitted from the transmitter to the receiver (Note that propagation delay over the air is not modeled in the example).
- Packet transmission time can be reduced by using higher PHY data rates. Higher PHY data rates can be acheived by setting high values for any of MCS, ChannelBandwidth, NumTransmitAntennas, and NumSpaceTimeStreams. See wlanDeviceConfig for these configuration parameters.
- Note that at higher PHY data rates, distance between nodes may need to be reduced due to lowered range of transmission.
Hope this helps!