9 Replies Latest reply on Sep 6, 2011 12:27 AM by entrepreneur101

    missing feature or bug? - NetGroup video does not go through firewalls/NATs

    entrepreneur101 Level 1

      I am developing an application based on NetGroup Video. I observed following

       

      - Without any NAT/firewall - "NetGroup.post" and audio/video DOES work

      - One client inside NAT/firewall - "NetGroup.post" works, video and audio DOES NOT work

      - After manually punching holes in NAT/firewall (outside of application), both audio and video started working. As soon as hole was closed, both audio/video stopped again.

       

      It seems like NetGroup P2P connections do not do NAT/firewall hole punching. Can somebody from adobe confirm this to be true (or not true). If true, is it a known issue, will it be fixed soon? If not, I may have to implement a hole punching algorithem in my application.

       

      Any information / help is appreciated.

        • 1. Re: missing feature or bug? - NetGroup video does not go through firewalls/NATs
          Michael Thornburgh Adobe Employee

          RTMFP Groups does do NAT/firewall traversal.  the underlying connections between peers are RTMFP sessions.

           

          NetGroup.post and P2P multicast use exactly the same RTMFP sessions between peers.  it should not be possible that NetGroup.post would work but P2P multicast video/audio would not work in the same group between the same peers.

           

          when you say "manually punching holes in NAT/firewall", what do you mean exactly?  the ports used by RTMFP clients are random per NetConnection and can't be predicted.  are you blocking UDP with a firewall, did you set up port forwarding through your NAT, or did you disable your NAT entirely?

           

          what GroupSpecifier parameters are you using for the case where NetGroup.post is working for you?  how about for the NetStream where P2P multicast doesn't work?  is it the same group?

          • 2. Re: missing feature or bug? - NetGroup video does not go through firewalls/NATs
            entrepreneur101 Level 1

            Thanks for the quick reply Michael. After your assurance that it works, I am testing again. I found at least one problem in my code and will continue to test until I can report with more confidence.

             

            "manually punching holes" - I started video talk using gmail video chat and as long as gmail video was on, Netgroup video also worked. I have no idea why it worked that way. My guess is that somehow Netgroup was picking up video stream from gmail video.

             

            I am using one NetGroup specifier for both NetGroup as well as NetStream.

             

            Again - all this is irrelevant now as I was able to reproduce a part of problem outside of NAT as well, which points to a problem in my coding. For now I will assume it to be a coding error and continue working. I will report back if I run into a wall again.

             

            Thanks, your post gave me confidence and helped me identify issues.

            • 3. Re: missing feature or bug? - NetGroup video does not go through firewalls/NATs
              entrepreneur101 Level 1

              Hi Michael,

               

              I learned a lot more and finally fixed everything that was wrong. I am still having same issue. Here is what I did step by step:

               

              1. A user logs into my app with id 'user1'. I create a netgroup with id X (new GroupSpecifier("user1") and publish user's video with name 'user1' [outgoingStream.publish('user1')]

              2. Another logs in and finds first user's id. 2nd user joins netgroup X and starts playing stream X [incomingStream.play('user1')]

               

              3. I tested using 2 computers connected to my LAN. It works perfectly for multiple users.

               

              4. I connected 2 users through separate networks

              (e.g.  first user on LAN 2nd user on mobile network; first user on LAN 2nd user is a friend in different city etc).

               

              In any of these cases the code executed successfully but the video never came through.

               

              5. As last time it strangely worked when gtalk video was started, I decided to test that again.

              I started a gtalk video call ALSO. my application video also showed up.

              I disconnected gtalk video call, my application video also stopped.

               

              You can test this application at http://www.chattiz.com

              I will also send you a private message with test URLs to see logs that might help in solving the problem.

               

              Please help.

              • 4. Re: missing feature or bug? - NetGroup video does not go through firewalls/NATs
                Michael Thornburgh Adobe Employee

                as i said before, it should work, and what you're describing (especially the "starts to work with gtalk and stops working when gtalk turns off" part) doesn't make sense.  especially since you're able to connect to Cirrus in the first place.

                 

                does the posting-based text chat work even if video doesn't?

                 

                please post the results of the cc.rtmfp.net check with gtalk video not running and with it running.  it would be interesting to see if your NAT behavior is different when gtalk video is operating.  that's the only explanation i can think of that fits the evidence you've provided so far.

                • 5. Re: missing feature or bug? - NetGroup video does not go through firewalls/NATs
                  entrepreneur101 Level 1

                   

                  Hi Michael, thanks for quick reply. My reply as below:

                   

                  1. Yes the text chat works over NetGroup while video does not work (Video is connected through a different NetGroup)

                  2. results of cc.rtmfp.net as follows:

                   

                  Event: NetConnection.ConnectivityCheck.Results info:

                  receiveDifferentAddressDifferentPortAllowed: false

                  code: NetConnection.ConnectivityCheck.Results

                  publicAddressIsLocal: false

                  level: status

                  description: Connectivity Check Results

                  sendAfterIntroductionAllowed: true

                  sendAfterIntroductionPreservesSourceAddress: true

                  receiveSameAddressSamePortAllowed: true

                  sendAfterIntroductionPreservesSourcePort: true

                  localAddresses: 10.0.0.2:52964,[2001:0:4137:9e76:28c8:22e8:8302:dec1]:52965

                  publicPortMatchesLocalPort: true

                  receiveSameAddressDifferentPortAllowed: false

                  publicAddress: 124.253.33.62:52964

                   

                  3. My code to send video is as follows:

                   

                  var id:String = "user1";

                   

                  // code to send video

                  var groupSpec:GroupSpecifier = new GroupSpecifier(id);

                  groupSpec.ipMulticastMemberUpdatesEnabled = true;

                  groupSpec.multicastEnabled = true;

                  groupSpec.postingEnabled = true;

                  groupSpec.objectReplicationEnabled = true;

                  groupSpec.routingEnabled = true;

                  groupSpec.serverChannelEnabled = true;

                   

                  outgoingStream = new NetStream(netConnection, sendVideoNetGroupSpec.groupspecWithAuthorizations());

                  var mic:Microphone = Microphone.getMicrophone();

                  mic.gain = 100;

                  outgoingStream.attachAudio(mic);

                  var camera:Camera = Camera.getCamera();

                  camera.setMode(320, 240, 15);

                  outgoingStream.attachCamera(camera);

                   

                  outgoingStream.publish(id);

                  break;

                   

                   

                  4. Code to receive video on the other end is as follows:

                   

                  var groupSpec:GroupSpecifier = new GroupSpecifier(id);

                  groupSpec.ipMulticastMemberUpdatesEnabled = true;

                  groupSpec.multicastEnabled = true;

                  groupSpec.postingEnabled = true;

                  groupSpec.objectReplicationEnabled = true;

                  groupSpec.routingEnabled = true;

                  groupSpec.serverChannelEnabled = true;

                   

                  var incomingStream:NetStream = new NetStream(netConnection, chatTopicNeighbourList[i].videoNetGroupSpec.groupspecWithAuthorizations());

                  incomingStream.receiveVideo(true);

                  incomingStream.receiveAudio(true);

                   

                  var st:SoundTransform = new SoundTransform(1);

                  incomingStream.soundTransform = st;

                   

                  var remoteVideo:Video = new Video();

                  remoteVideo.width = 120;

                  remoteVideo.height = 68;

                  remoteVideo.attachNetStream(incomingStream);

                   

                  videoDisplay.addChild(remoteVideo);

                   

                  incomingStream as NetStream.play(id);

                   

                   

                  • 6. Re: missing feature or bug? - NetGroup video does not go through firewalls/NATs
                    Michael Thornburgh Adobe Employee

                    are the results from cc essentially the same with gtalk video running and not running?  i was hoping to see the cc results for both cases.

                     

                    according to the cc results you posted, your NAT is a port restricted cone NAT. you should be able to communicate with anything that's not behind a symmetric NAT (where there's a unique translation for each peer you're talking to).

                     

                    as far as what's going on on the wire, RTMFP doesn't care whether the data flowing over it is text chat (postings) or video (p2p multicast). if text chat (using posting in a NetGroup) is working P2P with or without gtalk video, but video (via P2P multicast over a group NetStream) is dependent on whether gtalk video is running, then the problem is almost certainly not network related.  in particular, if you just have two peers, then the same RTMFP session (assuming you're using the same NetConnection) is used for both groups (the one you're using for posting/chat and the one you're using for multicast).

                     

                    i think something else must be going on.

                    • 7. Re: missing feature or bug? - NetGroup video does not go through firewalls/NATs
                      entrepreneur101 Level 1

                      Michael, I did a bare bones app to get a proof of concept working but that also did not work. So at this point, I assume it is my ignorance about how to code to get videos working through netgroup.

                       

                      I tested the app with direct video and it works. Then I made following 2 changes and it stops working.

                       

                      ------------- sending video changes start ---------------------------------------------

                      var outgoingStream:NetStream = new NetStream(netConnection, NetStream.DIRECT_CONNECTIONS);
                      outgoingStream.publish(netConnection.nearID);

                      var outgoingStream:NetStream = new NetStream(netConnection, groupSpec.groupspecWithAuthorizations());

                      outgoingStream.publish(netConnection.nearID);

                      ------------- sending video changes end ---------------------------------------------

                       

                       

                      ------------- receive video changes start ---------------------------------------------

                       

                      incomingStream = new NetStream(remotePeerID);
                      incomingStream.play(remotePeerID);

                      incomingStream = new NetStream(groupSpec.groupspecWithAuthorizations());

                      incomingStream.play(remotePeerID);

                      ------------- receive video changes end ---------------------------------------------

                       

                       

                       

                      What am I doing wrong? Is there a code sample to publish video to a group and

                       

                       

                       

                      =============================================

                      In case you are interested: POC app is located at http://www.chattiz.com//flex/Chattiz.html

                       

                      To test direct video, start 2 browser A and B and go to mentioned URL. Press "send direct video" button in A, it will print an ID, copy the ID, paste in the top right text box in B and press "see direct video" button. You can see A's video. Now you can similarly send B's video back to A.

                       

                      To test group video, start 2 browser A and B and go to mentioned URL. Press "send group video" button in A, it will print an ID, copy the ID, paste in the top right text box in B and press "see group video" button. You can NOT see A's video.

                       

                      P.S.: I can provide full source if needed.

                      • 8. Re: missing feature or bug? - NetGroup video does not go through firewalls/NATs
                        Michael Thornburgh Adobe Employee

                        first, i assume that on the receive side you're actually saying new NetStream(netConnection, groupSpec.groupspecWithAuthorizations()).  it probably wouldn't compile if you did it like you actually posted. 

                         

                        when using groups, after making your new group NetStream, you *must* wait for a NetStream.Connect.Success event to be posted to the NetConnection's NetStatusEvent.NET_STATUS handler before you can do anything with the new NetStream (other than adding event handlers to it).  so before saying netStream.publish() or netStream.play(), you need to wait for that event.  the event is associated with the "Peer Assisted Networking" dialog.

                        1 person found this helpful
                        • 9. Re: missing feature or bug? - NetGroup video does not go through firewalls/NATs
                          entrepreneur101 Level 1

                          Thank you Micheal. That was the mistake I was making. My group video now works.

                           

                          I owe you 100 beers!!