HCIA-Cloud Computing V5.5 Pre-Course
HCIA-Cloud Computing V5.5 Pre-Course
HCIA-Cloud Computing V5.5 Pre-Course
Foreword
2 Huawei Confidential
Objectives
3 Huawei Confidential
Contents
1. Introduction to Servers
◼ What Is a Server?
Server Development History
Server Types
Server Hardware
4 Huawei Confidential
Server Definition and Features
⚫ Definition
A server is a type of computer. It runs faster, carries more loads, and costs more than ordinary computers.
A server provides services to users. There are file servers, database servers, and application servers.
Availability
Reliability Scalability
Server
Features
Usability
Manage
ability
5 Huawei Confidential
Application
Web DNS
Email Proxy
…
Database Server use cases
File
6 Huawei Confidential
• Servers have been widely used in various fields, such as the telecom carrier,
government, finance, education, enterprise, and e-commerce. Servers can provide
users with the file, database, email, and web services.
▫ C/S: short for Client/Server. In this architecture, the server program runs on
the server, and the client software is installed on the client. The server and
client perform different tasks. The client carries the front-end GUI and
interaction operations of users, and the server processes the background
service logic and request data. This greatly improves the communication
speed and efficiency between the two ends. For example, you can install the
vsftpd program on a file server and start the service. After you install the
FileZilla or WinSCP client on your PC, you can upload and download files
using the client.
▫ B/S: short for Browser/Server. In this architecture, users only need to install
a browser. The application logic is centralized on the server and middleware,
which improves the data processing performance. For example, when
accessing a website, we only need to enter the domain name of the website
in the browser, for example, www.huawei.com. Then we can see the web
services provided by the background servers of the website. We do not need
to care the background servers that provide services, such as the database
service, proxy service, and cache service.
Contents
1. Introduction to Servers
What Is a Server?
◼ Server Development History
Server Types
Server Hardware
7 Huawei Confidential
Server Development History
Mainframe
and Cloud
Microcomputers X86 servers
midrange computing
computers
8 Huawei Confidential
• Mainframe phase
▫ In the 1940s and 1950s, the first generation of vacuum tube computers
emerged. The computer technology develops rapidly from vacuum tube
computers, transistor computers, integrated circuit computers, to large-
scale integrated circuit computers.
• Midrange computer phase
▫ In the 1960s and 1970s, mainframes were scaled down for the first time to
meet the information processing requirements of small- and medium-sized
enterprises and institutions. The cost was acceptable.
• Microcomputer phase
▫ In the 1970s and 1980s, mainframes were scaled down for the second time.
Apple Inc. was founded in 1976, and launched Apple II in 1977. In 1981,
IBM launched IBM-PC. After several generations of evolution, it occupied
the personal computer market and made personal computers popular.
• x86 server era
▫ In 1978, Intel launched the first-generation x86 architecture processor, 8086
microprocessor.
▫ In 1993, Intel officially launched the Pentium series, which brought the x86
architecture processor to a new level of performance.
▫ In 1995, Intel launched Pentium Pro, the x86 processor for servers, ushering
in the x86 era. The standardization and openness of Pentium Pro also
promoted the market development and laid a solid foundation for the
cloud computing era.
9 Huawei Confidential
▫ Since 2008, the concept of cloud computing has gradually become popular,
and cloud computing becomes a popular word. Cloud computing is
regarded as a revolutionary computing model because it enables the free
flow of supercomputing capabilities through the Internet. Enterprises and
individual users do not need to purchase expensive hardware. Instead, they
can rent computing power through the Internet and pay only for the
functions they need. Cloud computing allows users to obtain applications
without the complexity of technologies and deployment. Cloud computing
covers development, architecture, load balancing, and business models, and
is the future model of the software industry.
A Leap from Computing 1.0 to Computing 3.0
10 Huawei Confidential
• The computing industry has developed for nearly half a century and continuously
changed other industries. The computing industry itself is evolving.
• In the early mainframe and midrange computer era, dedicated computing is used,
which is called computing 1.0. In the x86 era, under the leadership of Intel and
driven by Moore's Law, computing has shifted from dedicated to general-purpose.
A large number of data centers have emerged, which is called computing 2.0.
With the rapid development of digitalization, the world is developing towards
intelligent. Computing is not limited to data centers, but also enters the full-stack
all-scenario (computing 3.0) era. This era is featured by intelligence, so it is also
called intelligent computing.
Contents
1. Introduction to Servers
What Is a Server?
Server Development History
◼ Server Types
Server Hardware
11 Huawei Confidential
Server Classification - Hardware Form
Hardware form
12 Huawei Confidential
• Tower server:
▫ Some tower servers use a chassis roughly the same size as an ordinary
vertical computer, while others use a large-capacity chassis, like a large
cabinet.
• Rack server:
• Blade server:
1. Introduction to Servers
What Is a Server?
Server Development History
Server Types
◼ Server Hardware
13 Huawei Confidential
Hardware Structure
⚫ Huawei TaiShan 200 server
1 Chassis
9 2 Motherboard
5 3 Memory
4 CPU
7
8 5 CPU heat sink
6 3 6 Power supply unit (PSU)
2
4 7 Fan
8 Drive
1
9 Air duct
14 Huawei Confidential
⚫ Components
The CPU consists of a logic operation unit, a control unit, and a storage unit.
Register
Controller
15 Huawei Confidential
• The CPU is the core processing unit on a server, and a server is an important
device on the network and needs to process a large number of access requests.
Therefore, servers must have high throughput and robust stability, and support
long-term running. Therefore, the CPU is the brain of a computer and is the
primary indicator for measuring server performance.
• The computer controls the entire computer according to a pre-stored program,
and the program refers to an instruction sequence that can implement a function.
The controller is an organization that issues commands to various logic circuits
according to the instructions. The controller is a command center of the
computer, controls work of an entire CPU, and determines automation of a
running process of the computer.
• The ALU is a part of a computer that performs a variety of arithmetic and logical
operations. Basic operations of an ALU include arithmetic operations such as
addition, subtraction, multiplication, and division, logical operations such as AND,
OR, NOT, and XOR, and other operations such as shift, comparison, and transfer.
The ALU is also called the arithmetic logic component.
• The register is used to temporarily store the data involved in operations and the
operation results. It can receive, store, and output data.
CPU Frequency
⚫ Dominant frequency
The dominant frequency is also called clock speed. It indicates, in MHz or GHz, the frequency at
which a CPU computes and processes data.
⚫ External frequency
The external frequency is the reference frequency of a CPU, measured in MHz. The CPU external
frequency determines the speed of the motherboard.
⚫ Bus frequency
The bus frequency directly affects the speed of data exchange between a CPU and a dual in-line
memory module (DIMM).
⚫ Multiplication factor
The multiplication factor is the ratio of the dominant frequency to the external frequency.
16 Huawei Confidential
Memory
⚫ Definition
Storage is classified, by purpose, into main memory and external storage. Main memory, referred to as internal storage, is the
storage space that the CPU can address.
Memory is used to temporarily store CPU operation data and the data exchanged with external storage devices such as hard
drives.
Memory, one of important computer components, communicates with the CPU.
Memory consists of the memory chip, circuit card, and edge connector.
17 Huawei Confidential
18 Huawei Confidential
• SATA and NL-SAS drives are cheaper, SAS drives are more expensive, and SSDs
are the most expensive.
RAID Controller Card
⚫ Also called the RAID card.
⚫ Functions of the RAID controller card:
Combines multiple drives into a system managed by the array controller according to requirements.
Improves drive subsystem performance and reliability.
LSI SAS3108
19 Huawei Confidential
Logical drive
20 Huawei Confidential
• For details about the working principles of RAID, see the course of storage basics.
RAID Hot Spare and Reconstruction
⚫ Hot spare definition
If a drive in a RAID array fails, a hot spare is used to automatically replace the failed drive to maintain the RAID
array's redundancy and data continuity.
⚫ Hot spare types
Global: The spare drive is shared by all RAID arrays in the system.
Dedicated: The spare drive is used only by a specific RAID array.
A0 Reconstruction XOR
Failure
Reconstruction A0
Replace- A1 A2 P
ment
Data drive Data drive Data drive Parity drive
Hot spare
drive
21 Huawei Confidential
• Data parity: Redundant data is used to detect and rectify data errors. The
redundant data is usually calculated through Hamming check or XOR operations.
Data parity can greatly improve the reliability, performance, and error tolerance
of the drive arrays. However, the system needs to read data from multiple
locations, calculate, and compare data during the parity process, which affects
system performance.
CPU CPU
SCSI Bus
PCI Bus PCI Bus
SCSI
RAID controller
card
Bus
RAID
SCSI card controller
SCSI Bus
22 Huawei Confidential
• A RAID controller card has a processor inside and can control the RAID storage
subsystem independently from the host. The RAID controller card has its own
independent processor and memory. It can calculate parity information and
locate files, reducing the CPU computing time and improving the parallel data
transmission speed.
RAID Implementation - Software
⚫ Definition
Software RAID implements RAID functions by installing software on the operating system.
⚫ Characteristics
Software RAID does not require expensive RAID controller cards, reducing the cost.
RAID functions are performed by CPUs, requiring significant CPU resources, such as for large
23 Huawei Confidential
24 Huawei Confidential
NIC Definition and Functions
⚫ Definition
A network interface card (NIC or network adapter) is an indispensable part of a
⚫ Functions
Fixed network address
Data sending and receiving
Data encapsulation and decapsulation Data Application layer
Physical layer
25 Huawei Confidential
Huawei Server NICs
⚫ LOM card
It is embedded directly into the PCH chip on the server
LOM card
motherboard and cannot be replaced.
It provides two external GE electrical ports + two 10 Gbit/s
optical/electrical ports. LOM cards do not occupy PCIe slots.
⚫ PCIe card PCIe card
Huawei has both self-developed and purchased PCIe cards.
They can be installed in standard PCIe slots.
⚫ FlexIO card
FlexIO card
Huawei-developed, non-standard PCIe card, which can only be
used with Huawei rack servers.
⚫ Mezzanine card
Mezzanine cards are only used on the compute nodes of
Mezzanine card
Huawei E9000 blade servers.
26 Huawei Confidential
• PCI-Express (PCIe) is the third-generation I/O bus, or 3GIO, following ISA and PCI
buses. This bus was proposed by Intel at the Intel Developer Forum (IDF) in 2001
and renamed PCI-Express after being certified and released by the PCI special
interest group (SIG). Its main advantages are high data transmission rate, strong
anti-interference, long transmission distance, and low power consumption.
• For Huawei servers, a PCIe card refers to the NIC in a PCIe slot.
• Visit the link below to learn how to install and remove a PCIe card:
https://support.huawei.com/enterprise/en/doc/EDOC1100002169?section=o00d
27 Huawei Confidential
▫ 1+1: In this mode, each module provides 50% of the output power. When
one module is removed, the other provides 100% of the output power.
▫ 2+1: In this mode, three modes are required. Each module provides 1/3 of
the output power. When one module is removed, each of the other two
modules provides 50% of the output power.
1. Server Introduction
28 Huawei Confidential
What Is IPMI?
⚫ Definition
The Intelligent Platform Management Interface (IPMI) is a set of open and standard hardware management
interface specifications that defines specific methods for communication between embedded management
subsystems.
IPMI information is exchanged using the baseboard management controller (BMC). Entry-level intelligent
hardware, not the OS, handles management.
Client
Server
29 Huawei Confidential
• IPMI development:
▫ In 1998, Intel, DELL, HP, and NEC put forward the IPMI specification. The
temperature and voltage can be remotely controlled through the network.
▫ In 2001, the IPMI was upgraded from version 1.0 to version 1.5. The PCI
Management Bus function was added.
▫ In 2004, Intel released the IPMI 2.0 specification, which is compatible with
the IPMI 1.0 and 1.5 specifications. Console Redirection is added. Servers
can be remotely managed through ports, modems, and LANs. In addition,
security, VLANs, and blade servers are supported.
BMC
⚫ Definition
The BMC complies with the IPMI specification. It collects, processes, and stores sensor signals, and monitors
component operating status. It supplies the chassis management module with managed objects' hardware status
and alarm information. The management module uses this information to manage the devices.
30 Huawei Confidential
▫ Remote control
▫ Alarm management
▫ Status check
▫ Web-based management
Diagnosis Run
• Power-on/off assistance records • Black box - Kbox
recording • Parsing tool -
• Serial port voice HWKbox
recording
• Last screenshot
• Last video
31 Huawei Confidential
• The iBMC provides a series of management tools for hardware status monitoring,
deployment, energy saving, and security, and standard interfaces to build a
comprehensive server management ecosystem. The iBMC uses Huawei-developed
management chip Hi1710 and multiple innovative technologies to implement
refined server management.
• The iBMC provides a variety of user interfaces, such as the CLI, web-based user
interface, IPMI integration interface, SNMP integration interface, and Redfish
integration interface. All user interfaces adopt the authentication mechanism and
high-security encryption algorithm to enhance access and transmission security.
Contents
1. Introduction to Servers
32 Huawei Confidential
BIOS
⚫ Basic Input/Output System (BIOS)
⚫ The BIOS is a system's foundation: a group of programs providing the most direct control of system
hardware.
Applications
Operating environment
BIOS functions:
Operating system kernel Hardware detection
and initialization
OS boot
BIOS Hardware driver Advanced power
management
Hardware
33 Huawei Confidential
• The BIOS is a bridge between the system kernel and the hardware layer.
▫ Fault recovery
▫ ECC management
▫ Hardware diagnosis
Quiz
1. Which of the following statements are true about the NICs of Huawei servers?
A. The LOM card is embedded into the PCH chip on the server motherboard and cannot be replaced.
B. Huawei-developed PCIe cards can be installed in standard PCIe slots.
C. A FlexIO card is integrated with the server panel for front-end service connection.
D. Mezzanine cards can be used with Huawei rack servers.
2. The BMC complies with the IPMI specification. It collects, processes, and stores sensor
signals, and monitors component operating status.
A. True
B. False
34 Huawei Confidential
• Answers:
▫ AB
▫ A
Summary
35 Huawei Confidential
Recommendations
⚫ Huawei iLearning
https://e.huawei.com/en/talent/portal/#/
⚫ Huawei Support Case Library
https://support.huawei.com/enterprise/en/knowledge?lang=en
36 Huawei Confidential
Acronyms and Abbreviations
⚫ BIOS: Basic Input/Output System
⚫ BMC: Baseboard Management Controller
⚫ B/S: browser/server architecture
⚫ C/S: client/server architecture
⚫ CPU: Central Processing Unit
⚫ iBMC: Huawei Intelligent Baseboard Management Controller
⚫ IPMI: Intelligent Platform Management Interface
⚫ MTBF: Mean Time Between Failures
⚫ NIC: Network Interface Card
⚫ RAID: Redundant Array of Independent Disks
37 Huawei Confidential
Thank you. 把数字世界带入每个人、每个家庭、
每个组织,构建万物互联的智能世界。
Bring digital to every person, home, and
organization for a fully connected,
intelligent world.
⚫ Data is the most important asset for every enterprise. This course describes
how and where data is stored, and provides the key data storage
technologies in cloud computing.
2 Huawei Confidential
Objectives
3 Huawei Confidential
Contents
1. Storage Basics
◼ Definition of Storage
History of Storage
Mainstream Disk Types
Storage Networking Types
Storage Forms
4 Huawei Confidential
What Is Storage?
⚫ Storage refers to the process of storing and managing digital information on a computer or other
electronic device. It can include both physical storage devices, such as hard disks and solid state disks,
and virtual storage systems, such as cloud storage services.
⚫ The goal of storage is to provide a reliable and secure way to store and access data as needed.
5 Huawei Confidential
• Storage in a narrow sense: CDs, DVDs, ZIP drives, tapes, and disks...
1. Storage Basics
Definition of Storage
◼ History of Storage
Mainstream Disk Types
Storage Networking Types
Storage Forms
6 Huawei Confidential
History of Storage
Controller
This century
1990s • Distributed
1980s • Storage storage
network • Cloud storage
• External
1950s storage
• Traditional
storage
7 Huawei Confidential
• The storage architecture has gone through the following development phases:
traditional storage, external storage, storage network, distributed storage, and
cloud storage.
• Traditional storage refers to individual disks. In 1956, IBM invented the world's
first mechanical hard drive that has fifty 24-inch platters and the total storage
capacity of just 5MB. It is about the size of two refrigerators and weighs more
than a ton. It was used in the industrial field at that time and was independent of
the mainframe.
• A storage area network (SAN) is a typical storage network that transmits data
mainly over a Fibre Channel network. Then, IP SANs emerge.
Server RAM
RAM
CPU
Disk Disk
RAM
SCSI card
SCSI card
Disk
Controller
8 Huawei Confidential
From Separation to Convergence
SAN LAN
File
NAS SAN
system
Storage Storage
File
system Storage
9 Huawei Confidential
▫ Scattered data
▫ Data sharing
▫ Distance extension
▫ NAS: builds networks between servers and storage devices with file systems
to provide file storage services.
• In 2011, unified storage that supported both SAN and NAS protocols became
popular. Storage convergence set a new trend: NAS and SAN were converged to
provide both database and file sharing services, simplifying storage management,
and improving storage utilization.
Scale-out Storage
⚫ Physical resources are organized using
software to form a high-performance
Front-end
logical storage pool, ensuring reliability service
Management
network
and providing multiple storage services. network
10 Huawei Confidential
• The scalability and flexibility of storage systems in the traditional architecture are
limited.
11 Huawei Confidential
• Functions:
Legacy New
applications applications
Converged
Elastic Block storage service File storage service Object storage service
12 Huawei Confidential
• The cloud storage system uses clustered applications, grid technologies, or scale-
out file systems to coordinate various storage devices over the networks to
provide data storage and service access.
Contents
1. Storage Basics
Definition of Storage
History of Storage
◼ Mainstream Disk Types
Storage Networking Types
Storage Forms
13 Huawei Confidential
Introduction to Disks
⚫ Disks can be considered the most important storage device of a computer.
⚫ A disk interface is a component used to connect a disk to a host. It transmits data between the disk cache and the host memory. The
disk interface type determines the connection speed between the disk and the computer, the program running speed, and system
performance.
Capacity (TB) 1 TB/2 TB/3 TB 0.6 TB/0.9 TB 2 TB/3 TB/4 TB 0.6 TB/0.8 TB/1.2 TB/1.6 TB
14 Huawei Confidential
• Increasing order of price: SATA and NL-SAS disks, SAS disks, and SSDs
Disk Key Indicators
⚫ Disk capacity Bandwidth
IOPS
(128 KB
Disk Type (4 KB random
⚫ Rotational speed (HDD only) write)
sequential
read)
⚫ Average access time
SATA 330 200 MB/s
⚫ Data transfer rate
SAS 10K 350 195 MB/s
⚫ Input/Output operations per second (IOPS)
SAS 15K 450 290 MB/s
Higher IOPS,
IOPS
better performance
SATA SSD 30,000 to 60,000 540 MB/s
15 Huawei Confidential
• Disk capacity: The capacity is measured in MB or GB. The factors that affect the
disk capacity include the single platter capacity and the number of platters.
• Rotational speed: The rotational speed is the number of rotations made by disk
platters per minute. The unit is rotation per minute (rpm). In most cases, the
rotational speed of a disk reaches 5400 rpm or 7200 rpm. The disk that uses the
SCSI interface reaches 10,000 rpm to 15,000 rpm.
• Data transfer rate: The data transfer rate of a disk is the speed at which the disk
reads and writes data. It is measured in MB/s. The rate consists of the internal
data transfer rate and the external data transfer rate.
1. Storage Basics
Definition of Storage
History of Storage
Mainstream Disk Types
◼ Storage Networking Types
Storage Forms
16 Huawei Confidential
Introduction to DAS
⚫ Direct attached storage (DAS)
⚫ Time: 1970s
Server
⚫ Background: Data explosion drove up huge
17 Huawei Confidential
Introduction to NAS(1)
⚫ Network attached storage (NAS)
⚫ Time: early 1990s
NAS system architecture
Unix Linux Windows
⚫ Background: Developing networks drove the need
for large-scale data sharing and exchange, leading
to dedicated NAS storage devices.
NFS NFS CIFS ⚫ Access mode: Multiple front-end servers share
space on back-end NAS storage devices using CIFS
Dedicated IP or NFS Concurrent read and write operations can
storage network be performed on the same directory or file.
NFS and
CIFS File system
RAID ⚫ The file system is on the back-end storage
device.
18 Huawei Confidential
• Linux NFS clients support NFSv2 [RFC1094], NFSv3 [RFC1813], and NFSv4
[RFC3530]. NFSv2 that uses the User Datagram Protocol (UDP) is outdated due
to its limited data access and transmission capabilities.
▫ RPC provides a set of operations to achieve remote file access that are not
restricted by machines, OSs, and lower-layer transmission protocols. It
allows remote clients to access storage over a network like accessing a local
file system.
▫ The NFS client sends an RPC request to the NFS server. The server transfers
the request to the local file access process, reads the local disk files on the
server, and returns the files to the client.
• Common Internet File System (CIFS) is a network file system protocol used for
sharing files and printers between machines on a network. CIFS is mainly used to
share network files between hosts running Windows.
Introduction to NAS(2)
⚫ NAS supports the centralized management of scattered and independent data, facilitating
access to various hosts and application servers.
NAS
Ethernet port Ethernet port
NFS
File system
Volume management module Volume management module
19 Huawei Confidential
• NAS can serve as a network node and be directly connected to the network. In
theory, NAS can support various network technologies and topologies. As
Ethernet is the most popular network connection mode nowadays, we mainly
discuss the NAS environment on the Ethernet.
• NAS supports multiple protocols (such as NFS and CIFS) and supports various
OSs. Users can conveniently manage NAS devices by using Internet Explorer or
Netscape on any work station.
Introduction to SAN
⚫ A storage area network (SAN) is a dedicated storage network that connects one or more
network storage devices to servers.
Clients
LAN
Servers
Storage devices
20 Huawei Confidential
• The SAN that uses Fibre Channel Protocol (FCP) to set up connections between
servers and storage devices through Fibre Channel switches is called an FC SAN.
Fibre Channel is especially suitable for SANs, because it supports long-distance
and large-block transfer. The SAN mainly applies to high-end and enterprise-
class storage applications, which have demanding requirements for performance,
redundancy, and data availability.
• The major difference between NAS and SAN is that NAS provides a file operation
and management system while SAN does not. SAN provides only data
management, which is the layer below file management. SAN and NAS do not
conflict with each other. They can coexist on the same network. However, NAS
implements storage space management and resource sharing through a public
interface, while SAN provides only a quick dedicate back-end channel for servers
to store data.
Introduction to FC SAN
⚫ Fibre Channel storage area network (FC SAN)
⚫ Time: middle and late 1990s
Server
⚫ Background: To solve the poor scalability issue of
DAS, storage devices was networked. More than 100
servers can be connected in a network.
Fibre Channel ⚫ Connection mode: Fibre Channel link; Fibre
switch
Fibre Channel
Channel switch
link ⚫ Access mode: The storage space on the back-end
FC SAN storage device can be divided into multiple LUNs.
Controller
Each LUN belongs to only one front-end server.
⚫ Link rate: 2 Gbit/s, 4 Gbit/s, or 8 Gbit/s
⚫ Provides advanced data protection functions,
such as snapshot and disaster recovery.
Disk array
21 Huawei Confidential
• Fibre Channel (FC) is a standard data storage network used to transmit 100
Mbit/s to 4.25 Gbit/s signals over fiber or copper cables. It is a high-speed
transport technology used to build SANs. Fibre Channel is primarily used for
transporting SCSI traffic from servers to disk arrays, but it can also be used on
networks carrying ATM and IP traffic.
Introduction to IP SAN
⚫ IP storage area network (IP SAN)
⚫ Time: 2001
⚫ Background: IP SAN is designed to solve the price and
Server
management issues of the FC SAN.
⚫ Connection mode: Ethernet link; Ethernet switch
⚫ Access mode: The storage space on the back-end storage
device can be divided into multiple LUNs. Each LUN
Ethernet switch
belongs to only one front-end server.
IP link ⚫ Link rate: 1 Gbit/s, or 10 Gbit/s
⚫ The IP SAN provides advanced data protection functions,
such as snapshot and disaster recovery.
iSCSI storage controller
⚫ iSCSI is a mainstream choice because:
Mature IP network management tools and
infrastructure can be used.
IP networks are widely used, which can reduce a large
Disk array number of construction, management, and personnel
costs.
22 Huawei Confidential
Application
Any File servers Database applications Video security
scenario
High scalability and
Easy to understand; Easy to install; Strong scalability;
Advantage performance;
robust compatibility low cost low cost
high availability
Difficult management;
Low performance; Expensive and complex
limited scalability; low Low performance
Disadvantage inapplicable to some configuration; poor
storage space
applications networking compatibility
utilization
23 Huawei Confidential
Contents
1. Storage Basics
Definition of Storage
History of Storage
Mainstream Disk Types
Storage Networking Types
◼ Storage Forms
24 Huawei Confidential
Centralized Storage
⚫ A centralized storage system refers to one set of storage system consisting of multiple devices. Enterprises often deploy their storage
devices on a centralized environment. For example, the Huawei storage system may need several cabinets to house devices. In terms
of technical architectures, centralized storage is classified into SAN (including FC SAN and IP SAN) and NAS storage.
⚫ Centralized storage has a simple deployment structure, which means you do not need to consider how to deploy multiple nodes for
a service, or the distributed collaboration between multiple nodes.
Server
Ethernet
switch
IP link
Disk storage
25 Huawei Confidential
P1 P2 Px
P1 P2 Py
26 Huawei Confidential
Object
File Object
Object Object Data
system Key
system Object
Storage Metadata
layer … User-defined
metadata
… …
27 Huawei Confidential
• Users can access data in an object storage as fast as in a SAN storage and can
share data as easy as in a NAS storage. Object storage has high reliability and
secure data sharing between platforms. The following describes the comparison
among the object storage, block storage, and file storage:
▫ Block storage directly accesses the storage layer, featuring fast speed,
minimum overhead, and maximum efficiency. However, block storage has
the high cost and poor scalability. Block storage employs iSCSI and Fibre
Channel. Therefore, it is difficult to transmit data across networks. Block
storage is applicable to enterprise databases, such as Oracle.
▫ File storage creates a file system on the basis of block storage. Data is
organized in the directory-directory-file mode, facilitating data
management. The objects operated by most application programs are files.
Therefore, file storage enables easier interworking with application systems.
File systems are restricted by directory trees. Therefore, a file system can be
typically expanded to dozens of PB at most. The scalability is limited. File
systems are applicable to application integration and file sharing in an
enterprise.
• Object storage creates the object management layer above block storage.
Compared with the file system, the object system is flat with little expansion
limitation. An object consists of a unique key, file, data (file), metadata, and user-
defined metadata. An object contains self-management information. Therefore,
object storage is more intelligent. Using compatible standard Internet protocol
interfaces, object storage supports cross-region transmission. Object storage
applies to storage scenarios for Internet services, and internal arching and backup
scenarios for enterprises.
Contents
1. Storage Basics
29 Huawei Confidential
What Is RAID?
⚫ Redundant Array of Independent Disks (RAID) combines multiple physical disks into one logical disk in
different ways, improving read/write performance and data security.
RAID levels based on combination methods
RAID 0 Data striping, no parity
RAID 0+1 Create RAID 0 and then RAID 1, providing data striping and mirroring.
RAID 10 Similar to RAID 0+1. The difference is that RAID 1 is created before RAID 0.
RAID 50 Create RAID 5 and then RAID 0, effectively improving the performance of RAID 5.
30 Huawei Confidential
RAID Data Distribution
⚫ Disk striping: Space in each disk is divided into multiple strips of a specific size. Written data is also
divided into blocks based on the strip size.
⚫ Strip: A strip consists of one or more consecutive sectors in a disk, and multiple strips form a stripe.
⚫ Stripe: A stripe consists of strips of the same location or ID on multiple disks in the same array.
D3 D4 D5 Stripe 1
D0 D1 D2 Stripe 0
31 Huawei Confidential
• Stripe width
▫ Indicates the number of disks in an array for striping. For example, if a disk
array consists of three member disks, the stripe width is 3.
• Stripe depth
32 Huawei Confidential
Dedicated: The spare disk is used only by a specific RAID group in the system.
A0 Reconstruction XOR
Fault
Reconstruction
A0 A1 A2 P
Replacement
Data disk Data disk Data disk Parity disk
Hot spare
disk
33 Huawei Confidential
• Data parity: Redundant data is used to detect and rectify data errors. The
redundant data is usually calculated through Hamming check or XOR operations.
Data parity can greatly improve the reliability, performance, and error tolerance
of the disk arrays. However, the system needs to read data from multiple
locations, calculate, and compare data during the parity process, which affects
system performance.
D3 D2 D3 D3
D2 D2
D2 D3 D1 D1 D2 P1 D3 D0 D1 D2 D3
D0 D1 D0 D1 P0 RAID 1 RAID 1 RAID 1 RAID 1
D0 D0
34 Huawei Confidential
• RAID 0 consists of striping without fault tolerance. Data of the RAID group is
evenly distributed on all disks in stripe form.
• RAID 1, also called mirroring, can simultaneously write data into the primary disk
and mirror disk.
• RAID 3 consists of striping with dedicated parity. Data is striped on data disks,
and parity data is stored on a dedicated parity disk.
• RAID 10 combines mirroring and striping. The first level is RAID 1 mirrored pairs,
and the second level is RAID 0. RAID 10 is also a widely used RAID level.
Working Principles of RAID 6 DP
⚫ Double parity (DP): In addition to the horizontal XOR parity disk used in RAID 4, it adds another disk to store
diagonal XOR parity data.
⚫ P0 to P3 on the horizontal parity disk are the parity information of horizontal data on all data disks.
For example, P 0 = D 0 XOR D 1 XOR D 2 XOR D 3
⚫ DP 0 to DP 3 in the diagonal parity disk represent the diagonal parity data for respective data disks and the
horizontal parity disk.
For example, DP 0 = D 0 XOR D 5 XOR D 10 XOR D 15
35 Huawei Confidential
• RAID 6 DP has two independent parity data blocks: horizontal parity data and
diagonal parity data.
• Parity values in the horizontal parity disk are also called parity check values,
which are obtained by performing the XOR operation on user data in the same
stripe.As shown in the following figure,P0 is obtained by performing an XOR
operation on D0, D1, D2, and D3 on a stripe 0, and P1 is obtained by performing
an XOR operation on D4, D5, D6, and D7 on a stripe 1. Therefore, P0 = D0 ⊕D1⊕
D2⊕D3, P1 = D4⊕D5⊕D6⊕D7, and so on.
• The diagonal parity uses the diagonal XOR operation to obtain the row-diagonal
parity data block. A process of selecting a data block is relatively complex. DP0 is
obtained by performing an exclusive OR operation on D0 on a stripe 0 of a hard
disk 1, D5 on a stripe 1 of a hard disk 2, D10 on a stripe 2 of a hard disk 3, and
D15 on a stripe 3 of a hard disk 4. DP1 is obtained by performing an exclusive OR
operation on D1 on a stripe 0 of a hard disk 2, D6 on a stripe 1 of a hard disk 3,
D11 on a stripe 2 of a hard disk 4, and P3 on a stripe 3 of a first parity hard disk.
DP2 is obtained by performing an exclusive OR operation on D2 on a stripe 0 of a
hard disk 3, D7 on a stripe 1 of a hard disk 4, P2 on a stripe 2 of an odd even
hard disk, and D12 on a stripe 3 of a hard disk 1. Therefore, DP0 =
D0⊕D5⊕D10⊕D15, DP1 = D1⊕D6⊕D11⊕P3, and so on.
• A RAID 6 array tolerates failures of up to two disks.
▫ The disk capacity is large (usually greater than 2 TB). The reconstruction of
a large-capacity disk takes a long time. Data will be inaccessible for a long
time if two disks fail at the same time. A RAID 6 array tolerates failure of
another disk during the reconstruction of one disk. Some enterprises want
to use a dual-redundancy RAID array for their large-capacity disks.
Introduction to RAID 2.0
⚫ RAID 2.0
RAID 2.0 is an enhanced RAID technology that effectively resolves the following problems: prolonged
reconstruction of an HDD, and data loss if a disk is faulty during the long reconstruction of a traditional RAID
group.
⚫ RAID 2.0+
RAID 2.0+ provides smaller resource granularities (tens of KB) than RAID 2.0 to serve as the units of standard
allocation and reclamation of storage resources, similar to VMs in computing virtualization. This technology is
called virtual block technology.
⚫ Huawei RAID 2.0+
Huawei RAID 2.0+ is a new RAID technology that overcomes traditional RAID issues. Huawei RAID 2.0+ evolves
in line with the storage architecture virtualization to implement two-layer virtualized management instead of
the traditional fixed management. Based on the underlying disk management that employs block virtualization
(Virtual for Disk), RAID 2.0+ uses Smart-series efficiency improvement software to implement efficient resource
management that features upper-layer virtualization (Virtual for Pool).
37 Huawei Confidential
38 Huawei Confidential
2. Each SSD is then divided into CKs of a fixed size (typically 4 MB) for logical space
management.
3. CKs from different SSDs form chunk groups (CKGs) based on the RAID policy
specified on DeviceManager.
4. CKGs are further divided into grains (typically 8 KB). Grains are mapped to LUNs
for refined management of storage resources.
• Balanced service loads for zero hotspots. Data is evenly distributed to all
SSDs in a storage resource pool, ensuring no SSD becomes a hotpot,
thereby lowering the SSD failure rate.
• Quick reconstruction for a lowered data loss risk. Faulty SSDs trigger data
reconstruction on all the other SSDs in the storage pool. This many-to-
many reconstruction is rapid and significantly reduces data vulnerability.
1. Storage Basics
39 Huawei Confidential
SCSI
⚫ Small Computer System Interface (SCSI) is an interface technology developed for midrange
computers and used for connecting between hosts and peripheral devices.
I/O request
SCSI bus
Data/Address bus Host Disk
Host
Adapter C/S
Command/Data
SCSI array SCSI array SCSI transport layer SCSI transport layer
ID 0 ID 5
Bus connection
LUN 0 LUN 1 LUN 0 SCSI interconnection SCSI interconnection
LUN 2 LUN 1 layer layer
40 Huawei Confidential
• Computers communicate with storage systems through buses. The bus is a path
through which data is transferred from the source device to the target device. To
put it simple, the high-speed cache of the controller functions as the source
device and transfers data to target disks, which serve as the target devices. The
controller sends a signal to the bus processor requesting to use the bus. After the
request is accepted, the controller's high-speed cache sends data. During this
process, the bus is occupied by the controller and other devices connected to the
same bus cannot use it. However, the bus processor can interrupt the data
transfer at any time and allow other devices to use the bus for operations of a
higher priority.
• A computer has numerous buses, which are like high-speed channels used for
transferring information and power from one place to another. For example, the
universal serial bus (USB) port is used to connect an MP3 player or digital
camera to a computer. The USB port is competent to the data transfer and
charging of portable electronic devices that store pictures and music. However,
the USB bus is incapable of supporting computers, servers, and many other
devices.
• In this case, SCSI buses are applicable. SCSI, short for Small Computer System
Interface, is an interface used to connect between hosts and peripheral devices
including disk drives, tape drives, CD-ROM drives, and scanners. Data operations
are implemented by SCSI controllers. Like a small CPU, the SCSI controller has its
own command set and cache. The special SCSI bus architecture can dynamically
allocate resources to tasks run by multiple devices in a computer. In this way,
multiple tasks can be processed at the same time.
iSCSI
⚫ iSCSI encapsulates SCSI commands and block data into TCP packets and transmits the
packets over an IP network. iSCSI uses mature IP network technologies to implement and
extend SANs.
SCSI applications (such as file systems and databases)
SCSI block instruction SCSI flow instruction Other SCSI instructions
iSCSI
TCP
IP
Physical layer
42 Huawei Confidential
• The SCSI controller card is used to connect to multiple devices to form a network.
The devices can communicate with each other on the network but cannot be
shared on the Ethernet. If devices form a network through SCSI and the network
can be mounted to an Ethernet, the devices can interconnect and share with
other devices as network nodes. As a result, the iSCSI protocol evolved from SCSI.
The IP SAN using iSCSI converts user requests into SCSI codes and encapsulates
data into IP packets for transmission over the Ethernet.
• The iSCSI scheme was initiated by Cisco and IBM and then advocated by Adaptec,
Cisco, HP, IBM, Quantum, and other companies. iSCSI offers a way of transferring
data through TCP and saving data on SCSI devices. The iSCSI standard was
drafted in 2001 and submitted to IETF in 2002 after numerous arguments and
modifications. In Feb. 2003, the iSCSI standard was officially released. The iSCSI
technology inherits advantages of traditional technologies and develops based on
them. On one hand, SCSI technology is a storage standard widely applied by
storage devices including disks and tapes. It has been keeping a fast development
pace since 1986. On the other hand, TCP/IP is the most universal network
protocol and IP network infrastructure is mature. The two points provide a solid
foundation for iSCSI development.
43 Huawei Confidential
• The iSCSI communication system inherits some of SCSI's features. The iSCSI
communication involves an initiator that sends I/O requests and a target that
responds to the I/O requests and executes I/O operations. After a connection is
set up between the initiator and target, the target controls the entire process as
the primary device.
• iSCSI targets include iSCSI disk arrays and iSCSI tape libraries.
• The iSCSI protocol defines a set of naming and addressing methods for iSCSI
initiators and targets. All iSCSI nodes are identified by their iSCSI names. This
method distinguishes iSCSI names from host names.
• iSCSI uses iSCSI names to identify initiators and targets. Addresses change with
the relocation of initiator or target devices, but their names remain unchanged.
When setting up a connection, an initiator sends a request. After the target
receives the request, it checks whether the iSCSI name contained in the request is
consistent with that bound with the target. If the iSCSI names are consistent, the
connection is set up. Each iSCSI node has a unique iSCSI name. One iSCSI name
can be used in the connections from one initiator to multiple targets. Multiple
iSCSI names can be used in the connections from one target to multiple initiators.
Discussion:
⚫ We have learned the FC SAN and IP SAN. Now assume that two sites use different
networks FC SAN and TCP/IP. How can storage devices at the two sites
communicate with each other?
44 Huawei Confidential
Convergence of Fibre Channel and TCP
⚫ Ethernet technologies and Fibre Channel technologies are both developing fast. Therefore, it
is inevitable that IP SAN and FC SAN that are complementary coexist for a long time.
⚫ Fibre Channel over a TCP/IP network:
◼ iFCP
◼ FCoE
45 Huawei Confidential
• Fibre Channel over IP (FCIP) is an IETF proposed standard that defines the Fibre
Channel architecture over TCP/IP links. FCIP uses the current IP protocol and
facilities to connect the tunnels of two Fibre Channel SANs at different places.
• Fibre Channel over Ethernet (FCoE) transmits Fibre Channel signals over an
Ethernet, so that Fibre Channel data can be transmitted at the backbone layer of
a 10 Gbit/s Ethernet using the Fibre Channel protocol.
• IP over Fibre Channel (IPFC) uses the Fibre Channel connections between two
servers as IP data exchange media. To do this, IPFC defines how to transmit IP
packets over a Fibre Channel network. Like all other application protocols, IPFC is
implemented by a device driver in an operating system. The ifconfig or ipconfig
command is executed for local IP connections. Then the IPFC driver addresses the
Fibre Channel HBA. After that, IP packets can be transmitted through Fibre
Channel.
iFCP
⚫ Internet Fibre Channel Protocol (iFCP) is a gateway-to-gateway protocol that provides Fibre
Channel communication services for optical devices on TCP/IP networks to implement end-
to-end IP connection.
iFCP gateway iFCP gateway
TCP/IP
• The frame address conversion method defined in the iFCP protocol allows Fibre
Channel storage devices to be added to the TCP/IP-based network through
transparent gateways. iFCP can replace Fibre Channel to connect to and group
Fibre Channel devices using iFCP devices. However, iFCP does not support the
merge of independent SANs, and therefore a logical SAN cannot be formed. iFCP
outstands in supporting SAN interconnection as well as gateway zoning, allowing
fault isolation and breaking the limitations of point-to-point tunnels. In addition,
iFCP enables end-to-end connection between Fibre Channel devices. As a result,
the interruption of TCP connection affects only a communication pair. SANs that
adopt iFCP support fault isolation and security management, and deliver higher
reliability than SANs that adopt FCIP.
iFCP Protocol Stack
⚫ iFCP is between Fibre Channel and TCP/IP, which means that iFCP can
interwork with either Fibre Channel or TCP/IP.
SCSI applications (such as file systems and databases)
SCSI block instruction SCSI flow instruction Other SCSI instructions
iFCP
TCP
IP
Physical layer
47 Huawei Confidential
• The main function of the iFCP protocol layer is to transport Fibre Channel frame
images between locally and remotely attached N_Ports. When transporting
frames to a remote N_Port, the iFCP layer encapsulates and routes the Fibre
Channel frame comprising each Fibre Channel information unit, and transmits
the frame via a predetermined TCP connection over the IP network.
• In the IP SAN that uses iFCP, iFCP devices take the place of Fibre Channel
switches, which means that iFCP switches can also function as Internet Storage
Name Servers (iSNSs) to provide the name discovery service for terminal nodes.
The iFCP switch allocates a 4-byte IP address to each Fibre Channel terminal
node. When a Fibre Channel device sends an SNS name query request, the
request is intercepted by the iFCP switch and interpreted by the iSNS server.
FCoE
⚫ Fibre Channel over Ethernet (FCoE) allows the transmission of LAN and FC SAN data on the same
Ethernet link. This reduces the number of devices, cables, and network nodes in a data center, as well
as power consumption and cooling loads, simplifying management.
⚫ FCoE encapsulates FC data frames into Ethernet frames and allows service traffic on a LAN and SAN to
be transmitted over the same Ethernet.
VoIP call
48 Huawei Confidential
• FCoE offers standard Fibre Channel services, including discovery, global naming,
and zoning. These services run in the same way as the original Fibre Channel
services with low latency and high performance.
• From the perspective of Fibre Channel, FCoE enables Fibre Channel to be carried
by the Ethernet Layer 2 link. From the perspective of the Ethernet, FCoE is an
upper-layer protocol that the Ethernet carries, like IP or IPX.
FCoE Protocol Encapsulation
⚫ FCoE encapsulates contents in the FC-2 and above layers into Ethernet packets for
transmission.
FC-4 FC-4
FC-3 FC-3 Fibre Channel protocol layers
FC-2 FC-2
FC-1 FCoE
FC-0 MAC
Ethernet protocol layers
PHY
49 Huawei Confidential
• The Fibre Channel protocol stack has five layers. FC-0 defines the medium type,
FC-1 defines the frame coding and decoding mode, FC-2 defines the frame
division protocol and flow control mechanism, FC-3 defines general services, and
FC-4 defines the mapping from upper-layer protocols to Fibre Channel.
Discussion:
⚫ What are the application scenarios of FCoE?
⚫ What are the application scenarios of iFCP?
50 Huawei Confidential
Quiz
B. False
51 Huawei Confidential
Answers:
▫ AD
▫ B
Summary
52 Huawei Confidential
Recommendations
⚫ Huawei iLearning
https://e.huawei.com/en/talent/#/
⚫ Huawei Support Case Library
https://support.huawei.com/enterprise/en/knowledge?lang=en
53 Huawei Confidential
Acronyms and Abbreviations
⚫ FC: Fibre Channel
⚫ FCIP: Fibre Channel over IP
⚫ FCoE: Fibre Channel over Ethernet
⚫ iFCP: Internet Fibre Channel Protocol
⚫ iSCSI: Internet Small Computer System Interface
⚫ IPFC: IP over Fiber Channel
54 Huawei Confidential
Acronyms and Abbreviations
⚫ IOPS: Input/Output per second
⚫ MTBF: Mean Time Between Failure
⚫ NAS: Network Attached Storage
⚫ RAID: Redundant Array of Independent Disks
⚫ SAN: Storage Area Network
⚫ SCSI: Small Computer System Interface
55 Huawei Confidential
Thank you. 把数字世界带入每个人、每个家庭、
每个组织,构建万物互联的智能世界。
Bring digital to every person, home, and
organization for a fully connected,
intelligent world.
⚫ Network technologies are the basis for the interconnection of all platforms
and services. What exactly is a network? What are the basic principles of
network communication? And what are the common network technologies?
This course will answer these questions and more.
2 Huawei Confidential
Objectives
3 Huawei Confidential
Contents
1. IP Address Basics
3. Switching Basics
4. Routing Basics
4 Huawei Confidential
What Is an IP Address?
⚫ An IP address is a unique logical address used to identify a device that sends or receives data packets on a network.
⚫ The functions of an IP address are to:
Identify a host or network device (identifying its network interface and indicating its location on the network).
Implement network addressing
IP Address
IP 1 IP 5
An IP address is like a real-world
IP 4
address. It identifies a node on a
IP 2
network, and is used to find the
destination.
IP 3
Data
5 Huawei Confidential
27 26 25 24 23 22 21 20
Power
Decimal-to-binary 128 64 32 16 8 4 2 1
conversion
Bit 1 1 0 0 0 0 0 0
= 128 + 64 = 192
⚫ IPv4 address range: 0.0.0.0–255.255.255.255
6 Huawei Confidential
• IP address format:
▫ An IP address has 32 bits and consists of four bytes. For the convenience of
reading and writing, an IP address is usually in the format of dotted
decimal notation.
▫ 00000000.00000000.00000000.00000000–
11111111.11111111.11111111.11111111 in binary, and 0.0.0.0–
255.255.255.255 in decimal.
IP Address Structure
⚫ Network portion: identifies a network segment.
⚫ Host portion: uniquely identifies a host on a network segment.
Host
Network portion
portion
• Subnet mask: specifies which portion of an address refers to the subnet and which portion refers to
the host.
192 168 10 1
192.168.10.1 1 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 IP address
7 Huawei Confidential
Assigned to
Class B 10NNNNNN NNNNNNNN NNNNNNNN NNNNNNNN 128.0.0.0–191.255.255.255
hosts
Used for
Class D 1110NNNN NNNNNNNN NNNNNNNN NNNNNNNN 224.0.0.0–239.255.255.255 multicast
Used for
Class E 1111NNNN NNNNNNNN NNNNNNNN NNNNNNNN 240.0.0.0–255.255.255.255
research
8 Huawei Confidential
⚫ Private IP address
Some networks do not need to connect to the Internet, for example, a network in a closed lab of a university. However, the IP
addresses of network devices in the lab network still need to be unique to avoid conflicts. Some IP addresses of classes A, B, and
C are reserved for this kind of situation. These IP addresses are called private IP addresses.
◼ Class A: 10.0.0.0–10.255.255.255
192.168.1.0/24
◼ Class B: 172.16.0.0–172.31.255.255 10.0.0.0/8
◼ Class C: 192.168.0.0–192.168.255.255
Internet NAT
10.0.0.0/8 192.168.1.0/24
• Private IP addresses are used to resolve IP address shortage. They are used for
internal networks or hosts, and cannot be used for public networks.
• Note:
10 Huawei Confidential
• 255.255.255.255
▫ This address is called a limited broadcast address and can be used as the
destination IP address of an IP packet.
▫ After receiving an IP packet whose destination IP address is a limited
broadcast address, a router stops forwarding the IP packet.
• 0.0.0.0
▫ If this address is used as a network address, it refers to the network address
of any network. If this address is used as a host address, it refers to an
interface IP address of a host on the network.
▫ For example, when a host does not obtain an IP address during startup, it
can send a DHCP Request packet with the source IP address being 0.0.0.0
and the destination IP address being a limited broadcast address to the
network. The DHCP server will assign an available IP address to the host
after receiving the DHCP Request packet.
• 127.0.0.0/8
▫ This address is a loopback address that can be used as the destination IP
address of an IP packet. It is used to test the software system of the device.
▫ An IP packets whose destination IP address is a loopback address cannot
leave the device which sends the packet.
• 169.254.0.0/16
▫ If a network device is configured to automatically obtain an IP address but
does not find an available DHCP server on the network, the device uses an
IP address on the 169.254.0.0/16 network segment for temporary
communication.
• Note: DHCP is used to dynamically allocate network configuration parameters,
such as IP addresses.
Subnet Mask and Available Host Address
⚫ Generally, the network range defined by a network ID is called a network segment.
⚫ Subnet mask: Used to calculate the network ID (network address) and host ID (host address) in an IP address.
Example: 192.168.10.0/24
11 Huawei Confidential
• Broadcast address
• Available address
IP address 1 0 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1
12 Huawei Confidential
• Network address: Change all host bits of an IP address to 0, and the result is the
network address of the network to which the IP address belongs.
• Broadcast address: Change all host bits of an IP address to 1, and the result is the
broadcast address of the network to which the IP address belongs.
13 Huawei Confidential
1. IP Address Basics
3. Switching Basics
4. Routing Basics
14 Huawei Confidential
Concept of Network Communication
⚫ Communication refers to the information transfer and exchange between people, between people and things, and
between things through a certain medium and action.
⚫ Network communication refers to communication between terminal devices through a computer network.
⚫ Examples of network communication:
Data
Router
...
Data
B. Files are transferred among multiple computers
(terminals) through a router.
15 Huawei Confidential
• The Internet is the largest computer network in the world. Its predecessor,
Advanced Research Projects Agency Network (ARPANET), was born in 1969. The
wide popularization and application of Internet is one of the signs of entering the
information age.
Information Transfer Process
⚫ Virtual information transfer is similar to real object transfer.
Packet Packet
Data Data Data Data
16 Huawei Confidential
▫ The packet is transmitted through the Internet and reaches the local
network where the destination address resides. The gateway or router of
the local network decapsulates and encapsulates the packet, and then
determines the next-hop router according to the destination address. Finally,
the packet reaches the gateway of the network where the destination
computer resides.
• The distribution center sorts the packages according to the destination addresses
on the packages. The courier delivers the packages to the receiver. The receiver
unpacks the package, confirms that the items are intact, and signs for the
package. The entire express delivery process is complete.
▫ After the packet reaches the gateway of the network where the destination
computer resides, the gateway decapsulates and encapsulates the packet,
and then sends the packet to the corresponding computer according to the
destination address. After receiving the packet, the computer verifies the
packet. If the packet passes verification, the computer accepts the packet
and sends the data payload to the corresponding application program for
processing. A complete network communication process is complete.
What Is a Gateway?
PC1 PC2
18 Huawei Confidential
• Just like you must walk through a door when entering a room, information sent
from one network or network segment to another must pass through a gateway.
We can say the gateway is the door to another network.
• Functions of a gateway — A gateway plays significant roles in not only its role
but also its configuration:
▫ After the gateway is configured, the default route is generated on the host,
with the next hop being the gateway.
Basic Architecture of a Communication Network
Internet
Log system
A communication network Controller
NMS
consists of routers, switches, Application
server
firewalls, PCs, network printers,
servers, and more.
⚫ Function
The basic function of a
communication network is to
implement data communication. ...
... ...
Office area 1 Office area 2 Office area 3
19 Huawei Confidential
• Take the enterprise data center network (DCN) as an example. The major
requirements of an enterprise for the DCN include service operation and
computing, data storage, and service access.
• The DCN thereby needs to enable device-device and device-user interconnection
and provide external access capabilities for services. Devices on such a network
collaborate with each other to implement communication:
▫ Routers forward traffic between different office areas and between internal
and external networks.
▫ Firewalls implement access control for areas of different security levels and
between internal and external networks to ensure secure access.
Network Device - Switch
⚫ As the device closest to end users, a switch connects end users to a network and forwards
data frames. A switch can:
Connect terminals (such as PCs and servers) to the network.
Isolate collision domains.
Broadcast unknown packets.
Switch
Learn MAC addresses and maintain the MAC address table.
Forward packets based on the MAC address table.
Broadcast domain
20 Huawei Confidential
• Switch:
▫ Collision domain: an area where a collision occurs when two devices on the
same network send packets at the same time.
▫ MAC address table: exists on each switch and stores the mappings between
MAC addresses and switch interfaces.
Network Device - Router
⚫ Working at the network layer, a router forwards data packets on the Internet. Based on the destination
address in a received packet, a router selects a path to send the packet to the next router or
destination. The last router on the path is responsible for sending the packet to the destination host. A
router can:
Implement communication between networks of the
21 Huawei Confidential
• Router:
▫ A router can maintain the routing table and routing entries, discover routes,
select paths, forward data, isolate broadcast domains, implement WAN
access, translate network addresses, and provide specific security functions.
Discussion
⚫ What are the differences between a Layer 2 switch and a router that are both
used for network connection?
⚫ What are their application scenarios?
22 Huawei Confidential
Network Device - Firewall
⚫ As a network security device, a firewall is used to ensure secure communication between two
networks. It monitors, restricts, and modifies data flows passing through it to shield the information,
structure, and running status of internal networks from the public network. A firewall can:
Isolate networks of different security levels. Untrust zone
23 Huawei Confidential
• Firewall:
1. IP Address Basics
3. Switching Basics
4. Routing Basics
24 Huawei Confidential
OSI Reference Model
⚫ To achieve compatibility between networks and help vendors produce compatible network devices, the
International Organization for Standardization (ISO) launched the Open Systems Interconnection (OSI)
reference model in 1984. It was quickly adopted as the basic model for computer network
communication.
7. Application layer Provides interfaces for applications.
Converts data formats to ensure the application layer of one system can identify and understand
6. Presentation layer
the data generated by the application layer of another system.
5. Session layer Establishes, manages, and terminates sessions between two parties.
Establishes, maintains, and cancels one-time end-to-end data transmission processes, controls
4. Transport layer
transmission speeds, and adjusts data sequencing.
3. Network layer Defines logical addresses and transfers data from sources to destinations.
Encapsulates packets into frames, transmits frames in P2P or P2MP mode, and implements error
2. Data link layer
checking.
1. Physical layer Transmits bit streams over transmission media and defines electrical and physical specifications.
25 Huawei Confidential
• The Open Systems Interconnection (OSI) model was included in the ISO 7489
standard and released in 1984. ISO stands for International Organization for
Standardization.
• The OSI reference model is also called the seven-layer model. The seven layers
from bottom to top are as follows:
▫ Physical layer: transmits bit streams between devices and defines physical
specifications such as electrical levels, speeds, and cable pins.
▫ Data link layer: encapsulates bits into octets and octets into frames, uses
link layer addresses (MAC addresses in Ethernet) to access media, and
implements error checking.
▫ Network layer: defines logical addresses for routers to determine paths and
transmits data from source networks to destination networks.
▫ Transport layer: implements connection-oriented and non-connection-
oriented data transmission, as well as error checking before retransmission.
▫ Session layer: establishes, manages, and terminates sessions between
entities at the presentation layer. Communication at this layer is
implemented through service requests and responses transmitted between
applications on different devices.
▫ Presentation layer: provides data encoding and conversion functions so that
data sent by the application layer of one system can be identified by the
application layer of another system.
▫ Application layer: provides network services for applications and is closest to
users.
TCP/IP Reference Model
⚫ The TCP/IP reference model has become the mainstream reference model of the Internet
because the TCP and IP protocols are widely used and the OSI model is too complex.
Application layer
Session layer
26 Huawei Confidential
0 1 1 0 0 1 0 1 0 1 ... Transmission
Transmission medium
medium
28 Huawei Confidential
• Assume that you are using a web browser to access Huawei's official website.
After you enter the website address and press Enter, the following events occur
on your computer:
▫ Internet Explorer (application) invokes HTTP (application-layer protocol) to
encapsulate the application-layer data. (Data in the figure should also
include the HTTP header, which is not shown here.)
▫ HTTP uses TCP to ensure reliable data transmission and thereby transmits
the encapsulated data to the TCP module.
▫ The TCP module adds the corresponding TCP header information (such as
the source and destination port numbers) to the data transmitted from the
application layer. The protocol data unit (PDU) is called a segment.
▫ On an IPv4 network, the TCP module sends the encapsulated segment to
the IPv4 module at the network layer. (On an IPv6 network, the segment is
sent to the IPv6 module for processing.)
▫ After receiving the segment from the TCP module, the IPv4 module
encapsulates the IPv4 header. Here, the PDU is called a packet.
▫ Ethernet is used as the data link layer protocol. Therefore, after the IPv4
module completes encapsulation, it sends the packet to the Ethernet
module (such as the Ethernet adapter) at the data link layer for processing.
▫ After receiving the packet from the IPv4 module, the Ethernet module adds
the corresponding Ethernet header and FCS frame trailer to the packet.
Now, the PDU is called a frame.
▫ After the Ethernet module completes encapsulation, it sends the data to the
physical layer.
▫ Based on the physical media, the physical layer converts digital signals into
electrical signals, optical signals, or electromagnetic (wireless) signals.
▫ The converted signals are then transmitted on the network.
Data Transmission on the Intermediate Network
⚫ Encapsulated data is transmitted on the network.
Data
Data
29 Huawei Confidential
• In most cases:
▫ Note: The details and principles of switching and routing will be described
in the following chapters.
Data Decapsulation on the Receiver
Web server
Application layer Data Data
Transmission 0 1 1 0 0 1 0 1 0 1 ...
medium
30 Huawei Confidential
• After being transmitted over the intermediate network, the data finally reaches
the destination server. Based on the information in different protocol headers,
the data is decapsulated layer by layer, processed, transmitted, and finally sent to
the application on the web server for processing.
Contents
1. IP Address Basics
3. Switching Basics
4. Routing Basics
31 Huawei Confidential
Common TCP/IP Protocols
⚫ The TCP/IP protocol stack defines a set of standard protocols.
32 Huawei Confidential
• Overview of protocols:
▫ Hypertext Transfer Protocol (HTTP): used to access various pages on web
servers.
▫ File Transfer Protocol (FTP): used to transfer data from one host to another.
34 Huawei Confidential
▫ MSS: limits the maximum length of a TCP packet sent to the receiver. When
a connection is established, both parties of the connection advertise their
MSSs to make full use of bandwidth resources.
▫ Checksum of the header and data: TCP maintains the checksum of the
header and data, implementing end-to-end check to verify whether the
data changes during transmission. If the checksum of a received segment is
incorrect, TCP discards the segment and does not acknowledge the receipt
of the segment. In this case, TCP starts the retransmission mechanism.
▫ Flow control: Each party of a TCP connection has a buffer with a fixed size.
The receiver allows the sender to send only the data that can be stored in
the receive buffer, which prevents buffer overflow caused by the high
transmission rate of the sender.
UDP
⚫ UDP provides connectionless services for applications. Before data transmission, no
⚫ UDP does not maintain connection states or sending and receiving states. Therefore, a server
can transmit the same message to multiple clients at the same time.
35 Huawei Confidential
TCP UDP
• Connection-oriented • Connectionless
• Reliable transmission with flow and • Unreliable transmission, with
congestion control packet reliability guaranteed by
• Header length: 20–60 bytes upper-layer applications
• Applies to applications that require • Short header length of 8 bytes
reliable transmission, such as file • Applies to real-time applications,
transfer such as video conferencing
36 Huawei Confidential
• TCP is reliable, but its reliability mechanism leads to low packet transmission
efficiency and high encapsulation overhead.
Server
37 Huawei Confidential
▫ A client cannot truly identify the server. As a result, attackers can use a
bogus server to launch attacks.
Server
38 Huawei Confidential
▫ Version negotiation
▫ Algorithm negotiation
▫ Key exchange
▫ User authentication
▫ Service request
39 Huawei Confidential
• SSH encrypts data before sending it, ensuring data transmission security. It
applies to scenarios where encrypted authentication is required.
• Telnet is still used in tests or scenarios where encryption is not required (such as
on a LAN).
Contents
1. IP Address Basics
3. Switching Basics
◼ Ethernet Switching Basics
VLAN Basics
VLAN Basic Configuration
4. Routing Basics
40 Huawei Confidential
Ethernet Protocol
⚫ Ethernet is the most common communication protocol standard used by existing local area
networks (LANs). It defines the cable types and signal processing methods that are used on
a LAN.
Switch B
Host A Host B
Host C Host D
Host C Host D
41 Huawei Confidential
• Early Ethernet:
• Switch networking:
▫ Working at the data link layer, switches are able to confine collisions to a
particular scope, thereby helping improve Ethernet performance. Switches
have replaced hubs as mainstream Ethernet devices. However, switches do
not restrict broadcast traffic on the Ethernet. This affects Ethernet
performance.
Layer 2 Ethernet Switch
⚫ Layer 2 Ethernet switches forward data
Internet Internet
through Ethernet interfaces. Specifically, a
switch performs addressing and forwards
data only based on the MAC address in the
Layer 2 header of an Ethernet data frame.
Layer 2 Ethernet
switch
42 Huawei Confidential
▫ A Layer 2 switch works at the second layer (data link layer) of the TCP/IP
model and forwards data packets based on MAC addresses.
• Layer 3 Ethernet switch:
• Note: The switches involved in this course refer to Layer 2 Ethernet switches.
MAC Address Table
⚫ Each switch has a MAC address table that stores the mappings between MAC addresses and
switch interfaces.
Host 1 Host 2
GE0/0/1 GE0/0/2
IP 1 Switch IP 2
MAC 1 MAC 2
MAC 2 GE0/0/2
... ...
43 Huawei Confidential
• A MAC address table records the mappings between MAC addresses learned by a
switch and switch interfaces. When forwarding a data frame, the switch looks up
the MAC address table based on the destination MAC address of the frame. If the
MAC address table contains an entry mapping the destination MAC address of
the frame, the frame is directly forwarded through the outbound interface in the
entry. If there is no match of the destination MAC address of the frame in the
MAC address table, the switch floods the frame to all interfaces except the
interface that receives the frame.
Working Principles of Switches
Host 1 Host 2
GE0/0/1 GE0/0/2
Switch
IP1: 192.168.1.1 IP2: 192.168.1.2
MAC1: 0050-5600-0001 MAC2: 0050-5600-0002
44 Huawei Confidential
• Layer 2 switches work at the data link layer and forward frames based on MAC
addresses. Different interfaces on a switch send and receive data independently,
and each interface belongs to a different collision domain. This effectively isolates
collision domains on the network.
• Layer 2 switches maintain the mappings between MAC addresses and interfaces
by learning the source MAC addresses of Ethernet frames in a table called a MAC
address table. Layer 2 switches look up the MAC address table to determine the
interface to which a frame is forwarded based on the destination MAC address of
the frame.
Three Frame Processing Behaviors of a Switch
⚫ A switch processes the frames entering an interface over a transmission medium in
three ways:
Switch
Flooding
Port 1 Port 2 Port 3 Port 4
Switch
Forwarding
Port 1 Port 2 Port 3 Port 4
Forwarding path
inside a switch
Switch Outgoing frame
Discarding Incoming frame
Port 1 Port 2 Port 3 Port 4
Data frame
45 Huawei Confidential
▫ Flooding: The switch forwards the frames received from an interface to all
other interfaces.
1. IP Address Basics
3. Switching Basics
Ethernet Switching Basics
◼ VLAN Basics
VLAN Basic Configuration
4. Routing Basics
46 Huawei Confidential
Why Do We Need VLANs?
⚫ Broadcast packets have a wide-ranging impact on a network. However, Ethernet has no
method for forwarding control.
A B C
User: Administrator:
I don't want to receive I want to stop B from
broadcast packets from C. accessing A.
47 Huawei Confidential
A B C
Group 2 Group 1
48 Huawei Confidential
Router
VLAN 1
VLAN 2
VLAN 3
49 Huawei Confidential
• Hosts within a VLAN can communicate with each other but cannot communicate
directly with hosts in other VLANs. This confines broadcast packets within a single
VLAN. Inter-VLAN communication is not allowed, which improves network
security. For example, if enterprises in the same building establish their own LANs,
the cost is high. If enterprises share the same LAN in the building, there may be
security risks. In this case, the VLAN technology can be adopted to enable
enterprises to share the same LAN while ensuring information security.
• The figure above shows a typical VLAN networking. Three switches are deployed
at different locations, for example, on different floors of a building. Each switch is
connected to three PCs that belong to different VLANs (for example, VLANs for
different enterprises).
VLAN Frame Format
6B 6B 2B 64–1500 B 4B
6B 6B 4B 2B 64–1500 B 4B
2B 2B
TPID TCI
50 Huawei Confidential
• Since VLAN tags are adopted, Ethernet frames are classified as untagged frames
(without 4-byte VLAN tags) or tagged frames (with 4-byte VLAN tags).
SW1
VLAN
Assignment VLAN 10 VLAN 20
Method
Interface-based GE0/0/1, GE0/0/3 GE0/0/2, GE0/0/4
MAC address–
MAC 1, MAC 3 MAC 2, MAC 4
based
IP subnet–based 10.0.1.* 10.0.2.*
51 Huawei Confidential
• PCs send only untagged frames. After receiving such an untagged frame, a switch
that supports the VLAN technology needs to assign the frame to a specific VLAN
based on certain rules.
• Available VLAN assignment methods are as follows:
▫ Interface-based assignment: assigns VLANs based on switch interfaces.
▪ A network administrator preconfigures a port VLAN ID (PVID) for
each switch interface. When an untagged frame arrives at an
interface of a switch, the switch tags the frame with the PVID of
the interface. The frame is then transmitted in the specified VLAN.
▫ MAC address–based assignment: assigns VLANs based on the source MAC
addresses of frames.
▪ A network administrator preconfigures the mapping between MAC
addresses and VLAN IDs. After receiving an untagged frame, a
switch tags the frame with the VLAN ID mapping the source MAC
address of the frame. The frame is then transmitted in the
specified VLAN.
▫ IP subnet–based assignment: assigns VLANs based on the source IP
addresses and subnet masks of frames.
▪ A network administrator preconfigures the mapping between IP
addresses and VLAN IDs. After receiving an untagged frame, a
switch tags the frame with the VLAN ID mapping the source IP
address of the frame. The frame is then transmitted in the
specified VLAN.
▫ Protocol-based assignment: assigns VLANs based on the protocol (suite)
types and encapsulation formats of frames.
10 • Principles
SW1 SW2
PVID 1 PVID 1 ▫ VLANs are assigned based on interfaces.
▫ A network administrator preconfigures a PVID for
PVID 10 PVID 10 PVID 20 PVID 20 each switch interface to assign each interface to the
VLAN corresponding to the PVID.
▫ After an interface receives an untagged frame, the
switch adds a tag carrying the PVID of the interface
to the frame. The frame is then transmitted in the
specified VLAN.
Host 1 Host 2 Host 3 Host 4
VLAN 10 VLAN 20 • PVID (Port VLAN ID)
▫ Default VLAN ID of an interface
The network administrator must
reconfigure VLANs when hosts move. ▫ Value range: 1–4094
53 Huawei Confidential
• Assignment rule:
• Characteristics:
• Access interface
An access interface is used to connect a switch to a terminal, such as a
PC or server. In general, the NICs on such terminals receive and send
only untagged frames. An access interface can be added to only one
VLAN.
• Trunk interface
A trunk interface is used to connect a switch to another switch or a
sub-interface on a device such as a router or firewall. This type of
interface allows frames that belong to multiple VLANs to pass
through and differentiates the frames using the 802.1Q tag.
• Hybrid interface
Similar to a trunk interface, a hybrid interface also allows frames that
VLAN 10 VLAN 20 VLAN 10 VLAN 20 belong to multiple VLANs to pass through and differentiates the
frames using the 802.1Q tag. You can determine whether to allow a
hybrid interface to send frames that belong to one or multiple VLANs
Access interface Trunk interface VLAN-tagged.
54 Huawei Confidential
• Access interface
• Trunk interface
• Hybrid interface
1. IP Address Basics
3. Switching Basics
Ethernet Switching Basics
VLAN Basics
◼ VLAN Basic Configuration
4. Routing Basics
55 Huawei Confidential
Basic VLAN Configuration Commands
⚫ Create VLANs.
Create a VLAN and enter the VLAN view, or enter the view of an existing VLAN.
The value of vlan-id is an integer that ranges from 1 to 4094.
56 Huawei Confidential
• The vlan command creates a VLAN and displays the VLAN view. If the VLAN to
be created exists, the VLAN view is displayed directly.
• The undo vlan command deletes a VLAN.
• By default, all interfaces belong to the default VLAN, that is, VLAN 1.
▫ Commands:
▫ vlan vlan-id
▪ vlan-id: specifies the VLAN ID. The value is an integer that ranges
from 1 to 4094.
▫ vlan batch { vlan-id1 [ to vlan-id2 ] }
▪ batch: creates VLANs in a batch.
▪ vlan-id1 to vlan-id2: specifies the IDs of VLANs to be created in a
batch.
− vlan-id1 specifies the start VLAN ID.
− vlan-id2 specifies the end VLAN ID. The value of vlan-id2
must be greater than or equal to that of vlan-id1. vlan-id1
and vlan-id2 identify a VLAN range.
▪ If to vlan-id2 is not specified, the VLAN specified by vlan-id1 is
created.
▪ The values of vlan-id1 and vlan-id2 are integers that range from 1
to 4094.
Basic Access Interface Configuration Commands
⚫ Set the interface type.
In the interface view, set the link type of the interface to access.
In the interface view, configure the default VLAN of the interface and add the interface to the VLAN.
vlan-id: specifies the default VLAN ID. The value is an integer that ranges from 1 to 4094.
57 Huawei Confidential
Basic Trunk Interface Configuration Commands
⚫ Set the interface type.
[Huawei-GigabitEthernet0/0/1] port link-type trunk
In the interface view, set the link type of the interface to trunk.
In the interface view, configure the default VLAN of the trunk interface.
58 Huawei Confidential
▪ to vlan-id2 specifies the end VLAN ID. The value of vlan-id2 must
be greater than or equal to that of vlan-id1.
▪ The values of vlan-id1 and vlan-id2 are integers that range from 1
to 4094.
▫ vlan-id: specifies the default VLAN ID of the trunk interface. The value is
an integer that ranges from 1 to 4094.
Basic Hybrid Interface Configuration Commands
⚫ Set the interface type.
[Huawei-GigabitEthernet0/0/1] port link-type hybrid
In the interface view, set the link type of the interface to hybrid.
⚫ Add the hybrid interface to specified VLANs.
[Huawei-GigabitEthernet0/0/1] port hybrid untagged vlan { { vlan-id1 [ to vlan-id2 ] } | all }
In the interface view, add the hybrid interface to specified VLANs. Frames that belong to these VLANs then
pass through the hybrid interface in untagged mode.
[Huawei-GigabitEthernet0/0/1] port hybrid tagged vlan { { vlan-id1 [ to vlan-id2 ] } | all }
In the interface view, add the hybrid interface to specified VLANs. Frames that belong to these VLANs then
pass through the hybrid interface in tagged mode.
⚫ (Optional) Configure the default VLAN of the hybrid interface.
[Huawei-GigabitEthernet0/0/1] port hybrid pvid vlan vlan-id
In the interface view, configure the default VLAN of the hybrid interface.
59 Huawei Confidential
GE0/0/1 GE0/0/2
GE0/0/2 GE0/0/1
PVID 10 PVID 20
PVID 20 PVID 10
60 Huawei Confidential
• Configuration roadmap:
▫ Create VLANs and add interfaces connecting users to the VLANs to isolate
Layer 2 traffic between users with different services.
SW1 SW2
GE0/0/3 GE0/0/3
PVID 1 PVID 1
[SW1] vlan 10
[SW1-vlan10] quit
[SW1] vlan 20
[SW1-vlan20] quit Host 1 Host 2 Host 3 Host 4
VLAN 10 VLAN 20 VLAN 10 VLAN 20
[SW2] vlan batch 10 20
Access interface
Trunk interface
61 Huawei Confidential
Configuring Access and Trunk Interfaces
Configure access interfaces and add the interfaces to
corresponding VLANs.
[SW1] interface GigabitEthernet 0/0/1
SW1 SW2
[SW1-GigabitEthernet0/0/1] port link-type access GE0/0/3 GE0/0/3
PVID 1 PVID 1
[SW1-GigabitEthernet0/0/1] port default vlan 10
GE0/0/1 GE0/0/2 GE0/0/1 GE0/0/2
[SW1] interface GigabitEthernet 0/0/2 PVID 10 PVID 20 PVID 10 PVID 20
[SW1-GigabitEthernet0/0/2] port link-type access
[SW1] vlan 20
[SW1-vlan20] port GigabitEthernet0/0/2
[SW1-vlan20] quit
62 Huawei Confidential
Verifying the Configuration
63 Huawei Confidential
▫ Type or VLAN Type: VLAN type. The value common indicates a common
VLAN.
1. IP Address Basics
3. Switching Basics
4. Routing Basics
◼ Basic Routing Principles
Static and Default Routes
64 Huawei Confidential
Routes
⚫ Routes are the path information that is used to guide packet forwarding.
⚫ A routing device is one that forwards packets to a destination network segment based on routes. The most
common routing device is a router.
⚫ A routing device maintains an IP routing table that stores routing information.
Router R4
Data R1 R2 R3
N M
Gateway Gateway
Destination-based forwarding
65 Huawei Confidential
66 Huawei Confidential
• The destination address and mask identify the destination address of an IP packet.
After an IP packet matches a specific route, the router determines the forwarding
path according to the outbound interface and next hop of the route.
• The next-hop device for forwarding the IP packet cannot be determined based
only on the outbound interface. Therefore, the next-hop device address must be
specified.
Routing Table
• A router discovers routes using Destination/ Outbound
Next Hop
multiple methods. Mask Interface
14.0.0.0/8
11.0.0.0/8 2.2.2.2 GE0/0
• A router selects the optimal route and R4
13.0.0.0/8 3.3.3.2 GE0/1
installs it in its IP routing table. 1.1.1.2/30
14.0.0.0/8 1.1.1.2 GE0/2
• A router forwards IP packets based on ...
GE0/2
routes in the IP routing table. 1.1.1.1/30 1.1.1.0/30 1.1.1.1 GE0/2
2.2.2.2/30 3.3.3.2/30
R1 R3
11.0.0.0/8 13.0.0.0/8
67 Huawei Confidential
68 Huawei Confidential
• Cost: indicates the cost of the route. When multiple routes to the same
destination have the same preference, the route with the lowest cost is selected
as the optimal route.
• NextHop: indicates the local router's next-hop address of the route to the
destination network. This field specifies the next-hop device to which packets are
forwarded.
• Interface: indicates the outbound interface of the route. This field specifies the
local interface through which the local router forwards packets.
Route-based Forwarding Process
Destination/Mask Next Hop Outbound Interface
20.0.1.0/24 20.0.1.2 GE0/0
Destination
IP address: 30.0.1.0/24 30.0.1.1 GE0/1
40.0.1.2 10.0.1.0/24 20.0.1.1 GE0/0
40.0.1.0/24 30.0.1.2 GE0/1
69 Huawei Confidential
• The IP packets from 10.0.1.0/24 need to reach 40.0.1.0/24. These packets arrive at
the gateway R1, which then searches its IP routing table for the next hop and
outbound interface and forwards the packets to R2. After the packets reach R2,
R2 forwards the packets to R3 by searching its IP routing table. After receiving
the packets, R3 searches its IP routing table, finding that the destination IP
address of the packets belongs to the network segment where a local interface
resides. Therefore, R3 directly forwards the packets to the destination network
segment 40.0.1.0/24.
Contents
1. IP Address Basics
3. Switching Basics
4. Routing Basics
Basic Routing Principles
◼ Static and Default Routes
70 Huawei Confidential
Introduction to Static Routes
• Static routes are manually configured by network Static route
administrators, have low system requirements, and
apply to simple, stable, and small networks.
71 Huawei Confidential
Configuration Example
GE0/0/0 S1/0/0
10.0.0.2/24 20.1.1.3/24
Configure RTA.
GE0/0/0 S1/0/0
RTA 10.0.0.1/24 RTB 20.1.1.2/24 RTC [RTA] ip route-static 20.1.1.0 255.255.255.0 10.0.0.2
⚫ Configure static routes on RTA and RTC for communication between 10.0.0.0/24 and 20.1.1.0/24.
⚫ Packets are forwarded hop by hop. Therefore, all the routers along the path from the source to the
destination must have routes destined for the destination.
⚫ Data communication is bidirectional. Therefore, both forward and return routes must be available.
72 Huawei Confidential
Default Route
• Default routes are used only when packets to be forwarded do not match any routing entry in an IP
routing table.
• In an IP routing table, a default route is the route to network 0.0.0.0 (with the mask 0.0.0.0), namely,
0.0.0.0/0.
RTA needs to forward packets to a network
segment that is not directly connected to it
and forwards the packets to 10.0.0.2.
192.168.1.0/24
RTA RTB 192.168.2.0/24
GE0/0/0 GE0/0/0
10.0.0.0/24 192.168.3.0/24
10.0.0.1 .
10.0.0.2 .
192.168.254.0/24
73 Huawei Confidential
Application Scenarios of Default Routes
⚫ Default routes are typically used at the egress of an enterprise network. For example, you
can configure a default route on an egress device so that the device forwards IP packets
destined for any address on the Internet.
Enterprise network
RTA
1.2.3.0/24 Internet
GE0/0/1 GE0/0/0 1.2.3.254
PC 192.168.1.254 1.2.3.4
192.168.1.100
Gateway: 192.168.1.254
74 Huawei Confidential
Quiz
75 Huawei Confidential
• Answers:
▫ ABCD
▫ A
Summary
76 Huawei Confidential
Recommendations
⚫ Huawei Learning
https://e.huawei.com/en/talent/portal/#/
⚫ Huawei Support Knowledge Base
https://support.huawei.com/enterprise/en/knowledge?lang=en
77 Huawei Confidential
Thank you. 把数字世界带入每个人、每个家庭、
每个组织,构建万物互联的智能世界。
Bring digital to every person, home, and
organization for a fully connected,
intelligent world.
2 Huawei Confidential
Objectives
3 Huawei Confidential
Contents
2. Linux Basics
4 Huawei Confidential
Operating System Definition and Functions
⚫ An operating system (OS) is a computer program (system software) that
manages and controls computer hardware and software resources.
5 Huawei Confidential
• Mainstream OSs:
▫ From the perspective of application field, OSs are classified into the
following types:
2. Linux Basics
6 Huawei Confidential
Components of an Operating System
⚫ From the perspective of users, an OS consists of a kernel and various applications, that is, the kernel space and user space.
⚫ The kernel is essentially a software program used to manage computer hardware resources and provide a system call interface to
run upper-layer application programs.
Applications
and shells
Function
libraries
System Calls
Kernel
7 Huawei Confidential
• Shell: A shell is a special application program, which is also called the command
line interface. It is a command interpreter in essence. It can execute texts (scripts)
that comply with the shell syntax. Some shell script statements encapsulate
system calls for convenient use.
• The kernel controls hardware resources, manages OS resources, and provides a
system call interface for applications.
▫ Process scheduling and management: The kernel creates and destroys
processes and handles their input and output.
▫ Memory management: The kernel creates a virtual address space for all
processes based on limited available resources.
▫ File system management: Linux is based on the concept of file system to a
large extent. Almost anything in Linux can be seen as a file. The kernel
builds a structured file system on top of unstructured hardware.
▫ Device driver management: Drivers of all peripherals in the system, such as
hard drives, keyboards, and tape drives, are embedded in the kernel.
▫ Network resource management: All routing and address resolution
operations are performed in the kernel.
• Summary: User-mode applications can access kernel-mode resources using the
following:
▫ System calls
▫ Shell scripts
▫ Library functions
Contents
2. Linux Basics
9 Huawei Confidential
Common Server OSs
A multi-user and multi-process OS. It supports large-scale file Common Unix OSs:
HP-UX, IBM AIX, Solaris,
UNIX system services and data service applications, provides powerful and A/UX.
functions, and ensures high stability and security.
Linux is a general term for Unix-like OSs. Linux runs with high Common Linux OSs:
GNU/ SUSE Linux, Kylin, Red Flag
Linux security and stability and has a complete permission control Linux, CentOS, RHEL, and
openEuler.
mechanism.
10 Huawei Confidential
▫ The Linux kernel was initially written by Linus Torvalds for a hobby when
he was studying at the University of Helsinki. Frustrated by MINIX, a Unix-
like OS for educational purposes, he decided to develop his own OS. The
first version was released in September 1991 with only 10,000 lines of code.
▫ Unix systems are usually compatible only with specific hardware. This
means that most Unix systems such as AIX and HP-UX cannot be installed
on x86 servers or PCs. On the contrary, Linux can run on various hardware
platforms.
▫ Unix is commercial software, while Linux is open source and free of charge.
▫ GNU is a recursive acronym for "GNU's Not Unix". Linux provides a kernel,
and GNU provides a large amount of free software to enrich the various
applications run on the kernel.
Contents
2. Linux Basics
◼ Introduction to Linux
Introduction to openEuler
Introduction to File Systems on openEuler
Basic openEuler Operations
11 Huawei Confidential
Features of Linux
⚫ Multi-platform design
Linux can run on multiple hardware platforms. The Linux kernel is also used in embedded systems
that run on devices such as handheld computers and set-top boxes.
⚫ Multi-user and multitasking
System resources can be used by different users. Multiple programs can run simultaneously and
independently.
⚫ Free to use
The source code of Linux is available for free. Users can edit and modify the source code as required.
⚫ Fully compatible with the POSIX.1 standard
⚫ Inherits the design concept of Unix
Everything is a file.
12 Huawei Confidential
13 Huawei Confidential
• The core philosophy of Linux is "everything is a file", which means that all files,
including directories, character devices, block devices, sockets, printers, processes,
threads, and pipes, can be operated, read, and written by using functions such as
fopen(), fclose(), fwrite(), and fread().
• After logging in to the system, enter the ls / command in the current command
window. The command output similar to the figure is displayed. The directories
are described as follows:
▫ /bin: short for binary. This directory stores the frequently used commands.
▫ /boot: stores some core files used for booting the Linux OS, including some
links and images.
▫ /dev: short for device. This directory stores peripheral device files of Linux.
The method of accessing devices on Linux is the same as that of accessing
files.
▫ /etc: stores all configuration files and subdirectories required for system
management.
▫ /lib: stores basic shared libraries of the system. A library functions similarly
to a dynamic link library (DLL) file on Windows. Almost all applications
need to use these shared libraries.
▫ /mnt: temporary mount point for other file systems. You can mount the
CD-ROM drive to /mnt and then go to this directory to view the contents in
the CD-ROM.
▫ /opt: stores additional software installed on the host. For example, if you
install an Oracle database, you can save the installation package to this
directory. By default, this directory is empty.
Contents
2. Linux Basics
Introduction to Linux
◼ Introduction to openEuler
Introduction to File Systems on openEuler
Basic openEuler Operations
14 Huawei Confidential
Background of openEuler
⚫ EulerOS is a server OS that runs on the Linux kernel and supports processors of multiple
architectures, such as x86 and ARM. It is ideal for database, big data, cloud computing, and
artificial intelligence (AI) scenarios.
⚫ Over the past decade, EulerOS has interconnected with various Huawei products and
solutions. It is respected for its security, stability, and efficiency.
⚫ Cloud computing, in addition to Kunpeng processors, has sparked the growth of EulerOS to
become the most powerful software infrastructure in the Kunpeng ecosystem.
⚫ To develop the Kunpeng ecosystem and build prosperity of the computing industry in China
and around the world, the open source version of EulerOS was officially released as
openEuler at the end of 2019.
15 Huawei Confidential
Introduction to openEuler
⚫ openEuler is a free open source Linux distribution that supports multiple processor
architectures including x86, ARM, and RISC-V.
⚫ All developers, enterprises, and business organizations can simply use the openEuler
community version, or use it to build, develop, and release their own OS versions.
https://openeuler.org/
https://gitee.com/openeuler
16 Huawei Confidential
Relationship Between openEuler and Mainstream OSs
Linux
Kernel
Community edition
Fedora • The upstream community
Red Hat Commercial edition Free edition of openEuler, SUSE,
RHEL CentOS Debian, and Red Hat is
the kernel community
www.kernel.org.
Debian Ubuntu • The openEuler
community releases free
long-term support (LTS)
Commercial edition versions, enabling
SLES
SUSE operating system vendors
Free edition
openSUSE (OSVs) such as Kylinsoft,
iSoft, Sinosoft, and
Kylin V10 GreatDB to develop
Community edition
openEuler openEuler Commercial
iSoft V5.1 commercial releases.
releases
EulixOS 1.0
17 Huawei Confidential
Contents
2. Linux Basics
Introduction to Linux
Introduction to openEuler
◼ Introduction to File Systems on openEuler
Basic openEuler Operations
18 Huawei Confidential
File System Overview
⚫ A file system is a method and a data structure used by an OS to identify files on a storage
device or a partition, that is, a method of organizing files on a storage device.
⚫ In an OS, a software structure that manages and stores file data is referred to as a file
management system, or file system for short.
Underlying storage
hardware, such as drives and Objects and properties
partitions
19 Huawei Confidential
• Function: The file system organizes and allocates the space on file storage
devices, stores files, and protects and retrieves the stored files. Specifically, it is
responsible for creating files for users, saving, reading, modifying, and dumping
files, controlling access to files, and canceling a file that is no longer in use.
Functions of a file system include: manages and schedules storage space of a file,
and provides the logical structure, physical structure, and storage method of the
file; maps file identifiers to actual addresses, controls and accesses files, shares
file information, provides reliable file confidentiality and protection measures,
and provides file security measures.
File Systems on openEuler
⚫ The openEuler kernel is derived from Linux. The Linux kernel supports more than 10 types of
file systems, such as Btrfs, JFS, ReiserFS, ext, ext2, ext3, ext4, ISO 9660, XFS, Minix, MSDOS,
UMSDOS, VFAT, NTFS, HPFS, SMB, SysV and PROC. The following table describes the
common file systems.
⚫ The default file system on openEuler is ext4.
Common File System Description
Ext File system specially designed for Linux. The latest version is ext4.
A high-performance log file system developed for the IRIX OS by Silicon Graphics
XFS in 1993. Later ported to the Linux kernel, it excels in large-file processing and
provides smooth data transfer.
On Linux, VFAT is the name of the FAT (including FAT16 and FAT32) file systems
VFAT
in DOS and Windows.
The standard file system for optical disc media. Linux supports this file system,
ISO 9600
allowing the system to read CD-ROMs and ISO image files, and burn CD-ROMs.
20 Huawei Confidential
Contents
2. Linux Basics
Introduction to Linux
Introduction to openEuler
Introduction to File Systems on openEuler
◼ Basic openEuler Operations
21 Huawei Confidential
Contents
22 Huawei Confidential
Linux GUI and CLI
⚫ A graphical user interface (GUI) presents all elements as graphical. The mouse is used as the
main input tool, and buttons, menus, and dialog boxes are used for interaction, focusing on
ease of use.
⚫ All elements on a command line interface (CLI) are character-based. The keyboard is used as
the input tool to enter commands, options, and parameters for executing programs,
achieving high efficiency.
23 Huawei Confidential
• Example:
▫ Start the calculator on the Windows GUI. Choose Start > Programs >
Windows Accessories > Calculator. In the calculator, click buttons to enter
an expression. Similarly, a small keyboard is displayed when a certain
program requires you to enter a password, asking you to click the numbers.
This method is very user-friendly, and the calculator looks similar to the
input device used at bank ATMs all around the world. The difference here is
that you click it using a mouse, rather than using your own hands.
▫ In the Linux CLI, enter bc to start the calculator. Enter the calculation 1 + 1
and press Enter. Result 2 is obtained.
Why We Use CLIs
⚫ Higher efficiency
On Linux, it is faster to perform operations on a keyboard than using the mouse.
A GUI-based operation cannot be repeated, while a CLI script can be used to complete all required
tasks, for example, deleting outdated log files.
24 Huawei Confidential
Linux CLI Shortcuts
⚫ Tab completion
Use the Tab key to complete a command or file name, which is time-saving and accurate.
When no command is entered, press Tab twice to list all available commands.
If you have entered a part of the command name or file name, press Tab to complete it
automatically.
⚫ Cursor control
↑: Press ↑ several times to display historical commands for quick execution.
↓: Press ↓ together with ↑ for choosing a historical command.
Home: Press Home to move the cursor to the beginning of the line.
Ctrl+A: Press Ctrl+A to move the cursor to the beginning of the line.
Ctrl+E: Press Ctrl+E to move the cursor to the end of the line.
Ctrl+L: Press Ctrl+L to clear the screen.
25 Huawei Confidential
Login to Linux
⚫ You can log in to Linux in either of the following ways:
Local login
Remote Login
◼ Using clients such as PuTTY and Xshell to remotely log in to openEuler.
26 Huawei Confidential
• After you log in to the system as the root user, # is displayed in the command
prompt.
Changing the Password
⚫ Passwords are used to ensure the security of system and data.
⚫ To ensure system security, you should:
Change the password upon the first login.
Change passwords periodically.
Set a complex password, for example, a password containing more than eight characters and at least three
types of the following characters: uppercase letters, lowercase letters, digits, and special characters.
⚫ You can run the passwd command to change the password.
27 Huawei Confidential
• For security purposes, openEuler does not display the password when you enter it
and does not use any placeholders to indicate the number of characters.
Types of Linux Users
⚫ On Linux, a UID is used to uniquely identify a user.
⚫ Based on different UIDs, there are three types of users in Linux (openEuler is used as an
example):
Super user
◼ The super user is also called the super administrator. Its UID is 0. The super user has all system permissions.
It is similar to the administrator in Windows.
System user
◼ System users, also called program users, have UIDs ranging from 1 to 999. A system user is created by a
program and is used to run the program or service.
Common user
◼ Common users are generally created by the super administrator (the root user) to perform limited
management and maintenance operations on the system. UIDs of common users range from 1000 to 60000.
28 Huawei Confidential
Creating and Deleting a Linux User
⚫ Creating a user (common user by default): useradd username
⚫ Viewing user information: id username
⚫ Switching users: su - username
⚫ Deleting a user: userdel username
29 Huawei Confidential
Contents
30 Huawei Confidential
Power Supply Commands: shutdown and reboot
⚫ shutdown is used to shut down the computer, which requires root permissions.
Main options:
◼ -h: powers off the computer after it is shut down.
◼ -r: powers on the computer after it is shut down. (This operation is equivalent to restarting the computer.)
◼ -p: explicitly indicates that the system will be shut down and the main power supply will be cut off.
⚫ reboot is used to restart the computer, which requires system administrator permissions.
Main options:
◼ -w: writes records to the /var/log/wtmp file. It does not restart the system.
◼ -d: does not write records to the /var/log/wtmp file.
◼ -i: restarts the system with network settings disabled.
31 Huawei Confidential
• The shutdown command can safely shut down the system. It is dangerous to
shut down the Linux system by directly powering off the system.
• Different from Windows, Linux runs many processes in the background. Therefore,
forcible shutdown may cause loss of process data, making the system unstable
and even damaging hardware in some systems.
• If you run the shutdown command to shut down the system, the system notifies
all users who have logged in that the system will be shut down and the login
command will be frozen, prohibiting new user logins.
File Paths
⚫ Absolute path: a path starting from the root directory (/), for example, /root/Desktop.
⚫ Relative path: a path starting from the current path, for example, ./Desktop.
⚫ ./ or . indicates the current path. ../ or .. indicates the upper-level directory of the current path.
⚫ pwd: Viewing the current path.
⚫ cd: Switching paths.
32 Huawei Confidential
• Syntax: cd [directory]
▫ cd ..: goes to the upper-level directory. Double dot indicates the upper-level
directory.
33 Huawei Confidential
• The cat command is used to view contents of a small file. This command displays
all lines in a file.
• The tail command is used to view the last 10 lines of a file by default.
▫ -n: followed by a number, for example, 5, indicating that the last five lines
of a file are viewed. You can also enter a number directly without the -n
option.
▫ -f: dynamically displays file changes. This option is commonly used for
viewing log files.
• The head command is used to view the first 10 lines of a file by default.
• The less and more commands are used to view large files page by page. Enter q
to exit. Enter a slash (/) and a keyword to search for the keyword in the file.
Creating Files
⚫ mkdir: Creating directories (folders)
-p: cascades to create multiple directories recursively.
[root@localhost ~]# mkdir my_dir_01 # Create a my_dir_01 directory.
[root@localhost ~]# ls
anaconda-ks.cfg my_dir_01
[root@localhost ~]# mkdir -p my_dir_02/sub_dir # Create a my_dir_02 directory and its subdirectory sub_dir.
[root@localhost ~]# touch test01.log test02.log # Create files test01.log and test02.log.
[root@localhost ~]# ls -lt
total 0
-rw-------. 1 root root 0 Jul 29 15:06 test01.log
-rw-------. 1 root root 0 Jul 29 15:06 test02.log
34 Huawei Confidential
Copying Files
⚫ cp: Copying files or directories
-a: copies the files of a directory while retaining the links and file attributes.
-r: If the source file is a directory, all subdirectories and files in the directories are copied recursively
and the attributes are retained.
[root@localhost ~]# ls
test01.log test02.log
[root@localhost ~]# cp /etc/passwd passwd.back # Copy the /etc/passwd file to the current directory and rename the
file to passwd.back.
[root@localhost ~]# cp -r /var/log/audit ./ # Copy the audit directory and all files in it to the current directory.
[root@localhost ~]# ls
audit passwd.back test01.log test02.log
[root@localhost ~]# cp -s /etc/passwd passwd_link # Create a symbolic link passwd_link of the passwd file.
[root@localhost ~]# ls
audit passwd.back passwd_link test01.log test02.log
[root@localhost ~]# ls -l
total 8
drwx------. 2 root root 4096 Jul 29 15:24 audit
-rw-------. 1 root root 2546 Jul 29 15:24 passwd.back
lrwxrwxrwx. 1 root root 11 Jul 29 15:25 passwd_link -> /etc/passwd
-rw-------. 1 root root 0 Jan 2 19:20 test01.log
-rw-------. 1 root root 0 Jul 29 19:20 test02.log
[root@localhost ~]#
35 Huawei Confidential
• The cp command is used to copy files and directories. You can copy one or more
files at a time. Exercise caution when running this command because data loss
risks are involved.
• Syntax: cp [OPTION]... SOURCE... DIRECTORY
▫ -a: copies the files of a directory while retaining the links and file attributes.
▫ -p: copies the file content, modification time, and access permissions to the
new file.
▫ -r: if the source file is a directory, all subdirectories and files in the
directories are copied recursively.
▫ -l: creates a hard link of the source file instead of copying it.
▫ -s: creates a soft link of the source file instead of copying it.
• cp f1 f2: copies file f1 and renames it to f2.
• cp f1 d1/: copies f1 to the d1 directory without renaming it.
• cp f1 f2 f3 d1/: copies multiple files to a directory.
• cp -i f1 f2: waits for the user's confirmation before overwriting f2 if f2 already
exists.
• cp -r d1 d2: copies a directory recursively if the -r option is added.
• cp -a f1 f2: if the -a option is added, the attributes of the source file are retained.
This option is used to copy block devices, character devices, and named pipes.
• By default, the cp command does not ask the user before overwriting files.
Therefore, many shells have made cp as an alias for cp -i. The -f option in the cp
command does not indicate forcible overwriting.
Moving and Renaming Files
⚫ mv: Moving or renaming a file
The mv command is used to move a file or directory. Exercise caution when running this command
because data loss risks are involved.
If the source file and target file are in the same directory, the mv command is used to rename the
file.
[root@localhost ~]# ls
passwd_link test01.log test02.log
[root@localhost ~]# mv test02.log test03.log #Change the name of the test02.log file to test03.log
[root@localhost ~]# ls
passwd_link test01.log test03.log
[root@localhost ~]# mv test01.log /root/test # Move the test01.log file to the /root/test directory.
[root@localhost ~]# mv –f test01.log test03.log # Forcibly overwrite the test03.log file with the content of
the test01.log file.
36 Huawei Confidential
• If the source file and target file are in the same directory, the mv command
renames the file.
▫ -f: forcibly overwrites the target file without asking the user.
▫ -i: overwrites the target file after obtaining the user's consent.
▫ -u: updates the target file only when the source file is newer than the
target.
Deleting Files
⚫ rm: Deleting files or directories
The rm command is a high-risk command. No tool can guarantee recovery of files deleted by the
rm command, which does not move a file to a recycle bin like in GUIs. Therefore, you cannot undo
the deletion.
[root@localhost ~]# ls
audit_back passwd.back test01.log test03.log
[root@localhost ~]# rm test01.log # Delete the test01.log file with a prompt
before deletion.
rm: remove regular empty file 'test01.log'? yes
[root@localhost ~]# rm -rf test03.log # Forcibly delete the test03.log file.
[root@localhost ~]# rm -rf audit_back/ # Delete the mail.bak directory, including all
files and subdirectories in it.
[root@localhost ~]# ls
passwd.back
[root@localhost ~]#
37 Huawei Confidential
Obtaining Help Information About a Command
⚫ help: Obtaining simple help information about a command.
To navigate the massive number of commands on Linux, you can run the help command to obtain
help information.
Exit Status:
Returns 0 unless an invalid option is given or the current directory cannot be read.
[root@localhost ~]# systemctl --help
systemctl [OPTIONS...] {COMMAND} ...
38 Huawei Confidential
Contents
39 Huawei Confidential
Linux Text Editor - Vim
⚫ Vim is a customizable text editor derived from Visual Editor (vi) that inherits, improves and
adds many features to vi's original base.
⚫ Common Vim modes:
Normal mode: used to copy, paste, and delete text, undo previous operations, and navigate the cursor.
Insert mode: used to edit and modify text.
Command line mode: used to save, exit, search for, or replace text. Enter a colon (:) to switch to this mode.
Normal mode
Esc Esc
: or / a, i, o, or s
40 Huawei Confidential
• Vim is not installed on openEuler 20.03 LTS by default. You need to manually
install it.
Normal Mode of Vim
⚫ By default, Vim begins to run in normal mode after you open a file with the vim command.
vim [options] [file]... Edit specified files.
vim [options] - Read text from standard input (stdin).
vim [options] -t tag Edit the file where the tag is defined.
vim [options] -q [errorfile] Edit the file where the first error occurs.
⚫ Common options:
-c: runs a specified command before opening a file.
-R: opens a file in read-only mode but allows you to forcibly save the file.
-M: opens a file in read-only mode and does not allow you to forcibly save the file.
-r: recovers a crashed session.
+num: starts at line num.
41 Huawei Confidential
Common Operations in Vim Normal Mode
⚫ Cursor control
Arrow keys or k, j, h, and l keys move the cursor up, down, left, and right, respectively.
0: moves the cursor to the beginning of the current line.
g0: moves the cursor to the leftmost character of the current line that is on the screen.
:n: moves the cursor to line n.
gg: moves the cursor to the first line of the file.
G: moves the cursor to the last line of the file.
⚫ Data operations
yy or Y: copies an entire line of text.
y[n]w: copies 1 or n words.
d[n]w: deletes (cuts) 1 or n words.
[n] dd: deletes (cuts) 1 or n lines.
42 Huawei Confidential
Insert Mode of Vim
⚫ Use the vim filename command to open a file and enter the normal mode by default. Type
i, I, a, A, o, or O to enter the insert mode.
⚫ If the filename file exists, the file is opened and the file content is displayed; otherwise, Vim
displays [New File] at the bottom of the screen and creates the file when saving the file for
the first time.
⚫ Press Esc to exit the insert mode and return to the normal mode.
[root@openEuler ~]# vim test.txt # Enter the normal mode by default.
~
~
"test.txt" [New File]
[root@openEuler ~]# vim test.txt # Press i, I, a, A, o, or O to enter the insert mode.
~
~
-- INSERT --
43 Huawei Confidential
Command Line Mode of Vim
⚫ Search
:/word or /word: searches for a word string after the cursor. Press n to continue to search forwards or press Shift+n to search
backwards.
⚫ Replace
:1,5s/word1/word2/g: replaces all occurrences of word1 in lines 1 to 5 with word2. If g is not specified, only the first occurrence
of word1 in each line is replaced.
%s/word1/word2/gi: replaces all occurrences of word1 with word2. i ignores the case of matches.
44 Huawei Confidential
Contents
45 Huawei Confidential
Important Network Concepts in openEuler
⚫ Host network device: a network adapter on the host.
⚫ Interface
Interfaces on devices are created by drivers for the system access.
⚫ Broadcast address
An IP address used to send packets to all hosts on the network segment
⚫ Subnet mask
A number that distinguishes the network address and the host address within an IP address
⚫ Route
Next-hop IP address when IP packets are transmitted across network segments
⚫ Link: connection between the device and the network.
46 Huawei Confidential
Commands for Querying IP Addresses
⚫ ip and ifconfig commands are used to view IP addresses of the current host.
⚫ Viewing information about all network adapters on a host.
[root@openEuler ~]# ifconfig –a
[root@openEuler ~]# ip addr show
47 Huawei Confidential
• Viewing the current IP addresses and subnet masks of all interfaces: ip addr
Configuring Static IP Addresses Using Network Adapter Configuration Files
⚫ Query the path of the network adapter configuration file:
[root@openEuler ~]# ls /etc/sysconfig/network-scripts/ifcfg-*
/etc/sysconfig/network-scripts/ifcfg-enp0s3 /etc/sysconfig/network-scripts/ifcfg-enp0s8
⚫ Parameter description: Parameter Description
TYPE Interface type
BOOTPROTO Boot-time protocol
ONBOOT Whether to activate the device at boot-time
IPADDR IP address
NETMASK Subnet mask
GATEWAY Gateway address
BROADCAST Broadcast address
MAC address. Only one MAC address needs to be set. New MAC addresses
HWADDR/MACADDR
cannot share the same name as another when they are set at the same time.
Whether to specify the DNS server address. If the DHCP protocol is used, the
PEERDNS
default value is yes.
DNS{1, 2} DNS server addresses
USERCTL User permission control
NAME Network connection name
DEVICE Physical interface name
48 Huawei Confidential
Configuring the IP Address - Configuration File Example
⚫ Set the static IP address of the enp0s3 interface to 192.168.56.100/24.
TYPE=Ethernet
BOOTPROTO=static
NAME=enp0s3
DEVICE=enp0s3
ONBOOT=yes
IPADDR=192.168.56.100
NETMASK=255.255.255.0
49 Huawei Confidential
50 Huawei Confidential
51 Huawei Confidential
52 Huawei Confidential
• The route, ip, and nmcli commands can be used to manage routes. The
following uses the route command as an example.
Viewing the Routing Table Using the route Command
⚫ Run the route command to view the routing table.
53 Huawei Confidential
• When the -n option is used to display routes, the values in the Destination
column are IP addresses.
• Eight fields are displayed when you run the route command to view routes. The
possible values of the Flags field include:
route [-f] [-p] [Command [Destination] [mask Netmask] [Gateway] [metric Metric]] [if Interface]]
⚫ Example:
[root@openEuler ~]# route add -net 192.168.101.0 netmask 255.255.255.0 dev enp4s0
[root@openEuler ~]# route add -host 192.168.100.10 dev enp4s0
[root@openEuler ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default _gateway 0.0.0.0 UG 100 0 0 enp4s0
192.168.100.10 0.0.0.0 255.255.255.255 UH 0 0 0 enp4s0
192.168.101.0 0.0.0.0 255.255.255.0 U 0 0 0 enp4s0
192.168.110.0 0.0.0.0 255.255.255.0 U 100 0 0 enp4s0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
54 Huawei Confidential
• You can use the route command to add routes. The added routes are stored in
the memory and become invalid after the system is restarted.
• The route add -host 192.168.101.100 dev enp3s0 command adds a route to the
192.168.101.100 host through the enp3s0 device.
• The output of the route command shows that routes to hosts have a higher
priority than routes to network segments.
Deleting a Route Using the route Command
⚫ Deleting a route to a network segment or host using the route del command.
⚫ Syntax:
route del [-net|-host] [netmask Nm] [gw Gw] [[dev] If]
⚫ Example:
55 Huawei Confidential
• The route del -host 192.168.101.100 dev enp3s0 command deletes the route to
the 192.168.101.100 host. The device parameter is optional.
• To delete routes in the route file, use the vi editor to edit the file and restart the
network.
Host Name
⚫ A host name identifies a device in a local area network (LAN).
⚫ The device can be a physical or virtual machine.
⚫ The host name is stored in the /etc/hostname file.
56 Huawei Confidential
Setting the Host Name
⚫ Setting a temporary host name: hostname new-name
⚫ Setting a permanent host name: hostnamectl set-hostname new-name
⚫ Setting a host name by modifying the file: write new-name to the /etc/hostname file.
57 Huawei Confidential
• To make the setting take effect, log in again or run the source .bashrc command.
• Run the hostname command to view the host name of the current system.
Introduction to the hosts File
⚫ Hosts in a LAN can be accessed through IP addresses.
⚫ IP addresses are difficult to remember when a large number of hosts exist in the LAN.
Therefore, we want to access the hosts directly through their host names.
⚫ In this case, the hosts can be located using a table that records the mapping between host
names and IP addresses. This table is the hosts file.
[root@openEuler ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost4.localdomain6
58 Huawei Confidential
• The hosts file is a system file without a file name extension. Its basic function is
to establish a "database" of frequently used domain names and their
corresponding IP addresses.
• When a user enters a website URL in the web browser, the system searches for
the corresponding IP address in the hosts file. Once the IP address is found, the
system opens the corresponding web page.
• If the URL is not found, the system sends the URL to the DNS server for IP
address resolution.
# Ip domain.com
192.168.10.20 www.example.com
#ip domain.com
#192.168.10.20 www.example.com
59 Huawei Confidential
Quiz
1. Which of the following statements is incorrect about file systems?
A. A file system is a method and a data structure used by an OS to identify files on a
storage device or a partition.
B. The software structure that manages and stores file data is referred to as a file
management system.
C. The file system manages and controls computer hardware and software resources.
D. The file system organizes and allocates the space on file storage devices, stores files,
and protects and retrieves the stored files.
2. Linux is a multi-user OS that allows multiple users to log in at the same time and
allows one user to log in multiple times.
A. True
B. False
60 Huawei Confidential
• Answer:
▫ C
▫ A
Summary
⚫ This course discusses the basic components and types of OSs and basic
operations of Linux. Now, we have finished learning the basics about
computing, storage, network, and OS technologies. In cloud computing,
how can we use and manage the resources to provide services for
applications? We will address these issues in the next course about
virtualization technology.
61 Huawei Confidential
Recommendations
⚫ Huawei iLearning
https://e.huawei.com/en/talent/portal/#/
⚫ Huawei Support Knowledge Base
https://support.huawei.com/enterprise/en/knowledge?lang=en
62 Huawei Confidential
Acronyms and Abbreviations
⚫ CLI: Command Line Interface
⚫ GUI: Graphical User Interface
⚫ POSIX: Portable Operating System Interface
63 Huawei Confidential
Thank you. 把数字世界带入每个人、每个家庭、
每个组织,构建万物互联的智能世界。
Bring digital to every person, home, and
organization for a fully connected,
intelligent world.