Network Fundamentals · Topic 12 of 17

Virtualization Fundamentals

Learn how server virtualization, hypervisors, containers and VRFs work, how a VM differs from a container, and how a router keeps separate routing tables.

  • 5 min
  • Exam objective 1.12
In a nutshell
  • A hypervisor shares one server among many virtual machines.
  • A Type 1 hypervisor runs on bare metal. A Type 2 hypervisor runs on top of an operating system.
  • Each VM has its own operating system. Containers share the host kernel.

What it is

Virtualization creates a virtual version of something physical, so one real resource can be shared by several workloads.

It saves hardware, power and space, and it makes systems easier to copy, move and back up.

This topic covers three kinds you should know: server virtualization with virtual machines, containers, and VRFs, which virtualize routing on a network device.

How it works

Virtual machines and containers share a server, and VRFs share a router.

Physical serverHypervisorshares CPU, memory, storageVM 1own OSAppHypervisorVM 2own OSAppHypervisorVirtual switchlinks VMsPhysical network

Server virtualization

A physical server runs software called a hypervisor. The hypervisor divides the server's CPU, memory, storage and network connections among several virtual machines (VMs).

Each VM runs its own full operating system and behaves like a separate computer, even though they all share one box.

There are two types of hypervisor:

  • Type 1 (bare metal): installed directly on the hardware. It is used in data centres because it is efficient and stable.
  • Type 2 (hosted): installed as an application on top of a normal operating system. It is common on laptops for testing and learning.

Virtual machines connect to the network through a virtual switch inside the hypervisor. The virtual switch links the VMs to each other and to the physical network cards.

To the physical network, each VM can appear as a separate host with its own MAC and IP address.

Containers

A container packages an application together with the libraries it needs, but it does not include a full operating system. Containers share the kernel of the host operating system, so they are much smaller and start much faster than VMs.

FeatureVirtual machineContainer
Includes its own OSYesNo, shares the host kernel
SizeLarge, often gigabytesSmall, often megabytes
Start timeMinutesSeconds or less
IsolationStrongLighter
Typical useRunning full systemsRunning application components

Tools such as Docker create and run containers, and an orchestration system such as Kubernetes manages large numbers of them across many hosts. Containers suit modern application designs made of many small services.

The trade-off is isolation. A VM is separated from others at the hardware level, while containers share a kernel, so a flaw in the kernel can affect all of them.

Exam tip

Ask whether it carries its own operating system. A VM does, and a container shares the host kernel.

VRF

A VRF (Virtual Routing and Forwarding) instance is a separate routing table inside one router or Layer 3 switch. Interfaces assigned to a VRF belong to that table only.

One physical router can therefore act as several virtual routers.

Customer A10.1.1.0interfaceRouterVRF Customer A tableCustomer B10.1.1.0interfaceRouterVRF Customer B table

This is useful when you must keep traffic apart. A service provider can keep each customer's routes separate, and an enterprise can keep guest, corporate and management traffic from mixing.

Two VRFs can even use the same IP addresses without conflict, because their routing tables never meet.

A simple configuration on a recent Cisco device looks like this:

vrf definition CUSTOMER-A
 address-family ipv4
 exit-address-family
!
interface GigabitEthernet0/1
 vrf forwarding CUSTOMER-A
 ip address 10.1.1.1 255.255.255.0

Adding the interface to the VRF removes any IP address that was already on it, so the address is entered afterwards. Older releases used ip vrf NAME and ip vrf forwarding NAME instead, which support IPv4 only.

To look at a VRF routing table, include the name:

show ip route vrf CUSTOMER-A
show vrf

Without the VRF name, show ip route shows only the global routing table. A ping between two interfaces in different VRFs fails unless you deliberately leak routes between them.

What to remember for the exam

Eight facts cover virtualization.

  • A hypervisor shares one server among many virtual machines.
  • A Type 1 hypervisor runs on bare metal. A Type 2 hypervisor runs on top of an operating system.
  • Each VM has its own operating system. Containers share the host kernel.
  • Containers are lighter and faster to start, and are managed with tools such as Docker and Kubernetes.
  • A virtual switch connects VMs to each other and to the physical network.
  • A VRF is a separate routing table on one router.
  • Interfaces in different VRFs do not reach each other by default.
  • Use the VRF name in verification commands, such as show ip route vrf NAME.
Watch out

Plain show ip route shows only the global table. VRF routes look missing until you add vrf NAME.

Common mistakes

These five confusions are the usual ones.

Calling a container a small VM. A container has no operating system of its own. It uses the host's kernel.

Mixing up the two hypervisor types. Type 1 is on the hardware. Type 2 sits on an operating system.

Forgetting the VRF name. show ip route alone shows the global table, so VRF routes seem to be missing.

Expecting VRFs to talk to each other. Isolation is the whole point. Traffic crosses only if you configure it to.

Assigning the IP address before the VRF. Putting an interface into a VRF clears its address. Enter the address afterwards.

Check yourself

Work through these three prompts.

  • How does a virtual machine compare with a container in operating system, size and start time?

    A VM includes its own full operating system, is large (often gigabytes) and starts in minutes. A container shares the host kernel, is small (often megabytes) and starts in seconds or less.

  • What does a VRF do, and why can two VRFs use the same address range?

    A VRF is a separate routing table inside one router or Layer 3 switch, so one device can act as several virtual routers. Two VRFs can use the same IP addresses because their routing tables never meet.

  • What is the difference between a Type 1 and a Type 2 hypervisor, and where is each typically used?

    A Type 1 (bare metal) hypervisor is installed directly on the hardware and is used in data centres. A Type 2 (hosted) hypervisor is installed as an application on a normal operating system and is common on laptops for testing and learning.

Topic 12 of 17 in Network Fundamentals

Test yourself on Network Fundamentals

The full Cisco CCNA 200-301 question bank has 1,206 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Cisco. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.