6 Replies Latest reply on Nov 9, 2007 6:16 PM by Newsgroup_User

    Is this efficient?

    Level 7
      I have a p2p game using the MUS xtra. There is a server application that
      one player runs, and then all players connect to the server. A player
      can send images to other players. When a player sends an image to other
      players it first goes to the server, which distributes it to some or all
      of the other clients.

      Now, take the example of a player (one that is not running the server)
      sending an image to the player that is running the server. The server
      (which has a list of all connected users) sends the image out to the IP
      address of each player. Of course this would include the person running
      the server.

      I am trying to understand, from a network perspective what happens in
      the case of the person running the server. The server is sending the
      image to an IP that is really the same one it is on. Is the server smart
      enough to recognize this? Or does it just send it out, going out to the
      users ISP which then routes it back to be received by the client?

      If this is the case, it would seem to be somewhat inefficient. Could I
      improve it in any way?
        • 1. Re: Is this efficient?
          hellojoyce123123 Level 1
          The server does recognize it and it sends it down the easiest route, I just checked using a packet viewer to see which IP the server sent the message to and it sent to to the ip my computer was on on my router not my ISP then back.

          I don't know if it would use 127.0.0.1 if you didn't have a router though, I actually think it would take the ISP route rather than send directly to your computer.
          • 2. Re: Is this efficient?
            Level 7
            justinjkdr wrote:
            > The server does recognize it and it sends it down the easiest route, I just
            > checked using a packet viewer to see which IP the server sent the message to
            > and it sent to to the ip my computer was on on my router not my ISP then back.
            >
            > I don't know if it would use 127.0.0.1 if you didn't have a router though, I
            > actually think it would take the ISP route rather than send directly to your
            > computer.
            >

            Thats what I was afraid of. It sounds like in your case, the packets
            were sent to the router, which routed back to the computer. But for
            those not behind a router I suspect it would go to their ISP then back
            to the computer.

            I like the idea of using the loopback address (127.0.0.1). I'll try it.
            If the person running the server connects their client using that
            address instead of the IP address assigned by the router or ISP, then it
            truly should not pass through their ethernet port. I'll give it a test
            and let you know.

            Thanks!



            • 3. Re: Is this efficient?
              Level 7
              Ok, so my client can connect to my server on 127.0.0.1 if the computer
              is NOT connected to my home network. When I connect to my network (and
              get an IP address of 172.0.0.100) the client can not connect on
              127.0.0.1. It does connect on 172.0.0.100 because my router forwards the
              ports I am using to this IP address.

              I am not sure why it wont work when I am connected to a network.
              • 4. Re: Is this efficient?
                Level 7
                If the ip you are sending the packets to is the ip of the machine, then the
                exchange will be handled internally, by the os.
                If you are using nat translation, and you are sending the message to the ip
                that is assigned to the router by the isp, then, at least when opening the
                route, the message will first reach the isp and will then be sent back to
                the router - which will then forward it back to the host.
                So, in order to have guaranteed maximum performance/minimum load, you should
                use the intranet (nat) ip to connect to the server by clients residing on
                the same lan (or the same machine) and the router's ip by internet clients.

                As for the localhost (127.0.0.1), it should work if the host is bound to it,
                and if the client is requesting a connection to it. But I think I do
                remember an issue with 127.0.0.1 and mus/muXtra. In general, even if you
                make it work, I would advise against using it, since it is mostly used for
                test purposes.

                "Dave C" <no@no.com> wrote in message
                news:fh0ibs$4k1$1@forums.macromedia.com...
                > Ok, so my client can connect to my server on 127.0.0.1 if the computer is
                > NOT connected to my home network. When I connect to my network (and get an
                > IP address of 172.0.0.100) the client can not connect on 127.0.0.1. It
                > does connect on 172.0.0.100 because my router forwards the ports I am
                > using to this IP address.
                >
                > I am not sure why it wont work when I am connected to a network.


                • 5. Re: Is this efficient?
                  Level 7
                  Thank you so much alchemist, that clears it up for me!

                  By the way, as I recall some time ago you had started working on a new
                  Xtra that was supposed to offer many functions and features. I can't
                  recall specifically what it was called, but one of the functions was the
                  ability to automatically configure routers so that they forwarded
                  whatever ports that a program needed. Am I recalling correctly? What is
                  the status?
                  • 6. Re: Is this efficient?
                    Level 7
                    Yes, it can open routes via upnp, like e.g. bit torrent clients do , long as
                    upnp communication is enabled on the router.
                    It has been under development for several years now, and it's aim is to
                    transform director to a pro app/server builder.
                    Though networking will be one of it's most important features, it's not the
                    only one. A beta version of it's unicode functionality was available for
                    testing last year, under the name 'Xtrema'. Now that research on most of
                    it's base components is finished, it shouldn't take long for a new version
                    including the networking features to be released.
                    Since you are into mu programming, and case you want to give the current
                    version a try, mail me off-list at xtrema at rtr d0t gr.


                    > one of the functions was the ability to automatically configure routers so
                    > that they forwarded whatever ports that a program needed
                    Yes, amongst it's features is talking upnp and opening ports - like e.g.
                    torrent clients do.
                    It has been under development for several years, and it's goal is to
                    transform director to a very powerfull pro-app/server builder.


                    "Dave C" <no@no.com> wrote in message
                    news:fh1suk$ss3$1@forums.macromedia.com...
                    > Thank you so much alchemist, that clears it up for me!
                    >
                    > By the way, as I recall some time ago you had started working on a new
                    > Xtra that was supposed to offer many functions and features. I can't
                    > recall specifically what it was called, but one of the functions was the
                    > ability to automatically configure routers so that they forwarded whatever
                    > ports that a program needed. Am I recalling correctly? What is the
                    > status?