I have a problem: I try to calculate FCS-16 (Frame Check Sequence) for a
PPP frame, according to the algorithm on RFC 1662, and seems to be correct,
but I have a LOG from a real PPP sesion, and the FCS doesn´t match!
Here´s the frame:
FF 03 C0 21 01 01 00 18
01 04 05 DC 02 06 00 0A
00 00 05 06 9E 05 C1 97
07 02 08 02
The transmited FCS was 7489, and the FCS I compute is 8B76 !!
Please, answer me here: tru...@another-world.com
> I have a problem: I try to calculate FCS-16 (Frame Check Sequence) for a
>PPP frame, according to the algorithm on RFC 1662, and seems to be correct,
>but I have a LOG from a real PPP sesion, and the FCS doesn´t match!
[SNIP]
>The transmited FCS was 7489, and the FCS I compute is 8B76 !!
0x7489 is the logical NOT of 0x8b76.
The RFC's are not as clear on this as they ought to be...the PPP FCS gets
logically-NOTed before being sent. Also...watch the byte ordering! This will
vary depending if your coding big-endian (Motorola) or little-endian (Intel).
Finally, if you re-read the RFC's you'll see that if your recieve routine runs
right over the FCS while computing the recieved FCS, a valid FCS will always
generate a certain hex word value...I cannot remember off-hand what the
number is, but it's declared in the example source code of the RFCs.
Happy coding!
-Tim
: I have a problem: I try to calculate FCS-16 (Frame Check Sequence) for a
: PPP frame, according to the algorithm on RFC 1662, and seems to be correct,
: but I have a LOG from a real PPP sesion, and the FCS doesn愒 match!
: Here愀 the frame:
: FF 03 C0 21 01 01 00 18
: 01 04 05 DC 02 06 00 0A
: 00 00 05 06 9E 05 C1 97
: 07 02 08 02
: The transmited FCS was 7489, and the FCS I compute is 8B76 !!
: Please, answer me here: tru...@another-world.com
I think you forgot to invert it!!
Josechu <jos...@redestb.es> wrote in article
<5sir43$gl5$1...@talia.mad.ibernet.es>...
Both are correct. The FCS bytes transmitted will be (remember that
the FCS, unlike virtually all other networking data, is sent
complemented and in little-endian order) 89 74.
The FCS that you calculate will be 8B76. Complement this to get 7489.
You would thus send 89 followed by 74.
There's no reason to be comparing the FCS to anything, anyway. The
FCS of a good frame (before complementing) will always be F0B8 if you
include the sender's FCS bytes. You just need to check for this
constant value after processing all bytes in the frame.
--
James Carlson <car...@xylogics.com>, Prin Engr Tel: +1 508 916 4351
Bay Networks - Annex I/F Develop. / 8 Federal ST +1 800 225 3317
Mail Stop BL08-05 / Billerica MA 01821-3548 Fax: +1 508 916 4789
Keep an eye out for my PPP design and debug book from Addison-Wesley.
(Available early 1998.)