How do two computers communicate?

Back in the late 1960s the US department of defense was designing the predecessor of what we now know as the internet. This network was called ARPANET (Advanced Research Project Agency Network). This network was one of the first that was designed to use packet switching, one of the concepts that is the backbone of how the modern internet works. But how does all of the network stuff work? One of the ways that the communication between computers can be explained and shown is through networking models. There are several examples of networking models: the OSI model and the TCP/IP model are two examples.

The main purpose of networking models is to standardize communication methods between two or more computer systems and to show what happens to data as it is transmitted from one computer to another. For the purposes of this blog post I’ll be focusing on showing the OSI networking model.

The OSI model was created by the International Organization of Standardization and the International Telegraph and Telephone Consultative Committee. These two organizations started working on their own separate projects involving networking back in the late 1970s. Eventually they combined their efforts and created the OSI networking model.

For more information on the history of the OSI model visit:

The OSI model contains 7 layers, these 7 layers split up the communication and protocols that are used between one or more network devices. Protocols are a set of rules that govern how computers exchange information. Certain protocols only operate on certain layers of the OSI model. I will discuss the functions of specific protocols in a future post. What’s important here is to know where protocols stand in relation to the OSI model. The protocols that are listed in each layer may not be the only protocols that operate at that layer.

The seven layers are as follows:

Layer 7 – Application

  • This layer is at the top of the OSI model
  • The application layer is the layer that is the closest to the end user
  • The application layer generates data that is to be sent across the network
  • Protocols that operate in this layer: HTTP, FTP, and SSH

Layer 6 – Presentation

  • The presentation layer is responsible for formatting, encoding, and decoding the data that is received on the network
  • Protocols that operate at this layer: MIME and ASE
  • Character encoding also takes place at this layer. For example UTF-8 encoding

Layer 5 – Session

  • This layer creates and terminates application sessions or connections
  • Protocols that operate at this layer: NetBIOS, L2TP, and PPTP

Layer 4 – Transport

  • The transport layer is responsible for reliable delivery of information
  • Protocols that operate at this layer: TCP, UDP, and SCTP

Layer 3 – Network

  • The network layer sends packets (chunks of data) between computer networks
  • Protocols that operate at this layer: IP, ICMP, and IPX

Layer 2 – Data Link

  • This layer sends packets across a single network hop (a single network segment), computer to computer, or from computer to a router.
  • Protocols that operate at this layer: ARP, SLIP, and ATM

Layer 1 – Physical

  • This is the bottom of the OSI model
  • The physical layer is comprised of the physical devices that send the data (wires, radio transmitters, etc)
  • Protocols that operate at this layer: Ethernet and WiFi

When data is sent from from one computer to another it travels along the layers of the OSI model. For example say there are two computers that want to exchange data: computer A and computer B. When computer A sends a message to computer B the message starts at the application layer then travels down the OSI model. When the message travels between layers it is encapsulated. I like to think of encapsulation like the message is being placed inside of an envelop. When the data from computer A reaches the transport layer it is encapsulated into a network packet. Technically a piece of information called a header is attached to the data sent from computer A. This header contains the sending IP address and the destination IP address for the message. When the packet reaches layer two another header is added to the message. This header contains the physical address or MAC (Media Access Control) address of the destination computer. Further more the message is encapsulated or wrapped into a frame. When the message reaches layer 1 it is broken down into bits (1s and 0s) then sent across the physical wires or wireless signals.

After the data is sent across the wire or wireless it is reconstructed into the original layer 2 frame. Then as it travels up the OSI model it is encapsulated again but in reverse order. As the data is encapsulated the headers are read and stripped off until only the data that is to be sent to the destination remains. These headers that were added by the sending computer tell the routers and switches where the message is going. Without these headers the message would not get to its intended destination.

This explanation is an overview of the OSI model and how two computers communicate with each other.

For more information on the OSI model and other computing concepts please visit:

Thanks for reading!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s