Giter VIP home page Giter VIP logo

Comments (1)

nyrahul avatar nyrahul commented on June 12, 2024

There are two ways to get the statistics without having to parse the logs:

  1. Using the cmd_* OAM commands.
  2. Using the captured pcap files on per node basis.

Using OAM commands

❯ ./scripts/wfshell
wfsh# 
cmd_config_info        cmd_icmp_stats         cmd_nd6_stats          cmd_node_position      cmd_rtsize             cmd_tcp_stats          help                   path_upstream          
cmd_def_route          cmd_ipv6_stats         cmd_node_exec          cmd_route_table        cmd_set_node_position  cmd_udp_stats          native_shell           plot_network_graph     
cmd_get_udpapp_stat    cmd_mac_stats          cmd_node_osname        cmd_rpl_stats          cmd_start_udp          exit                   path_downstream  

To get icmp stats on node 1:

wfsh# cmd_icmp_stats 1
{ "icmp_stats": {
    "rcvd": "26",
    "sent": "22",
    "drop": "0",
    "typeerr": "0",
    "chkerr": "0"
}
}

To get mac stats on node 1:

wfsh# cmd_mac_stats 1
MCAST_PKTS: rx=22,tx=6
UCAST_PKTS: rx=99,tx=101,tx_succ=101,tx_fail=0,tx_attempt1=101,tx_attempt2=0,tx_attempt3=0

Similarly stats for IPv6/RPL/UDP/ICMP/TCP can be handled by the these OAM commands. These OAM commands depend on the stack's API for statistics. If the stack is not compiled with stats on then it wont work.

Using packet capture

This is a generic and guaranteed way to get the stats. Whitefield creates a pcap on per node basis in pcap/ folder.

To get all RPL packets sent/recv to the node ...
tshark -nr pcap/pkt-0-0.pcap -Y "icmpv6.type==155" | wc -l

To get all RPL packets sent from the node ...
tshark -nr pcap/pkt-0-0.pcap -Y "icmpv6.type==155 and ipv6.addr == fe80::ff:fe00:1" | wc -l

To get all UDP packets sent/recv to the node ..
tshark -nr pcap/pkt-0-0.pcap -Y "udp" | wc -l

Note that I am using node-specific pcap here .. hope this helps.

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.