Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to connect two Qt PC apps over Internet (not locally) using UDP protocol?

How to connect two Qt PC apps over Internet (not locally) using UDP protocol?

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 6 Posters 2.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CroCo
    wrote on last edited by
    #1

    I'm in the process of developing some sort of teleoperation robotics application. One PC is ubuntu and the other PC is Windows 10. Both have Qt5.10. I've done some applications using sockets in Windows and Linux but locally using 127.0.0.1 and port 444. Now I would like to develop an application over Internet to test my application. What are the general guidelines for this kind of applications? It seems to me the security is the real issue and merely dumping the IP is not enough. Is there any tips regarding this issue? Also, if Qt has any features to simply this kind of projects? Thank you in advance.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      QSslSocket comes to mind for that.

      Note that robot teleoperation and UDP doesn't sound quite right. Looks more like something for TCP.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • C Offline
        C Offline
        CroCo
        wrote on last edited by
        #3

        @SGaist thank you for QSslSocket. Regarding the UDP, this is the right approach for teleoperation robotics. Delay is a major issue in teleoperation so upd is preferred in this kind of projects. This is a well-established fact in literature.

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          Connecting over LAN or internet works 100% the same.
          The only matter is source and target will be behind router/firewall and the correct
          NAT/forwarding needs to be in place for it to work.

          1 Reply Last reply
          2
          • Pablo J. RoginaP Offline
            Pablo J. RoginaP Offline
            Pablo J. Rogina
            wrote on last edited by
            #5

            @CroCo said in How to connect two Qt PC apps over Internet (not locally) using UDP protocol?:

            Delay is a major issue in teleoperation so upd is preferred in this kind of projects. This is a well-established fact in literature.

            @CroCo maybe UDP is well established in the literature, but perhaps it was so in a world where the clients/servers sat in the same local network, and Internet or IoT was not widely available as it is now, full of bad guys trying to do bad things.

            Given that said, and if you're really going to connect some robotics device on the Internet and expect to control it from somewhere in the world, please be advised that you won't be the only one trying to control it. Once somebody discover that there's a port open listen for plain UDP packets, well, it's a invitation for things to go wrong.

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            aha_1980A C 2 Replies Last reply
            3
            • JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              In addition to what you guys have said, I thought UDP is for "broadcasting to multiple clients" whereas a TCP connection would be for "one-to-one communication". Why would the OP want to "broadcast" in this situation?

              1 Reply Last reply
              0
              • Pablo J. RoginaP Pablo J. Rogina

                @CroCo said in How to connect two Qt PC apps over Internet (not locally) using UDP protocol?:

                Delay is a major issue in teleoperation so upd is preferred in this kind of projects. This is a well-established fact in literature.

                @CroCo maybe UDP is well established in the literature, but perhaps it was so in a world where the clients/servers sat in the same local network, and Internet or IoT was not widely available as it is now, full of bad guys trying to do bad things.

                Given that said, and if you're really going to connect some robotics device on the Internet and expect to control it from somewhere in the world, please be advised that you won't be the only one trying to control it. Once somebody discover that there's a port open listen for plain UDP packets, well, it's a invitation for things to go wrong.

                aha_1980A Offline
                aha_1980A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Hi @CroCo,

                And just to add to @Pablo-J.-Rogina,

                Regarding the UDP, this is the right approach for teleoperation robotics. Delay is a major issue in teleoperation so upd is preferred in this kind of projects. This is a well-established fact in literature.

                You are aware that sending packets through the internet is not comparable with sending them in the local network? First, the time to tansmit a packet to another station takes unpredicatable time, and every packet can take another route.

                Second, sometimes packets get lost in the internet. With TCP you have automatic retransmission, something that you have to take care yourself when using UDP.

                Qt has to stay free or it will die.

                1 Reply Last reply
                2
                • Pablo J. RoginaP Offline
                  Pablo J. RoginaP Offline
                  Pablo J. Rogina
                  wrote on last edited by
                  #8

                  @JonB I think UDP is/was used because of its simplicity, and thus, less computation resources needed to implement it (thinking of old embedded devices for instances), but simplicity comes at a stake of less reliability. A TCP connection guarantees the delivery of a package (because of retransmission, etc.) while UDP doesn't assure any given packet will reach the other end.

                  Upvote the answer(s) that helped you solve the issue
                  Use "Topic Tools" button to mark your post as Solved
                  Add screenshots via postimage.org
                  Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                  1 Reply Last reply
                  3
                  • Pablo J. RoginaP Pablo J. Rogina

                    @CroCo said in How to connect two Qt PC apps over Internet (not locally) using UDP protocol?:

                    Delay is a major issue in teleoperation so upd is preferred in this kind of projects. This is a well-established fact in literature.

                    @CroCo maybe UDP is well established in the literature, but perhaps it was so in a world where the clients/servers sat in the same local network, and Internet or IoT was not widely available as it is now, full of bad guys trying to do bad things.

                    Given that said, and if you're really going to connect some robotics device on the Internet and expect to control it from somewhere in the world, please be advised that you won't be the only one trying to control it. Once somebody discover that there's a port open listen for plain UDP packets, well, it's a invitation for things to go wrong.

                    C Offline
                    C Offline
                    CroCo
                    wrote on last edited by
                    #9

                    @Pablo-J.-Rogina thank you for this informative answer. The comparison between UDP and TCP in teleopration projects has been done in literature. I don't remember the papers I've read since this was a long time ago. UDP is preferred over TCP due to not simplicity which is a bonus but the fact that delay destablizes Haptic-Teleopereation projects. In the aforementioned projects, delay time injects unwanted energy in the system. The mathematical proof for the preceding fact has been published in the 1980s. You can search more about that in IEEE if you are interested.

                    You are absolutely right about the security issue which is why I'm asking since my background is far away from networking security discipline. I need some guidelines for this matter in order to perform projects in more realistic scenarios. I've done the local networking communication. Now I need to move forward with caution.

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved