Ten or fifteen years ago, I was fooling with using bright LEDs to send pulse-width modulated voice signals. You want to use PWM for noise immunity, because the linearity of LEDs and phototransistors isn't very reliable and because you want to see nice clean edges. Something like PWM would of course be excellent for sending bit sequences.
Save yourself a heap of trouble and use visible light. You'll be able to see what you're doing. If you need secrecy, encrypt the bitstream but don't use light you can't see.
In a light transmitter, you want good collimation, so that the light will travel as far as possible. This means you want a point-like emitter, placed at the focal point of your lens, and you can adjust this by forming a spot on a distant wall. Of course if you're using a laser pointer, it's already collimated.
Light rays entering the receiver want to be collimated so that the image of your light emitter will form a point right on the sensitive part of your detector. So the detector sits at the focal point of its lens (or parabolic mirror) also.
The receiver wants the light-gathering property of a telescope. The primary lens or mirror (the first thing the light hits) should be as large as possible. When I was tinkering with this stuff, I used an inexpensive 8.5x11 Fresnel lens sold at Staples. If you wanted something less cheesy, you could become an amateur telescope builder or go out and buy a telescope. From one of the web pages below: Unlike a telescope... we needn't bother trying to obtain an actual detailed image of the light source. We need merely to gather as much light from the source as possible. Also, adjustable focus is not needed. A light communications antenna then can be much simpler and cheaper than a telescope.
Another important property of the receiver is bandwidth of the receiving circuitry. It's easy to crank a lot of bits per second through the transmitter, but getting them back out of the receiver can be a challenge. Detectors (phototransistors and photodiodes) are in many cases quite limited in bandwidth. One trick is to keep the voltages on all pins of the detector at constant voltages, and only allow the currents to change. This can be done by AC-coupling the detector to a virtual ground (like the input of an op amp, or the base of a transistor).
Forget about doing this with something hand-held. At a minimum, put the transmitter and receiver on camera tripods (put a UNC-2B 1/4"-20-thread C-mount on the bottom of whatever they're mounted on). Better yet, make it a permanent fixture on the side of a building or something, but make sure the aim is adjustable in some way.
- http://www.n1bug.net/tech/laser/alc_wa6ejo.html -- Amateur radio laser communication, voice not IP packets. LOTS of fantastic technical information.
- http://www.messaggeri.it/xoptoelettronica.htm -- Where to buy optical supplies. A number of light receiver circuits, maybe 1/3 of the way down the page, of which the first was designed specifically for Ethernet over laser.
- http://www.hut.fi/Misc/Electronics/circuits/laserl ink.html -- This guy sent 115.2 kbaud serial information over a laser link. He used a pre-built laser receiver (Hewlett Packard HBFR-2521) but I can't easily find any information about it.
- http://www.qsl.net/wb9ajz/laser/data/cheepo.txt -- Here's another ham who built a very inexpensive transmitter and receiver, for sending Morse code, so the bandwidth is very low, but he has some good ideas.
- http://www.clansullivan.com/joseph/projects/laser. htm -- Another RS232 over laser project. Includes a discussion about how to modify the laser pointer.
So you've got two locations (one with electrical power but no Internet access), and each one has a transmitter and a receiver, and you can send bits back and forth at a decent rate. You'll need a computer that talks to the transmitter and receiver and functions as their connection to the local LAN, effectively I haven't thought about this part very hard so I'm going to wing it, and assume that anybody attempting this will know this part better than I do.
I'm a Linux bigot and I'll assume that nobody would ever do this with anything other than a Linux box.
The immediate problem is connecting the transmitter and receiver to the Linux box. You want to handle lots of bandwidth. Probably the easiest thing to do is connect to the parallel port.
Then you want to make the transmitter and receiver appear to the operating system as a network device (like a NIC card). The best idea would be to write a network device driver that looks like one of the existing drivers. Apparently there is SONET hardware with similar characteristics for data flow, because it does laser transmission over fiber optics. There may be examples of this in drivers/atm/suni.c or drivers/atm/nicstar.c.
Once you managed to write the correct device driver, you'd set it up