Viva Questions and Answers
Experiment 5: CRC and Error Detection
Q: What is the purpose of a Cyclic Redundancy Check (CRC)?
A: CRC is used to detect errors in data transmission. It generates a checksum based on the
data being sent and ensures the integrity of the received message.
Q: How does the CRC generator identify transmission errors?
A: The CRC generator divides the data bits by a predetermined polynomial, producing a
remainder. If the remainder at the receiver end does not match, an error is detected.
Q: What is a codeword in CRC?
A: A codeword is the original message appended with the CRC bits, which is transmitted to
the receiver for verification.
Q: Why is the division operation important in CRC implementation?
A: Division determines the remainder (CRC bits), which is used to verify data integrity at the
receiver's end.
Q: What happens if the receiver detects an incorrect codeword?
A: The receiver identifies an error in transmission and requests the sender to resend the
data.
Q: How does CRC ensure data integrity?
A: CRC detects even small errors in data transmission by comparing the generated and
received remainders.
Q: What is the role of the polynomial generator in CRC?
A: The polynomial generator defines the divisor used in the CRC calculation, determining
the level of error detection.
Q: What does redundancy mean in error detection?
A: Redundancy refers to extra data (CRC bits) added to the original message to detect errors
during transmission.
Q: How is CRC implemented in C/C++?
A: CRC is implemented by appending zeros to the message, performing binary division using
the generator polynomial, and appending the remainder to the message.
Q: What are some practical applications of CRC?
A: CRC is widely used in data communication protocols like Ethernet, USB, and error-
checking in storage devices.
Experiment 6: Distance Vector Algorithm
Q: What is the purpose of the distance vector algorithm?
A: The distance vector algorithm calculates the shortest path between nodes in a network
by sharing routing information with neighboring nodes.
Q: Explain the count-to-infinity problem.
A: The count-to-infinity problem occurs when routers continuously update each other with
incorrect routing information, leading to a loop.
Q: How does the algorithm calculate the shortest path?
A: Each router calculates the shortest path by considering the distances reported by its
neighbors and updates its routing table accordingly.
Q: What is the role of a next-hop table?
A: The next-hop table identifies the immediate router that packets should be sent to reach
their destination.
Q: How does the algorithm handle non-adjacent routers?
A: Non-adjacent routers exchange information through intermediary routers to update their
distance tables.
Q: What are the challenges of the distance vector protocol?
A: Challenges include slow convergence, the count-to-infinity problem, and routing loops.
Q: Why is router table initialization important?
A: Proper initialization ensures that routers start with accurate distance information,
preventing errors during updates.
Q: Describe the process of distance calculation.
A: Routers calculate the distance to each destination by adding the cost to the neighbor and
the neighbor’s reported distance to the destination.
Q: How is hop count used in routing?
A: Hop count represents the number of routers a packet must traverse to reach its
destination. It helps identify the shortest path.
Q: What are practical applications of the distance vector algorithm?
A: It is used in routing protocols like RIP (Routing Information Protocol) and small to
medium-sized networks.
Experiment 7: TCP Client-Server Architecture
Q: What is the TCP protocol, and why is it reliable?
A: TCP (Transmission Control Protocol) is a connection-oriented protocol ensuring reliable
data transmission through acknowledgment and error-checking mechanisms.
Q: How does the server establish a connection with a client?
A: The server listens for incoming requests on a specific port. When a client sends a
connection request, the server accepts it, establishing a connection.
Q: What is the significance of port numbers in TCP?
A: Port numbers identify specific processes or services on a device, enabling multiple
applications to use TCP simultaneously.
Q: Explain socket programming in Java.
A: Socket programming in Java involves creating a server socket on the server and a client
socket on the client to facilitate two-way communication.
Q: Why is exception handling important in a TCP program?
A: Exception handling ensures the program can manage runtime errors like connection
failures or invalid input without crashing.
Q: What happens when a client sends a message to the server?
A: The server reads the message, processes it, and optionally sends a response back to the
client.
Q: How is the `q` command used in this program?
A: The `q` command is used to terminate the connection between the client and server
gracefully.
Q: Describe the flow of data between client and server in this program.
A: The client sends a message to the server, which processes the message and sends a
response back to the client in a continuous loop until terminated.
Q: Why is multithreading essential for a robust server?
A: Multithreading allows a server to handle multiple client connections simultaneously
without blocking others.
Q: How would you test the TCP program for functionality?
A: By running both the client and server programs, sending messages from the client, and
verifying the responses received from the server.