Connecting three PCs using switch

Submitted on Mon, 04/22/2024 - 22:48

In this example, we connect three PCs using a switch instead of a hub. 

Step 1. Create a network using Cisco switch 2960 and three PCs.

To select switch, select Network Devices, switch then 2960.

Assign the following IP addresses to the three PCs.

Subnet Mask for /29 is

Step 2. Switch to simulation from Realtime.

Step 3. Click on Show All/None to remove all the visible events.

Step 4. Click on Edit Filters and select ICMP and ARP.

Step 5. Select a simple PDU and click on two PCs to send the PDU. (pc0 to pc1)

Here, we can see that two PDUs are created. One for ICMP and ARP. Since packet delivery requires MAC addresses of the destination interface, ARP PDU is created to find the destination’s MAC address.

Now, we can click on the forward button to see the PDUs in action.

  1. ARP PDU arrives at the switch from the pc0. This PDU has details regarding the sender’s IP address and MAC address. The switch adds the MAC address of the pc0’s interface and the connected port in its MAC address table. This is called learning. 

The ARP PDU is flooded to the rest of the PCs connected to the switch. pc2 drops the PDU as the ARP PDU is trying to find out the MAC address of pc1. Everytime, flooding occurs, filtering also occurs during which the PDU is sent to every other device except the sender.

During this step, the switch behaves similarly to the hub. 

pc1 sends back the ARP PDU with details of its MAC address. The ARP PDU arrives at the switch. Thus, the switch again performs learning by adding MAC address of pc1’s interface and connected port.

The switch sends back the ARP PDU to pc0 only using previous learning. This process is called forwarding during which the switch forwards the PDU to the rightful interface only. ARP protocol is completed. Now, the MAC address of the pc1 is known to pc0.

ICMP PDU arrives at the switch.

Switch again performs forwarding and sends the PDU to pc1 only.

pc1 replies with the ICMP PDU. The ICMP PDU arrives at the switch.

ICP PDU returns back to pc0.

Thus, we can see that the switch avoids unnecessary flooding as a hub. Switch has four functions:

  • Learning
  • Filtering
  • Flooding
  • Forwarding 

While the hub only has two functions:

  • Filtering
  • Flooding