Python Network Programming
上QQ阅读APP看书,第一时间看更新

Constructing a virtual lab

Before we dive into the packages, let's examine the options of putting together a lab for the benefit of learning. As the old saying goes, practice makes perfect: we need an isolated sandbox to safely make mistakes, try out new ways of doing things, and repeat some of the steps to reinforce concepts that were not clear in the first try. It is easy enough to install Python and the necessary packages for the management host, but what about those routers and switches that we want to simulate?

To put together a network lab, we basically have two options, each with its advantages and disadvantages:

  • Physical device: This option consists of physical devices that you can see and touch. If you are lucky enough, you might be able to put together a lab that is an exact replication of your production environment:
    • Advantages: It is an easy transition from lab to production, easier to understand by managers and fellow engineers who can look at and touch the devices. In short, the comfort level with physical devices is extremely high because of familiarity. 
    • Disadvantages: It is relatively expensive to pay for a device that is only used in the lab. Devices require engineering hours to rack and stack and are not very flexible once constructed.
  • Virtual devices: These are emulations or simulations of actual network devices. They are either provided by the vendors or by the open source community:
    • Advantages: Virtual devices are easier to set up, relatively cheap, and can make changes to the topology quickly.
    • Disadvantages: They are usually a scaled-down version of their physical counterpart. Sometimes there are feature gaps between the virtual and the physical device.

Of course, deciding on a virtual or physical lab is a personal decision derived from a trade-off between the cost, ease of implementation, and the risk of having a gap between lab and production. In some of the environments I have worked on, the virtual lab is used when doing an initial proof-of-concept while the physical lab is used when we move closer to the final design.

In my opinion, as more and more vendors decide to produce virtual appliances, the virtual lab is the way to proceed in a learning environment. The feature gap of the virtual appliance is relatively small and specifically documented, especially when the virtual instance is provided by the vendor. The cost of the virtual appliance is relatively small compared to buying physical devices. The time-to-build using virtual devices is quicker because they are usually just software programs.

For this book, I will use a combination of physical and virtual devices for concept 
demonstration with a preference for virtual devices. For the examples we will see, the differences should be transparent. If there are any known differences between the virtual and physical devices pertaining to our objectives, I will make sure to list them.

On the virtual lab front, besides images from various vendors, I am using a program from Cisco called Virtual Internet Routing Lab (VIRL), https://learningnetworkstore.cisco.com/virtual-internet-routing-lab-virl/cisco-personal-edition-pe-20-nodes-virl-20

I want to point out that the use of this program is entirely optional for the reader. But it is strongly recommended that the reader have some lab equipment to follow along with the examples in this book.