Networking Forums

Networking Forums > Computer Networking > Linux Networking > How to tell an application to use a custom tcp/ip stack instead of tcp/ip stack from linux?

Reply
Thread Tools Display Modes

How to tell an application to use a custom tcp/ip stack instead of tcp/ip stack from linux?

 
 
CDP
Guest
Posts: n/a

 
      07-04-2005, 01:27 PM
Hello Groups,

I am a newbie to this groups and I am struggling with a problem and I
need your help in this regard.

I have lwip ( low weight ip) tcp/ip stack and tftp (client & server
tftp-hpa-0.40) source .Both are compiling well on linux with out any
problem. The tftp source is also working good when I installed it on my
linux system (Redhat linux 9.0 , gcc 3.2.2) for getting and putting
files.

I need to get a tftp/udp/ip stack for an embedded system to upgrade the
firmware of a chip. So the problem is I want to tell my tftp source I
have with me to use lwip tcp/ip stack instead of the tcp/ip stack that
comes from linux . Some how I should be able to do the getting and
putting of files from/to a remote host using this lwip tcp/ip stack and
not the stack that comes from linux.So for this I need to tell my tftp
source to use lwip ..right? Please tell me how can I accomplish this ?
The lwip user forum did not give me the information what I want...But
one guy told me that I can make use of the LD_PRELOAD environment
variable to do this .is this right? and I also heard that I need to
make some modifications to the linux kernel and recompile it as tcp/ip
stack is a part of kernel ..if this is so...? Please tell me the
detailed procedure how can I do this , as I need this at any case for
my work . I would be thankful for any kind of suggestions ..

Regards
CDP

 
Reply With Quote
 
 
 
 
aetu
Guest
Posts: n/a

 
      07-04-2005, 04:55 PM
If you want reprogram the low level of ip stack you must see
man 7 packet

 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      07-04-2005, 11:58 PM

"CDP" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...

> I have lwip ( low weight ip) tcp/ip stack and tftp (client & server
> tftp-hpa-0.40) source .Both are compiling well on linux with out any
> problem. The tftp source is also working good when I installed it on my
> linux system (Redhat linux 9.0 , gcc 3.2.2) for getting and putting
> files.


You haven't defined your problem precisely enough for any Linux folks to
help you. You'll have to talk to the lwip folks.

DS


 
Reply With Quote
 
CDP
Guest
Posts: n/a

 
      07-05-2005, 08:22 AM
David Schwartz wrote:
> "CDP" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
>
>
>
> You haven't defined your problem precisely enough for any Linux folks to
> help you.



The problem is I want to make my tftp source I have with me to use lwip
and not the tcp/ip stack that comes from Linux under linux . The tftp
source is my application layer .This application layer should use
udp/ip protocols of lwip under linux , Hope you got my problem by now .

The tftp is a simple protocol to get and put files to/from a remote
server.I installed my tftp source on Redhat Linux PC , and its getting
and putting files from/to a remote host using the default tcp/ip stack
from Linux
without any problem.So instead of the default tcp/ip stack from linux
it should use lwip under linux , So how can I make this under linux ???


For this I was told that I must do some modifications in the linux
kernel and recompile it ...is this the exact soultion to do this, if
this is, please tell me the detailed procedure to do this..?


> You'll have to talk to the lwip folks.
>
> DS


I asked the lwip folks and I had posted my question in the lwip
user forum , only one guy answered me that I sould use LD_PRELOAD
environment variable of Linux to do this ...

I am herewith giving the reply , he had given me , please see below

First, build the library. Second set LD_PRELOAD to the path of the
library. Third, run tftp. That's it.

The above is the reply he had given me

So please adivce me in this issue , I guess its a linux specific
question , If you guys want me to post any code my tftp source I can do
that , its nothing but tftp-hpa-0.40.I need help in this desperatley.

Regards
CDP

 
Reply With Quote
 
Willem
Guest
Posts: n/a

 
      07-05-2005, 09:36 AM
CDP wrote:
) I asked the lwip folks and I had posted my question in the lwip
) user forum , only one guy answered me that I sould use LD_PRELOAD
) environment variable of Linux to do this ...
)
) I am herewith giving the reply , he had given me , please see below
)
) First, build the library. Second set LD_PRELOAD to the path of the
) library. Third, run tftp. That's it.
)
) The above is the reply he had given me

Have you actually tried doing what this guy said ?
If you set LD_PRELOAD to point to a library, that will be loaded
and any functions in there replace the 'standard' functions.

I would also assume that the lwip source has detailed instructions
how to use it in your applications.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
 
Reply With Quote
 
CDP
Guest
Posts: n/a

 
      07-05-2005, 10:50 AM


Willem wrote:
> CDP wrote:
> ) I asked the lwip folks and I had posted my question in the lwip
> ) user forum , only one guy answered me that I sould use LD_PRELOAD
> ) environment variable of Linux to do this ...
> )
> ) I am herewith giving the reply , he had given me , please see below
> )
> ) First, build the library. Second set LD_PRELOAD to the path of the
> ) library. Third, run tftp. That's it.
> )
> ) The above is the reply he had given me
>
> Have you actually tried doing what this guy said ?
> If you set LD_PRELOAD to point to a library, that will be loaded
> and any functions in there replace the 'standard' functions.


I tried it , by setting the LD_PRELOAD environement variable to
the path of the shared library of lwip I have with me , which I already
compiled on my linux system. By setting it I started my tftp
application , but I did not observe any change... its like ,its using
the normal tcp/ip stack from linux , but not lwip. If the standard
functions are replaced with this , I should observe some change
...right? But I did nt ..How can I set it actually whether the standard
functions are replaced..?What about the idea of kernel modifications
and recompiling ..Do you guys have any idea in my problem..?

>
> I would also assume that the lwip source has detailed instructions
> how to use it in your applications.


The guys in lwip forum , do more with a kind protocol related
things, and if post something related to linux kernel ..or something of
my problem,I guess they can not reply, because I tried it
already.Regarding the documentation lwip , I had a glance at it already
and I did not find useful information..

>
>
> SaSW, Willem
> --
> Disclaimer: I am in no way responsible for any of the statements
> made in the above text. For all I know I might be
> drugged or something..
> No I'm not paranoid. You all think I'm paranoid, don't you !
> #EOT


 
Reply With Quote
 
J Jackson
Guest
Posts: n/a

 
      07-05-2005, 11:23 AM
In comp.os.linux.embedded CDP <(E-Mail Removed)> wrote:
: Hello Groups,

: I am a newbie to this groups and I am struggling with a problem and I
: need your help in this regard.

: I have lwip ( low weight ip) tcp/ip stack and tftp (client & server
: tftp-hpa-0.40) source .Both are compiling well on linux with out any
: problem. The tftp source is also working good when I installed it on my
: linux system (Redhat linux 9.0 , gcc 3.2.2) for getting and putting
: files.

: I need to get a tftp/udp/ip stack for an embedded system to upgrade the
: firmware of a chip.

I'm guessing that your embedded system will not have a Linux kernel
and that you are wanting to build a tftp server as a dedicated application
in an embedded device? If this is a the case then this isn't a linux
problem and you have lots of other problems.

If you did have the Linux kernel in the embedded device you'd use it's
tcp/ip stack, and using lwip wouldn't be an issue.

I think maybe people are just confused by what it is you are trying to do.



: So the problem is I want to tell my tftp source I
: have with me to use lwip tcp/ip stack instead of the tcp/ip stack that
: comes from linux . Some how I should be able to do the getting and
: putting of files from/to a remote host using this lwip tcp/ip stack and
: not the stack that comes from linux.So for this I need to tell my tftp
: source to use lwip ..right? Please tell me how can I accomplish this ?
: The lwip user forum did not give me the information what I want...But
: one guy told me that I can make use of the LD_PRELOAD environment
: variable to do this .is this right? and I also heard that I need to
: make some modifications to the linux kernel and recompile it as tcp/ip
: stack is a part of kernel ..if this is so...? Please tell me the
: detailed procedure how can I do this , as I need this at any case for
: my work . I would be thankful for any kind of suggestions ..

: Regards
: CDP

 
Reply With Quote
 
CDP
Guest
Posts: n/a

 
      07-05-2005, 11:44 AM


J Jackson wrote:
> In comp.os.linux.embedded CDP <(E-Mail Removed)> wrote:
> : Hello Groups,
>
> : I am a newbie to this groups and I am struggling with a problem and I
> : need your help in this regard.
>
> : I have lwip ( low weight ip) tcp/ip stack and tftp (client & server
> : tftp-hpa-0.40) source .Both are compiling well on linux with out any
> : problem. The tftp source is also working good when I installed it on my
> : linux system (Redhat linux 9.0 , gcc 3.2.2) for getting and putting
> : files.
>
> : I need to get a tftp/udp/ip stack for an embedded system to upgrade the
> : firmware of a chip.
>
> I'm guessing that your embedded system will not have a Linux kernel
> and that you are wanting to build a tftp server as a dedicated application
> in an embedded device? If this is a the case then this isn't a linux
> problem and you have lots of other problems.
>
> If you did have the Linux kernel in the embedded device you'd use it's
> tcp/ip stack, and using lwip wouldn't be an issue.
>
> I think maybe people are just confused by what it is you are trying to do.


Hi Jackson,


Yes your are right , the embedded system do not have a linux kernel
and it has a third party rtos , which is very small and it is only
menat for scheduling.This doesn't have to do anything with what I asked
...?

The reason why I am using Linux is basically , as a test environment
to test my tftp application combined with lwip .If I can tell my tftp
application to use lwip instead of tcp/ip stack from linux , then I can
test my lwip stack as well as tftp application (ofcourse on linux ).
This is what I am trying to do. I guess there is no confusion by now.
If it works fine then the tftp/udp/ip stack is ready for actual
implementation.

As I am using linux now on my PC , so what do you think would be the
way to solve my problem ..? Hope you got my problem by now ...saying
oit in raw words again , tftp application should use lwip for all its
transfers... on linux

Please advice me if you have any idea..?

Regards
CDP

 
Reply With Quote
 
John-Paul Stewart
Guest
Posts: n/a

 
      07-05-2005, 03:06 PM
CDP wrote:
>
>
> I tried it , by setting the LD_PRELOAD environement variable to
> the path of the shared library of lwip I have with me , which I already
> compiled on my linux system. By setting it I started my tftp
> application , but I did not observe any change... its like ,its using
> the normal tcp/ip stack from linux , but not lwip. If the standard
> functions are replaced with this , I should observe some change
> ..right?


I don't quite know what you'd expect to observe. TCP/IP stacks don't
typically display a lot of output on screen telling you what is going
on. What did *you* expect to see? Why did you expect that? (E.g., did
the makers of the alternate stack tell you "expect to see X happen"?)

It's possible that the lack of observed difference means the alternate
stack was running just fine. There might only be observable differences
when things go wrong, if one stack is meant to be a drop-in replacement
for the other.
 
Reply With Quote
 
CDP
Guest
Posts: n/a

 
      07-05-2005, 04:44 PM


John-Paul Stewart wrote:
> CDP wrote:
> >
> >
> > I tried it , by setting the LD_PRELOAD environement variable to
> > the path of the shared library of lwip I have with me , which I already
> > compiled on my linux system. By setting it I started my tftp
> > application , but I did not observe any change... its like ,its using
> > the normal tcp/ip stack from linux , but not lwip. If the standard
> > functions are replaced with this , I should observe some change
> > ..right?

>
> I don't quite know what you'd expect to observe. TCP/IP stacks don't
> typically display a lot of output on screen telling you what is going
> on. What did *you* expect to see? Why did you expect that? (E.g., did
> the makers of the alternate stack tell you "expect to see X happen"?)
>
> It's possible that the lack of observed difference means the alternate
> stack was running just fine. There might only be observable differences
> when things go wrong, if one stack is meant to be a drop-in replacement
> for the other.


Hi John,

The makers of alternate tcp/ip stack (lwip) did not mention
anything to happen after the replacement.So do you think that the
alternate stack is working fine with my tftp application? I can not
even see a single difference b/w the linux tcp/ip stack and lwip , may
be I might have done wrong with my LD_PRELOAD environment variable . I
cross checked the LD_PRELOAD environment variable , its set to the path
of shared library gen erated by means of compiling the stack. Do you
know any other means of cross checking ? whether what I have done is
right?

One more thing is do you have any idea about kernel modification and
recompilation for this problem.., I mean stack replacement problem
under linux ..?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to remove atcp/ip stack and add a third party stack in linux RajaSekhar.Kavuri Linux Networking 1 03-22-2005 06:30 PM
Advice requested: Porting Linux TCP/IP stack to application space Robert Linux Networking 0 07-29-2004 01:09 AM
Packets from bottom of TCP/IP stack direct to application bypassing stack Cameron Kerr Linux Networking 2 06-09-2004 12:19 PM
Looking for TCP stack that runs in application space Robert Linux Networking 5 05-19-2004 12:08 PM
WAP stack for linux Hammercode Linux Networking 0 04-01-2004 12:35 PM



1 2 3 4 5 6 7 8 9 10 11