[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Porting the lwip TCP/IP/PPP stack, hints for debugging
From: |
Clive Wilson |
Subject: |
Re: [lwip-users] Porting the lwip TCP/IP/PPP stack, hints for debugging needed, avoiding pitfalls |
Date: |
Wed, 14 Feb 2007 19:37:10 +0000 |
Hans-Joerg,
Some answers for you - see below.
At 21:24 13/02/2007, you wrote:
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C74FB5.509E81CB"
Hi
I am a very novice with lwip and porting to embedded system. I'm planning
to port the lwip to the OSE delta from ENEA running (4.5.1 quite old
version) on a MPC555 as a diploma thesis.
It's for a gsm based dial up connection to a Windows based PPP-server
(perhaps client) to have a cheap independent m2m connection with a
reliable TCP/IP based error correction retransmission mechanism (we dont
want to need our customers IT infrastructure, if it has any because it
could be a blocking issue for the customers to buy our support package).
Sorry if I lack some theoretical basics. I know a little bit TCP/IP but
not PPP.
Sorry if this is a little off topic, but have you considered a commercial
m2m service? The embedded side would be a self-contained module that you
can program with your application code. The module has an API for GPRS
connections and data transfer through the service providers' gateway. Your
client uses an access protocol (e.g SOAP over http interface or similar) to
retrieve the data from the service provider. That way there is minimal
infrastructure expense for you or your client (only initial hardware costs,
a little development cost, then ongoing data costs per use). If you would
like to know more, I'll gladly elaborate.
At the moment the requirements are not already clear, if the the
connection will be established from the embedded system side or from the
windows PC side. Would the lwIP stack provide both capabilities to
initiate a PPP link (this would be in the role as client I guess) or to
accept a PPP connection from the PC (in the role as a server I guess).
I browsed shortly through the lwip sources. I found some client state
definitions in the chap & pap modules as well as some server state
definitions. However I only found a pppInput call in the PPP state machine
of ppp.c. I'm wondering if lwip can only act as a PPP server, or am I wrong.
PPP does not really make the distinction between client and server. Both
sides negotiate the link, therefore they could more accurately be
considered to be peers of one another. Both peers have the option to reject
certain PPP configurations, and have "don't cares" about others. It is up
to the higher layers to determine whether the node should be considered to
be client or server. Having said that, if you're connecting to a Windows
server, then it is up to the remote peer to initiate the connection with a
specific (and unhelpfully non-standard) data sequence, before the Win
server will start negotiating the PPP link. This is all covered in the book
I mention below.
BTW do you know a good PPP tutorial (not RFC like style) with detailed
explanations of the link establish phases with the PPP control headers
used. perhaps in a diagram style (some sort of request response arrows
from left to right and right to left).
I found this book to be very helpful
http://www.amazon.co.uk/exec/obidos/ASIN/0201700530/ the author James
Carlson is a noted guru in this subject. The book explains the process of
bringing up the PPP link very well, including walkthroughs of the state
machines involved.
Are the roles of TCP server and client completely independent of the roles
of PPP server and client on the underlying layer. E.g. the device
initiated a PPP connection as a client starts now a TCP server for
accepting. Would that be possible?
See above response.
Is there the possibility to establish a PPP connection between the
embedded device and the PC without using a modem dial up, just with a
direct cable connection to make first trials and debuggings?
Yes, absolutely. This is precisely what I did when I implemented a dial-up
LwIP PPP connection to a Win2k server.
Can I start a PPP client or server on a w2k or xp platform without
configuring this dial-up or ras things? Are there tutorials to do this?
You have to go through the RAS setup if using a Windows server. Also beware
that LwIP only supports PAP or CHAP authentication. PAP isn't secure. CHAP
is better - but the flavour of CHAP Microsoft prefer to support is MS-CHAP,
very different to MD5-CHAP that LwIP supports. Win2k server will support
MD5-CHAP connections (this is what I used), but is awkward to set up.
Microsoft have a KB article on this, I can give you a pointer if required.
I already did some socket programming in JDK1.5 for windows. As soon as
there is a PPP link do both sides have a IP address for the com port? Do I
have to configure it for the PC if it acts as a server (how)? Can I use
the socket programming in Java on the PC for this PPP connection as I
would do it for an ethernet connection?
IP address is negotiated during the IPCP phase. So yes, you get an IP
address for both ends by the end of the PPP link startup. I don't know
about the rest of what you mention as I've not had much Java experience.
Sorry for the basic questions. But as the time is limited, I cannot
investigate in every details and I therefore need some starting point.
No worries, everyone has to learn somehow.
Hope this helps,
Clive Wilson