|
From: Anum N. <nas...@gm...> - 2018-04-30 17:36:54
|
Hi everyone
Is there any way to find delay that packets face in simulation of cooja
simulator?
On Mon, Apr 16, 2018 at 11:42 PM, Sara Ammar <sar...@gm...> wrote:
> Im already use sky mote, but i try to put printf in uip6.c not in my
> application and its finally work.
> Thank you so much for you time
>
> On Mon, Apr 16, 2018 at 3:36 AM Mohammed Mahyoub <mal...@gm...>
> wrote:
>
>> What if you use another mote platform. Sky mote for example .It seems you
>> are using cooja platform.
>>
>> On Mon, Apr 16, 2018, 2:15 AM Sara Ammar <sar...@gm...> wrote:
>>
>>> hello mohammed,
>>> thank you to notifying me about adding " static struct uip_stats
>>> uip_stat;"
>>> i do what you say but there is an error occurred, in fact this error
>>> make me add "static struct uip_stats uip_stat;" in the first place:
>>>
>>> > make udp-client.sky TARGET=sky
>>> fatal: Not a git repository: '../../../.git'
>>> CC udp-client.c
>>> udp-client.c: In function ‘process_thread_udp_client_process’:
>>> udp-client.c:156:22: error: ‘uip_stat’ undeclared (first use in this
>>> function)
>>> udp-client.c:156:22: note: each undeclared identifier is reported only
>>> once for each function it appears in
>>> ../../../Makefile.include:260: recipe for target 'udp-client.co' failed
>>> make: *** [udp-client.co] Error 1
>>> Process returned error code 2
>>>
>>> i hope you know why
>>> thank you so much
>>>
>>>
>>>
>>> On Sun, Apr 15, 2018 at 10:55 PM, Mohammed Mahyoub <mal...@gm...>
>>> wrote:
>>>
>>>> Hello Sara,
>>>> Adding "static struct uip_stats uip_stat;" will result in creating a
>>>> new instance from uip_stats with no link to that already declared in uip.h
>>>> so the result always be zero.
>>>> No need to add that.
>>>> I always do the following :
>>>> add "#define UIP_CONF_STATISTICS 1" to the project-conf.h
>>>> add "printf("%d\n", uip_stat.ip.sent);" to the application file
>>>> (rpl-udp.c for example)
>>>> It works fine.
>>>> I hope this help .
>>>> Best.
>>>>
>>>>
>>>> On Sun, Apr 15, 2018 at 10:20 PM, Sara Ammar <sar...@gm...>
>>>> wrote:
>>>>
>>>>> Thank you Muhammad,
>>>>> i fond the file and used the structure uip_stats, i add "static struct
>>>>> uip_stats uip_stat;" in the beginning of my file(udp-client.c) and add
>>>>> "printf("send %d", uip_stat.ip.sent);" after, befor and in send_packet
>>>>> function but the result is always 0
>>>>> Note: i also try to use icmp, udp and nd6 instead of ip and recv
>>>>> instead of sent but the result is still 0
>>>>> Did i forget something?
>>>>>
>>>>>
>>>>> On Sat, Apr 14, 2018 at 4:04 AM Mohammed Mahyoub <mal...@gm...>
>>>>> wrote:
>>>>>
>>>>>> Hello Sara,
>>>>>> I am sorry for the mistake.
>>>>>> The file I meant is uip.h resided in core/net/ip directory and the
>>>>>> used structure from that file is uip_stats (not uip-stats)
>>>>>> You will find the following:
>>>>>> /**
>>>>>> * The uIP TCP/IP statistics.
>>>>>> *
>>>>>> * This is the variable in which the uIP TCP/IP statistics are
>>>>>> gathered.
>>>>>> */
>>>>>> #if UIP_STATISTICS == 1
>>>>>> extern struct uip_stats uip_stat;
>>>>>> #define UIP_STAT(s) s
>>>>>> #else
>>>>>> #define UIP_STAT(s)
>>>>>> #endif /* UIP_STATISTICS == 1 */
>>>>>>
>>>>>> /**
>>>>>> * The structure holding the TCP/IP statistics that are gathered if
>>>>>> * UIP_STATISTICS is set to 1.
>>>>>> *
>>>>>> */
>>>>>> struct uip_stats {
>>>>>> struct {
>>>>>> uip_stats_t recv; /**< Number of received packets at the IP
>>>>>> layer. */
>>>>>> uip_stats_t sent; /**< Number of sent packets at the IP
>>>>>> layer. */
>>>>>> uip_stats_t forwarded;/**< Number of forwarded packets at the IP
>>>>>> layer. */
>>>>>> uip_stats_t drop; /**< Number of dropped packets at the IP
>>>>>> layer. */
>>>>>> uip_stats_t vhlerr; /**< Number of packets dropped due to wrong
>>>>>> IP version or header length. */
>>>>>> uip_stats_t hblenerr; /**< Number of packets dropped due to wrong
>>>>>> IP length, high byte. */
>>>>>> uip_stats_t lblenerr; /**< Number of packets dropped due to wrong
>>>>>> IP length, low byte. */
>>>>>> uip_stats_t fragerr; /**< Number of packets dropped because they
>>>>>> were IP fragments. */
>>>>>> uip_stats_t chkerr; /**< Number of packets dropped due to IP
>>>>>> checksum errors. */
>>>>>> uip_stats_t protoerr; /**< Number of packets dropped because they
>>>>>> were neither ICMP, UDP nor TCP. */
>>>>>> } ip; /**< IP statistics. */
>>>>>> struct {
>>>>>> uip_stats_t recv; /**< Number of received ICMP packets. */
>>>>>> uip_stats_t sent; /**< Number of sent ICMP packets. */
>>>>>> uip_stats_t drop; /**< Number of dropped ICMP packets. */
>>>>>> uip_stats_t typeerr; /**< Number of ICMP packets with a wrong
>>>>>> type. */
>>>>>> uip_stats_t chkerr; /**< Number of ICMP packets with a bad
>>>>>> checksum. */
>>>>>> } icmp; /**< ICMP statistics. */
>>>>>> #if UIP_TCP
>>>>>> struct {
>>>>>> uip_stats_t recv; /**< Number of recived TCP segments. */
>>>>>> uip_stats_t sent; /**< Number of sent TCP segments. */
>>>>>> uip_stats_t drop; /**< Number of dropped TCP segments. */
>>>>>> uip_stats_t chkerr; /**< Number of TCP segments with a bad
>>>>>> checksum. */
>>>>>> uip_stats_t ackerr; /**< Number of TCP segments with a bad ACK
>>>>>> number. */
>>>>>> uip_stats_t rst; /**< Number of received TCP RST (reset)
>>>>>> segments. */
>>>>>> uip_stats_t rexmit; /**< Number of retransmitted TCP segments.
>>>>>> */
>>>>>> uip_stats_t syndrop; /**< Number of dropped SYNs because too few
>>>>>> connections were available. */
>>>>>> uip_stats_t synrst; /**< Number of SYNs for closed ports,
>>>>>> triggering a RST. */
>>>>>> } tcp; /**< TCP statistics. */
>>>>>> #endif
>>>>>> #if UIP_UDP
>>>>>> struct {
>>>>>> uip_stats_t drop; /**< Number of dropped UDP segments. */
>>>>>> uip_stats_t recv; /**< Number of recived UDP segments. */
>>>>>> uip_stats_t sent; /**< Number of sent UDP segments. */
>>>>>> uip_stats_t chkerr; /**< Number of UDP segments with a bad
>>>>>> checksum. */
>>>>>> } udp; /**< UDP statistics. */
>>>>>> #endif /* UIP_UDP */
>>>>>> #if NETSTACK_CONF_WITH_IPV6
>>>>>> struct {
>>>>>> uip_stats_t drop; /**< Number of dropped ND6 packets. */
>>>>>> uip_stats_t recv; /**< Number of recived ND6 packets */
>>>>>> uip_stats_t sent; /**< Number of sent ND6 packets */
>>>>>> } nd6;
>>>>>> #endif /*NETSTACK_CONF_WITH_IPV6*/
>>>>>> };
>>>>>>
>>>>>> So, you can use the above structure to gather the statistics once it
>>>>>> is enabled.
>>>>>> I hope this help
>>>>>>
>>>>>> On Sat, Apr 14, 2018 at 1:15 AM, Sara Ammar <sar...@gm...>
>>>>>> wrote:
>>>>>>
>>>>>>> Thank you Mohammed Mahyoub,
>>>>>>>
>>>>>>> I search for (uip-stats.h) file but there is no such file in
>>>>>>> contiki -3.0 and 2.7 , when i search for just (stats) i found:
>>>>>>> 1- *print-stats.h* (also print-stats.c /.o/.d) file which
>>>>>>> contain: void print_stats(void); function
>>>>>>> 2- *uip-mcast6-stats.h* which contain: "Header file for IPv6
>>>>>>> multicast forwarding stats maintenance" (also uip-mcast6-stats .c
>>>>>>> files) :
>>>>>>>
>>>>>>> typedef struct uip_mcast6_stats {
>>>>>>> /** Count of unique datagrams received */
>>>>>>> UIP_MCAST6_STATS_DATATYPE mcast_in_unique;
>>>>>>>
>>>>>>> /** Count of all datagrams received */
>>>>>>> UIP_MCAST6_STATS_DATATYPE mcast_in_all;
>>>>>>>
>>>>>>> /** Count of datagrams received for a group that we have joined */
>>>>>>> UIP_MCAST6_STATS_DATATYPE mcast_in_ours;
>>>>>>>
>>>>>>> /** Count of datagrams forwarded by us but we are not the seed */
>>>>>>> UIP_MCAST6_STATS_DATATYPE mcast_fwd;
>>>>>>>
>>>>>>> /** Count of multicast datagrams originated by us */
>>>>>>> UIP_MCAST6_STATS_DATATYPE mcast_out;
>>>>>>>
>>>>>>> /** Count of malformed multicast datagrams seen by us */
>>>>>>> UIP_MCAST6_STATS_DATATYPE mcast_bad;
>>>>>>>
>>>>>>> /** Count of multicast datagrams correclty formed but dropped by
>>>>>>> us */
>>>>>>> UIP_MCAST6_STATS_DATATYPE mcast_dropped;
>>>>>>>
>>>>>>> /** Opaque pointer to an engine's additional stats */
>>>>>>> void *engine_stats;
>>>>>>> } uip_mcast6_stats_t;
>>>>>>>
>>>>>>> 3-*rimestats.h* which contain "Header file for Rime statistics"
>>>>>>> (also *rimestats.c)*
>>>>>>> #ifndef RIMESTATS_H_
>>>>>>> #define RIMESTATS_H_
>>>>>>>
>>>>>>> struct rimestats {
>>>>>>> unsigned long tx, rx;
>>>>>>>
>>>>>>> unsigned long reliabletx, reliablerx,
>>>>>>> rexmit, acktx, noacktx, ackrx, timedout, badackrx;
>>>>>>>
>>>>>>> /* Reasons for dropping incoming packets: */
>>>>>>> unsigned long toolong, tooshort, badsynch, badcrc;
>>>>>>>
>>>>>>> unsigned long contentiondrop, /* Packet dropped due to contention
>>>>>>> */
>>>>>>> sendingdrop; /* Packet dropped when we were sending a packet */
>>>>>>>
>>>>>>> unsigned long lltx, llrx;
>>>>>>> };
>>>>>>>
>>>>>>> #if RIMESTATS_CONF_ENABLED
>>>>>>> /* Don't access this variable directly, use RIMESTATS_ADD and
>>>>>>> RIMESTATS_GET */
>>>>>>> extern struct rimestats rimestats;
>>>>>>>
>>>>>>> #define RIMESTATS_ADD(x) rimestats.x++
>>>>>>> #define RIMESTATS_GET(x) rimestats.x
>>>>>>> #else /* RIMESTATS_CONF_ENABLED */
>>>>>>> #define RIMESTATS_ADD(x)
>>>>>>> #define RIMESTATS_GET(x) 0
>>>>>>> #endif /* RIMESTATS_CONF_ENABLED */
>>>>>>>
>>>>>>> #endif /* RIMESTATS_H_ */
>>>>>>>
>>>>>>> i think you mean this file but im not sure.
>>>>>>> also i try to use printf("sent %d", rimestats.ip.sent); in
>>>>>>> udp-server.c code after PROCESS_BEGIN(); but its not work.
>>>>>>>
>>>>>>> sorry for taking this much of your time but i really need help with
>>>>>>> this, thank you so much
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Apr 12, 2018 at 9:01 PM, Mohammed Mahyoub <
>>>>>>> mal...@gm...> wrote:
>>>>>>>
>>>>>>>> Regarding the statistics.
>>>>>>>> The more details can be found in file uip-stats.h and by enabling RPL_CONF_STATS
>>>>>>>> you can collect information about different layers. For example, network
>>>>>>>> layer , transport layer, and ICMP packets statistics. You can print in your
>>>>>>>> application how many ip, udp, icmp, or tcp packets sent, received ,
>>>>>>>> dropped, ..etc.
>>>>>>>> You can do that by
>>>>>>>> printf("sent %d", uip-stats.ip.sent); for the sent ip packets (as
>>>>>>>> example).
>>>>>>>> Actually you can find all the information you can extract in file
>>>>>>>> uip-stats.h
>>>>>>>> I hope this help.
>>>>>>>> Best regards.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Apr 12, 2018, 7:57 PM Sara Ammar <sar...@gm...>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Hello everyone,
>>>>>>>>> I try to understand how rpl protocol works and i see the file that
>>>>>>>>> related to rpl in cooja, i found in rpl-conf.h file the RPL_CONF_STATS 0
>>>>>>>>> and changing this to 1 enable rpl statistics, but i dont understand what
>>>>>>>>> that mean. I change it and run the simulation but i cant notice any change
>>>>>>>>> in output of mote, also i want to know if the result of sumulation(power
>>>>>>>>> consumption, delay and PRR) effects when changing the speed of simulation (
>>>>>>>>> from no limit to 1000%)
>>>>>>>>> Thank you
>>>>>>>>> ------------------------------------------------------------
>>>>>>>>> ------------------
>>>>>>>>> Check out the vibrant tech community on one of the world's most
>>>>>>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot______
>>>>>>>>> _________________________________________
>>>>>>>>> Contiki-developers mailing list
>>>>>>>>> Con...@li...
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/contiki-developers
>>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------
>>>>>>>> ------------------
>>>>>>>> Check out the vibrant tech community on one of the world's most
>>>>>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>>>>>> _______________________________________________
>>>>>>>> Contiki-developers mailing list
>>>>>>>> Con...@li...
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/contiki-developers
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------
>>>>>>> ------------------
>>>>>>> Check out the vibrant tech community on one of the world's most
>>>>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>>>>> _______________________________________________
>>>>>>> Contiki-developers mailing list
>>>>>>> Con...@li...
>>>>>>> https://lists.sourceforge.net/lists/listinfo/contiki-developers
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Mohammed Ayedh Ahmed Mahyoub
>>>>>> Full-Time Ph.D student
>>>>>> Computer Engineering Department
>>>>>> King Fahd University of Petroleum and Minerals.
>>>>>> Dhahran, Saudi Arabia
>>>>>> 00966 533 587 584
>>>>>> ------------------------------------------------------------
>>>>>> ------------------
>>>>>> Check out the vibrant tech community on one of the world's most
>>>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot______
>>>>>> _________________________________________
>>>>>> Contiki-developers mailing list
>>>>>> Con...@li...
>>>>>> https://lists.sourceforge.net/lists/listinfo/contiki-developers
>>>>>>
>>>>>
>>>>> ------------------------------------------------------------
>>>>> ------------------
>>>>> Check out the vibrant tech community on one of the world's most
>>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>>> _______________________________________________
>>>>> Contiki-developers mailing list
>>>>> Con...@li...
>>>>> https://lists.sourceforge.net/lists/listinfo/contiki-developers
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Mohammed Ayedh Ahmed Mahyoub
>>>> Full-Time Ph.D student
>>>> Computer Engineering Department
>>>> King Fahd University of Petroleum and Minerals.
>>>> Dhahran, Saudi Arabia
>>>> 00966 533 587 584
>>>>
>>>> ------------------------------------------------------------
>>>> ------------------
>>>> Check out the vibrant tech community on one of the world's most
>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>> _______________________________________________
>>>> Contiki-developers mailing list
>>>> Con...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/contiki-developers
>>>>
>>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot______
>>> _________________________________________
>>> Contiki-developers mailing list
>>> Con...@li...
>>> https://lists.sourceforge.net/lists/listinfo/contiki-developers
>>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot______
>> _________________________________________
>> Contiki-developers mailing list
>> Con...@li...
>> https://lists.sourceforge.net/lists/listinfo/contiki-developers
>>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Contiki-developers mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/contiki-developers
>
>
|