I've been reading up on how VMs communicate on the internet using vNICs, vSwitches etc. Would like to confirm a few things
For outbound traffic, the pNIC can be overridden send frames/packets with ip/MAC of the VM instead of host ip and hardcoded NIC MAC. Correct ?
If and when this traffic hits a switch, MAC table of switch will have multiple entries for a particular port( host+VM(s) ). Correct ?
For inbound traffic, switch directs all traffic from step 2 to that port. is the NIC only responsible for layer 2 processing ( ie does it only extract the IP packet from a frame and pass it to OS ?? ) .
A hardware hypervisor like esxi is programmed to look at the destination ip of the packet and route it to the corresponding VM. Correct ?
If so, this means that the esxi/host os will receive all packets for both itself and its VMs. when are IP packets procesed to extract transport layer data ? For example, if I send a ssh command to a VM, when does the host process this packet and figure out it is not meant for itself but for the VM?