Computer Networking Basics

Compared with a hub (repeater hub), which correctly describes how an L2 switch operates?

  1. AIt reads IP addresses and relays packets between different networks
  2. BIt reads the destination MAC address of a frame and forwards it only to the port where the destination device is connected
  3. CIt always sends every frame to all ports, and only the destination device accepts it
Show answer and explanation

Answer: B. It reads the destination MAC address of a frame and forwards it only to the port where the destination device is connected

A hub is a layer 1 device that repeats the signal arriving on one port to all ports. All attached devices therefore share one channel, and simultaneous transmissions collide. An L2 switch is a layer 2 device: it records which source MAC address arrived on which port in a table (the MAC address table) and forwards each frame only to the port where its destination MAC address is connected. Frames for destinations not yet in the table, and broadcast frames, are sent to all ports except the one they came in on (flooding). Because traffic is separated per port, communication between different pairs of ports can happen at the same time. Relaying between different networks based on IP addresses is the job of a router at layer 3.

  • A. That is how a router operates.
  • B. Correct. A switch learns MAC addresses and forwards only to the port needed.
  • C. That is closer to how a hub behaves. A switch sends only to the right port once it knows the destination.
Practice this topic Back to topic

Related calculators

Books on Computer Networking Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Computer Networking Basics questions

  1. On one L2 switch, VLANs are configured so that ports 1–4 are in VLAN 10 and ports 5–8 are in VLAN 20. Which statement about its operation is correct?
  2. Which correctly shortens the IPv6 address 2001:0db8:0000:0000:0000:0000:0000:0001 according to the abbreviation rules?
  3. A host has IP address 192.168.1.10 and subnet mask 255.255.255.0. What is the network address of the network it belongs to?
  4. In the network 192.168.5.0/26, how many IP addresses can be assigned to hosts (end devices or router interfaces)?
  5. A host has IP address 192.168.10.77/27. What is the broadcast address of its subnet?