views:

152

answers:

5

I know that a protocol is a set of rules that governs communication between two computers on a network, but how are thoses rules implemented for the computer? Is a protocol basically a piece of code or, in other words, software?

+1  A: 

A network protocol is basically like a spoken language. It is implemented by code that sends and receives specially prepared messages over the network/internet, much like the vocal chords you need to speak (the network and hardware) and a brain to actually understand what someone said (the protocol stack/software).

Sometimes protocols are implemented directly on the hardware [for speed reasons] (like the Ethernet protocol for LANs) - but it is always software/code required to do something useful with a protocol.

This might be interesting for you:

BastiBense
For example, HTTP protocol: http://tools.ietf.org/html/rfc2616
el.pescado
A: 

Software implements the rules defined in the protocol, some protocols are formal defined and some informal.

zpon
A: 

a protocol is a set of rules governing the communication between two entities.

in the computer/programming context, a protocol is a set of rules governing the communication between two programs.

in the computer network context, a protocol is a set of rules governing the communication between two programs, well, over network.

in computers, in the end everything is embodied in code...

just somebody
+3  A: 

Protocols are generally built upon each other. At the risk of sounding pedantic, here's an example of a protocol and where/how it's implemented:

  • Application Protocol - the way a particular application talks to another instance of itself or a corresponding server; this is implemented in the application code or a shared library
  • TCP (or UDP, or another layer) - the way that information is sent at the binary level and split up into usable chunks, then reassembled at the destination; this is usually implemented as part of the operating system, but it is still software code
  • IP - the way that information (having already been split or truncated by something like TCP or UDP) makes its way from one place to another by routing over one or more "hops"; this is always software code, but is sometimes implemented in the OS and sometimes implemented in the network device (your LAN card, for example)
  • base-T (ethernet), token ring, etc - Here we are physically getting into how the hardware talks to one another; ie, which wire corresponds to a particular type of signal; this is always implemented in hardware
  • electricity /photons - the laws that govern (or at least define) how electrons (or photons) flow over a conductive material or over the air; this is usually implemented in hardware ;)

In a sense, these are all "protocols" (a set of rules or expected behaviors that allow communication to take place), and they're built on one another.

Bear in mind that (aside from electricity) this is not an exhaustive list of the sort of protocols that exist at any of these layers!

Edit Thanks to dmckee for pointing out that electricity isn't the only physical process used in networking ;)

Adam Robinson
WE may soon see the day when "electricity" can be replaced by "photons" end-to-end (you can, and often do, use photons for much of the run already).
dmckee
@dmckee: Indeed, fiber completely escaped me. Thanks, I've edited the answer!
Adam Robinson
You forgot to mention a description of OSI Layer 8, where almost all problems originate :D
pokstad
@pokstad: The PEBKAC phenomenon is sufficiently complex that I thought attempting to describe it might end up causing more confusion than it addressed ;)
Adam Robinson
+2  A: 

Networking protocols are not pieces of code or software, they are only a set of rules. When software uses a specific networking protocol, then the software is known as an implementation. There can be many different software implementations of the same protocol (i.e. Windows and UNIX have different TCP/IP implementations). It is possible to understand networking protocols without any knowledge of programming.


EDIT: How are they implemented? Here's a paper on taking an abstract specification of a protocol and implementing it into C. You'll see that less-strict protocols leave out certain details that programmers have to guess on, which makes some implementations incompatible with others.

pokstad
RFC's usually define protocols, take a look and you'll see that it's very similar to legal-talk than programming: http://en.wikipedia.org/wiki/Request_for_Comments
pokstad