Working with Logical Networks

Modified: 31 Oct 2016 15:06 UTC
                <table class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><tbody><tr>

SmartDataCenter uses logical networks to group a wide array of network information such as network segment, physical network adapters, IP subnets, and VLAN ids. Logical networks are used both on head nodes and compute nodes. Logical networks are associated with physical interfaces by using a system called NIC Tags. Physical interfaces can be tagged with one or more words, and these words are associated with logical networks. This allows an operator to control the flow of logical network data over physical links.

By default, a tag and logical network are created for two logical networks: "Admin", and "External". The admin network is used as the management and communication network between the head node and compute nodes. External is created at install time, but not assigned to compute nodes. It's purpose is to allow instances to connect to some outside network like the Internet.

In this page:

Logical Networks Overview

A logical network describes a network segment. It includes

The nic_tag provides a way of associating the logical network with a physical NIC port on a head node or a compute node. A logical network may be associated with only one nic_tag, but several logical networks may use the same nic_tag. A physical NIC can have more than one nic_tag associated with it.

This example shows a compute node with two physical NICs

The NIC on the right is tagged external.
The NIC on the left has two tags, private and internal
There are N logical networks:

Assigning NIC Tags to Logical Networks

When a new compute node appears on the admin network, the head node tags the physical NIC that was used to netboot the compute node with the admin tag. Any other physical NICs on the compute node remain untagged.

When you assign a nic_tag to a physical NIC on a compute node, you're saying that any of the logical networks with that nic_tag can be used to route traffic to SmartMachines on that compute node.

Logical Networks and SmartMachines

When you provision a new SmartMachine, you select a package that describes the memory, disk space, swap space, and CPU limits of the the SmartMachine. The package also includes the default logical networks for the package. You can override the defaults and choose any of the available networks.

When the SmartMachine is provisioned, the head node creates a VNIC for each of the logical networks associated with the SmartMachine. Each VNIC is assigned the next available IP address for each logical network. The VNICs are named net0, net1, and so on.

For example, this is the network configuration of a SmartMachine that was provisioned with three logical networks:

[root@970c57fb-aa4e-416e-8ffb-4bae17762ee8 ~]# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
net0: flags=40001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,L3PROTECT> mtu 1500 index 2
        inet 10.88.88.51 netmask ffffff00 broadcast 10.88.88.255
        ether c0:ff:ee:b4:78:ec
net1: flags=40001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,L3PROTECT> mtu 1500 index 3
        inet 10.88.86.15 netmask ffffff00 broadcast 10.88.86.255
        ether c0:ff:ee:14:af:65
net2: flags=40201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS,L3PROTECT> mtu 1500 index 4
        inet 10.88.87.15 netmask ffffff00 broadcast 10.88.87.255
        ether c0:ff:ee:4b:12:b8
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
        inet6 ::1/128

Initial NIC Tags and Logical Networks

The initial configuration consists of two default networks:

Logical Network Description
Admin This network is used to communicate between the head node and the compute nodes. It is associated with physical NICs tagged admin.
External This network allows the head node and the compute nodes to communicate with the external network, usually the Internet. It is associated with physical NICs tagged external.

Creating Logical Networks

The Admin and External logical networks are created when you set up a new compute node. Once the compute node is set up, use the Operations Portal to create logical networks and to assign logical networks to packages.

At this time, you have to create nic_tags using MAPI.

Logical Networks and NIC Tags Created at Setup Time

If you are using the standard installation procedure for SmartDataCenter, you can skip this section.

If you're interested in non-interactive, automatic deployments of SDC head nodes, this section is relevant to you.

The config file on the root of the USB key provides the configuration of the two default logical networks and nic_tags of these logical networks on the head node only For example, a typical config might contain the following lines:

# admin_nic is the nic admin_ip will be connected to for headnode zones.
admin_nic=00:50:56:34:60:4c
admin_nic_tag=admin
admin_ip=10.99.99.7
admin_netmask=255.255.255.0
admin_network_name=admin
admin_network=10.99.99.0
admin_gateway=10.99.99.7

# external_nic is the nic external_ip will be connected to for headnode zones.
external_nic=00:50:56:3d:a7:95
external_nic_tag=external
external_ip=10.88.88.200
external_gateway=10.88.88.1
external_netmask=255.255.255.0
#external_vlan_id=999
external_network_name=external
external_network=10.88.88.0
external_provisionable_start=10.88.88.50
external_provisionable_end=10.88.88.199

This configuration indicates that the head node NIC with the MAC address 00:50:56:34:60:4c is tagged admin, and the Headnode NIC with the MAC address 00:50:56:3d:a7:95 is tagged external

Additionally, the configuration indicates that the admin nic_tag is associated with the logical network named admin: 10.99.99.0/24. The external nic_tag is associated with the logical network named external 10.88.88.0/24.

You cannot define additional NIC tags or logical networks in the config file. Only the default Admin and External logical networks are defined there.

Creating a NIC Tag

To create a new nic_tag via the API use the following sdc-mapi command:

headnode# sdc-mapi /nic_tags -X POST -d name=private
HTTP/1.1 201 Created
Server: nginx/0.8.53
Date: Wed, 19 Oct 2011 21:01:59 GMT
Content-Type: application/json
Connection: keep-alive
Status: 201 Created
Content-Length: 120

{
  "name": "private",
  "created_at": "2011-10-19T21:01:59+00:00",
  "updated_at": "2011-10-19T21:01:59+00:00",
  "uri": "/nic_tags/3"
}

Creating a Logical Network

You can use the Operations Portal to create logical networks. You can also use sdc-mapi to use the API to create a logical network:

headnode# sdc-mapi /networks -X POST \
          -d name=Private \
          -d subnet=10.88.85.0/24 \
          -d start_ip=10.88.85.15 \
          -d end_ip=10.88.85.200 \
          -d default_gateway_ip=10.88.85.2 \
          -d vlan_id=0 \
          -d nic_tag_name=private \
          -d admin=false
HTTP/1.1 201 Created
Server: nginx/0.8.53
Date: Wed, 19 Oct 2011 21:11:33 GMT
Content-Type: application/json
Connection: keep-alive
Status: 201 Created
Content-Length: 334

{
  "name": "Private",
  "description": null,
  "vlan_id": 0,
  "admin": false,
  "created_at": "2011-10-19T21:11:33+00:00",
  "updated_at": "2011-10-19T21:11:33+00:00",
  "uri": "/networks/5",
  "start_ip": "10.88.85.15",
  "end_ip": "10.88.85.200",
  "default_gateway_ip": "10.88.85.2",
  "subnet": "10.88.85.0/24",
  "nic_tag": "/nic_tags/3",
  "resolver_ips": [
    "8.8.4.4",
    "8.8.8.8"
  ]
}
At a Glance