Correct antenna-gain setting on Mikrotik Hardware

Problem:
I’m trying to more deeply understand the /interface wireless ‘antenna-gain=’ setting with regards to what should be set to maximize signal strength in relation to the hardware specifications (i.e., LHG 5). In searching the forums and I found one similar post (http://forum.mikrotik.com/t/question-about-antenna-gain-setting/132133/1). I’ve also read the Mikrotik FAQ(https://wiki.mikrotik.com/wiki/Manual:Wireless_FAQ) and Mikrotik Manual:Interface/Wireless (https://wiki.mikrotik.com/wiki/Manual:Interface/Wireless), but none of these resources answer the question in much detail regarding what should be the recommended setting to both stay within Country Regulations and not transmit more power than the hardware specifications state to prevent damage to wireless cards. I understand ‘tx-power-mode’ set to anything other than default runs the risk of damage with improper settings, but I’ve also been advised by a 3rd party consultant that improper ‘antenna-gain’ can also damage the wireless card over time if set to 0, which I’ve questioned, but haven’t found a clear explanation enough to believe it.

For example, a ‘Mikrotik LHG 5’ specs show Antenna gain dBi for 5 GHz to be ‘24.5’ (https://mikrotik.com/product/RBLHG-5nD), which I’m led to assume this must be the value provided to ‘antenna-gain=’ for this hardware and should not be left set to 0 as seen with a default RouterOS configuration.

*Side note: ‘24.5’ is not a valid value for the ‘antenna-gain=’ setting within ‘/interface wireless’ unless you round up or down 25 or 24 DBi.

Example Config:
/interface wireless
set [ find default-name=wlan1 ] adaptive-noise-immunity=ap-and-client-mode
allow-sharedkey=no ampdu-priorities=0,1,2,3,4,5,6,7 amsdu-limit=8192 amsdu-threshold=
8192 antenna-gain=0 area=“” arp=enabled arp-timeout=auto band=5ghz-a/n
basic-rates-a/g=6Mbps bridge-mode=enabled channel-width=20/40mhz-XX compression=no
country=“united states3” default-ap-tx-limit=0 default-authentication=yes
default-client-tx-limit=0 default-forwarding=yes disable-running-check=no disabled=no
disconnect-timeout=3s distance=dynamic frame-lifetime=0 frequency=auto frequency-mode=
regulatory-domain
frequency-offset=0 guard-interval=any hide-ssid=no ht-basic-mcs=
mcs-0,mcs-1,mcs-2,mcs-3,mcs-4,mcs-5,mcs-6,mcs-7 ht-supported-mcs=“mcs-0,mcs-1,mcs-2,mcs
-3,mcs-4,mcs-5,mcs-6,mcs-7,mcs-8,mcs-9,mcs-10,mcs-11,mcs-12,mcs-13,mcs-14,mcs-15,mcs-16
,mcs-17,mcs-18,mcs-19,mcs-20,mcs-21,mcs-22,mcs-23” hw-fragmentation-threshold=disabled
hw-protection-mode=cts-to-self hw-protection-threshold=0 hw-retries=7 installation=
outdoor interworking-profile=disabled keepalive-frames=enabled l2mtu=1600 mac-address=
XXXXXXXXX max-station-count=2007 mode=bridge mtu=1500 multicast-buffering=
enabled multicast-helper=default name=wlan1 noise-floor-threshold=default
nv2-cell-radius=30 nv2-downlink-ratio=50 nv2-mode=dynamic-downlink
nv2-noise-floor-offset=default nv2-preshared-key=“” nv2-qos=default nv2-queue-count=2
nv2-security=disabled nv2-sync-secret=“” on-fail-retry-time=100ms preamble-mode=both
radio-name=XXXXXXX rate-selection=advanced rate-set=default rx-chains=0,1
scan-list=default secondary-channel=“” security-profile=default ssid=XXXXXXXX
station-bridge-clone-mac=00:00:00:00:00:00 station-roaming=enabled
supported-rates-a/g=6Mbps,9Mbps,12Mbps,18Mbps,24Mbps,36Mbps,48Mbps,54Mbps
tdma-period-size=2 tx-chains=0,1 tx-power-mode=default update-stats-interval=disabled
vlan-id=1 vlan-mode=no-tag wds-cost-range=50-150 wds-default-bridge=none
wds-default-cost=100 wds-ignore-ssid=no wds-mode=disabled wireless-protocol=nv2
wmm-support=disabled wps-mode=disabled

Questions:

  • Is it possible to damage the wireless card of Mikrotik PTP/PTMP hardware if the ‘antenna-gain=0’ if the Country and Frequency Mode are set appropriately (e.g., united states3/regulatory-domain)?
  • If not, then is damage possible if the Country is undefined and Frequency-Mode is set to ‘manual-txpower’ with ‘antenna-gain=0’?

  • Any thoughts are greatly appreciated to fill in the gaps of what I may be missing or not understanding. I also hope answers may help resolve confusion for others seeking understand this as well in the community.

In the wireless tab change the country to your country.

Then select regulatory domain in order to be limited to the frequency channels available for your country and also for the max Tx power you are allowed to use…

Finally, insert the antenna’s gain according to the specifications so that the max transmit power, eirp, can be calculated…the higher the gain you use the lower the Tx power value will be so that you stay inside the regulation limits…

Zacharias, thanks for the response. Per the example config, I’m aware how to set Country and Frequency Mode, but my question really has more to do about concerns with leaving the antenna-gain set to 0. Is there anywhere in Mikrotik documentation that actually describes that the antenna-gain should match the DBi of the specs sheet?

The meaning of antenna-gain is solely to alliw unit to calv+culate correct EIRP as @Zacharias already wrote. And units are dBi which is custommary unit for antenna gain (I haven’t seen it written anywhere in MT documents, but this is common radio knowledge).

If you don’t play with Tx power table, then leaving antenna gain set to 0 won’t hurt hardware, ROS will automatically back-off Tx power for modes which require different Tx profile. Leaving antenna gain set to 0 will only make your station illegal due to excessive EIRP.

Leaving antenna gain set to 0 will only make your station illegal due to excessive EIRP.

@mkx even if he lets Gain to 0 but country is set to regulatory domain then again he will stay within limits… so why is it illegal?

As antennas in small RBs, for example, are usually 2dBi, your AP will be 2dBm stronger than allowed in your country.

Setting antenna gain at a non 0 value will tell the router to subtract that gain to stay with country regulation.

Sent from my cell phone. Sorry for the errors.

Oh yes… how i missed that :frowning:
Although i know we should provide the real gain… my mistake…

The responses and clarification are much appreciated. This discussion has definitely helped me understand much more about the antenna-gain setting and what it does, but it seems like you’d need to manually calculate EIRP in order to figure out if you’re over the legal limit depending on the wireless card unless it’s assumed all wireless cards output would meet the dBm limit with the tx-power-mode set to default. Also, it’s interesting to note that Mikrotik would not code the setting in the RouterOS firmware for device models that have internal or non-replaceable antennas so people with less understanding may avoid illegal dBm using the quickset feature with regards to having the appropriate antenna-gain set. Now I’m curious about finding resources to understand more about calculating EIRP, but I think that is beyond the scope of the the current forum topic.

Thank you all for your knowledge and time!

AFAIK there is no need to specify it for devices with integrated antenna.

Any reference in the wiki for that?

Actually I would like to know the dBm shows in datasheet is EIRP(Board+antenna gain) or just dBm from ROS? For example cAP ac, it has 26dBm for both 2.4G and 5G, but it never tell either it’s 24+2 or 26+2

EIRP (dbm) = Output power - cable/connector losses + Antenna Gain

I cant be sure but i believe the datasheet refers to the total radiated power, so the Antenna’s Gain is included…

This would be very interesting to verify if true since most of the devices I work with have an integrated antenna.

There is no reference in the wiki for that… so…
According to the manual in the Antenna-gain you specify the value of the antenna’s gain… It doesnt say that if its intergrated let it to 0…

Is there any trusty source for that?

I was talking about changes made in this ROS version:
http://forum.mikrotik.com/t/v6-43-11-stable-is-released/127424/1

If I understand this right, in theory, if frequency mode is set to regulatory domain and you have a correct country setting, then ROS won’t let you set antenna gain value lower than needed for EIRP to stay inside country regulations. And as some of the users wrote, that was the exact situation for them - there was some minimal value depending on the country.
However I tried to do so myself now, and I haven’t found any country setting, that won’t let me set antenna gain to zero.

So either there were some other changes that I missed (for example making 0 a new default setting, meaning maximum TX-power for your country, so that you can only lower the TX-power setting the higher gain), or it just don’t work for some reason.

To sum up:

The device itself for sure “knows” the gain of its integrated antennas.
You can check it yourself:

/interface wireless info hw-info wlan1

And it is clear, that from ROS 6.43.11 version if in regulatory-domain mode the device won’t let you fall out of your country regulations somehow.
That’s what the change was about.

The only thing that is not clear for me - what does antenna gain setting represent after all:
Is it “real gain” = “hw gain” + user set “antenna gain”?
Or is it “real gain” = max(“hw gain”, user set “antenna gain”).

xvo in the forum topic you posted someone said that gain exists as a value in the device and you can see it if in terminal type: interface wireless info hw-info wlan1

I tested it, in the result you can see that the antenna’s gain exist even if you haven’t configured it…

So, if the device knows its antenna’s gain, then why should i provide it as well?

Since it knows that its antenna gain is lets say 2 dbi, then why i can change it to 0,1,2,3,4,5 … ?

A few versions back (don’t remember when exactly) MT implemented minimum antenna gain setting for models with fixed/internal antennae. E.g. if built-in antennae have 2dBi gain, then it’s not possible to set this parameter to 0 or 1 … but it is posible to set it higher, e.g. to 10. As ROS will reduce Tx power to maintain max EIRP within country regulations, setting high antenna gain (where in reality it is low) means reduced signal level … and sometimes this is actually good.

I guess you no longer need to.

What needs to be clarified, is what happens when you set something there using frequency-mode=regulatory-domain.

But it still is!
My guess, it just ignores it, if the value is lower than minimum for selected country.