0% found this document useful (0 votes)
29 views32 pages

CN Practicalneww File

Uploaded by

Shivam Raval
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)
29 views32 pages

CN Practicalneww File

Uploaded by

Shivam Raval
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/ 32

PRACTICAL -1

AIM: To Study Different Types of Topologie


Network Topology is the schematic description of a network arrangement, connecting
various nodes (sender and receiver) through lines of connection.
THERE ARE DIFFERENT TYPES OF TOPOLOGIES:
1) BUS TOPOLOGY: It is a network type in which every computer and network device is
connected to a single cable. When it has exactly two endpoints, then it is called Linear Bus
topology.

FEATURES:

• It transmits data only in one direction.

• Every device is connected to a single cable

ADVANTAGES:

• It is cost effective.

• Used in small networks.

• It is easy to understand.

• Easy to expand by joining two cables together.

DISADVANTAGES:

• Cables fail then the whole network fails.

• If network traffic is heavy then the performance of the network decreases.

• Cable has a limited length.

• It is slower than the ring topology.

Page | 2
2) RING TOPOLOGY: It is called ring topology because it forms a ring as each computer is
connected to another computer, with the last one connected to the first. Exactly two neighbours
for each device.

FEATURES:
• A number of repeaters are used and the transmission is unidirectional. •
Date is transferred in a sequential manner that is bit by bit

ADVANTAGES:

• Easy to install and reconfigure.

• Adding or deleting a device in-ring topology needs you to move only two connections.

• Failure of one computer can disturb the whole network.

• Offers equal access to all the computers of the networks

• Faster error checking and acknowledgment.

DISADVANTAGES:

• Unidirectional traffic.

• Break in a single ring can risk the breaking of the entire network

• Modern day high-speed LANs made this topology less popular.

• It is very difficult to troubleshoot the ring network.

• Adding or removing the computers can disturb the network activity.

Page | 3
3) STAR TOPOLOGY: In this type of topology all the computers are connected to a single
hub through a cable. This hub is the central node and all other nodes are connected to the central
node.

FEATURES:
• Every node has its own dedicated connection to the hub.

ADVANTAGES:

• Easy to troubleshoot, set up, and modify.

• Only those nodes are affected, that has failed. Other nodes still work.

• Fast performance with few nodes and very low network traffic.

• In Star topology, addition, deletion, and moving of the devices are easy.

DISADVANTAGES:

• Cost of installation is high.

• Expensive to use.

• If the hub fails then the whole network is stopped because all the nodes depend on the hub.

• Performance is based on the hub that is it depends on its capacity.

• Acts as a repeater for data flow.


• Can be used with twisted pair, Optical Fibre or coaxial cable

Page | 4
4) MESH TOPOLOGY: It is a point-to-point connection to other nodes or devices. All
the network nodes are connected to each other. Mesh has n(n-1)/2 physical channels to link n
devices.

Page | 5
TYPES:
1. Partial Mesh Topology: In this topology some of the systems are connected in the same
fashion as mesh topology but some devices are only connected to two or three devices.
2. Full Mesh Topology: Each and every node or device are connected to each other.

FEATURES:

• Fully connected.

• Robust.

• Not flexible.

ADVANTAGES:

• Each connection can carry its own data load.

• It is robust.

• Fault is diagnosed easily.

• Provides security and privacy.

DISADVANTAGES:

• Installation and configuration are difficult.

• Cabling cost is more.

• Bulk wiring is required.

5) TREE TOPOLOGY: It has a root node and all other nodes are connected to it forming
a hierarchy. It is also called hierarchical topology. It should at least have three levels to the
hierarchy.
Page | 6
FEATURES:
• Ideal if workstations are located in groups.
• Used in Wide Area Network.

ADVANTAGES:

• Extension of bus and star topologies.

• Expansion of nodes is possible and easy.

• Easily managed and maintained.

• Error detection is easily done.

DISADVANTAGES:

• Heavily cabled.

• Costly.

• Node maintenance is difficult.

• Central hub fails, network fails.

6) HYBRID TOPOLOGY: It is two different types of topologies which is a mixture of


two or more topologies. For example, if in an office in one department ring topology is used
and, in another star, topology is used, connecting these topologies will result in Hybrid
Topology

FEATURES:
• It is a combination of two or topologies
Page | 7
ADVANTAGES:

• Effective.

• Scalable as size can be increased easily.

• Flexible.

DISADVANTAGES:

• Complex in design.

• Costly.

• Inherits the advantages and disadvantages of the topologies included

PRACTICAL - 2

AIM: To Study Different Categories of Networks.

A computer network is an interconnected system of devices, represented as network nodes, that


share information, data and resources among each other.

Page | 8
PRACTICAL - 3
AIM: To study different types of transmission media.

Transmission media is a communication channel that carries the information from the sender
to the receiver. Data is transmitted through the electromagnetic signals. Transmission media
are of two types: -
1. Guided media - It is also referred to as Wired or Bounded transmission media. Signals being
transmitted are directed and confined in a narrow pathway by using physical links.
Features:
● High speed
● Secure
● Used for comparatively shorter distances
There are 3 types of Guided media:
I. Twisted Pair Cable - It consists of 2 separately insulated conductor wires wound about each
other. Generally, several such pairs are bundled together in a protective sheath. They are the
most widely used Transmission Media.
It is of two types:
a. Shielded Twisted Pair (STP)
b. Unshielded Twisted Pair (UTP)
Advantages -
● Best performance in short distances.
● If a portion of a twisted pair cable is broken it doesn’t affect the whole network.
● The twisted-pair cable is low in weight.
● Twisted pair cable is flexible to use
● Twisted Pair cable is easy to connect.

Disadvantages -
● It results in signal distortion in a very effective manner.
● It provides poor security and is relatively easy to tap.

Page | 15
● As they are thin, they can be easily breakable.
● Low durability (must be maintained regularly).
● Susceptible to electromagnetic interference (EMI).

II. Coaxial Cable - A coaxial cable is an electrical cable with a copper conductor and an
insulator shielding around it and a braided metal mesh that prevents signal interference and
crosstalk. Coaxial cable is also known as coax.
Advantages -
● Supports high bandwidth.
● Easy to install coaxial cables.
● More reliable and durable.

Disadvantages -
● They are expensive.
● It has multiple layers and it is very bulky.
● Single cable failure can disrupt the entire network

Applications -
● Ethernet LANs and also used in MANs.
● Televisions, CCTVs
● Video transmission

III. Fiber Optic Cable - An Optical Fiber is a cylindrical fiber of glass which is hair thin size
or any transparent dielectric medium. The fiber which is used for optical communication is
waveguides made of transparent dielectrics.
Advantages -
● Increased capacity and bandwidth
● Lightweight
● Less signal attenuation
● Immunity to electromagnetic interference
● Resistance to corrosive materials
● Supports multiple channels

Page | 16
Disadvantages -
● Difficult to install and maintain
● High cost
● Fragile
2. Unguided Media - It is also referred to as Wireless or Unbounded transmission media. No
physical medium is required for the transmission of electromagnetic signals.
Features:
The signal is broadcasted through air
Less Secure
Used for larger distances
There are 3 types of Signals transmitted through unguided media: -
I. Radio Waves - Radio waves are very low frequency electromagnetic waves that are
transmitted in all directions within the range. The range in frequencies of radio waves is
from 3 Khz to 1 Khz. Advantages -
● Radio waves are mainly used for Wide Area Networks (WAN) ● Suitable for longer
distance communications.
● Radio waves can penetrate well
● Radio transmission provides a higher transmission rate.

Disadvantages -
● It is uncertain and simple to tap communication.
● It gets affected by weather effects like rains, thunderstorms etc.
● Not possible to isolate the communication inside the building.

II. Microwaves - Microwave is a line-of-sight wireless communication technology that


uses high frequency beams of radio waves to provide high speed wireless connections
that can send and receive voice, video, and data information. Advantages -
● Cheaper than using cables.
● It is free from land acquisition as it does not require any land for the installation of
cables.
● Possible to implement in areas where cable transmission is difficult to implement such
as hill areas.
● Communication over oceans can be achieved by using microwave transmission.

Page | 17
Disadvantages -
● Not secure, susceptible to eavesdropping.
● Weather conditions can affect the transmission.
● Limited bandwidth.

III. Infrared waves - Infrared waves are used for very short distance communication.
Frequency Range:300GHz – 400THz. It is used in TV remotes, wireless mouse,
keyboard, printer, etc.
Advantages -
● It is a very high-speed transmission.
● It has a large bandwidth.
● It is very cheap.
● It is very secure.
● It provides a wireless connection between two systems.
● It has a high data transfer rate.

Disadvantages -
● Cannot be used for long-range communication.
● Cannot penetrate through walls.
● Sun rays interfere with the infrared rays so not ideal for outdoor communication.

PRACTICAL - 4
AIM: Write a program that demonstrates the concept of bit stuffing.
Program:
#include <iostream>

Page | 18
using namespace std;
int main()
{
int a[10], b[10], n;
cout << "Enter frame size: ";
cin >> n;
cout << "Enter the frame in the form of 0 and 1: ";
for (int i = 0; i < n; i++)
cin >> a[i];
int i = 0;
int count = 1;
int j = 0;
while (i < n)
{
if (a[i] == 1)
{
b[j] = a[i];
for (int k = i + 1; a[k] == 1 && k < n && count < 5; k++)
{
j++;

if (count == 5)
{
j++;
b[j] = a[k];
count++;

b[j] = 0;
}
i = k;
}

Page | 19
} else
b[j] = a[i];
i++; j++;
}
cout << "After Bit Stuffing: ";
for (int i = 0; i < j; i++)
cout << b[i];
}

OUTPUT:

PRACTICAL - 5
AIM: Write a program that demonstrates the concept of byte stuffing.
Program:
#include <iostream>

Page | 20
using namespace std;
int main()
{
string flag = "11111111";
string stuff = "01111110";
string data = "0111011111111001101";
cout << "Before stuffing data: " << data << endl;
int n = data.find(flag);
data.insert(n + 1, stuff);
cout << "After stuffing data will be " << data << endl;
int y = data.find(stuff);
data.erase(y, 8);
cout << "After getting data, data string will be " << data << endl;
return 0;
}

OUTPUT:

PRACTICAL - 6
AIM: To demonstrate Networking and Internetworking devices (NIC, Switch,
Hub, Router, Gateway, Repeater, Bridges, Cables)

Page | 21
1) BUS TOPOLOGY -

2) STAR TOPOLOGY –

Page | 22
3) RING TOPOLOGY –

4) MESH TOPOLOGY –

Page | 23
5) TREE TOPOLOGY –

6) HYBRID TOPOLOGY –

Page | 24
PRACTICAL -08
AIM:

7
Write a program to demonstrate the concept of PARITY CHECKING.
Program:
#include <iostream> #include
<algorithm>
using namespace std;

int parity(int arr[4], int n1)


{
int c = 0;
for (int i = 0; i < n1; i++)
{
if (arr[i] == 1)
c++;
}
if (c % 2 != 0)
return 1;
else
return 0;
}

int BinaryToDecimal(int parBit)


{
int decimalNumber = 0;
int base = 1;
int temp = parBit;
while (temp)
{
int lastDigit = temp % 10;
temp = temp / 10;
decimalNumber += lastDigit * base;
base = base * 2;
}
cout << "Decimal form of " << parBit << " is " << decimalNumber << endl;
return decimalNumber;
}

int main()
{
int a[7] = {1, 0, 1, 1, 0, 1, 1};
unsigned int n = sizeof(a) / sizeof(a[0]);
reverse(a, a + n); int p1[4] = {a[6],

Page | 25
a[4], a[2], a[0]}; int n1 = sizeof(p1) /
sizeof(p1[0]); int p2[4] = {a[6], a[5],
a[2], a[1]}; int p4[4] = {a[6], a[5], a[4],
a[3]}; int ans;
cout << "Entered Bits: ";

for (int i = 0; i < n; i++)


cout << a[i]; cout <<
endl; cout << "p1: ";

for (int i = 0; i < n1; i++)


cout << p1[i]; cout <<
endl; cout << "p2: ";

Page | 26
PRACTICAL -08
AIM:

for (int i = 0; i < n1; i++)


cout << p2[i];
cout << endl;
cout << "p4: ";

for (int i = 0; i < n1; i++)


cout << p4[i];
cout << endl;

int parBit = parity(p4, n1) * 100 + parity(p2, n1) * 10 + parity(p1, n1);


cout << parBit;
cout << endl;

int dec = BinaryToDecimal(parBit);


if (a[dec - 1] == 1)
a[dec - 1] = 0;
else
a[dec - 1] = 1;
reverse(a, a + n);
cout << "Corrected Bits: ";

for (int i = 0; i < n; i++)


cout << a[i];
cout << endl;
return 0;
}

OUTPUT:

Write a program which demonstrates the concept of Error Detection


Methods like VRC, LRC.

Page | 27
#include <math.h>
#include <stdio.h>
int input[32], code[32];

int ham_calc(int position, int c_l)


{
int count = 0, i, j;
i = position - 1;
while (i < c_l)
{
for (j = i; j < i + position; j++)
{
if (code[j] == 1)
count++;
}
i = i + 2 * position;
}
if (count % 2 == 0)
return 0;
else
return 1;
}

void solve(int input[], int n)


{
int i, p_n = 0, c_l, j, k;
i = 0;
while (n > (int)pow(2, i) - (i + 1))
{
int ham_calc(int, int); void

solve(int input[], int);

Page | 28
PRACTICAL -08
AIM:

p_n++; i++;

}
c_l = p_n + n;
j = k = 0;
for (i = 0; i < c_l; i++)
{ if (i == ((int)pow(2, k)
- 1))
{
code[i] = 0;
k++;
}

Page | 29
else
{
code[i] = input[j];
j++;
}
}
for (i = 0; i < p_n; i++)
{
int position = (int)pow(2, i);
int value = ham_calc(position, c_l);
code[position - 1] = value;
}
printf("\nThe generated Code Word is: ");
for (i = 0; i < c_l; i++)
{
printf("%d", code[i]);
}
}

int main()
{
input[0] = 0;
input[1] = 1;
input[2] = 1;
input[3] = 1;
int N = 4;
solve(input, N);
return 0;
}

OUTPUT:

10
Write a program to demonstrate the concept of error detection method
CRC.
Program:

Page | 30
PRACTICAL -08
AIM:

#include <iostream>
#include <math.h>
using namespace std;

string toBin(long long int num)


{
string bin = "";
while (num)
{
if (num & 1)
bin = "1" + bin;
else
bin = "0" + bin;
num = num >> 1;
}
return bin;
}

long long int toDec(string bin)


{
long long int num = 0;
for (int i = 0; i < bin.length(); i++)
{
if (bin.at(i) == '1')
num += 1 << (bin.length() - i - 1);
}
return num;
}

void CRC(string dataword, string generator)


{
int l_gen = generator.length(); long
long int gen = toDec(generator);

long long int dword = toDec(dataword);

long long int dividend = dword << (l_gen - 1);


int shft = (int)ceill(log2l(dividend + 1)) - l_gen;
long long int rem;

Page | 31
while ((dividend >= gen) || (shft >= 0))
{
rem = (dividend >> shft) ^ gen;
dividend = (dividend & ((1 << shft) - 1)) | (rem << shft);

shft = (int)ceill(log2l(dividend + 1)) - l_gen;


}
long long int codeword = (dword << (l_gen - 1)) | dividend;
cout << "Remainder: " << toBin(dividend) << endl;
cout << "Codeword : " << toBin(codeword) << endl;
}

int main()
{
string dataword, generator;
dataword = "10011101";
generator = "1001";
CRC(dataword, generator);
return 0;
}

OUTPUT:

11
Configuration of router in packet tracer using command line.
STUDY:
Page | 32
PRACTICAL -08
AIM:

1) RIP:
Step-1(Configuring Router1):
1. Select the router and Open CLI.
2. Press ENTER to start configuring Router1.

4. Type config t(configure terminal) to access the configuration menu.


5. Configure interfaces of Router1:

CODE:
Configuration of router 1:
Router(config) #router rip
Router(config-router) #network 192.168.1.0
Router(config-router) #network 10.0.0.0
Router(config-counter) #exit

Configuration of router 2:
Router(config) #router rip
Router(config-router) #network 192.168.2.0
Router(config-router) #network 10.0.0.0
Router(config-counter) #exit

Step-2(Configuring PCs):
1. Assign IP Addresses to every PC in the network.
2. Select the PC, go to the desktop and select IP Configuration and assign an IP address,
Default gateway, Subnet Mask
3. Assign the default gateway of PC0 as 192.168.10.1.
4. Assign the default gateway of PC1 as 192.168.20.1.
3. Type enable to activate the privileged mode.

Step-3(Connecting PCs with Router):


1. Connect the FastEthernet0 port of PC0 with FastEthernet0/0 port of Router1 using a copper
straight-through cable.
2. Connect the FastEthernet0 port of PC1 with FastEthernet0/1 port of Router1 using a copper
straight-through cable.

Page | 33
OUTPUT:

2) OSPF:
Step 1: First, open the Cisco packet tracer desktop and select the devicesthen, create a network
topology

Step 2: Configure the PCs (hosts) with IPv4 address and Subnet Mask according to the IP
addressing table given above.
Assign IP Address
• Then, go to desktop and then IP configuration and there you will IPv4 configuration.
• Fill IPv4 address and subnet mask.
• using the ipconfig command, or we can also assign an IP address with the help
Assigning an IP address of a command.
• Go to the command terminal of the PC.
• Then, type iPConfig <IPv4 address><subnet mask><default gateway> (if needed)

Step 3: Configure router with IP address and Subnet mask.


• To assign an IP address in router0, click on router0.
• Then, go to config and then Interfaces.
• Make sure to turn on the ports.

Then, configure the IP address in FastEthernet and serial ports according to the IP
addressing Table.
• Fill IPv4 address and subnet mask.

CODE:
Configuration of router 0:
Router(config) #router ospf 1
Router (config-router) #network 192.168.1.0 0.0.0.255 area 0

Page | 34
Router (config-router) #network 10.0.0.0 0.255.255.255 area 0
Router (config-router) #network 12.0.0.0 0.255.255.255 area 0
Router(config-counter) #exit

Configuration of router 1:
Router(config)#router ospf 1
Router (config-router) #network 10.0.0.0 0.255.255.255 area 0
Router (config-router) #network 11.0.0.0 0.255.255.255 area 0

Page | 35
Configuration of router 2:
Router(config)#router ospf 1
Router (config-router) #network 192.168.2.0 0.0.0.255 area 0
Router (config-router) #network 11.0.0.0 0.255.255.255 area 0
Router (config-router) #network 12.0.0.0 0.255.255.255 area 0
Router(config-counter) #exit

Step 4: After configuring all of the devices we need to assign the routes to the routers.
To assign RIP routes to the particular router:
• First, click on router0 then Go to CLI.
• Then type the commands and IP information given - CLI command: network <network
id>

OUTPUT:

Router (config-router) #network 11.0.0.0 0.255.255.255 area 0 Router(config-counter)


#exit

Page | 36
3) BGP:

Step 1: First, open the Cisco packet tracer desktop and select the devices then, create a
network topology.

Step 2: Configure the PCs (hosts) with IPv4 address and Subnet Mask according to the IP
addressing table given above.
Assign IP Address

• Then, go to desktop and then IP configuration and there you will IPv4 configuration.
• Fill IPv4 address and subnet mask.
• using the ipconfig command, or we can also assign an IP address with the help
Assigning an IP address of a command.
• Go to the command terminal of the PC.
• Then, type iPConfig <IPv4 address><subnet mask><default gateway> (if needed)

Step 3: Configure router with IP address and Subnet mask.

• To assign an IP address in router0, click on router0.


• Then, go to config and then Interfaces.
• Make sure to turn on the ports.
• Then, configure the IP address in FastEthernet and serial ports according to IP
addressing Table.
• Fill IPv4 address and subnet mask.

CODE:
Configuration of router 0:
Router(config) #router bgp 100
Router(config-router) #network 192.168.1.0
Router(config-router) #network 192.168.2.0
Router(config-router) #neighbor 192.168.2.3 remote-as 200
Router(config-router) #netighbor 192.168.3.2 remote-as 200
Router(config-router) #exit

Configuration of router 1:
Router(config) #router bgp 200
Router(config-router) #network 192.168.2.0
Router(config-router) #network 192.168.3.0
Router(config-router) #neighbor 192.168.2.2 remote-as 100
Router(config-router) #netighbor 192.168.1.2 remote-as 200
Router(config-router) #exit

Step 4: After configuring all of the devices we need to assign the routes to the routers. To
assign RIP routes to the particular router:

Page | 37
• First, click on router0 then Go to CLI.
• Then type the commands and IP information - CLI command: network <network id>

OUTPUT:

Page | 38
PRACTICAL - 12
AIM: Configuration of router in packet tracer using configuration terminal.
STUDY:
Step-1(Configuring Router1):
1. Select the router and Open terminal.
2. Press ENTER to start configuring Router1.
3. Type enable to activate the privileged mode.
4. Type config t(configure terminal) to access the configuration menu.
5. Configure interfaces of Router1.

Step-2(Configuring PCs):
1. Assign IP Addresses to every PC in the network.
2. Select the PC, go to the desktop and select IP Configuration and assign an IP address,
Default gateway, Subnet Mask
3. Assign the default gateway of PC0 as 192.168.10.1.
4. Assign the default gateway of PC1 as 192.168.20.1.

Step-3(Connecting PCs with Router):


1. Connect the FastEthernet0 port of PC0 with FastEthernet0/0 port of Router1 using a copper
straight-through cable.
2. Connect the FastEthernet0 port of PC1 with FastEthernet0/1 port of Router1 using copper
straight-through cable.

OUTPUT:

Page | 39

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy