A protocol is basically a set of predefined rules that can be uses to govern communication between two entities. HTTP for example is a protocol that web servers and clients follow to request and send data from point A to B. Writing the code comes after defining the rules that will dictate how communication should proceed. You can read some RFC's online to give you a better idea. I hope this helps.

Here's a link for FTP related docs
http://www.faqs.org/rfcs/ftp-rfcs.html

You can search for an RFC here
http://www.faqs.org/rfcs/rfc-index.html