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:

  1. Create a LAN using PCs and a network switch.
  2. Identify the Ethernet interface of a PC.
  3. Identify FastEthernet ports on a switch.
  4. Select and use a Copper Straight-Through cable.
  5. Configure IPv4 addresses and subnet masks on PCs.
  6. Understand communication between devices in the same IP network.
  7. Verify network connectivity using ping.
  8. Use ipconfig to verify IP configuration.
  9. Use arp -a to examine IP-to-MAC address mappings.
  10. 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:

DeviceInterfaceIP AddressSubnet MaskDefault Gateway
PC0FastEthernet0192.168.1.1255.255.255.0Blank
PC1FastEthernet0192.168.1.2255.255.255.0Blank
PC2FastEthernet0192.168.1.3255.255.255.0Blank

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

  1. Open Cisco Packet Tracer.
  2. Create a new blank workspace.

Task 2: Add Three PCs

  1. Select End Devices.
  2. Select PC.
  3. Drag three PCs into the workspace.
  4. The PCs will normally be named:
    • PC0
    • PC1
    • PC2

Arrange them below the switch.


Task 3: Add a Switch

  1. Select Network Devices.
  2. Select Switches.
  3. Select a Cisco 2960 switch.
  4. Drag it into the workspace.

Arrange the devices approximately as:

                  Switch 2960
                 +-----------+
                 |           |
                 +-----------+
                  /    |    \
                 /     |     \
               PC0    PC1    PC2

8. Task 4: Connect PC0 to the Switch

  1. Click the Connections icon.
  2. Select Copper Straight-Through.
  3. Click PC0.
  4. Select:
FastEthernet0
  1. Click the switch.
  2. 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

  1. Click PC0.
  2. Select Desktop.
  3. Select IP Configuration.
  4. Enter:
IP Address:       192.168.1.1
Subnet Mask:      255.255.255.0
  1. Leave Default Gateway blank.

The configuration should be:

ParameterValue
IP Address192.168.1.1
Subnet Mask255.255.255.0
Default GatewayBlank

12. Task 8: Configure the IP Address of PC1

  1. Click PC1.
  2. Select Desktop → IP Configuration.
  3. Enter:
IP Address:       192.168.1.2
Subnet Mask:      255.255.255.0
  1. Leave the default gateway blank.

13. Task 9: Configure the IP Address of PC2

  1. Click PC2.
  2. Select Desktop → IP Configuration.
  3. Enter:
IP Address:       192.168.1.3
Subnet Mask:      255.255.255.0
  1. Leave the default gateway blank.

14. Task 10: Verify the IP Configuration of PC0

  1. Click PC0.
  2. Select Desktop.
  3. Select Command Prompt.
  4. 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.

SourceDestinationCommand    Result
PC0PC1ping 192.168.1.2    __________
PC0PC2ping 192.168.1.3    __________
PC1PC0ping 192.168.1.1    __________
PC1PC2ping 192.168.1.3    __________
PC2PC0ping 192.168.1.1    __________
PC2PC1ping 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.

  1. Change Packet Tracer from Realtime to Simulation mode.
  2. Open PC0.
  3. Select Desktop → Command Prompt.
  4. Enter:
ping 192.168.1.2
  1. Observe the packets in the simulation window.
  2. Click Capture/Forward to move through the communication step by step.
  3. 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

Popular posts from this blog

Networks Lab PCCSL507 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Study of whois Command

Study and Use of ifconfig Command