BCS 052 Solved Assignment (Incomplete) 2021-22 PDF

Title BCS 052 Solved Assignment (Incomplete) 2021-22
Author Soham Gidwani
Course Network Programming and Administration
Institution Indira Gandhi National Open University
Pages 10
File Size 175.2 KB
File Type PDF
Total Downloads 375
Total Views 948

Summary

Q1)A) BLANK PAGEB) By examining the first few bits of an address, IP software can quickly determine the class, therefore the structure, of an address.  Class A: o If the first bit of the IP address is 0, it is the address of a class A network o The first bit identifies the class, the next 7 identif...


Description

Q1) A) BLANK PAGE B) -

-

-

By examining the first few bits of an address, IP software can quickly determine the class, therefore the structure, of an address.  Class A: o If the first bit of the IP address is 0, it is the address of a class A network o The first bit identifies the class, the next 7 identify the network, and the last 24 identify the host o There are fewer than the 128 class A networks but each network can be composed of millions of hosts Class B o The first 2 bits are 10 o First 2 bits identify the class, the next 14 identify the network, and the last 16 identify the host o Thousands of class B networks each of thousands of hosts Class C o First 3 bits are 110 o

-

-

o Class D o o o Class E o o o

First 3 bits identify the class, the next 21 identify the network, and the last 8 identify the host Millions of class C networks each of 254 hosts First 4 bits are 1110, it is a multicast address They don’t really refer to specific networks Multicast addresses are used to address groups of computers all at once If the first 4 bits are 1111, it is a special reserved address They don’t really refer to specific networks No numbers are currently assigned in this range

Q2) -

IP datagram format diagram on Block 1 Unit 1 Page 16 HLEN (4 bits) o It is needed because length of header is variable. o When the header size is 20 bytes, its value is 5 (5*4=20). With options, the maximum size is 60 bytes, when the value is 15 (15*4=60). o Each value represents number of 32-bit words.

-

Fragmentation Offset (13 bits)

o

It is a pointer that indicates the offset of the fragment in the original datagram before fragmentation.

Q3) BLANK PaGE Q4) Some of popular web servers are: -

-

-

Apache HTTP Server o Apache powers 52% of all websites globally, and is by far the most popular web server. o It uses a modular architecture, in which extra modules can be loaded to extend its features. For example, loading the mod_proxy will allow for a proxy/gateway on your server, and mod_proxy_balancer will enable load balancing for all supported protocols. o It benefits from great documentation and integrated support from other software projects. Nginx o NGINX relies on an asynchronous event-driven architecture to help power its goal of handling massive concurrent sessions. o It has become a very popular web server among administrators due to its light resource utilization and its ability to scale easily. o It can not only be deployed as web server, but also as proxy server or load-balancer. Microsoft IIS Server Jetty Lighthttpd

Q5) -

Disk management is an activity to manage the drives installed in a computer like hard disk drives (internal and external), optical disk drives, and flash drives. Following are some of the disk management functions: Create partitions, logical drives, and volumes Delete partitions, logical drives, and volumes Format partitions and volumes Mark partitions as active Assign or modify drive letters for hard disk volumes, removable disk drives, and CD-ROM drives Obtain a quick visual overview of the properties of all disks and volumes in the system Create mounted drives on system using the NTFS file system Convert basic disks to dynamic disks Convert dynamic to basic disks, although this is a destructive operation On dynamic disks, create a number of specialty volumes including spanned, striped, mirrored, and RAID-5 volumes

Q6) System Accounts - BLANK PaGE

Password Policy -

-

Password policy implementation is very essential to secure accounts and at the same time secure the systems, the network and the services. The following are some of the parameters to be enforced as part of setting a password policy: o Enforce password history o Maximum password age o Minimum password age o Minimum password length o Password strength (must meet complexity requirements) Password strength setting determines whether passwords must meet a series of guidelines that are considered important for a strong password.

Q7) Secure Shell (SSH) -

-

SSH is a proprietary cryptographic network tool for secure data communication between two networked computers that connects, via a secure channel over an insecure network, a server and a client. The best-known application of the tool is for access to shell accounts in Unix-like operating systems. SSH is generally used to log into a remote machine and execute commands. It also supports tunneling, forward TCP ports, X11 connections, file transfers, etc. SSH is important in cloud computing to solve connectivity problems, avoiding the security issues of exposing a cloud-based virtual machine directly on the internet. An SSH tunnel can provide a secure path over the internet, through a firewall to a virtual machine.

Telnet -

Telnet is used to connect a remote computer over network. It provides a bidirectional interactive text-oriented communication facility using a virtual terminal connection on internet or local area networks. Telnet provides a command line interface on a remote host. Telnet is used to establish a connection to Transmission Control Protocol (TCP) on port number 23, where a Telnet server application (telnetd) is listening. Experts in computer security, recommend that the use of Telnet for remote logins should be discontinued under all normal circumstances.

Q8) The following are most commonly employed ICMP message types -

Destination Unreachable: o This message indicates that a packet cannot be delivered because host is unreachable.

Reasons may be host or network is unreachable or unknown, protocol or port is unknown or unstable Echo and Echo Reply o These messages are used to check whether hosts are reachable on the network o One host sends Echo and receiving host responds with an Echo reply o The messages are the basis for the Ping command Source Quench TTL Exceeded Timestamp and Timestamp Reply o

-

Q9) Client.c

#include #include #include #include #include #include #include #include

#define LINES 128 #define PORT 7200

int main(int argc, char *argv[]) { int sockfd, bytesent, bytrec; struct sockaddr_in ser_addr, echo_addr; socklen_t len=sizeof(ser_addr); char sendline[LINES], recvline[LINES+1];

if((sockfd=socket(AF_INET, SOCK_DGRAM, 0)) < 0) { perror("socket error");

exit(1); }

/* fill address completely with 0's */ memset(&ser_addr, '\0', sizeof(ser_addr)); ser_addr.sin_family = AF_INET; ser_addr.sin_addr.s_addr = htonl(INADDR_ANY); ser_addr.sin_port = htons(PORT);

while(1) { printf("==> "); fflush(stdout); fgets(sendline, LINES, stdin);

if(strcmp(sendline, "exit\n")==0) { break; }

bytesent = sendto(sockfd, sendline, strlen(sendline), 0, (struct sockaddr *) &ser_addr, sizeof(ser_addr)); if(bytesent == -1) { perror("sendto error"); exit(1); }

if(strcmp(sendline, "Terminate\n") != 0) { if( (bytrec = recvfrom(sockfd, recvline, LINES, 0, (struct sockaddr *) &echo_addr, &len)) < 0) { perror("recvfrom error"); exit(1);

} recvline[bytrec] = '\0'; printf("From server: %s\n", recvline); } else { printf("Server is terminated.\n"); break; } } close(sockfd); printf("Echo Client Normal End\n"); return 0;

}

Server.c #include #include #include #include #include #include #include #include

#define LINES 128 #define PORT 7200

int main(int argc, char *argv[]) { int sockfd, byterec; struct sockaddr_in ser_addr, cli_addr;

socklen_t len=sizeof(cli_addr); char recvline[LINES+1];

if((sockfd=socket(AF_INET, SOCK_DGRAM, 0)) < 0) { perror("socket error"); exit(1); }

memset(&ser_addr, '\0', sizeof(ser_addr)); ser_addr.sin_family = AF_INET; ser_addr.sin_addr.s_addr = htonl(INADDR_ANY); ser_addr.sin_port = htons(PORT);

bind(sockfd, (struct sockaddr *) &ser_addr, sizeof(ser_addr));

while(1) { if( (byterec=recvfrom(sockfd, recvline, LINES, 0, (struct sockaddr*) &cli_addr, &len)) < 0) { perror("recvfrom error"); exit(1); }

fprintf(stdout, "Connection from %s, port %d. Received %d bytes.\n", inet_ntoa(cli_addr.sin_addr), ntohs(cli_addr.sin_port), byterec); fflush(stdout); recvline[byterec] = '\0';

if(strcmp(recvline, "Terminate\n")==0) { fprintf(stdout, "A client wants me to terminate.\n"); fflush(stdout);

break; }

if( sendto(sockfd, recvline, byterec, 0, (struct sockaddr *)&cli_addr, len) < 0 ) { perror("sendto error"); exit(1); } }

close(sockfd); fprintf(stdout, "Server Normal End\n"); fflush(stdout); return 0; }

System calls for data transfer -

-

-

-

Read() o This used to receive data from the remote machine, it assumes that there is already an open connection present between two machines and is possible only in case of TCP. o Read(int sockfd, char void *buff, int buff_len) Write() o When we want to send some data to a process running on remote machine we use write() system call. o Write() assumes that connection is already open between sender and receiver machine, that’s why this is limited to process using TCP. o Write(int sockfd, const void *buff, int buff_len) Send() o The send() function initiates transmission of a message from the specified socket to its peer. o The send() function sends a message only when the socket is connected. o Send(int sockfd, char* buff, int nbytes, int flags) Sendto() o The sendto() function sends a message through a connection oriented or connectionless socket. o Sendto(int sockfd, char *buff, int nbytes, int flags, struct sockaddr * dest_addr, int addrlen)

-

-

Recv() o The recv() function receives a message from a socket. o The recv() call can be used on a connection oriented socket and connectionless socket. o Recv(int sockfd, char *buff, int nbytes, int flags) Recvfrom() o The recvfrom() system call receives a message from a socket and capture the address from which the data was sent. o Recvfrom(int sockfd, char* buff, int nbytes, int flags, struct sockaddr* from, int *addrlen)

Q10) -

A socket is referenced by an integer. That integer is called a socket descriptor.

Structure of a Socket: -

-

Diagram on Block 2 Unit 1 page 16 Local Address: Pointer to a buffer of type stuct sockaddr_in which contains the remote address to which the socket is bound o Sin_len o Sin_family o Sin_port o Sin_addr o Sin_zero[8] Family: The protocol group needed for the communication. Type: Indicates desired communication style of the socket. Protocol: Specifies a particular protocol to be used with the socket. Remote Address: Pointer to a buffer of type stuct sockaddr_in which contains the remote address to which the socket is bound o Sin_len o Sin_family o o o

Sin_port Sin_addr Sin_zero[8]

Q11) The following are the general rules to be followed when configuring NFS. -

-

Only export directories beneath / directory Do not export a subdirectory of a directory that has already been exported. The exception being when the subdirectory is on a different physical device. Likewise, do not export the parent of a subdirectory unless it is on a separate device. Only export local filesystems.

-

When mounting any file system on a directory, one should know that the original contents of the directory are ignored, or obscured, in favor of the files in the mounted filesystem. When the filesystem is unmounted, then the original files in the directory reappear unchanged.

Q12) The complete procedure of mapping a domain name to an IP address is as follows: -

Let us say a user opens a web browser and tries to connect to a website, say www.ignou.ac.in The operating system not knowing the IP address for www.ignou.ac.in, asks the ISP’s DNS Server for this information. The ISP’s DNS Server does not know this information, so it connects to a Root Server to find out what name server, running somewhere in the world knows the information about ignou.ac.in. The Root Server tells the ISP’s DNS Server to contact a particular name server that knows the information about ignou.ac.in. Thereafter, the ISP’s DNS server connects to IGNOU’s DNS server and asks for the IP address for www.ignou.ac.in. IGNOU’s DNS Server responds to the ISP’s DNS server with the appropriate IP address. The ISP’s DNS Server tells the User’s operating system the IP address for ignou.ac.in. The operating system tells the Web Browser the IP address for www.ignou.ac.in. The web browser connects and starts communication with www.ignou.ac.in.

Download Link: https://docs.google.com/document/d/1zO_IiObL4cSrHkEJDfCzGxIZoZ3-ZRnO/edit? usp=sharing&ouid=101687282440582388863&rtpof=true&sd=true...


Similar Free PDFs