What if, when you were up at a ridiculous hour Skyping your relatives in Australia, you could borrow unused bandwidth from your sleeping neighbors to make your own broadband connection faster and stronger?

High up in a glass tower in Barcelona, Telefonica's research and development team has been attempting to tackle exactly this question. The solution they have come up with, BeWifi, is a technology that gathers bandwidth from local Wi-Fi routers in order to enhance the connection of the users that happen to be on the Internet at exactly that moment in time.

Telefonica started to research the idea, without making changes to existing infrastructure, in 2008. "We were exploring what would be the opportunities for bringing the peer-to-peer and sharing phenomenon into this arena," Pablo Rodriguez, Telefonica's Director of Product Innovation and Research, told Wired.co.uk.

"Your broadband connection is not used 100 percent of the time," he explained. "If you bring [connections] together smartly and manage to aggregate the spare capacity...[it's] a much better customer experience."

The way Telefonica has made this happen in a practical way is to build its own routers that can be installed in houses within a neighborhood. So far these have had to be installed by engineers, but the next generation are plug-and-play, and eventually all that will be needed is an over-the-air software update to customers' existing routers. According to Rodriguez, the software "creates a mesh to aggregate the capabilities [of the routers]." Pooling all of the bandwidth from these routers allows anyone within the network to take advantage of it at home, and they can also connect to any BeWifi network they come across on their mobile devices when out and about.

"From a technical point of view it's not trivial because you have to develop the software that is on the router to make sure that the router not only communicates with itself but also communicates in a mesh way with the other routers that are in the neighborhood," says Rodriguez.

The technology's only limitation is the actual Wi-Fi bandwidth available, he says. "What you need is some densely populated area—it could either be a small village or it could be a high-rise building, but you need to have some sort of community that is able to share the bandwidth."

Rodriguez is keen to emphasize that security has been a priority from the beginning and the network is completely safe and private. Homeowners will also always get priority over their own bandwidth, he says. "You always get at least what you paid for, but potentially you're going to get a lot more."

He does concede though that Telefonica needs to work out a way to deal with customers within a single network that are perhaps on different tariffs and are contributing more to the mesh than others. He suggests a system whereby the bandwidth a customer gets is somehow proportional to the capacity they bring into the system. This hasn't been a problem so far because the BeWifi pilots Telefonica has run so far in Catalonia have all involved households on the same tariff. By testing the technology in the market early on, Telefonica now has a better understanding of potential customer adoption and how it might scale the project further, Rodriguez explained.

When Telefonica advertised the first trial, over 1,000 people signed up in the north of Barcelona during the first week. "We were able to double the speed that customers were getting and we had some very interesting feedback," said Rodriguez, detailing that some people couldn't run Skype and YouTube at the same time before using BeWifi.

Through the pilot, Telefonica discovered that BeWifi also offered some unplanned benefits. One case involved a customer whose home broadband was suffering an outage. "His Internet connection came down and he was going through another Wi-Fi router from a nearby home and he didn't even notice it was happening," Rodriguez explains.

Another unexpected finding was that people do not use the Internet heavily all at exactly the same time—a concern at the beginning of the trial—but in sporadic bursts. This means there is nearly always some spare bandwidth available to be recycled.

Telefonica is currently looking towards developing economies and its huge customer base of over 200 million households in 14 countries in South America as the places in which BeWifi could have a real impact.

"Where it provides the most benefit is in areas where the connectivity [is poor]," says Rodriguez. "Where you need to do more with less, that's where technology helps you."