1 Jim Binkley SNMP v1 - the protocol Network Mgmt/Sec.

Slides:



Advertisements
Similar presentations
Chapter 5 SNMPv1: Communication and Functional Models.
Advertisements

Communication and Functional Models
SNMP Operations * * Mani Subramanian “Network Management: Principles and practice”, Addison-Wesley, 2000.
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 Chapter 8: Monitoring the Network Connecting Networks.
Implementing a Highly Available Network
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 24 Network Management: SNMP.
SNMP 訊息格式 IP 標頭 UDP 標頭 SNMP 訊息 SNMP 標頭 PDU 標頭 PDU 資料.
TCP/IP Protocol Suite 1 Chapter 21 Upon completion you will be able to: Network Management: SNMP Understand the SNMP manager and the SNMP agent Understand.
CSEE W4140 Networking Laboratory Lecture 11: SNMP Jong Yul Kim
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
1 Pertemuan 07 Model Komunikasi Matakuliah: H0372/Manajemen Jaringan Tahun: 2005 Versi: 1/0.
1 SNMP Simple Network Management Protocol. 2 SNMP Overview Define mechanism for remote management of network devices (routers, bridges, etc.) Fundamental.
SNMP PROTOCOL Copyright © 2001 by Aiko Pras These sheets may be used for educational purposes.
COMP4690, by Dr Xiaowen Chu, HKBU
SNMP PROTOCOL Copyright © 2001 by Aiko Pras These sheets may be used for educational purposes.
SNMP Simple Network Management Protocol
Chapter 5 SNMPv1: Communication and Functional Models.
Network Management: SNMP
SNMPv1 Communication and Functional Models
1 © 2013 Cisco Systems, Inc. All rights reserved. Cisco confidential.Cisco Networking Academy, U.S./Canada Equipping Today’s Instructors for Tomorrow’s.
SNMP Terms SNMP Agent (network element to monitor) SNMP Management Station Community String (password) SMI (Structure of Management Info) MIB (Management.
Introduction to SNMP AfNOG 11, Kigali/Rwanda.
1 Jim Binkley SNMP overview Network Mgmt/Sec.. 2 Jim Binkley Outline u snmp components –architecture/MIBS/naming –protocol –security u snmp history and.
Ch. 31 Q and A IS 333 Spring 2015 Victor Norman. SNMP, MIBs, and ASN.1 SNMP defines the protocol used to send requests and get responses. MIBs are like.
Ch. 31 Q and A CS332 Spring Network management more than just Ethernet Q: Comer mentions that network managers need to be able to account for different.
SNMP (Simple Network Management Protocol) Jon Sevy Geometric and Intelligent Computing Laboratory Department of Mathematics and Computer Science Drexel.
ENS 1 SNMP M Clements. ENS 2 Simple Network Management Protocol Manages elements in networks – E.g. routers, switches, IP phones, printers etc. Uses manager.
Chapter 6 Overview Simple Network Management Protocol
McGraw-Hill The McGraw-Hill Companies, Inc., 2000 SNMP Simple Network Management Protocol.
TCP/IP Protocol Suite 1 Chapter 21 Upon completion you will be able to: Network Management: SNMP Understand the SNMP manager and the SNMP agent Understand.
SNMP Communication and Functional Models
Network Protocols UNIT IV – NETWORK MANAGEMENT FUNDAMENTALS.
SNMP ( Simple Network Management Protocol ) based Network Management.
Lec8: SNMP v1.
9/15/2015© 2008 Raymond P. Jefferis IIILect Application Layer.
ECE Prof. John A. Copeland Office: Klaus or call.
Communication and Functional Models
SNMP Simple Network Management Protocol. SNMP and UDP Uses UDP as transport protocol Connectionless Connectionless Port 161 for sending and receiving.
Lec 3: Infrastructure of Network Management Part2 Organized by: Nada Alhirabi NET 311.
SNMP n Where did it come from ? –Internet Engineering Task Force »Network Management Area –SNMP V1 –MIB definitions –SNMPV2.
1 Network Management: SNMP The roots of education are bitter, but the fruit is sweet. - Aristotle.
POSTECH DP&NM Lab 1 Simple Network Management Protocol (SNMP) Mi-Jung Choi Dept. of Computer Science KNU
Simple Network Management Protocol (SNMP) SNMP v1 (RFC 1157) UDP Port 161 Operation supported by SNMP – Get: retrieves a scalar object value – Set: updates.
APRICOT 2008 Network Management Taipei, Taiwan February 20-24, 2008 Introduction to SNMP.
CITA 440 Week 6 SNMPv1. Internet SNMP Management Internet Engineering Task Force (IETF) –1990SNMPv1 –1996SNMPv2 –1998SNMPv3 Internet documents: –Request.
1 Kyung Hee University Prof. Choong Seon HONG SNMP Management Information.
Common Management Protocol W.lilakiatsakun. Topics SNMP (Widely used) SNMP (Widely used) Command Line Interface (CLI) Command Line Interface (CLI) Syslog.
Chapter 36 Network Management & SNMP. Network management monitors network related hardware & software; troubleshoot network problems Detects major failures.
Ch. 31 Q and A IS 333 Spring 2016 Victor Norman. SNMP, MIBs, and ASN.1 SNMP defines the protocol used to send requests and get responses. MIBs are like.
Lec 3: Infrastructure of Network Management Part2 Organized by: Nada Alhirabi NET 311.
Extra Lecture and examples
Network Management Workshop June 2009 Papeete, French Polynesia
Network management Communication model
Simple Network Management Protocol (SNMP)
Simple Network Management Protocol (SNMP)
Karl Quinn 23rd November 2004 NDS M.Sc.
Network Management: SNMP
SNMPv1 Network Management: Communication and Functional Models
APRICOT 2008 Network Management Taipei, Taiwan February 20-24, 2008
SNMP M Clements ENS.
Instructor & Todd Lammle
Network Management Workshop November 2009 Nadi, Fiji
SNMP M Clements ENS.
Network Management Workshop June 2009 Papeete, French Polynesia
SNMPv1 (cont’d) & SNMPv2 (II)*
SNMPv1 Network Management: Communication and Functional Models
SNMP M Clements ENS.
Network Management Workshop intERlab at AIT Thailand March 11-15, 2008
COMS/CSEE 4140 Networking Laboratory Lecture 10
CT1305 Computer Network Management Dr. Mostafa H. Dahshan
Presentation transcript:

1 Jim Binkley SNMP v1 - the protocol Network Mgmt/Sec.

2 Jim Binkley Outline u protocol overview –UDP/polling/reliability u protocol formats –get, set, response, trap –get-next, and tables u protocol examples

3 Jim Binkley manager/agent agent get database item (OID) MIBS manager sends agent sends response

4 Jim Binkley SNMP layered on top of UDP u manager sends packet (snmp get) with: –ip src = manager, ip dst = agent –udp src port = client port (>=1024), say 1046 –udp dst port = 161 u response formed by client comes back from port 161 to manager client port (1046) u traps sent to port 162 on manager

5 Jim Binkley UDP is unreliable protocol u collisions, congestion, noise may kill packets u send mechanism will typically have N retries u UDP does have checksum mechanism (needs to be on) u in addition, typical manager does periodic poll (5 minutes/15 minutes or longer)

6 Jim Binkley polling, cont. u in general you need to consider how many agents exist u how many MIB objects are accessed (e.g., in BGP router, routing table could be quite large) u how “far” in link counts is manager from worst-case agent –less links the better; manager should be central and should be on quality link

7 Jim Binkley Heisenberg... u are you feeling “uncertain”? u question: how can you measure capacity usage at manager? u use HPOV on manager interfaces u use MRTG to watch thruput on manager interfaces (or snmpget/snmpwalk) u look at SNMP errors in snmp mib, interface errors in interface mib on manager

8 Jim Binkley traps are fundamentally unreliable u one way, agent to manager u doesn’t mean they aren’t useful u I rebooted (due to a crash) u I lost an interface u you get some redundancy here from syslog though –syslog is not SNMP...

9 Jim Binkley v1 community u each agent may have 1-N community strings defined associated with access-mode u access-mode: { read-only (RO), read-write) u manager needs to know community in order for access to succeed u more formally: MIB view: subset (or all) of objects in MIB u possible that different communities may have different views (but rare)

10 Jim Binkley community, etc. u MIB object has ACCESS defined with it u access-mode (set in global agent configuration) may/may not agree u there aren’t any surprises here really: u you can’t set an object with RO access mode. u you can’t write a read-only access u thus all mib objects (if you are careful) can be read-only (not unusual due to paranoia)

11 Jim Binkley community, etc u public is often (always?) default for RO community u private is often (not always) default for RW community –sometimes no default (good idea...) –check for this with any piece of equipment u typically multiple communities supported –may be ACL to limit access to certain IP addresses

12 Jim Binkley naming (part 1) u short-form: u get (or other request) must utter the OID of the object u basically: snmp-get( etc = ???) u reply: snmp-response( etc==value) u snmp messages like get can actually have multiple OID requests in them u we will get to tables with snmp-get-next

13 Jim Binkley packet (PDU) structure u note PDU in pure SNMP speak refers to upstairs snmp type of packet u SEQUENCE –version INTEGER {value is *0*) –community OCTET STRING, –data ANY -- actually the PDUs,, therefore

14 Jim Binkley encapsulation enet(MAC) ip (addr) udp(port) snmp (OID) as an IP datagram version community string SNMP PDU/s common snmp structure layout note: remember BER, starts with sequence TLV

15 Jim Binkley 5 kinds of PDU (packet) u PDUs ::= CHOICE –get-requestGetRequest-PDU, –get-next-request GetNextRequest-PDU, –get-response GetResponse-PDU, –set-request SetRequest-PDU, –trapTrap-PDU

16 Jim Binkley common PDU structure u for all but Trap-PDU u Get (0), GetNext (1), GetResponse(2), Set (3) u PDU ::= SEQUENCE –request-id INTEGER –error-status INTEGER –error-index INTEGER –variable binding VarBindList u note: > 1 variable bindings u varBind is: (name ObjectName, value ObjectSyntax) (NULL in gets)

17 Jim Binkley notes (for all but trap) u error-status values include: –noError (0) –tooBig (1) - GetResponse PDU < MIB value –noSuchName (2) - no known OID in MIB/s –badValue (3) - setRequest has “bad” value –readOnly (4) -- –genError(5) -- general error, see error-index u error-index, if > 0, index into variables in variable bindings (which one is wrong)

18 Jim Binkley encapsulation of gets/set/request PDU type request-id 0 0 (name,value) (name,value) get, get-next, set PDU type request-id error-status error-index vars get-response

19 Jim Binkley notes u typically one, but > 1 in variable bindings possible u very unlikely but one UDP packet can contain multiple snmp messages... u error fields are 0 in gets/set, possibly non zero in response u request-id in get and response should be same - effectively sequence number

20 Jim Binkley protocol picture get, get-next, set response 161 manager agent trap

21 Jim Binkley snmp-get - 1 MIB variable ucd-snmpget example #1: # snmpget -d -v 1 DNS-name COMMUNITY system.sysDescr.0 sending 49 bytes to : D C A public B F4 06 EB ;t.k C B note: done on localhost, above is snmp-get

22 Jim Binkley snmp-response part received 178 bytes from AE C A public" F B F4 06 EB ;t.k F B B F A 79 6D FreeBSD etc.... truncated, following is displayed response for sysDescr system.sysDescr.0 = "FreeBSD mumble.cs.pdx.edu RELEASE FreeBSD RELEASE #2: Mon Jul 14 09:12:23 PDT 1997

23 Jim Binkley tcpdump of snmp-get # tcpdump -i lo0 udp and port :40: > : |30|82|00|2d|02|01|04|06|a0|20GetRequest(19)|02|04|02|01|02|01|30| 82|00|10 |30|82[|snmp] (ttl 64, id 32901) data deleted...

24 Jim Binkley tcpdump of same response 14:40: > : |30|82|00|ae|02|01|04|06|a2|82|00|9fGetResponse(17)|02|04|02|01|02| 01|30|82|00|8f |30[|snmp] (ttl 64, id 32902) data deleted...

25 Jim Binkley get-next and tables u two kinds of access in SNMP u 1. “random access”, which simply means you supply the exact OID, and get/set value –tricky if table entry, else simple u 2. “sequential access”, which is done on basis of lexicographical ordering of OIDs

26 Jim Binkley lexicographical ordering u an OID is a series of small integers from left to right (x1, x2,... xn) u we say that OID1 precedes OID2 if for (x1, x2,... xn) and (y1, y2,... y2) OID1 < OID2 if iterate via index i, and while xi = yi stop if xi is < yi

27 Jim Binkley put another way root

28 Jim Binkley lexicographic order means: u visit the root and then traverse subtrees from left to right u depth-first search of the tree u so: snmp-get-next given OIDx u returns OID(next lexicographic leaf) u basically works on leafs u but given non-leaf predecessor, finds next leaf

29 Jim Binkley lexicographic order u is how managers can walk tables without a priori knowing how big table is u e.g., IP MIB-2 section contains: –routing table –arp table u could be arbitrarily big (and change periodically)

30 Jim Binkley tables, like Gaul u have three parts –1. table name (ipNetToMediaTable(22)) –2. row name (ipNetToMediaEntry(1) –3. column object name (ipNetToMediaIfIndex(1)) u table –row name »column name

31 Jim Binkley hypothetical example namenumberage billy sue bob r1 r2 r3 c1c2c3

32 Jim Binkley in snmp speak: u this is the table peopleTable, sequence of u rows peopleRows, sequence: u name, number, age (column names) u random access in snmp would be: peopleTable.peopleRow.number u i.e., r2, c2 u assumption: index is put at end, and somehow uniquely identifies item

33 Jim Binkley therefore u OID for tables of form: table.row.column-label.index u supplied to get-next, returns next table entry (or next entry period -- can walk off table) u next table entry COLUMN-WISE –NOT ROW-WISE u random access requires index at end for table

34 Jim Binkley reality-check u there aren’t that many tables in MIB-2 u in general index is straight-forward u not so, for tcp connection table –index is 4-tuple of ip peers addresses and tcp client/server ports u easier to use get-next and walk through table than utter “random-access” name u e.g., ucd-snmp snmpwalk > snmpget

35 Jim Binkley ARP table - ASN (roughly) u ip.ipNetToMediaTable (table name) –ipNetToMediaEntry (row name) »index is: ( ipNetToMediaIfIndex, NetAddress) »SEQUENCE ipNetToMediaIfIndex INTEGER, ipNetToMediaPhysAddress PhysAddress (MAC) ipNetToMediaNetAddress IpAddress ipNetToMediaType INTEGER u basically (MAC, IP) bound to a certain interface (ifIndex)

36 Jim Binkley handout time u look at handout for arp table walk

37 Jim Binkley traps u Trap-PDU ::= [4] IMPLICIT SEQUENCE –enterprise OBJECT IDENTIFIER -- system.sysObjectID - equipment ID –agent-addr NetworkAddress -- ip address –generic-trap INTEGER -- type of trap –specific-trap INTEGER –time-stamp TimeTicks -- time since boot –variable-bindings -- interesting info

38 Jim Binkley trap types u coldStart (0) -- reboot possibly due to crash u warmStart (1) -- software reinit u linkDown(2) -- link crashed u linkUp(3) -- link uncrashed u authenticationFailure(4) -- invalid SNMP password u egpNeighborLoss(5) u enterpriseSpecific(6)

39 Jim Binkley what to do with traps u besides log (e.g., ucd snmptrapd can log in UNIX syslog) u treat as 1st-class faults and u send linkDown coldStart with associated strings to pager u note Cisco enterprise traps can tell you about things like router re-configuration (which could be a security event...)

40 Jim Binkley snmp trap - cisco cold start on cisco# reload reboot trap send to manager... Mar 29 17:38:21 deedee snmptrapd[2580]: : Cold Start Trap (0) Uptime: 0:00:08, system.sysUpTime.0 = Timeticks: (858) 0:00:08.58, enterprises = "reload” note: ucd-snmp unix snmptrapd logs to syslog

41 Jim Binkley snmp trap - cisco link down cisco-config-interface# interface FastEthernet0/1 shutdown Mar 29 17:39:59 deedee snmptrapd[2580]: : Link Down Trap (0) Uptime: 0:02:10, interfaces.ifTable.ifEntry.ifIndex.2 = 2, interfaces.ifTable.ifEntry.ifDescr.2 = FastEthernet0/1, interfaces.ifTable.ifEntry.ifType.2 = ethernetCsmacd(6), enterprises = "administratively down” note: how can figure out what MIB was used for the enterprises MIB object? what other MIB objects are in that MIB?

42 Jim Binkley enterprise trap/reality check?! note: this showed up. what is it and can we make it more meaningful? Mar 29 17:40:56 deedee snmptrapd[2580]: : Enterprise Specific Trap (1) Uptime: 0:03:20, enterprises = 1, enterprises = 3, enterprises = 2

43 Jim Binkley example v1 setup/cisco router u in IOS speak: u access-list 2 permit u snmp-server community noguessing RO 2 u snmp-server community RW 2 u snmp-server host traps u snmp-server location PSU u snmp-server contact anybody but me, x-1234 u snmp-server enable traps snmp, etc. u # show snmp (to see setup)

44 Jim Binkley cisco setup notes u don’t do RW if you don’t believe in “writeability” or don’t have to –ancient security principle: least privilege - don’t give it up unless you have to... u set the location/contact –for the sake of the person covering for you on vacation... u cisco enterprise traps may be specified (or not) in the trap line