Network Services and Applications
Network Services and Applications
Page 1 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Foreword
The Internet has become an integral part of our lives, with a wide range of
applications such as file transfer, email sending, online video, web browsing, and
online gaming. Because of the layered network model, common users can use
various services provided by the application layer, without knowing technical details
such as communication technology implementations.
In previous courses, we have learned technologies related to the data link layer,
network layer, and transport layer. This chapter will describe common network
services and applications such as FTP, DHCP, and HTTP.
Page 2 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Objectives
On completion of this course, you will be able to:
Understand FTP fundamentals.
Understand TFTP fundamentals.
Understand DHCP fundamentals.
Understand Telnet fundamentals.
Understand HTTP fundamentals.
Understand DNS fundamentals.
Understand NTP fundamentals.
Page 3 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. File Transfer
▪ FTP
▫ TFTP
2. Telnet
3. DHCP
4. HTTP
5. DNS
6. NTP
Page 4 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
File Transfer Protocols
File transfer between hosts is an important function of IP networks. Nowadays, people can conveniently transfer
files using web pages and mailboxes.
However, in the early Internet era when the World Wide Web (WWW) did not come into being and operating
systems used command-line interfaces, people transferred files via command-line tools. The most commonly used
protocols for transferring files at that time are File Transfer Protocol (FTP) and Trivial File Transfer Protocol (TFTP).
Page 5 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Basic Concepts of FTP
ASCII mode
Binary mode
Page 6 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
FTP Transfer Process - Active Mode
• FTP works in two modes: active mode (PORT) and passive mode (PASV).
File transfer
Page 7 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
FTP Transfer Process - Passive Mode
File transfer
Page 8 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Configuration Commands (Device as FTP Server)
A user accesses a device through FTP.
[Huawei]aaa
[Huawei]local-user user-name password irreversible-cipher password
[Huawei]local-user user-name privilege level level
[Huawei]local-user user-name service-type ftp
[Huawei]local-user user-name ftp-directory directory
The privilege level must be set to level 3 or higher. Otherwise, the FTP connection fails.
Page 9 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Configuration Commands (Device as FTP Client)
1. A VRP device that functions as an FTP client accesses an FTP server.
<FTP Client>ftp 10.1.1.1
Trying 10.1.1.1 ...
Press CTRL+K to abort
Connected to 10.1.1.1.
220 FTP service ready.
User(10.1.1.1:(none)):ftp
331 Password required for ftp.
Enter password:
230 User logged in.
2. Common commands used when the VRP device functions as an FTP client.
ascii Set the file transfer type to ASCII, and it is the default type
binary Set the file transfer type to support the binary image
ls List the contents of the current or remote directory
passive Set the toggle passive mode, the default is on
get Download the remote file to the local host
put Upload a local file to the remote host
Page 10 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Configuration Example
Configurations on the FTP server:
<Huawei> system-view
[Huawei] sysname FTP_Server
[FTP_Server] ftp server enable
[FTP_Server] aaa
[FTP_Server-aaa] local-user admin1234 password irreversible-cipher
Page 11 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. File Transfer
▫ FTP
▪ TFTP
2. Telnet
3. DHCP
4. HTTP
5. DNS
6. NTP
Page 12 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Basic Concepts of TFTP
Compared with FTP, TFTP is designed to transfer small files and is easier to implement.
Using UDP (port 69) for transmission
Authentication not required
You can only request a file from or upload a file to the server, but cannot view the file directory on
the server.
TFTP
UDP
IP
Page 13 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
TFTP Transfer Example
Upload a File Download a File
Page 14 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Configuration Commands (Device as TFTP Client)
1. Download a file (VRP device functioning as a TFTP client).
You do not need to log in to the TFTP server, and only need to enter the IP address of the TFTP server and the
corresponding command.
You do not need to log in to the TFTP server, and only need to enter the IP address of the TFTP server and the
corresponding command.
Page 15 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. File Transfer
2. Telnet
3. DHCP
4. HTTP
5. DNS
6. NTP
Page 16 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Application Scenario of Telnet
To facilitate device management using commands, you can use Telnet to manage devices.
Device management through Telnet is different from that using the console port. In Telnet-based device
management mode, no dedicated cable is required to directly connect to the console port of the Telnet server, as
long as the Telnet server’s IP address is reachable and Telnet clients can communicate with the Telnet server’s TCP
port 23.
The device that can be managed through Telnet is called the Telnet server, and the device connecting to the Telnet
server is called the Telnet client. Many network devices can act as both the Telnet server and Telnet client.
Telnet server
TCP connection
AP Router
IP network
Switch Firewall
Telnet client
...
Server
Page 17 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
VTY User Interface
When a user logs in to a device using the console port or Telnet, the system allocates a user interface to manage
and monitor the current session between the device and the user. A series of parameters can be set in each user
interface view to specify the authentication mode and user privilege level after login. After a user logs in to a device,
user operations that can be performed depend on the configured parameters.
The user interface type of Telnet is virtual type terminal (VTY) user interface.
User interface
Authentication mode: local
VTY 0 User privilege: Level 15
1 Establish a Telnet connection VTY 1
VTY 2 3 Authenticate the Telnet
connection using the VTY
VTY 3
IP network configuration.
Page 18 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Configuration Commands (1)
1. Enable the Telnet server function.
The Telnet server function is enabled on the device (disabled by default). To disable this function, run
the undo telnet server enable command.
2. Enter the user view.
The VTY user interface view is displayed. VTY user interfaces may vary according to device models.
By default, the VTY user interface supports Secure Shell (SSH) and Telnet.
Page 19 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Configuration Commands (2)
4. Configure the authentication mode and the authentication password in password authentication mode.
By default, no default authentication mode is available. You need to manually configure an authentication
mode.
The set authentication password cipher command implementation varies according to VRP versions. In
some versions, you need to press Enter and then enter the password. In other versions, you can directly enter
the password after the command.
Page 20 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Configuration Example (1)
Page 21 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Configuration Example (2)
Page 22 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. File Transfer
2. Telnet
3. DHCP
4. HTTP
5. DNS
6. NTP
Page 23 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Issues Faced by Manual Network Parameter
Configuration (1)
Too Many Hard-to-Understand Parameters Huge Workload
Address configuration
Mask . . . Address configuration Network
administrator
Gateway . . .
• Common users are not familiar with network parameters and • Network administrators centrally configure network
misconfiguration often occurs, resulting in network access parameters, with heavy workloads and repetitive tasks.
failure. Random IP address configuration may cause IP address • Network administrators need to plan and allocate IP
conflicts. addresses to users in advance.
Page 24 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Issues Faced by Manual Network Parameter
Configuration (2)
Low Utilization Poor Flexibility
Offline user
Office A Office B
• On an enterprise network, each user uses a fixed IP address. As a • Wireless local area networks (WLANs) allow for flexible station
result, the IP address utilization is low, and some IP addresses (STA) access locations. When a STA moves from one wireless
may remain unused for a long time. coverage area to another, the IP address of the STA may need
to be reconfigured.
Page 25 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Basic Concepts of DHCP
DHCP Working Principle
Page 26 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
DHCP Advantages
Unified Management IP Address Lease
DHCP client
DHCP client
Pool-No 1 IP:192.168.1.10
DNS-server 10.1.1.2 | Gateway 10.1.2.1 Network mask:24
Network 10.1.2.0 | Mask 255.255.255.0 Gateway:192.168.1.1
Total Used DNS: 114.114.114.114
252 2 Lease: 8 hour
• IP addresses are obtained from the address pool on the DHCP server. The • DHCP defines the lease time to improve IP address utilization.
DHCP server records and maintain the usage status of IP addresses for
unified IP address assignment and management.
Page 27 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
DHCP Working Principle
Layer 2
broadcast
domain
DHCP client DHCP Discover (broadcast): used to discover the DHCP server
DHCP server on the current network.
Sent by the DHCP client DHCP Offer (unicast): carries the IP address
Pool-No 1
assigned to the client.
Total Address 255
Question: Why does a DHCP client need to send a DHCP Request packet to the DHCP server to notify its
use of a particular IP address after receiving a DHCP Offer packet?
Page 28 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
DHCP Lease Renewal
Layer 2
broadcast
domain
If the DHCP client fails to receive a response from the original DHCP server at 50% of the lease (known
as T1), the DHCP client waits until 87.5% of the lease (known as T2) has passed. At T2, the client enters
the rebinding state, and broadcasts a DHCP Request packet, to which any DHCP server can respond.
Page 29 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Configuration Commands (1)
1. Enable DHCP.
2. Enable the interface to use the interface address pool to provide the DHCP server function.
4. Configure the range of IP addresses that cannot be automatically assigned to clients from the interface
address pool.
5. Configure the lease of IP addresses in the interface address pool of the DHCP server.
[Huawei-Gigabitthernet0/0/0]dhcp server lease { day day [ hour hour [ minute minute ] ] | unlimited }
Page 30 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Configuration Commands (2)
6. Create a global address pool.
7. Specify the range of IP addresses that can be assigned dynamically in the global address pool.
[Huawei-ip-pool-2]gateway-list ip-address
9. Specify the DNS server IP address that the DHCP server delivers to DHCP clients.
[Huawei-ip-pool-2]dns-list ip-address
Page 31 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
DHCP Interface Address Pool Configuration
Requirement:
Layer 2
GE0/0/0
broadcast • Configure a router as the DHCP server, configure the subnet
domain 10.1.1.1/24
to which GE0/0/0 belongs as the address pool of DHCP
DHCP client DHCP server
clients, set the IP address of GE0/0/0 to that of the DNS
server, and set the lease to three days.
Page 32 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
DHCP Global Address Pool Configuration
Requirement:
Page 33 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. File Transfer
2. Telnet
3. DHCP
4. HTTP
5. DNS
6. NTP
Page 34 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Web Page Access Using a Browser
The browser sends an HTTP request to the server
to obtain page resources.
www.huawei.com
• When you enter a uniform resource locator (URL) in a browser, the browser can obtain data from a web server
and display the content on the page.
• Hypertext Transfer Protocol (HTTP): an application layer protocol for communication between a client browser
or another program and a web server
• HTTP adopts the typical C/S architecture, and uses TCP for transmission.
Page 35 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Background
WWW
The WWW is comprised of the web servers and clients all over the world.
• In the early days of the Internet, World Wide Web (WWW) was proposed to share documents.
• The WWW consists of three parts: Hypertext Markup Language (HTML) for displaying document content in a browser, HTTP for
transmitting documents on the network, and URLs for specifying document locations on the network.
• WWW was actually the name of a client application for browsing HTML documents, and now represents a collection of technologies
(HTML + HTTP + URL) and is commonly known as the Web.
Page 36 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Transfer Example (1)
HTTP request
HTTP response
Internet
Web client Web server
www.servs_app.com/web/index.html
Page 37 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Transfer Example (2)
HTTP request
HTTP response
Internet
Web client Web server
Web Server
Host:www.servs_app.com
Page 38 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. File Transfer
2. Telnet
3. DHCP
4. HTTP
5. DNS
6. NTP
Page 39 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Birth of DNS
When you enter a domain name in your browser to access a website, the domain name is resolved to an IP address.
The browser actually communicates with this IP address.
The protocol used for resolving domain names to IP addresses is Domain Name System (DNS).
Each node on the network has a unique IP address, and nodes can communicate with one another through IP
addresses. However, if all nodes communicate through IP addresses, it is difficult to remember so many IP addresses.
Therefore, DNS is proposed to map IP addresses to alphanumeric character strings (domain names).
Internet
www.huawei.com 1.2.3.4
1 Domain name
resolution HTTP
Source IP: 192.168.1.1
Destination IP: 1.2.3.4
Page 40 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
DNS Components
Domain name: a sequence of characters to identify hosts. In most cases, the URL entered in the
browser when you visit a website is the domain name of the website.
DNS server: maintains the mappings between domain names and IP addresses and responds to
requests from the DNS resolver. Domain name
info
Row 1
Internet
Row 2
DNS client DNS server
DNS request Row 3
DNS query: domain name A
DNS response
UDP
Page 41 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Domain Name Format
The domain name is in the format of hostname.second-level domain.top-level domain.root domain.
The root domain is represented by a dot (.). Generally, the root domain is denoted by an empty name
(that is, containing no characters).
Root domain .
Second-level
domain huawei
Page 42 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
DNS Query Modes
The DNS is a distributed system. The database of most DNS servers does not have all domain name records. When a
client queries a domain name from a DNS server but the DNS server does not have the record of the domain name,
the client can continue the query in either of the following ways:
Recursive query: The DNS server queries other DNS servers and returns the query result to the DNS client.
Iterative query: The DNS server informs the DNS client of the IP address of another DNS server, from which the DNS client
queries the domain name.
4 2
2 3
3
DNS client DNS client
4
DNS server 2 DNS server 2
Page 43 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. File Transfer
2. Telnet
3. DHCP
4. HTTP
5. DNS
6. NTP
Page 44 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Time Synchronization Requirements
Consistent clock of all devices is required in many scenarios on enterprise campus networks:
Network management: Analysis of logs or debugging messages collected from different routers needs time for
reference.
Charging system: The clocks of all devices must be consistent.
Several systems working together on the same complicate event: Systems have to take the same clock for
reference to ensure a proper sequence of implementation.
Incremental backup between a backup server and clients: Clocks on the backup server and clients should be
synchronized.
System time: Some applications need to know the time when users log in to the system and the time when files
are modified.
Page 45 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
NTP Overview
If the administrator manually enters commands to change the system time for time synchronization,
the workload is heavy and the accuracy cannot be ensured. Therefore, the Network Time Protocol
(NTP) is designed to synchronize the clocks of devices.
NTP is an application layer protocol belonging to the TCP/IP suite and synchronizes time between a
group of distributed time servers and clients. NTP is based on IP and UDP, and NTP packets are
transmitted using UDP on port number 123.
NTP server
Time synchronization
Page 46 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
NTP Network Structure
Primary time server: directly synchronizes its clock with a standard reference clock through a cable or radio.
Typically, the standard reference clock is either a radio clock or the Global Positioning System (GPS).
Stratum-2 time server: synchronizes its clock with either the primary time server or other stratum-2 time servers
within the network. Stratum-2 time servers use NTP to send time information to other hosts in a Local Area
Network (LAN).
Stratum: is a hierarchical standard for clock synchronization. It represents the precision of a clock. The value of a
stratum ranges from 1 to 15. A smaller value indicates higher precision. The value 1 indicates the highest clock
precision, and the value 15 indicates that the clock is not synchronized.
NTP client
Page 47 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Quiz
1. Which FTP mode is recommended for transferring log and configuration files on network
devices? Why?
2. Why does a DHCP client need to send a DHCP Request packet to the DHCP server to notify
its use of a particular IP address after receiving a DHCP Offer packet?
Page 48 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Summary
FTP is used to transfer files. You are advised to use different transfer modes for
different files. FTP is based on TCP and therefore can ensure the reliability and
efficiency of file transfer.
As the document transfer protocol of WWW, HTTP is widely used in today's network
for encoding and transporting information between a client (such as a web browser)
and a web server.
Page 49 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.
Thank You
www.huawei.com
Page 50 Copyright © 2021 Huawei Technologies Co., Ltd. All rights reserved.