locked
TCP over serial port RS232, PPP or something else? RRS feed

  • Question

  • I have app( a kind of custom messenger) that is communicating over TCP/IP. But some of my users might be reachable over serial port RS232, not Ethernet. That is some custom wire interface that goes over different equipment, but the point is I get RS232 at user end.

    What is the best way to communicate over RS232, is there any nice library I can use? I tried PPP over serial port in WinXP and Win7, and that looks fine, but maybe I need some custom library, especially since I go over unreliable media, and handling of connect/disconnect. Or, maybe there is some other custom library, doesn’t need to be TCP based, that would handle lost of connection, recovery or lost packets, corruption in transmitting recovery etc.?

    • Moved by Mike Feng Monday, April 8, 2013 8:02 AM
    Saturday, April 6, 2013 11:34 AM

Answers

  • PPP is that custom library. Otherwise you may use SLIP. See Serial Programming/IP Over Serial Connections.
    Saturday, April 6, 2013 12:14 PM
  • SLIP is severely limited and obsolete.   The PPP is the way to go.   If you really want to get things cranking, you may wish to look for support from Van Jacobsen's Header Compression algorithm.

    Both of these work at the IP level.   The big problem with an error prone link is that TCP's performance in an lossy link sucks badly.   TCP handles an occasional packet loss and even with the Van Jacobsen improvements in managing the window (slow start), it won't over drive the capacity of the link.   However, if you have a noisy link you want to use something else.   If file transfer is primarily what you are doing, there are some commercial packages out there that handle the throughput in a long latency or lossy link better.   They still run on IP (and hence PPP or whatever you have at the link level) but they use a more robust transfer protocol.

    Saturday, April 6, 2013 12:29 PM

All replies

  • PPP is that custom library. Otherwise you may use SLIP. See Serial Programming/IP Over Serial Connections.
    Saturday, April 6, 2013 12:14 PM
  • SLIP is severely limited and obsolete.   The PPP is the way to go.   If you really want to get things cranking, you may wish to look for support from Van Jacobsen's Header Compression algorithm.

    Both of these work at the IP level.   The big problem with an error prone link is that TCP's performance in an lossy link sucks badly.   TCP handles an occasional packet loss and even with the Van Jacobsen improvements in managing the window (slow start), it won't over drive the capacity of the link.   However, if you have a noisy link you want to use something else.   If file transfer is primarily what you are doing, there are some commercial packages out there that handle the throughput in a long latency or lossy link better.   They still run on IP (and hence PPP or whatever you have at the link level) but they use a more robust transfer protocol.

    Saturday, April 6, 2013 12:29 PM
  • I mostly exchange some info messages with some numerical data, and occasionally send files/pictures.

    PPP seems fine to me, just on Windows platform is difficult for user to manage it. Average user can not handle connect/disconnect problems, thru Network Control Panel, then in case of lost connection he/she must to reestablish link, etc. Also, I think in windows implementation of PPP client side needs to connect to master, which is complicated to users.

    It seems like that Windows/PPP technology is designed only for stable modem connections, and they do not pay attention to it much.

    I would need something easier for users, like “just plug serial cable here, and start my app, and all will work”. Users become stupid if windows disconnect PPP due to bad serial link. Ideally app would handle all that, not requiring users to mess with Network connection panel.

    Saturday, April 6, 2013 2:01 PM
  • This really isn't a C# question.... you'd be better off asking elsewhere.

    Saturday, April 6, 2013 2:53 PM
  • Ideally, I was thinking, there would be some third-party C# library that would implement PPP or similar, that I would call, overtake control of serial port from my application, and maintain connections and open some kind of socket and do my TCP over it...

    Saturday, April 6, 2013 3:18 PM
  • Are then looking to control the device through the computer's RS232 com port or USB port?

    If so, use the serialport class resource. Drag it from the toolbox to your form.

    Saturday, April 6, 2013 8:41 PM
  • Hi Mark55_55,

    Thanks for your post.

    I agree with Ron Natalie that your question is actually not a Visual C# General question.

    I'll move your case to "Where is the forum for" so that you can be redirect to the right forum.

    Regards,


    Barry Wang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 8, 2013 8:00 AM
  • Places to ask...

    http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/threads

    http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/threads

    Thanks!


    Ed Price (a.k.a User Ed), SQL Server Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)

    Answer an interesting question? Create a wiki article about it!

    Monday, April 8, 2013 3:24 PM