0% found this document useful (0 votes)
31 views

Computer Network and Security Lab File

The document provides steps to configure a basic two-router network using Routing Information Protocol (RIP) in Packet Tracer, including: 1. Creating a network topology with two routers connected by a crossover cable and PCs connected to each router. 2. Configuring the interface IP addresses on each router. 3. Entering global configuration mode and configuring RIP version 2 on each router to advertise the connected networks. 4. Testing connectivity between the PCs by pinging the routers' interfaces.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Computer Network and Security Lab File

The document provides steps to configure a basic two-router network using Routing Information Protocol (RIP) in Packet Tracer, including: 1. Creating a network topology with two routers connected by a crossover cable and PCs connected to each router. 2. Configuring the interface IP addresses on each router. 3. Entering global configuration mode and configuring RIP version 2 on each router to advertise the connected networks. 4. Testing connectivity between the PCs by pinging the routers' interfaces.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

COMPUTER NETWORKS AND SECURITY

ESSENTIONAL LAB

CAP4005L
School of Engineering
Department of Computer Science and Engineering

Submitted By
Student Name Vishal kumar meena
Enrollment Number 230160307042
Programme Masters in Computer Application
Department Computer Science and Engineering
Session/Semester 2023-2025/First Semester
Submitted To
Faculty Name Mr. Susheel Kumar
INDEX
S. No. Date Aim the Experiment Page No. Signature

29/10/2023 Familiarization with Transmission media and Tools:


01 Coaxial cable, UTP Cable, Crimping tool, Connectors
etc. and preparing straight and cross cables.
29/10/2023 Familiarization with network configuration and
02 troubleshooting commands.
29/10/2023 Configure a network through routing information
03 protocol using packet tracer.
29/10/2023 Configure open shortest path first using packet tracer.
04
29/10/2023 Write a program in c to simulate of ARP/RARP
05 Protocol.
Experiment – 1

Aim - Familiarization with Transmission media and Tools: Coaxial cable, UTP Cable,
Crimping tool, Connectors etc. and preparing straight and cross cables.

Familiarization with transmission media and tools like coaxial cables, UTP (Unshielded Twisted Pair)
cables, crimping tools, connectors, and preparing straight and cross cables is important for anyone
working with computer networks, telecommunications, or audio/video systems. Here's a brief
overview of each component and how to prepare straight and cross cables using UTP cables:
1. Coaxial Cable:

• Coaxial cable is commonly used for cable television and broadband internet connections.
• It consists of a central conductor, an insulating layer, a metallic shield, and an outer insulating
layer.
• Coaxial cables are suitable for high-frequency transmission.
2. UTP Cable (Unshielded Twisted Pair):

• UTP cables are widely used for Ethernet networking (e.g., Cat5e, Cat6, Cat6a, Cat7).
• They consist of twisted pairs of copper wires with no shielding.
• UTP cables come in different categories, with Cat5e and Cat6 being common for general
networking.
3. Crimping Tool:
• A crimping tool is used to attach connectors to the ends of Ethernet cables.
It allows you to secure the cable wires to the connectors, ensuring a proper connection.
4. Connectors:

RJ45 connectors are commonly used for UTP cables in Ethernet networks.
• They have eight pins (or conductors) and are used for both straight-through and crossover
cables.
Preparing a Straight Ethernet Cable (RJ45):
a straight- To create through Ethernet cable, follow these steps:
1.Gather your materials: UTP cable, RJ45 connectors, and a crimping tool.
2.Strip about 1 inch (2.5 cm) of the outer insulation from the UTP cable using a cable stripper.
3.Untwist and straighten the pairs of wires inside the cable.
4.Arrange the wires in the following order (from left to right) for both ends:
1)Orange-White
2)Orange
3)Green-White
4)Blue
5)Blue-White
6)Green
7)Brown-White
8)Brown
1.Insert the wires into the RJ45 connector in the same order and make sure they reach the end of the
connector.
2.Use the crimping tool to crimp the connector onto the cable, ensuring a secure connection.
3.Repeat the process for the other end of the cable, and you've created a straight Ethernet cable.
Preparing a Crossover Ethernet Cable (RJ45):
To create a crossover Ethernet cable, which is used for connecting two similar devices (e.g., two
computers), follow the same steps as above, but swap the wire order for one end. Use the following
order for one end (the other end remains straight-through):
• Orange-White
• Orange
• Green-White
• Blue
• Blue-White
• Green
• Brown-White
• Brown
Creating a crossover cable allows you to connect two devices directly without the need for a hub or
switch.
Make sure to test your cables using a cable tester to ensure they are functioning correctly before
deploying them in your network.

Experiment - 2

Aim - Familiarization with network configuration and troubleshooting commands.


Certainly! Network configuration and troubleshooting commands are essential for managing and
maintaining computer networks. Below, I'll provide you with some common network commands and
their basic usage. These commands are often used in a command-line interface (CLI) or terminal on
various operating systems.
1. ipconfig / ifconfig (Windows / Linux/macOS):
ipconfig (Windows) or ifconfig (Linux/macOS) displays network configuration information,
including IP addresses, subnet masks, and gateway information.
Example (Windows):
ipconfig /all
Example (Linux/macOS):
ifconfig
2. pig:
ping is used to test network connectivity by sending ICMP (Internet Control Message
Protocol) echo requests to a remote host.
Example:
ping google.com
3. traceroute / tracert (Linux/macOS / Windows):
traceroute (Linux/macOS) and tracert (Windows) help you trace the route taken by packets to
reach a destination, showing each hop along the way.
Example (Linux/macOS):
traceroute google.com
Example (Windows):
tracert google.com
4. nslookup / dig / host (Windows / Linux/macOS):
a. These commands are used to perform DNS (Domain Name System) queries to
resolve hostnames to IP addresses and vice versa.
Example (Windows):
Nslookup google.com
Example (Linux/macOS):
dig google.com
5. netstat (Windows / Linux/macOS):
a. netstat provides information about network connections, routing tables, interface
statistics, masquerade connections, and multicast memberships.
Example (Windows):
netstat -ano
Example (Linux/macOS):
netstat -tuln
6. ssh (Secure Shell):
a. ssh is used to securely connect to a remote host or server. You can use it to manage
remote systems.
Example:
ssh username@hostname
7. ifup / ifdown (Linux):
a. These commands are used to bring network interfaces up or down. Useful for
managing network connections.
Example (bring an interface up):
sudo ifup eth0
Example (bring an interface down):
sudo ifdown eth0
8. arp (Address Resolution Protocol):
a. The arp command displays and manipulates the ARP cache, which maps IP addresses
to MAC addresses.
Example:
arp -a
9. iptables / ufw (Linux):
a. iptables and ufw are used for configuring firewall rules on Linux systems.
Example (ufw allow SSH):
sudo ufw allow 22/tcp
10. ip (Linux):
a. The ip command is a versatile tool for configuring and managing network interfaces,
routing, and more.
Example (show interface information):
ip address show

Experiment – 3

Aim - Configure a network through routing information protocol using packet tracer

Certainly, I can guide you through configuring a network using the Routing Information Protocol
(RIP) in Packet Tracer. RIP is a simple and widely used routing protocol. Here's a step-by-step guide
to set up a basic network with two routers and RIP routing protocol using Packet Tracer:
Note: Before you start, make sure you have Packet Tracer installed and open it.
1. Create Network Topology:
• Open Packet Tracer.
• Drag and drop two routers (e.g., Cisco 2811) from the device panel onto the
workspace.
• Connect them with a crossover cable (use the copper straight-through cable).
• Add a PC (e.g., a generic laptop) to each router to serve as the host devices.
2. Configure Router Interfaces:
• Double-click on Router1 to open the CLI (Command Line Interface).
• Enter privileged exec mode by typing enable and configure the interfaces:
code
configure terminal
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
exit

interface Serial0/0/0
ip address 10.0.0.1 255.0.0.0
no shutdown
exit
• Repeat the same steps for Router2, but use IP addresses appropriate for Router2's
interfaces (e.g., 192.168.2.1 and 10.0.0.2).
3. Configure RIP Routing:
• On Router1, enter global configuration mode and configure RIP:
code
configure terminal
router rip
version 2
network 192.168.1.0
network 10.0.0.0
exit
configure terminal router rip version 2 network 192.168.1.0 network 10.0.0.0 exit
• Repeat the same configuration on Router2, but use the network addresses relevant to
Router2.
4. Testing:
• You can test the connectivity between devices by using the ping command on the
PC's command prompt.
Code :
ping 192.168.2.1 // From PC1 to Router2's interface
ping 192.168.1.1 // From PC2 to Router1's interface Router1's interface
If the configuration is done correctly, you should be able to ping between devices within the network.

Experiment – 4

Aim - Configure open shortest path first using packet tracer.

Configuring Open Shortest Path First (OSPF) in Packet Tracer involves setting up a more advanced
routing protocol compared to RIP. OSPF is commonly used in larger networks. Here's how to
configure OSPF on two routers using Packet Tracer:
Note: Make sure you have Packet Tracer installed and open it.
1.Create Network Topology:
Open Packet Tracer.
• Drag and drop two routers (e.g., Cisco 2811) from the device panel onto the work
space.
• Connect them with a crossover cable (use the copper straight-through cable).
• Add a PC (e.g., a generic laptop) to each router to serve as the host devices.
2.Configure Router Interfaces:
• Double-click on Router1 to open the CLI.
• Enter privileged exec mode by typing enable and configure the interfaces:
code
co configure terminal
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
exit

interface Serial0/0/0
ip address 10.0.0.1 255.0.0.0
no shutdown
exit
Repeat the same steps for Router2 but use IP addresses appropriate for Router2's interfaces
(e.g., 192.168.2.1 and 10.0.0.2).
2.Configure OSPF Routing:
On Router1, enter global configuration mode and configure OSPF:
code
co configure terminal
router ospf 1
network 192.168.1.0 0.0.0.255 area 0
network 10.0.0.0 0.255.255.255 area 0
exit
Repeat the same configuration on Router2 with appropriate network addresses and area settings.

3. Testing:
You can test the connectivity between devices by using the ping command on the PC's command
prompt.
vbnet code
ping ping 192.168.2.1 // From PC1 to Router2's interface
ping 192.168.1.1 // From PC2 to Router1's interfaceRouter1's interface
If the configuration is done correctly, you should be able to ping between
devices within the network.

Experiment – 5

Aim - Write a program in c to simulate of ARP/RARP Protocol.

ARP (Address Resolution Protocol) and RARP (Reverse ARP) are used to map between IP addresses
and MAC (Media Access Control) addresses. Below is a simple C program that simulates ARP and
RARP protocols. This program allows a device to send ARP and RARP requests to find the MAC
address associated with an IP address and vice versa.

#include <stdio.h>
#include <string.h>

// Define a structure to represent an ARP table entry


struct ARPEntry {
char ipAddress[16]; // IP Address (e.g., "192.168.1.1")
char macAddress[18]; // MAC Address (e.g., "00:1A:2B:3C:4D:5E")
};

// Function to simulate ARP request


void sendARPRequest(struct ARPEntry arpTable[], int tableSize, char targetIP[]) {
int i;
for (i = 0; i < tableSize; i++) {
if (strcmp(arpTable[i].ipAddress, targetIP) == 0) {
printf("ARP Request: IP Address %s maps to MAC Address %s\n", targetIP,
arpTable[i].macAddress);
return;
}
}
printf("ARP Request: IP Address %s not found in ARP table\n", targetIP);
}

// Function to simulate RARP request


void sendRARPRequest(struct ARPEntry arpTable[], int tableSize, char targetMAC[]) {
int i;
for (i = 0; i < tableSize; i++) {
if (strcmp(arpTable[i].macAddress, targetMAC) == 0) {
printf("RARP Request: MAC Address %s maps to IP Address %s\n", targetMAC,
arpTable[i].ipAddress);
return;
}
}
printf("RARP Request: MAC Address %s not found in ARP table\n", targetMAC);
}

int main()
{
// Initialize the ARP table with sample entries
struct ARPEntry arpTable[3];
strcpy(arpTable[0].ipAddress, "192.168.1.1");
strcpy(arpTable[0].macAddress, "00:1A:2B:3C:4D:5E");
strcpy(arpTable[1].ipAddress, "192.168.1.2");
strcpy(arpTable[1].macAddress, "11:22:33:44:55:66");
strcpy(arpTable[2].ipAddress, "192.168.1.3");
strcpy(arpTable[2].macAddress, "AA:BB:CC:DD:EE:FF");

// Simulate ARP and RARP requests


sendARPRequest(arpTable, 3, "192.168.1.2");
sendARPRequest(arpTable, 3, "192.168.1.4");
sendRARPRequest(arpTable, 3, "11:22:33:44:55:66");
sendRARPRequest(arpTable, 3, "00:11:22:33:44:55");
return 0;
}

You might also like