ramonfontes / reproducible-research

62 stars 35 forks source link

Constant is RSSI in executing Propagation Model twoRayGround and Friis Model #9

Closed harualhassan closed 5 years ago

harualhassan commented 5 years ago

Kindly assist to properly execute twoRayGround and Friis Models. They all give constant RSSI as sta2 moves away from ap

!/usr/bin/python

"Propagation Model Demo"

from mininet.log import setLogLevel, info from mininet.node import Controller from mn_wifi.net import Mininet_wifi from mn_wifi.node import OVSKernelAP from mn_wifi.cli import CLI_wifi

def topology(): "Create a network." net = Mininet_wifi( controller=Controller, accessPoint=OVSKernelAP )

info("*** Creating nodes\n")
ap1 = net.addAccessPoint( 'ap1', ssid='ssid_ap1', txpower='15' , mode='g', channel='1' , position='10,10,0' )
sta1 = net.addStation( 'sta1', ip='192.168.0.1/24', txpower='15' , position='8,10,0' )
sta2 = net.addStation( 'sta2', ip='192.168.0.2/24', txpower='15' , position='11.36,10,0' )

#net.propagationModel(model='logDistance', exp=3, sL=1)
#net.propagationModel(model='ITU', pL=20)
#net.propagationModel(model='logNormalShadowing', sL=2, exp=3, variance=1)
#net.propagationModel(model='friisPropagationLossModel', sL=2)
net.propagationModel(model='twoRayGround')

info("*** Configuring wifi nodes\n")
net.configureWifiNodes()

#info("*** Adding Link\n")
#net.addLink(sta1, ap1)
#net.addLink(sta2, ap1)

net.plotGraph(max_x=120, max_y=20)

info("*** Starting network\n")
net.build()

for i in range(1,71):
    x = 10+i*1.36
    y = 10
    z = 0

    pos = '%s,%s,%s' % (x,y,z)    
    sta2.setPosition(pos)

    info("---------------------\n")    

    #info(sta2.params['position'][0])
    info(sta2.params['position'][0] -  10)
    info("m *** Dist-Sta2-Ap1\n")

    info(sta2.params['rssi'][0])
    info("dBm *** RSSI\n")

info("*** Running CLI\n") 
CLI_wifi( net )

info("*** Stopping network\n")
net.stop()

if name == 'main': setLogLevel( 'info' ) topology() result

1.36m Dist-Sta2-Ap1 -60dBm RSSI

2.72m Dist-Sta2-Ap1 -60dBm RSSI

4.08m Dist-Sta2-Ap1 -60dBm RSSI

5.44m Dist-Sta2-Ap1 -60dBm RSSI

6.8m Dist-Sta2-Ap1 -60dBm RSSI

8.16m Dist-Sta2-Ap1 -60dBm RSSI

9.52m Dist-Sta2-Ap1 -60dBm RSSI

10.88m Dist-Sta2-Ap1 -60dBm RSSI

12.24m Dist-Sta2-Ap1 -60dBm RSSI

13.6m Dist-Sta2-Ap1 -60dBm RSSI

14.96m Dist-Sta2-Ap1 -60dBm RSSI

16.32m Dist-Sta2-Ap1 -60dBm RSSI

17.68m Dist-Sta2-Ap1 -60dBm RSSI

19.04m Dist-Sta2-Ap1 -60dBm RSSI

20.4m Dist-Sta2-Ap1 -60dBm RSSI

21.76m Dist-Sta2-Ap1 -60dBm RSSI

23.12m Dist-Sta2-Ap1 -60dBm RSSI Why is RSSI always constant for both twoRayGround and Friis Models when executed.

ramonfontes commented 5 years ago

Please try friis instead of friisPropagationLossModel. Regarding twoRayGround I forgot to implement it for L213 and L321.

harualhassan commented 5 years ago

Thanks much Remon the Friss has work perfectly. As a beginner how do I fix the model for the twoRayGround Please? Regards Haru

On Tuesday, 4 December 2018, 20:15:49 GMT+1, Ramon Fontes <notifications@github.com> wrote:  

Please try friis instead of friisPropagationLossModel. Regarding twoRayGround I forgot to implement it for L213 and L321.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.