TCP operation configuration example
Network requirements
As shown in Figure 15, configure a TCP operation to test the time required for Device A to establish a TCP connection with Device B.
Figure 15: Network diagram
Configuration procedure
Assign IP addresses to interfaces, as shown in Figure 15. (Details not shown.)
Configure static routes or a routing protocol to make sure the devices can reach each other. (Details not shown.)
Configure Device B:
# Enable the NQA server.
<DeviceB> system-view [DeviceB] nqa server enable
# Configure a listening service to listen on the IP address 10.2.2.2 and TCP port 9000.
[DeviceB] nqa server tcp-connect 10.2.2.2 9000
Configure Device A:
# Create a TCP operation.
<DeviceA> system-view [DeviceA] nqa entry admin test1 [DeviceA-nqa-admin-test1] type tcp
# Specify 10.2.2.2 as the destination IP address.
[DeviceA-nqa-admin-test1-tcp] destination ip 10.2.2.2
# Set the destination port number to 9000.
[DeviceA-nqa-admin-test1-tcp] destination port 9000
# Enable the saving of history records.
[DeviceA-nqa-admin-test1-tcp] history-record enable [DeviceA-nqa-admin-test1-tcp] quit
# Start the TCP operation.
[DeviceA] nqa schedule admin test1 start-time now lifetime forever
# After the TCP operation runs for a period of time, stop the operation.
[DeviceA] undo nqa schedule admin test1
# Display the most recent result of the TCP operation.
[DeviceA] display nqa result admin test1 NQA entry (admin admin, tag test1) test results: Send operation times: 1 Receive response times: 1 Min/Max/Average round trip time: 13/13/13 Square-Sum of round trip time: 169 Last succeeded probe time: 2011-11-22 10:27:25.1 Extended results: Packet loss ratio: 0% Failures due to timeout: 0 Failures due to disconnect: 0 Failures due to no connection: 0 Failures due to internal error: 0 Failures due to other errors: 0
# Display the history records of the TCP operation.
[DeviceA] display nqa history admin test1 NQA entry (admin admin, tag test1) history records: Index Response Status Time 1 13 Succeeded 2011-11-22 10:27:25.1
The output shows that it took Device A 13 milliseconds to establish a TCP connection to port 9000 on the NQA server.