📄 c-background2.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title> SNMP Background </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a></a><a href="c-background.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-background1.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-agent.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="83425">3.2 The Simple Network Management Protocol</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83426"> </a>The Simple Network Management Protocol (<i class="term">SNMP</i>) was developed to address the problems of Internet management. SNMP provides for effective monitoring and control of heterogeneous devices on both local and wide area networks. Since its introduction in 1988, SNMP has experienced widespread acceptance in the TCP/IP community, and it has spread to other communities as well. <a href="c-background2.html#83814">Figure 3-1</a> illustrates how SNMP fits into the Internet architecture.<div class="frame"><h4 class="EntityTitle"><a name="83814"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 3-1: SNMP Management</font></a></h4><dl class="margin"><div class="Anchor"><a name="83803"> </a><img class="figure" border="0" src="images/c-background0.gif"></div></dl></div></p><dd><p class="Body"><a name="83463"> </a>For a list of Internet RFCs (Requests for Comment) and associated publications discussing SNMP, see <a href="x-snmpRefList.html#83419"><i class="title">E. SNMP Reference List</i></a>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83467">3.2.1 The SNMP Framework</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83471"> </a>The SNMP model of network management (see <a href="c-background2.html#83879">Figure 3-2</a>) consists of the following constructs:</p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="83472"> </a>agents</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="83473"> </a>a network management station (NMS)</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="83474"> </a>a network management protocol</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="83475"> </a>a management information base (MIB)</li></ul></p></dl><dl class="margin"><dd><p class="Body"><a name="83476"> </a>An <i class="term">agent</i> is a node that resides on the network (such as a host, router, or terminal server), and is monitored, controlled, and configured by receiving and reacting to the commands sent by an NMS to manipulate the MIB. The NMS and agent communicate by sending SNMP messages. In addition, NMS receives unsolicited SNMP messages (<i class="term">traps</i>) from agents.<div class="frame"><h4 class="EntityTitle"><a name="83879"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 3-2: Manager-Agent Model</font></a></h4><dl class="margin"><div class="Anchor"><a name="83830"> </a><img class="figure" border="0" src="images/c-backgrounda1.gif"></div></dl></div></p><dd><p class="Body"><a name="83516"> </a>There are three components to SNMP: </p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="83517"> </a>the SNMP protocol</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="83518"> </a>the Management Information Base (<i class="term">MIB</i>)</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="83519"> </a>the Structure of Management Information (<i class="term">SMI</i>)</li></ul></p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83520">3.2.2 The SNMP Protocol</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83521"> </a>While a network management protocol could potentially require a large number of distinct commands (for example, add route, delete route, change interface address, examine address, and so on), SNMP casts all of its commands into a small handful of get and set commands which operate on a number of predefined objects. This means that an NMS exercises control over an agent by getting or setting the value of an object, rather than by issuing a specialized command to perform each possible action. For example, to shut down an interface, the NMS sets the interface status to the value <b class="keyword">off</b>.</p><dd><p class="Body"><a name="83522"> </a>This paradigm separates the protocol from the objects managed by the protocol. The benefit is simplicity: there are a limited number of commands, yet there is extensibility. In other words, the number of objects managed by the protocol can grow larger as required by the application MIB.</p><dd><p class="Body"><a name="83523"> </a>The SNMP protocol uses UDP (User Datagram Protocol) at the transport layer and IP (Internet Protocol) at the network layer. The SNMP command (also known as a protocol data unit or PDU) implements requests, responses, and traps between the manager and the agent, as shown in <a href="c-background2.html#83536">Figure 3-3</a>. SNMPv1 commands are listed in <a href="c-background2.html#83983">Table 3-1</a>. The <b class="command">get</b>, <b class="command">set</b>, and <b class="command">response</b> PDUs are formatted alike; the <b class="command">trap</b> PDU contains different fields. SNMP communication is depicted in <a href="c-background2.html#83620">Figure 3-4</a>: the manager sends requests to UDP port 161; the agent sends traps to UDP port 162. <div class="frame"><h4 class="EntityTitle"><a name="83536"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 3-3: SNMP Messages and Commands</font></a></h4><dl class="margin"><div class="Anchor"><a name="83582"> </a><img class="figure" border="0" src="images/c-backgrounda2.gif"></div></dl></div> <p class="table"><h4 class="EntityTitle"><a name="83983"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 3-1: SNMPv1/v2c Command Set</font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="83987"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Command</font></b></div></th><td width="10"> </td><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="83989"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Description</font></b></div></th><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="83991"> </a><b class="command">get-request</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="83993"> </a>Get a value</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="83995"> </a><b class="command">get-next-request </b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="83997"> </a>Get the next value</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="83999"> </a><b class="command">get-bulk</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="84001"> </a>Get many values (SNMPv2c only)</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84003"> </a><b class="command">get-response</b></div></td><td width="10"> </td><td colspan=1 rowspan=1>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -