[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why does a VLAN and Network have IP information?


Looking at our design and tables in the database I'm wondering why both
a VLAN and a Network has IP information.

A VLAN is a Layer 2 domain and shouldn't have any IP(4/6) information
and we also seem to store redundant information in there.

Below is some information I have in a test database and I'm just trying
to understand why both have IP information.

Imho this information should not be stored in the VLAN table as it's
redundant anyway. But still, why is it there? And why do we actually use
the VLAN table? Because even the VLAN tag is stored in the *networks* table.


mysql> select * from vlan limit 1 \G
*************************** 1. row ***************************
                 id: 1
               uuid: d14f30ab-072e-41b7-bfcf-0aadd156e01d
            vlan_id: 0
          vlan_type: DirectAttached
     data_center_id: 1
         network_id: 203
physical_network_id: 200
        ip6_gateway: 2001:db8:100::1
           ip6_cidr: 2001:db8:100::/64
          ip6_range: NULL
            removed: NULL
            created: 2018-06-09 18:53:26
1 row in set (0.00 sec)


mysql> select * from networks where id = 203 \G
*************************** 1. row ***************************
                   id: 203
                 name: GuestNetwork1
                 uuid: f1f7281d-bedd-422c-bd44-eae9be172157
         display_text: GuestNetwork1
         traffic_type: Guest
broadcast_domain_type: Vlan
        broadcast_uri: vlan://untagged
                 mode: Dhcp
  network_offering_id: 6
  physical_network_id: 200
       data_center_id: 1
            guru_name: DirectNetworkGuru
                state: Setup
              related: 203
            domain_id: 1
           account_id: 1
                 dns1: NULL
                 dns2: NULL
            guru_data: NULL
           set_fields: 0
             acl_type: Domain
       network_domain: cs1cloud.internal
       reservation_id: NULL
           guest_type: Shared
     restart_required: 0
              created: 2018-06-09 18:53:26
              removed: NULL
    specify_ip_ranges: 1
               vpc_id: NULL
          ip6_gateway: NULL
             ip6_cidr: NULL
         network_cidr: NULL
      display_network: 1
       network_acl_id: NULL
          streched_l2: 0
            redundant: 0
          external_id: NULL
1 row in set (0.01 sec)