Net Tunnel
Net Tunnel
Net Tunnel
Chris Nord Project Report COSC 4853 Network Security Project April 29, 2011
1.2 Overview
The rest of the paper is organized as follows. Section Two gives the problem as it stands today. Section Three proposes a solution. Section Four describes our implementation of the proposed solution. Section Five analyzes the results from our implementation. Section Six concludes our project.
2. Problem
Chief among the new problems that a NAT device raises is that a computer behind a NAT device is unable to accept unsolicited traffic (incoming traffic that was not requested by the computer behind the NAT) without configuring the NAT device. This problem arises because the NAT device is bridging two networks, when it receives data from one of the networks it doesn't know how to "map" that data to the other network it's servicing. This isn't a problem when a computer behind the NAT makes an outgoing request, since the NAT device can make a note of the request and route the response appropriately back to the computer. As leaders of a community of game server enthusiasts, we often get asked how to properly configure a server so that clients online will be able to access the game server. For game server hosts who do not run a NAT or firewall on their connection, it's often as easy as just running the server software, and clients will immediately be able to connect to the game server; for other server hosts, it's a discussion on ports, routers, and what NAT means for their game servers. Still other server hosts are unable to properly configure a server online due to restrictions beyond their control at the network level. The difficulty in exposing services to other clients across the Internet can usually be broken down to one or more of the following: 1. One or more firewalls between the application and the Internet need to be configured to allow incoming, unsolicited traffic to the ports the service uses. 2. One or more NAT devices between the computer hosting the service and the Internet need to configured to route incoming traffic to the appropriate next hop on the local segment. 3. Somewhere between the application and the Internet the service is being intentionally blocked.
3. Proposed Solution
In order to help people get their services up and running quickly without having the hassle of changing settings, learning about networking, or having exemptions made by their local IT staff, NetTunnel was born. NetTunnel is intended to provide a means for users with a lack of knowledge on networking or on a restrictive network an easy and simple means to share network services (such as Apache or Ventrilo) with other clients in a secure manner. We propose solving all three of the problems by using a combination of existing technologies. Problems 1 and 2 can be overcome by NAT punch-through, which basically makes the router think that incoming traffic is actually outgoing traffic. Firewalls and NATs are generally less restrictive with outgoing traffic. Problem 3 can be solved by taking charge of the protocol being used between computers and encrypting the communication.
4. Implementation
Each client has its own unique public/private key pair which is used to send encrypted data across the network. The server has it's own public/private key pair as well. To send serialized data between clients and to and from the server we used protobuf-net by Marc Gravell. [1]
Wired University (5 Wired Residential Wired Data Center Mbps down, 3.55 (1.28 Mbps down, 710 (8.81 Mbps down, Mbps up) Kbps up) 6.41 Mbps up) Table 1 Hardware Configurations
5. Analysis of Results
The proposed solution works as intended. We were able to make a prototype implementation in which one client was able to successfully connect to an Apache server hosted by another client. Unfortunately, due to time constraints, only our prototype implementation was working when this paper was written. The prototype used in our tests was programmed to work for Apache between two clients and therefore tells us little about a 'real world' usage of NetTunnel. However, based on inspection of the protocol, the following problems are apparent: Clients have to open a new port for each service's port for each client that wishes to connect to it. For example, if some service needed both port 80 and port 81, and three clients wished to connect to it, the client hosting the service needs to open six separate ports to accomplish the share with all clients connecting. So, the current protocol doesn't scale well for services with lots of ports or when lots of clients want access to the same service. In the current implementation, only one socket can be associated with each tunnel. This prevents, for example, a web browser from opening multiple connections to Apache (which most browsers do on every website to retrieve images concurrently, etc). Because of the forwarding system, services will always see incoming connections as from the localhost. The effects this has will vary according to how the service is programmed. Apache shouldn't have any trouble with this, but a game server might not allow more than one connection per host, meaning only one client can have a working tunnel. Because of the forwarding system, users connecting to a service will have to connect to their localhost, which might be confusing to some users or hard to setup in certain applications. Browsers can handle this fine, except for the annoyance of having to add a port to the URL, but other applications might not allow connections to a localhost or on a custom port.
7. References
[1] Protobuf-net by Marc Gravell, used for data serialization over network - http://code.google.com/p/protobuf-net/ [2] Network Address Translation, Wikipedia -- http://en.wikipedia.org/wiki/NAT