You are on page 1of 16

Introduction to Common Applications P-1

Confidential Information of Huawei. No Spreading Without Permission


Introduction to Common Applications P-2

Confidential Information of Huawei. No Spreading Without Permission


Introduction to Common Applications P-3

Confidential Information of Huawei. No Spreading Without Permission


Introduction to Common Applications P-4

 The ping command is a common way to check the IP connectivity of the network and
the connection to the host. The ping command uses a series of Internet Control
Message Protocol (ICMP) messages to check whether the destination is reachable,
the communication delay, and the packet loss ratio. Ping is a process in which the
device sends a request and waits for response. The device that run the ping
command sends an Echo message to the destination, and then waits for a response.
If the Echo message reaches the destination and an Echo Reply message is returned
to the source within the specified period, the device can ping through the peer. If the
source does not receive the Echo Reply message, the “Request timed out” message
is displayed. In this example, the following command is typed on the PC:
 Ping 1.1.1.1
 To test the connectivity, send the Echo message to address 1.1.1.1.
 Besides basic commands, the ping command provides various optional parameters,
for example –a and –i. -a source-ip-address: sets the source IP address that sends
the ICMP ECHOREQUEST message. -i interface-type interface-number:

Confidential Information of Huawei. No Spreading Without Permission


Introduction to Common Applications P-6

 ICMP is an important part of the network layer. IP does not provide reliability, so the
device cannot obtain the network fault information. By using ICMP, the device can
obtain the information about the network faults.
 ICMP can send the information of error, control, and packet query. The ICMP packets
are encapsulated in IP packets. The value of the protocol field is 1. Some upper layer
applications may use the ICMP protocol, for example, ping and Tracert.

Confidential Information of Huawei. No Spreading Without Permission


Introduction to Common Applications P-7

 The ICMP packet uses the basic IP header, namely 20 bytes. The ICMP packet is
encapsulated in the IP packet. The first 64 bits of the datagram refer to the ICMP
packet. Therefore, an ICMP packet consists of an IP packet and the first 64 bits of the
datagram.
 The ICMP packet consists of the Type, Code, Checksum, and unused fields. The
formats of the messages vary with the message types. The details are omitted here.
 Type: indicates the type of the ICMP message.
 Code: in the same ICMP message type, the messages express different contents by
using the codes.
 For example: The Destination Unreachable message of which the Type value is 3
contains the following four types of messages:
 0 = net unreachable
 1 = host unreachable
 2 = protocol unreachable
 3 = port unreachable
 Checksum: contains 16 bits. This field is not in use and the value is 0.

Confidential Information of Huawei. No Spreading Without Permission


Introduction to Common Applications P-8

 ICMP provides the various message types. The following are commonly used:
 0 Echo Reply
 3 Destination Unreachable
 4 Source Quench
 5 Redirect
 8 Echo
 11 Time Exceeded
 12 Parameter Problem
 13 Timestamp
 14 Timestamp Reply
 Some messages are used together. For example, the Echo Reply message is the
response to the Echo message. The messages of the same type contain different
information. The following describes the message types and formats.

Confidential Information of Huawei. No Spreading Without Permission


Introduction to Common Applications P-9

 Tracert is used to check the path from the source node to the destination node. It
deducts 1 from the TTL value of the packet every time the packet traverses a router.
When the TTL value becomes 0, the router reports TTL timeout.
 Tracert sends a packet of which the TTL value is 1, so the first hop returns an ICMP
error message to notify that the packet cannot be forwarded because the TTL times
out. Then, Tracert sends a packet of which the TTL is 2, and the second hop returns
the same message. Tracert continuously sends such packets until one packet can be
sent to the destination. The packet uses an invalid port number (33434 by default), so
the destination host returns an ICMP unreachable message to notify that the Tracert
operation completes. Tracert records the source address that sends the ICMP error
message. Thus it can provide the IP addresses of the gateways through which the
user packets pass.
 Tracert can also provide a function to test the connectivity. When a fault occurs on the
network, it can be located according to the path displayed by Tracert.

Confidential Information of Huawei. No Spreading Without Permission


Introduction to Common Applications P-10

 Ping and Tracert are taken as an example here. The two methods can test whether
RTA and interface 3.3.3.3 of RTC can communicate.
 As shown in the displayed information, the ping command can directly display
whether the RTC is reachable, while Tracert can display the forwarding path in
details. The packet reaches 10.1.1.2, and then to 10.2.2.2, and finally reaches
3.3.3.3. In addition, the tracert command can locate the fault. In this example, if the
displayed information is as follows, it indicates that the packet can be sent to next hop
10.1.1.2, but cannot be forwarded by the router, therefore the fault occurs between
this router and the destination.
 [RTA]tracert 3.3.3.3
 traceroute to 3.3.3.3(3.3.3.3) 30 hops max,40 bytes packet
 1 10.1.1.2 31 ms 31 ms 32 ms
 2***

Confidential Information of Huawei. No Spreading Without Permission


Introduction to Common Applications P-11

 Telnet is used for the remote service. The user can log in to the remote server
through Telnet. The transport protocol used by Telnet is TCP and the port number is
23. The telnet command is as follows:
 telnet 192.168.1.22 23
 192.168.1.22: IP address of the router server.
 23: port number. The default value is 23. The value can be null. If the port number is
not 23, the user must enter the port number. For the detailed operation related to
telnet based access to a device, refer to the basic configuration of VRP.

Confidential Information of Huawei. No Spreading Without Permission


Introduction to Common Applications P-12

 FTP is an Internet standard for file transfer. It adopts two TCP links to transfer a file.
One is control link and the other is the data link. FTP adopts different TCP ports
according to the port mode, Port or Passive. In the past, the default client mode is
Port. In recent years, the Passive mode is widely used because the Port mode is not
secure (easy to be attacked.) In Port mode, FTP adopts two default port numbers 20
and 21. Port 20 is used to transfer data, and port 21 is used to transfer commands.
 The VRP routers can act as the FTP client or the FTP server. In this example, the PC
functions as the FTP client to log in to the FTP server through the FTP protocol. The
PC run the FTP program (that is, enter the ftp 1.1.1.1 command). The system displays
the login dialog box to request the user to enter user name and password, then the
user can log in.

Confidential Information of Huawei. No Spreading Without Permission


Introduction to Common Applications P-13

 If the VRP router needs to download a file from the remote server, it can act as the
FTP client to access files from the FTP server. Enter “FTP IP address of the remote
server” in the VRP system view. The user is prompted to enter the user name and
password. Then, the prompt is changed into [FTP]. It indicates that the user logs in
successfully.
 Get and Put are two operations performed on files. Get means downloading files from
the server, while Put means uploading files to the server. In this example, the Get
vrpcfg.def vrp1 command means that the client downloads the vrpcfg.dev file and
saves the file as vrp1.

Confidential Information of Huawei. No Spreading Without Permission


Introduction to Common Applications P-14

 To upload files to the FTP server, use the put command. In this example, the Put
vrpcfg.def command means that the local file vrpcfg.def is uploaded to the authorized
directory of the FTP server and the file name is not changed. The configuration
software of the FTP server is different. The details are omitted here.

Confidential Information of Huawei. No Spreading Without Permission


Introduction to Common Applications P-15

 The Trivial File Transfer Protocol (TFTP) is used when the user needs to transfer file
between server and client and complex interaction is not required. TFTP uses UDP
and the port number is 69. The VRP router can act as only the TFTP client to
download files from the TFTP server.

Confidential Information of Huawei. No Spreading Without Permission


Introduction to Common Applications P-16

 1. What are the functions of Ping and Tracert?


 They can test the connectivity of the network. Ping can provide the options to satisfy
test requirements, for example, specifying the source IP address and source port.
Tracert can obtain the forwarding path of packets. Besides, Tracert can also be used
to judge the distance to a destination.
 2. What is the format of the ICMP packet?
 The ICMP packet adopts the basic IP header (20 bytes). The packet is encapsulated
in the IP packet. The ICMP packet consists of the Type, Code, Checksum, and
unused fields. The formats vary with the message types.
 3. What is the difference between FTP and TFTP?
 FTP is based on TCP, while TFTP is based on UDP. TFTP is a simple file transfer
protocol. It is applicable to the read-only memory. FTP is designed for file transfer
with high throughput. FTP can control the user name and password, while TFTP
cannot. The router can support FTP Client and FTP Server, while TFTP supports only
the Client.

Confidential Information of Huawei. No Spreading Without Permission


Introduction to Common Applications P-17

Confidential Information of Huawei. No Spreading Without Permission

You might also like