lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Force PPP TermReq (Lwip 2.0.0 RC2)


From: Greg Smith
Subject: Re: [lwip-users] Force PPP TermReq (Lwip 2.0.0 RC2)
Date: Wed, 10 Aug 2016 15:56:43 +0000

Hi, Sylvain.

> From: lwip-users
> On Behalf Of Sylvain Rochet
> Sent: Tuesday, 09 August 2016 17:22
> On Tue, Aug 09, 2016 at 04:21:43PM +0000, Greg Smith wrote:
> >
> > I totally agree this would be nice to have a data trace. I do already
> > have a facility to output printf() data to a console or Telnet
> > session. However, when I turned on all those options (PRINTPKT_SUPPORT
> > was the only one I didn't already have on), I don't see it outputting
> > any packet data during LCP. Should I be seeing payload bytes during
> > this phase?
>
> Yes, all packets are dumped except IP and IPv6 packets. Are you sure lwIP
> debugging trace works at all ?

I get a lot of other good Lwip debugging messages. Here's my current debug settings:
#define LWIP_DEBUG LWIP_DBG_ON
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
#define LWIP_DBG_TYPES_ON LWIP_DBG_ON
#define ICMP_DEBUG LWIP_DBG_ON
#define MEM_DEBUG LWIP_DBG_ON
#define MEMP_DEBUG LWIP_DBG_ON
#define NETIF_DEBUG LWIP_DBG_OFF
#define PBUF_DEBUG LWIP_DBG_OFF
#define PPP_DEBUG LWIP_DBG_ON
#define SOCKETS_DEBUG LWIP_DBG_ON
#define SYS_DEBUG LWIP_DBG_ON
#define TCP_DEBUG LWIP_DBG_OFF
#define TCP_CWND_DEBUG LWIP_DBG_OFF
#define TCP_FR_DEBUG LWIP_DBG_OFF
#define TCP_INPUT_DEBUG LWIP_DBG_OFF
#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
#define TCP_QLEN_DEBUG LWIP_DBG_OFF
#define TCP_RTO_DEBUG LWIP_DBG_ON
#define TCP_RST_DEBUG LWIP_DBG_ON
#define TCPIP_DEBUG LWIP_DBG_OFF
#define TIMERS_DEUBG LWIP_DBG_ON
#define UDP_DEBUG LWIP_DBG_OFF
#define PRINTPKT_SUPPORT 1
#define PPP_PROTOCOLNAME 1


At the very bottom is a clip with some sample output I get during connecting and reception of a couple TCP keepalive packets. (The keepalive seems to print the packet data.) But I don't see any lines showing raw data going out (or, generally, coming in, either).
(Ignore the missing data at the end of the line with TCP_KEEPINTV; that's a function of my output capture.)

>
> > I am running an RS485 bus, so I could hook another device in to
> > "listen" to all the traffic. Unfortunately, that's going to get me a
> > lot of bytes, but minimal decoding. Do you know of any good tools
> > where I could dump raw bytes and get packet decoding back out? (Or
> > even a tool to hang on the serial line and decode live?)
>
> If you can hook on the serial line the easiest way is to use pppd and
> you'll have exactly the same output as lwIP PPP trace, or even better
> lwIP itself using the unix port. If you ask I almost never try lwIP PPP
> support on real hardware, I hate waiting the flash time.

How do you get pppd to print out packets? I've turned on pppd 'debug', but that doesn't give me packet data, either. I see the sent and rcvd LCP packet high level information, but not actual packet data for any further transmissions (i.e. the TCP keepalive, for instance).

And when I get into the state where pppd seems to being ignore LCP packets, I do not get anything from pppd.

Thanks.
-- G

=========================== SAMPLE LWIP DEBUG OUTPUT ===============================

ppp phase changed[0]: phase=0
status_cb: User interrupt
ppp_connect[0]: holdoff=3
ppp phase changed[0]: phase=11
lwip_socket(PF_INET, SOCK_DGRAM, 17) = 0
lwip_bind(0, addr=0.0.0.0 port=69)
lwip_bind(0) succeeded
lwip_recvfrom(0, 0x2000bb10, 1500z, 0x0, ..)
lwip_recvfrom: top while sock->lastdata=0
lwip_socket(PF_INET, SOCK_STREAM, 6) = 1
lwip_bind(1, addr=0.0.0.0 port=53426)
lwip_bind(1) succeeded
lwip_listen(1, backlog=2)
lwip_accept(1)...
ppp_link_start[0]
ppp phase changed[0]: phase=1
pppos_connect: unit 0: connecting
ppp_start[0]
pppos_send_config[0]: out_accm=FF FF FF FF
ppp_send_config[0]
pppos_recv_config[0]: in_accm=FF FF FF FF
ppp_recv_config[0]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xc4acac4b> <pcomp> <accomp>]
pppos_write[0]: len=24
ppp_start[0]: finished
pppos_input[0]: got 46 bytes
rcvd [LCP ConfReq id=0x3 <asyncmap 0x0> <magic 0xb6a778f4> <pcomp> <accomp>]
sent [LCP ConfAck id=0x3 <asyncmap 0x0> <magic 0xb6a778f4> <pcomp> <accomp>]
pppos_write[0]: len=24
pppos_input[0]: got 39 bytes
pppos_input[0]: got 6 bytes
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xc4acac4b> <pcomp> <accomp>]
netif_set_mtu[0]: mtu=1500
pppos_send_config[0]: out_accm=0 0 0 0
pppos_input[0]: got 21 bytes
rcvd [IPCP ConfAck id=0x2 <compress VJ 0f 01> <addr 192.168.60.1>]
sifvjcomp[0]: VJ compress enable=1 slot=1 max slot=15
sifup[0]: err_code=0
status_cb: Connected
our_ipaddr = 192.168.60.1
his_ipaddr = 192.168.60.11
netmask = 255.255.255.255
local IP address 192.168.60.1
remote IP address 192.168.60.11
ppp phase changed[0]: phase=8
pppos_input[0]: got 65 bytes
ppp_input[0]: ip in pbuf len=60
tcp_output_segment: rtseq 6510
pppos_netif_output[0]: proto=0x21, len = 56
pppos_input[0]: got 8 bytes
pppos_input[0]: got 13 bytes
pppos_input[0]: got 13 bytes
pppos_input[0]: got 13 bytes
pppos_input[0]: got 9 bytes
rcvd [proto=0x2f] 45 00 00 34 1e 0d 40 00 40 00 23 5a c0 a8 3c 0b c0 a8 3c 01 eb 01 d0 b2 cc ad 54 6c 00 00 19 6f ...
ppp_input[0]: vj_un in pbuf len=52
tcp_receive: pcb->rttest 0 rtseq 6510 ackno 6511
lwip_accept(1) returning new sock=2 addr=192.168.60.11 port=60161
lwip_setsockopt(2, SOL_SOCKET, optname=0x8, ..) -> on
lwip_setsockopt(2, IPPROTO_TCP, TCP_KEEPCNT) -> 10
lwip_setsockopt(2, IPPROTO_TCP, TCP_KEEPIDLE) -> 15000
lwip_setsockopt(2, IPPROTO_TCP, TCP_KEEPINTVpppos_input[0]: got 57 bytes
rcvd [proto=0x2f] 45 00 00 34 1e 0e 40 00 40 00 23 59 c0 a8 3c 0b c0 a8 3c 01 eb 01 d0 b2 cc ad 54 6b 00 00 19 6f ...
ppp_input[0]: vj_un in pbuf len=52
tcp_receive: pcb->rttest 0 rtseq 6510 ackno 6511
pppos_netif_output[0]: proto=0x2F, len = 52
pppos_input[0]: got 14 bytes
pppos_write[0]: len=12
pppos_write[0]: len=12
pppos_input[0]: got 13 bytes
pppos_input[0]: got 38 bytes
pppos_input[0]: got 17 bytes
pppos_input[0]: got 1 bytes
rcvd [proto=0x2f] 45 00 00 34 1e 0f 40 00 40 00 23 58 c0 a8 3c 0b c0 a8 3c 01 eb 01 d0 b2 cc ad 54 6b 00 00 19 6f ...
ppp_input[0]: vj_un in pbuf len=52
tcp_receive: pcb->rttest 0 rtseq 6510 ackno 6511
pppos_netif_output[0]: proto=0x2F, len = 52
pppos_input[0]: got 57 bytes
rcvd [proto=0x2f] 45 00 00 34 1e 10 40 00 40 00 23 57 c0 a8 3c 0b c0 a8 3c 01 eb 01 d0 b2 cc ad 54 6b 00 00 19 6f ...
ppp_input[0]: vj_un in pbuf len=52
tcp_receive: pcb->rttest 0 rtseq 6510 ackno 6511
pppos_netif_output[0]: proto=0x2F, len = 52
pppos_input[0]: got 14 bytes
pppos_write[0]: len=12
pppos_write[0]: len=12
pppos_input[0]: got 13 bytes
pppos_input[0]: got 57 bytes
rcvd [proto=0x2f] 45 00 00 34 1e 11 40 00 40 00 23 56 c0 a8 3c 0b c0 a8 3c 01 eb 01 d0 b2 cc ad 54 6b 00 00 19 6f ...
ppp_input[0]: vj_un in pbuf len=52
tcp_receive: pcb->rttest 0 rtseq 6510 ackno 6511
pppos_netif_output[0]: proto=0x2F, len = 52



This email has been scanned for email related threats and delivered safely by Mimecast.
For more information please visit http://www.mimecast.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]