optical communication using arduino and led

Hello, this is my first post on arduino forum.
Actually i am working on a project for making an optical communication module using LED.I have to type the msg on the serial monitor of one arduino,tranmit it bitwise through the LED,and retrieve it reliably on the other side using photodiode and print the message on the serial moniter at other end.I am facing problem with encodig and decoding the message,on both side.I have to write the protocol so that I can send the msg through packet.So,facing problem in designing the packet header and footer.
Any suggestion will be welcomed.
Thank You

Some information from Nick Gammodownloadn

Some info from Nick Gammon HERE:

This is about RS485 but you can use plain serial.

See the section about Protocol, which I think you can use...

Search for Robin2's Serial Input Basics - updated thread to get some ideas for a protocol. The ideas can be applied to your scenario.

This Thread about Serial comms using IR may be helpful