Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Man From The Future on June 12, 2011, 01:46:26 PM



Title: Make UPNP enabled by default?
Post by: Man From The Future on June 12, 2011, 01:46:26 PM
Unless this has changed in the latest release(I'll check ina minute :P), why shouldn't it be enabled by default?

Many people have routers with UPNP support, and enabling it would allow new users who don't know what it is, or haven't looked in the options, to get more than 8 connections.


Title: Re: Make UPNP enabled by default?
Post by: Matt Corallo on June 12, 2011, 02:42:05 PM
I'm in favor of this, and was since the beginning, but when it was first introduced, there was a vote on these forums and the result was strongly against UPnP.  Frankly Im really not sure what valid argument anyone had as if UPnP is a "security risk" (which is only sort of, remotely is) then it should be off on the router and enabling it on Bitcoin does nothing different.  It would also go some way towards solving some of the connection issues (though those are mostly solved in 0.3.23 with the more aggressive connections).


Title: Re: Make UPNP enabled by default?
Post by: bitlotto on June 12, 2011, 02:51:02 PM
I don't know much about UPNP, does this affect TOR users at all?


Title: Re: Make UPNP enabled by default?
Post by: Nesetalis on June 12, 2011, 02:52:56 PM
UPnP is one of the most insecure networking protocols designed, any external router that supports it, is just asking for their network to be comprimized.

This doesnt help or hinder bitcoin in anyway, but in the future you are far less likely to find a router that supports it inherently.


Title: Re: Make UPNP enabled by default?
Post by: mewantsbitcoins on June 12, 2011, 06:02:26 PM
UPnP is one of the most insecure networking protocols designed, any external router that supports it, is just asking for their network to be comprimized.

This doesnt help or hinder bitcoin in anyway, but in the future you are far less likely to find a router that supports it inherently.

 ;D

Care to elaborate on the vulnerabilities of UPnP?

As a side note - I vote yes to enabling UPnP by default


Title: Re: Make UPNP enabled by default?
Post by: Mike Hearn on June 12, 2011, 06:52:41 PM
Votes aren't a good way to decide these issues. I suggest Matt just submit a pull req to enable it by default and let Gavin decide.

UPnP is a de-facto standard that's used by virtually all p2p software. The fact that it's even an option puts Bitcoin behind apps like Skype in terms of UI simplicity. It's definitely worth enabling it by default, at minimum.


Title: Re: Make UPNP enabled by default?
Post by: wumpus on June 12, 2011, 07:07:12 PM
This doesnt help or hinder bitcoin in anyway, but in the future you are far less likely to find a router that supports it inherently.
"the future"? You mean when IPv6 has been introduced everywhere and UPNP is no longer needed?


Title: Re: Make UPNP enabled by default?
Post by: gmaxwell on June 12, 2011, 07:54:52 PM
Votes aren't a good way to decide these issues. I suggest Matt just submit a pull req to enable it by default and let Gavin decide.
UPnP is a de-facto standard that's used by virtually all p2p software. The fact that it's even an option puts Bitcoin behind apps like Skype in terms of UI simplicity. It's definitely worth enabling it by default, at minimum.

Instead of talking about how great UPNP is it would be much more useful to tell everyone if you've tried it and if it worked.

It's not a feature developers are likely to use — other than to test it. It would be pretty terrible if it turned out that it had a bug which occasionally crashed bitcoin and it got enabled by default.

Also, looking at the implementation it appears that it tries to use UPNP even when its not required to get the port open. Thats probably somewhat less than optimal, since the upnp traffic might make network operators mistake bitcoin for filetrading applications in the same way IRC seed makes people mistake bitcoin for a botnet.



Title: Re: Make UPNP enabled by default?
Post by: Nesetalis on June 12, 2011, 08:16:38 PM
This doesnt help or hinder bitcoin in anyway, but in the future you are far less likely to find a router that supports it inherently.
"the future"? You mean when IPv6 has been introduced everywhere and UPNP is no longer needed?


indeed.

and as to the vulnerabilities, it allows any malicious software to open ports in your firewall whether you want them or not once its on your computer.

it was a nice idea to try and work around the terrible curse of NAT, but shortly NAT wont be necessary.


Title: Re: Make UPNP enabled by default?
Post by: Luke-Jr on June 12, 2011, 10:04:54 PM
and as to the vulnerabilities, it allows any malicious software to open ports in your firewall whether you want them or not once its on your computer.
This "vulnerability" assumes that UPnP meant to configure firewalls, which it isn't. It's to inform a NAPT device of a port being opened. It really should be implemented by the OS's listen() function.


Title: Re: Make UPNP enabled by default?
Post by: Maged on June 12, 2011, 10:45:15 PM
Votes aren't a good way to decide these issues. I suggest Matt just submit a pull req to enable it by default and let Gavin decide.
UPnP is a de-facto standard that's used by virtually all p2p software. The fact that it's even an option puts Bitcoin behind apps like Skype in terms of UI simplicity. It's definitely worth enabling it by default, at minimum.

Instead of talking about how great UPNP is it would be much more useful to tell everyone if you've tried it and if it worked.

It's not a feature developers are likely to use — other than to test it. It would be pretty terrible if it turned out that it had a bug which occasionally crashed bitcoin and it got enabled by default.
It's been pretty well tested at this point. Also, I too don't get the "vulnerability" reason of not having UPnP on by default. It seems to me that the issue is that those people who are concerned about it have it enabled in their router, not that Bitcoin would use it.


Title: Re: Make UPNP enabled by default?
Post by: Basiley on June 13, 2011, 02:28:37 AM
screw "screwed by design" things like UPnP, IMO.
and yes, BTC network nodes compromising ease, even on small degree isn't option, IMO.
point is, UPnP isn't hot/quick/mission-critical thing in to-do/timeline, IMO and unlikely be in next one.


Title: Re: Make UPNP enabled by default?
Post by: wumpus on June 13, 2011, 06:18:27 AM
it was a nice idea to try and work around the terrible curse of NAT, but shortly NAT wont be necessary.
Do note that I was talking about a (possibly distant) future in which NAT is no longer needed.

For the problems we face NOW, UPnP is a good compromise.

The Bitcoin client is meant to open a port, as this is part of the P2P network design and strengthens the network. More connections=more trust. This I recommend enabling UPnP by default.

Counter-arguments are easy to address:

- Users can still choose to not open a Bitcoin port. Provide the -nolisten argument, which causes the client to only rely on outgoing connections and not advertise.

- Users can still choose not to use UPnP for security reasons. Disable it in your router configuration.  Not enabling UPnP in Bitcoin does not provide any additional security. Trojans can still use UPnP as long as it is enabled in your router!

- UPnP should obviously be disabled when running over an overlay network such as Tor (or when a proxy is used..).

- No, UPnP does not advertise the program as a file sharing application. Non-filesharing applications such as Skype also use UPnP. But if you're worried about it you can provide the command line argument to disable UPnP (or -nolisten to not advertise at all).



Title: Re: Make UPNP enabled by default?
Post by: speeder on June 13, 2011, 06:21:41 AM
I agree with John Smith

Thus... leave it enabled by default :D


Title: Re: Make UPNP enabled by default?
Post by: Nesetalis on June 13, 2011, 09:45:18 AM
my point wasnt that it shouldnt be in the client and enabled by default, just that its a badly designed interface that may go the way of the dinosaur in the next couple years and not to rely upon it. Part of the standard install should be saying "hey, user, open X and Y port in your firewall." OR asking which port the user wants to use and broadcasting that to the network.


Title: Re: Make UPNP enabled by default?
Post by: wumpus on June 13, 2011, 11:42:32 AM
my point wasnt that it shouldnt be in the client and enabled by default, just that its a badly designed interface that may go the way of the dinosaur in the next couple years and not to rely upon it. Part of the standard install should be saying "hey, user, open X and Y port in your firewall." OR asking which port the user wants to use and broadcasting that to the network.
But the point is that UPnP doesn't address power users that know how to open ports manually. It is only useful for people that want to simply start the executable and use it.

And indeed, in a couple of years it won't be needed anymore. However, as long as we have IPv4 and NAT-uglyness, this problem exists. Code can always be removed.


Title: Re: Make UPNP enabled by default?
Post by: Basiley on June 13, 2011, 02:15:33 PM
or two different builds, entitled "download this for easy use/nobrainers" and "reasonably-hardened/tweaked for power users".


Title: Re: Make UPNP enabled by default?
Post by: Nesetalis on June 13, 2011, 02:19:47 PM
er, except most routers do not come with upnp enabled by default since it is a security hole, meaning.... for the non power user, upnp isnt going to work? :p


Title: Re: Make UPNP enabled by default?
Post by: wumpus on June 13, 2011, 02:24:28 PM
er, except most routers do not come with upnp enabled by default since it is a security hole, meaning.... for the non power user, upnp isnt going to work? :p
I have no statistics on routers and which % have UPnP enabled by default. Do you?

Anyway even in that case, having it enabled by default in bitcoin is not a problem.


Title: Re: Make UPNP enabled by default?
Post by: speeder on June 13, 2011, 02:43:08 PM
Where I live I think routers come with it enabled by default because we have a SEVERE lack of IP addresses (for example, I cannot download anything on file sharing sites, because someone with my IP is always downloading there already... even when the only machine active on my network is my own).


And... seriously, you people that suggest that we need to ask the user "x" or "y" do not realize that 99.99% of the people in the world will never understand the question.

I am computer savy since I was a child (my dad wanted me to become the next bill gates or something... he taught me how to program when I was 8 even...), and for good part of my life, I believed everyone else was a idiot.

When I realized that only me understood those kind of questions coming from software, I noticed the software was wrong, not the users.

You cannot ASSUME people know stuff. They don't.

Not even the WASD keys when designing a FPS, research data showed that one of the reasons that it is popular only among "hardcore" is that only "hardcode" know how to control the character, with most games assuming you will use the most popular controls, and normal people cannot even walk forward in the game.


If you ask someone about port forwarding, NAT, UPNP, firewall, whatever, they will only think: "Wha?"
If you try to explain, say it is a security risk but is a nice feature, people will think: "Hell no! I do not want another virus!" even if the risk is minor or negligible and have nothing to do with virus. (or worse: I know people that really believe that hackers in a chat can figure the color of your underwear)


Title: Re: Make UPNP enabled by default?
Post by: Basiley on June 13, 2011, 02:59:22 PM
"is see no problem in problem" is just as hilarious as newspapers/e-news.
its could bring interesting alternative to UPnP itself, as long as HTLM5-specified "WebServices" will fixed/updated and re-enabled back.
and plenty of web-browser applets for similar purpose will re-surface quickly.
for quick examples, check some Opera Unity widgets.


Title: Re: Make UPNP enabled by default?
Post by: Theo on June 13, 2011, 04:15:39 PM
I have no statistics on routers and which % have UPnP enabled by default. Do you?

We did a test with 40 random NAT users in Germany, out of which 10% had UPnP enabled.


Title: Re: Make UPNP enabled by default?
Post by: Man From The Future on June 13, 2011, 05:00:29 PM
The important part there is Germany. Try, for example, in Britain, and almost any BT users will have it enabled, as their "Home Hub" routers have it by default.


Title: Re: Make UPNP enabled by default?
Post by: ShadowOfHarbringer on June 13, 2011, 05:03:46 PM
This doesnt help or hinder bitcoin in anyway, but in the future you are far less likely to find a router that supports it inherently.
"the future"? You mean when IPv6 has been introduced everywhere and UPNP is no longer needed?

I don't think that IPv6 will invalidate NAT and therefore UPNP.
There are many people who like to have a closed network behind a NATed firewall. I belong to these people.

I know a little about network security, and nobody can tell me that giving IPv6 address to every machine in the house is safe. Because it isn't.
The NAT-way, where all machines in a subnetwork are protected by additional firewall, is simply better.


Title: Re: Make UPNP enabled by default?
Post by: Nesetalis on June 13, 2011, 05:09:38 PM
you dont need nat to run a firewall. For instance, my network we have 6 IP addresses, 3 of which go to specific computers, 2 go to internal nats to rout to the individual computers, but it is all behind a single firewall.

Nat is not necessary.


Title: Re: Make UPNP enabled by default?
Post by: ShadowOfHarbringer on June 13, 2011, 05:25:10 PM
you dont need nat to run a firewall. For instance, my network we have 6 IP addresses, 3 of which go to specific computers, 2 go to internal nats to rout to the individual computers, but it is all behind a single firewall.

Nat is not necessary.

You are probably correct, however in many cases still like the NAT-way better than single IP for everything.
There are some small specialized devices that simply don't neet their own external IP address.

Also, there is the security-by-obscurity concern. Nobody needs to know how many devices exactly is in my network.


Title: Re: Make UPNP enabled by default?
Post by: Nesetalis on June 13, 2011, 05:45:55 PM
why shouldnt a small device have its own IP? there is absolutely no reason to add the extra complexity of a nat. The only times when something like that is useful, is when you are letting two isolated networks touch, say, an intranet in a buisness and the internet. IPv6 allows enough addresses for every computer, toaster, person and cellphone to have a handful of IP addresses. The only reason to put up a nat, is if you are running a separate network, which yes there are reasons for it, but the average user would never need or want a NAT.


Title: Re: Make UPNP enabled by default?
Post by: ShadowOfHarbringer on June 13, 2011, 07:26:42 PM
IPv6 allows enough addresses for every computer, toaster, person and cellphone to have a handful of IP addresses.

But why would i want my toaster to have an external IP address ?
This is just potential another unnecessary security risk.

I want all devices in my network (except servers) to be completely invisible from outside. I do not want _ANY_ interaction between the outside world and these devices. Security concerns.
Therefore i find "ip-for-your-toaster" idea foolish.


Title: Re: Make UPNP enabled by default?
Post by: Nesetalis on June 13, 2011, 07:48:18 PM
again, firewall != nat.
your home network would be behind a firewall, so no risk, unless you have a really bad firewall.


Title: Re: Make UPNP enabled by default?
Post by: Man From The Future on June 13, 2011, 08:30:09 PM
IP for me toaster, why?

I hardly want to make toast in my house while away from my house... ;)


Title: Re: Make UPNP enabled by default?
Post by: Basiley on June 13, 2011, 08:51:07 PM
actually, "larger address space" is only one [from many]IPv6 advantages over IPv4, like transparent/seamless encryption[say buy-bye to IPSec armchair], hierarchy architecture.
point is both UPnP was ALREADY abused by feds and corporate spies for intel gathering, for years, like they do with flash traffic or binary downstram.


Title: Re: Make UPNP enabled by default?
Post by: Schleicher on June 14, 2011, 06:50:25 AM
But why would i want my toaster to have an external IP address ?
This is just potential another unnecessary security risk.

Well, nobody is forcing you to assign global addresses to all devices.
In ipv6 you have also "unique local adresses" that only work locally:
http://en.wikipedia.org/wiki/Unique_local_address (http://en.wikipedia.org/wiki/Unique_local_address)


Title: Re: Make UPNP enabled by default?
Post by: jgarzik on June 14, 2011, 06:58:52 AM
I see a whole lot of handwaving in this thread, and very little substance.  But Mike makes a relevant point,


UPnP is a de-facto standard that's used by virtually all p2p software. The fact that it's even an option puts Bitcoin behind apps like Skype in terms of UI simplicity. It's definitely worth enabling it by default, at minimum.

The relevant question to me is:  what widely used software enables UPNP by default?

If UPNP is enabled by default on widely used software, as your post seems to indicate, then it seems reasonable that bitcoin may follow suit.  I know plenty of P2P software supports UPNP, but what about default-on?



Title: Re: Make UPNP enabled by default?
Post by: theymos on June 14, 2011, 07:07:12 AM
The only software I know of that enables UPnP by default actually requires the port to be open in order to work properly. Bitcoin does not. I don't think it's right for the program to donate resources by default.

In the future perhaps there will be a first-run screen asking, "Do you want to help the network?". If the user accepts, run UPnP and become a full node / hub.