0% found this document useful (0 votes)
15 views38 pages

Experiments

The document outlines a series of experiments focused on networking hardware and software configurations, including RJ-45 connector crimping, hub and switch configuration using Cisco Packet Tracer, and network traffic analysis with Wireshark. Each experiment includes specific aims, procedures, and objectives, such as configuring IP addresses, testing connectivity with ping commands, and capturing ICMP data. The document serves as a practical guide for learning essential networking skills and tools in a lab environment.

Uploaded by

c8cxmvccnv
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)
15 views38 pages

Experiments

The document outlines a series of experiments focused on networking hardware and software configurations, including RJ-45 connector crimping, hub and switch configuration using Cisco Packet Tracer, and network traffic analysis with Wireshark. Each experiment includes specific aims, procedures, and objectives, such as configuring IP addresses, testing connectivity with ping commands, and capturing ICMP data. The document serves as a practical guide for learning essential networking skills and tools in a lab environment.

Uploaded by

c8cxmvccnv
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

Roll No.

:- 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

Apparatus (Components): RJ-45 connector, Climping Tool, Twisted pair Cable

Procedure: To do these practical following steps should be done:

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.

Diagram shows you how to prepare Cross wired connection


Roll No.:- Name:-

Diagram shows you how to prepare straight through wired connection

Experiment-2
Roll No.:- Name:-

Aim: Hub and Switch configuration using packet tracer.

Objectives: Connecting Multiple Computers Using Hub in Cisco Packet Trace

Topology Diagram

Step 1: Open the Cisco Packet Tracer.


Step 2: On opening Cisco packet tracer, click on End devices from bottom left icon menus, Add four
PCs and a hub into the screen of the simulator.
Step 3: Connect all PCs and hub with copper straight cable by selecting it through the cables menu
from the bottom left menus in the simulator. Green signal in the wire shows they’re ready to
communicate.
Step 4: Now, we’ve to give unique IP address to each PC. Click on each PC, go to Desktop section
and then click on IP configuration to give IP address.
IP Address Subnet Mask
[Link] [Link]
[Link] [Link]
[Link] [Link]
[Link] [Link]
Step 5: Click on a PC, go to Desktop and then click on Command prompt.
Step 6: After that test the ping command in command prompt to check the connectivity between these
PCs.

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.

Step 1: Configure the switch host name.


a. From the Customer PC, use a console cable and terminal emulation software to connect to the console of
the customer Cisco Catalyst 2960 switch.
b. Set the host name on the switch to CustomerSwitch using these commands.

Switch>enable
Switch#configure terminal

Switch(config)#hostname CustomerSwitch

Step 2: Configure the privileged mode password and secret.


a. From global configuration mode, configure the password as cisco.
CustomerSwitch(config)#enable password cisco
b. From global configuration mode, configure the secret as cisco123.
CustomerSwitch(config)#enable secret cisco123
Step 3: Configure the console password.
a. From global configuration mode, switch to configuration mode to configure the console line.
CustomerSwitch(config)#line console 0

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

Step 4: Configure the vty password.


Roll No.:- Name:-

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

Step 5: Configure an IP address on interface VLAN1.


From global configuration mode, switch to interface configuration mode for VLAN1, and assign the IP address
[Link] with the subnet mask of [Link].
CustomerSwitch(config)#interface vlan 1 CustomerSwitch(config-
if)#ip address [Link] [Link] CustomerSwitch(config-
if)#no shutdown CustomerSwitch(config-if)#exit

Step 6: Configure the default gateway.


a. From global configuration mode, assign the default gateway to [Link].
CustomerSwitch(config)#ip default-gateway [Link]
b. Click the Check Results button at the bottom of this instruction window to check your work.

Step 7: Verify the configuration.


The Customer Switch should now be able to ping the ISP Server at [Link]. The first one or two pings may
fail while ARP converges.

CustomerSwitch(config)#end
CustomerSwitch#ping [Link]

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
..!!!
Success rate is 60 percent (3/5), round-trip min/avg/max = 181/189/197 ms
CustomerSwitch#

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.

To test a TCP/IP configuration by using the ping command:


Roll No.:- Name:-
 To quickly obtain the TCP/IP configuration of a computer, open Command Prompt, and then type ipconfig .
From the display of the ipconfig command, ensure that the network adapter for the TCP/IP configuration you are testing is
not in a Media disconnected state.
 At the command prompt, ping the loopback address by typing ping [Link]
 Ping the IP address of the computer.
 Ping the IP address of the default gateway. If the ping command fails, verify that the default gateway IP address
is correct and that the gateway (router) is operational.
 Ping the IP address of a remote host (a host that is on a different subnet). If the ping command fails, verify that
the remote host IP address is correct, that the remote host is operational, and that all of the gateways (routers) between this
computer and the remote host are operational.
 Ping the IP address of the DNS server. If the ping command fails, verify that the DNS server IP address is
correct, that the DNS server is operational, and that all of the gateways (routers) between this computer and the DNS
server are operational.

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:-

Objective: Use Wireshark to View Network Traffic.

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

Capture and Analyze Local ICMP Data in Wireshark


In Part 1 of this lab, you will ping another PC on the LAN and capture ICMP requests and replies in Wireshark. You
will also look inside the frames captured for specific information. This analysis should help to clarify how packet
headers are used to transport data to their destination.

Retrieve your PC interface addresses.


For this lab, you will need to retrieve your PC IP address and its network interface card (NIC) physical address, also
called the MAC address.
Open a Windows command prompt.

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

Host Name . . . . . . . . . . . . : DESKTOP-NB48BTC


Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Ethernet:

Connection-specific DNS Suffix . :


Description . . . . . . . . . . . : Intel(R) 82577LM Gigabit Network Connection
Physical Address. . . . . . . . . :00-26-B9-DD-00-91
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::d809:d939:110f:1b7f%20(Preferred)
IPv4 Address. . . . . . . . . . . : [Link](Preferred)
Subnet Mask . . . . . . . . . . . : [Link]
Default Gateway . . . . . . . . . : [Link]
<output omitted>
Ask a team member or team members for their PC IP address and provide your PC IP address to them. Do not provide
them with your MAC address at this time.
Close a Windows Command Prompt.

Start Wireshark and begin capturing data.


Navigate to Wireshark. Double-click the desired interface to start the packet capture. Make sure the desired interface
has traffic.
Information will start scrolling down the top section in Wireshark. The data lines will appear in different colors based
on protocol.
This information can scroll by very quickly depending on what communication is taking place between your PC
and the LAN. We can apply a filter to make it easier to view and work with the data that is being captured by
Wireshark.
For this lab, we are only interested in displaying ICMP (ping) PDUs. Type icmp in the Filter box at the top of
Wireshark and press Enter, or click the Apply button (arrow sign) to view only ICMP (ping) PDUs.
This filter causes all data in the top window to disappear, but you are still capturing the traffic on the interface.
Navigate to a command prompt window and ping the IP address that you received from your team member.
C:\> ping [Link]

Pinging [Link] with 32 bytes of data:


Reply from [Link]: bytes=32 time<1ms TTL=128
Reply from [Link]: bytes=32 time<1ms TTL=128
Reply from [Link]: bytes=32 time<1ms TTL=128
Reply from [Link]: bytes=32 time<1ms TTL=128

Ping statistics for [Link]:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
Roll No.:- Name:-
Notice that you start seeing data appear in the top window of Wireshark again.

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.

Examine the captured data.


In Step 3, examine the data that was generated by the ping requests of your team member PC. Wireshark data is
displayed in three sections: 1) The top section displays the list of PDU frames captured with a summary of the IP
packet information listed; 2) the middle section lists PDU information for the frame selected in the top part of the
screen and separates a captured PDU frame by its protocol layers; and 3) the bottom section displays the raw data of
each layer. The raw data is displayed in both hexadecimal and decimal form.
Click the first ICMP request PDU frames in the top section of Wireshark. Notice that the Source column has your PC
IP address, and the Destination column contains the IP address of the teammate PC that you pinged.
With this PDU frame still selected in the top section, navigate to the middle section. Click the plus sign to the left of
the Ethernet II row to view the destination and source MAC addresses.
Questions:

Does the source MAC address match your PC interface?


T your answers here.
Yes
Does the destination MAC address in Wireshark match your team member MAC address?
Type your answers here.
Yes
How is the MAC address of the pinged PC obtained by your PC?
Roll No.:- Name:-
Type your answers here.
The MAC address is obtained through an ARP request.
Note: In the preceding example of a captured ICMP request, ICMP data is encapsulated inside an IPv4 packet PDU (IPv4
header) which is then encapsulated in an Ethernet II frame PDU (Ethernet II header) for transmission on the LAN.

Capture and Analyze Remote ICMP Data in Wireshark


In Part 2, you will ping remote hosts (hosts not on the LAN) and examine the generated data from those pings. You
will then determine what is different about this data from the data examined in Part 1.

Start capturing data on the interface.


Start the data capture again.
A window prompts you to save the previously captured data before starting another capture. It is not necessary to save
this data. Click Continue without Saving.
With the capture active, ping the following three website URLs from a Windows command prompt:
Open a Windows command prompt

[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.

Examining and analyzing the data from the remote hosts.


Review the captured data in Wireshark and examine the IP and MAC addresses of the three locations that you pinged.
List the destination IP and MAC addresses for all three locations in the space provided.
Questions:

IP address for [Link]:


Type your answers here.
MAC address for [Link]:
Type your answers here.
IP address for [Link]:
Type your answers here.
MAC address for [Link]:
Type your answers here.
IP address for [Link]:
Type your answers here.
MAC address for [Link]:
Type your answers here.
P addresses: [Link], [Link], [Link] (these IP addresses may vary)
AC address: This will be the same for all three locations. It is the physical address of the default-gateway LAN interface of
the router.
What is significant about this information?
Type your answers here.
The MAC addresses for all three locations are the same.
How does this information differ from the local ping information you received in Part 1?
Roll No.:- Name:-
Type your answers here.
A ping to a local host returns the MAC address of the PC NIC. A ping to a remote host returns the MAC address of the
default gateway LAN interface.
Close the Windows command prompt

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:

 Cisco Packet Tracer


Topology Diagram:

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.

 Configure the device name.


 Secure the privileged EXEC mode.
 Secure and enable remote SSH and Telnet access.
Roll No.:- Name:-
 Secure all plaintext passwords.
 Provide legal notification.
The following tasks should be completed when configuring initial settings on a router.

1. Configure the device name.

Router(config)# hostname hostname

2. Secure privileged EXEC mode.

Router(config)# enable secret password

3. Secure user EXEC mode.

Router(config)# line console 0


Router(config-line)# password password
Router(config-line)# login

4. Secure remote Telnet / SSH access.

Router(config-line)# line vty 0 4


Router(config-line)# password password

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)# service password-encryption


2. Provide legal notification.

Router(config)# banner motd delimiter message delimiter

3. Save the configuration.

Router(config)# end

Router# copy running-config startup-config


Roll No.:- Name:-
Configure Router Interfaces

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:

Router(config)# interface type-and-number


Router(config-if)# description description-text
Router(config-if)# ip address ipv4-address
subnet-mask Router(config-if)# ipv6 address
ipv6-address/prefix-length Router(config-if)# no
shutdown

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:

Router Initial Configuration – R1

Step 1: Enter Privileged EXEC Mode

R1> enable

Step 2: Enter Global Configuration Mode

R1# configure terminal

Configure Interface G0/0/0 (LAN Link)

R1(config)# interface gigabitEthernet 0/0/0

R1(config-if)# description Link to LAN

R1(config-if)# ip address [Link] [Link]

R1(config-if)# ipv6 address 2001:db8:acad:10::1/64


Roll No.:- Name:-
R1(config-if)# no shutdown

R1(config-if)# exit

Message Output:
Interface GigabitEthernet0/0/0 changed state to down → up

Line protocol on Interface GigabitEthernet0/0/0 changed state to up

Configure Interface G0/0/1 (Link to R2)

R1(config)# interface gigabitEthernet 0/0/1

R1(config-if)# description Link to R2

R1(config-if)# ip address [Link] [Link] R1(config-

if)# no shutdown

R1(config-if)# exit

Message Output:
Interface GigabitEthernet0/0/1 changed state to down → up

Line protocol on Interface GigabitEthernet0/0/1 changed state to up

Verification Commands

Show IP Interface Brief

R1# show ip interface brief

Interface IP-Address Status Protocol


GigabitEthernet0/0/0 [Link] up up
GigabitEthernet0/0/1 [Link] up up
Vlan1 unassigned down down

Show IPv6 Interface Brief

R1# show ipv6 interface brief


Roll No.:- Name:-

Interface IPv6 Address Status


GigabitEthernet0/0/0 2001:db8:acad:10::1 up/up
GigabitEthernet0/0/1 2001:db8:feed:224::1 up/up
Vlan1 unassigned down/down

Useful Show Commands Summary

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:

 To implement fixed-length subnetting for equal distribution of IP addresses across subnets.


 To apply VLSM for efficient IP address allocation based on varying host requirements.
Software Required:
Cisco Packet Tracer
Topology Diagram:

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.

Given Network: [Link]/24


Subnetting using VLSM based on host requirements:
Roll No.:- Name:-
Hosts
Subnet Required Subnet Mask Subnet Address Usable IP Range

/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]

Testing and Verification


Use the ping command from one PC to another in a different subnet: ping
[Link]
ping [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:

 Create VLANs and assign ports using Cisco Packet Tracer.


 Configure a Router-on-a-Stick to enable inter-VLAN communication using a
TRUNK link.
 Use CLI only for Router configuration.
 Highlight TRUNK usage on Switch-Router link.
Software Required:

 Cisco Packet Tracer


Theory:

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.

There are three inter-VLAN routing options:

 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:

Device Interface Connection VLAN IP Address


PC0 FastEthernet0 Switch0 Fa0/1 10 [Link]
PC1 FastEthernet0 Switch0 Fa0/2 10 [Link]
PC2 FastEthernet0 Switch0 Fa0/3 20 [Link]
PC3 FastEthernet0 Switch0 Fa0/4 20 [Link]
Switch0 Fa0/1–4 PCs 10/20 —
Switch0 Fa0/24 Router G0/0 TRUNK —
VLAN 10 sub-int
Router0 G0/0.10 10 [Link]
Roll No.:- Name:-
Device Interface Connection VLAN IP Address
Router0 G0/0.20 VLAN 20 sub-int 20 [Link]

Procedure:

Step 1: IP Configuration on PCs (GUI)

For each PC → Desktop > IP Configuration

PC IP Address Subnet Mask Default Gateway


PC0 [Link] [Link] [Link]
PC1 [Link] [Link] [Link]
PC2 [Link] [Link] [Link]
PC3 [Link] [Link] [Link]

Step 2: VLAN Creation & TRUNK Configuration on Switch0 (Using GUI)

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

Step 3: Router Configuration Using CLI (TRUNK & Sub-Interfaces)

Click on Router0 > CLI and enter the following: Router>

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

! Sub-interface for VLAN 10 on TRUNK port


Router(config)# interface gigabitEthernet 0/0.10
Router(config-subif)# encapsulation dot1Q 10
Router(config-subif)# ip address [Link] [Link]
Router(config-subif)# exit

! Sub-interface for VLAN 20 on TRUNK port


Router(config)# interface gigabitEthernet 0/0.20
Router(config-subif)# encapsulation dot1Q 20
Router(config-subif)# ip address [Link] [Link]
Router(config-subif)# exit
Roll No.:- Name:-

Step 4: Verification

On PCs (Command Prompt):

ping [Link] # VLAN 10 Gateway


ping [Link] # VLAN 20 Gateway
ping [Link] # PC0 to PC2(inter-VLAN) ping
[Link] # PC3 to PC1(inter-VLAN)

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.

S1 VLAN and Trunking Configuration


Complete the following steps to configure S1 with VLANs and trunking:
Step 1. Create and name the VLANs.
Roll No.:- Name:-
Step 2. Create the management interface.
Step 3. Configure access ports.
Step 4. Configure trunking ports.

S2 VLAN and Trunking Configuration


The configuration for S2 is similar to S1.

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.

Verify Connectivity Between PC1 and PC2


The router-on-a-stick configuration is complete after the switch trunk and the router subinterfaces have been configured.
Roll No.:- Name:-
The configuration can be verified from the hosts, router, and switch.
From a host, verify connectivity to a host in another VLAN using the ping command. It is a good idea to first verify the
current host IP configuration using the ipconfig Windows host command.
Next, use ping to verify connectivity with PC2 and S1, as shown in the figure. The ping output successfully confirms
inter-VLAN routing is operating.

Verify Connectivity Between PC1 and PC2 ( Cont…)

Router-on-a-Stick Inter-VLAN Routing Verification: -


In addition to using ping between devices, the following show commands
can be used to verify and troubleshoot the router-on-a-stick configuration.

• 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.

Software Required: Java Development Kit (JDK), IDE (VS 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.

The (7,4) Hamming Code means:

● 4 bits of data (input)

● 3 parity bits (added for error checking)

● Total = 7 bits

● P1, P2, P3 → Parity bits

● D1, D2, D3, D4 → Data bits

Parity Bit Calculations

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:

1. Input the 4-bit data from the user.


2. Determine the positions for parity bits (positions 1, 2, and 4 – index 0, 1, and 3 in a 0- based array).
3. Place data bits in the remaining positions (3, 5, 6, 7 – index 2, 4, 5, 6).
4. Calculate the values of the parity bits using XOR logic: P1 covers
positions 1, 3, 5, 7
P2 covers positions 2, 3, 6, 7
P4 covers positions 4, 5, 6, 7
5. Insert the parity bits into their respective positions to form a 7-bit encoded message.
6. Output the 7-bit encoded message.

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 (![Link](i)) { 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:-

// Generate the encoded Hamming (7,4) code


[Link](data, parityPositions);
}
}

Input and Output:

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:

 Data (D): 101100


 Generator (G): 1101 (degree 3 → append 3 zeros)

Append 3 zeros to data:


101100 → 101100000

Perform binary division (XOR):


Divide 101100000 by 1101 (using XOR)

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

0101 ← Remainder (3 bits)


CRC Remainder: 101
Final Transmitted Message = Data + CRC = 101100101
Steps:

1. Take input data bits and a divisor (generator polynomial).


2. Perform binary division using XOR (mod-2 division) on the data appended with zeros.
3. The remainder from this division is the CRC code, which is added to the original data before
transmission.
Roll No.:- Name:-
4. On the receiving side, the data (including the CRC) is again divided by the same divisor.
5. If the remainder is zero, it indicates the data is received correctly; otherwise, it indicates an error
in transmission.
Flow Chart:

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:-

Input and Output:

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.

You might also like