Windows 7 / Networking

Test TCP

With Test TCP, you can both initiate TCP connections and listen for TCP connections. You can also use the Test TCP tool for UDP traffic. With Test TCP, you can configure a computer to listen on a specific TCP or UDP port without having to install the application or service on the computer. This allows you to test network connectivity for specific traffic before the services are in place.

Test TCP (Ttcp.exe) is a tool that you can use to listen for and send TCP segment data or UDP messages between two nodes. Ttcp.exe is provided with Windows Server 2003 in the Valueadd\Msft\Net\Tools folder of the Windows Server 2003 or Windows XP Service Pack 2 (SP2) product CD-ROM.

Test TCP differs from Port Query in the following ways:

  • With Test TCP, you can configure a computer to listen on a specific TCP or UDP port without having to install the application or service on the computer. This allows you to test network connectivity for specific traffic before the services are in place. For example, you could use Test TCP to test for domain replication traffic to a computer before you make the computer a domain controller.
  • Test TCP also supports IPv6 traffic.

When you are using a TCP port, the following code shows the basic syntax for Ttcp.exe on the listening node (the receiver):

ttcp -r -pPort

When using a UDP port, use the following syntax.

ttcp -r -pPort -u

After starting Test TCP in receive mode, the tool will wait indefinitely for a transmission before returning you to the command prompt. The first time you use Test TCP to listen from a computer running Windows 7, you might be prompted to create a Windows Firewall exception. You must create the exception for Test TCP to work. If you choose to unblock the application, Windows Firewall will allow all traffic for that computer on the specified port in the future. Therefore, you will not need to create a new exception for that network type, even if you listen on a different port. In Windows Firewall, the exception is named Protocol Independent Perf Test Command.

When you are using a TCP port, the following code shows the basic syntax for Ttcp.exe on the sending node (the transmitter):

ttcp -t -pPort hostname

When using a UDP port, use the following syntax.

ttcp -t -pPort -u hostname

If the two computers are able to communicate, the transmitting computer will display output such as the following.

ttcp-t: Win7 -> 192.168.1.132
ttcp-t: local 192.168.1.196 -> remote 192.168.1.132
ttcp-t: buflen=8192, nbuf=2048, align=16384/+0, port=81 tcp -> Win7
ttcp-t: done sending, nbuf = -1
ttcp-t: 16777216 bytes in 1423 real milliseconds = 11513 KB/sec
ttcp-t: 2048 I/O calls, msec/call = 0, calls/sec = 1439, bytes/call = 8192

Meanwhile, the receiving computer will display output similar to the following.

ttcp-r: local 192.168.1.132 <- remote 192.168.1.196
ttcp-r: buflen=8192, nbuf=2048, align=16384/+0, port=81 tcp
ttcp-r: 16777216 bytes in 1416 real milliseconds = 11570 KB/sec
ttcp-r: 3492 I/O calls, msec/call = 0, calls/sec = 2466, bytes/call = 4804

You can use Test TCP to connect to any computer listening for incoming TCP connections, even if that computer is not running Test TCP. However, to accurately test UDP connectivity, Test TCP must be running on both the receiver and transmitter. For example, to attempt a connection to www.microsoft.com on TCP port 80, you would run the following command.

ttcp -t -p80 www.yahoo.com
ttcp-t: local 192.168.1.196 -> remote 10.46.20.60
ttcp-t: buflen=8192, nbuf=2048, align=16384/+0, port=80 tcp -> www.yahoo.com
send(to) failed: 10053
ttcp-t: done sending, nbuf = 2037
ttcp-t: 81920 bytes in 16488 real milliseconds = 4 KB/sec
ttcp-t: 11 I/O calls, msec/call = 1498, calls/sec = 0, bytes/call = 7447

In this example, the TCP connection was successful, even though the output includes the line "send(to) failed." If the connection was unsuccessful, the output would have included the phrase "connection refused." Alternatively, some servers will simply not respond to invalid communications, which will cause the Test TCP transmitter to pause indefinitely while it awaits a response from the server. To cancel Test TCP, press Ctrl+C.

Each instance of Test TCP can listen on or send to only a single port. However, you can run it in multiple command prompts to listen or send on multiple ports. For additional commandline options, type Ttcp at the command prompt.

[Previous] [Contents] [Next]

In this tutorial:

  1. Troubleshooting Network Issues
  2. Tools for Troubleshooting
  3. Table-1 Network Troubleshooting Tools
  4. Arp
  5. How to Identify a Problem with the ARP Cacher
  6. How to Clear the ARP Cache
  7. Event Viewer
  8. IPConfig
  9. Nblookup
  10. Nbtstat
  11. Net
  12. How to View Shared Folders on the Local Computer
  13. How to View Shared Folders on Another Computer
  14. Netstat
  15. Network Monitor
  16. Nslookup
  17. Verifying that the Default DNS Server Resolves Correctly
  18. Verifying that a Specific DNS Server Resolves Correctly
  19. Verifying Specific Types of Addresses
  20. Using TCP for DNS Lookups
  21. PathPing
  22. PathPing Output
  23. Routing Loops
  24. Performance Problems
  25. Possible Connectivity Issues
  26. No Connectivity Issues
  27. Performance Monitor
  28. Data Collector Sets
  29. Windows Resource Monitor
  30. Ping
  31. PortQry
  32. Identifying the TCP Port for a Service
  33. Windows 7 Testing Service Connectivity
  34. Determining Available Remote Management Protocols
  35. Why PortQry Is Great
  36. Route
  37. Task Manager
  38. TCPView
  39. Telnet Client
  40. Testing Service Connectivity
  41. Test TCP
  42. Windows Network Diagnostics
  43. The Process of Troubleshooting Network Problems
  44. How to Troubleshoot Network Connectivity Problems
  45. How to Troubleshoot Application Connectivity Problems
  46. Default Port Assignments for Common Services and Tasks
  47. How to Troubleshoot Name Resolution Problems
  48. How to Verify Connectivity to a DNS Server
  49. How to Use the Hosts File
  50. How to Troubleshoot Performance Problems and Intermittent Connectivity Issues
  51. How to Troubleshoot Joining or Logging on to a Domain
  52. How to Verify Requirements for Joining a Domain
  53. How to Troubleshoot Network Discovery
  54. How to Troubleshoot File and Printer Sharing
  55. How to Troubleshoot File and Printer Sharing from the Client
  56. How to Troubleshoot File and Printer Sharing from the Server
  57. How to Troubleshoot Wireless Networks
  58. Network Diagnostics
  59. How to Troubleshoot Firewall Problems