The TCP/IP Model and Protocol Suite Explained for Beginners

tcp-ip-protocol-stackAny one starting to learn about computer networking will be faced with learning about the OSI and TCP/IP networking models, and the TCP/IP protocol suite.

In this tutorial we will look at networking protocol models, and explain how and why they are structured into layers.

We will then look at the most common protocol suite, the TCP/IP protocol suite and the 4 layer model.

What you will Learn

  • What are Protocols and what is a protocol suite
  • Why Protocols use a stack or layer model
  • The OSI and TCP/IP models
  • How Protocols work across Networks.
  • The TCP/IP model ,protocol layers and the main protocols at each layer.
  • Networking equipment and networking levels

What is a Protocol ?

A protocol is a set of rules that govern how systems communicate. For networking they govern how data is transferred from one system to another.

What is a Protocol Suite ?

A protocol suite is a collection of protocols that are designed to work together.

Before TCP/IP became the de-facto standard other protocol suites like IPX and SPX were common (Novell).

Protocol Stacks

It is possible to write a single protocol that takes data from one computer application and sends it to an application on another computer.- A Single stack Protocol

The problem with this approach is that it very inflexible, as any changes require changing the entire application and protocol software.

The approach used in networking is to create layered protocol stacks.

Each level of the stack performs a particular function and communicates with the levels above and below it.

This layered arrangement is not confined to networking, and how it works is probably best understood if you compare it to real life example.

Lets take an example of a parcel service between two offices.

The task is simple – send parcels between people in each office.

We will divide the task into two distinct processes as follows:

  1. Take a package, wrap it and address it.
  2. Send it to the destination

at the receiving end

  1. Receive the package
  2. Deliver it to the recipient

Typically you would have an internal mail man that:

  1. Collects the parcels from the senders and takes then to a mail dispatch room.
  2. The parcels are placed in a van by the dispatcher and then driven to the remote office.

At the remote office

  1. The parcels are received by the dispatcher and placed into a tray for the mail man
  2. The mail man collects the parcels and delivers them to the recipients,

Here is a simple diagram to illustrate the process:

layered-system-example

The question really is what is the advantage of splitting the task into different layers/tasks?

The answer is that any of the layers/tasks can be changed without affecting the other layers.

So if for example, if we decide to use a train instead of a van to transport the messages between the offices we could do so without affecting the mail man.

In fact the mail man doesn’t know, and doesn’t care, how the parcels are transported between the offices, as all he does is collect them, and pass them to the delivery man.

Although this appears very simple, and maybe trivial, it does illustrate some very important points that are crucial when it comes to understanding networking protocols and how they are organised.

The OSI and TCP/IP Networking Models

All networking courses teach the 7 layer OSI model.

It is important to understand that this model provides for a conceptual framework, and no modern protocols implement this model fully.

The TCP/IP protocol suite uses a 4 layer model.

Note: The OSI model is an idealised networking model, whereas the TCP/IP model is a practical implementation.

The diagram shows how the TCP/IP and OSI models compare

osi-tcp-ip-models

This article has a good overview of the OSI protocol layers and their functions

What is important to understand is that the interfaces between the interfaces are well defined so that it is theoretically possible to replace a particular protocol with another one that operates at that level.

For example you should theoretically be able to replace the IP networking protocol with the IPX networking protocol without affecting how the application e.g. POP3 works.

Although this doesn’t always apply the application protocols like SMTP ,POP3 etc will work Okay across different data link protocols like Ethernet,Token ring etc.

End to End Connections- Routers,Switches and OSI

When two computers communicate across a network the data must travel through various items of networking equipment.

You will often hear the terms level 2 and level 3 equipment used. These terms refer to the OSI levels of the protocol stack  that the device operates at.

A router for example works at the networking layer and is a level 3 device.

A switch operates at the Ethernet level and is a level 2 device.

protocol-stacks-end-end

Because a router operates at the networking layer it doesn’t need to support the upper layer application protocols like HTTP,FTP etc.

The router works on network address which are part of the networking protocol (IP or IPX).

A router can route many different protocols at the same time, but it doesn’t do protocol conversion.

An IP packet coming in will be an IP packet going out and an IPX packet coming in will be an IPX packet going out.

To do protocol conversion you will need a Gateway.

Likewise a switch doesn’t have level 3,4,5,6 or 7 protocol stacks as it doesn’t need them, and so it doesn’t care about the routing protocol IP,IPX etc or the application FTP,HTTP etc that passes through it.

Because the switch operates at level 2 (data link layer) it only needs to understand the MAC addresses that are part of the Ethernet protocol.

The TCP/IP Protocol Suite

The TCP/IP protocol suite consists of many protocols that operate at one of 4 layers.

The protocol suite is named after two of the most common protocols – TCP (transmission Control Protocol) and IP (internet Protocol).

tcp-ip-networking-model

TCP/IP was designed to be independent of networking Hardware and should run across any connection media.

The earliest use, and the most common use is over Ethernet networks.

Ethernet is a 2 layer protocol/standard covering the physical and data link layer, shown in the diagram above.

Important Notes:

HTTP (hypertext transfer protocol) -This is the workhorse of the Web.

SMTP,POP3,IMap4 – These are email protocols

TCP (Transmission control protocol) is a connection orientated protocol and is used to provides a reliable end to end connection.

UDP (used datagram protocol) is connection less protocol and doesn’t guarantee delivery. See UDP vs TCP- what is the Difference?

Applications will choose which transmission protocol to use based on their function. HTTP, POP3, IMAP4, SMTP and many more use TCP.

UDP is used more in utility applications like DNS, RIP (routing information protocol), DHCP.

IP (Internet Protocol) – This is the main networking protocol. There are two version of IP (IPv4 and IPV6).

ARP (address resolution Protocol) -Translates an IP address to a MAC or physical address.(IP4 networks)

Summary

The TCP/IP protocol suite is a collection of protocols that are used on the Internet.

It is named after two of the main protocols (TCP and IP) and uses a 4 layer networking model.

Questions?

What’s missing from this tutorial? What isn’t properly explained? Let me know using the comments section below and help me improve this tutorial.

Was This Useful?

Related Articles and resources:

Please rate? And use Comments to let me know more

30 comments

  1. (suggestion on what could be added to the guide)

    Would be worth mentioning that MQTT is an application-layer protocol, which utilizes TCP as transport, and IP as networking.

  2. I am a little confused about the number of layers with TCP/IP. Most websites, like yours, specify the number of layers as 4. Other sites say there are 5 levels, like this question on Stack Overflow:
    https://stackoverflow.com/q/42456116/643828

    Another example is here:
    https://www.ccnahub.com/ip-fundamentals/understanding-tcp-ip-and-osi-models/
    This website explains “The second version of TCP/IP became 5 layers: changed the name of Internet Layer to Network layer and divided the link Layer to 2 layers.”

    I’m assuming that by “second version”, the author means when IPv6 was introduced to IP. But, I’m not quite sure.

    No question that in the past, there were 4 layers. But, as of now, are there 5? Or maybe it depends on whether or not the latest version of IP is used?

    1. Hi
      First time I’ve seen it as 5 layers but I don’t teach this anymore . Wiki still shows it as 4. However it really doesn’t matter as the main idea is that it is split into distinct layers which are responsible for a certain function.
      If you are worried regarding an exam question then I would go with 5. Looking around it seems that they are teaching 5 layers
      https://users.exa.unicen.edu.ar/catedras/comdat1/material/TP1-Ejercicio5-ingles.pdf

      by splitting the link layer. However when you look at Ethernet it is a link layer protocol which covers the link and physical levels.
      The OSO model has 7 with the link layer split and so I can only assume they have mapped it to that more closely than before.
      TCP/IP came before OSI which is why they don’t map exactly
      Rgds
      Steve

  3. Just wish you guys could explain what each protocol does in short lines (or long ones if you wish) and how does each level of the protocol suite interacts with the next.

  4. Would like to know, if the layer 2 Encapsulated protocol in the WAN depends on the physical interface on the router, and also how many L2 protocols are there in TCP/IP model, that can used in the WAN?, and their Encapsulated Format use(frame format used) ?
    Interface L2 protocols supported
    NIC—— Ethernet (802.3)
    Serial——. HDLC, PPP and frame Relay

    Please, kindly let me know more router interface s and the Layer 2 protocols supported.

    Thanks.

  5. Hello Steve,

    Although the explanation the contained layers and protocols, I couldn’t understand how the TCP / IP protocol suite works in real time and its purpose. Giving a real world like example in a Hypothetical network environment explaining how each layers comes into play would be helpful.

    Thanks

  6. I like the pictures because it helps your brain remember. I also like the fact that you know you are explaining it to someone who doesn’t know. I would like to know how it all ties together and which commands are used for each layer. I want to work with what I’m learning. You are on the right track as far as your teaching method. I’ve been to 100 sites and yours was pretty clear.

  7. Hey Steve
    I am Bittu kumar from IIT Bombay
    You have tried your best to explain the networking model but I have a doubt in protocol which tools are used to make protocols and how protocols are doing their job..
    I know it is difficult to explain in this short conversation but as I have observed you are best in the explaining the things…
    That’s why I am requesting to have look on my comment.
    Thanks
    Bittu kumar

    1. application layer is software and so is the network
      physical and data link are done mainly in hardware
      rgds
      steve

  8. I understand that all using all these different protocols have their purpose. But, can data be sent only using the ethernet layer and no underlying protocols like TCP.

  9. Explained very well.I want explanation on transmission modes sir…thank you….may Allah bless u

Leave a Reply

Your email address will not be published. Required fields are marked *