Baptiste Chaboud-crousaz | 2 Apr 09:55 2009

SNMP trap

Hi all,

I would like to send a SNMP trap. I know that lwIP offers to do that tanks to a call to :

err_t snmp_send_trap(s8_t generic_trap, struct snmp_obj_id *eoid, s32_t specific_trap);

But, I don't understand how to fill in the global structure trap_msg in order to include some variable bindings.

Would it be possible to have an example that shows how to fill in trap_msg with 1 or 2 variables bindings?

Thanks.
Best Regards.
Baptiste Chaboud-Crousaz

_______________________________________________
lwip-users mailing list
lwip-users@...
http://lists.nongnu.org/mailman/listinfo/lwip-users
Domen Puncer | 2 Apr 12:09 2009

ignored packets?

Hello!

My setup: PC, Linux - ARM7 (LPC2388) with lwIP 1.3.0, FreeRTOS 5.1.2
(but still NO_SYS, all is handled in one task, using rawapi)

My protocol on top of TCP is basically:
1. Make N connections.
then for each connection:
2. Send requests from lwIP
3.a NODATA reply, wait a bit, goto 2
3.b DATA reply, receive 200-400kB of data
4. Send ack, wait a bit, goto 2

I'm (rarely) seeing this problem (see also attached .pcaps,
192.168.101.128 - PC, 192.168.101.115 - lwIP):
Packets just seem to be ignored, so my check for connection
inactivity kicks in, and i call tcp_abort().

Wireshark shows the packets are being sent to lwIP, but all
of the sudden, it just "forgets to reply with ack"? Other connections
still work.

It would make sense if packets were dropped, but it doesn't look so from
lwip_stats (see end of message).

It always seems to happen when these small requests are transferring, and
not when actual data goes from PC to lwIP.

What can I try to track this down? It only seems to appear once in couple
of MB of traffic, so that makes it tricky to do debug printouts.

A completely different question is: how hard would it be to add support
for dual size packets (ie. one for these requests and other for "data")?
Any pointers to code areas or maybe even patches?

Thank you!

	Domen

My receive callback is basically something like:

	if (pbuf == NULL) {
		tcp_close(pcb);
		return ERR_OK;
	}
	rx_len = 0;
	while (pbuf) {
		handle_data
		rx_len += pbuf->len;
		pbuf = pbuf->next;
	}
	tcp_recved(pcb, rx_len);
	pbuf_free(pbuf_orig);

Data is sent with tcp_write followed by tcp_output.

(gdb) p lwip_stats 
$1 = {
 link = {xmit = 20330, rexmit = 0, recv = 39220, fw = 0, drop = 0, chkerr = 0,
    lenerr = 0, memerr = 0, rterr = 0, proterr = 0, opterr = 0, err = 0, cachehit = 0}, 
 etharp = {xmit = 10, rexmit = 0, recv = 5, fw = 0, drop = 0, chkerr = 0,
   lenerr = 0, memerr = 0, rterr = 0, proterr = 0, opterr = 0, err = 0, cachehit = 39727},
 ip_frag = {xmit = 0, rexmit = 0, recv = 0, fw = 0, drop = 0, chkerr = 0,
    lenerr = 0, memerr = 0, rterr = 0, proterr = 0, opterr = 0, err = 0, cachehit = 0},
 ip = {xmit = 20320, rexmit = 0, recv = 19605, fw = 0, drop = 0, chkerr = 0,
   lenerr = 0, memerr = 0, rterr = 0, proterr = 0, opterr = 0, err = 0, cachehit = 0},
 icmp = {xmit = 0, rexmit = 0, recv = 0, fw = 0, drop = 0, chkerr = 0,
   lenerr = 0, memerr = 0, rterr = 0, proterr = 0, opterr = 0, err = 0, cachehit = 0},
 udp = {xmit = 0, rexmit = 0, recv = 103, fw = 0, drop = 0, chkerr = 0,
   lenerr = 0, memerr = 0, rterr = 0, proterr = 0, opterr = 0, err = 0, cachehit = 0},
 tcp = {xmit = 2735, rexmit = 0, recv = 19502, fw = 0, drop = 0, chkerr = 0,
   lenerr = 0, memerr = 0, rterr = 0, proterr = 0, opterr = 0, err = 0, cachehit = 0},
 mem = {avail = 6400, used = 168, max = 1680, err = 0},
 memp = {
 {avail = 4, used = 0, max = 0, err = 0},
 {avail = 4, used = 0, max = 0, err = 0},
 {avail = 31, used = 10, max = 11, err = 0},
 {avail = 8, used = 0, max = 0, err = 0},
 {avail = 32, used = 2, max = 11, err = 0},
 {avail = 5, used = 0, max = 0, err = 0},
 {avail = 30, used = 0, max = 10, err = 0},
 {avail = 33, used = 1, max = 10, err = 0},
 {avail = 16, used = 0, max = 3, err = 0}},
 sys = { sem = {used = 0, max = 0, err = 0}, mbox = {used = 0, max = 0, err = 0}}}

Attachment (ignored_4118.pcap): application/cap, 3979 bytes
Attachment (ignored_4177.pcap): application/cap, 1481 bytes
_______________________________________________
lwip-users mailing list
lwip-users@...
http://lists.nongnu.org/mailman/listinfo/lwip-users
Kieran Mansley | 2 Apr 12:17 2009

Re: ignored packets?

On Thu, 2009-04-02 at 12:09 +0200, Domen Puncer wrote:
> Wireshark shows the packets are being sent to lwIP, but all
> of the sudden, it just "forgets to reply with ack"? Other connections
> still work.

Is the data that isn't acked delivered to the application?  I.e. is it
just the ack that goes missing, or the data as well?

> It would make sense if packets were dropped, but it doesn't look so from
> lwip_stats (see end of message).

Is there any path in your driver that could result in dropped packets?
That would be my first guess.

Kieran
Domen Puncer | 2 Apr 14:54 2009

Re: ignored packets?

On 02/04/09 11:17 +0100, Kieran Mansley wrote:
> On Thu, 2009-04-02 at 12:09 +0200, Domen Puncer wrote:
> > Wireshark shows the packets are being sent to lwIP, but all
> > of the sudden, it just "forgets to reply with ack"? Other connections
> > still work.
> 
> Is the data that isn't acked delivered to the application?  I.e. is it
> just the ack that goes missing, or the data as well?

Right, data is also missing.

> 
> > It would make sense if packets were dropped, but it doesn't look so from
> > lwip_stats (see end of message).
> 
> Is there any path in your driver that could result in dropped packets?
> That would be my first guess.

On first look, no. But it uses polling, and then probably drops packets
when many arrive at "the same time". Then I'd expect the large payload
transfers to fail.

Guess I should play with that.

> 
> Kieran
> 
> 
> 
> _______________________________________________
> lwip-users mailing list
> lwip-users@...
> http://lists.nongnu.org/mailman/listinfo/lwip-users
Domen Puncer | 2 Apr 15:33 2009

Re: ignored packets?


Replying to myself, because I don't think this is a lwip problem.
Receive counter lwip_stats.link also suggests the packet is missing,
so the problem is very likely in driver.

Anyone has a nice lpc23xx emac source? ;-)

Thank you for getting me unstuck after a couple of days!
And sorry for the noise!

	Domen

On 02/04/09 14:54 +0200, Domen Puncer wrote:
> On 02/04/09 11:17 +0100, Kieran Mansley wrote:
> > On Thu, 2009-04-02 at 12:09 +0200, Domen Puncer wrote:
> > > Wireshark shows the packets are being sent to lwIP, but all
> > > of the sudden, it just "forgets to reply with ack"? Other connections
> > > still work.
> > 
> > Is the data that isn't acked delivered to the application?  I.e. is it
> > just the ack that goes missing, or the data as well?
> 
> Right, data is also missing.
> 
> > 
> > > It would make sense if packets were dropped, but it doesn't look so from
> > > lwip_stats (see end of message).
> > 
> > Is there any path in your driver that could result in dropped packets?
> > That would be my first guess.
> 
> On first look, no. But it uses polling, and then probably drops packets
> when many arrive at "the same time". Then I'd expect the large payload
> transfers to fail.
> 
> Guess I should play with that.
> 
> > 
> > Kieran
> > 
> > 
> > 
> > _______________________________________________
> > lwip-users mailing list
> > lwip-users@...
> > http://lists.nongnu.org/mailman/listinfo/lwip-users
> 
> 
> _______________________________________________
> lwip-users mailing list
> lwip-users@...
> http://lists.nongnu.org/mailman/listinfo/lwip-users
Bill Yang | 2 Apr 18:10 2009

Spanning Tree Protocol on lwip?

Hi,

 

I wonder if there is STP (Spanning Tree Algorithm Protocol) implement in lwip software. I am using freerots as my project’s embedded OS on Luminary’s microcontroller (LM3S6965 ARM Cortex-M3) to implement STP for a 1Gb Ethernet switch. If any one can provide information regarding this, it will be greatly appreciated.

 

Thanks,

 

Bill Yang | Software Engineer

phone: 801.433.6354 | yyang-OH9KM0HG0uTQT0dZR+AlfA@public.gmane.org

From: lwip-users-bounces+yyang=parvus.com-qX2TKyscuCcdnm+yROfE0A@public.gmane.org [mailto:lwip-users-bounces+yyang=parvus.com-qX2TKyscuCcdnm+yROfE0A@public.gmane.org] On Behalf Of Baptiste Chaboud-crousaz
Sent: Thursday, April 02, 2009 1:55 AM
To: lwip-users-qX2TKyscuCcdnm+yROfE0A@public.gmane.org
Subject: [lwip-users] SNMP trap

 

Hi all,

I would like to send a SNMP trap. I know that lwIP offers to do that tanks to a call to :

err_t snmp_send_trap(s8_t generic_trap, struct snmp_obj_id *eoid, s32_t specific_trap);

But, I don't understand how to fill in the global structure trap_msg in order to include some variable bindings.

Would it be possible to have an example that shows how to fill in trap_msg with 1 or 2 variables bindings?

Thanks.
Best Regards.
Baptiste Chaboud-Crousaz

_______________________________________________
lwip-users mailing list
lwip-users@...
http://lists.nongnu.org/mailman/listinfo/lwip-users
Piero 74 | 2 Apr 23:20 2009
Picon

Re: ignored packets?

yes... i have the driver, for lpc2366... but i have the code in my
office (now i'm using my ipaq)... send me an email tomorrow, to
trigger my brain!

i'm very pride to share my code, and happy if other devolopers will
use it, stressing it (bugs are always deeply hidden). when i have some
free time, i will try to improve it to have "zero copy driver" (there
are some discussions about this in lwip mailing)... help and testing
will be appreciated!

bye,
Piero

bye

2009/4/2, Domen Puncer <domen@...>:
>
> Replying to myself, because I don't think this is a lwip problem.
> Receive counter lwip_stats.link also suggests the packet is missing,
> so the problem is very likely in driver.
>
> Anyone has a nice lpc23xx emac source? ;-)
>
>
> Thank you for getting me unstuck after a couple of days!
> And sorry for the noise!
>
>
>  Domen
>
>
> On 02/04/09 14:54 +0200, Domen Puncer wrote:
>> On 02/04/09 11:17 +0100, Kieran Mansley wrote:
>> > On Thu, 2009-04-02 at 12:09 +0200, Domen Puncer wrote:
>> > > Wireshark shows the packets are being sent to lwIP, but all
>> > > of the sudden, it just "forgets to reply with ack"? Other connections
>> > > still work.
>> >
>> > Is the data that isn't acked delivered to the application?  I.e. is it
>> > just the ack that goes missing, or the data as well?
>>
>> Right, data is also missing.
>>
>> >
>> > > It would make sense if packets were dropped, but it doesn't look so
>> > > from
>> > > lwip_stats (see end of message).
>> >
>> > Is there any path in your driver that could result in dropped packets?
>> > That would be my first guess.
>>
>> On first look, no. But it uses polling, and then probably drops packets
>> when many arrive at "the same time". Then I'd expect the large payload
>> transfers to fail.
>>
>> Guess I should play with that.
>>
>> >
>> > Kieran
>> >
>> >
>> >
>> > _______________________________________________
>> > lwip-users mailing list
>> > lwip-users@...
>> > http://lists.nongnu.org/mailman/listinfo/lwip-users
>>
>>
>> _______________________________________________
>> lwip-users mailing list
>> lwip-users@...
>> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
> _______________________________________________
> lwip-users mailing list
> lwip-users@...
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
John Kennedy | 3 Apr 00:15 2009

low_level_output question

Hi,
I'm porting lwip (using an RTOS and the socket API) and I have a question regarding the low_level_output function.
If I can't send the pbuf immediately (netif busy), to avoid copying the pbuf, I'd like to do the following:
*       Increment the reference count to prevent lwip from re-using or freeing the pbuf.
*       Put the pbuf on my output queue and try to send it later.
*       Return ERR_OK.
Later when the netif is not busy...
*       Remove the pbuf from my output queue.
*       Send the pbuf.
*       Free the pbuf.

Will this scheme work with lwip?

Thanks,
John Kennedy

 
________________________________________
John Kennedy

Idaho Technology Inc.
390 Wakara Way
Salt Lake City, UT 84108, USA

USA: 1-800-735-6544
Bus:+1 (801)736-6354 x448
Fax:+1 (801)588-0507

http://www.idahotech.com/

________________________________________
CONFIDENTIALITY NOTICE: This E-mail and any attachments are confidential information of the sender and
are for the exclusive use of the intended recipient. If you are not the intended recipient, be aware that
any disclosure, copying, distribution, or use of this E-mail or any attachment is prohibited. If you have
received this E-mail in error, please notify us immediately by returning it to the sender and delete this
copy from your system. Thank you for your cooperation.

 
Bill Auerbach | 3 Apr 15:32 2009

RE: low_level_output question

Yes, it will work this way.  In fact, the Stellaris lwIP Ethernet driver is done just like this.

Bill

>-----Original Message-----
>From:
lwip-users-bounces+bauerbach=arrayonline.com@...
>[mailto:lwip-users-bounces+bauerbach=arrayonline.com@...] On
>Behalf Of John Kennedy
>Sent: Thursday, April 02, 2009 6:16 PM
>To: lwip-users@...
>Subject: [lwip-users] low_level_output question
>
>Hi,
>I'm porting lwip (using an RTOS and the socket API) and I have a
>question regarding the low_level_output function.
>If I can't send the pbuf immediately (netif busy), to avoid copying the
>pbuf, I'd like to do the following:
>*       Increment the reference count to prevent lwip from re-using or
>freeing the pbuf.
>*       Put the pbuf on my output queue and try to send it later.
>*       Return ERR_OK.
>Later when the netif is not busy...
>*       Remove the pbuf from my output queue.
>*       Send the pbuf.
>*       Free the pbuf.
>
>Will this scheme work with lwip?
>
>Thanks,
>John Kennedy
>
>
>
>
>
>________________________________________
>John Kennedy
>
>
>Idaho Technology Inc.
>390 Wakara Way
>Salt Lake City, UT 84108, USA
>
>USA: 1-800-735-6544
>Bus:+1 (801)736-6354 x448
>Fax:+1 (801)588-0507
>
>http://www.idahotech.com/
>
>________________________________________
>CONFIDENTIALITY NOTICE: This E-mail and any attachments are confidential
>information of the sender and are for the exclusive use of the intended
>recipient. If you are not the intended recipient, be aware that any
>disclosure, copying, distribution, or use of this E-mail or any
>attachment is prohibited. If you have received this E-mail in error,
>please notify us immediately by returning it to the sender and delete
>this copy from your system. Thank you for your cooperation.
>
>
>
>
>_______________________________________________
>lwip-users mailing list
>lwip-users@...
>http://lists.nongnu.org/mailman/listinfo/lwip-users
yueyue papa | 7 Apr 08:35 2009
Picon

Re: PPP negotiate process

from the log the major problem is after CHAP success.

Request peer address, and got a fcs error.
#######################
pppInProc[0]: got 10 bytes
pppInput[0]: IPCP len=4
fsm_input(IPCP):1,0,4
fsm_rconfreq(IPCP): Rcvd id 0 state=6 (LS_REQSENT)
ipcp_reqci: Requesting peer address
ipcp_reqci: returning Configure-NAK
pppWrite[0]: len=18
Written 18 bytes:
7e ff 03 80 21 03 00 00 0a 03 06 00 00 00 00 a0     ~...!...........
3d 7e                                               =~

fsm_sdata(IPCP): Sent code 3,0,10.
Read 29 bytes:
7e 80 21 03 01 00 16 03 06 0d 0a 44 09 82 81 06     ~.!........D....
d3 88 70 32 83 06 d3 88 14 cb bc a0 7e              ..p2........~

pppInProc[0]: got 29 bytes
pppInProc[0]: Dropping bad fcs 0xAD6A proto=0x8021
#########################


#########################
fsm_sdata(IPCP): Sent code 1,2,14.
IPCP: sending Configure-Request, id 2
Read 21 bytes:
7e 80 21 04 02 00 0e 01 0d 0a 00 00 00 00 00 00     ~.!.............
00 00 66 f7 7e                                      ..f.~

pppInProc[0]: got 21 bytes
pppInProc[0]: Dropping bad fcs 0xFC02 proto=0x8021
#########################

I got many 29 and 21 bytes fcs error. 

How could I confirm this is really FCS error, or some other protocol ?

Lee

_______________________________________________
lwip-users mailing list
lwip-users@...
http://lists.nongnu.org/mailman/listinfo/lwip-users

Gmane