When we are setting up a server it will most likely it will be connected to a switch. Due to this we need to gain more knowledge and review how a switch operates as our server and eventually our type-1 hypervisor and VMs will communicate through this device.
A switch is a piece of networking equipment that operates at Layer 2 of the OSI Model. A switch takes in packets that are sent by devices that are connected to its physical ports. It then sends out these packets out the required ports to the intended devices.
All Network Interface Cards (NIC) have a MAC (media access control) address. When a NIC is connected to a switch by an ethernet cable and starts to send data the switch learns this MAC address.
You might need to recall what a MAC address is. A MAC address is a physical address that is embedded on each network interface card. It is made up of a 48-bit number that is written in hexadecimal. The first 24-bits define the OUI (Organizationally Unique Identifier). Think of the OUI as the vendor of the Mac Address. The last 24-bits are unique to the NIC.
Let us look at an example of how a switch operates. We have three computers connected to a switch. Each computer has a unique MAC Address. Computer 1 (MAC Address: AAA) is sending an Ethernet Frame to Computer 2 (MAC Address: BBB).
Our switch will maintain a MAC Address Table. After Computer 1 sends the Ethernet Frame and the switch receives it the MAC Address Table will look like (each port gets assigned the correct MAC Address).
AAA
The switch at this point does not know what port MAC Address BBB is located at. Due to this the switch will send the ethernet frame out both ports 2 and 3. It knows that Port 1 does not have it as it received the ethernet frame on that interface. Each computer will receive the ethernet frame and compare the DEST MAC Address to their own and see if it matches.
As Computer 2 has a match on the MAC address it will respond to the Ethernet Frame. When Computer 2 responds the switch will learn the MAC Address of computer and add this to its MAC Address table.
Updated Mac Address Table:
AAA
BBB
If Computer 1 was to send data back to Computer 2 the switch would know that Computer 2 is off interface 2 and be able to send data directly out that interface.