Simon Duquennoy | 2 Jan 2012 10:37
Picon
Picon

Re: csma operation with full queue

Hi,

As there is one transmit_timer per neighbor queue, you shouldn't have to do this. In the code snippet you're showing, the timer of the current neighbor is stopped before freeing the neighbor structure. Other neighbor queues remain active, and their timer will eventually trigger.
To answer the question in your previous email, there is no centralized decision selecting the next neighbor to send to. Instead, each neighbor has its own ctimer implementing the csma backoff, and the transmissions are triggered independently.

Regards,
Simon

On 27/12/2011 21:02, Mohammad Abdellatif wrote:
i think i managed a work around it..
in csma.c
the function free_first_packet
in the end after the main queue is finished and freed.. i added this in order to send any remaining packets in the other queue.
      else {
      /* This was the last packet in the queue, we free the neighbor */
      ctimer_stop(&n->transmit_timer);
      list_remove(neighbor_list, n);
      memb_free(&neighbor_memb, n);
     
// my addition
      struct neighbor_queue *n = list_head(neighbor_list);
      if(n != NULL) {
      transmit_packet_list(n);
}
//
   } 

so far the problem hasnt appeared, but i am still doing some tests.
will keep u posted

Mohammad Abdellatif

Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN 




On Tue, Dec 27, 2011 at 4:34 PM, Mohammad Abdellatif <moh.abdellatif-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Iam beginning to think that the problem is related to the neighbor queue
the node sends the packets from one queue only while the the other queue backs up until it is full which causes the problem..
in my case, each nodes r arranged in a row, what happens is that the neighbor queue in the direction of the sink is not full while the other one is "in the direction of the other nodes" , then this node cant forward the packets to the sink however it can still generate its own packets and reply to messages coming from the sink.

can any one tell me where is the function responsible for sending queued packets and how does it select which neighbor queue to send from first?

thaks,


Mohammad Abdellatif

Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN 




On Thu, Dec 22, 2011 at 7:00 PM, Mohammad Abdellatif <moh.abdellatif-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
i still dont know why does the prints from queuebuf.c and from csma.c shows different sizes of the queue buffer.. they decrease together when the csma does a retransmission.. however when this problem happens, the size from the queubuf.c increases while the size from the csma.c stays the same!!!!
as soon as the size reaches the max, csma start saying that it cant allocate the packet.


Mohammad Abdellatif

Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN 




On Thu, Dec 22, 2011 at 6:52 PM, Mohammad Abdellatif <moh.abdellatif-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
when i send i just use uip_udp_packet_sendto .. it should handle all the packetbuf work. right?


Mohammad Abdellatif

Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN 




On Thu, Dec 22, 2011 at 3:12 PM, David Kopf <dak664-2p+qKb8Fl0QN+BqQ9rBEUg@public.gmane.org> wrote:
Do e.g. $ objdump -t --section=.bss webserver6.avr-raven. On avr builds the queue buffers are in the middle of .bss so stack
overflow would affect other things first (the last entry is uip_udp_conns).

However writing off the end of packetbuf would set the bufmem count array to show no free entries. Do you memcpy or sprintf to that
using a variable size?

00800cba l     O .bss   00000002 packetbufptr
00800cbc l     O .bss   000000b2 packetbuf_aligned
00800d6e l     O .bss   0000000f bufmem_memb_count
00800d7d l     O .bss   0000001e bufmem_memb_mem
00800d9b l     O .bss   00000002 refbufmem_memb_count
00800d9d l     O .bss   0000006a refbufmem_memb_mem
00800e07 l     O .bss   0000000f buframmem_memb_count
00800e16 l     O .bss   00000c4e buframmem_memb_mem
00801a68 l     O .bss   00000002 lastport

-----Original Message-----
From: Mohammad Abdellatif
Sent: Thursday, December 22, 2011 9:15 AM
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] csma operation with full queue

i am pretty sure this is the problem.. can u help me with doing that if u have the time?
thanks,

Mohammad Abdellatif


Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN
http://win.inescporto.pt/mma





On Wed, Dec 21, 2011 at 6:47 PM, David Kopf <dak664-2p+qKb8Fl0QN+BqQ9rBEUg@public.gmane.org> wrote:
Do your own scan for free slots before adding and after removing an entry.  A stack overwrite would make that number change
abruptly.


-----Original Message-----
From: Mohammad Abdellatif

Sent: Wednesday, December 21, 2011 12:08 PM
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] csma operation with full queue

after enabling the debug in queuebuf.. i can see that the queue gets full.. however csma still says that the queue is not full which
i cant seem to understand why.




------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Contiki-developers mailing list
Contiki-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/contiki-developers






------------------------------------------------------------------------------ Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev

_______________________________________________ Contiki-developers mailing list Contiki-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/contiki-developers
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Contiki-developers mailing list
Contiki-developers@...
https://lists.sourceforge.net/lists/listinfo/contiki-developers
Mohammad Abdellatif | 2 Jan 2012 19:44
Picon

Re: csma operation with full queue

yeah i guess u r right.. however, what i do is a kinda of a speedup to the process. instead of waiting for the other queue's timer to expire.
it is still did not solve the problem completely, i will try to do more work on it and keep u posted if i reach something solid.
thanks,
 
Mohammad Abdellatif


Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN 




On Mon, Jan 2, 2012 at 9:37 AM, Simon Duquennoy <simonduq <at> sics.se> wrote:
Hi,

As there is one transmit_timer per neighbor queue, you shouldn't have to do this. In the code snippet you're showing, the timer of the current neighbor is stopped before freeing the neighbor structure. Other neighbor queues remain active, and their timer will eventually trigger.
To answer the question in your previous email, there is no centralized decision selecting the next neighbor to send to. Instead, each neighbor has its own ctimer implementing the csma backoff, and the transmissions are triggered independently.

Regards,
Simon


On 27/12/2011 21:02, Mohammad Abdellatif wrote:
i think i managed a work around it..
in csma.c
the function free_first_packet
in the end after the main queue is finished and freed.. i added this in order to send any remaining packets in the other queue.
      else {
      /* This was the last packet in the queue, we free the neighbor */
      ctimer_stop(&n->transmit_timer);
      list_remove(neighbor_list, n);
      memb_free(&neighbor_memb, n);
     
// my addition
      struct neighbor_queue *n = list_head(neighbor_list);
      if(n != NULL) {
      transmit_packet_list(n);
}
//
   } 

so far the problem hasnt appeared, but i am still doing some tests.
will keep u posted

Mohammad Abdellatif

Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN 




On Tue, Dec 27, 2011 at 4:34 PM, Mohammad Abdellatif <moh.abdellatif-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Iam beginning to think that the problem is related to the neighbor queue
the node sends the packets from one queue only while the the other queue backs up until it is full which causes the problem..
in my case, each nodes r arranged in a row, what happens is that the neighbor queue in the direction of the sink is not full while the other one is "in the direction of the other nodes" , then this node cant forward the packets to the sink however it can still generate its own packets and reply to messages coming from the sink.

can any one tell me where is the function responsible for sending queued packets and how does it select which neighbor queue to send from first?

thaks,


Mohammad Abdellatif

Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN 




On Thu, Dec 22, 2011 at 7:00 PM, Mohammad Abdellatif <moh.abdellatif-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
i still dont know why does the prints from queuebuf.c and from csma.c shows different sizes of the queue buffer.. they decrease together when the csma does a retransmission.. however when this problem happens, the size from the queubuf.c increases while the size from the csma.c stays the same!!!!
as soon as the size reaches the max, csma start saying that it cant allocate the packet.


Mohammad Abdellatif

Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN 




On Thu, Dec 22, 2011 at 6:52 PM, Mohammad Abdellatif <moh.abdellatif <at> gmail.com> wrote:
when i send i just use uip_udp_packet_sendto .. it should handle all the packetbuf work. right?


Mohammad Abdellatif

Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN 




On Thu, Dec 22, 2011 at 3:12 PM, David Kopf <dak664 <at> embarqmail.com> wrote:
Do e.g. $ objdump -t --section=.bss webserver6.avr-raven. On avr builds the queue buffers are in the middle of .bss so stack
overflow would affect other things first (the last entry is uip_udp_conns).

However writing off the end of packetbuf would set the bufmem count array to show no free entries. Do you memcpy or sprintf to that
using a variable size?

00800cba l     O .bss   00000002 packetbufptr
00800cbc l     O .bss   000000b2 packetbuf_aligned
00800d6e l     O .bss   0000000f bufmem_memb_count
00800d7d l     O .bss   0000001e bufmem_memb_mem
00800d9b l     O .bss   00000002 refbufmem_memb_count
00800d9d l     O .bss   0000006a refbufmem_memb_mem
00800e07 l     O .bss   0000000f buframmem_memb_count
00800e16 l     O .bss   00000c4e buframmem_memb_mem
00801a68 l     O .bss   00000002 lastport

-----Original Message-----
From: Mohammad Abdellatif
Sent: Thursday, December 22, 2011 9:15 AM
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] csma operation with full queue

i am pretty sure this is the problem.. can u help me with doing that if u have the time?
thanks,

Mohammad Abdellatif


Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN
http://win.inescporto.pt/mma





On Wed, Dec 21, 2011 at 6:47 PM, David Kopf <dak664-2p+qKb8Fl0QN+BqQ9rBEUg@public.gmane.org> wrote:
Do your own scan for free slots before adding and after removing an entry.  A stack overwrite would make that number change
abruptly.


-----Original Message-----
From: Mohammad Abdellatif

Sent: Wednesday, December 21, 2011 12:08 PM
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] csma operation with full queue

after enabling the debug in queuebuf.. i can see that the queue gets full.. however csma still says that the queue is not full which
i cant seem to understand why.




------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Contiki-developers mailing list
Contiki-developers-5NWGOfrQmndRYHbF4JBHZw@public.gmane.orgge.net
https://lists.sourceforge.net/lists/listinfo/contiki-developers






------------------------------------------------------------------------------ Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev

_______________________________________________ Contiki-developers mailing list Contiki-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/contiki-developers

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Contiki-developers mailing list
Contiki-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/contiki-developers


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Contiki-developers mailing list
Contiki-developers@...
https://lists.sourceforge.net/lists/listinfo/contiki-developers
Mohammad Abdellatif | 18 Jan 2012 13:56
Picon

Re: csma operation with full queue

Hey
i am still having the same error
the csma freezes at some point "random" and so the queue gets full
it sends new generated packets however it doesnt  forward the ones who are already in the queue and drops any new incoming packets.
i tried reducing the sending rate to 1 packet per minute and still this error sometimes happen.
not sure what to do more.. any ideas?

Mohammad Abdellatif


Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN 




On Mon, Jan 2, 2012 at 6:44 PM, Mohammad Abdellatif <moh.abdellatif-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
yeah i guess u r right.. however, what i do is a kinda of a speedup to the process. instead of waiting for the other queue's timer to expire.
it is still did not solve the problem completely, i will try to do more work on it and keep u posted if i reach something solid.

thanks,
 
Mohammad Abdellatif

Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN 




On Mon, Jan 2, 2012 at 9:37 AM, Simon Duquennoy <simonduq-02ecni/8Nmo@public.gmane.org> wrote:
Hi,

As there is one transmit_timer per neighbor queue, you shouldn't have to do this. In the code snippet you're showing, the timer of the current neighbor is stopped before freeing the neighbor structure. Other neighbor queues remain active, and their timer will eventually trigger.
To answer the question in your previous email, there is no centralized decision selecting the next neighbor to send to. Instead, each neighbor has its own ctimer implementing the csma backoff, and the transmissions are triggered independently.

Regards,
Simon


On 27/12/2011 21:02, Mohammad Abdellatif wrote:
i think i managed a work around it..
in csma.c
the function free_first_packet
in the end after the main queue is finished and freed.. i added this in order to send any remaining packets in the other queue.
      else {
      /* This was the last packet in the queue, we free the neighbor */
      ctimer_stop(&n->transmit_timer);
      list_remove(neighbor_list, n);
      memb_free(&neighbor_memb, n);
     
// my addition
      struct neighbor_queue *n = list_head(neighbor_list);
      if(n != NULL) {
      transmit_packet_list(n);
}
//
   } 

so far the problem hasnt appeared, but i am still doing some tests.
will keep u posted

Mohammad Abdellatif

Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN 




On Tue, Dec 27, 2011 at 4:34 PM, Mohammad Abdellatif <moh.abdellatif-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Iam beginning to think that the problem is related to the neighbor queue
the node sends the packets from one queue only while the the other queue backs up until it is full which causes the problem..
in my case, each nodes r arranged in a row, what happens is that the neighbor queue in the direction of the sink is not full while the other one is "in the direction of the other nodes" , then this node cant forward the packets to the sink however it can still generate its own packets and reply to messages coming from the sink.

can any one tell me where is the function responsible for sending queued packets and how does it select which neighbor queue to send from first?

thaks,


Mohammad Abdellatif

Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN 




On Thu, Dec 22, 2011 at 7:00 PM, Mohammad Abdellatif <moh.abdellatif-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
i still dont know why does the prints from queuebuf.c and from csma.c shows different sizes of the queue buffer.. they decrease together when the csma does a retransmission.. however when this problem happens, the size from the queubuf.c increases while the size from the csma.c stays the same!!!!
as soon as the size reaches the max, csma start saying that it cant allocate the packet.


Mohammad Abdellatif

Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN 




On Thu, Dec 22, 2011 at 6:52 PM, Mohammad Abdellatif <moh.abdellatif <at> gmail.com> wrote:
when i send i just use uip_udp_packet_sendto .. it should handle all the packetbuf work. right?


Mohammad Abdellatif

Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN 




On Thu, Dec 22, 2011 at 3:12 PM, David Kopf <dak664 <at> embarqmail.com> wrote:
Do e.g. $ objdump -t --section=.bss webserver6.avr-raven. On avr builds the queue buffers are in the middle of .bss so stack
overflow would affect other things first (the last entry is uip_udp_conns).

However writing off the end of packetbuf would set the bufmem count array to show no free entries. Do you memcpy or sprintf to that
using a variable size?

00800cba l     O .bss   00000002 packetbufptr
00800cbc l     O .bss   000000b2 packetbuf_aligned
00800d6e l     O .bss   0000000f bufmem_memb_count
00800d7d l     O .bss   0000001e bufmem_memb_mem
00800d9b l     O .bss   00000002 refbufmem_memb_count
00800d9d l     O .bss   0000006a refbufmem_memb_mem
00800e07 l     O .bss   0000000f buframmem_memb_count
00800e16 l     O .bss   00000c4e buframmem_memb_mem
00801a68 l     O .bss   00000002 lastport

-----Original Message-----
From: Mohammad Abdellatif
Sent: Thursday, December 22, 2011 9:15 AM
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] csma operation with full queue

i am pretty sure this is the problem.. can u help me with doing that if u have the time?
thanks,

Mohammad Abdellatif


Phd student at Faculty of Engineering University of Porto (FEUP)
Researcher at Inesc Porto, UTM, WiN
http://win.inescporto.pt/mma





On Wed, Dec 21, 2011 at 6:47 PM, David Kopf <dak664-2p+qKb8Fl0QN+BqQ9rBEUg@public.gmane.org> wrote:
Do your own scan for free slots before adding and after removing an entry.  A stack overwrite would make that number change
abruptly.


-----Original Message-----
From: Mohammad Abdellatif

Sent: Wednesday, December 21, 2011 12:08 PM
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] csma operation with full queue

after enabling the debug in queuebuf.. i can see that the queue gets full.. however csma still says that the queue is not full which
i cant seem to understand why.




------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Contiki-developers mailing list
Contiki-developers-5NWGOfrQmndRYHbF4JBHZw@public.gmane.orgge.net
https://lists.sourceforge.net/lists/listinfo/contiki-developers






------------------------------------------------------------------------------ Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev

_______________________________________________ Contiki-developers mailing list Contiki-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/contiki-developers

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Contiki-developers mailing list
Contiki-developers@...
https://lists.sourceforge.net/lists/listinfo/contiki-developers

Gmane