<<

Link-Layer Protocol Lab The Kermit Protocol

Introduction:

By studying the operation of Kermit, a simple character-oriented file-transfer protocol, this laboratory will provide students with the opportunity to observe and understand several communication protocol fundamentals including: error control, flow control, framing and data transparency. Understanding why they are important, how they operate, and how they impact protocol performance is an essential prerequisite for a complete understanding of more complex internetworking protocols. By studying Kermit file transfers, the student will enhance his or her understanding of link-layer protocols and their role in reliable data transport. Students should give careful consideration to the tradeoffs being made and to the effect that the environment and the application may have on the design and implementation of communication protocols.

The first part of this laboratory requires the student to: 1) transfer an ASCII- using Kermit, 2) monitor the transfer using the FELINE protocol analyzer, 3) decode the contents of several packets, and 4) analyze the exchange of packets. The student's goal should be an understanding of what elements a protocol must have to accomplish reliable file transfers and achieve data transparency.

In the second half of this lab, students will analyze the performance of Kermit by repeatedly transferring an ASCII- text file and a . For each transfer, they will vary both the maximum size of the Kermit packets and the use of Kermit's sliding window extension. Students will measure the transfer delays and observe how the data is packetized, encoded and transmitted. Students will also observe a Kermit file transfer at extremely high serial-port rates, which will provide an opportunity to judge the Kermit protocol's ability to operate in a high speed environment.

While performing the steps of this lab, students should consider why the Kermit protocol behaves in the manner they observe. In so doing, they will gain insight into the tradeoffs that protocol designers and users must make when they design and use communications protocols.

Kermit/Link-Layer Lab - Rev: 01-06-96 1 Equipment and Setup:

Three Kermit setups will be available for students to use. Students may work in groups of no more than three persons. A sign-up sheet for the lab equipment will be posted outside the lab.

• Estimated Time: One to Two Hours.

• Table 1 is a list of the equipment required for this lab. The equipment should be pre-configured for you before coming to the lab. Consult with the on-duty GSA if you have any difficulty identifying or operating the correct equipment.

Qty Equipment Description 3 NCR 386/sx PCs (or equivalent) as detailed below: • 1 PC serving as a Kermit server. • 1 PC serving as a Kermit client. • 1 PC serving as the FELINE Protocol Analyzer. 2 Kermit v3.11 Software for MS-DOS. 1 FELINE/ParaScope Pod (Parallel Interface). 1 FELINE Protocol Analysis Software. 3 Files to be Transferred using Kermit: • DECODE.TXT, an -text file used to decode packets. • ASCII.TXT. an ascii-text file used to test performance. • BINARY.EXE, a binary-executable file used to test performance. Table 1: Hardware and Software required for the Kermit/Link-Layer lab.

Setting up Kermit, Feline, and the ParaScope Pod:

The outer PCs are configured with Kermit software to transfer files over the serial cable, and the center PC is configured with the FELINE software and the ParaScope Pod to monitor and examine the transfer. A null- serial cable is connected between the 25-pin RS-232 port on one of the Kermit PCs and one of the 25-pin RS-232 ports on the ParaScope Pod. A standard serial cable is then connected from the other 25-pin RS-232 port on the ParaScope Pod and the 25-pin RS-232 port on the other Kermit PC. The ribbon cable attached to the ParaScope pod is attached to the FELINE PC's parallel port. Check to make sure that the AC-adapter is plugged into the ParaScope Pod and into the 110-volt AC outlet. Finally, Check that the power switch on the ParaScope Pod is turned on.

Note: Please do not attach or detach any of the serial or parallel cables while the PCs are powered on. This can damage the on the PC. There are already many PCs in the lab that will not work with Kermit because of damage to the serial port. Turn the power off, or ask the GSA for assistance in moving any cabling.

Kermit/Link-Layer Lab - Rev: 01-06-96 2 Lab Procedures: Part I - Decoding Kermit Packets:

Overview:

A short ASCII text file will transferred between the sending and server PCs by Kermit. A PC running the FELINE Protocol Analyzer will monitor the transfer of the file and will capture it into a data buffers. By examining the data in FELINE's capture buffer, you will decode a Kermit packet, and you will analyze the sequence of Kermit packets sent between sender and server during the file transfer. As you transfer, capture, decode, and analyze the Kermit file transfer, think about how a protocol that only transfers printable ASCII characters can send non-printable ASCII characters such as carriage returns

1. Kermit's default settings will be used for this transfer. Load Kermit on the outer PCs: :\> KERMIT

• The PC on the left will be used as a Kermit server. Place it in server mode. MS-KERMIT> SERVER

The receiving PC should now display the server message.

2. Start FELINE on the center PC to monitor the file transfer. C:\> FELINE

FELINE automatically loads the configuration and program files, and FELINE then places itself in monitor mode to begin the traffic capture.

• Change FELINE's screen configuration to half-screen, so the timer will be visible. Press for the Change Screen Menu. Press to make it a Half Screen display. Press to Exit the Change Screen Menu.

3. Send the file from the right PC. MS-KERMIT> SEND DECODE.TXT

Kermit/Link-Layer Lab - Rev: 01-06-96 3 4. While we are most interested in the analysis of protocols in terms of their performance and efficiency, any such study must begin with a thorough understanding of the underlying structure and details of its operation. In Part 1 of the lab, you will "decode" the contents of a Kermit Send-INIT packet as captured during the transfer of the ASCII text file decode.txt. While interpreting packets captured by a protocol analyzer can be a lesson in tedium; it is, nonetheless, an important skill for both the designer and troubleshooter of communications protocols.

• (4.1) In order to complete Table 2, which is at the end of this lab write-up, you will need to place FELINE into examine mode. In examine mode, you will be able to use the arrow keys (← ↑ → ↓) to move through the contents of FELINE's capture buffer, which contains the record of the file transfer that was just captured. You will also need to refer to an ASCII table and your notes on the structure of Kermit packets.

• Place FELINE in Examine Mode: Press to Exit Line Monitor mode. Press to Exit Monitor Mode. Press to Enter Examine Mode.

5. In Table 2 provided on the next page, list the contents of the SEND INIT packet. Identify each field in both the header and the data section. Along with the identification, indicate the actual decoded value which is being transferred from the sender to the server. The Mark (Start-of-packet) character has been done for you already, use this as a guide. The column headings indicate what you should enter in each cell. Hex-Value is the actual value read from the raw protocol analyzer output. Encoding describes the type of encoding Kermit used to transmit the character. Possible values are: literal, excess-32, and XOR-64. Field Name and Description are self explanatory. Decoded Value should be the decoded value which Kermit is sending end-to-end—from sender to server. To determine the actual value you must undo the encoding used by the transmitting Kermit. In some cases. this may be an ASCII character; in other cases, it may be a decimal numeral. • Note: you need not decode the capas, maxl1, and maxl2 fields, just note their presence.

Kermit/Link-Layer Lab - Rev: 01-06-96 4 Hex Value Encoding Field Name Description Decoded Value 01h literal SOH start-of-header

0dh literal CR end-of-packet delimiter Table 2: Decoded Contents of the Send-INIT Packet.

Kermit/Link-Layer Lab - Rev: 01-06-96 5 6. While in examine mode, use Table 3 to record all the packets that were transferred while Kermit transferred the file decode.txt. After completing the experiments, you will create a time-sequence diagram from the contents of Table 3 to illustrate the dialog between the Kermit sender and the Kermit server while performing a Kermit file transfer session. Starting with the SEND INIT packet and ending with the BREAK packet, draw the time-sequence diagram on a separate sheet of paper and hand it in with your lab write-up. Clearly indicate the following information for each packet in the exchange: the packet-type, the sequence-number, and the direction of travel (i.e. who is the sender and who is the receiver).

Packet # Sequence # Sent By Sent To Packet Type Notes 1 0 Sender Server S Send-INIT Packet 20 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 Table 3: Packet Traffic for Kermit Transfer of decode.txt.

Kermit/Link-Layer Lab - Rev: 01-06-96 6 Part II: Transferring ASCII Text Files

Overview:

An ASCII text file will be transferred between the sender and server PCs by Kermit. Using FELINE, the file transfer time of the file will be measured. A number of transfers will be made while varying two Kermit- configurable parameters: 1) the maximum size of a Kermit packet; and 2) the use or non-use of Kermit's sliding- window protocol extension. You should observe that certain configurations of the two parameters will have significantly better or poorer performance than other configurations will. While you perform each of the experiments, you should consider why certain configurations perform better than other configurations, and you should also consider the effect on performance of the interaction between the frame size and the use or non-use of sliding windows. In the analysis section, you will be asked to calculate the effective transfer rate achieved by Kermit during these file transfers, so that while you perform each experiment, consider how much time is spent waiting for acknowledgments and how much time is spent constructing packets. Any insight you gain while performing these experiments will be very helpful in your analysis of the lab.

1. On the Server, exit Server Mode to set the Kermit parameters by typing: +

2. Because the PC on the left will again be used as a Kermit server, (The Receiver of Kermit packets) set the server's parameters for the file transfer and place it in server mode. MS-KERMIT> SET WINDOWS 1 MS-KERMIT> SET RECEIVE PACKET-LENGTH 50 MS-KERMIT> SERVER

3. The PC on the right will send files to the server. Set the sender's parameters. MS-KERMIT> SET WINDOWS 1 MS-KERMIT> SET SEND PACKET-LENGTH 50

4. Prepare FELINE to monitor the file transfer. Press repeatedly to return to the FELINE Main Menu. Press to Enter Monitor mode. Press to Enter Line Monitor mode.

• FELINE is now ready to monitor the Kermit File Transfer.

5. The first set of Kermit file transfers will use an ASCII text file called ASCII.TXT. If you have not placed FELINE in monitor mode, do so before you begin the first file transfer on the sending PC. At the Kermit prompt on the sender, type: MS-KERMIT> SEND ASCII.TXT

• Both Kermit PCs will show a status screen, which reports the percentage of the file transferred, the number of packets transferred, and the packet size along with other information. The PCs will beep when the transfer is complete.

6. When the file transfer is complete, find the number of frames used and the number of bytes transferred by Kermit on the Kermit server's display, and enter the values into the appropriate cells of the data sheet.

Kermit/Link-Layer Lab - Rev: 01-06-96 7 7. Shift your attention to the center PC and FELINE. You will read the file transfer time from the FELINE Display:

• (7.1) At the left side of FELINE's top window, you will see a column of timers, Timer 1 to Timer 5. You will find the time it took to transfer the file from the value of Timer 1: Timer 1 = 12345 milliseconds.

• In this case, the transfer time would be Timer 1 = 12.345 seconds.

8. Change the Kermit parameters for the next trial of the timing test. (On the Server, you must exit Server Mode before changing the parameters.) + MS-KERMIT> SET WINDOWS 7 MS-KERMIT> SET RECEIVE PACKET-LENGTH 50 MS-KERMIT> SERVER

• On the Sender, simply change the parameters. MS-KERMIT> SET WINDOWS 7 MS-KERMIT> SET SEND PACKET-LENGTH 50

9. Prepare FELINE for the next file transfer: Press to Exit Line Monitor mode. Press to Enter Line Monitor mode to capture the next transfer.

10. Send the ASCII.TXT file again. MS-KERMIT> SEND ASCII.TXT

11. Repeat (Part II) Steps 6 through 10 and record the results when using the other values of packet and window sizes in the appropriate cells of the data sheet. (See Table 4 below.)

Kermit/Link-Layer Lab - Rev: 01-06-96 8 Part III - Transferring Binary Files

Overview:

Because Kermit is designed to transfer ASCII files, special measures must be taken while using Kermit to transfer binary files. Kermit will assume that it has an 8-bit wide channel to send packets over. This can be a problem if Kermit is communicating over a 7-bit channel, which has one parity bit. In such a situation, any binary data that uses the eighth bit will lose the contents of that bit when the parity bit is set or reset, therefore the binary data will be corrupted by the transfer process. By telling Kermit to add a parity bit to every byte of data, binary files can be transferred reliably through the use of Kermit's control-character encoding and high-order bit encoding. As you transfer binary files, observe the data stream being captured by FELINE. Notice the use of prefix characters for encoding. While you observe, consider the combinations of prefix encoding that are possible and the effect that this encoding has on the effective transfer rate.

1. Make certain that the server is at the Kermit prompt by typing + , and then type at the prompt on both Server and Sender: MS-KERMIT> SET PARITY EVEN

2. Set the packet length and the window size back to 50 and 1, respectively. MS-KERMIT> SET WINDOWS 1 MS-KERMIT> SET RECEIVE (or SEND) PACKET-LENGTH 50

• On the server, type MS-KERMIT> SERVER

3. Prepare FELINE to monitor the file transfer. Press to Exit Line Monitor mode. Press to Enter Line Monitor mode for the next file transfer.

• FELINE is now ready to monitor the Kermit File Transfer.

4. The Kermit binary file transfers will use a file called BINARY.EXE. Begin sending the file by typing on the sending PC: MS-KERMIT> SEND BINARY.EXE

• (4.1) Take a minute to observe the contents of a few data packets involved in a binary transfer. Look for the presence of control character and high-order bit prefix characters. Compare this to what you observed when transferring ASCII.TXT.

5. Repeat (Part III) Steps 2 through 4 and record the results when using the other values of packet and window sizes in the appropriate cells of the data sheet (See Table 4 below.).

Kermit/Link-Layer Lab - Rev: 01-06-96 9 Kermit Parameters ASCII.TXT BINARY.EXE Packet Window # of Packets # of KBytes Timer 1 # of Packets # of KBytes Timer 1 Size Size (sec) (sec) 50 1 50 7 94 1 94 7 285 1 285 7 2000 1 Table 4: Kermit File Transfer Times

Kermit/Link-Layer Lab - Rev: 01-06-96 10 Part IV - High-Speed Serial Transfers

Overview:

In this part of the lab, you will observe the serial transfer of the text file, ascii.txt, using a high serial-port rate and with sliding windows set to seven. No data will be taken, but your observations will help you answer the questions that follow.

1. Make certain that the server is at the Kermit prompt by typing + , and then type at the prompt on both Server and Sender: MS-KERMIT> SET PARITY NONE MS-KERMIT> SET SEND PACKET-LENGTH 94 MS-KERMIT> SET RECEIVE PACKET-LENGTH 94 MS-KERMIT> SET WINDOWS 7 MS-KERMIT> SET SPEED 57600

• On the server, type MS-KERMIT> SERVER

2. The Kermit text file transfer will use the ASCII.TXT file. Begin sending the file by typing on the sending PC: MS-KERMIT> SEND ASCII.TXT

4. During and after the file transfer, observe the number of packets sent, and the number of retries which occurred.

Kermit/Link-Layer Lab - Rev: 01-06-96 11 Part V - Protocol Analysis:

Name : ______

Turn in pages 5,6,10 and section V only, neatly stapled. Please answer the following questions on a separate piece of paper. If you can please type your answers.

Questions:

1.(a) What is the purpose of the SEND INIT packet exchange between the sender and receiver?

1.(b) What problems does it solve?

1.(c) What problems cannot be solved by exchanging configuration information in this manner?

2. Clearly define each of the initialization parameters included in the SEND INIT packet.

3. Briefly describe the functionality of the packet types identified in the time-sequence diagram from the previous problem.

4. Using your observations of the file transfer, your knowledge of Kermit and information from problem (3), explain how Kermit handles control characters in the data field (i.e. how does Kermit achieve data transparency?):

5. Calculate the effective link utilization as seen by the user for each of the (14) trials in Table 4 for both the ASCII and the binary file. You will require the following additional information to make the calculations: data- rate = 9600 bps, ascii.txt - 12255 bytes, binary.exe - 12642 bytes, assume 8 bits/byte. Hint: An effective rate of 9600 bps yields a link utilization of 100%. Please use a separate sheet for the calculations, and place your answers in Table 5 below.

Kermit Values ASCII.TXT BINARY.EXE Packet Window Link Utilization Link Utilization Size Size (%) (%)

50 1 50 7 94 1 94 7 285 1 285 7 2000 1 Table 5: Effective Link Utilization

6. Using your observations of binary and ASCII file transfers, and your data gathered in table 1, explain what aspects of this protocol cause the difference in performance between text and binary file transfers?

Kermit/Link-Layer Lab - Rev: 01-06-96 12 7. As you did the lab, you should have noticed that some settings appear to be better in the situation that we created in the lab. Are there good reasons for using settings which appear to make the protocol less efficient?

Kermit/Link-Layer Lab - Rev: 01-06-96 13 Block Diagram of a Kermit File Transfer

Begin

Send Init Packet

Get Receiver's Init Packet

Send File Header

Send Data Packet

No File Done?

Yes

Send EOF Packet

Yes More Files?

No

Send EOT Packet

End

Kermit/Link-Layer Lab - Rev: 01-06-96 14 Kermit Packet Format

MARK LEN SEQ TYPE DATA .... CHK

• MARK SOH Identifies start of packet

• LEN Number of bytes in packet

• SEQ Packet sequence number, modulo-64

• TYPE Packet type, for example: D Data Y Acknowledgment S Send Init F File Header Z End of File B Break Transmission

• DATA Content varies by packet type: D packet contains file contents F packet contains name of file S packet contains parameter values

• CHK Checksum can be 1, 2, or 3 characters

Kermit/Link-Layer Lab - Rev: 01-06-96 15 Data-Link Encoding

• To achieve data transparency, Kermit transmits only printable ASCII characters, except the SOH.

• Three techniques are used to convert control characters into printable ASCII depending upon where the character is located in the packet.

• Control Fields: Characterization

• Data Fields: “Controlified” Prefix Encoding

• High-Order Bit: HOB Prefix Encoding

Kermit/Link-Layer Lab - Rev: 01-06-96 16 Control Characters in Control Fields

• Control characters are promoted to printable form prior to transmission, and demoted at the receiver using the following functions:

• At the sender: char(x) = x + 20h

• At the receiver: unchar(x) = x - 20h

• Example:

1. Packet sequence number 0 (zero). 2. SEQ = 0 is not printable, it must be promoted. 3. char(0h) = 20h which is the SP character. 4. A space (SP) is transmitted in the SEQ field. 5. At the receiver unchar(20h) yields 0 (zero)

Kermit/Link-Layer Lab - Rev: 01-06-96 17 Control Character Encoding in Data Fields

• char(x) limits the values to the range 0 - 94. Anything above 94 will promote to a non-printable character.

• Kermit cannot limit the range of values within the data field as it can with control fields.

• The solution: Convert the control character to printable form by flipping the 7th bit (XOR with 40h), and prefix this converted character with a special character, typically “#”.

• At the sender: ctl(x) = x XOR 40h

• At the receiver: ctl(ctl(x)) = x

• Example:

1. Sender wants to send ctrl-A : 0000 0001 2. ctl(ctrl-A) yields “A”: 0100 0001 3. Transmit #A 4. Receiver drops the # and 5. ctl(A) yields ctrl-A again: 0000 0001

Kermit/Link-Layer Lab - Rev: 01-06-96 18 High-Order Bit Encoding For Sending Binary Files

• Many asynchronous communications channels do not provide an 8-bit wide path for data.

• With binary files data often contains bytes with the high-order bit (8th) set.

• To accommodate 8-bit transfer on 7-bit channels Kermit uses a prefix encoding technique as follows:

• At the sender: If the 8th bit is set, send the prefix character, typically &, followed by the 7-bit printable character.

• At the receiver: If you detect the prefix character, drop it and set the 8th bit high on the next character.

Kermit/Link-Layer Lab - Rev: 01-06-96 19 Parameter Initialization Send-Init Packet

• Prior to transferring any files, two peer Kermits must negotiate several parameters which govern both ends for the duration of a file transfer session.

• Kermit does this by exchanging Send-Init packets at the start of each session.

• The session initiator requests values for parameters including:

Maximum packet length Send time-out End-of-packet delimiter Prefix encoding character HOB prefix encoding character Type of checksum Window size ... and more

• The receiver responds with the values it is willing to accept.

Kermit/Link-Layer Lab - Rev: 01-06-96 20 Parameter Initialization Send-Init Packet Format

MAXL TIME NPAD PADC EOL QCTL QBIN CHKT REPT

123456789

Extension: CAPA WINDOW MAXL1 MAXL2 10 11 12 13

• The data field of the ‘S’ packet contains parameters as illustrated above:

• Each parameter is encoded using one printable ascii character.

• The encoding used varies per parameter and is described below:

1. MAXL Maximum packet length characterized 2. TIME Receive time-out characterized 3. NPAD Number of padding characters characterized 4. PADC Control character for padding controlified 5. EOL End of packet delimiter characterized 6. QCTL Prefix encoding character literal 7. QBIN High-order prefix encoding literal, ‘Y’, or ‘N’ 8. CHKT Type of checksum used ‘1’,’2’ or ‘3’ 9. REPT Repeat count prefix character literal

Kermit/Link-Layer Lab - Rev: 01-06-96 21 • Extensions to Kermit have allowed for sliding windows, large packets and the use of an optional attributes packet to exchange additional information about files.

• The CAPA field consists of a bit mask that indicates which of these advanced features the sender is willing to use. Setting a bit in the appropriate position indicates a willingness to use a feature, and determines the processing of the final three fields.

10. CAPA 11. WINDOW Indicates window size if window bit is set in CAPA 12. MAXL1 Used in conjunction with MAXL2 to determine the max 13. MAXL2 packet length if bits are set CAPA.

Kermit/Link-Layer Lab - Rev: 01-06-96 22