ICMP Echo Request And Echo Reply - Interface Serial

ICMP Echo Request and Echo Reply Last Updated on Wed, 28 Jun 2023 | Interface Serial

The ICMP Echo and Echo Reply messages are sent and received by the ping command. In fact, when people say that they sent a ping packet, they really mean that they sent an ICMP Echo Request. These two messages are very much self-explanatory. The Echo Request simply means that the host to which it is addressed should reply to the packet. The Echo Reply is the ICMP message type that should be used in the reply. The Request includes some data, which can be specified by the ping command; whatever data is sent in the Echo Request is sent back in the Echo Reply.

The ping command itself supplies many creative ways to use Echo Requests and Replies. For instance, the ping command enables you to specify the length as well as the source and destination address, and it also enables you to set other fields in the IP header. Example 5-6, later in this chapter, shows a good example of the capabilities of the ping command.

FTP and TFTP

File Transfer Protocol (FTP) and Trivial File Transfer Protocol (TFTP) are two popularly used file transfer protocols in a typical IP network. Most users use FTP, whereas router and switch administrators use TFTP. Which is "better" depends partially on what is being done. A more important question may typically be, "Which is supported on the devices that need to transfer the file?" Given a choice today, most users will choose FTP because it has many more robust features. TFTP is a favorite of router administrators, however, because the IOS does not support FTP as an application.

FTP is a TCP-based application that has many options and features, including the capabilities to change directories, list files using wildcard characters, transfer multiple files with a single command, and use a variety of character sets or file formats. More important in this context is the basic operation of FTP. Figures 5-15 and 5-16 show a typical FTP connection—or, better stated, connections:

Figure 5-15 FTP Control Connections

r SYN, DPORT=21, SPORT=1030

Lj

SYN, ACK, DPORT=1030, SPORT=21 ^L

- ACK, DPORT=21, SPORT=1030 w

FTP Client FTP Server

The connection shown in Figure 5-15 is called an FTP control connection. When a user (FTP client) asks to connect to an FTP server, a TCP connection is established to the FTP server's well-known port (21). The connection is established like any other TCP connection. The user is typically required to enter a user name and password, which the server uses to authenticate the files available to that user for read and write permissions. This security is based on the file security on the server's platform. Access to files on the client side is implied by the environment from which the client created the FTP connection; again, this is dependent on the operating system on the client platform. All the commands used to control the transfer of a file are sent across this connection—hence the name FTP control connection.

At this point, the user has a variety of commands available to enable settings for transfer, change directories, list files, and so forth. However whenever a get or a put command is entered (or mget or mput—m is for multiple) or the equivalent button is clicked, then a file is transferred. The data is transferred over a separate TCP data connection. Figure 5-16 outlines the FTP data connection process.

Figure 5-16 FTP Data Connection

A

get, myport=1031, file=zzz

TCP ACK

V I

SYN, DPORT=20, SPORT=1031

FTP Client

SYN, ACK, DPORT=1031, SPORT=20

FTP Server

ACK, DPORT=20, SPORT=1031

>

As shown in Figure 5-16, another TCP connection is established, this time to well-known port 20. Using this convention, a file can be transferred without getting in the way of the control connection. If many files are to be transferred rather than make a single control/data connection for each file, the control connection is made once. The environment is defined using the control connection, and these settings affect the functioning of the data connection. For instance, the default directory to use in future transfers can be defined using commands on the control connection, as well as the type of data (binary or ASCII). The control connection stays up until the user breaks it. While the control connection is up, a separate data connection is established for each file transfer.

An additional step helps prevent hackers from breaking in and transferring files, as shown in Figure 5-16. Rather than just creating a new connection, the client tells the server with an application layer message what port number will be used for the new connection. The server will not transfer the file (zzz, in this case) over any other data connection except the one to the correct socket—the one with the client's IP address, TCP, and the port number declared to the server (1031, in this case).

TFTP

Trivial File Transfer Protocol (TFTP) is a UDP-based application with very basic features. One of the reasons that such an application is needed (when the more robust FTP is available) is that TFTP takes little memory to load and takes little time to program. With the advent of extremely low-cost memory and processing, such advantages seem trivial. Practically speaking, if you intend to transfer files frequently from your PC, FTP is probably what you will use. However, to transfer files into and out of IOS-based routers and switches, Cisco supports TFTP, not FTP.

TFTP uses UDP, so there is no connection establishment and no error recovery by the transport layer. However, TFTP uses application layer recovery by embedding a small header between the UDP header and the data. This header includes codes—for instance, read, write, and acknowledgment—along with a numbering scheme that numbers 512-byte blocks of data. These block numbers are used to acknowledge receipt and resend the data. TFTP sends one block and waits on an acknowledgment before sending another block—essentially, the equivalent of a window size of 1.

Table 5-7 summarizes some features of TFTP and FTP.

Table 5-7 Comparison of FTP and TFTP

Table 5-7 summarizes some features of TFTP and FTP.

Table 5-7 Comparison of FTP and TFTP

FTP

TFTP

Uses TCP

Uses UDP

Uses robust control commands

Uses simple control commands

Sends data over a separate TCP connection from

Uses no connections, due to UDP

control commands

Requires more memory and programming effort

Requires less memory and programming effort

Is not supported as an application in IOS

Is supported as an application in IOS

Continue reading here: Classes of Networks

Was this article helpful?

+2 -5

Tag » What Is Echo Request And Reply