Understanding TCP/IP Protocol Types

When two people are able to communicate we generally assume that they know the same language, and that is the key to understanding each other. This applies to the world of computing as well, where the set of standards are called protocols. During this article we plan to present in a nutshell the most common TCP/IP protocol types. We won’t get in-depth, so don’t expect university course-style material—just the basics.

Before we move on, let’s fully grasp the concept of protocol and explain how more of those build up a structure called the OSI model. How are they important to us? Finally, we’ll get into enumerating the popular TCP/IP protocols. These are the ones we need to be familiar with, since our applications and Internet surfing happens through them.

As mentioned earlier, in the simplest terms, a protocol is a set of rules and conventions that characterize some communication type. It defines specific elements like syntax, semantics, etc. It’s the way that speaking and writing leads to understanding. If we were to throw together letters and words without any reason or order, no one would understand us.

TCP/IP is a suite of two protocol collections, TCP (Transmission Control Protocol) and IP (Internet Protocol). And that is why the TCP/IP is the most important protocol we can talk about when it comes to Internet-based communications. It is a prerequisite of the Internet. In a future article we will cover routing protocols (with the help of which routers work), VoIP protocols (telephones), and cellular phone protocols as well.

You may have already heard of the OSI Model or perhaps the TCP/IP Model. These two conceptually define and gather protocols of communications into layers. There are distinct differences between those two, but let’s keep things simple. First, the OSI model has 7 layers, because it distinguishes the three top layers which are encapsulated together in the TCP/IP model. Aside from these, they’re “mostly” akin.

We won’t mess with the lower-layer protocols (such as physical and data link layers) because, from the perspective of the user, it does not matter what happens “inside” the little black box; the end result is what truly makes a difference. On the next pages we will become familiar with the most common and important protocols from the Internet/Network Layer (IP-v4, v6; IPSec), Transport Layer (TCP and UDP), and lots of application-specific protocols like HTTP, FTP, SMTP, POP3, IMAP, etc.

Now that we know the underlying foundation of protocol types, we can move on.

{mospagebreak title=TCP/IP Protocol Types}

TCP/IP is the reference model that basically encapsulates all of the conventions as to how end-to-end point connectivity is supposed to happen. The attributes are standardized. This is how software developers can seamlessly code their applications; by knowing the standards, you know what kind of packets to expect, what their shape will be, and can pretty much delineate their content based on the known syntax and semantics.

The Internet Protocol (IP) is the most vital protocol since almost all of the higher layer protocols use the IP routing protocol to get the data from host X to host Y. On the previous page we mentioned that TCP/IP is a protocol suite; thus, IP could be considered the dominant protocol.

IP encapsulates data from higher layer protocols and deploys them to the end-point. It is a connectionless protocol that does not work on pre-designed circuits. From an architectural sense, it is a pretty primitive protocol that does not give any kind of reliability measures, such as determining data corruption, duplicate arrival, lost data, retransmission, and so forth. But we will understand why IP was “made” to be simple.

Along with the other originating vital component of the TCP/IP suite, the so-called TCP protocol, in cooperation with many other, higher level protocols, enhances the “IQ-level” of IP communications. IP by itself works on the best-effort delivery concept. It assumes everything is working fine, the conditions are ideal, and the idea of something going wrong (packets being lost, etc.) is unknown to the protocol.

However, the TCP works on the end-points (hosts); it adds specific functions like retransmission, error detection, congestion control, and many others. Other higher level protocols also help to improve the quality of service. As we can see, the IP protocol was made to be simple, and that is why it has become so successful. It was fast. The higher level protocols could be implemented whenever needed on clients.

Let’s see what kind of data IP encapsulates and what its header structure looks like. First of all, it must know the source address and destination address, just like any traditional postal service. Then, of course, it needs the data it’s about to transfer, and it adds a few other elements, such as type of service identifiers, total length, flags, time to live, header checksums of the header only (just that!), version field, offset/padding, etc.

It is important to understand that a datagram is built up by an IP header and IP data. While the header has its checksum for verification purposes, just as mentioned earlier, the IP protocol does not encapsulate anything to verify at end-points whether the data has arrived intact.

Currently, there are two versions of IP protocol. IPv4 is still the dominant one; it uses 32-bit addressing (4.3×109). There is also IPv6 on 128-bit (3.4×1038). The latter has even left out the IP header-only checksums. Right now our application protocols already offer sufficient attributes to ensure error-free communications. Therefore, the purpose of IP is to remain as simple and efficient as possible.

{mospagebreak title=TCP/IP Protocols, continued}

It’s time to speed up our pace since there are many protocols to be explained. The aforementioned IP protocol has a security-conscious derivative: IPSec. What it does is simple: it authenticates and encrypts each of the datagrams that are sent/received. Distinct from the other security protocols, IPSec operates on layer 3, not on application levels such as the SSH, SSL, TLS, etc.

On the previous page we mentioned the TCP protocol. It’s located one layer higher-the fourth. Most of the tasks that run on the Internet, such as e-mail, web browsing, file transfers and so on use TCP because of its reliable management attributes. It is a connection-based protocol, unlike its counterpart, UDP, which is connection-less.

The Transport Layer is the fourth layer in the model, and almost all of the activity that happens through that layer is based on TCP and UDP protocols. These are core protocols of the TCP/IP model. UDP is once again a somewhat primitive type that does not offer a reliable way to know whether or not the datagram arrives intact. Therefore, it’s great for streaming media or online/network gaming.

Both of the above require very fast data exchange and little to no verification. On the client-side these can be corrected if needed, but most of the time it doesn’t matter when their amount is low-they can be neglected. In the case of TCP communications, the data must be 100% correct. That is why it includes specific complex handshaking dialogs, data verification for integrity, ordering, etc.

The structure of a UDP packet is really simple: source port, destination port, length, checksum, and the data. It is the ideal choice whenever broadcasting or multi-casting is required. The structure of a TCP packet is quite complex; it includes the following in addition to the inherited elements: sequence number, acknowledgment number, data offset, window size, checksum, flags, and lots of extra options.

We shouldn’t go further than this. There are books written on the TCP mechanism. Moving on, finally, we can talk about protocols from the application layer. These can be found on the highest layer, and they are “working” on the end-points.

Unless you’re holding a printed copy of this article, you’re reading this online inside a web browser. That means your favorite browser has used the HTTP protocol (and others) to syndicate and make the content appear on your monitor. HTTP stands for Hypertext Transfer Protocol. It’s based on the request/response model, just like any other client-server specific application model.

The standard enumerates a few request methods and the browser phrases a valid request (syntax-based and semantically) and then it waits for the response. It’s a stateless protocol. Cookies are used to store data about users. 

FTP stands for File Transfer Protocol. It creates a direct connection between two hosts to exchange data. Actually, there are two connections: one is used for control information, and the other for the actual data transfer. The algorithms used are pretty reliable, and when used in correlation with other application-level protocols, security elements can be added as well, as in the case of SSL and SSH.

POP is ironically named Post Office Protocol. Anyone can guess the main purpose of that protocol. Basically, email clients use this protocol to communicate with mail servers to retrieve mail. It’s akin to the method where the postman delivers the mail. POP3 is the most commonly used version that implements authentication methods and other hashing functions. By default, it uses port number 110. Google Mail uses 995 because it’s POP3 over SSL.

Just as POP3 is used to retrieve mails, SMTP is used to deliver them. Simple Mail Transfer Protocol can only be used to deliver messages. IMAP is another retrieving protocol, like POP3, and it’s also commonly used. IMAP fixed some of the POP’s shortcomings but also brought a few drawbacks (such as complexity). With the help of IMAP4, server-side searching was possible, along with many other functions.

{mospagebreak title=Final Thoughts}

As you can see, we’ve reached the end of this article. Unfortunately, due to space constraints we could not get into details and discuss other protocols as well. We have slightly focused on the IP, TCP, and UDP protocols since these are the most important components of the entire suite.

In a future article we will become familiar with VoIP protocols. In another sequel, we are going to discuss routing protocols, which are rather complex.

Finally, we will find out how cellular phones communicate and talk about mobile standards such as the GSM and CDMA. You won’t want to miss those articles!

In closing, I’d like to invite you to join our experienced community of technology professionals on all areas of IT&C starting from software and hardware up to consumer electronics at Dev Hardware Forums. As well, be sure to check out the community of our sister site at Dev Shed Forums. We are friendly and we’ll do our best to help you.

Google+ Comments

Google+ Comments