Cloud Computing - Chapter 4
Cloud Computing - Chapter 4
Foreword
⚫ 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.
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.
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.
33 Huawei Confidential
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
• UDP applies to applications that require high transmission efficiency or have the
reliability guaranteed at the application layer. For example, the Remote
Authentication Dial-In User Service (RADIUS) protocol used for authentication
and accounting and Routing Information Protocol (RIP) are based on UDP.
TCP vs. UDP
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
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
• 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
• The intermediate node selects the best path from its IP routing table to forward
packets.
• A routing entry contains a specific outbound interface and next hop, which are
used to forward IP packets to the corresponding next-hop device.
Routing Information
⚫ A route contains the following information:
Destination network: identifies a destination 1.1.1.2
10.1.1.0/24
network segment.
Mask: identifies a network segment together with a GE0/0/0
1.1.1.3
destination IP address.
Outbound interface: indicates the interface through
which a data packet is sent out of the local router.
IP routing table
Next hop: indicates the next-hop address used by Destination/Mask Outbound Interface Next Hop
the router to forward the data packet to the 10.1.1.0/24 GE0/0/0 1.1.1.2
destination network segment.
⚫ The information identifies the destination
network segment and specifies the path for
forwarding data packets.
66 Huawei Confidential
• 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
• Proto (Protocol): indicates the protocol type of the route, that is, the protocol
through which a router learns the route.
• Pre (Preference): indicates the routing protocol preference of the route. There
may be multiple routes to the same destination, which have different next hops
and outbound interfaces. These routes may be discovered by different routing
protocols or manually configured. A router selects the route with the highest
preference (with the lowest preference value) as the optimal route.
• 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
Summary
75 Huawei Confidential
Quiz
76 Huawei Confidential
• Answers:
▫ ABCD
▫ A
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
Acronyms and Abbreviations
⚫ ARP: Address Resolution Protocol
⚫ DNS: Domain Name Service
⚫ FTP: File Transfer Protocol
⚫ HTTP: Hypertext Transfer Protocol
⚫ ICMP: Internet Control Message Protocol
⚫ IGMP: Internet Group Management Protocol
⚫ IP: Internet Protocol
⚫ LAN: Local Area Network
⚫ TCP: Transmission Control Protocol
⚫ UDP: User Datagram Protocol
⚫ VLAN: Virtual Local Area Network
⚫ VLSM: Variable Length Subnet Mask
78 Huawei Confidential
Thank you. 把数字世界带入每个人、每个家庭、
每个组织,构建万物互联的智能世界。
Bring digital to every person, home, and
organization for a fully connected,
intelligent world.