Skip to article frontmatterSkip to article content

Is layer 4 sufficient, or do we need something else?


With TCP or UDP we can do our data transfers between applications


In your opinion is it all good then or do we need something else?




๐Ÿ”Ž Letโ€™s look at a concrete example ๐Ÿ”Ž


A lock ๐Ÿ”’ยถ

Nothing standard in my data exchanges ๐Ÿ˜ตโ€๐Ÿ’ซ



I created my own logic



but itโ€™s maybe certainly not in the eyes of others.



A bit of standardization wouldnโ€™t hurt ...


By the way: data transfer ...ยถ

The big question that can arise is


in what format is it relevant to exchange data โ“


The OSI model does not really specify a data format other than saying it is binary ๐Ÿคจ



Layer 6 specifies things a bit in reality but it gives a fairly broad spectrum actually


๐Ÿ˜ฉ How do we do if we want to transmit

a packet of structured but heterogeneous data?

For example, a personโ€™s information:

Name, First name, Date of birth, number of children, ...


JSON Serializationยถ


Via Python ๐Ÿ itโ€™s easy!

import json
data = dict(name="jean", age=1)
serialized = json.dumps(data)
# serialized is now a string
import json
serialized = '{"name": "jean", "age": 1}'
data = json.loads(serialized)
# data is now a dictionary

High level: layer 7 of the OSI modelยถ

This is where concrete things begin ๐Ÿฅณ


Layer 7 = Application layer


Each "category" of application then specifies:

How communications are made between the client and the application

message format, expected content, ...

We talk about protocol, for example:

  • File transfer ๐Ÿ“‚: (S)FTP, rsync

  • Messaging โœ‰๏ธ: SMTP, POP, IMAP

  • Remote sessions: telnet, SSH

  • and...