NAT

28 views
Skip to first unread message

Matheus Santana

unread,
Dec 23, 2010, 3:03:54 PM12/23/10
to gazzera-discuss
Hi everyone!

I have a simple question: gazzera works with over a router? I ask that
because my GID are @127.0.1.1:6730 ... and i using a dlink router, as
DHCP server. I see the ExampleFriend and he have a static IP, did you
using a dynDNS account?

Regards,
Matheus

Cyrus Pencroff

unread,
Dec 23, 2010, 6:57:31 PM12/23/10
to gazzera...@googlegroups.com
Hello!
Gazzera works behind a router, with some limitation. It currently cannot determine its public IP, so your gid looks like localhost (127.0.0.1) or your private network (ie 192.168.x.y). You can force the "address part" of the Gid with the dynamic.host parameter, where you can put either an host name or an ip address. Examples:

dynamic.host=yourhost.dyndns.org
dynamic.host=123.45.67.89

To set the parameter, close gazzera, go to <path>/database/<yourgid>/ and open the file called "conf" with a text editor.

ExampleFriend is behind a router and uses a dynamic host with variable IP.
Note also that you have to open your firewall for incoming connection. UPNP automatic opening will be implemented.
I hope this help, feel free to ask any other question :)

Matheus Santana

unread,
Dec 23, 2010, 10:16:49 PM12/23/10
to gazzera-discuss
Hi Cyrus!

In theory, if i know my public IP and my local IP, can i set these
"two" hosts by someway, right? If no, i think to try write some code
to do that :)

Regards!

On Dec 23, 9:57 pm, Cyrus Pencroff <delent...@gmail.com> wrote:
> Hello!
> Gazzera works behind a router, with some limitation. It currently cannot
> determine its public IP, so your gid looks like localhost (127.0.0.1) or
> your private network (ie 192.168.x.y). You can force the "address part" of
> the Gid with the dynamic.host parameter, where you can put either an host
> name or an ip address. Examples:
>
> dynamic.host=yourhost.dyndns.org
> dynamic.host=123.45.67.89
>
> To set the parameter, close gazzera, go to <path>/database/<yourgid>/ and
> open the file called "conf" with a text editor.
>
> ExampleFriend is behind a router and uses a dynamic host with variable IP.
> Note also that you have to open your firewall for incoming connection. UPNP
> automatic opening will be implemented.
> I hope this help, feel free to ask any other question :)
>
> On Thu, Dec 23, 2010 at 9:03 PM, Matheus Santana
> <matheussl...@yahoo.com.br>wrote:

Cyrus Pencroff

unread,
Dec 24, 2010, 6:33:41 AM12/24/10
to gazzera...@googlegroups.com
Uhm i'm not sure i understood. What do you mean with "two hosts"? Note that gazzera nodes listen to all interfaces, so it will be avaiable both from the local network and the internet. The "address portion" of the GID is just descriptive, it's used only when you give your gid to a friend (for example by mail) to give his node an hint of where to find you the first time. So for example the following GIDs all identify the very same node:

ExampleFriend@7002d187e4f190af535e4dbf79a66063d5b8a367@192.168.0.55:7755
ExampleFriend@7002d187e4f190af535e4dbf79a66063d5b8a367@anyhost.dyndns.org:7755
ExampleFriend@7002d187e4f190af535e4dbf79a66063d5b8a367@127.0.0.1:7755
ExampleFriend@7002d187e4f190af535e4dbf79a66063d5b8a367

As you can see, the last GID is still valid (the address is optional). If the address portion is missing or can't be connected to, the friend is still added, but it will appear oflline.

Any code contribution is very welcome :) Let me know if you want the last version of the code, i've a lot of uncommitted changes since i'm reworking some of the download/upload code.

Matheus Santana

unread,
Dec 27, 2010, 3:33:53 PM12/27/10
to gazzera...@googlegroups.com
Hi again,

when i say two hosts i say some thing like this:

...@85.34.5.6.7.8(Real internet IP):127.0.0.1:7575(NAT IP behind a router).

Doing that i can just set the GID without using DynDNS, for example. Ok, we still have the problem with dynamic IP, but i think that the problem with NAT is resolved, what you think?

About the code, yes, i want to help! :)

Regards,
Matheus S. Lima
Bacharelado em Ciência da Computação
Universidade Federal de São Carlos

--- Em sex, 24/12/10, Cyrus Pencroff <dele...@gmail.com> escreveu:

Cyrus Pencroff

unread,
Dec 28, 2010, 10:52:37 AM12/28/10
to gazzera...@googlegroups.com
Honestly i don't like the idea of having more than one addresse together very much :) I think one of the nice things of GID is that they're short enought to copy/paste on IM or such. Also, that would expose the local address of the machine to the public, which could be a security concern.
Anyway, following your idea, when you add a friend to your node, how should it determine which of the avaiable addresses to connect to? There should be a way to tell if the node is in our same local network.

BTW should it look something like this ?
ExampleFriend@7002d187e4f190af535e4dbf79a66063d5b8a367@192.168.0.55,89.123.45.67:7755

As another solution, we could add a broadcasting mechanism to notify the presence of a node in a local network. If you enable the feature, other nodes on the network will be able to see your presence and eventually add you as friend.

PS. I'll commit all pending changes in the public repository asap (today or tomorrow).

Matheus Santana

unread,
Dec 28, 2010, 4:57:24 PM12/28/10
to gazzera...@googlegroups.com
Hi,

in fact, about security, expose local IP is not a good idea, but can make more easy to add friends node without using other methods to find the specific user IP. I have see one project named Retroshare, he use the friend-to-friend concept too, he create a PGP key public, that you have to send and received to the friend node. In this text file, exist the hashed key, that is unique, and the internet ip, local ip and the port in use.

After user has exchanged this text, the link is established. For the user, NAT is invisible.

About the GID:

ExampleFriend@7002d187e4f190af535e4dbf79a66063d5b8a367@192.168.0.55,89.123.45.67:7755

I think that can be a way of do that, Gazzera can create a GID which have the information need to pass over NAT, without help. The problem with broadcast is, if we doing that, maybe the user don't want to be exposed like that way for other computer, even in local network. The use of that modified GID can resolve that too, i can add node from the internet and local too just the ones i want(Ok, both nodes will have to use internet to talk, but work in Retroshare).

About the code, thanks for share :)
Regards


Matheus S. Lima
Bacharelado em Ciência da Computação
Universidade Federal de São Carlos

--- Em ter, 28/12/10, Cyrus Pencroff <dele...@gmail.com> escreveu:

Matheus Santana

unread,
Jan 1, 2011, 7:37:06 PM1/1/11
to gazzera...@googlegroups.com
Cyrus,

do you have anything to need help in project? What you think about the nat?


Regards,
Matheus S. Lima
Bacharelado em Ciência da Computação
Universidade Federal de São Carlos

--- Em ter, 28/12/10, Cyrus Pencroff <dele...@gmail.com> escreveu:

De: Cyrus Pencroff <dele...@gmail.com>
Assunto: Re: NAT
Para: gazzera...@googlegroups.com
Data: Terça-feira, 28 de Dezembro de 2010, 13:52

Cyrus Pencroff

unread,
Jan 2, 2011, 5:38:40 AM1/2/11
to gazzera...@googlegroups.com
Hi Matheus, sorry for the late reply :)
First off, i've committed all changes to the main repository, you can get it from here: http://code.google.com/p/gazzera/source/checkout

About the Nat and multiple addresses, maybe it could be implemented but i don't see it so necessary right now.
There are plenty of other things that need improvements :)
Some examples are:
- correcting gui bugs (such as ordering in tables etc)
- implementing search by keyword
- implementing a "settings" page
- integrating UPNP
- implementing priority on downloads
- new GUIs

and so on :)

I don't know the level of your skills, so maybe you could take up something not so hard, such as download priority.
If you're interested, i could write some introduction on the general architecture (which will be useful for other peoples too) as well as some details on the task you'd like to do.
Reply all
Reply to author
Forward
0 new messages