Find the answer to your Linux question:
Results 1 to 2 of 2
Hi , Here I can mention my software requirements as follows. I need to transfer data between PC (linux/windows based) and linux based hardware board Method 1 : Transfer using ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2010
    Posts
    1

    LInux socket programming - PPP protocol


    Hi ,

    Here I can mention my software requirements as follows.

    I need to transfer data between PC (linux/windows based) and linux based hardware board

    Method 1 :

    Transfer using TCP/IP ( Ethernet card is interface ) protocol :

    Here we can transfer data using socket programming .One PC acted as a server and other one as a client . I know this method .

    Method 2 :

    Transfer using PPP protocols ( RS 232 and serial cable interface) :

    I am not very clear about this method. My doubts are as follows.

    1) As per my understanding same socket program as I mentioned above can reuse in this case without any modification, because PPP is a data link layer protocol and If I open socket means we are directly communicate with TCP or UDP layer which is above Data link layer. If this is true

    a) How I can make sure that in which route data is passing( Either ethernet layer / PPP layer ) ? Defenitely some configuration is required in order to select PPP or ethernet protocol in linux in application program.Assume that I am working only in application layer not in Kernel level.

    b) Which is equivalent protocol for PPP if I use ethernet card ?

    2) Here one more use case that is in windows. It is as follows.

    One PC is running windows based tool , that is connected with linux based hardware.( RS 232 interface) . This is for modem dial up.
    when I have press connect button in this tool, Internally source code is using windows RAS API with remote phone number (like RasDial()). As a result of this remote hardware (linux based hardware) will send back its IP address. Once IP address was obtained by windows based tool, it will open a socket and connect to port 2000 of Remote hardware . Here communication medium is RS 232 .

    a) Is RAS service in windows make use of PPP protocol ? Here windows is using RAS service for dial up(to connect to remote linux hardware). How I can receive this data in remote linux hardware ? I dont think we can socket program here because I dont have remote linux hardware IP address now. So may be linux also have same kind of RAS service ? please clarify it ?
    b) Here also once IP adress received, windows opening a socket and send data to linux hardware . But communication is through serial (PPP). Here how we can select specifically PPP(Normally we use ethernet protocol and ethernet card )

    If you know any site regarding this , please forward to me .

    Thanks,
    Sethu

  2. #2
    Just Joined!
    Join Date
    Feb 2009
    Posts
    23
    Okay, I come from a network back ground, and could be approaching this wrong, but here's my take on things.

    Quote Originally Posted by sethum View Post

    1) As per my understanding same socket program as I mentioned above can reuse in this case without any modification, because PPP is a data link layer protocol and If I open socket means we are directly communicate with TCP or UDP layer which is above Data link layer. If this is true
    PPP is a layer 2 protocol - think of it from the OSI model as an alternative to ethernet. As such you run IP above PPP it then above IP the UDP / TCP port numbers. Again, OSI, think IP v4 or v6, with PPP as it's below this doesn't matter. Think of it like this:

    4 TCP UDP
    3 IP IPX
    2 ethernet / PPP
    1 cable

    Quote Originally Posted by sethum View Post
    a) How I can make sure that in which route data is passing( Either ethernet layer / PPP layer ) ? Defenitely some configuration is required in order to select PPP or ethernet protocol in linux in application program.Assume that I am working only in application layer not in Kernel level.
    Again, as you are working in layer 2, you'd use your layer 3 suite of tools. If IP, ping is useful as well as looking at your routing table. trace might give you some pointers, but remember that PPP as a layer 2 protocol won't catch any layer 3 devices it tunnels through. Just the same as you don't see layer 2 switches when tracing - IP doesn't see the layers beneath it.

    Quote Originally Posted by sethum View Post
    b) Which is equivalent protocol for PPP if I use ethernet card ?
    IEEE 802.3.. ethernet, both sit in the same place on the OSI model. You can tunnel PPP over ethernet, but you could use a variety of different protocols aka GRE / IPSec tunnels. PPP is done over a variety of networks - many DSL Broadband provers are actually using PPPoA (over atm) or PPPoE (over ethernet) to provide their services. Again, both ethernet and ppp sit as a data link layer protocol. But... PPP can be tunnelled, so sorry I've I've misunderstood that.

    Quote Originally Posted by sethum View Post
    One PC is running windows based tool , that is connected with linux based hardware.( RS 232 interface) . This is for modem dial up.
    It's a serial port - Serial port
    Quote Originally Posted by sethum View Post
    when I have press connect button in this tool, Internally source code is using windows RAS API with remote phone number (like RasDial()). As a result of this remote hardware (linux based hardware) will send back its IP address. Once IP address was obtained by windows based tool, it will open a socket and connect to port 2000 of Remote hardware . Here communication medium is RS 232 .
    Not clear on what you are doing here - sounds like a reverse telnet. See the wiki entry on it - Reverse telnet You sure that IP it's getting is really the Linux device, it's not the Windows device's IP address, or a 3rd party piece of hardware with a different port number? Normally I'd just use in Windows something like Putty or Hyperterminal (minicom in Linux) to connect via a serial port into a another device. That port 2000 makes me think of terminal servers - Terminal server - see the section that has the heading Console Management - Rev Telnet, Rev SSH, and follow the link there for console managment.


    Quote Originally Posted by sethum View Post
    a) Is RAS service in windows make use of PPP protocol ? Here windows is using RAS service for dial up(to connect to remote linux hardware). How I can receive this data in remote linux hardware ? I dont think we can socket program here because I dont have remote linux hardware IP address now. So may be linux also have same kind of RAS service ? please clarify it ?
    No, I don't believe that it is using PPP, unless you've got some sort of call back going on. I'm am a little confused here on exactly the method you are using to get into the serial port of the Linux device. Are you having to set parity and stopbits? A serial connection is generally layer 1 - the physical layer. As such I've used Windows tools such as Hyperterminal to connect to devices through the serial port. To me it sounds like you connected to a console server through your serial port and then you are reverse telneting to different devices.

    Quote Originally Posted by sethum View Post
    b) Here also once IP adress received, windows opening a socket and send data to linux hardware . But communication is through serial (PPP). Here how we can select specifically PPP(Normally we use ethernet protocol and ethernet card )
    Check those IP address. Using an ethernet port rather than the serial for comms would generally be not using a remote port number.

    Again, I may have this completely wrong, but I would check the cabling on exactly how you are connecting to those devices and what you are physically using. Sorry if I've got the wrong idea about what's happening here, please clarify if I've given bad info about another subject.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •