An Introduction to Protocols
A protocol is a standard way of doing something. Protocols are all around us in society, they often go unnoticed, but exist nontheless. There is for example a protocol for making a purchase at a shop:
- Step 1: The customer places the items to be purchased on the counter
- Step 2: The cashier scans the items
- Step 3: The cashier announces the total cost
- Step 4: The customer produces payment
In some places though, they do things differently:
- Step 1: The customer places the items to be purchased on the counter
- Step 2: The cashier scans the items
- Step 3: The customer reads the amount payable from the terminal screen
- Step 4: The customer produces payment
If a customer expecting the first protocol encounters a cashier expecting the second, the whole process stalls at step 3 while they stare blankly at each other. The customer is wondering why the cashier does not announce the amount payable. The cashier is wondering why the customer has failed to read the total payable that is obviously displayed on the terminal screen. The two parties must be using the same protocol with the same set of steps for the transaction to proceed smoothly.
Computers have protocols too for coordinating transactions between different machines. There is a protocol for sending e-mail on the internet called SMTP which stands for Simple Mail Transfer Protocol. There are other protocols for sending e-mail messages, but SMTP is commonly used. As with the protocol for using a shop, if two computers wish to exchange messages but are not using exactly the same protocol, then the whole process will stall in confusion.
SMTP works like this:
- Step 1: The email receiving machine greets the sending machine
- Step 2: The email sending machine says
HELO
(spelled like that) - Step 3: The sender says who the message is from by saying
MAIL FROM: [email protected]
- Step 4: The recipient acknowledges with
OK
. - Step 5: The sender says who the message is to by saying
MAIL TO: [email protected]
- Step 6: The recipient acknowledges with
OK
. - Step 7: The sender says
DATA
, then appends the content of the e-mail message and finishes with a dot on a single line. - Step 8: The receiver says
OK
- Step 9: The sender says
QUIT
As long as both parties follow the same process, then the message will get sent.
Protocols are often built on top of each other in layers. That is one protocol is carried within another protocol.
- The ethernet protocol defines how data is sent over a cable. You may have an ethernet cable in your home connected to a broadband router. Ethernet, however doesn’t know much about the internet. It can send any kind of information that wants to go over a cable and intenet data is just one type.
- The TCP/IP protocol (actually two separate protocols) coordinates how information is sent over the internet and may use the ethernet protocol to transmit internet data over a cable. However, it may also use a wireless protocol such as wi-fi to send the information information via radio and not use ethernet at all or perhaps it may use a mobile phone protocol instead. The TCP/IP protocol does not specify through what medium the internet information is sent and knows nothing of the requirements of cables or radio. The lower layer of protocol, like ethernet or wi-fi, coordinates usage of the physical medium.
- The TCP/IP protocol knows nothing about email. So when we want to send a message we layer on top the SMTP protocol that we saw above, which then uses the TCP/IP protocol which then may in turn use the ethernet protocol. SMTP does not have to be transmitted over the internet, but usually is. You could send an SMTP email directly over ethernet, but ethernet doesn’t know anything about the internet, so when the message got to the end of the cable, it would go no further without the help of TCP/IP.
There are a large number of protocols for many different purposes and many protocols offering different features compete with each other for the same purpose:
- HTTP (Hyper-Text Transport Protocol) - used for sending web pages (hence where the http:// comes from that sometimes appears at the start of web addresses). HTTP has itself become another protocol layer and all kinds of other protocols are built on top of HTTP.
- SSL/TLS (Secure sockets layer/Transport layer security) - used for encrypting communications. When HTTP is placed inside the SSL/TLS protocol it becomes HTTPS
- FTP (File Transfer Protocol) - used for sending files, now less common and often HTTP is used instead.
- SIP - (Session Initiation Protocol) - Used for making phone calls and video conferencing via the internet
- SSH (Secure Shell) - enables a computer to be accessed remotely over a network. Often used for performing system administration on servers on the internet.
- DHCP - (Dynamic Host Configuration Protocol) - automatically configures a computer such that it can use the internet. When you first connect a computer to a new internet service, it uses DHCP to acquire all of the information it needs to communication.
- DNS - (Domain Name System) - Works like a telephone directory enabling computers to locate other computers on the internet
Image Credit: Raysonho