Experiments
Experiments
:- Name:-
Experiment-1
Aim: To learn handling and configuration of networking hardware like RJ-45 connector and
CAT-6 cable crimping tool and practically implement the cross-wired cable and straight
through cable
1. Start by stripping off about 2 inches of the plastic jacket off the end of the cable. Be very careful at this point, as
to not nick or cut into the wires, which are inside. Doing so could alter the characteristics of your cable, or even
worse render is useless. Check the wires, one more time for nicks or cuts. If there are any, just whack the whole end
off, and start over.
2. Spread the wires apart, but be sure to hold onto the base of the jacket with your other hand. You do not want the
wires to become untwisted down inside the jacket. Category 5 cable must only have 1/2 of an inch of 'untwisted'
wire at the end; otherwise it will be 'out of spec'. At this point, you obviously have ALOT more than 1/2 of an inch
of un-twisted wire.
3. You have 2 end jacks, which must be installed on your cable. If you are using a pre-made cable, with one of the
ends whacked off, you only have one end to install - the crossed over end. Below are two diagrams, which show
how you need to arrange the cables for each type of cable end. Decide at this point which end you are making and
examine the associated picture below.
Experiment-2
Roll No.:- Name:-
Topology Diagram
Step 7: If ping command works successfully, then it means all these PCs are able to communicate and
share data between them and we’ve build our network of four PCs and a Hub successfully.
Objectives
Perform an initial configuration of a Cisco Catalyst 2960 switch
Topology Diagram
Roll No.:- Name:-
Background / Preparation
In this activity, you will configure these settings on the customer Cisco Catalyst 2960 switch:
Host name
Console password
vty password
Privileged EXEC mode password
Privileged EXEC mode secret
IP address on VLAN1 interface
Default gateway
Note: Not all commands are graded by Packet Tracer.
Switch>enable
Switch#configure terminal
Switch(config)#hostname CustomerSwitch
b. From line configuration mode, set the password to cisco and require the password to be entered at
login.
CustomerSwitch(config-line)#password cisco
CustomerSwitch(config-line)#login
CustomerSwitch(config-line)#exit
a. From global configuration mode, switch to the configuration mode for the vty lines 0 through 15.
CustomerSwitch(config)#line vty 0 15
b. From line configuration mode, set the password to cisco and require the password to be entered at
login.
CustomerSwitch(config-line)#password cisco
CustomerSwitch(config-line)#login
CustomerSwitch(config-line)#exit
CustomerSwitch(config)#end
CustomerSwitch#ping [Link]
Reflection
a. What is the significance of assigning the IP address to the VLAN1 interface instead of any of the Fast
Ethernet interfaces?
b. What command is necessary to enforce password authentication on the console and vty lines?
c. How many gigabit ports are available on the Cisco Catalyst 2960 switch that you used in the activity?
Experiment- 3
Program Name:
WAP to run and use services/commands like ping, trace route, arp, ipconfig, netstat etc.
Theory Concepts:
1. Ping
Verifies IP-level connectivity to another TCP/IP computer by sending Internet Control Message Protocol (ICMP) Echo
Request messages. The receipt of corresponding Echo Reply messages are displayed, along with round-trip times. Ping is
the primary TCP/IP command used to troubleshoot connectivity, reachability, and name resolution. You can use ping to
test both the computer name and the IP address of the computer.
2. Ipconfig
Displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol (DHCP)
and Domain Name System (DNS) settings. This command is most useful on computers that are configured to obtain an IP
address automatically. This enables users to determine which TCP/IP configuration values have been configured by
DHCP, Automatic Private IP Addressing (APIPA), or an alternate configuration.
If the Adapter name contains any spaces, use quotation marks around the adapter name (that is, "Adapter
Name").
For adapter names, ipconfig supports the use of the asterisk (*) wildcard character to specify either adapters with
names that begin with a specified string or adapters with names that contain a specified string.
For example, Local* matches all adapters that start with the string Local and *Con* matches all adapters that
contain the string Con.
Roll No.:- Name:-
3. Arp
Displays and modifies entries in the Address Resolution Protocol (ARP) cache, which contains one or more tables that are
used to store IP addresses and their resolved Ethernet or Token Ring physical addresses. There is a separate table for each
Ethernet or Token Ring network adapter installed on your computer.
4. TRACERT
If someone would like to know how he goes from his house to his office he could just tell the list of the crossroads where
he passes. The same way we can ask the data sent over from your computer to the web server which way does it go,
through which devices? We ask it by using the utility called traceroute. In most computers today you can use this tool
from the command line: In UNIX machines it is called traceroute, in MS Windows machines it is called tracert.
Roll No.:- Name:-
5. NETSTAT Command
This command is used to get information about the open connections on your system (ports, protocols being used, etc.),
incoming and outgoing data and also the ports of remote systems to which you are connected.
Experiment-4
Roll No.:- Name:-
Topology
Objectives
Part 1: Capture and Analyze Local ICMP Data in Wireshark
Part 2: Capture and Analyze Remote ICMP Data in Wireshark
Background / Scenario
Wireshark is a software protocol analyzer, or "packet sniffer" application, used for network troubleshooting, analysis,
software and protocol development, and education. As data streams travel back and forth over the network, the sniffer
"captures" each protocol data unit (PDU) and can decode and analyze its content according to the appropriate RFC or
other specifications.
Wireshark is a useful tool for anyone working with networks and can be used with most labs in the CCNA courses for
data analysis and troubleshooting. In this lab, you will use Wireshark to capture ICMP data packet IP addresses and
Ethernet frame MAC addresses.
Required Resources
1 PC (Windows with internet access)
Additional PCs on a local-area network (LAN) will be used to reply to ping requests.
Instructions
In a command prompt window, enter ipconfig /all, to the IP address of your PC interface, its description, and its
MAC (physical) address.
C:\Users\Student> ipconfig /all
Roll No.:- Name:-
Windows IP Configuration
Note: If the PC of your team member does not reply to your pings, this may be because the PC firewall of the
team member is blocking these requests. Please see Error: Reference source not found for information on how
to allow ICMP traffic through the firewall using Windows.
Stop capturing data by clicking the Stop Capture icon.
[Link]
[Link]
[Link]
Note: When you ping the URLs listed, notice that the Domain Name Server (DNS) translates the URL to an IP
address. Note the IP address received for each URL.
You can stop capturing data by clicking the Stop Capture icon.
Reflection Question
Why does Wireshark show the actual MAC address of the local hosts, but not the actual MAC address for the remote
hosts?
MAC addresses for remote hosts are not known on the local network, so the MAC address of the default-gateway is
used. After the packet reaches the default-gateway router, the Layer 2 information is stripped from the packet and a
new Layer 2 header is attached with the destination MAC address of the next hop ro
Experiment-5
Roll No.:- Name:-
Aim: Configure Initial Router Settings.
Objectives:
To understand and perform basic configuration tasks on a router using the CLI.
To configure hostname, passwords, and interface IP addresses for initial router setup.
Software Required:
Theory:
Configuring the initial settings of a router is a fundamental step in setting up a functional network. It involves
accessing the router’s command-line interface (CLI) through a console connection and performing basic
configurations to ensure secure and stable operation. These settings typically include assigning a hostname to the
router, setting passwords for user modes (user EXEC, privileged EXEC, and console/VTY lines), and configuring
banners for security notices. Additionally, it may involve setting IP addresses on interfaces to enable
communication with other devices and saving the configuration to the startup configuration file to ensure settings
persist after a reboot. Initial configuration lays the groundwork for further advanced setup, including routing
protocols, access control, and network services, making it an essential part of network administration.
Use this syntax checker to practice configuring the initial settings on a router.
Router(config-line)# login
Router(config-line)# transport input {ssh | telnet}
1. Secure all passwords in the config file.
Router(config-line)# exit
Router(config)# end
At this point, routers have their basic configurations. The next step is to configure their
interfaces. This is because routers are not reachable by end devices until the interfaces are
are many different types of interfaces available on Cisco routers. For example, the Cisco ISR 4321
router is equipped with two Gigabit Ethernet interfaces:
GigabitEthernet 0/0/0 (G0/0/0) GigabitEthernet 0/0/1
(G0/0/1)
The task to configure a router interface is very similar to a management SVI on a switch. Specifically, it includes
issuing the following commands:
the description command would be helpful to enter the third-party connection and contact information. No
shutdown command activates the interface and is like powering on the interface
Procedure:
R1> enable
R1(config-if)# exit
Message Output:
Interface GigabitEthernet0/0/0 changed state to down → up
if)# no shutdown
R1(config-if)# exit
Message Output:
Interface GigabitEthernet0/0/1 changed state to down → up
Verification Commands
Command Description
show ip interface brief Shows IPv4 address and status of all interfaces
show ipv6 interface brief Shows IPv6 address and status of all interfaces
show ip route Displays IPv4 routing table
show ipv6 route Displays IPv6 routing table
show interfaces Displays detailed statistics (IPv4 only) for all
interfaces
show ip interfaces Displays IPv4 interface statistics
show ipv6 interface Displays IPv6 interface statistics
Result:
The initial router settings were successfully configured, including hostname assignment, password protection
for different access modes, interface IP address configuration, and saving the configuration to startup
memory. The router is now ready for basic communication within the network.
Interpretation:
This practical demonstrates the foundational steps required to prepare a router for network integration. By
configuring essential parameters, the device becomes secure, identifiable, and capable of communication
with other devices. It ensures the router is properly initialized for further networking tasks and real-time
operation.
Roll No.:- Name:-
Experiment-6
Aim: Fixed length and Variable Length Subnet Mask (VLSM)/Subnetting implementation.
Objectives:
Theory:
Subnetting is the process of dividing a larger network into smaller, more manageable sub- networks to
improve routing efficiency, enhance security, and optimize IP address usage. Fixed Length Subnet
Masking (FLSM) uses the same subnet mask for all subnets, resulting in equal-sized subnets, which is
simple but can lead to IP address wastage. Variable Length Subnet Masking (VLSM) allows different
subnet masks within the same network, creating subnets of varying sizes based on specific host
requirements, thereby utilizing IP addresses more efficiently. Implementing subnetting involves calculating
subnet IDs, broadcast addresses, valid IP ranges, and required mask lengths based on the number of hosts
or subnets needed.
/26 [Link] –
LAN A 50 ([Link]) [Link]/26 [Link]
/27 [Link] –
LAN B 30 ([Link]) [Link]/27 [Link]
/28 [Link] –
LAN C 10 ([Link]) [Link]/28 [Link]
/30 [Link] –
WAN 2 ([Link]) [Link]/30 [Link]
Procedure:
Cisco Packet Tracer Configuration
1. Drag and drop a router, PCs, and a switch into the Packet Tracer workspace.
2. Connect each PC to the switch using straight-through cables.
3. Connect the switch to the router using suitable interfaces.
4. Assign IP addresses to PCs based on the subnetting plan.
5. Configure the router using CLI as follows:
Router> enable
Router# configure terminal
! LAN A
Router(config)# interface fastEthernet 0/0
Router(config-if)# ip address [Link] [Link]
Router(config-if)# no shutdown
! LAN B
Router(config)# interface fastEthernet 0/1
Router(config-if)# ip address [Link] [Link]
Router(config-if)# no shutdown
! LAN C
Router(config)# interface fastEthernet 1/0
Router(config-if)# ip address [Link] [Link]
Router(config-if)# no shutdown
! WAN (if connecting to another router) Router(config)#
interface serial 0/0/0
Router(config-if)# ip address [Link] [Link]
Router(config-if)# no shutdown
Roll No.:- Name:-
PC Configuration
Each PC must be manually configured with:
IP Address
Subnet Mask
Default Gateway (Router’s IP on that subnet)
Examples:
PC in LAN A
IP Address: [Link]
Subnet Mask: [Link]
Default Gateway: [Link]
PC in LAN B
IP Address: [Link]
Subnet Mask: [Link]
Default Gateway: [Link]
PC in LAN C
IP Address: [Link]
Subnet Mask: [Link]
Default Gateway: [Link]
Output:
Successful replies indicate correct subnetting and routing.
"Request timed out" indicates misconfiguration in IP, mask, or gateway.
Result:
The Fixed-Length and Variable-Length Subnet Masking (VLSM) were successfully implemented using Cisco
Packet Tracer. Devices in different subnets communicated effectively through proper configuration of IP addresses
and routing interfaces.
Interpretation:
This task highlights the importance of subnetting in efficient IP address management. Fixed- length subnetting
ensures uniformity, while VLSM provides flexibility for real-world network scenarios by matching subnet sizes to
actual needs. Understanding both methods is crucial for effective network planning and design.
Roll No.:- Name:-
Experiment-7
Aim: VLAN Creation and Inter-VLAN Routing Using TRUNK Port on Router.
Objectives:
Inter-VLAN Routing
VLANs are used to segment switched Layer 2 networks for a variety of reasons. Regardless of the reason,
hosts in one VLAN cannot communicate with hosts in another VLAN unless there is a router or a Layer 3
switch to provide routing services. Inter-VLAN routing is the process of forwarding network traffic from
one VLAN to another VLAN.
Legacy Inter-VLAN routing - This is a legacy solution. It does not scale well.
Router-on-a-Stick - This is an acceptable solution for a small to medium-sized network.
Layer 3 switch using switched virtual interfaces (SVIs) - This is the most scalable
solution for medium to large organizations.
Topology Summary:
Procedure:
A. Click on Switch0
B. Go to Config tab
C. Under VLAN Database:
o Add VLAN 10 → Name: Sales
o Add VLAN 20 → Name: HR
D. Under Interface > FastEthernet0/1 & 0/2:
o Set Mode = Access
o Assign VLAN = 10
E. Under Interface > FastEthernet0/3 & 0/4:
o Set Mode = Access
o Assign VLAN = 20
F. Under Interface > FastEthernet0/24:
o Set Mode = TRUNK
enable
Router# configure terminal
Roll No.:- Name:-
! Enable physical TRUNK port Router(config)#
interface gigabitEthernet 0/0 Router(config-if)# no
shutdown Router(config-if)# exit
Step 4: Verification
Output:
VLANs were successfully created and assigned to respective switch ports. A trunk port was configured
between the switch and the router. Inter-VLAN routing was established using sub-interfaces on the router,
enabling communication between devices in different VLANs. Devices in separate VLANs were able to
ping each other, confirming proper routing.
Result:
The VLANs were configured correctly, and inter-VLAN communication was achieved through the trunk
port and router sub-interfaces.
Interpretation:
This activity demonstrates the segmentation of a network using VLANs for improved management and security,
along with the use of a router-on-a-stick configuration to enable communication between them. Configuring the
trunk port and sub-interfaces ensures that VLAN-tagged traffic is properly routed, allowing devices in different
VLANs to interact as needed.
Roll No.:- Name:-
Experirment-08
Aim:10 Router-on-a-Stick Inter-VLAN Routing
Router-on-a-Stick Scenario:-
• In the figure, the R1 GigabitEthernet 0/0/1 interface is connected to the S1 FastEthernet 0/5 port. The S1
FastEthernet 0/1 port is connected to the S2 FastEthernet 0/1 port. These are trunk links that are required to
forward traffic within and between VLANs.
• To route between VLANs, the R1 GigabitEthernet 0/0/1 interface is logically divided into three subinterfaces, as
shown in the table. The table also shows the three VLANs that will be configured on the switches.
• Assume that R1, S1, and S2 have initial basic configurations. Currently, PC1 and PC2 cannot ping each other
because they are on separate networks. Only S1 and S2 can ping each other, but they but are unreachable by PC1
or PC2 because they are also on different networks.
• To enable devices to ping each other, the switches must be configured with VLANs and trunking, and the router
must be configured for inter-VLAN routing.
R1 Sub-interface Configuration: -
The router-on-a-stick method requires you to create a subinterface for each VLAN to be routed. A subinterface is
created using the interface interface_id subinterface_id global configuration mode command. The subinterface syntax
is the physical interface followed by a period and a subinterface [Link] not required, it is customary to match
the subinterface number with the VLAN number.
Each subinterface is then configured with the following two commands:
• encapsulation dot1q vlan_id [native] - This command configures the subinterface to respond to 802.1Q
encapsulated traffic from the specified vlan-id. The native keyword option is only appended to set the native
VLAN to something other than VLAN 1.
• ip address ip-address subnet-mask - This command configures the IPv4 address of the subinterface. This address
typically serves as the default gateway for the identified VLAN.
Repeat the process for each VLAN to be routed. Each router subinterface must be assigned an IP address on a unique
subnet for routing to occur. When all subinterfaces have been created, enable the physical interface using the no
shutdown interface configuration command. If the physical interface is disabled, all subinterfaces are disabled.
R1 Subinterface Configuration (Cont.)
In the configuration, the R1 G0/0/1 subinterfaces are configured for VLANs 10, 20, and 99.
• show ip route
• show ip interface brief
• show interfaces
• show interfaces trunk
Roll No.:- Name:-
Experiment-09
Aim: Implementation of a Hamming (7,4) code to limit the noise. We have to code the 4- bit data in to 7-bit
data by adding 3 parity bits.
Objectives:
To implement Hamming (7,4) encoding to detect and correct single-bit errors in data transmission.
To demonstrate the use of parity bits for error detection and correction in 4-bit data using Hamming
code.
Theory:
Hamming (7,4) code is an error detection and correction technique used in digital communication systems.
It was developed by Richard Hamming to improve data reliability over noisy channels. This code converts
4 bits of original data into 7 bits by adding 3 parity bits, which help in detecting and correcting single-bit
errors during transmission. The technique is based on even parity logic and ensures that the receiver can
locate and fix one- bit errors without retransmission, making it highly effective in reliable data
communication.
● Total = 7 bits
Parity bits are placed in positions that are powers of 2 (1, 2, 4).
Each parity bit checks certain positions using even parity (i.e., number of 1s should be even):
● P1 covers: 1, 3, 5, 7
● P2 covers: 2, 3, 6, 7
● P3 covers: 4, 5, 6, 7
Roll No.:- Name:-
Algorithm:
Flow Chart:
Roll No.:- Name:-
Code:
import [Link].*;
class Hamming {
// Function to generate Hamming (7,4) code
void generateData(int[] data, ArrayList<Integer> parityPositions) {
int[] d = new int[11]; // Using 11 bits to simulate extended space, only 0-10 used
int dataIdx = 0;
// Fill data into positions not reserved for parity
for (int i = 0; i < 11; i++) {
if () { d[i] =
data[dataIdx++];
}
}
// Calculate parity bits using XOR operations
d[0] = d[2] ^ d[4] ^ d[6] ^ d[8] ^ d[10]; // P1
d[1] = d[2] ^ d[5] ^ d[6] ^ d[9] ^ d[10]; // P2 d[3] =
d[4] ^ d[5] ^ d[6]; // P4
d[7] = d[8] ^ d[9] ^ d[10]; // P8
// Output the final encoded data [Link]("\nHamming
coded data bits sent:"); for (int i = 0; i < 11; i++) {
[Link](d[i] + " ");
}
}
public static void main(String[] args) { Hamming h =
new Hamming();
Scanner scan = new Scanner([Link]); int[] data
= new int[7];
// Input data bits (7 positions to fill non-parity spots)
[Link]("Enter 7 bits:");
for (int i = 0; i < 7; i++) { data[i] =
[Link]();
}
// Display input bits
[Link]("Data bits:\n"); for (int i
= 0; i < 7; i++) {
[Link](data[i] + " ");
}
// Define parity positions (powers of 2): 0,1,3,7
ArrayList<Integer> parityPositions = new ArrayList<>([Link](0, 1, 3, 7));
Roll No.:- Name:-
Result:
The Hamming (7,4) code was successfully implemented to encode 4-bit input data into a 7-bit codeword by
adding three parity bits. The encoding process ensures that single-bit errors can be detected and corrected,
improving data reliability during transmission.
Interpretation:
By calculating and inserting parity bits at appropriate positions (positions 1, 2, and 4), the system creates a
redundant pattern that allows identification and correction of any single- bit error in the 7-bit codeword.
This demonstrates the effectiveness of Hamming codes in minimizing the impact of noise in
communication systems.
Roll No.:- Name:-
Experiment-10
Aim: Implementation of CRC error detection algorithm.
Objectives:
To implement the CRC algorithm for detecting errors in data transmission.
Software Required: Java Development Kit (JDK), IDE (VS Code)
Theory:
Cyclic Redundancy Check (CRC) is an error-detecting technique commonly used in digital networks and
storage devices to detect accidental changes to raw data. It works by applying a mathematical algorithm to
a block of data to generate a short, fixed-size binary sequence known as the CRC or checksum.
Example:
1101 ) 101100000
1101 ← XOR with first 4 bits
0110
1101 ← XOR next 4 bits (after bringing down 1 bit)
0011
1101 ← XOR next 4 bits
0110
1101 ← XOR next 4 bits
Code:
import [Link].*; class
CRCExample1 {
public static void main(String args[])
{
Scanner scan = new Scanner([Link]); int size;
Roll No.:- Name:-
[Link]("Enter the size of the data array: "); size =
[Link]();
int data[] = new int[size];
[Link]("Enter data bits in the array one by one: "); for(int i = 0 ;
i < size ; i++)
{
[Link]("Enter bit " + (size-i) + ":"); data[i] =
[Link]();
}
[Link]("Enter the size of the divisor array:"); size =
[Link]();
int divisor[] = new int[size];
[Link]("Enter divisor bits in the array one by one: "); for(int i = 0 ; i <
size ; i++)
{
[Link]("Enter bit " + (size-i) + ":"); divisor[i] =
[Link]();
}
int rem[] = DWD(data, divisor);
[Link]("Final Remainder is"); for(int i = 0; i
< [Link]-1; i++) { [Link](rem[i]);
}
[Link]("\nGenerated CRC code is: "); for(int i
= 0; i < [Link]; i++)
{
[Link](data[i]);
}
for(int i = 0; i < [Link]-1; i++)
{
[Link](rem[i]);
Roll No.:- Name:-
} [Link]();
int sentData[] = new int[[Link] + [Link] - 1]; [Link]("Enter bits
in the array which you want to send: "); for(int i = 0; i < [Link]; i++) {
[Link]("Enter bit " +([Link] - i)+ ":"); sentData[i] =
[Link]();
}
receiveData(sentData, divisor);
}
static int[] DWD(int oldData[], int divisor[])
{
int cal[] = new int[[Link]]; int i;
int data[] = new int[[Link] + [Link]];
// use system's arraycopy() method for copying data into rem and data arrays [Link](oldData, 0, data, 0,
[Link]);
[Link](data, 0, cal, 0, [Link]);
// iterate the oldData and exor the bits of the remainder and the divisor for(i = 0; i <
[Link]; i++) {
[Link]((i+1) + ".) First data bit is : "+ cal[0]);
[Link]("Remainder : ");
if(cal[0] == 1) {
// We have to exor the remainder bits with divisor bits for(int j =
1; j < [Link]; j++) {
cal[j-1] = exorOperation(cal[j], divisor[j]);
[Link](cal[j-1]);
}}
else {
// We have to exor the remainder bits with 0 for(int j
= 1; j < [Link]; j++) {
cal[j-1] = exorOperation(cal[j], 0);
Roll No.:- Name:-
[Link](cal[j-1]);
}}
// The last bit of the remainder will be taken from the data // This is the 'carry' taken from the dividend after
every step of division
cal[[Link]-1] = data[i+[Link]];
[Link](cal[[Link]-1]);
}
return cal;
}
//create exorOperation() method to perform exor data static int exorOperation(int x, int y)
{
// This simple function returns the exor of two bits if(x == y) { return 0;
}
return 1;
}
// method to print received data
static void receiveData(int data[], int divisor[]) { int rem[]
= DWD(data, divisor);
// Division is done
for(int i = 0; i < [Link]; i++)
{ if(rem[i] != 0) {
// if the remainder is not equal to zero, data is currupted
[Link]("Currupted data received..."); return;
}
}
[Link]("Data received without any error.");
}
}
Roll No.:- Name:-
Result:
The original 4-bit data 101100 was encoded using the CRC generator polynomial 1101, producing the
transmitted message 101100101. At the receiver side, binary division of the received message
101100101 by the same generator yielded a remainder of 000.
Interpretation:
The zero remainder at the receiver end confirms that no error occurred during transmission. This
validates the effectiveness of the CRC method in detecting transmission errors. CRC ensures data
integrity by appending a computed remainder (checksum) to the data, which the receiver verifies to
detect any corruption.