====== Le protocole ====== ===== Les multiples versions ===== Commençons par le plus désagréable. SNMP existe au moins dans les versions 1, 2c, 2 et 3. Comme pour tout protocole, les références sont des RFC. Si vous aimez ce genre de lecture : ^ **Version** ^ **année** ^ **RFCs** ^ **Titre** ^ **Statut** ^ | v1 | 1990 | 1155 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1155&type=ftp&file_format=txt|Structure and Identification of Management Information for TCP/IP-based Internets]] | standard | |:::|:::| 1156 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1156&type=ftp&file_format=txt|Management Information Base for network management of TCP/IP-based internets ]] | historique | |:::|:::| 1157 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1157&type=ftp&file_format=txt|Simple Network Management Protocol (SNMP)]] | historique | ^ ^^^^^ | v2c (classic) | 1993 | 1441 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1441&type=ftp&file_format=txt|Introduction to version 2 of the Internet-standard Network Management Framework ]] | historique, proposé comme standard | |:::|:::| 1442 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1442&type=ftp&file_format=txt|Structure of Management Information for version 2 of the Simple Network Management Protocol (SNMPv2)]] | standard proposé, remplacé par RFC-1902 | |:::|:::| 1443 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1443&type=ftp&file_format=txt|Textual Conventions for version 2 of the Simple Network Management Protocol (SNMPv2)]] | standard proposé, remplacé par RFC-1903 | |:::|:::| 1444 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1444&type=ftp&file_format=txt|Conformance Statements for version 2 of the Simple Network Management Protocol (SNMPv2) ]] | standard proposé, remplacé par RFC-1904 | |:::|:::| 1445 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1445&type=ftp&file_format=txt|Administrative Model for version 2 of the Simple Network Management Protocol (SNMPv2)]] | historique | |:::|:::| 1446 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1446&type=ftp&file_format=txt|Security Protocols for version 2 of the Simple Network Management Protocol (SNMPv2) ]] | historique | |:::|:::| 1447 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1447&type=ftp&file_format=txt|Party MIB for version 2 of the Simple Network Management Protocol (SNMPv2) ]] | historique | |:::|:::| 1448 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1448&type=ftp&file_format=txt|Protocol Operations for version 2 of the Simple Network Management Protocol (SNMPv2) ]] | standard proposé, remplacé par RFC-1905 | |:::|:::| 1449 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1449&type=ftp&file_format=txt|Transport Mappings for version 2 of the Simple Network Management Protocol (SNMPv2) ]] | standard proposé, remplacé par RFC-1906 | |:::|:::| 1450 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1450&type=ftp&file_format=txt|Management Information Base for version 2 of the Simple Network Management Protocol (SNMPv2)]] | standard proposé, remplacé par RFC-1907 | |:::|:::| 1451 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1451&type=ftp&file_format=txt|Manager-to-Manager Management Information Base]] | historique | |:::|:::| 1452 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1452&type=ftp&file_format=txt|Coexistence between version 1 and version 2 of the Internet-standard Network Management Framework ]] | standard proposé, remplacé par RFC-1908 | ^ ^^^^^ | v2 | 1996 | 1901 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1901&type=ftp&file_format=txt|Introduction to Community-based SNMPv2 ]] | historique, proposé comme expérimental | |:::|:::| 1902 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1902&type=ftp&file_format=txt|Structure of Management Information for Version 2 of the Simple Network Management Protocol (SNMPv2) ]] | standard, remplacé par RFC-2578 | |:::|:::| 1903 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1903&type=ftp&file_format=txt|Textual Conventions for Version 2 of the Simple Network Management Protocol (SNMPv2)]] | standard, remplacé par RFC-2579 | |:::|:::| 1904 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1904&type=ftp&file_format=txt|Conformance Statements for Version 2 of the Simple Network Management Protocol (SNMPv2) ]] | standard, remplacé par RFC-2580 | |:::|:::| 1905 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1905&type=ftp&file_format=txt|Protocol Operations for Version 2 of the Simple Network Management Protocol (SNMPv2)]]  (3416) | standard, remplacé par RFC-3416 | |:::|:::| 1906 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1906&type=ftp&file_format=txt|Transport Mappings for Version 2 of the Simple Network Management Protocol (SNMPv2)]]  (3417) | standard, remplacé par RFC-3417 | |:::|:::| 1907 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1907&type=ftp&file_format=txt|Management Information Base for Version 2 of the Simple Network Management Protocol (SNMPv2)]] (3418) | standard, remplacé par RFC-3418 | |:::|:::| 1908 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=1908&type=ftp&file_format=txt|Coexistence between Version 1 and Version 2 of the Internet-standard Network Management Framework]]  (2576) | standard, remplacé par RFC-2576 | ^ ^^^^^ | v3 | 1999 | 2571 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=2571&type=ftp&file_format=txt|An Architecture for Describing SNMP Management Frameworks]] | standard, remplacé par RFC-3411 | |:::|:::| 2572 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=2572&type=ftp&file_format=txt|Message Processing and Dispatching for the Simple Network Management Protocol (SNMP)]] | standard, remplacé par RFC-3412 | |:::|:::| 2573 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=2573&type=ftp&file_format=txt|SNMP Applications]] | standard, remplacé par RFC-3413 | |:::|:::| 2574 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=2574&type=ftp&file_format=txt|User-based Security Model (USM) for version 3 of the Simple Network Management Protocol (SNMPv3)]] | standard, remplacé par RFC-3414 | |:::|:::| 2575 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=2575&type=ftp&file_format=txt|View-based Access Control Model (VACM) for the Simple Network Management Protocol (SNMP) ]] | standard, remplacé par RFC-3415 | ^ ^^^^^ | v2 et v3 | 2000 | 2576 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=2576&type=ftp&file_format=txt|Coexistence between Version 1, Version 2, and Version 3 of the Internet-standard Network Management Framework]][[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=2576&type=ftp&file_format=txt| ]] | standard proposé | |:::| 2002 | 3411 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=3411&type=ftp&file_format=txt|An Architecture for Describing Simple Network Management Protocol (SNMP) Management Frameworks]] | standard | |:::|:::| 3412 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=3412&type=ftp&file_format=txt|Message Processing and Dispatching for the Simple Network Management Protocol (SNMP)]] | standard | |:::|:::| 3413 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=3413&type=ftp&file_format=txt|Simple Network Management Protocol (SNMP) Applications]] | standard | |:::|:::| 3414 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=3414&type=ftp&file_format=txt|User-based Security Model (USM) for version 3 of the Simple Network Management Protocol (SNMPv3) ]] | standard | |:::|:::| 3415 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=3415&type=ftp&file_format=txt|View-based Access Control Model (VACM) for the Simple Network Management Protocol (SNMP) ]] | standard | |:::|:::| 3416 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=3416&type=ftp&file_format=txt|Version 2 of the Protocol Operations for the Simple Network Management Protocol (SNMP) ]] | standard | |:::|:::| 3417 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=3417&type=ftp&file_format=txt|Transport Mappings for the Simple Network Management Protocol (SNMP)]] | standard | |:::|:::| 3418 | [[http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=3418&type=ftp&file_format=txt|Management Information Base (MIB) for the Simple Network Management Protocol (SNMP) ]] | standard | ^ ^^^^^ | plus quelques standards proposés mais non encore entérinés à ce jour (juillet 2010) ||||| D'une manière générale, reportez-vous au site [[http://www.rfc-editor.org/cgi-bin/rfcsearch.pl|rfc-editor]] pour retrouver les RFC, avec les informations sur leur statut (expérimental, obsolète, actif...) Comme vous le voyez, il règne la plus grande confusion dans la définition des versions 2 et 3 de SNMP. La version 2, commencée à être définie en 1996, ne se voit réellement finalisée qu'en décembre 2002, après que la version 3 ait été définie. Ladite version 3, trop récente, n'est pas encore largement utilisée, si bien que c'est la version 1 qui se retrouve être supportée par tous, avec ses (graves) défauts, comme nous le verrons plus loin, ainsi que la v 2c assez généralement supportée. La version 3, la seule qui intègre quelques notions de sécurité, commence tout de même à être supportée sur des équipements récents (ceci est écrit en juillet 2010). Pour que SNMP fonctionne, il n'y a pas qu'un protocole d'échange à définir. Il y a aussi une standardisation des informations que ce protocole peut transporter. C'est un protocole Internet, il doit être utilisable sur des plates-formes hétérogènes (matériel comme système d'exploitation). C'est pour cette raison que l'on parlera de MIB (Management Information Base) et de SMI (Structure of Management Information) Dans ce qui suit, nous nous appuierons principalement sur SNMP v1 ou v2c. ===== Le protocole lui-même ===== SNMP tire son « S » du fait qu'il s'appuie sur UDP d'une part, et qu'il ne propose qu'un nombre très restreint de commandes. Les commandes sont les suivantes (version 1): ^ **Commande** ^ **Action** ^ | get-request | Le Manager SNMP demande une information à un agent SNMP | | get-next-request | Le Manager SNMP demande l'information suivante à l'agent SNMP | | set-request | Le Manager SNMP met à jour une information sur un agent SNMP | | get-reponse | L'agent SNMP répond à un get-request ou a un set-request | | trap | L'agent SNMP envoie une alarme au Manager | Jusque là, c'est on ne peut plus simple. L'agent utilise le port 161 et le manager, le port 162. Graphiquement, ça donne ceci : {{ :215snmp:snmp2.png |Échanges SNMP}} Les commandes get-request, get-next-request et set-request sont toutes émises par le manager à destination d'un agent et attendent toutes une réponse get-response de la part de l'agent. La commande trap est une alerte. Elle est toujours émise par l'agent à destination du manager, et n'attend pas de réponse. Comme vous le voyez, jusque-là, c'est extrêmement simple. Rassurez-vous, ça va nettement se compliquer avec la MIB et la SMI.