0% found this document useful (0 votes)
8 views54 pages

CN Practical File Divya

The document outlines a series of practical exercises related to networking, including setting up a basic LAN, common network commands, downloading and installing CISCO Packet Tracer, and creating network topologies. Each practical includes step-by-step instructions and requirements for successful completion. The document serves as a comprehensive guide for individuals learning about network configuration and management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views54 pages

CN Practical File Divya

The document outlines a series of practical exercises related to networking, including setting up a basic LAN, common network commands, downloading and installing CISCO Packet Tracer, and creating network topologies. Each practical includes step-by-step instructions and requirements for successful completion. The document serves as a comprehensive guide for individuals learning about network configuration and management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 54

INDEX

Sno. Practical Page no. Signature


1. How To Setup a Basic LAN 1-4
Connection.
2. Write Down the Common Network 5 - 10
Commands.
3. How to Download and Install 11 - 19
CISCO Packet Tracer.
4. Create Point to Point and Star 20 - 25
Topology in CISCO Packet Tracer.
5. How to Configure a Switch and 26 - 30
Router in CISCO Packet Tracer.
6. Implement Error Detection 31 - 35
Technique (Checksum).
7. How to setup and configure a 36 - 40
Firewall.
8. How to setup and configure a VPN. 41 - 45

9. Write down the Steps to Setting up 46 – 49


and Secure a Wireless Network .

10. Implement the Link State Routing 50 - 53


algorithm by taking at least 6
nodes. Also calculate the total cost
of the shortest path.
DIVYA PANDEY (2023218743)

PRACTICAL – 1

Aim: - How To Setup a Basic LAN Connection.


Introduction:
A Local Area Network (LAN) is a computer network that connects devices within a small
geographical area, such as a home, office, or building. It allows devices to share resources,
communicate, and access the internet efficiently. LANs are commonly used for tasks like file
sharing, printing, and streaming media.
Requirement :
 Router or network switch
 Ethernet cables (Cat5e/Cat6)
 Devices with Ethernet ports (e.g., PCs, printers, etc.)
 (Optional) Wireless access point for Wi-Fi devices

Fig 1.1: Requirement

Steps to Set Up a Basic LAN:


Connect the Router or Switch
 Plug the router/switch into a power source.
 If you’re using a router, it may have a port labeled WAN/Internet—you only need this
if you’re connecting to the internet.

1
DIVYA PANDEY (2023218743)

Fig 1.2: Connect the Router or Switch

2. Connect Devices via Ethernet


 Plug one end of an Ethernet cable into a device (like a computer).
 Plug the other end into an available LAN port on the router/switch.
 Repeat this for all devices.

Fig 1.3: Connect Devices via Ethernet

3. Power On and Configure Devices


(i). Turn on all connected devices.

2
DIVYA PANDEY (2023218743)

(ii). Each device should automatically be assigned an IP address via DHCP from the router
(if DHCP is enabled, which is the default for most routers)

Fig 1.4: Power On and Configure Devices

4. Set Static IPs(Optional).


If you want fixed IP addresses:
o Go to Network Settings on each device.
o Set an IP address manually (e.g., 192.168.1.10, 192.168.1.11, etc.).
o Subnet mask: 255.255.255.0
o Default gateway: Router's IP (usually 192.168.1.1)

Fig 1.5: Set Static Ips

3
DIVYA PANDEY (2023218743)

5. Test the Connection


 On Windows, open Command Prompt and type:
 ping 192.168.1.11
On Mac/Linux, open Terminal and do the same.

Fig 1.6: Test the Connection

6. Enable File and Printer Sharing (if needed)


 On Windows: Control Panel > Network and Sharing Center > Advanced sharing
settings.
 On macOS: System Preferences > Sharing.

Fig 1.7: Enable File and Printer Sharing

4
DIVYA PANDEY (2023218743)

PRACTICAL – 2

Aim:- Write Down the Common Network Commands.


Introduction:-
Computer network commands are instructions used through a command-line interface (CLI)
to manage and troubleshoot network connections and devices. These commands allow IT
professionals to gather information, monitor performance, diagnose issues, and configure
various network settings. They are essential for maintaining the health and security of a
network, especially in complex environments like cloud and remote-first setups.
Networking commands are essential tools for managing and troubleshooting computer
networks. From assessing connectivity with "ping" to configuring interfaces using "ifconfig"
or "ipconfig" these commands provide crucial insights.

1. ping: Used to test network connectivity by sending ICMP echo requests to a specified
host.
Example: ping 192.168.1.1

Fig. 2.1: Output of Ping Command

5
DIVYA PANDEY (2023218743)

2. ipconfig/ifconfig: Displays and manages the network configuration of a computer,


including IP addresses, subnet masks, and default gateways.

Example: ipconfig

Fig. 2.2: Output of IPconfig Command

3. netstat: Displays network connections, routing tables, and other network-related


information.
Example: netstat

Fig. 2.3 : Output of Netstat Command


6
DIVYA PANDEY (2023218743)

4. nslookup: Query DNS servers to retrieve domain name or IP address information.

Example: nslookup

Fig. 2.4: Output of NSlookup Command

5. hostname: Displays or sets the hostname of the current computer.


Example: hostname

Fig. 2.5: Output of Hostname Command

7
DIVYA PANDEY (2023218743)

6. route: Used to view and manipulate the routing table, which determines how network
traffic is routed.
Example: route

Fig 2.6: Output of Route Command

7. arp: Used to display or modify the local ARP cache, which maps IP addresses to MAC
addresses.
Example: arp

Fig 2.7: Output of ARP Command

8
DIVYA PANDEY (2023218743)

8. tracert: Traces the path that network packets take from your computer to a destination
IP address or domain name, showing each hop along the way.
Example : tracert

Fig 2.8 : Output of Tracert Command

9. Pathping : The Pathping command is a Windows command-line utility that combines


the functionality of ping and tracert.
Example: pathping

Fig 2.9: Output of Pathping Command


9
DIVYA PANDEY (2023218743)

10. Ssh: Establishes a secure remote connection to a device or server.


Example: ssh

Fig 2.10 : Output of SSH Command

10
DIVYA PANDEY (2023218743)

PRACTICAL – 3

Aim:- How to Download and Install CISCO Packet Tracer.


Introduction:
Cisco Packet Tracer is a network simulation tool that allows users to design, configure, and
troubleshoot networks in a virtual environment.
Follow the below steps to install Packet Tracer on Windows:
Step 1: Visit the official website of Netacad using any web browser.

Fig. 3.1: Go to Cisco Packet Tracker Site


Step 2: Press the login button and select login option.

Fig. 3.2: Click on Login


Step 3: Next screen will appear, click on the sign-up option.
11
DIVYA PANDEY (2023218743)

Fig. 3.3: login Page

Step 4: Next screen will appear and will ask for email and password and other simple details,
fill them and click on Register.

Fig. 3.4: New User Sign Up


Step 5: Now the login screen appears again so fill in the Email id.

12
DIVYA PANDEY (2023218743)

Fig. 3.5: Login In

Step 6: On the next screen enter the password and press the Login button.

Fig. 3.6: Enter Login Password

13
DIVYA PANDEY (2023218743)

Step 7: Dashboard will initialize, now click on Resources and choose Download Packet
Tracer Option.

Fig. 3.7 Download Cisco Packet Tracer 1.0.3

Step 8: On the next web page choose the operating system to download the packet tracer.
Downloading will start automatically.

Fig. 3.8: Click on Windows 64-bit

14
DIVYA PANDEY (2023218743)

Step 9: Check for the executable file in your system and run it.

Fig. 3.9:-Install Packet Tracer Set-up

Step 10: Next screen is of License Agreement so Click on I accept the license.

Fig. 3.10: Click on Next Button

15
DIVYA PANDEY (2023218743)

Step 11: Choose the installing location which has sufficient space.

Fig. 3.11: Click on Next Button

Step 12: Select the start menu folder and click the Next button.

Fig. 3.12: Click on Next Button

16
DIVYA PANDEY (2023218743)

Step 13: Check the box for creating a desktop icon and click on the Next button.

Fig. 3.13: Click on Next Button

Step 14: Now packet tracer is ready to install so click on the Install button.

Fig. 3.14: Click on Install


17
DIVYA PANDEY (2023218743)

Step 15: The installation process will start and will hardly take a minute.

Fig. 3.15: Packet Tracer Extracting File in Process

Step 16: Click on the Finish button to complete the installation.

Fig. 3.16: Click on Finish Button

18
DIVYA PANDEY (2023218743)

Step 17: An icon is created on the desktop so run it.

Fig. 3.17: Double Click on Packet Tracer

Step 18: Interface is initialized and the software is ready to use.

Fig. 3.18: Packet Tracer Ready to Use

19
DIVYA PANDEY (2023218743)

PRACTICAL – 4

Aim:- Create Point to Point and Star Topology in CISCO Packet Tracer.

Point-to-Point Topology :-
Point-to-point topology is the simplest network configuration, directly connecting two
devices (nodes) with a dedicated link. This means data travels directly between the two
endpoints without going through any other device or hub. It's like a direct telephone call,
where one device (the sender) communicates directly with another (the receiver) without
interference.

1. Open Cisco Packet Tracer and start a new project.

Fig 4.1: Open Cisco Packet Tracer

2. Add end devices: Drag two PCs from the "End Devices" section to the workspace.

20
DIVYA PANDEY (2023218743)

Fig 4.2: Add end Devices

3. Connect the devices: Select a "Straight-Through" cable and connect one PC to the
other.

Fig 4.3: Add Connection Cable

21
DIVYA PANDEY (2023218743)

4. Configure IP addresses: Click on each PC, go to "Desktop" > "IP Configuration", and
assign static IP addresses (e.g., 192.168.2.10 for PC1 and 192.168.2.11 for PC2).
Ensure the subnet mask is correct (e.g., 255.255.255.0).

Fig 4.4: IP addresses 192.168.2.10 for PC1

Fig 4.5: IP addresses 192.168.2.11 for PC2

22
DIVYA PANDEY (2023218743)

5. Test connectivity: Use the "Ping" command from the Command Prompt on one PC to
test if it can reach the other.

Fig 4.6: ping command to Check the Connection

Star Topology:-
In computer networking, a star topology is a network configuration where all devices connect
to a central hub or switch. This central node acts as a focal point, and all communication
passes through it. Each device has a dedicated point-to-point connection to the central hub,
making it easy to manage and isolate network traffic.
1. Open Cisco Packet Tracer and start a new project.

Fig 4.7: Open Cisco Packet Tracer

23
DIVYA PANDEY (2023218743)

2. Add a central device: Drag a "Switch" (or "Hub") from the "Devices" section to the
workspace.

Fig 4.8: Add Switch and End Device

3. Connect devices to the switch/hub: Use "Straight-Through" cables to connect each PC


to the switch/hub.

Fig 4.9: Stabilise Connection between End Devices and Switch

24
DIVYA PANDEY (2023218743)

4. Configure IP addresses: Click on each PC, go to "Desktop" > "IP Configuration", and
assign static IP addresses. Ensure the subnet mask is correct for the network.

Fig 4.10: Enter IP Address to All End Devices

5. Test connectivity: Use the "Ping" command from the Command Prompt on one PC to
test if it can reach other PCs on the network.

Fig 4.11: Ping Command to Check the Connection

25
DIVYA PANDEY (2023218743)

PRACTICAL – 5

Aim: - How to Configure a Switch and Router in CISCO Packet Tracer.


Introduction:
Switch: A switch is a multiport bridge with a buffer designed that can boost its efficiency (a
large number of ports imply less traffic) and performance. A switch is a data link layer
device. The switch can perform error checking before forwarding data, which makes it very
efficient as it does not forward packets that have errors and forward good packets selectively
to the correct port only. In other words, the switch divides the collision domain of hosts, but
the broadcast domain remains the same.

Router: A router is a device like a switch that routes data packets based on their IP addresses.
The router is mainly a Network Layer device. Routers normally connect LANs and WANs
and have a dynamically updating routing table based on which they make decisions on
routing the data packets. The router divides the broadcast domains of hosts connected
through it.

Here's a step-by-step guide on how to configure a switch and router in Cisco Packet Tracer:
Step 1: Create a New Topology
1. Open Cisco Packet Tracer.
2. Create a new topology.

26
DIVYA PANDEY (2023218743)

Fig 5.1: Open Packet Tracer


Step 2: Add Devices
1. Add a router (2811) to the workspace.
2. Add two switches (2960) to the workspace.
3. Add four End PCs to the workspace.

Fig 5.2: Add Devices

Step 3: Configure the Router


1. Click on the router and select the "Config" tab.
2. Set the hostname of the router using the hostname command.
3. Configure the interfaces (e.g., FastEthernet0/0, FastEthernet0/1) with IP addresses and
subnet masks.

Fig 5.3: Configure the Router

27
DIVYA PANDEY (2023218743)

Step 4: Configure the Switch


1. Click on the switch and select the "Config" tab.
2. Set the hostname of the switch using the hostname command.
3. Configure the VLANs and assign ports to VLANs.

Fig 5.4: Configure the Switch

Step 5: Connect Devices


1. Use copper straight-through cables to connect the PCs to the switch.
2. Use copper straight-through cables to connect the switch to the router.

28
DIVYA PANDEY (2023218743)

Fig 5.5: Connect Devices


Step 6: Configure PCs
1. Set the IP addresses, subnet masks, and default gateways for the PCs.

Fig 5.6: Configure PCs

Step 7: Verify Configuration


1. Use the ping command to test connectivity between PCs.
2. Use the show running-config command to verify the configuration on both the router and
switch.

29
DIVYA PANDEY (2023218743)

Fig 5.7: Verify Configuration


Step 8: Save the Configuration
1. Save the configuration on both the router and switch.

Fig 5.8: Save the Configuration

30
DIVYA PANDEY (2023218743)

PRACTICAL: - 6

Aim: - Implement Error Detection Technique (Checksum).


Introduction:
Checksum is an error detection technique in computer networks that uses a simple arithmetic
sum of data segments. The sender calculates a checksum (a value representing the sum of
data segments) and sends it along with the data. The receiver performs the same calculation
and compares the result with the received checksum. If they match, it's assumed the data was
transmitted without errors.

Here's a breakdown of how checksum works:

1. Data Segmentation: The data to be transmitted is divided into equal-sized blocks


(segments).
2. Summation: The segments are added together using one's complement arithmetic.
3. Checksum Generation: The sum is then complemented (ones complement) to produce the
checksum.
4. Transmission: The original data and the checksum are sent together.
5. Reception and Verification: The receiver performs the same addition and one's
complement operation on the received data and checksum.
If the final result is all ones (or zero), it indicates no errors were detected during
transmission.
Program:
def checksum(data):
"""
Calculates the 1's complement checksum of the data.

Args:
data: A string representing the data.

Returns:

31
DIVYA PANDEY (2023218743)

A string representing the checksum.


"""

data_list = [int(bit) for bit in data]


sum = 0
for bit in data_list:
sum += bit

# Convert the sum to binary string


sum_binary = bin(sum)[2:]

# Calculate 1's complement


complement = ''.join(['1' if bit == '0' else '0' for bit in sum_binary])

return complement

def verify_checksum(data, checksum):


"""
Verifies if the checksum matches the calculated checksum.

Args:
data: A string representing the data.
checksum: A string representing the received checksum.

Returns:
True if the checksums match, False otherwise.
"""

calculated_checksum = checksum(data)

32
DIVYA PANDEY (2023218743)

return calculated_checksum == checksum

# Example usage:
data = "101101011100"
received_checksum = checksum(data)

print("Data:", data)
print("Calculated checksum:", received_checksum)
# Simulate a data transmission with a potential error
# Let's say bit 2 (index 1) is flipped from 1 to 0
# data_with_error = "100101011100"

# Simulate reception with an error


# data_with_error = "100101011100"
# if we want to test the checksum at the receiver's end
# received_checksum = checksum(data_with_error)

# Check if the checksums match


if verify_checksum(data, received_checksum):
print("Data is likely error-free.")
else:
print("Error detected in data.")
Example:
Let's say the data is: 1100 1010 1001 1100 (4 words, 4 bytes)
1. Add the words (1's complement arithmetic):

1100
1010

33
DIVYA PANDEY (2023218743)

1001
1100
-------
10011

1. Handle carry: The 5th bit carries over, so it's added to the sum:

10011
+1
-------
10100

1. 1's complement: Flip the bits (0 to 1 and 1 to 0):

10100 (Sum)
01011 (1's complement = Checksum)

1. Transmission: The sender sends 1100 1010 1001 1100 01011 (data + checksum).

2. Reception and Verification:

○ The receiver performs the same calculation:

1100
1010
1001
1100
01011 (Checksum)

34
DIVYA PANDEY (2023218743)

-------
11111 (Sum of all including checksum)

1's complement the sum.

11111 (Sum)
00000 (1's complement = 0)

● Result: The result is all ones (or zero), indicating no errors were detected.

35
DIVYA PANDEY (2023218743)

PRACTICAL: 7

Aim: - How to Setup and Configure a Firewall.


Introduction:
A firewall is a network security system that acts as a barrier between a trusted internal
network and untrusted external networks, such as the Internet. It monitors and controls
incoming and outgoing network traffic based on pre-defined security rules, typically
allowing authorized traffic while blocking unauthorized or malicious traffic.
1. Open Cisco Packet Tracer and start a new project.

Fig 7.1: Open Cisco Packet Tracer


2. Add end devices: Drag two PCs from the "End Devices" section to the workspace.

Fig 7.2: Add end Devices

36
DIVYA PANDEY (2023218743)

3. Connect the devices: Select a “Straight- Through” cable and connect all end devices.

Fig 7.3: Add Connection Cable

4. Configure IP addresses: Click on server, go to "Desktop" > "IP Configuration", and


assign static IP addresses 1.0.0.1.

Fig 7.4: IP Addresses 1.0.0.1 for Server

37
DIVYA PANDEY (2023218743)

5. Click on services of the server and click on DHCP and on the services.

Fig 7.5: On Service of Server

6. Configure IP addresses: Click on each PC, go to "Desktop" > "IP Configuration", and
assign DHCP IP addresses.

Fig 7.6: Make DHCP for All end Devices

38
DIVYA PANDEY (2023218743)

7. Click on server and go to desktop and select a IP v4 firewall and on the services of
firewall.

Fig 7.7: Configure a Firewall

8. Click on any pc and go to desktop and click on command prompt and run ping 1.0.0.1
command to check the firewall.

Fig 7.8: Check Command p=Prompt with Ping 1.0.0.1 Command

39
DIVYA PANDEY (2023218743)

9. Click on any pc and go to desktop and click on web browser and run 1.0.0.1 to check
the firewall.

Fig 7.9: Check Web browser with 1.0.0.1

40
DIVYA PANDEY (2023218743)

PRACTICAL – 8

Aim :- How to Setup and Configure a VPN .


Introduction :
Virtual Private Network (VPN) connection is a secure and encrypted connection between
your device and a VPN server. VPN creates a secure "tunnel" between your device and the
internet, encrypting your online activity and protecting your data from interception or
eavesdropping.
1. Open Cisco Packet Tracer and start a new project .

Fig 8.1 : Open cisco packet tracer


2. Add end devices: Drag four PCs from the "End Devices" section and switches and
routers to the workspace.

Fig 8.2 : Add end Devices


41
DIVYA PANDEY (2023218743)

3. Connect the devices: Select a “Straight- Through” cable and connect all end devices .

Fig 8.3 : Add Connection Cable

4. Give labeling to all of the devices with IP address .

Fig 8.4 : Labeling to all Devices

42
DIVYA PANDEY (2023218743)

5. Gives the router configuration to the router by the fast ethernet .

Fig 8.5 : Router Configuration

6. Gives the RIP configuration of IP of the routers.

Fig 8.6 : RIP Configuration

43
DIVYA PANDEY (2023218743)

7. Configuration of the all devices are successfully created .

Fig 8.7 : Configuration Successful

8. Makes the VPN turnel for the configuration of the VPN .

Fig 8.8 : VPN Turnel

44
DIVYA PANDEY (2023218743)

9. Run the VPN configuration command on the CLI of the routers .

Fig 8.9 : VPN Configuration

10. Check the VPN configuration on the PC command prompt with the tracert command .

Fig 8.10 : Successfully Creates the VPN setup

45
DIVYA PANDEY (2023218743)

PRACTICAL – 9

Aim :- Write down the Steps to Setting up and Secure a Wireless Network .
Introduction :
A wireless network is a type of computer network that connects devices without the use of
physical cables or wires. It allows devices to communicate with each other and access the
internet or other network resources wirelessly.
1. Open Cisco Packet Tracer and start a new project.

Fig 9.1 : Open cisco packet tracer


2. Add end devices: Drag Four PCs from the End Devices and three routers section to the
workspace.

Fig 9.2 : Add end devices and routers

46
DIVYA PANDEY (2023218743)

3. Select router and select wireless and add password .

Fig 9.3 : Add password on Router

4. Connect all pc’s with the wireless connection to search router .

Fig 9.4 : Find routers available

47
DIVYA PANDEY (2023218743)

5. Enter the password to establish wireless connection .

Fig 9.5 : Enter the password

6. Connect the routers : Select a “Automatic cable” and connect the routers .

Fig 9.6 : Add connection cable

48
DIVYA PANDEY (2023218743)

7. Check the wireless connection with packets .

Fig 9.7 : checking the wireless connection

49
DIVYA PANDEY (2023218743)

PRACTICAL – 10

Aim :- Implement the Link State Routing algorithm by taking at least 6 nodes.
Also calculate the total cost of the shortest path.
Introduction :
The Link State Routing algorithm is a dynamic routing protocol used in computer networks
to determine the best path between nodes. It works by maintaining a map of the network
topology and calculating the shortest path to each node based on the link costs.
Program :
#include <iostream>
#include <vector>
#include <climits>
using namespace std;
#define N 6 // Number of nodes
void dijkstra(int graph[N][N], int src) {
int dist[N]; // Shortest distance from src to i
bool visited[N]; // True if vertex is processed
// Initialize distances and visited[]
for (int i = 0; i < N; i++) {
dist[i] = INT_MAX;
visited[i] = false;
}
dist[src] = 0; // Distance to itself is always 0
for (int count = 0; count < N - 1; count++) {
int u = -1;
int minDist = INT_MAX;
// Pick the unvisited vertex with the smallest distance
for (int i = 0; i < N; i++) {
if (!visited[i] && dist[i] <= minDist) {
minDist = dist[i];

50
DIVYA PANDEY (2023218743)

u = i;
} }

visited[u] = true;
// Update distances of adjacent vertices of u
for (int v = 0; v < N; v++) {
if (!visited[v] && graph[u][v] && dist[u] != INT_MAX
&& dist[u] + graph[u][v] < dist[v]) {
dist[v] = dist[u] + graph[u][v];
}
}
}
// Print results
cout << "Shortest path costs from Node " << src << ":" << endl;
int totalCost = 0;
for (int i = 0; i < N; i++) {
cout << "To Node " << i << " : " << dist[i] << endl;
totalCost += dist[i];
}
cout << "Total cost of shortest paths: " << totalCost << endl;
}

int main() {
// Example graph represented as adjacency matrix
// 0 means no direct link
int graph[N][N] = {
{0, 2, 0, 1, 0, 0},
{2, 0, 3, 2, 0, 0},
{0, 3, 0, 0, 7, 3},

51
DIVYA PANDEY (2023218743)

{1, 2, 0, 0, 1, 0},
{0, 0, 7, 1, 0, 2},
{0, 0, 3, 0, 2, 0}
};

int srcNode;
cout << "Enter source node (0 to " << N-1 << "): ";
cin >> srcNode;
if (srcNode < 0 || srcNode >= N) {
cout << "Invalid source node." << endl;
return 1;
}
dijkstra(graph, srcNode);
return 0;
}
Graph layout :
Node 0: connects to 1 (2), 3 (1)
Node 1: connects to 0 (2), 2 (3), 3 (2)
Node 2: connects to 1 (3), 4 (7), 5 (3)
Node 3: connects to 0 (1), 1 (2), 4 (1)
Node 4: connects to 2 (7), 3 (1), 5 (2)
Node 5: connects to 2 (3), 4 (2)
Graph diagram :
(2)
0 -------- 1
| |
(1) (3)
| |

52
DIVYA PANDEY (2023218743)

3 -------- 2
\ /\
(1) (7) (3)
\ / \
4 -------- 5
(2)

53

You might also like