Garden of KnowledgeApplied Sciences › Computer Science › Software › Security › Networking › Fundamentals
February 25, 2026

Protocoles Réseau

Les protocoles réseau définissent les règles de communication entre systèmes. Cette note couvre les protocoles fondamentaux avec un focus sur leurs mécanismes, leurs ports, et leurs implications pour la sécurité.

Modèle TCP/IP vs OSI§

Couche TCP/IPCouche OSIProtocolesPDU
Application7 Application, 6 Présentation, 5 SessionHTTP, DNS, SMTP, SSH, FTPMessage/Data
Transport4 TransportTCP, UDP, SCTPSegment/Datagramme
Internet3 RéseauIP, ICMP, ARP, BGPPaquet
Accès réseau2 Liaison, 1 PhysiqueEthernet, WiFi (802.11), PPPTrame/Bit

Protocoles de transport§

TCP (Transmission Control Protocol)§

Caractéristiques : orienté connexion, fiable, ordonné, contrôle de flux et de congestion.

Three-way handshake :

Client → Serveur : SYN (seq=x)
Serveur → Client : SYN-ACK (seq=y, ack=x+1)
Client → Serveur : ACK (ack=y+1)

Fermeture :

Initiateur → Autre : FIN
Autre → Initiateur : ACK
Autre → Initiateur : FIN
Initiateur → Autre : ACK
État : TIME_WAIT (2×MSL = ~4 min)

Drapeaux TCP :

FlagSignificationUsage
SYNSynchronizeInitiation connexion
ACKAcknowledgeConfirmation réception
FINFinishFermeture connexion
RSTResetFermeture abrupte
PSHPushEnvoyer immédiatement
URGUrgentDonnées urgentes
ECEECN-EchoCongestion notification
CWRCongestion Window ReducedFenêtre réduite

Numéros de séquence : 32 bits, aléatoires à l’initialisation (ISN — Initial Sequence Number). Déterminent la fiabilité et l’ordre des données.

UDP (User Datagram Protocol)§

Caractéristiques : sans connexion, non fiable, pas d’ordre garanti, très rapide.

En-tête UDP : Source Port (2B), Dest Port (2B), Length (2B), Checksum (2B) = 8 bytes seulement.

Usage préféré pour :

Implications sécurité : UDP ne valide pas l’IP source → utilisé pour les attaques d’amplification DDoS (DNS amplification, NTP monlist, Memcached).

Fonctions de la couche Transport§

La couche Transport (couche 4 du modèle OSI) assure la communication de bout en bout entre processus applicatifs.

Fonctions clés§

Adressage : utilisation des numéros de port pour identifier les applications destinataires.

Livraison de bout en bout : garantit que les données arrivent intégralement à la bonne destination.

Contrôle de flux : empêche l’émetteur d’envoyer plus de données que le récepteur peut absorber (fenêtre TCP).

Multiplexage / Démultiplexage :

Livraison fiable (TCP) : contrôle d’erreur, contrôle de séquence, contrôle de perte, contrôle de doublons.

Comparaison TCP vs UDP§

CritèreTCPUDP
ConnexionOrienté connexion (3-way handshake)Sans connexion
FiabilitéGarantie (retransmission, ACK)Non garantie
OrdreGaranti (numéros de séquence)Non garanti
Contrôle de fluxOui (fenêtre glissante)Non
VitessePlus lentPlus rapide
En-tête20-60 octets8 octets
UsageHTTP, FTP, SMTP, SSHDNS, DHCP, VoIP, streaming

Autres protocoles de transport§

ProtocoleSigleCaractéristiques
DCCPDatagram Congestion Control ProtocolContrôle de congestion sans fiabilité
SCTPStream Control Transmission ProtocolMultihoming, multi-streaming
RDPReliable Data ProtocolLivraison fiable sans connexion

Numéros de port courants§

PortProtocoleService
20/21TCPFTP (données/contrôle)
22TCPSSH
23TCPTelnet
25TCPSMTP
53TCP/UDPDNS
67-68UDPDHCP
80TCPHTTP
110TCPPOP3
143TCPIMAP
443TCPHTTPS
3306TCPMySQL
5432TCPPostgreSQL
6379TCPRedis
27017TCPMongoDB

Protocole IP§

IPv4§

En-tête IPv4 (20 bytes minimum) :

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version|  IHL  |Type of Service|          Total Length         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Identification        |Flags|      Fragment Offset    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Time to Live |    Protocol   |         Header Checksum       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Source Address                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Destination Address                        |

IPv6§

Implications sécurité : IPv6 souvent mal filtré par les firewalls, vecteur de bypass.

ICMP (Internet Control Message Protocol)§

Types courants :

TypeCodeDescription
00Echo Reply (ping réponse)
30-15Destination Unreachable
50-3Redirect
80Echo Request (ping)
110Time Exceeded (TTL=0)
120Parameter Problem

Usage sécurité :

Protocoles d’application§

DNS (Domain Name System)§

Ports : UDP/53 (requêtes standard), TCP/53 (transferts de zone, réponses > 512 bytes), DoT/853, DoH/443.

Types d’enregistrements :

TypeDescriptionExemple
AIPv4 addressexample.com → 93.184.216.34
AAAAIPv6 addressexample.com → 2606:2800::68
CNAMECanonical name (alias)www → example.com
MXMail exchangermail.example.com priority 10
NSName serverns1.example.com
PTRReverse lookup34.216.184.93.in-addr.arpa → example.com
TXTTextSPF, DKIM, DMARC, domaine verification
SOAStart of AuthoritySerial, refresh, retry, expire
SRVService locator_sip._tcp.example.com
CAACertificate Authority AuthorizationAutoriser seulement Let’s Encrypt

Hiérarchie DNS :

. (root)
├── com
│   └── example.com (autoritative NS)
│       ├── www.example.com
│       └── mail.example.com
├── org
└── fr

Résolution récursive :

Client → Résolveur récursif (FAI ou 8.8.8.8)
Résolveur → Root NS → TLD NS (.com) → Autoritative NS
Autoritative NS → Résolveur → Client

Sécurité DNS :

HTTP/HTTPS§

Voir note dédiée : Software/Web/HTTP en profondeur.md

Ports : HTTP/80, HTTPS/443

Méthodes et propriétés :

MéthodeSûreIdempotenteCache
GETOuiOuiOui
HEADOuiOuiOui
POSTNonNonNon
PUTNonOuiNon
DELETENonOuiNon
PATCHNonNonNon
OPTIONSOuiOuiNon

SSH (Secure Shell)§

Port : 22/TCP

Fonctionnalités :

Méthodes d’authentification :

Algorithmes (openssh récent) :

Key Exchange: curve25519-sha256, ecdh-sha2-nistp256
Host Key: ssh-ed25519, rsa-sha2-512
Cipher: chacha20-poly1305, aes256-gcm
MAC: hmac-sha2-256, umac-128

Configurations sécurisées (/etc/ssh/sshd_config) :

PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
AllowUsers user1 user2
MaxAuthTries 3
Protocol 2
X11Forwarding no
AllowTcpForwarding no  # si tunneling non requis

TLS (Transport Layer Security)§

TLS 1.3 Handshake (1.5 RTT) :

Client → Serveur : ClientHello (key_share, supported_ciphers)
Serveur → Client : ServerHello + Certificat + CertificateVerify + Finished
Client → Serveur : Finished
→ Application data

Suites cryptographiques TLS 1.3 :

TLS 1.2 et antérieur : déprécié (SHA-1, RC4, export ciphers). PCI DSS exige TLS 1.2 minimum depuis 2018.

Vérification :

openssl s_client -connect target.com:443 -tls1_3
nmap --script ssl-enum-ciphers -p 443 target.com
testssl.sh target.com

SMTP/POP3/IMAP — Emails§

ProtocolePortChiffréUsage
SMTP25/TCPNon (MTA-to-MTA)Envoi entre serveurs
SMTP Submission587/TCPSTARTTLSEnvoi client-to-server
SMTPS465/TCPTLSEnvoi client-to-server (ancien)
POP3110/TCPNonRéception (télécharge)
POP3S995/TCPTLSRéception chiffrée
IMAP143/TCPNonRéception (synchronisation)
IMAPS993/TCPTLSRéception chiffrée

Sécurité email :

# Vérifier SPF
dig TXT example.com | grep spf

# Vérifier DKIM
dig TXT mail._domainkey.example.com

# Vérifier DMARC
dig TXT _dmarc.example.com

FTP / SFTP§

ProtocolePortSécurisé
FTP control21/TCPNon (credentials en clair)
FTP data (actif)20/TCPNon
FTP data (passif)DynamiqueNon
FTPS (SSL)990/TCPOui
SFTP22/TCP (SSH)Oui

FTP anonyme : permettre l’accès sans credentials (anonymous/email). Souvent présent sur vieux serveurs, vérifier avec :

nmap --script ftp-anon -p 21 target.com

DHCP (Dynamic Host Configuration Protocol)§

Ports : UDP/67 (serveur), UDP/68 (client)

Séquence DORA :

Client → Broadcast : DHCP Discover
Serveur → Client : DHCP Offer (IP proposée, durée bail)
Client → Broadcast : DHCP Request (acceptation)
Serveur → Client : DHCP ACK (confirmation)

Sécurité :

SNMP (Simple Network Management Protocol)§

Ports : UDP/161 (agent), UDP/162 (traps)

Versions :

VersionSécuritéStatut
SNMPv1Community string en clairObsolète
SNMPv2cCommunity string en clairCourant mais déconseillé
SNMPv3Authentification + chiffrementRecommandé

Community strings : public (lecture) et private (écriture) par défaut → toujours changer.

# Énumération SNMP
snmpwalk -v2c -c public 192.168.1.1 1.3.6.1.2.1.1   # Infos système
snmpwalk -v2c -c public 192.168.1.1 1.3.6.1.2.1.25.4 # Processus
snmpwalk -v2c -c public 192.168.1.1 1.3.6.1.2.1.4.22 # Table ARP

# Brute force community string
onesixtyone -c communities.txt 192.168.1.1

LDAP (Lightweight Directory Access Protocol)§

Ports : TCP/389 (LDAP), TCP/636 (LDAPS)

Protocole d’accès aux annuaires (Active Directory, OpenLDAP). Structure hiérarchique DN (Distinguished Name) :

CN=John Doe,OU=Users,DC=company,DC=local

Opérations LDAP : Bind, Search, Add, Delete, Modify, ModifyDN, Compare, Abandon.

# Requête LDAP anonyme (si autorisé)
ldapsearch -x -H ldap://192.168.1.1 -b "dc=company,dc=local"

# Avec authentification
ldapsearch -x -H ldap://192.168.1.1 -D "CN=user,DC=company,DC=local" -w password \
    -b "DC=company,DC=local" "(objectClass=user)"

# Récupérer les utilisateurs AD
ldapsearch -x -H ldap://dc01.company.local -b "DC=company,DC=local" \
    "(objectClass=person)" sAMAccountName mail

NTP (Network Time Protocol)§

Port : UDP/123

Synchronisation des horloges. Précision de l’ordre de la milliseconde. Crucial pour Kerberos (tickets invalides si horloge décalée > 5 minutes).

Sécurité :

Ports courants à connaître§

PortProtocoleService
21TCPFTP control
22TCPSSH, SFTP
23TCPTelnet (non chiffré)
25TCPSMTP
53TCP/UDPDNS
67-68UDPDHCP
80TCPHTTP
110TCPPOP3
123UDPNTP
135TCPMicrosoft RPC
137-139TCP/UDPNetBIOS
143TCPIMAP
161-162UDPSNMP
389TCPLDAP
443TCPHTTPS
445TCPSMB (Windows shares)
587TCPSMTP submission
636TCPLDAPS
993TCPIMAPS
995TCPPOP3S
1433TCPMicrosoft SQL Server
1521TCPOracle DB
3306TCPMySQL
3389TCPRDP (Remote Desktop)
5432TCPPostgreSQL
5985-5986TCPWinRM (HTTP/HTTPS)
6379TCPRedis
8080TCPHTTP alternatif
8443TCPHTTPS alternatif
27017TCPMongoDB
—The Gardener