SNMP Manager Programmer's Guide

SNMP Manager Programmer’s Guide134249
7-1
7
Sending and Receiving Packets
After encoding a request or trap packet, you transmit it. Request packets are sent to
SNMP agents, and trap packets to other managers. After a request packet has been
processed, you receive and interpret its corresponding response packet.
The logic you use for sending and receiving encoded packets depends on the way the
packets are encoded:
To transmit and receive IPC-encoded packets, you use NonStop Kernel interprocess
communication calls. This approach can be used when sending requests to a
NonStop agent.
To transmit and receive BER-encoded packets, you use calls appropriate to the
transmission protocol supported by the target agent or manager. The most widely
supported transmission protocol is the TCP/IP UDP protocol, although alternative
transport mechanisms might be supported by various agents and managers.
Alternative methods include direct encapsulation in Ethernet frames (RFC 1089),
OSI transport (RFC 1283), IPX transport (RFC 1298), and X.25 encapsulation.
NonStop agents and managers that run on NonStop Kernel systems currently
support the UDP protocol.
This section takes a brief look at these two scenarios, using the logic of the example
managers that support both IPC and UDP communication.
Communicating With NonStop Agents
Figure 7-1 summarizes the sequence of system calls used to establish IPC
communication with a NonStop agent, send requests, and receive responses. Both
transmission and receipt are done using nowaited I/O, meaning that the manager could
perform other activities while waiting for the sending (write) and receiving (read)
operations to complete. For waited I/O, the calls associated with the four boxes with
darker outlines in Figure 7-1
would not be required.
Figure 7-1. Calls for Sending and Receiving IPC-Encoded Packets
701
FILE_OPEN_() WRITEX() AWAITIOX() FILE_GETINFO_()
READX()
FILE_GETINFO_()
FILE_GETINFO_()AWAITIOX()FILE_GETINFO_()
Establish nowaited
communication
with NonStop agent
Initiate sending of
request packet
to NonStop agent
Detect
I/O
completion
Determine
outcome of
I/O operation
Determine outcome
of READX()
initiation
Detect I/O completion
Determine outcome
of I/O operation
Determine outcome
of WRITEX()
initiation
Initiate receipt of
response packet
from NonStop agent