JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech III NETWORK PROGRAMMING Previous Question Paper (February - 2023 - R18)

B.Tech | III | II | R18 | February - 2023

Answer PaperPaper Code: 156CAMaximum Marks: 75Time: 3 Hours

Note: Part A is compulsory (25 Marks). Answer all questions. Part B (50 Marks), Answer any one question from each unit.

Part A

1.a

Define concurrent server.

2 marks

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(), or epoll() to monitor multiple file descriptors simultaneously within a single process.
1.b

Write a program to determine the host byte order.

3 marks

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 val is initialized to 1.
  • A char pointer ptr is used to point to the first byte of the memory occupied by val.
  • 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.
1.c

Write a function of shutdown of a server host.

2 marks

Answer

Sign in to view the complete answer paper.

1.d

What is the need of I/O model?

3 marks

Answer

Sign in to view the complete answer paper.

1.e

What is the use of Ancillary Data?

2 marks

Answer

Sign in to view the complete answer paper.

1.f

What is the syntax of setsockopt( )?

3 marks

Answer

Sign in to view the complete answer paper.

1.g

What is uname( ) function?

2 marks

Answer

Sign in to view the complete answer paper.

1.h

Differentiate between unicast and multicast addressing.

3 marks

Answer

Sign in to view the complete answer paper.

1.i

What is the significance of ping program?

2 marks

Answer

Sign in to view the complete answer paper.

1.j

How are pseudo terminals different from control terminals?

3 marks

Answer

Sign in to view the complete answer paper.

Part B

2

Describe any 5 elementary TCP socket functions.

10 marks

Answer

Sign in to view the complete answer paper.

OR
310 marks
a

Describe the four way handshaking mechanism in TCP connection establishment.

5 marks

Answer

Sign in to view the complete answer paper.

b

Explain about the standard internet services.

5 marks

Answer

Sign in to view the complete answer paper.

4

Differentiate between synchronous and asynchronous I/O models.

10 marks

Answer

Sign in to view the complete answer paper.

OR
5

Explain about the shutdown function and poll function.

10 marks

Answer

Sign in to view the complete answer paper.

6

Explain IPV6 and ICMPV6 socket options in detail.

10 marks

Answer

Sign in to view the complete answer paper.

OR
710 marks
a

What are the different socket states in a network communication?

5 marks

Answer

Sign in to view the complete answer paper.

b

How to modify the socket's behavior in response to error conditions?

5 marks

Answer

Sign in to view the complete answer paper.

810 marks
a

Write a program that creates a daemon process using the daemon_init() function, which logs messages using the syslog() function and the syslogd daemon.

5 marks

Answer

Sign in to view the complete answer paper.

b

Explain about the Multicast Socket Options.

5 marks

Answer

Sign in to view the complete answer paper.

OR
910 marks
a

How does the Simple Network Time Protocol (SNTP) is used in multicasting for time synchronization of a network?

5 marks

Answer

Sign in to view the complete answer paper.

b

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.

5 marks

Answer

Sign in to view the complete answer paper.

1010 marks
a

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.

5 marks

Answer

Sign in to view the complete answer paper.

b

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.

5 marks

Answer

Sign in to view the complete answer paper.

OR
1110 marks
a

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?

5 marks

Answer

Sign in to view the complete answer paper.

b

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.

5 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of NETWORK PROGRAMMING from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for B.Tech CSE III II, February - 2023, R18.

For the question paper without answers, switch to the Question Paper tab.

Other papers in NETWORK PROGRAMMING

Loading Question Papers

Fetching data from database...