Hey guys I was having a discussion with my lecturer earlier about how networking protocols are implemented and he says that they are a set of rules written in a programming language such as C,he says the protocol header will tell the OS what protocol is been used,it could also contain a source and destination IP,and all headers contain a checksum
anyway this has me thinking could anyone explain to me how I would go about actually using a protocol and how they are made?
for example lets say if I created an FTP server/client program(s) how would I say that the protocol to be used should be FTP?
also how did the creators of lets say FTP create the protocol in the first place and how does the OS deal with protocols ?
if anyone could explain it with some code would be great helps me understand things much easier :)
the link below in the first answer is the best answer I could find online but it doesn't really go into detail,
Such a protocol is at it's very basic a paper which describes where you can find certain byte(s) within a data stream and the meaning of this byte(s).
Usually a protocol leaves space for a so called payload. This payload may obey a certain protocol as well. This nested protocols are also referred to as layer. See:
A great description of internet protocols is TCP/IP Illustrated by W. Richard Stevens.
Most protocols are described in RFCs (Requests For Comment). I suspect that they begin life as a protocol implemented by some person or group to solve a problem and they become generally useful and thus standardized.
An important part of an IP protocol that hasn't been mentioned so far is the port number. IF you want to send/receive a file via FTP on a computer, you can't just make a random connection to the computer, you have to connect to a port that understands FTP (more precisely, a port whose listening program understands FTP). FTP uses port 21 for this. Note that once the connection is established, the sending/receiving computers can negotiation to use a different port.
Another interesting thing about protocols is that they are usually very simple. Simple protocols are easy to implement which means that they actually will get implemented.
Get Stevens book (volume 1). It's a pretty interesting read.