Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixed links
Wiki Markup
h3. Description

The VirtualNetworkFilter module is simple layer 2 (MAC) based network virtualization. This allows you to create multiple logical layer 2 networks in a single layer 2 domain. This module can be used for an OpenStack deployment or standalone.

h3. Services Provided

* IVirtualNetworkService

h3. Service Dependencies

* IDeviceService
* IFloodlightProviderService
* IRestApiService

h3. Java File

The module is implemented in net.floodlightcontroller.virtualnetwork.VirtualNetworkFilter.

h3. How it works

When Floodlight starts up no virtual networks are created. The result is that hosts will not be able to talk to each other. Once the user creates virtual networks hosts can be added to it. The module will insert itself before the forwarding implementation in the processing chain for PacketIn messages. Once a PacketIn is received it will look at the source and destination MAC addresses. If the MACs are both on the same virtual network, the module will return Command.CONTINUE and the flow will continue to be processed. If source and destination MAC addresses are on different networks the module will return Command.STOP and the packet will be dropped.

h3. Limitations

* The physical network must be one layer 2 domain
* You can only have one gateway per virtual network (it can be shared with multiple virtual networks)
* Multicast and broadcast traffic is not isolated
* All DHCP traffic is allowed

h3. Configuration

The module is not enabled by default. It must be added to the configuration file and Floodlight must be restarted in order for it to be loaded. A sample configuration file is posted below. The module is called "VirtualNetworkFilter". The default configuration file used for this is in src/main/resources/quantum.properties.

{code:xml}

# The default configuration for openstack
floodlight.modules = net.floodlightcontroller.storage.memory.MemoryStorageSource,\
net.floodlightcontroller.staticflowentry.StaticFlowEntryPusher,\
net.floodlightcontroller.forwarding.Forwarding,\
net.floodlightcontroller.jython.JythonDebugInterface,\
net.floodlightcontroller.counter.CounterStore,\
net.floodlightcontroller.perfmon.PktInProcessingTime,\
net.floodlightcontroller.ui.web.StaticWebRoutable,\
net.floodlightcontroller.virtualnetwork.VirtualNetworkFilter
net.floodlightcontroller.restserver.RestApiServer.port = 8080
net.floodlightcontroller.core.FloodlightProvider.openflowport = 6633
net.floodlightcontroller.jython.JythonDebugInterface.port = 6655

{code}

| (!) | For more information on the module loading system see the documentation [here|http://www.openflowhub.org/display/floodlightcontroller/Module+loading+system/]. |
If you are using the Floodlight VM the configuration file is already on the machine. Simply execute these commands to enable it.

{code:xml}

floodlight@localhost:~$ touch /opt/floodlight/floodlight/feature/quantum
floodlight@localhost:~$ sudo service floodlight stop
floodlight@localhost:~$ sudo service floodlight start

{code}

h4. Configuration Options

None.

h3. REST API

|| URI || Method || URI Arguments || Data || Data Fields || Description ||
| /quantum/v1.0{color:#222222}networkService{color}{color:#222222}/{color}{color:#222222}v1{color}{color:#222222}.{color}{color:#222222}1{color}/tenants/\{tenant}/networks/\{network} | PUT/POST/DELETE | Tenant: Currently ignored  \\
Network: The ID (not name) of the network | {"network": { "gateway": "<IP>", "name": "<Name>" }}\ | IP: Gateway IP in "1.1.1.1" format, can be null&nbsp; \\
Name: Network name a string | Creates a new virtual network. Name and ID are required, gateway is optional. |
| /quantum/v1.0{color:#222222}networkService{color}{color:#222222}/{color}{color:#222222}v1{color}{color:#222222}.{color}{color:#222222}1{color}/tenants/\{tenant}/networks/\{network}/ports/\{port}/attachment | PUT/DELETE | Tenant: Currently ignored&nbsp; \\
Network: The ID (not name) of the network \\
Port: Logical port name | {"attachment": {"id": "<Network ID>", "mac": "<MAC>"}}&nbsp; \\ | Network ID: Network ID as a string, the one you just created&nbsp; \\
MAC: MAC address in "00:00:00:00:00:09" format | Attaches a host to a virtual network. |
| /quantum/v1.0{color:#222222}networkService{color}{color:#222222}/{color}{color:#222222}v1{color}{color:#222222}.{color}{color:#222222}1{color}/tenants/\{tenant}/networks \\ | GET | Tenant: Currently ignored | None | None | Shows all networks and their gateway, ID, and hosts mac in json format |

h4. Examples using curl

Creating a virtual network named "VirtualNetwork1", the ID is "NetworkId1", the gateway is "10.0.0.7", and the tenant is "default" (which is currently ignored).

{code:xml}

curl -X PUT -d '{ "network": { "gateway": "10.0.0.7", "name": "virtualNetwork1" } }' http://localhost:8080/quantumnetworkService/v1.01/tenants/default/networks/NetworkId1

{code}

Adding a host to VirtualNetwork1 with the MAC address "00:00:00:00:00:08" and the port "port1".

{code:xml}

curl -X PUT -d '{"attachment": {"id": "NetworkId1", "mac": "00:00:00:00:00:08"}}' http://localhost:8080/quantumnetworkService/v1.01/tenants/default/networks/NetworkId1/ports/port1/attachment

{code}