📝 SNMP protocol in computer networks (11 MCQs)
📖 From Data Communication and Networks • 27. Network Management • 11 questions available
What is SNMP protocol in computer networks?
SNMP (Simple Network Management Protocol) is a standard application-layer protocol used to monitor and manage network devices by allowing a central manager to collect status information and configure devices using a simple request-response model over UDP.
📝 All SNMP protocol in computer networks MCQs
Q1. If the recv loop terminates because recv returns 0, what does the variable len contain?
📖 Explanation: When recv returns 0 it signals an orderly shutdown by the peer. The loop stops, leaving len as the sum of all bytes accumulated in previous iterations, which represents the total bytes successfully received.
Q2. Which SNMP operation would you use to periodically retrieve the number of bytes processed by this echo server?
📖 Explanation: An SNMP GET request reads the current value of a managed object. By defining a custom OID that the server updates with the byte count, a management station can poll that OID regularly to monitor the server’s traffic volume.
Q3. When walking through a table of active connections, which SNMP request is most appropriate?
📖 Explanation: SNMP GETNEXT returns the next OID in lexicographic order, making it ideal for iterating over a table of entries such as active connections. Using GETNEXT avoids needing to know every exact OID in advance, unlike GET which requires a specific OID each time.
Q4. If the bind call fails because the address is already in use, which socket option should be set before bind to allow reuse?
📖 Explanation: The SO_REUSEADDR flag permits a socket to bind to an address that is already in use, typically when a previous instance of the server is in TIME_WAIT state. Setting this option before the bind call prevents the “address already in use” error and enables rapid restarts.
Q5. To send an SNMP trap when a client disconnects unexpectedly, where should the code be inserted?
📖 Explanation: An unexpected client disconnect is detected when the recv() loop ends without receiving further data. Placing trap‑generation code right after this loop (and before closing the socket) ensures the event is captured promptly, allowing the server to notify the manager of the abrupt termination.
Q6. Evaluating the risk of hard‑coding SNMP community strings in the echo server’s source, which statement is most accurate?
📖 Explanation: Community strings act as passwords for SNMP v1/v2c. Embedding them in source code exposes them to anyone who can view or decompile the binary, enabling unauthorized read or write operations on managed objects, which constitutes a high security vulnerability.
Q7. If the server receives a packet larger than the current maxLen, how does the while loop handle the excess data?
📖 Explanation: Each iteration of the loop reads at most maxLen bytes, then updates maxLen and the buffer pointer. When a packet exceeds the remaining buffer capacity, recv() reads only the portion that fits, and the loop continues until the entire packet has been consumed, preventing overflow.
Q8. What security improvement does SNMP v3 provide over SNMP v2c for managing this server?
📖 Explanation: SNMP v3 incorporates user‑based security models that support authentication (e.g., HMAC‑SHA) and privacy (encryption) of messages, addressing the weak, clear‑text community‑string model of v2c. This enhancement protects management traffic for the echo server against eavesdropping and tampering.
Q9. Which statement best describes the typical transport protocol choice for SNMP?
📖 Explanation: SNMP was originally designed to run over UDP, which provides minimal latency and overhead suitable for frequent polling. Although newer versions allow TCP for reliability, the standard and most common deployment still rely on UDP as the transport layer.
Q10. What structure does an OID use to uniquely identify a managed object in SNMP?
📖 Explanation: Object Identifiers (OIDs) are expressed as a series of numbers separated by dots, forming a hierarchical tree that uniquely identifies each managed object across all devices. This numeric representation enables consistent referencing regardless of vendor or platform.
Q11. What does the acronym SNMP stand for?
📖 Explanation: SNMP stands for Simple Network Management Protocol, a widely used Internet‑standard protocol that enables network devices to be monitored and managed from a centralized location.