Connecting Three PCs Using a Switch
Experiment: Connecting Three PCs Using a Switch
1. Aim
To create a simple Local Area Network (LAN) consisting of three PCs connected through a Layer 2 switch using straight-through Ethernet cables, configure IPv4 addresses, and verify connectivity using the ping command in Cisco Packet Tracer.
2. Objectives
After completing this experiment, students should be able to:
- Create a LAN using PCs and a network switch.
- Identify the Ethernet interface of a PC.
- Identify FastEthernet ports on a switch.
- Select and use a Copper Straight-Through cable.
- Configure IPv4 addresses and subnet masks on PCs.
- Understand communication between devices in the same IP network.
-
Verify network connectivity using
ping. -
Use
ipconfigto verify IP configuration. -
Use
arp -ato examine IP-to-MAC address mappings. - Perform basic troubleshooting of a LAN.
3. Theory
A Local Area Network (LAN) is a network that connects computers and other devices within a limited geographical area.
A network switch is used to connect multiple devices in a LAN. Unlike a direct PC-to-PC connection, each PC requires only one Ethernet interface when connected to a switch.
The topology used in this experiment is:
+----------------+ | Switch 2960 | +----------------+ | | | | | | PC0 PC1 PC2
The switch provides Layer 2 connectivity between the PCs.
All three PCs will be assigned IP addresses from the same network:
192.168.1.0/24
Therefore, they can communicate with each other without a router.
4. Network Topology
Create the following topology in Cisco Packet Tracer:
Switch +---------+ | 2960 | +---------+ / | \ / | \ / | \ PC0 PC1 PC2
Connections
PC0 FastEthernet0 ──── Switch FastEthernet0/1 PC1 FastEthernet0 ──── Switch FastEthernet0/2 PC2 FastEthernet0 ──── Switch FastEthernet0/3
Use Copper Straight-Through cables for all three connections.
5. Hardware and Software Required
Software
- Cisco Packet Tracer
Devices
| Device | Quantity |
|---|---|
| PC | 3 |
| Cisco 2960 Switch | 1 |
| Copper Straight-Through Cable | 3 |
6. IP Addressing Scheme
Use the following configuration:
| Device | Interface | IP Address | Subnet Mask | Default Gateway |
|---|---|---|---|---|
| PC0 | FastEthernet0 | 192.168.1.1 | 255.255.255.0 | Blank |
| PC1 | FastEthernet0 | 192.168.1.2 | 255.255.255.0 | Blank |
| PC2 | FastEthernet0 | 192.168.1.3 | 255.255.255.0 | Blank |
Network Address
192.168.1.0/24
Broadcast Address
192.168.1.255
Usable host range
192.168.1.1 – 192.168.1.254
The three PCs are therefore in the same subnet.
7. Procedure
Students should perform the following tasks in the given order.
Task 1: Start Cisco Packet Tracer
- Open Cisco Packet Tracer.
- Create a new blank workspace.
Task 2: Add Three PCs
- Select End Devices.
- Select PC.
- Drag three PCs into the workspace.
-
The PCs will normally be named:
- PC0
- PC1
- PC2
Arrange them below the switch.
Task 3: Add a Switch
- Select Network Devices.
- Select Switches.
- Select a Cisco 2960 switch.
- Drag it into the workspace.
Arrange the devices approximately as:
Switch 2960 +-----------+ | | +-----------+ / | \ / | \ PC0 PC1 PC2
8. Task 4: Connect PC0 to the Switch
- Click the Connections icon.
- Select Copper Straight-Through.
- Click PC0.
- Select:
FastEthernet0
- Click the switch.
- Select:
FastEthernet0/1
The connection is:
PC0 FastEthernet0 | | Straight-through | Switch FastEthernet0/1
9. Task 5: Connect PC1 to the Switch
Using another Copper Straight-Through cable:
PC1 FastEthernet0 | | Switch FastEthernet0/2
10. Task 6: Connect PC2 to the Switch
Using another Copper Straight-Through cable:
PC2 FastEthernet0 | | Switch FastEthernet0/3
The final topology should be:
Checkpoint 1
Before continuing, students must verify:
- Three PCs are present.
- One 2960 switch is present.
- PC0 is connected to switch port Fa0/1.
- PC1 is connected to switch port Fa0/2.
- PC2 is connected to switch port Fa0/3.
- Three straight-through cables are used.
- All physical links become active.
11. Task 7: Configure the IP Address of PC0
- Click PC0.
- Select Desktop.
- Select IP Configuration.
- Enter:
IP Address: 192.168.1.1 Subnet Mask: 255.255.255.0
- Leave Default Gateway blank.
The configuration should be:
| Parameter | Value |
|---|---|
| IP Address | 192.168.1.1 |
| Subnet Mask | 255.255.255.0 |
| Default Gateway | Blank |
12. Task 8: Configure the IP Address of PC1
- Click PC1.
- Select Desktop → IP Configuration.
- Enter:
IP Address: 192.168.1.2 Subnet Mask: 255.255.255.0
- Leave the default gateway blank.
13. Task 9: Configure the IP Address of PC2
- Click PC2.
- Select Desktop → IP Configuration.
- Enter:
IP Address: 192.168.1.3 Subnet Mask: 255.255.255.0
- Leave the default gateway blank.
14. Task 10: Verify the IP Configuration of PC0
- Click PC0.
- Select Desktop.
- Select Command Prompt.
- Enter:
ipconfig
Verify that the output shows:
IP Address: 192.168.1.1 Subnet Mask: 255.255.255.0
15. Task 11: Verify the IP Configuration of PC1
Open the command prompt of PC1:
ipconfig
Verify:
IP Address: 192.168.1.2 Subnet Mask: 255.255.255.0
16. Task 12: Verify the IP Configuration of PC2
Open the command prompt of PC2:
ipconfig
Verify:
IP Address: 192.168.1.3 Subnet Mask: 255.255.255.0
17. Task 13: Test PC0 to PC1 Connectivity
Open:
PC0 → Desktop → Command Prompt
Enter:
ping 192.168.1.2
Expected result:
Reply from 192.168.1.2
This confirms that PC0 can communicate with PC1.
18. Task 14: Test PC0 to PC2 Connectivity
From PC0:
ping 192.168.1.3
Expected result:
Reply from 192.168.1.3
19. Task 15: Test PC1 to PC2 Connectivity
From PC1:
ping 192.168.1.3
Expected result:
Reply from 192.168.1.3
20. Task 16: Test Connectivity in the Reverse Direction
Students should also verify the reverse communication.
From PC1:
ping 192.168.1.1
From PC2:
ping 192.168.1.1
From PC2:
ping 192.168.1.2
All three tests should be successful.
21. Connectivity Verification Table
Record the results in the lab record.
| Source | Destination | Command | Result |
|---|---|---|---|
| PC0 | PC1 | ping 192.168.1.2 | __________ |
| PC0 | PC2 | ping 192.168.1.3 | __________ |
| PC1 | PC0 | ping 192.168.1.1 | __________ |
| PC1 | PC2 | ping 192.168.1.3 | __________ |
| PC2 | PC0 | ping 192.168.1.1 | __________ |
| PC2 | PC1 | ping 192.168.1.2 | __________ |
Expected result: All six tests should be successful.
22. Task 17: Examine the ARP Table
This is an important learning activity.
From PC0, enter:
arp -a
The PC may display an entry similar to:
Internet Address Physical Address 192.168.1.2 xx-xx-xx-xx-xx-xx 192.168.1.3 xx-xx-xx-xx-xx-xx
Students should understand that ARP maps:
IP Address → MAC Address
For example:
192.168.1.2 → PC1's MAC address 192.168.1.3 → PC2's MAC address
23. Task 18: Examine the Switch
Click the 2960 switch.
Select the CLI tab.
You will see:
Switch>
Enter:
enable
The prompt becomes:
Switch#
Now enter:
show mac address-table
The switch will display MAC addresses that it has learned on its ports.
Students should identify:
- MAC address
- VLAN
- Port/interface through which the MAC address was learned
For example, conceptually:
MAC Address Port -------------------------- xxxx.xxxx.xxxx Fa0/1 yyyy.yyyy.yyyy Fa0/2 zzzz.zzzz.zzzz Fa0/3
Important concept
The switch learns the MAC addresses of connected devices and associates them with its ports.
24. Task 19: Observe the Effect of the Switch
Students should understand the communication path.
When PC0 communicates with PC1:
PC0 | | Ethernet frame ↓ Switch | | Ethernet frame ↓ PC1
The switch uses the destination MAC address to determine the appropriate port through which the frame should be forwarded.
25. Task 20: Use Simulation Mode
This is an excellent activity for students.
- Change Packet Tracer from Realtime to Simulation mode.
- Open PC0.
- Select Desktop → Command Prompt.
- Enter:
ping 192.168.1.2
- Observe the packets in the simulation window.
- Click Capture/Forward to move through the communication step by step.
- Observe the ARP and ICMP packets.
Students should try to identify:
ARP Request ↓ ARP Reply ↓ ICMP Echo Request ↓ ICMP Echo Reply
This provides a visual understanding of what happens when the ping command is executed.
26. Task 21: Create a Deliberate Configuration Error
To understand troubleshooting, change PC2's IP address.
Change:
192.168.1.3
to:
192.168.2.3
Keep:
255.255.255.0
The network now looks like:
PC0 → 192.168.1.1/24 PC1 → 192.168.1.2/24 PC2 → 192.168.2.3/24
27. Task 22: Test the Incorrect Configuration
From PC0 execute:
ping 192.168.2.3
Observe the result.
The ping will not work as it did previously because:
PC0 → 192.168.1.0/24 PC2 → 192.168.2.0/24
Although both PCs are physically connected to the same switch, they are configured in different IP networks.
This is an important concept:
Physical connectivity and logical IP connectivity are different concepts.
28. Task 23: Correct the Configuration
Change PC2's IP address back to:
192.168.1.3
with:
255.255.255.0
Now repeat:
ping 192.168.1.3
The ping should succeed.
29. Task 24: Basic Troubleshooting
If a ping fails, students should troubleshoot in the following order:
Step 1: Check the physical connection
Verify the cable between the PC and switch.
Step 2: Check the interface
Make sure the link indicator is active.
Step 3: Check the IP address
Use:
ipconfig
Step 4: Check the subnet mask
All three PCs should use:
255.255.255.0
Step 5: Check for duplicate IP addresses
Each PC must have a unique IP address.
Step 6: Ping again
For example:
ping 192.168.1.2
30. Observation
PC Configuration
| Device | IP Address | Subnet Mask |
|---|---|---|
| PC0 | 192.168.1.1 | 255.255.255.0 |
| PC1 | 192.168.1.2 | 255.255.255.0 |
| PC2 | 192.168.1.3 | 255.255.255.0 |
Switch Connections
| PC | PC Interface | Switch Interface |
|---|---|---|
| PC0 | FastEthernet0 | FastEthernet0/1 |
| PC1 | FastEthernet0 | FastEthernet0/2 |
| PC2 | FastEthernet0 | FastEthernet0/3 |
31. Result
A LAN consisting of three PCs and a Cisco 2960 switch was successfully created in Cisco Packet Tracer. The PCs were connected to the switch using Copper Straight-Through cables and configured with appropriate IPv4 addresses and subnet masks. Connectivity between all three PCs was successfully verified using the ping command. The ARP table and switch MAC address table were also examined, and a basic IP configuration error was introduced and corrected.
Comments
Post a Comment