JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech III NETWORK PROGRAMMING Previous Question Paper (February - 2023 - R18)
Note: Part A is compulsory (25 Marks). Answer all questions. Part B (50 Marks), Answer any one question from each unit.
Part A
Define concurrent server.
Answer
A concurrent server is a network server architecture designed to handle multiple client requests simultaneously rather than processing them sequentially. Instead of blocking the main server process while waiting for a single client to finish its task, the server employs concurrency mechanisms to manage multiple connections in parallel.
The typical operation of a concurrent server involves the following steps:
- The server process listens for incoming connection requests on a well-known port.
- Upon receiving a request, the server accepts the connection and immediately spawns a separate child process or thread to handle the specific client session.
- The parent process returns to the listening state to accept new incoming connections, while the child process handles the communication with the assigned client.
- This approach significantly improves server throughput and responsiveness, as the server does not remain idle while waiting for I/O operations from a single client.
Common techniques used to implement concurrent servers include:
- Multi-processing: Using the
fork()system call to create a new process for each client. - Multi-threading: Using libraries like POSIX threads (pthreads) to create lightweight execution units within the same process space.
- I/O Multiplexing: Using system calls like
select(),poll(), orepoll()to monitor multiple file descriptors simultaneously within a single process.
Write a program to determine the host byte order.
Answer
To determine the host byte order, one must check how a multi-byte integer is stored in memory. By storing a known value, such as 0x0001, in a 2-byte integer and inspecting the first byte in memory, we can identify whether the system is Little-Endian (where the least significant byte is stored at the lowest address) or Big-Endian (where the most significant byte is stored at the lowest address).
The following C program demonstrates this:
#include <stdio.h>
int main() {
unsigned short val = 0x0001;
char *ptr = (char *)&val;
if (*ptr == 1) {
printf("Host byte order is Little-Endian\n");
} else {
printf("Host byte order is Big-Endian\n");
}
return 0;
}In this program:
- A 16-bit integer
valis initialized to 1. - A
charpointerptris used to point to the first byte of the memory occupied byval. - If the system is Little-Endian, the byte at the lowest address will be 0x01.
- If the system is Big-Endian, the byte at the lowest address will be 0x00.
Write a function of shutdown of a server host.
Answer
Sign in to view the complete answer paper.
What is the need of I/O model?
Answer
Sign in to view the complete answer paper.
What is the use of Ancillary Data?
Answer
Sign in to view the complete answer paper.
What is the syntax of setsockopt( )?
Answer
Sign in to view the complete answer paper.
What is uname( ) function?
Answer
Sign in to view the complete answer paper.
Differentiate between unicast and multicast addressing.
Answer
Sign in to view the complete answer paper.
What is the significance of ping program?
Answer
Sign in to view the complete answer paper.
How are pseudo terminals different from control terminals?
Answer
Sign in to view the complete answer paper.
Part B
Describe any 5 elementary TCP socket functions.
Answer
Sign in to view the complete answer paper.
Describe the four way handshaking mechanism in TCP connection establishment.
Answer
Sign in to view the complete answer paper.
Explain about the standard internet services.
Answer
Sign in to view the complete answer paper.
Differentiate between synchronous and asynchronous I/O models.
Answer
Sign in to view the complete answer paper.
Explain about the shutdown function and poll function.
Answer
Sign in to view the complete answer paper.
Explain IPV6 and ICMPV6 socket options in detail.
Answer
Sign in to view the complete answer paper.
What are the different socket states in a network communication?
Answer
Sign in to view the complete answer paper.
How to modify the socket's behavior in response to error conditions?
Answer
Sign in to view the complete answer paper.
Write a program that creates a daemon process using the daemon_init() function, which logs messages using the syslog() function and the syslogd daemon.
Answer
Sign in to view the complete answer paper.
Explain about the Multicast Socket Options.
Answer
Sign in to view the complete answer paper.
How does the Simple Network Time Protocol (SNTP) is used in multicasting for time synchronization of a network?
Answer
Sign in to view the complete answer paper.
What is a daemon process and how does it differ from a normal process in a Unix operating system? What mechanism does DNS employ to efficiently return the IP address for the given domain name.
Answer
Sign in to view the complete answer paper.
What are terminal modes and control terminals, and how can they be set and manipulated in a program to control the behavior of a terminal and interact with processes running in the foreground and background of the program.
Answer
Sign in to view the complete answer paper.
What is the rlogin program and how does it provide remote login capabilities, allowing a user to log into a remote machine and interact with its shell as if they were directly connected to the machine.
Answer
Sign in to view the complete answer paper.
What are the benefits of using a packet capture library when working with network packets, and how does it provide an easy and efficient way to analyze and manipulate network traffic?
Answer
Sign in to view the complete answer paper.
What is the purpose of the traceroute program and how does it work to determine the route taken by packets from a from source to destination in a network.
Answer
Sign in to view the complete answer paper.