PPP: IPCP bad fcs issue

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

PPP: IPCP bad fcs issue

Axel Lin
Hi list,

I'm testing a LTE module with lwIP and found always got bad fcs as below.
I dump the received data below:
Is there anything wrong in the received data?

sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]␍␊
pppos_write[0]: len=26␍␊
pppos_input[0]: got 17 bytes␍␊
7e ff 3 80 21 1 1 16 3 6 81 6 83 6 6e db 7e ␍␍␊
pppos_input[0]: Dropping bad fcs 0x4114 proto=0x8021␍␊
pppos_input_drop: pbuf len=13, addr 0x2000bfc0␍␊
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]␍␊
pppos_write[0]: len=26␍␊
pppos_input[0]: got 17 bytes␍␊
7e ff 3 80 21 1 1 16 3 6 81 6 83 6 6e db 7e ␍␍␊
pppos_input[0]: Dropping bad fcs 0x4114 proto=0x8021␍␊
pppos_input_drop: pbuf len=13, addr 0x2000bfc0␍␊
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]␍␊
pppos_write[0]: len=26␍␊
pppos_input[0]: got 17 bytes␍␊
7e ff 3 80 21 1 1 16 3 6 81 6 83 6 6e db 7e ␍
pppos_input[0]: Dropping bad fcs 0x4114 proto=0x8021

// another boot
sent [IPCP ConfReq id=0x1 <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]␍␊
pppos_write[0]: len=20␍␊
pppos_input[0]: got 15 bytes␍␊
7e ff 3 80 21 1 1 10 81 6 83 6 2d 61 7e ␍␍␊
pppos_input[0]: Dropping bad fcs 0xa6ff proto=0x8021
sent [IPCP ConfReq id=0x1 <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]␍␊
pppos_write[0]: len=20␍␊
pppos_input[0]: got 15 bytes␍␊
7e ff 3 80 21 1 1 10 81 6 83 6 2d 61 7e ␍␍␊
pppos_input[0]: Dropping bad fcs 0xa6ff proto=0x8021
sent [IPCP ConfReq id=0x1 <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]␍␊
pppos_write[0]: len=20␍␊
pppos_input[0]: got 15 bytes␍␊
7e ff 3 80 21 1 1 10 81 6 83 6 2d 61 7e ␍␍␊
pppos_input[0]: Dropping bad fcs 0xa6ff proto=0x8021

Thanks,
Axel

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: PPP: IPCP bad fcs issue

Patrick Klos-2
On 8/15/2018 11:25 AM, Axel Lin wrote:
Hi list,

I'm testing a LTE module with lwIP and found always got bad fcs as below.
I dump the received data below:
Is there anything wrong in the received data?

sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]␍␊
pppos_write[0]: len=26␍␊
pppos_input[0]: got 17 bytes␍␊
7e ff 3 80 21 1 1 16 3 6 81 6 83 6 6e db 7e ␍␍␊
pppos_input[0]: Dropping bad fcs 0x4114 proto=0x8021␍␊

That doesn't look like a good PPP packet.
ff 3 80 21 1 1 16 3 6 81 6 83 6 6e db
ff 03 = address and control field
80 21 = IPCP protocol ID
01 = Configure request
01 = Identifier
16 03 = SHOULD BE PACKET LENGTH

Patrick


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: PPP: IPCP bad fcs issue

Sylvain Rochet
Hi,

On Wed, Aug 15, 2018 at 03:40:22PM -0400, Patrick Klos wrote:

> On 8/15/2018 11:25 AM, Axel Lin wrote:
> >Hi list,
> >
> >I'm testing a LTE module with lwIP and found always got bad fcs as below.
> >I dump the received data below:
> >Is there anything wrong in the received data?
> >
> >sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]␍␊
> >pppos_write[0]: len=26␍␊
> >pppos_input[0]: got 17 bytes␍␊
> >7e ff 3 80 21 1 1 16 3 6 81 6 83 6 6e db 7e ␍␍␊
> >pppos_input[0]: Dropping bad fcs 0x4114 proto=0x8021␍␊
>
> That doesn't look like a good PPP packet.
>
>    ff 3 80 21 1 1 16 3 6 81 6 83 6 6e db
>
> ff 03 = address and control field
> 80 21 = IPCP protocol ID
> 01 = Configure request
> 01 = Identifier
> 16 03 = SHOULD BE PACKET LENGTH
Added to that, there is something very wrong here, HDLC checksum
(polynomial 0x1021, init 0xffff, xor final 0xffff, reflected input,
reflected result, network byte order result) for "0xff 0x03 0x80 0x21
0x01 0x01 0x16 0x03 0x6 0x81 0x6 0x83 0x06" is 0x19 0x17 which is
obviously not 0x6e 0xdb.

But what is very strange is that checksum including checksum itself for
comparison purpose for "0x01 0x01 0x16 0x03 0x6 0x81 0x6 0x83 0x06 0x6e
0xdb" is 0xeb 0xbe, which is not 0x4114 (nor 0x1441 with byte swap) as
displayed in your "Dropping bad fcs" debug print, how is that even
possible ?

I just tested on good packets and the debug print actually print 0xf0b8
for FCS which is the PPP_GOODFCS value.

Sylvain

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PPP: IPCP bad fcs issue

Patrick Klos-2
On 8/15/2018 4:19 PM, Sylvain Rochet wrote:
> But what is very strange is that checksum including checksum itself for
> comparison purpose for "0x01 0x01 0x16 0x03 0x6 0x81 0x6 0x83 0x06 0x6e
> 0xdb" is 0xeb 0xbe, which is not 0x4114 (nor 0x1441 with byte swap) as
> displayed in your "Dropping bad fcs" debug print, how is that even
> possible ?

For what it's worth, 0x4114 is the complement of the byte swap 0xebbe
(and that's how the FCS is added to a PPP packet).  I didn't look at the
actual code to see at what stage and which value the message prints, but
it's close enough to say it's probably right.

Patrick


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: PPP: IPCP bad fcs issue

Sylvain Rochet
Hi,

On Wed, Aug 15, 2018 at 05:46:21PM -0400, Patrick Klos wrote:

> On 8/15/2018 4:19 PM, Sylvain Rochet wrote:
> >But what is very strange is that checksum including checksum itself for
> >comparison purpose for "0x01 0x01 0x16 0x03 0x6 0x81 0x6 0x83 0x06 0x6e
> >0xdb" is 0xeb 0xbe, which is not 0x4114 (nor 0x1441 with byte swap) as
> >displayed in your "Dropping bad fcs" debug print, how is that even
> >possible ?
>
> For what it's worth, 0x4114 is the complement of the byte swap 0xebbe (and
> that's how the FCS is added to a PPP packet).  I didn't look at the actual
> code to see at what stage and which value the message prints, but it's close
> enough to say it's probably right.
Oh dear, I actually checked that, but looks like I failed somewhere :-)

Indeed, the PPP_GOODFCS value is the checksum value of the full frame
including the checksum but without the final XOR.

Sylvain

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PPP: IPCP bad fcs issue

Axel Lin
In reply to this post by Patrick Klos-2
2018-08-16 3:40 GMT+08:00 Patrick Klos <[hidden email]>:

> On 8/15/2018 11:25 AM, Axel Lin wrote:
>
> Hi list,
>
> I'm testing a LTE module with lwIP and found always got bad fcs as below.
> I dump the received data below:
> Is there anything wrong in the received data?
>
> sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2
> 0.0.0.0>]␍␊
> pppos_write[0]: len=26␍␊
> pppos_input[0]: got 17 bytes␍␊
> 7e ff 3 80 21 1 1 16 3 6 81 6 83 6 6e db 7e ␍␍␊
> pppos_input[0]: Dropping bad fcs 0x4114 proto=0x8021␍␊
>
>
> That doesn't look like a good PPP packet.

Hi Patrick and Sylvain,
Thanks for your valuable comments.
I re-check my code and found I disable LCP magic number negotiation
due to hit issue without checking the root cause.
So the first error should be "Serial line is looped back".
I will check with module vendor.

Thanks,
Axel

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users