BCS-052 ASSIGNMENT SOLUTION (2018-19

If you have any queries please leave a message here
Your Message
×


Question 1

(a) List and explain the role of various internetworking devices used at different layers of OSI model.

Answer : -

Repeater - When a signal is sent over a long network cable, signal gets weakened due to attenuation. This results in ever data getting lost in the way. In order to boost the data signal Repeaters are needed to amplify the weakened signal. They are like a small box that connects two segments of networks, refines and regenerate the digital signals on the cable and send them on their way.

Hub - If multiple incoming connections need to be connected with multiple outgoing connections, then a hub is required. In data communications, a hub is a place of convergence where data arrives from one or more directions and is forwarded out in one or more other directions. Hubs are multi-port repeaters, and as such they obey the same rules as repeaters. They operate at the OSI Model Physical Layer. Hubs are used to provide a physical Star Topology.

Bridge - Segmenting a large network with a network device has numerous benefits. Among these are reduced collisions (in an Ethernet network), contained bandwidth utilization, and the ability to filter out unwanted packets. Bridges ware created to allow network administrators to segment their networks transparently. This means that individual stations need not know whether there is a bridge separating them or not. It is up to the bridge to make sure that packets get properly forwarded to their destinations.
Bridges work at the Data Link Layer Since bridges wwork in the Data Link Layer they do not examine the network layer addresses. They just look at the MAC addresses and determine whether or not to forward or ignore a frame.

Switch - A switch is a device that incorporates bridge functions as well as point-to-point dedicated connections. They connect devices or networks, filter, forward and flood frames based on the MAC destination address of each frame. Switch operates at Data Link Layer of the OSI Model. They are technically called bridges.

Router - In an environment consisting of several network segments with different protocols and architecture, a bridge may not be adequate for ensuring fast communication among all of the segments. A complex network needs a device which not only knows the address of each segment, but also can determine the best path for sending data and filtering broadcast traffic to the local segment. Such a device is called a Router. Routers are both hardware and software devices. Router operates at the Network Layer of the OSI Model.

Modem - It is a device which is used to convert digital signals generated by the computer into analog signals to be carried by a public access telephone line. It is also the device that convarts the analog signal received over a phone line into digital signal usable by the computer. A Modem is also known as Modulator and Demodulator




(b) Differentiate between static and dynamic routing. Also, explain distance vector routing algorithm with the help of an example.

Answer : -

Differentiate between Static and Dynamic Routing -

  1. The routers are configured manually, and the table is also created manually in static routing whereas in dynamic routing the configuration and table creation is automatic and router driven.

  2. In static routing, the routes are user-defined while in dynamic routing the routes are updated as topology changes.

  3. Static routing does not employ complex algorithms. As against, dynamic routing uses the complex algorithm for calculating shortest path or route.

  4. Dynamic routing is suitable for large networks where the number of hosts is high. Conversely, static routing can be implemented in a small network.

  5. When a link fails in static routing, the rerouting is discontinued and requires manual intervention to route traffic. In contrast, link failure in dynamic routing does not disrupt rerouting.

  6. The message broadcast and multicast in dynamic routing makes it less secure. On the other hand, static routing does not involve advertisement which makes it more secure.

  7. Dynamic routing involves protocols such as RIP, EIGRP, BGP, etc. Inversely, static routing does not require such protocols.

  8. Static routing does not need any additional resources while dynamic routing requires additional resources such as memory, bandwidth, etc.


Distance-Vector Routing Algorithm -

A distance-vector routing algorithm, also called a Bellman-Ford algorithm is one where routes are selected based on the distance between networks. The distance metric is something simple-usually the number of hops, or routers, between them.

Routers using this type of protocol maintain information about the distance to all known networks in a table. They regularly send that table to each router they immediately connect with (their neighbors or peers). These routers then update their tables and send those tables to their neighbors. This causes distance information to propagate across the internetwork, so that eventually, each router obtains distance information about all networks on the internetwork.

Distance Vector Algorithm

  1. A router transmits its distance vector to each of its neighbors in a routing packet.

  2. Each router receives and saves the most recently received distance vector from each of its neighbors.

  3. A router recalculates its distance vector when :

    • It receives a distance vector from a neighbor containing different information than before.
    • It discovers that a link to a neighbor has gone down.

The Distance Vactor calculation is based on minimizing the cost to each destination.






Question 2

(a) Explain the working of 3 bit sliding window protocol with suitable example.

Answer : -




(b) Explain the use of different fields of UDP header format. Also, draw a diagram to illustrate the header format.

Answer : -


UDP Header Format

Field Name Size (bits) Description
Source Port
16 bits
The 16-bit port number of the process that originated the TCP segment on the source device. This will normally be an ephemeral (client) port number for a request sent by a client to a server, or a well-known/registered (server) port number for a reply from a server to a client.
Destination Port
16 bits
The 16-bit port number of the process that is the ultimate intended recipient of the message on the destination device. This will usually be a well-known/registered (server) port number for a client request, or an ephemeral (client) port number for a server reply.
Length
16 bits
The length of the entire UDP datagram, including both header and Data fields.
Checksum
16 bits
An optional 16-bit checksum computed over the entire UDP datagram plus a special pseudo header of fields
Data
Variable
The encapsulated higher-layer message that will be sent.






Question 3

(a) Compare GET and SET in SNMP.

Answer : - Simple Network Management Protocol (SNMP) is an application–layer protocol defined by the Internet Architecture Board (IAB) in RFC1157 for exchanging management information between network devices. It is a part of Transmission Control Protocol⁄Internet Protocol (TCP⁄IP) protocol suite.

SNMP is one of the widely accepted protocols to manage and monitor network elements. Most of the professional–grade network elements come with bundled SNMP agent. These agents have to be enabled and configured to communicate with the network management system (NMS).

SNMP consists of -

GET operation is used by the SNMP manager applications to retrieve one or more values from the managed objects maintained by the SNMP agent. The applications typically perform an SNMP GET request by providing the host name of the agent and one or more OIDs along with the specific instance of the OID. The agent responds with a return value or with an error.

SET operation is used by the managers to modify or assign the value of the Managed device.




(b) In class-ful addressing how is an IP address in class A, Class B and Class C divided?

Answer : - The classful IP addressing scheme divides the IP address space into five classes, A through E, of differing sizes. Classes A, B, and C are the most important ones, designated for conventional unicast addresses. Class D is reserved for IP multicasting, and Class E is reserved for experimental use.

Step 1 If the first bit is 0, then it is a Class A address.
If it is 1, continue to step 2.
Step 2 If the Second bit is 0, then it is a Class B address.
If it is 1, continue to step 3.
Step 3 If the third bit is 0, then it is a Class C address.
If it is 1, continue to step 4.
Step 4 If the fourth bit is 0, then it is a Class D address.
If it is 1, it is a Class E address.

IP Address
Class
First Octet of
IP Address
Lowest Value of First Octet (Binary)Highest Value of First Octet (Binary)Range of First Octet Values (Decimal)Theoretical
IP Address Range
Class A
0xxx xxxx
0000 0000
0111 1111
0 to 1270.0.0.0 to
127.255.255.255
Class B
10xx xxxx
1000 0000
1011 1111
128 to 191128.0.0.0 to
191.255.255.255
Class C
110x xxxx
1100 0000
1101 1111
192 to 223192.0.0.0 to
223.255.255.255
Class D
1110 xxxx
1110 0000
1110 1111
224 to 239224.0.0.0 to
239.255.255.255
Class E
1111 xxxx
1111 0000
1111 1111
240 to 255240.0.0.0 to
255.255.255.255




(c) Given the address 23.56.7.91 and the default class A mask, find the network address.

Answer : -

IP Address 23.56.7.91 representated in Dotted Decimal and Binary form

2356791
00010111 00011100 00000111 01011011

Default Subnet Mask of Class A representated in Dotted Decimal and Binary form

255000
11111111 00000000 00000000 00000000

After perform AND Operation between IP Address and Subnet Mask

23000
00010111 00000000 00000000 00000000

So, the network address is - 23.0.0.0




(d) Given the address 201.180.56.5 and the default class C mask, find the network address.

Answer : -

IP Address 201.180.56.5 representated in Dotted Decimal and Binary form

201180565
11001001 10110100 00111000 00000101

Default Subnet Mask of Class C representated in Dotted Decimal and Binary form

2552552550
11111111 11111111 11111111 00000000

After perform AND Operation between IP Address and Subnet Mask

201180560
11001001 10110100 00111000 00000000

So, the network address is - 201.180.56.0






Question 4

(a) What is the significance of switching in computer network? Compare and contrast different types switching methodologies.

Answer : -

Packet Switching - Packet switching is a digital network transmission process in which data is broken into suitable-sized pieces or blocks for fast and efficient transfer via different network devices. When a computer attempts to send a file to another computer, the file is broken into packets so that it can be sent across the network in the most efficient way. These packets are then routed by network devices to the destination.

Circuit Switching - A circuit-switched communication system involves three phases : circuit establishment (setting up dedicated links between the source and destination); data transfer (transmitting the data between the source and destination); and circuit disconnect (removing the dadicated links).

In circuit switching network dedicated channel has to be established before the call is made between users. The channel is reserved between the users till the connection is active. For half duplex communication, one channel is allocated and for full duplex communication, two channels are allocated. It is mainly used for voice communication.




(b) Write a client and a server program using C- language in Unix with the following specification.

  1. A UDP client will send a string to the server.
  2. Sever will send back the reverse of the given string to the respective client.

Answer : -

Server Side
/* Header-File declaration */
#include<sys/socket.h>
#include<sys/types.h>
#include<netinet/in.h>
#include<stdlib.h>
#include<string.h>
#include<stdio.h>
#include<strings.h>

#define PORT 50000
#define MAX 1024

/* main( ) function begin */
void main()
{
int sockfd, n, len;
char buffer[MAX];

struct sockaddr_in serveraddr, clientaddr;

/* Create the socket. The three arguments are : */
/* 1) Internet domain       2) Stream socket       3) Default protocol (UDP in this case) */
sockfd=socket(AF_INET,SOCK_DGRAM,0);
if(sockfd < 0)
{
printf(“Socket not created ”);
exit(-1);
}

memset(&serveraddr, 0, sizeof(serveraddr));
memset(&clientaddr, 0, sizeof(clientaddr));

/*---- Configure settings of the server address struct ----*/
/* Address family = Internet */
serveraddr.sin_family=AF_INET;
/* Set port number, using htons( ) function to use proper byte order */
Serveraddr.sin_port=htons(PORT);
/* Set server IP address */
Serveraddr.sin_addr.s_addr=INADDR_ANY;

/*---- Bind the address struct to the socket ----*/
if(bind(sockfd, (const struct sockaddr *) &serveraddr, sizeof(struct serveraddr)) < 0)
{
printf(“Error in bind ”);
exit(-1);
}

/*---- Receive data from client ----*/
n=recvfrom(sockfd, (char *)buffer, MAX, MSG_WAITALL, ( struct sockaddr *) &clientaddr, &len);
buffer[n] = '\0';

/*---- reverse the string which received from client ----*/
strrev(buffer);

/*---- Send data to client ----*/
sendto(sockfd, (const char *)buffer, strlen(buffer), MSG_CONFIRM, (const struct sockaddr *) &clientaddr, sizeof(clientaddr));
}



Client Side
/* Header-File declaration */
#include<sys/socket.h>
#include<sys/types.h>
#include<netinet/in.h>
#include<stdlib.h>
#include<string.h>
#include<stdio.h>
#include<strings.h>

#define PORT 50000
#define MAX 1024

/* main( ) function begin */
void main()
{
int sockfd, n, len;
char array[MAX], buffer[MAX];

struct sockaddr_in serveraddr;

printf("Enter the string...");
gets(array)

/* Create the socket. The three arguments are : */
/* 1) Internet domain       2) Stream socket       3) Default protocol (UDP in this case) */
sockfd=socket(AF_INET,SOCK_DGRAM,0);
if(sockfd < 0)
{
printf(“Socket not created ”);
exit(-1);
}

memset(&serveraddr, 0, sizeof(serveraddr));

/*---- Configure settings of the server address struct ----*/
/* Address family = Internet */
serveraddr.sin_family=AF_INET;
/* Set port number, using htons( ) function to use proper byte order */
Serveraddr.sin_port=htons(PORT);
/* Set server IP address */
Serveraddr.sin_addr.s_addr=INADDR_ANY;

/*---- Send data to client ----*/
sendto(sockfd, (const char *)array, strlen(array), MSG_CONFIRM, (const struct sockaddr *) &serveraddr, sizeof(serveraddr));

/*---- Receive data from client ----*/
n=recvfrom(sockfd, (char *)buffer, MAX, MSG_WAITALL, ( struct sockaddr *) &serveraddr, &len);
buffer[n] = '\0';
puts(buffer);
}


ABOUT US

QuestionSolves.com is an educational website that helps worldwide students in solving computer education related queries.

Also, different software like Visual Studio, SQL Server, Oracle etc. are available to download in different versions.

Moreover, QuestionSolves.com provides solutions to your questions and assignments also.


MORE TOPIC


Windows Command

UNIX Command

IGNOU Assignment Solution

IGNOU Question Paper Solution


WHAT WE DO


Website Devlopment

Training

Home Learning

Provide BCA, MCA Projects

Provide Assignment & Question Paper Solution


CONTACT US


Follow Us