Giter VIP home page Giter VIP logo

Comments (10)

nyrahul avatar nyrahul commented on June 12, 2024

@philok93
The problem with plot-network seems to be contiki-ng specific.
Plot-network works by using cmd_def_route from contiki-ng.

Currently, the default route returned by contiki-ng seems to be incorrect.
image

I use this API in contiki and contiki-ng to query the default route. For contiki-ng this doesn't seem to work!
image

Do you know which is the right API for contiki-ng?

from whitefield.

philok93 avatar philok93 commented on June 12, 2024

I found that you can use uip_ds6_defrt_lookup(uip_ds6_defrt_choose()) to return the default route ip address. Check this shell commands:
https://github.com/contiki-ng/contiki-ng/blob/develop/os/services/shell/shell-commands.c#L632

Here the change:

int cmd_def_route(uint16_t id, char *buf, int buflen)
{
    const uip_ds6_defrt_t *route = uip_ds6_defrt_lookup(uip_ds6_defrt_choose());
    return uiplib_ipaddr_snprint(buf, buflen, &route->ipaddr);
}

I tried it and I notice that at start when network is not formed, the routes all show to node 1:

wfsh# cmd_def_route
sl_cmd "0:cmd_def_route"
fd00::1

sl_cmd "1:cmd_def_route"
fd00::1

sl_cmd "2:cmd_def_route"
fd00::1

sl_cmd "3:cmd_def_route"
fd00::1

sl_cmd "4:cmd_def_route"
fd00::1

sl_cmd "5:cmd_def_route"
fd00::1

sl_cmd "6:cmd_def_route"
fd00::1

sl_cmd "7:cmd_def_route"
fd00::1

Then, it is correct:

wfsh# cmd_def_route
sl_cmd "0:cmd_def_route"
fd00::1

sl_cmd "1:cmd_def_route"
fd00::1

sl_cmd "2:cmd_def_route"
fe80::302:304:506:1

sl_cmd "3:cmd_def_route"
fe80::302:304:506:0

sl_cmd "4:cmd_def_route"
fe80::302:304:506:0

sl_cmd "5:cmd_def_route"
fe80::302:304:506:0

sl_cmd "6:cmd_def_route"
fe80::302:304:506:0

sl_cmd "7:cmd_def_route"
fe80::302:304:506:0

But plotting network still showing mess graph. It should recognise that a valid IPv6 starts with fe80 and not with fd00. So that's why servers have always fd00 default route.

from whitefield.

nyrahul avatar nyrahul commented on June 12, 2024

It was never expected that a stackline will report a global IP prefix in default route. Contiki-ng should fix this.

Whitefield did not take into account network prefix while plotting graphs.
Now it does.
Also, nodes who are not connected will show up in the plots.
@philok93, this should work for you.

from whitefield.

philok93 avatar philok93 commented on June 12, 2024

Yeah thanks a lot! Now works perfectly! :) If you can guide me how to make the graph (position based network graph ) a bit better tell me. I try to plot it but nodes overlap and need some space between them.

from whitefield.

nyrahul avatar nyrahul commented on June 12, 2024

Added a way to scale the position based graph.

Usage:
./scripts/wfshell plot_network_graph tree.png pos.png scale=20
Note the scale=20 parameter scaling the pos.png by 20x.
scale= parameter is applicable only for position based graph.

Appreciate your offer for help but it was a small change in external scripts and hence decided to do it myself. Looking forward to any contribs while you do your experiments.

Hope it helps and thanks for constant feedback.

from whitefield.

philok93 avatar philok93 commented on June 12, 2024

Thanks a lot for your improvement! I will try it and give you my feedback. It should work now.
I needed plotting the topology it to check how far each node is deployed from server because in random topology sometimes nodes don't connect and I believe that are far away.
I really appreciate your help and in my future works I will reference you.

from whitefield.

philok93 avatar philok93 commented on June 12, 2024

I tried and this is the output with 22 nodes and scale=500:

p11

Is the x,y location of the nodes the real one coming from NS3? After executing the whitefield with random topology and scale=200 I got:
p11

So does this mean the position of nodes is fixed? I notice that if I deploy 20 nodes for example with 2 servers, the 1 server is not in RX range of the nodes and no network if formed. That's why in the above figures you see no arrows in some nodes.

from whitefield.

nyrahul avatar nyrahul commented on June 12, 2024

This looks like grid topology, certainly does not look random.
Can you share your config wf.cfg?
x,y location is the real location coming from ns3.

from whitefield.

philok93 avatar philok93 commented on June 12, 2024

This looks like grid topology, certainly does not look random.
Can you share your config wf.cfg?
x,y location is the real location coming from ns3.

Yes you are right, sorry my mistake I didn't change to randrect. I think plotting now works fine!

from whitefield.

nyrahul avatar nyrahul commented on June 12, 2024

Handled.

from whitefield.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.