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.