6.- Management protocols SNMP RMON Otro software
Motivación Papel de las comunicaciones Administrador de la red Administración de los recursos Routers Switches Servidores Firewalls Puntos de acceso inalámbricos Etc. Monitorización de Utilización del ancho de banda Estado de los enlaces Detección de cuellos de botella Problemas de cableado Coordinación/administración de la información de encaminamiento SEGURIDAD 2
Simple Network Management Protocol (SNMP) Diseñado a mediados de 1980 Estándar para la administración de redes. No genera gran carga sobre la red Utiliza TCP/IP. Se puede administrar cualquier dispositivo en la Internet, no solo en la LAN. 3
SNMP versiones SNMPv1 (1988) RFC1155, RFC1157 (w/rfc1212,1213,1215) SNMPv2 (1992, 1996) RFC1901 SNMPv2c RFC1902-1908 SNMPv2u RFC1909, RFC1910 SNMPv2* Corrige algunas deficiencias de la versión 1 Mejora la eficiencia de la transferencia de datos SNMPv3 (1998) RFC2570-2576,78-80 Corrige deficiencias de seguridad de las versiones anteriores Autenticación Privacidad Control de acceso 4
Conceptos Básicos Polling Firewall / Router Network Management Station... NMS PC...... UNIX UNIX RMON Device...... FDDI Notificación PC Internet UNIX PC 5
Elementos SNMP Tres elementos SNMP Agente ( el servidor) Gestor (Management, Network Management Station (NMS)) ( el cliente) Protocolo SNMP (Arquitectura Cliente-Servidor) Cada nodo SNMP (router, gateway, server, ) que se desea administrar tiene un agente que recoge información en una base de datos MIB (management information base ) Gestor o cliente Programa que se ejecuta en la NMS. Consulta el agente de cada nodo por los datos que ha ido recogiendo. Switch Managed Device with SNMP Agent Managed Device with SNMP Agent Switch MIB stored on Server Network Management Console Switch Managed Device with SNMP Agent Switch Managed Device with SNMP Agent Router Managed Device with SNMP Agent Managed Device with SNMP Agent Switch To Core Backbone 6
Protocolo SNMP Fija las normas de intercambio de mensajes SNMP-PDU s entre el/los clientes (Managers) y los servidores (Agents) Network Management Station (NMS) Network Elements (NEs) Host Host Router Manager Agent Agent SNMP UDP IP DataComm Network Management Protocol SNMP SNMP UDP IP DataComm... SNMP UDP IP DataComm Network 7
SNMP Servicios Servicios Get, GetNext, Set, Trap SNMP-PDUs GetRequest, GetNextRequest, GetResponse, SetRequest, Trap Manager {Get, GetNext, Set} Request Get Response Agent(s) Trap PDU: Protocol Data Unit 8
SNMP Servicios Get GetNext Set Manager Manager Manager Get Request Get Response GetNext Request Get Response Set Request Get Response Agent Agent Agent Manager Trap Request Agent Trap 9
SNMP Servicios (cont.) Get Request: Toma valores en la MIB de un agente. Get-Next Request: Toma valores del siguiente objeto en la MIB de un agente. Set Request: Actualiza/Cambia el valor de un objeto en la MIB de un agente. Trap Request Notifica un evento extraordinario al administrador (MS). 1 0
Puertos UDP por defecto para SNMP Network Management Station (NMS) Manager SNMP UDP IP Get req GetNext req Set req Network Elements (NEs) Agent SNMP UDP IP 162 Any Get resp 161 Any Trap req DataComm DataComm 1 1
Management Information Base (MIB) Cada recurso a ser administrado es representado por un objeto denominado managed object (MO). El MIB es la colección estructurada de TODOS los MOs. Esencialmente, cada MO es una variable. Cada agente mantiene una MIB (una parte de la MIB) Monitorización: lectura de los valores de los MOs en la MIB. Control: modificación (escritura) de los valores de los MOs en la MIB. Managed Resources Agent SNMP UDP IP MIB 1 2 DataComm NE: Network Element
MIB (cont) Sólo existe una MIB. Es el árbol global, abierto a nuevas ramificaciones, pero es común hablar de la MIB-RMON, MIB-RMON2, MIB-II. El administrador elige que parte de la MIB le interesa. (p.e. MIB-II para TCP/IP) 1 3
Identificación de Objetos en la MIB Utilizados en SNMP y en otros protocolos. Object Identifier (OID): El OID consiste en una secuencia de enteros que especifica una posición en el árbol MIB OID = OID tipo + instancia Los objetos son HOJAS 1.3.6.1.2.1 1.3.6.1.2.1.2 1.3.6.1.4.1
http://www.alvestrand.no/objectid/1.3.6.1.2.1.html MIB II rmon 1 5
Columnar Objects.ifTable.ifEntry.1 (1.3.6.1.2.1.2.2.1.1).ifTable.ifEntry.2 (1.3.6.1.2.1.2.2.1.2).ifTable.ifEntry.3 (1.3.6.1.2.1.2.2.1.3) ifindex ifdescr iftype... 1 le0 6... 6 llc0 1... 7 lo0 24... 9 le1 6... 1.3.6.1.2.1.2.2.1.2.6 1.3.6.1.2.1.2.2.1.3.7 1 6 OID = OID tipo + instancia
Get-Next Request MIB Tree : 4 5 6 En SNMP, sólo los objetos hoja tienes valores. :Non-Leaf Object 1 2 3 :Leaf Object 1 7
ASN.1 NET-SNMP-EXAMPLES-MIB DEFINITIONS -- -- Example scalars -- netsnmpexampleinteger OBJECT-TYPE SYNTAX Integer32 MAX-ACCESS read-write STATUS current DESCRIPTION "This is a simple object which merely houses a writable integer. It's only purposes is to hold the value of a single integer. Writing to it will simply change the value for subsequent GET/GETNEXT/GETBULK retrievals. This example object is implemented in the agent/mibgroup/examples/scalar_int.c file." DEFVAL { 42 } ::= { netsnmpexamplescalars 1 } 1 8 de NET-SNMP-EXAMPLES-MIB.TXT en ireasoning MIB-Browser
ASN.1 (cont) netsnmpexamplesleeper OBJECT-TYPE SYNTAX Integer32 MAX-ACCESS read-write STATUS current DESCRIPTION "This is a simple object which is a basic integer. It's value indicates the number of seconds that the agent will take in responding to requests of this object. This is implemented in a way which will allow the agent to keep responding to other requests while access to this object is blocked. It is writable, and changing it's value will change the amount of time the agent will effectively wait for before returning a response when this object is manipulated. Note that SET requests through this object will take longer, since the delay is applied to each internal transaction phase, which could result in delays of up to 4 times the value of this object. This example object is implemented in the agent/mibgroup/examples/delayed_instance.c file." DEFVAL { 1 } ::= { netsnmpexamplescalars 2 }
ASN.1 (cont) -- Example Tables netsnmpietfwgtable OBJECT-TYPE SYNTAX SEQUENCE OF NetSnmpIETFWGEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "This table merely contains a set of data which is otherwise useless for true network management. It is a table which describes properies about a IETF Working Group, such as the names of the two working group chairs. This example table is implemented in the agent/mibgroup/examples/data_set.c file." ::= { netsnmpexampletables 1 } netsnmpietfwgentry OBJECT-TYPE SYNTAX NetSnmpIETFWGEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "A row describing a given working group" INDEX { nsietfwgname } ::= {netsnmpietfwgtable 1 } NetSnmpIETFWGEntry ::= SEQUENCE { nsietfwgname OCTET STRING, nsietfwgchair1 OCTET STRING, nsietfwgchair2 OCTET STRING } nsietfwgname OBJECT-TYPE SYNTAX OCTET STRING (SIZE(1..32)) MAX-ACCESS not-accessible STATUS current DESCRIPTION "The name of the IETF Working Group this table describes." ::= { netsnmpietfwgentry 1 }
IETF MIBs 1213 1316 1317 1471 1513 1757 2021... MIB-II Character Stream RS-232-like Hardware PPP RMON for Token Ring RMON RMON-II 2 1
MIBs empresas Las empresas de dispositivos SNMP pueden registrar su propia MIB (rama de la MIB) en el árbol MIB global contactando con IANA (Internet Assigned Numbers Authority). http://www.iana.org Ramas actualmente asignadas a empresas http://www.iana.org/assignments/enterprise-numbers Red Iris OIDs http://www.rediris.es/si/oidregister/
Ejemplos implementación SNMP http://net-snmp.sourceforge.net/docs/man/ Net-SNMP is available for many Unix and Unix-like operating systems and also for Microsoft Windows. 2 3
Ejemplo de acceso a una variable MIB-II Ver el estado de una conexión TCP: mib-2.tcp.tcpconntable.tcpconnstate =.1.3.6.1.2.1.6.13.1.1 2 4 snmpget maquina public tcp.tcpconntable.tcpconnentry.tcpconnstate.0.0.0.0.25.0.0.0.0.0 >tcp.tcpconntable.tcpconnentry.tcpconnstate.0.0.0.0.25.0.0.0.0.0 = listen(2) (con Net-SNMP, línea de comandos) snmpwalk -v2c -c public maquina tcp TCP-MIB::tcpConnState.0.0.0.0.22.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.0.0.0.0.111.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.0.0.0.0.199.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.0.0.0.0.32768.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.127.0.0.1.25.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.127.0.0.1.631.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.127.0.0.1.32769.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.127.0.0.1.32776.127.0.0.1.631 = INTEGER: closewait(8) versión snmp comunidad (address, port)
RMON-Remote Network Monitoring MIB de propósito especial para monitorización de redes usando SNMP (RFC 1271 RMON-MIB) Diseñado en 1991 RMON-1 monitoriza tráfico de LAN (más que monitorizar dispositivos). Almacena estadísticas de la red. (RFC 1757) RMON-2 expande el análisis desde el nivel de red al de aplicación (RFC 2074) 2 5
RMON conceptos básicos Para conocer el estado de una LAN podríamos hacer Polling sobre todos los agentes en la LAN viendo que hace cada dispositivo Sobrecarga de la LAN por polling Cálculo sobre los datos recolectados Monitores de red, Analizadores o Sondas (probes) Funcionamiento en modo promiscuo Pueden generar resúmenes de la información Estadísticas de error (colisiones, crc-error, ) Estadísticas de prestaciones (paquetes/seg, distribución tamaños de paquetes,..) Pueden definirse filtros para limitar el número de paquetes a capturar Típicamente una sonda por subred 2 6
Ejemplo de configuración RMON NMS PC PC Router WAN PC Router PC with a probe Printer PC with a probe Laptop Printer Laptop Printer 2 7 Normalmente una sonda por subred
Objetivos de RMON Diseño de RMON Operaciones Off-line Proactive monitoring Detección de problemas y notificación. Datos con valor añadido Múltiples administradores RMON System Management station + conjunto de sondas RMON + protocolo SNMP Sonda RMON (RMON Probe) Un agente SNMP RMON MIB 2 8
RMON- MIB http://support.ipmonitor.com/mibs_byoidtree.aspx?oid=1.3.6.1.2.1.16 RMON define un MIB formado por tablas (denominadas grupos) accesibles vía comandos SNMP Statistics(1)- paquetes, octetos, errores. History(2) - histórico de estadísticas Alarms(3) notificación cambios Hosts(4) información de cada host detectado HostTopN(5) - hosts más activos Matrix(6) trafico, errores entre pares de hosts Filters(7) - definición de concordancias Capture(8) - paquetes después del filtro Events(9) - logs de eventos. 2 9
Alarmas RMON OID=1.3.6.1.2.1.16.3 Ejemplo: generar una alarma si más de 500 errores de CRC (umbral) en un periodo de 5 minutos (intervalo) Mecanismo de histéresis: evitar la generación de numerosas alarmas por oscilaciones sobre un único nivel umbral Dos tipos de umbral: superior e inferior (rising, falling) 3 0
RMON2 - RFC 2074 3 1 protocoldir(11) - protocolos soportados por la sonda protocoldist(12) distribución de trafico por protocolo addressmap(13) - MAC-to-NL address nlhost(14) paquetes (in/out) por NL (Network Layer) nlmatrix(15) - tráfico por pares NL alhost(16) AL (Application Layer) por host almatrix(17) - tráfico por AL por pares de host usrhistory(18) Histórico de parámetros user-defined probeconfig(19) - config. script RMON-2 expande el análisis desde el nivel de red al de aplicación (RFC 2074)
Otras herramientas útiles para análisis de tráfico Network Probe: Práctica de laboratorio Ethereal: Analizador de protocolos libre (unix, windows) MRTG: Multi-Router Traffic Grapher Ntop: Muestra el uso de la red, similar Unix top 3 2
3 3 Ethereal
MRTG: Multi-Router Traffic Grapher MRTG es una herramienta para monitorizar el tráfico en los enlaces de red http://people.ee.ethz.ch/~oetiker/webtools/mrtg/ MRTG genera páginas HTML con gráficos GIF que proporcionan una representación visual del tráfico en tiempo real. http://www.ee.ethz.ch/stats/mrtg/ MRTG está basado en Perl y C y funciona sobre UNIX y Windows NT. MRTG se utiliza en muchos sitios. (MRTG-Site-Map). 3 4
Ntop: Network TOP permite monitorear en tiempo real los usuarios y aplicaciones que están consumiendo recursos de red en un instante concreto Posee un microservidor web 3 5
SNMP Estándares SNMP Protocol (Std 15) RFC1157: Simple Network Management Protocol. Structure of Management Information (SMI) (Std 16) RFC1155: Structure and Identification of Management Information for TCP/IP-based Internets. RFC1212: Concise MIB Definitions. MIB-II (Std 17) RFC1213: Management Information Base for Network Management of TCP/IP-based Internets: MIB-II. http://www.isi.edu/rfc-editor/rfc.html