udprelay in netty

montanero roland.bergler at gmail.com
Tue Dec 29 06:27:02 EST 2009


Hi Trustin,

Thank you for your answer.


Trustin Lee wrote:
> 
> I hope you enjoy Netty :)
> 

I like the code and its structure very much, thank you for your great work!
What I am missing (as a beginner) is documentation on the architecture and
more complex examples on using netty.


Trustin Lee wrote:
> 
> I am somewhat confused.  Are you going to write a server, a client, or
> both?  Also, could you let me know what exactly udprelay does?  It it
> something like port unification?
> 

Udprelay (as I understand and use it) is running on a NAT router/firewall to
allow multiple clients on the outside to communicate with a UDP server
inside the NAT zone . It therefore maps remote client addresses to local
ports and forwards datagrams in both ways between the server and the
clients. To allow for conversational state on the communication between the
server and the client, the assignment between the "inner" port and the
"outer" peer address has to be one-to-one and must be kept stable at least
for a while.

At the moment I am experimenting with a datagram channel ("outside") with a
single handler. This handler maintains a map of datagram channels ("inside")
and forwards data between those channels. If an datagram is arriving on the
"outside" channel with a yet unknown remote address, a new "inside" channel
is created and added to the map. After that the datagram  is  forwarded to
the "inside" channel. Datagrams arriving on the "inside" channels are
forwarded to the "outside" channel after changeing the remote address.

I wonder whether this is the correct way to do this. To me it seems that
multiplexing data from a single channel to and from multiple channels is a
common problem which should have been solved somewhere? Somebody got an
example?

Greetings
Roland

-- 
View this message in context: http://n2.nabble.com/udprelay-in-netty-tp4217976p4227328.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list