Table Of Contents
Table Of Contents

Step 14. Introducing antenna gain

Goals

In the previous steps, we have assumed an isotropic antenna for the radio, with a gain of 1 (0dB). Here we want to enhance the simulation by taking antenna gain into account.

The model

For simplicity, we configure the hosts to use ConstantGainAntenna. ConstantGainAntenna is an abstraction: it models an antenna that has a constant gain in the directions relevant for the simulation, regardless of how such an antenna could be implemented in real life. For example, if all nodes of a simulated wireless network are on the same plane, ConstantGainAntenna could correspond to an omnidirectional antenna such as a vertical dipole. (INET contains support for directional antennas as well.)

[Config Wireless14]
description = Introducing antenna gain
extends = Wireless13

*.host*.wlan[0].radio.antenna.typename = "ConstantGainAntenna"
*.host*.wlan[0].radio.antenna.gain = 3dB

Results

With the added antenna gain, the transmissions are powerful enough to require only two hops to get to host B every time, as opposed to the previous step, where it sometimes required three. Therefore, at the beginning of the simulation, host R1 can reach host B directly. Also, host R1 goes out of host A’s communication range only at the very end of the simulation. When this happens, host A’s transmission is routed through host R2, which is again just two hops.

Number of packets received by host B: 1045

Sources: omnetpp.ini, WirelessC.ned

Discussion

Use this page in the GitHub issue tracker for commenting on this tutorial.