Do switches look at MAC addresses?
Let's say we have a network like the one in the image below and the switches MAC tables are empty and the ARP tables are also empty. I want to send a packet from Host A to Host B. The question I want to ask is in what order and which MAC address the Switches learn? Show
Here is what i know till now: Host 1 creates the packet with the Destination IP of Host B (172.30.2.16) and sends it. Switch 1 gets the packet and looks up in his MAC Table (its empty) and then sends it to all of his ports (flood) and in meanwhile saves up the Source MAC of Host A in his MAC Table. The packet comes to the Router which sends it to Switch 2. Now does the Switch 2 learns (saves) the Host A MAC address (caz its the source MAC) or it learns the Router MAC from which the packet came and its port is connected? Now the Switch 2 floods all ports and gets positive answer from Host B and learns(saves) his MAC address in his table. Now the process is going in reverse to Host A. Switch 1 MAC Table: Port------Source MAC 1------Host A MAC 5------Router's MAC or is it Host B MAC ? Switch 2 MAC Table: Port------Source MAC 1------Host A MAC or Router's MAC ? 3------Host B Thank you so much!
Zac67♦ 73.8k2 gold badges58 silver badges124 bronze badges asked Aug 22, 2017 at 11:29
2
Each router replaces the Original source MAC address with the MAC adddress of the interface where the packet is going out of the router.
So They are unaware of the original MAC adddress, and they don't need to know it. When answered Aug 22, 2017 at 11:39
jcbermujcbermu 4,43715 silver badges20 bronze badges 3 A router removes the frame around an incoming IP packet and encapsulates the packet with a new frame (depending on the layer 2 protocol) when passing it on. The MAC tables of the switches are populated by ARP:
To be exact, each switch removes the (layer 1) Ethernet packet around each (layer 2) frame on receipt and puts a new Ethernet packet around it when forwarding. So, layer 3 uses layer 2 for transport which in turn uses layer 1 for transport. Layer 1 is where the bits actually get moved. answered Aug 22, 2017 at 20:42
Zac67♦Zac67 73.8k2 gold badges58 silver badges124 bronze badges Accessing MAC address views and searchesSyntax
Listing all learned MAC addresses on the switch, with the port number on which each MAC address was learned HP Switch# show mac-address Listing all learned MAC addresses on one or more ports, with their corresponding port numbers For example, to list the learned MAC address on ports A1 through A4 and port A6: HP Switch# show mac-address a1-a4,a6 Listing all learned MAC addresses on a VLAN, with their port numbers This command lists the MAC addresses associated with the ports for a given VLAN. For example: HP Switch# show mac-address vlan 100
Finding the port on which the switch learned a specific MAC address For example, to find the port on which the switch learns a MAC address of 080009-21ae84: Accessing MAC address views and searches (Menu)Viewing and searching per-VLAN MAC-addressesThis feature lets you determine which switch port on a selected VLAN is being used to communicate with a specific device on the network. From the Main Menu, select:
Finding the port connection for a specific device on a VLANThis feature uses a device's MAC address that you enter to identify the port used by that device.
Viewing and searching port-level MAC addressesThis feature displays and searches for MAC addresses on the specified port instead of for all ports on the switch.
Determining whether a specific device is connected to the selected portProceeding from step 2, above:
Do switches filter MAC addresses?Although switches filter most frames based on MAC addresses, they do not filter broadcast frames. For other switches on the LAN to receive broadcast frames, switches must flood these frames out all ports. A collection of interconnected switches forms a single broadcast domain.
Do switches use IP addresses or MAC addresses?Network switches refer to MAC addresses in order to send Internet traffic to the right devices, not IP addresses. Every device that connects to the Internet has an IP address.
How do switches find MAC addresses?A switch can learn MAC address in two ways; statically or dynamically. In the static option, we have to add the MAC addresses in the CAM table manually. In the dynamic option, the switch learns and adds the MAC addresses in the CAM table automatically. The switch stores the CAM table in the RAM.
Do switches check IP addresses?Remember: switch does not look into the IP packet and forwards frame as is based on the destination MAC address.
|