๐ Fault management in computer networks (12 MCQs)
Detecting Abnormal Network Conditions and Failures
Fault management identifies, records, diagnoses and resolves conditions that disrupt or threaten network operation. Faults may involve failed interfaces, damaged cables, overloaded equipment, incorrect settings or unavailable services. Management systems use alarms, event logs, status changes and performance indicators to help administrators locate the affected component, estimate service impact and restore communication with minimal disruption. This work reduces service interruption and supports informed repair priorities.
Alarms, Events and Fault Records
A fault-management system receives events from device agents, monitoring probes or log collectors. Events can be filtered, correlated and assigned severity levels so that operators can prioritize work. A fault record may include the affected resource, time, symptoms, probable cause, service impact, assigned technician and resolution details for later analysis.
Isolating a Fault Before Restoring Service
Detection is followed by diagnosis and isolation. An operator checks link state, interface counters, reachability and related events, then compares the observations with network topology and recent changes. After identifying the faulty component, the team repairs or replaces it, confirms recovery with suitable tests, and closes the incident with an accurate record.
Example: Locating a Failed Access Link
A switch reports that an uplink interface is down, while several users report loss of access to another subnet. The operator checks the connected router port and cable, finds a damaged patch lead, replaces it, and confirms that the link returns to its expected speed and that users can again reach the destination network.
Fault History and Root-Cause Analysis
Fault records help reveal recurring weaknesses, such as repeated power failures or interfaces with rising error counts. Performance monitoring can expose degradation before a full outage, while configuration history helps identify changes that preceded an incident. Fault management therefore depends on accurate topology, device inventory and time-stamped operational information. Historical trends also help prioritize preventive maintenance.
Distinguishing Symptoms from Actual Faults
'An alarm always identifies the root cause' is incorrect because it may report only a symptom. 'A down interface always means a broken cable' ignores shutdown settings and remote failures. 'Closing an alert proves recovery' is mistaken; the operator must verify the affected service and record the confirmed resolution. An event requires interpretation before corrective action is selected.
Fault Detection, Severity and Recovery Questions
Students should distinguish fault detection, alarm generation, diagnosis, isolation, repair and verification. Be able to interpret severity levels and distinguish an event from an incident or root cause. Scenario questions may ask which counters or neighboring devices to inspect first and why service testing is required after a repair. A correct diagnosis links the symptom to supporting evidence.
Fault Detection and Recovery Terms
- Fault - An abnormal condition affecting network operation.
- Alarm - A notification of a detected condition.
- Event - A recorded occurrence in a managed system.
- Correlation - Relating events to find common causes.
- Root cause - The underlying reason for a failure.
- Recovery - Restoration of the affected service.
๐ All Fault management in computer networks MCQs
Q1. In the echo server code, if the call to accept() fails, what immediate action does the program take?
๐ Explanation: When accept() returns a negative value, the code enters the ifโblock, calls perror to display the system error message, and then invokes exit(1). This sequence halts the program immediately, preventing any further processing of client connections.
Q2. Considering the infinite for(;;) loop, which of the following best describes the effect on fault detection when a client disconnects unexpectedly?
๐ Explanation: The for(;;) construct repeats the acceptโreceiveโsend cycle indefinitely. If a client drops the connection, the recv() loop ends, the socket is closed, and control returns to the top of the loop where a new accept() is issued, allowing the server to handle subsequent clients without terminating.
Q3. If the pointer 'ptr' is advanced by n bytes in each iteration without resetting before the next client connection, what fault is most likely to occur after several connections?
๐ Explanation: Each connection assumes 'ptr' points to the start of a fresh buffer. Failing to reset it causes subsequent writes to occur beyond the allocated region, corrupting adjacent memory. After enough iterations this overflow triggers a segmentation fault, a classic crash resulting from accessing invalid addresses.
Q4. Compare the error handling of the accept() call and the recv() call in the code. Which statement is true?
๐ Explanation: The accept() call is wrapped in an ifโstatement that tests for a return value less than zero; on failure it prints an error with perror and exits. In contrast, recv() is placed inside a while loop that continues while the return value is positive, exiting the loop when it becomes zero or negative, thereby handling errors differently.
Q5. Evaluate the impact of not resetting 'maxLen' to its original buffer size at the start of each new connection. Which outcome is most accurate?
๐ Explanation: 'maxLen' tracks the remaining space in the buffer. If it is not restored for a new client, the next recv() call may think the buffer is almost full and stop reading early, causing the server to accept fewer bytes than the client actually sends.
Q6. Differentiate between fault management strategies appropriate for TCP (as in this code) versus UDP. Which statement correctly reflects a key difference?
๐ Explanation: TCP establishes a reliable connection with acknowledgments and automatic retransmission, so fault management often focuses on connection errors. UDP is connectionless and does not guarantee delivery; therefore, applications must implement their own checks for loss, ordering, or corruption, making its faultโhandling strategy fundamentally different.
Q7. Which function in the code is primarily responsible for detecting runtime errors related to socket operations?
๐ Explanation: The perror() function examines the global errno variable set by preceding system calls (such as accept(), recv(), or send()) and prints a humanโreadable description of the error. It is the central mechanism in this program for reporting socketโrelated failures to the user.
Q8. Explain the relationship between the return value of recv() and the detection of a clientโinitiated closure. Which condition indicates that the client has closed the connection?
๐ Explanation: When the peer performs an orderly shutdown, recv() returns zero, signalling endโofโfile on the socket. A negative return indicates an error condition, while a positive value less than the requested size simply means fewer bytes were available, not that the connection has closed.
Q9. To improve fault tolerance, a developer proposes adding a check after send() to verify that the number of bytes sent equals 'len'. What advantage does this modification provide?
๐ Explanation: send() may transmit fewer bytes than requested when the underlying socket buffer cannot accommodate the entire payload. By comparing the return value with the intended length, the program can detect partial sends and retry, guaranteeing that the full echo is delivered before closing the connection.
Q10. In the context of this C program, what does the 'perror' function do?
๐ Explanation: perror() takes a custom prefix string, appends a description of the current errno value, and writes the combined message to the standard error stream. This provides immediate feedback about why a system call such as accept() failed.
Q11. Analyzing the code's resource management, which of the following best describes a potential fault if 'close(s)' were omitted after handling a client?
๐ Explanation: Each accepted connection consumes a file descriptor. Failing to close the descriptor after the client interaction leaves it allocated, and repeated omissions eventually exhaust the process's descriptor limit, preventing new connections and causing subsequent accept() calls to fail.
Q12. Given the code fragment, if 'recv()' returns -1 due to an interrupt signal, what logical step should the server ideally take to maintain robustness?
๐ Explanation: An EINTR error indicates the system call was interrupted by a signal but the socket remains valid. The robust approach is to repeat the recv() operation, allowing the server to continue receiving data without treating the interruption as a fatal failure.