0% found this document useful (0 votes)
7 views16 pages

Computer Network Viva Question With Answer by Surya

The document provides a comprehensive list of important questions and answers related to computer networks, covering topics such as the OSI model, TCP vs. UDP, DNS, NAT, and various network protocols. It explains key concepts like subnet masks, error detection, and the role of different layers in network communication. Additionally, it discusses network types, transmission media, and protocols used in both wired and wireless networks.

Uploaded by

1795.gaming
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views16 pages

Computer Network Viva Question With Answer by Surya

The document provides a comprehensive list of important questions and answers related to computer networks, covering topics such as the OSI model, TCP vs. UDP, DNS, NAT, and various network protocols. It explains key concepts like subnet masks, error detection, and the role of different layers in network communication. Additionally, it discusses network types, transmission media, and protocols used in both wired and wireless networks.

Uploaded by

1795.gaming
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Computer Network

Top Important Computer Network Viva Question With Answer By Surya


1. Question: What is a computer network?
Answer: A computer network is a collection of interconnected devices (such as computers,
servers, routers, switches) that are linked together to facilitate communication and resource
sharing. It allows data exchange, file sharing, and collaborative work among connected
devices
2. Question: Define the OSI reference model.
Answer: The OSI (Open Systems Interconnection) reference model is a conceptual
framework that standardizes the functions of a communication system into seven distinct
layers. Each layer has specific responsibilities and interacts with the layers above and below
it to ensure effective communication between network devices.
3. Question: What is the difference between TCP and UDP?
Answer: TCP (Transmission Control Protocol) is a connection-oriented protocol that
provides reliable and ordered delivery of data with error checking and retransmission. UDP
(User Datagram Protocol), on the other hand, is a connectionless protocol that offers fast
data transmission without error recovery and retransmission.
4. Question: Explain the purpose of ARP (Address Resolution Protocol).
Answer: ARP is used to resolve the MAC (Media Access Control) address of a device based
on its IP address in a local network. It helps devices find each other's physical addresses to
communicate at the data link layer.

5. Question: What is the purpose of DNS (Domain Name System)?


Answer: DNS is used to translate human-readable domain names (like www.example.com)
into their corresponding IP addresses (like 192.0.2.1). It enables users to access websites
using domain names instead of remembering numerical IP addresses.
6. Question: How does NAT (Network Address Translation) work?
Answer: NAT is used to map private IP addresses to a single public IP address when
connecting to the Internet. It enables multiple devices in a local network to share a single
public IP address, providing a degree of security and conserving public IP address space.
7. Question: What is the purpose of a subnet mask?
Answer: A subnet mask is used to identify the network and host portions of an IP address.
It helps in dividing the IP address space into network and host parts, allowing routers to
determine how to route packets to their destinations.
8. Question: Explain the difference between half-duplex and full-duplex communication.

YADAV SURYA | SYV SOLUTION


Answer: In half-duplex communication, data can be transmitted in both directions, but not
simultaneously. Devices take turns transmitting and receiving data. In full-duplex
communication, data can be transmitted simultaneously in both directions, allowing for
faster and more efficient communication.

====== based on theory topics =====


1. Question: What is a Personal Area Network (PAN)?
Answer: A PAN is a network used for communication between devices in close proximity to
an individual, typically within a range of a few meters. Bluetooth is an example of a PAN
technology.
2. Question: Define Local Area Network (LAN).
Answer: A LAN is a network that spans a small geographical area, such as an office or
building, connecting devices within that limited area.
3. Question: What are the design issues in the Physical Layer?
Answer: Design issues in the Physical Layer include choosing appropriate transmission
media, determining transmission rates, and managing signal encoding.
4. Question: Explain the concept of guided transmission media.
Answer: Guided transmission media refers to media that use physical cables or wires to
guide data signals, such as twisted pairs, coaxial cables, and fiber optics.
5. Question: What are the different types of wireless transmission media?
Answer: Wireless transmission media include radio, microwave, infrared, and light
transmissions that do not require physical cables for data transmission.
6. Question: What is the difference between half-duplex and full-duplex communication?
Answer: In half-duplex communication, data can be transmitted in both directions, but not
simultaneously. In full-duplex communication, data can be transmitted simultaneously in
both directions.
7. Question: Describe the data link layer's error detection and correction process.
Answer: The data link layer uses various techniques like parity check, checksum, and CRC
to detect and correct errors in transmitted data.
8. Question: Explain the concept of Sliding Window protocols.
Answer: Sliding Window protocols allow multiple frames to be sent consecutively without
waiting for acknowledgment, increasing network efficiency.
9. Question: What is the purpose of the Medium Access Control (MAC) sublayer?

YADAV SURYA | SYV SOLUTION


Answer: The MAC sublayer is responsible for managing access to the shared transmission
medium, ensuring that multiple devices can transmit data without collisions.
10. Question: What are the multiple access protocols used in wireless LANs?
Answer: Multiple access protocols in wireless LANs include ALOHA, Carrier Sense Multiple
Access (CSMA), and collision-free protocols.
11. Question: Describe the concept of distance vector routing.
Answer: Distance vector routing uses the number of hops (distances) to determine the
best path to a destination node.
12. Question: What is the Network Layer in the Internet?
Answer: The Network Layer in the Internet is responsible for routing data packets across
multiple networks to their intended destination.
13. Question: What are the elements of Transport protocols?
Answer: The elements of Transport protocols include error control, flow control, and
congestion control mechanisms.
14. Question: Explain the difference between UDP and TCP protocols.
Answer: UDP is a connectionless protocol that does not provide reliability, while TCP is a
connection-oriented protocol that ensures reliable data delivery.
15. Question: What is the role of the Domain Name System (DNS)?
Answer: DNS translates human-readable domain names into IP addresses, enabling users
to access websites using domain names.
16. Question: Describe the architecture of the World Wide Web (WWW).
Answer: The World Wide Web is based on a client-server architecture, where clients (web
browsers) request web pages from servers, which then deliver the requested content.
17. Question: How does HTTP work in the World Wide Web?
Answer: HTTP (Hypertext Transfer Protocol) is the foundation of data communication in
the World Wide Web. It allows web browsers to request and receive web pages from web
servers.
18. Question: What are the layers in the OSI reference model?
Answer: The OSI reference model has seven layers: Physical, Data Link, Network,
Transport, Session, Presentation, and Application.
19. Question: What is the purpose of the Physical Layer in the OSI model?
Answer: The Physical Layer deals with the physical transmission of raw bits over a
communication channel, including the characteristics of the physical medium.

YADAV SURYA | SYV SOLUTION


20. Question: How does the Data Link Layer handle error detection and correction?
Answer: The Data Link Layer uses techniques like CRC (Cyclic Redundancy Check) and
checksum to detect and correct errors in transmitted data frames.
21. Question: Describe the operation of the ALOHA multiple access protocol.
Answer: ALOHA is a random access protocol where devices transmit data whenever they
have data to send, without waiting for a specific time slot. It can lead to collisions.
22. Question: What is the purpose of the ARPANET network?
Answer: ARPANET was one of the first operational computer networks and a precursor to
the modern Internet. It was developed by the U.S. Department of Defense's Advanced
Research Projects Agency (ARPA).
23. Question: Explain the concept of wireless LANs.
Answer: Wireless LANs use wireless communication technologies like Wi-Fi to connect
devices within a local area without the need for physical cables.
24. Question: How does the TCP/IP model differ from the OSI model?
Answer: The TCP/IP model combines the OSI model's Physical and Data Link layers into
one Network Interface layer and has fewer layers (four) compared to the OSI model's seven
layers.
25. Question: What is the purpose of the subnet mask?
Answer: The subnet mask helps identify the network and host portions of an IP address,
enabling routers to determine how to route packets to their destinations.
26. Question: Explain the concept of a CNAME record in DNS.
Answer: A CNAME (Canonical Name) record creates an alias for a domain, mapping one
domain name to another domain name.
27. Question: Describe the purpose of the Medium Access Control (MAC) sublayer.
Answer: The MAC sublayer is responsible for managing access to the shared transmission
medium in a data link layer, ensuring fair and collision-free transmission.
28. Question: What is the purpose of the Network layer in the OSI model?
Answer: The Network layer handles routing data packets across multiple networks to their
intended destination.

29. Question: Explain the difference between distance vector and link-state routing
algorithms.

YADAV SURYA | SYV SOLUTION


Answer: Distance vector routing uses the number of hops to determine the best path to a
destination, while link-state routing considers the state of all links to calculate the shortest
path.
30. Question: Describe the role of UDP (User Datagram Protocol) in transport layer
communication.
Answer: UDP is a connectionless transport layer protocol that provides fast and
lightweight data transmission without the reliability features of TCP.
31. Question: How does NAT (Network Address Translation) work?
Answer: NAT allows multiple devices in a private network to share a single public IP
address when connecting to the Internet, conserving public IP address space.
32. Question: What is a Domain Name System (DNS)?
Answer: DNS is a system that translates human-readable domain names (like
www.example.com) into their corresponding IP addresses (like 192.0.2.1).
33. Question: How does the World Wide Web (WWW) work?
Answer: The World Wide Web allows users to access and view multimedia web pages on
the internet using a web browser.
34. Question: Explain the purpose of HTTP (Hypertext Transfer Protocol).
Answer: HTTP is the protocol used for transmitting web pages and other resources on the
World Wide Web. It allows clients to request and receive web content from servers.
35. Question: What are the layers in the TCP/IP reference model?
Answer: The TCP/IP reference model has four layers: Application, Transport, Internet, and
Network Interface.
36. Question: What are the design issues in the Physical Layer of a network?
Answer: Design issues in the Physical Layer include choosing appropriate transmission
media, determining transmission rates, and managing signal encoding.
37. Question: Describe the purpose of the Data Link Layer in the OSI model.
Answer: The Data Link Layer is responsible for error detection and correction, as well as
managing access to the transmission medium.
38. Question: What are the different types of wireless transmission media?
Answer: Wireless transmission media include radio, microwave, infrared, and light
transmissions that do not require physical cables for data transmission.
39. Question: Explain the concept of full-duplex communication.
Answer: Full-duplex communication allows data to be transmitted simultaneously in both
directions, enabling faster and more efficient communication.

YADAV SURYA | SYV SOLUTION


40. Question: What are the various error detection and correction techniques used in the
Data Link Layer?
Answer: The Data Link Layer uses techniques like parity check, checksum, and CRC to
detect and correct errors in transmitted data frames.
41. Question: Describe the sliding window protocol and its advantages.
Answer: The sliding window protocol allows multiple frames to be sent consecutively
without waiting for acknowledgment, increasing network efficiency.
42. Question: How does the Medium Access Control (MAC) sublayer manage access to the
shared transmission medium?
Answer: The MAC sublayer uses multiple access protocols like ALOHA and Carrier Sense
Multiple Access (CSMA) to manage access to the medium without collisions.
44. Question: Explain the concept of distance vector routing.
Answer: Distance vector routing uses the number of hops (distances) to determine the
best path to a destination node.
45. Question: How does the Internet's Network Layer perform congestion control?
Answer: The Internet's Network Layer uses various congestion control algorithms to
manage traffic and prevent network congestion.
46. Question: What are the elements of Transport protocols?
Answer: The elements of Transport protocols include error control, flow control, and
congestion control mechanisms.
47. Question: What is the difference between UDP and TCP protocols?
Answer: UDP is a connectionless protocol that does not provide reliability, while TCP is a
connection-oriented protocol that ensures reliable data delivery.
51. Question: What are the layers in the OSI reference model?
Answer: The OSI reference model has seven layers: Physical, Data Link, Network,
Transport, Session, Presentation, and Application.
53. Question: How does the Data Link Layer handle error detection and correction?
Answer: The Data Link Layer uses techniques like CRC (Cyclic Redundancy Check) and
checksum to detect and correct errors in transmitted data frames.
54. Question: Describe the operation of the ALOHA multiple access protocol.
Answer: ALOHA is a random access protocol where devices transmit data whenever they
have data to send, without waiting for a specific time slot. It can lead to collisions.
55. Question: What is the purpose of the ARPANET network?

YADAV SURYA | SYV SOLUTION


Answer: ARPANET was one of the first operational computer networks and a precursor to
the modern Internet. It was developed by the U.S. Department of Defense's Advanced
Research Projects Agency (ARPA).
56. Question: Explain the concept of wireless LANs.
Answer: Wireless LANs use wireless communication technologies like Wi-Fi to connect
devices within a local area without the need for physical cables.
58. Question: What is the purpose of the subnet mask?
Answer: The subnet mask helps identify the network and host portions of an IP address,
enabling routers to determine how to route packets to their destinations.
61. Question: What is the purpose of the Session Layer in the OSI model?
Answer: The Session Layer establishes, maintains, and terminates communication sessions
between applications on different devices.
62. Question: Describe the different types of transmission media used in the Physical
Layer.
Answer: The Physical Layer uses various transmission media, including guided media like
twisted pairs, coaxial cables, and fiber optics, as well as wireless media like radio,
microwave, infrared, and light transmissions.
63. Question: How does the Data Link Layer handle flow control?
Answer: The Data Link Layer uses flow control mechanisms to regulate the flow of data
between devices to prevent buffer overflows and ensure smooth data transmission.
64. Question: Explain the concept of carrier sense multiple access (CSMA) protocols.
Answer: CSMA protocols allow devices to listen to the transmission medium before
sending data to avoid collisions. Devices only transmit data when the medium is idle.
65. Question: What are the services provided by the Internet's Network Layer?
Answer: The Network Layer provides services like packet forwarding, routing, and handling
congestion control to ensure efficient data delivery across networks.
66. Question: Describe the concept of shortest path routing.
Answer: Shortest path routing finds the path with the fewest hops or the lowest metric to
the destination node.
67. Question: How does the Transport Layer handle error control?
Answer: The Transport Layer uses mechanisms like sequence numbers and
acknowledgments to ensure error-free and reliable data delivery.
68. Question: Explain the purpose of NAT (Network Address Translation) in detail.

YADAV SURYA | SYV SOLUTION


Answer: NAT allows multiple devices in a private network to share a single public IP
address when connecting to the Internet. It also provides a level of security by hiding
internal IP addresses from external networks.
69. Question: Describe the process of DNS resolution in detail.
Answer: DNS resolution involves a client requesting the IP address for a given domain
name from DNS servers, which respond with the corresponding IP address.
70. Question: How does HTTP enable communication between web browsers and web
servers?
Answer: HTTP allows web browsers to send requests to web servers for specific web pages
or resources and receive the requested content as responses.
72. Question: Explain the purpose of the Network Interface layer in the TCP/IP model.
Answer: The Network Interface layer is responsible for handling the interface between the
physical network and the network software.
73. Question: Describe the different types of network topologies used in LANs and WANs.
Answer: LAN topologies include star, bus, ring, and mesh, while WAN topologies can be
point-to-point, hub-and-spoke, or fully-meshed.
74. Question: What is the purpose of routing algorithms in the Network Layer?
Answer: Routing algorithms determine the best path for data packets to reach their
destination efficiently.
75. Question: Compare the services provided by TCP and UDP in the Transport Layer.
Answer: TCP provides reliable, connection-oriented services, whereas UDP provides
connectionless and unreliable services with lower overhead.
76. Question: How do electronic mail protocols, such as SMTP and POP3, enable email
communication?
Answer: SMTP (Simple Mail Transfer Protocol) is used for sending email, and POP3 (Post
Office Protocol version 3) is used for receiving email from mail servers.
77. Question: Describe the components and architecture of the Domain Name System
(DNS).
Answer: DNS consists of DNS servers, DNS resolvers, and DNS zones. It uses a hierarchical
architecture to store and distribute domain name information.
78. Question: Explain the role of the Presentation Layer in the OSI model.
Answer: The Presentation Layer is responsible for data encryption, data compression, and
data format conversion to ensure interoperability between different systems.

YADAV SURYA | SYV SOLUTION


79. Question: How does the transport layer establish and terminate connections in TCP
and UDP?
Answer: In TCP, connections are established through a three-way handshake (SYN, SYN-
ACK, ACK), while in UDP, no connection setup is required.
80. Question: Describe the purpose of the Wide Area Network (WAN) and its applications.
Answer: WANs connect devices over long distances, enabling communication between
geographically separated locations, such as different offices or cities.
81. Question: What is a Metropolitan Area Network (MAN)?
Answer: A Metropolitan Area Network (MAN) is a network that covers a larger
geographical area, typically a city or a metropolitan region, connecting multiple LANs
together.
82. Question: Describe the concept of Wide Area Networks (WANs).
Answer: Wide Area Networks (WANs) connect devices over long distances, enabling
communication between geographically separated locations, such as different offices or
cities.
83. Question: What is an Internetwork or an Internet?
Answer: An Internetwork, commonly referred to as the Internet, is a global network of
networks that interconnects various devices and allows worldwide communication and
resource sharing.
84. Question: What are the design issues for the layers in the OSI model?
Answer: The design issues for each layer in the OSI model involve defining the services
provided by the layer, its interfaces, and the protocols used for communication between
layers.
85. Question: Explain the difference between connection-oriented and connectionless
services.
Answer: Connection-oriented services establish a logical connection before data
transmission, ensuring reliability and ordered delivery. Connectionless services do not
establish a connection and are faster but may not guarantee reliability.
86. Question: Describe the concept of protocol hierarchies and how they aid in network
communication.
Answer: Protocol hierarchies are a systematic arrangement of protocols in layers. Each
layer performs specific functions, and the hierarchical approach simplifies network design,
maintenance, and upgrades.
87. Question: What are the service primitives in network communication?

YADAV SURYA | SYV SOLUTION


Answer: Service primitives are the basic operations that the layers in a network model can
request or provide to the layers above and below them to facilitate communication.
89. Question: What are the key differences between guided and wireless transmission
media?
Answer: Guided transmission media use physical cables to guide data signals, while
wireless transmission media use electromagnetic waves to transmit data without cables.
90. Question: Describe the different types of guided transmission media used in networks.
Answer: Guided transmission media include twisted pairs, coaxial cables, fiber optics, and
power lines.
91. Question: Explain the purpose of the Network Interface layer in the TCP/IP model.
Answer: The Network Interface layer handles the interface between the physical network
and the network software, encapsulating IP packets into frames for transmission.
92. Question: What are the elementary data link protocols? Provide an example of each.
Answer: Elementary data link protocols include utopian simplex protocol and simplex
stop-and-wait protocol.
93. Question: How does the sliding window protocol improve data transmission efficiency?
Answer: The sliding window protocol allows multiple frames to be sent consecutively
without waiting for acknowledgment, increasing network efficiency.
94. Question: Compare the multiple access protocols ALOHA and Carrier Sense Multiple
Access (CSMA).
Answer: ALOHA is a random access protocol where devices transmit data whenever they
have data to send, while CSMA listens to the medium before transmitting.
95. Question: Explain the architecture and protocol stack of IEEE 802.11 wireless LANs.
Answer: IEEE 802.11 wireless LANs have multiple protocol layers, including physical layer,
data link layer, and frame structure.
96. Question: What is the purpose of the Transport Layer in the OSI model?
Answer: The Transport Layer provides end-to-end communication and ensures reliable
data delivery between two hosts.
97. Question: Compare the TCP and UDP protocols in terms of reliability and overhead.
Answer: TCP is reliable but has higher overhead due to connection establishment and
error recovery. UDP is less reliable but has lower overhead.
98. Question: Describe the role of the Domain Name System (DNS) in electronic mail
services.

YADAV SURYA | SYV SOLUTION


Answer: DNS is used to resolve the domain names of mail servers, allowing email clients
to send messages to the correct servers.
99. Question: Explain the role of the World Wide Web (WWW) in modern internet usage.
Answer: The World Wide Web allows users to access and view multimedia web pages on
the internet using a web browser.
100. Question: What is the purpose of HTTP (Hypertext Transfer Protocol) in web
communication?
Answer: HTTP is the protocol used for transmitting web pages and other resources on the
World Wide Web. It allows clients to request and receive web pages from web servers.

GTU MCA SEM 2 Practical Related Viva Question With Answer

**1. Python Program to Print Hostname and IP Address of Local Host:**


Question: What is the purpose of this Python program?
Answer: The purpose of this program is to retrieve and display the hostname and IP address
of the local host, where the program is running.
Question: How can you obtain the hostname of the local host in Python?
Answer: The `socket.gethostname()` function from the `socket` module is used to retrieve
the hostname of the local host.
Question: How does the program display the IP address of the local host?
Answer: The `socket.gethostbyname()` function is used to retrieve the IP address
corresponding to the hostname of the local host.
**2. Python Program to Print Hostname and IP Address of Remote Host (using IP
address):**
Question: What does this program do differently from the previous one?
Answer: This program prints the hostname and IP address of a remote host when the IP
address of that remote host is provided.
Question: How does the program retrieve the hostname of the remote host using its IP
address?
Answer: The `socket.gethostbyaddr()` function is used to obtain the hostname of the remote
host when its IP address is available.
**3. Python Program to Print Hostname and IP Address of Remote Host (using
hostname):**

YADAV SURYA | SYV SOLUTION


Question: What is the main difference between this program and the previous one?
Answer: This program prints the hostname and IP address of a remote host when the
hostname of that remote host is provided.
Question: How does the program retrieve the IP address of the remote host using its
hostname?
Answer: The `socket.gethostbyname()` function is used to obtain the IP address of the
remote host when its hostname is available.
**4. TCP Port Scanner Program for Local Host:**
Question: What is the purpose of this Python program?
Answer: The purpose of this program is to scan for open TCP ports on the local host to check
their status (open or closed).
Question: Why should this program not be used to scan remote hosts outside your
domain?
Answer: Scanning remote hosts without permission is considered unauthorized access and
may violate ethical guidelines and lead to legal consequences.
**5. UDP Port Scanner Program for Local Host:**
Question: What is the primary difference between a TCP port scanner and a UDP port
scanner?
Answer: A TCP port scanner checks the status of TCP ports, while a UDP port scanner checks
the status of UDP ports on the local host.
**6. TCP-based Client-Server Program with Hostname and IP Address Display:**
Question: Explain the functionality of this Python program.
Answer: This program implements a TCP-based client-server model where the server
displays its hostname, IP address, and port number, and the client displays a message sent
by the server.
Question: How does the server obtain its hostname and IP address?
Answer: The server uses `socket.gethostname()` to retrieve its hostname and
`socket.getsockname()` to get its IP address and port number.
Question: What message does the server send back to the client, and how does the client
display it?
Answer: The server sends the message "Thanks for Connecting!" back to the client, and the
client receives and displays this message on the screen.
**UDP-based Client-Server Program:**
1. Question: What is the purpose of the UDP-based client-server program?

YADAV SURYA | SYV SOLUTION


Answer: The UDP-based client-server program allows communication between a client and
a server using the User Datagram Protocol (UDP), which provides connectionless
communication with minimal overhead.
2. Question: How does the server display its hostname, IP address, and port number?
Answer: The server can use `socket.gethostname()` to get its hostname,
`socket.getsockname()` to get its IP address and port number.
3. Question: How can the server display the IP address and port number of the client
sending a dummy message?
Answer: Upon receiving a message from a client, the server can use `client_address =
(client_ip, client_port)` to get the client's IP address and port number from the received
datagram.
4. Question: What message does the server send back to the client, and how does the
client display it?
Answer: The server sends the message "Thanks for Message!" back to the client. The client
receives and displays this message on the screen.
**TCP-based Echo Client-Server Program:**
5. Question: Explain the functionality of the TCP-based echo client-server program.
Answer: The TCP-based echo client-server program allows the client to send a message to
the server, and the server echoes the same message back to the client.
6. Question: How does the client connect to the server in a TCP-based echo program?
Answer: The client uses the `socket.connect()` method to establish a connection to the
server's IP address and port number.
7. Question: How does the server receive the message from the client and send it back as
an echo?
Answer: The server uses `socket.recv()` to receive the data sent by the client and
`socket.sendall()` to send the data back as an echo.
**UDP-based Daytime Client-Server Program:**
8. Question: What is the purpose of the UDP-based daytime client-server program?
Answer: The UDP-based daytime client-server program allows the client to request and
receive the current date and time from the server.
9. Question: How does the client request the date and time from the server?
Answer: The client sends a specific message to the server requesting the current date and
time.

YADAV SURYA | SYV SOLUTION


10. Question: How does the server respond to the client's request in the UDP-based
daytime program?
Answer: The server processes the client's request, obtains the current date and time, and
sends it back to the client as a response.
**TCP-based Client-Server Text Chat Program:**
11. Question: Explain how the TCP-based client-server text chat program enables text
communication between clients.
Answer: The program uses a single server to handle multiple client connections. Clients
send messages to the server, which relays them to other connected clients, enabling text
chat among them.
12. Question: How does the server distinguish between different clients' messages in the
text chat program?
Answer: The server assigns a unique identifier or username to each client when they
connect, so it can identify and differentiate messages from different clients.
**UDP-based Client-Server Text Chat Program:**
13. Question: What is the primary difference between the TCP-based and UDP-based text
chat programs?
Answer: In the UDP-based text chat program, communication is connectionless, and
messages are sent as datagrams, making it suitable for scenarios where real-time
communication is essential, but reliability is not critical.
**TCP-based Echo Client-Server Program with Multi-threaded Server:**
14. Question: Why is a multi-threaded server preferred in a TCP-based echo program?
Answer: A multi-threaded server can handle multiple client connections simultaneously,
allowing concurrent processing of client requests without blocking other clients.
**TCP-based Daytime Client-Server Program with Multi-threaded Server:**
15. Question: How does the multi-threaded server manage multiple client connections in a
TCP-based daytime program?
Answer: Each client connection is managed in a separate thread, enabling the server to
serve multiple clients concurrently.
**Web Client using urllib:**

16. Question: How can the web client using urllib display the HTML source of a given URL
on the screen?

YADAV SURYA | SYV SOLUTION


Answer: The web client uses `urllib.request.urlopen()` to fetch the HTML source from the
given URL and then prints it on the screen.
17. Question: What method in urllib allows the display of the header information
transmitted in the HTTP response?
Answer: The `info()` method of the HTTP response object from `urllib.request.urlopen()`
provides the header information.
**FTP Client using ftplib:**
18. Question: What is the purpose of the `ftplib` library in Python?
Answer: The `ftplib` library provides functionalities to interact with FTP servers, allowing
users to download and upload files.
19. Question: How can the FTP client using ftplib display the directory list from the FTP
server?
Answer: The client uses `ftp.dir()` or `ftp.nlst()` to fetch the directory listing from the FTP
server.
**Python program for HTTP Protocol:**
20. Question: How does the Python program make a connection to a web server using the
HTTP protocol?
Answer: The program uses `urllib.request.urlopen()` to make an HTTP connection to the
web server.
21. Question: What is the primary difference between the HTTP and FTP client programs?
Answer: The HTTP client program interacts with web servers to retrieve web pages or
resources, while the FTP client program interacts with FTP servers to download and upload
files.
22. Question: How can you ensure that the HTTP client program successfully retrieves and
displays a document from the web server?
Answer: The HTTP client program should handle exceptions and check the HTTP response
code to ensure that the retrieval was successful before displaying the document.
**Web Server-Client Program:**
23. Question: Explain how you would implement a simple web server-client program using
Python.
Answer: For a simple web server-client program, you can use Python's `socket` module to
create a server and client that can communicate over the network.
24. Question: What is the difference between socket programming using multi-threading
and multi-processing in Python?

YADAV SURYA | SYV SOLUTION


Answer: Multi-threading uses multiple threads within a single process, while multi-
processing uses multiple processes, each having its memory space, making it more suitable
for CPU-bound tasks.
25. Question: What challenges might arise in a multi-threaded server in Python, and how
can you address them?
Answer: Challenges in a multi-threaded server include race conditions, deadlocks, and
resource sharing issues. Synchronization techniques like locks and semaphores can help
address them.
26. Question: Explain the steps involved in implementing a web client using Python's
`urllib` module.
Answer: To implement a web client, you use `urllib.request.urlopen()` to open a URL and
fetch data. Then, you can use `read()` to display the content of the fetched data.
27. Question: What are some potential issues when using Python's `urllib` to make web
requests?
Answer: Some potential issues include handling network errors, connection timeouts, and
server errors while making web requests.
**Socket Programming using Multi-threading:**
28. Question: Why is multi-threading beneficial in socket programming?
Answer: Multi-threading allows a server to handle multiple client connections
concurrently, ensuring efficient resource utilization and responsiveness.
29. Question: How does multi-threading work in Python's socket programming?
Answer: In Python, the `threading` module is used to create and manage threads for
handling client connections in socket programming.
30. Question: What is the difference between a multi-threaded server and a single-
threaded server in socket programming?
Answer: A multi-threaded server can handle multiple clients simultaneously, while a
single-threaded server can only handle one client at a time, potentially leading to delays.

YADAV SURYA | SYV SOLUTION

You might also like