[AG-TECH] Unicast issues with vic/rat

Andrew Swan aswan at cs.berkeley.edu
Mon Jan 26 20:44:27 CST 2004


Don Morton wrote:
> For some reason, there are folks who are trying
> to unicast in, and the end result seems to be that
> "we" can see them, but they can't see us.  Note
> that there's no multicast involved here - in one case,
> the bridge is simply being used as a "rendezvous point"
> for two unicast streams, but the same problems occur - 
> I seem to be able to see/hear the remote site, but they
> can't see/hear me.
> 
> [...]
> 
> My vague understanding of vic/rat, used with the QuickBridge,
> is that the clients send UDP datagrams out to the bridge on ports
> in the 50000 range, and they seem to receive UDP datagrams on
> ports in the 32000 range, and it "should" be that simple.

i'm not sure about rat but vic in unicast mode sends and
receives on the same port, which is specified on the
command line.  (the ports in your example were in the
50000 range).  the source port in packets sent from vic
will be an "ephemeral port" chosen by the operating system
which is likely what you are referring to as in the 32000
range.  

the behavior you describe is consistent with a nat or a
firewall that builds dynamic rules that assumes vic will
receive packets on the same port that it sends them from.

for example, if the remote person joins your quickbridge
on port 50186, they start sending packets from source port
32456 (or some other port chosen by their operating system,
but not port 50186).  upon seeing these packets, the nat or
firewall installs a rule to forward packets from source port
50186 on the quickbridge addressed to destination port 32456
back to the remote participant.  however, quickbridge is
sending packets to destination port 50186 so they never
reach the remote site.

probably the easiest way to verify that this is the problem
is to rebuild vic with the attached patch and run the
modified version at the remote site.  or if you have openmash
vic installed, you can just add the flag "-rtptv" to the vic
command line to get the same effect.

-Andrew

-------------- next part --------------
*** net/net-ip.cpp.orig	Mon Jan 26 18:38:58 2004
--- net/net-ip.cpp	Mon Jan 26 18:41:45 2004
***************
*** 421,427 ****
  	nonblock(fd);
  
  
! #ifdef WIN32
  	memset((char *)&sin, 0, sizeof(sin));
  	sin.sin_family = AF_INET;
  	sin.sin_port = 0;
--- 421,439 ----
  	nonblock(fd);
  
  
! #define NO_EPHEMERAL_SOURCE_PORT
! #ifdef NO_EPHEMERAL_SOURCE_PORT
! 	memset((char*)&sin, 0, sizeof sin);
! 	sin.sin_family = AF_INET;
! 	sin.sin_port = port;
! 	sin.sin_addr.s_addr = INADDR_ANY;
! 	if (bind(fd, (struct sockaddr*)&sin, sizeof sin) < 0) {
! 		perror("bind");
! 		exit(1);
! 	}
! #endif
! 
! #if defined(WIN32) && !defined(NO_EPHEMERAL_SOURCE_PORT)
  	memset((char *)&sin, 0, sizeof(sin));
  	sin.sin_family = AF_INET;
  	sin.sin_port = 0;
***************
*** 431,436 ****
--- 443,449 ----
  		exit(1);
  	}
  #endif
+ 
  	memset((char *)&sin, 0, sizeof(sin));
  	sin.sin_family = AF_INET;
  	sin.sin_port = port;


More information about the ag-tech mailing list