15 Network Services and Applications
15 Network Services and Applications
Applications
age 2 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Forewor
d
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.
age 3 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Objective
s
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.
age 4 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. File Transfer
▪ FTP
▫ TFTP
2. Telnet
3. DHCP
4. HTTP
5. DNS
6. NTP
age 5 Copyright © 2020 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).
age 6 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Basic Concepts of FTP
ASCII mode
Binary mode
age 7 Copyright © 2020 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
age 8 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
FTP Transfer Process - Passive Mode
File transfer
age 9 Copyright © 2020 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.
age 10 Copyright © 2020 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
age 11 Copyright © 2020 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-
FTP client FTP server cipher Helloworld@6789
10.1.1.2 10.1.1.1
[FTP_Server-aaa] local-user admin1234 privilege level 15
[FTP_Server-aaa] local-user admin1234 service-type ftp
[FTP_Server-aaa] local-user admin1234 ftp-directory flash:
age 12 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. File Transfer
▫ FTP
▪ TFTP
2. Telnet
3. DHCP
4. HTTP
5. DNS
6. NTP
age 13 Copyright © 2020 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
TFTP
directory on the server. UDP
IP
age 14 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
TFTP Transfer Example
Upload a File Download a File
age 15 Copyright © 2020 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.
age 16 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. File Transfer
2. Telnet
3. DHCP
4. HTTP
5. DNS
6. NTP
age 17 Copyright © 2020 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
age 18 Copyright © 2020 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:
VTY 0 local
1 Establish a Telnet connection User privilege: Level 15
VTY 1
VTY 2 3 Authenticate the Telnet
connection using the
VTY 3
IP network VTY configuration.
age 19 Copyright © 2020 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.
3. Configure protocols supported by the VTY user interface.
By default, the VTY user interface supports Secure Shell (SSH) and Telnet.
age 20 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Configuration Commands (2)
4. Configure the authentication mode and the authentication password in password authentication mode.
age 21 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Configuration Example (1)
<Huawei> system-view
IP network
[Huawei] telnet server enable
Telnet client Telnet server
10.1.1.1 10.1.1.2 [Huawei] aaa
[Huawei-aaa] local-user huawei password irreversible-
cipher Huawei@123
• Configure the router at 10.1.1.2 as the Telnet server
[Huawei-aaa] local-user huawei privilege level 15
and set the authentication mode to AAA local
[Huawei-aaa] local-user huawei service-type telnet
authentication. Create an account named huawei, set
[Huawei-aaa] quit
the password to Huawei@123, and set the privilege
[Huawei] user-interface vty 0 4
level to 15.
[Huawei-ui-vty0-4] authentication-mode aaa
• Log in to and manage the Telnet server through the
Telnet client.
age 22 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Configuration Example (2)
age 23 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. File Transfer
2. Telnet
3. DHCP
4. HTTP
5. DNS
6. NTP
age 24 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Issues Faced by Manual Network
Parameter Configuration (1)
Too Many Hard-to-Understand Parameters Huge Workload
s Mask
G
es
Address allocation
at
dr
ew
Ad
Address configuration
Mask . . .
ay
Address configuration Network
administrator
Gateway . . .
• Common users are not familiar with network parameters • Network administrators centrally configure network
and misconfiguration often occurs, resulting in network parameters, with heavy workloads and repetitive
access failure. Random IP address configuration may tasks.
cause IP address conflicts. • Network administrators need to plan and allocate IP
addresses to users in advance.
age 25 Copyright © 2020 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 • Wireless local area networks (WLANs) allow for flexible
address. As a result, the IP address utilization is low, and station (STA) access locations. When a STA moves from
some IP addresses may remain unused for a long time. one wireless coverage area to another, the IP address of
the STA may need to be reconfigured.
age 26 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Basic Concepts of DHCP
DHCP Working Principle
Request IP addresses
static IP configuration mode, the Dynamic Host
Configuration Protocol (DHCP) is developed to
dynamically assign suitable IP addresses to hosts.
age 27 Copyright © 2020 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 Network mask:24
10.1.2.1 Gateway:192.168.1.1
Network 10.1.2.0 | Mask DNS:
255.255.255.0 114.114.114.114
Total Used Lease: 8 hour
252 2
• IP addresses are obtained from the address pool on the DHCP • DHCP defines the lease time to improve IP address utilization.
server. The DHCP server records and maintain the usage status of
IP addresses for unified IP address assignment and management.
age 28 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
DHCP Working Principle
Layer 2
broadcast
domain
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?
age 29 Copyright © 2020 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.
age 30 Copyright © 2020 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.
age 31 Copyright © 2020 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
age 32 Copyright © 2020 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
domain 10.1.1.1/24
DHCP server
subnet to which GE0/0/0 belongs as the address pool
DHCP client
of DHCP clients, set the IP address of GE0/0/0 to that
of the DNS server, and set the lease to three days.
age 33 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
DHCP Global Address Pool
Configuration
Requirement:
DHCP client DHCP server (on the subnet 1.1.1.0/24) to DHCP clients. Set both
the gateway address and DNS address to 1.1.1.1, set
the lease to 10 days, and enable GE0/0/0 to use the
Configuration on the DHCP server: global address pool.
• Enable the DHCP service globally and
[Huawei]dhcp enable configure the global address pool
[Huawei]ip pool pool2
pool2. Configure the address range,
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-pool2]network 1.1.1.0 mask 24 gateway address, DNS address, and
[Huawei-ip-pool-pool2]gateway-list 1.1.1.1 lease for pool2.
[Huawei-ip-pool-pool2]dns-list 1.1.1.1
• Select the global address pool on a
[Huawei-ip-pool-pool2]lease day 10
[Huawei-ip-pool-pool2]quit specific interface (GE0/0/0). When
[Huawei]interface GigabitEthernet0/0/0 GE0/0/0 receives a DHCP request, it
[Huawei-GigabitEthernet0/0/1]dhcp select global assigns an IP address from the global
address pool.
age 34 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. File Transfer
2. Telnet
3. DHCP
4. HTTP
5. DNS
6. NTP
age 35 Copyright © 2020 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.
age 36 Copyright © 2020 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.
age 37 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Transfer Example (1)
HTTP request
HTTP response
Internet
Web client Web server
The URL www.servs_app.com/web/index.html is
entered in the address box of a browser. After
obtaining the IP address corresponding to the
domain name through DNS resolution, the client
sends an HTTP request to the server to request
the page. GET /web/index.html HTTP
/1.0
HOST:www.servs_app.com
www.servs_app.com/web/
index.html
age 38 Copyright © 2020 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.co
m
GET /web/index.html HTTP File System
/1.0
├── bin
www.servs_app.com/web/ HOST:www.servs_app.com
├── etc
index.html
├── sbin
├── share
└── web
Welcome to └── index.html
servs_app.com
This is an HTML Example Page
HTTP /1.1 200 ok The server finds the locally
Index.html stored page file based on
the URL and sends the
page file to the client.
age 39 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. File Transfer
2. Telnet
3. DHCP
4. HTTP
5. DNS
6. NTP
age 40 Copyright © 2020 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
HTTP access
2
request
age 41 Copyright © 2020 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
UDP
response
age 42 Copyright © 2020 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
age 43 Copyright © 2020 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
age 44 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. File Transfer
2. Telnet
3. DHCP
4. HTTP
5. DNS
6. NTP
age 45 Copyright © 2020 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.
age 46 Copyright © 2020 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
age 47 Copyright © 2020 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
age 48 Copyright © 2020 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?
3. What are the functions of HTML, URL, and HTTP?
age 49 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Summar
y
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.
Dynamically assigning IP addresses through DHCP reduces the workload of the
administrator and avoids IP address conflicts caused by manual configuration
of network parameters.
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.
age 50 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Thank You
www.huawei.com
age 51 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.