Investigating how computers communicate

in StemSocial2 years ago (edited)

Hi everyone!

Before we get started on the connected indoor garden project, I wanted to tell you a little bit about communication between electronic devices.

Background from Pixabay | Author: TheDigitalArtist

You can read this post in French here

You may have already asked yourself this question in the middle of the big mess created by the far too many norms and standards that each company tries to impose with great difficulty. Many of us also hate having to sacrifice a drawer full of cables with different plugs. And with the arrival of wireless networks with an ever-increasing number (3G, 4G, 5G and soon 6G), one could say that all these technologies are going a bit in all directions.

And you wouldn't be completely wrong, but behind all these communication methods there is a model that allows to organize all this little world, the OSI model. I imagine it a bit like a classification system similar to the genes in animals that allow to create phylogenetic trees ("family trees for species" if you want to know what I typed in the search engine to find the word phylogenetic).

The OSI model :

OSI is an acronym for Open Systems Interconnection, it is an ISO standard (therefore proposed by the International Organization for Standardization). But the model is so general that almost all communication modes are included (if we allow the fact that some protocols need less layers). On the other hand, it does not take into account the connectors used which are concerned by other standards (because the same type of connector can be used for different communication protocols).

The model is divided into 7 layers, which go from the hardware aspect (layer 1) to the software aspect (layer 7). You can see below the list of the 7 layers with the example of what corresponds to each layer for the TCP/IP protocol (the one that goes through the Ethernet cables with RJ45 connectors that you plug on your PCs to access the internet when the Wi-Fi is too slow or non-existent).

Source : Wikimédia | Author : offnofopt | Public Domain

But I guess not everyone is as comfortable with this protocol as the person who created this diagram, so we'll go into a little more detail about what each of these layers means and see if we can also draw a parallel with the human world using letter exchange, for example.

Layer #1 : Physical

It is here that we decide by which physical means we wish to transmit the information, generally we choose among a digital voltage (0 or 1), analog voltage (can take any value between 2 voltages) in a cable, a transmission by optical fiber or radio frequency.

For our postal analogy, layer 1 could be paper and ink.

Layer #2 : Data Link

The Data link is the layer allowing to put in relation 2 users of the same protocol. It is also the layer that takes care of the correction of errors that occurred because of layer 1 (due to electrical noise, among others).

For me, in the example of the Post Office, layer 2 is represented by the mailboxes. Because it is the way you communicate with the network (it becomes even more true when you receive and send mail from your mailbox).

Layer #3 : Network

In the OSI model, layer 3 allows you to identify a distant interlocutor (in another network), it is used to correctly direct the information from the sender to the recipient. This is the case of IP addresses for TCP/IP (the example in the image above).

In the case of the post office, these are postal addresses (e.g. 20 W 34th St, New York, NY 10001, United States). They allow you to get in touch with people outside your immediate circle.

Layer #4 : Transport

The transport layer is used to format standard ways of sending sequences of information. For websites (which use the http protocol) this means creating packets that are sent successively to the recipients. It is also in this layer that we worry about acknowledgements and the rate of lost packets, if it is a criterion for the protocol.

For our analogy, we don't need to cut our letter into several pieces to send it, but if it starts to get long (and even very very long), we will need more stamps because of the weight of the letter. Moreover, we can even choose to have a receipt, a tracking number or a registered letter by changing this stamp.

Layer #5 : Session

Layer 5 enables the creation of a privileged channel between two nodes (devices) in order to accelerate data exchanges between them.

This layer does not concern postal exchange, an alternative could be found if the postal services allowed you to create a faster direct line between you and the people you exchange with the most. On the other hand, this layer does concern phone calls for example.

Layer #6 : Presentation

This is where the format of the messages is decided (such as ASCII or UTF-8, for example, which assign a binary number to a character), the encryption of the data and the various possible conversions (compression, decompression, protocol conversion).

For our letter, this layer could as well contain, the language and alphabet or if you are going to use an encryption or not.

Layer #7 : Application

This is the access point, the layer closest to the user, it can be the browser you are reading this article on or the messaging application you use to contact your relatives.

For our epistolary example, after much hesitation, I think this layer is most similar to the envelope. It is the envelope that contains the message and on which all the information about the transaction is indicated.

Conclusion

And so we have covered the 7 layers of the OSI model. Of course, this is not the only model and not necessarily the most used one depending on the field of activity, but in electronics we appreciate this model to separate the different components of a communication protocol.

I hope you enjoyed this article and have a better idea of how to organize a protocol.

See you soon

Sources

Connected Garden Status:

I'll try to keep you informed of my progress in small sections at the end of the articles that concern this project. For the moment, it is the season of purchases, necessary at the beginning of any project and present particularly in spring for the budding gardeners. We have bought the plants and their pots, and I now remember why I didn't wanted to grow in soil at first :

It was getting dark outside, so we repot the plants inside, maybe not the best idea of the year

But now everything is cleaned up, and it looks very nice (I think, but I'm biased):

The current state of my indoor garden

We have 6 strawberry plants, 1 raspberry (not pi) plant, mint, basil, and chives. You can see below the germinating tray for the lettuce seeds and the container where I will transplant them when they will sprout. You can also see the lights I've added to help them grow.

Sort:  
 2 years ago  

1 raspberry (not pi) plant

:D

:) I should have written "not yet" because I talk about this kind of raspberries in the next articles ^^

Don-1UP-Cheers-Cartel-250px.png

You have received a 1UP from @lipe100dedos!

The following @oneup-cartel family members will soon upvote your post:
@stem-curator
And they will bring !PIZZA 🍕

Learn more about our delegation service to earn daily rewards. Join the family on Discord.

Love this kind of content.
Thanks for sharing.
!1UP
cartel_curator_final.gif

Thank you ! :)

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support.