views:

157

answers:

2

I am interested in learning more about manipulating network traffic to utilize LAN only programs (games in this case) over the internet.

There already exists several programs that does this (Hamachi, GArena), but I am interested in learning how they approach this and how to build this from the start up.

Obviously you need to capture the traffic - for Windows, I've heard mention of WinPCap which seems to be able to do what I need, though I need to study it further.

What I'm looking for are articles, general knowledge and even books that can show me where to start, what to do, etc. Thanks.

A: 

It sounds like you'd want to tunnel an existing lan protocol over a wan. Which is another way of saying Virtual Private Network. I'd try to set up an existing one, using a router supporting such a feature, or setting it up on e.g. a linux box.

Simply you need to find some materials on VPNs/IP tunneling. How they work is usually very simple(but more complex when you include authentication and encryption. The basics are pretty much:

  • Create a server and a client that can talk together over the Internet while having access to the LAN on both ends.
  • Capture the traffic on the LAN, Place said packet inside e.g. an UDP packet and send it over the Internet to the other side.
  • WHen receiving a packet, Get the data of the UDP packet, which is the IP packet from the other end, send it out on the local LAN.
  • Manipulate the IP addresses in the above packet to fit the local LAN.

The longer story is a bit longer, your software would have to act as a transparent router, and/or the LAN PCs would have to be configured with a specific IP route to reach the other end.

And there's many other tricks you could do. E.g. write a device driver that poses as network card that does the above points, luring the OS that it's sending out on the local LAN, but in reality the device driver encapsulates the packets and sends it to a reachable box on another LAN.

nos
This is actually exactly what I want to do and what I need more information on :)
Christian P.
A: 

Here is some WinPcap/libpcap tutorials:

WinPcap tutorial: a step by step guide to using WinPcap

Programming with pcap

Baget