Organization: China Mobile Smart Home Operations Center
Introduction
The primary goal of the OpenStack project is to simplify cloud deployment and provide good scalability. This article introduces OpenStack network types and analyzes their application scenarios.
What is OpenStack?
OpenStack is a cloud computing platform composed of multiple components. It is an open-source project that provides software for building and managing public, private, and hybrid clouds. Tens of thousands of individual contributors from more than 100 countries and over 200 companies participate in OpenStack development, including NASA, Huawei, Google, HP, Intel, IBM, and Microsoft. The project's main objective is to simplify cloud deployment and improve scalability.
What can OpenStack do?
OpenStack can plan and manage large numbers of virtual machines, allowing enterprises or service providers to deliver compute resources on demand. It also provides object and block storage resources required by cloud services and applications. To address the limitations of traditional network management in achieving highly scalable and automated management of next-generation networks, OpenStack provides plugin-based, extensible, API-driven networking and IP management features.
Supported network types
OpenStack network types are mainly divided into two categories: provider networks and self-service networks. The self-service type adds a Layer 3 routing component (Networking L3 Agent), which implements L3 protocols, handles SNAT/DNAT and other address translations, and provides isolated tenant networks.
Provider network
Provider networks are typically bridged networks. A virtual machine's internal interface is bridged directly to a physical NIC on the host, enabling the VM to use an IP address from the external network and to be reachable from the external network. This topology minimizes dependence on OpenStack internal networking components.
Self-service networks
Self-service networks create a virtual router between VMs and the host. A VM typically uses a private address attached to one interface of the virtual router; the router's other interface is bridged to a host physical NIC. Self-service networks hide VM addresses from the external network: VMs can access external networks, but external users cannot directly access VMs. To allow external access to specific VMs, you can configure one-to-one NAT or port mapping between the VM and the external network. In addition to the capabilities of provider networks, self-service networks offer highly customizable tenant networking.
Use cases by network type
Provider network use cases
In a provider network topology, VM interfaces are bridged to host NICs and use IP addresses from the external network. This approach minimizes reliance on OpenStack internal networking components and leverages external network infrastructure. Compared with self-service networks, provider networks can be more stable and introduce lower internal processing latency because the topology is simpler. Provider networks are suitable for scenarios with relatively fixed network topology and modest network feature requirements.
Self-service network use cases
In a self-service network topology, VMs are not directly bridged to host NICs; they use a private network connected to the physical NIC through a virtual router. The topology is more complex and the virtual router introduces additional processing latency compared with direct bridging. Because of its flexibility and richer functionality, self-service networking is better suited to scenarios that require advanced network features, such as private clouds or multi-tenant public clouds with complex internal networking needs.
Quick start with DevStack
OpenStack consists of many open components. To reduce deployment complexity for users and developers, the community provides DevStack, a one-click, quick-deployment environment. DevStack is a development build of OpenStack that uses automated scripts to rapidly build and validate a cloud environment.
5.1 Environment preparation
DevStack has been thoroughly tested on Ubuntu 22.04. It is recommended to create an Ubuntu 22.04 VM on VMware with the following configuration:
Virtual machine OS Ubuntu 22.04 RAM at least 8GB Disk at least 50GB Network interfaces Recommended two: one NAT, one bridged (NAT: eth0 192.168.1.2, bridged: eth2 192.168.2.2)
5.2 Deployment steps
(1) Add user
sudo useradd -s /bin/bash -d /opt/stack -m stack
(2) Add execute permission
sudo chmod +x /opt/stack
(3) Add sudo privileges
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack sudo -u stack -i
(4) Download DevStack
git clone https://opendev.org/Openstack/devstack cd devstack
(5) Create configuration file
Open and edit local.conf:
vim local.conf
[[local|localrc]] HOST_IP=192.168.2.2 SERVICE_HOST=192.168.2.2 MYSQL_HOST=192.168.2.2 RABBIT_HOST=192.168.2.2 GLANCE_HOSTPORT=192.168.2.2:9292 ADMIN_PASSWORD=secret DATABASE_PASSWORD=secret RABBIT_PASSWORD=secret SERVICE_PASSWORD=secret ## Neutron options Q_USE_SECGROUP=True FLOATING_RANGE="192.168.1.0/24" Q_FLOATING_ALLOCATION_POOL=start=192.168.1.200,end=192.168.1.220 PUBLIC_NETWORK_GATEWAY="192.168.1.1" PUBLIC_INTERFACE=eth0 # Open vSwitch provider networking configuration Q_USE_PROVIDERNET_FOR_PUBLIC=True OVS_PHYSICAL_BRIDGE=br-ex PUBLIC_BRIDGE=br-ex OVS_BRIDGE_MAPPINGS=public:br-ex
(6) Start installation
./stack.sh
Summary
OpenStack supports two main network types: provider and self-service. Choose the appropriate networking mode based on your deployment requirements. For relatively fixed topologies such as cloud PCs or virtual desktops, provider networks may be suitable, though they impose certain requirements on infrastructure and datacenter networks. For complex private or public cloud scenarios with advanced tenant networking needs, self-service networks are recommended.
References
- Huawei IP Encyclopedia: What is OpenStack, Huawei IP Knowledge Encyclopedia, Oct 9, 2021
- cnblogs: OpenStack Neutron network service, Oct 31, 2020
- OpenStack official installation guide: Provider network overview, OpenStack, Jan 14, 2023
- OpenStack official docs: Deploy LBs in self-service, OpenStack, Jan 14, 2023
- OpenStack DevStack documentation, OpenStack, Jan 12, 2023