# Patent

## Title
Simulating non-volatile memory in virtual distributed switches

## Abstract

A virtual non-volatile memory is simulated for a virtual switch. Operating instructions from the non-volatile memory of a physical switch may be translated into a flash type file. The flash type file may be stored on a virtual storage area in the virtual switch. Operating instructions in the virtual switch may access the flash type file in the virtual storage area without the need to access the non-volatile memory in the physical switch.

## Background
RELATED APPLICATIONS
The present continuation application claims the benefit of priority of U.S. application Ser. No. 13/610,592, filed Sep. 11, 2012, which application is incorporated herein by reference in its entirety.


BACKGROUND
The present invention relates to network virtualization, and more specifically, to simulating a non-volatile memory in virtual distributed switches.
In a physical switch, accessing memory for running software operations typically involves access to a physical memory module such as random access memory (RAM) or a flash memory. Physical switch software may interact with physical flash memory on the switch hardware. This device maybe used to store a compressed file system such as JFFS2 or it may write directly to an offset value on the device.
When porting network operating systems from physical switches to virtualization environments, it may be difficult to access memory for running software since when in a virtual distributed switching platform, the virtual distributed switch does not have physical flash memory hardware or physical NVRAM available. The flash memory, particularly when referenced by offset and structured, is typically hardware specific and software may be written for a particular family of physical switches. A considerable amount of software modification is traditionally required to change the existing network operating system in order to accommodate the non-standard platform. Since network operating systems are typically designed to write data directly to flash via a memory technology device interface, it may be a major drawback to have to modify each element of the code that normally reads/writes to flash to read/write to configuration files instead. This can make utilizing the switch software very difficult in a virtualized solution such as a virtual distributed switch. The virtual distributed switching platform cannot readily share code with physical switches, which can lead to a fragmented code base supporting multiple platforms and increased cost.
SUMMARY
According to one embodiment of the present invention, a network switch comprises a non-volatile memory module; a virtual memory storage architecture; a data storage module including a translation driver; and a processor configured to: operate the translation driver to duplicate a flash type file stored in the non-volatile memory, and store the duplicated flash type file in the virtual memory storage architecture.
According to another embodiment of the present invention, a process of simulating non-volatile memory in a virtual switch comprises accessing a physical non-volatile memory module for operating instructions; creating a flash type file of the operating instructions on a physical data storage module; translating the flash type file for use in a virtual switch; storing the translated flash type file to a virtual memory area; and accessing, by the virtual switch, the translated flash type file in the virtual memory area for use as operating instructions in the virtual switch.
According to still yet another embodiment of the present invention, a computer program product for simulating a non-volatile memory in a virtual switch, the computer program product comprising a computer readable storage medium having computer readable program code embodied therewith, the computer readable program code being configured to: access a physical non-volatile memory module on a physical switch for operating instructions; operate a Linux translation driver to interface with the physical non-volatile memory module; translate, using the Linux translation driver, a set of operating instructions from the physical non-volatile memory module into a flash type file of the operating instructions; store the translated flash type file to a virtual memory area; and access, with the virtual switch, the translated flash type file in the virtual memory area for use as operating instructions in the virtual switch.



BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS
FIG. 1 is a block diagram of a physical switch including a virtual switch environment in accordance with an exemplary embodiment of the present invention;
FIG. 2 is a block diagram of software architecture for translating physical switch software into a virtual switch storage area in accordance with another exemplary embodiment of the present invention; and
FIG. 3 is a flow chart of a process of simulating a non-volatile memory in a virtual switch environment in accordance with yet another exemplary embodiment of the present invention.



DETAILED DESCRIPTION
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or computer program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, aspects of the present invention may take the form of a computer program product embodied in one or more computer readable medium(s) having computer readable program code embodied thereon.
Any combination of one or more computer readable medium(s) may be utilized. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
Aspects of the present invention are described below with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
Referring now to FIG. 1, a physical switch 10 is shown according to an exemplary embodiment of the present invention. The physical switch 10 may be configured to house all or a portion of a virtual switch environment. The physical switch 10 may include a processor 20, a memory module 30, and a data storage module 40. The memory module 30 may be a non-volatile memory, for example non-volatile random access memory (NVRAM) or flash memory. The data storage module 40 may include software data that may include instructions for operating a virtual switch 50. The virtual switch 50 may access the processor 20, the memory module 30, and the data storage 40 to establish the virtual switch environment. A virtual data storage area 60 may be part of the virtual switch environment configured to provide stored data to the virtual switch 50 on demand.
In an exemplary embodiment, the virtual switch 50 may be part of a distributed fabric of virtual switches. For sake of illustration, only a single virtual switch 50 is shown. However, in some embodiments, a plurality of virtual switches 50 may operate within the physical switch 10. In some embodiments, the virtual switch 50 may be connected to virtual switches 50 residing remotely from the physical switch 10.
Referring now to FIGS. 1 and 2, software architecture 100 for translating software for the physical switch 10 into the virtual data storage area 60 is shown according to another exemplary embodiment of the present invention. The architecture 100 may be configured to translate physical switch operating instructions 110 to the virtual data storage area 60. The non-volatile memory module 20 may interface operating instructions 110 resident on the physical switch 10. A translation driver layer 150 operated by the processor 20 may manage the interaction between a simulated non-volatile memory and the physical switch software 110. In an exemplary embodiment, the simulated non-volatile memory may be resident on the physical switch 10. In an exemplary embodiment, Linux® coding may be used for operating instructions. Flash type memory containing the operating instructions 110 may be interfaced using a memory technology device (MTD) 120. High level wrapper functions may interface with a Linux MTD device 120 using for example, read( ) write( ), open( ) and close( ) type functionality. These functions may be intercepted by the translation driver layer 150. The translation driver layer 150 may determine if a raw flash type file is available on the virtual data storage area 60. It will be understood that a “raw” flash type file may be one where the contents of the flash are stored directly as data instead of being in some standard structured format such as, for example, a JFFS2 file system. The translation driver layer 150 may employ a device translator 130 to determine if the mapping for the MTD device 120 to block device (raw flash file) is setup correctly. For example, the translation driver layer 150 may determine if the raw flash file matches the block size and sector size associated with the non-volatile memory module 30. If a “JFFS2” or another file system is used on non-volatile memory module 30, the translation driver layer 150 may handle the creation and management of the file system over the MTD device translator 130. The translator 130 may take requests that are designed for MTD memory devices, mapping those block/sector locations to a block/sector location on the physical storage device so that an operation may be performed on the block device (virtual data storage area 60).
Referring now to FIG. 3, a process 300 of simulating a non-volatile memory in a virtual switch environment is shown. The processor 20 may access 310 the physical non-volatile memory module 30 on the physical switch 10 for operating instructions 110. A raw flash type file may be created based on the operating instructions 110 accessed. The flash type file may be stored in the data storage area 40. The flash type file may have a block size and storage size associated with the non-volatile memory in the memory module 30. The processor 20 may operate 320 the Linux translation driver 150 to interface with the physical non-volatile memory module 30. MTD function calls may be sent by the physical switch 10 to the translation driver 150. The translation layer 150 may route 330 the function calls to the MTD device translator 130. The MTD device translator 130 may translate 340 the raw flash type file set of operating instructions into a flash type file readable within the virtual switch 50. The processor 20 may store 350 the translated flash type file to the virtual memory area 60 as a virtual flash file. The virtual switch 50 may access the translated flash type file in the virtual memory area 60 for use as operating instructions in the virtual switch 50.
It may be appreciated that no code changes may be needed because the block size and physical storage size of the virtual flash files are identical to the original physical flash device. As such, hard-coded offsets and memory locations on the virtual flash are the same as they would be on the physical flash. In addition, since translation layer 150 accepts MTD calls, no upstream functions need to be modified. Translation may perform read/write in MTD raw format, which may be stored directly to a virtual disk. The software running in the virtual environment may behave as it would on a physical device because it accesses the virtual flash file as a simulated non-volatile memory.
The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, may be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises” and/or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
The corresponding structures, materials, acts, and equivalents of all means or step plus function elements in the claims below are intended to include any structure, material, or act for performing the function in combination with other claimed elements as specifically claimed. The description of the present invention has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the invention. The embodiment was chosen and described in order to best explain the principles of the invention and the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.

## Claims

1. A process of simulating non-volatile memory in a virtual switch, comprising:
accessing a physical non-volatile memory module for operating instructions;
creating a flash type file of the operating instructions on a physical data storage module;
translating the flash type file into a format readable in a virtual switch;
storing the translated flash type file to a virtual memory area; and
accessing, by the virtual switch, the translated flash type file in the virtual memory area for use as operating instructions in the virtual switch.

2. The process of claim 1, including employing a memory technology device (MTD) to read the operating instructions from the physical non-volatile memory module.

3. The process of claim 2, wherein the translating is performed by an MTD block device translator driver.

4. The process of claim 1, including reading or writing to the translated flash type file in the virtual memory area.

5. The process of claim 1, wherein the physical non-volatile memory module is non-volatile random access memory.

6. The process of claim 1, including determining if the translated flash type file includes a block size and sector size corresponding to the non-volatile memory module, wherein the determination is made prior to storing the translated flash type file to the virtual memory area.