4

The PC has two Gigabit Ethernet ports. They function as two separate network adapters. I'm trying to do a simple loopback test between the two. I've tried TTCP and IPERF. They're giving me hard time because I'm using the same physical PC.

Using pcattcp...

On the receiver end:

C:\PCATTCP-0114>pcattcp -r
PCAUSA Test TCP Utility V2.01.01.14 (IPv4/IPv6)
  IP Version  : IPv4
Started TCP Receive Test 0...
TCP Receive Test
  Local Host  : GIGA
**************
  Listening...: On TCPv4 0.0.0.0:5001

  Accept      : TCPv4 0.0.0.0:5001 <- 10.1.1.1:33904
  Buffer Size : 8192; Alignment: 16384/0
  Receive Mode: Sinking (discarding) Data
  Statistics  : TCPv4 0.0.0.0:5001 <- 10.1.1.1:33904
16777216 bytes in 0.076 real seconds = 215578.95 KB/sec +++
numCalls: 2052; msec/call: 0.038; calls/sec: 27000.000

C:\PCATTCP-0114>

On the transmitter end:

C:\PCATTCP-0114>PCATTCP.exe -t 10.1.1.1
PCAUSA Test TCP Utility V2.01.01.14 (IPv4/IPv6)
  IP Version  : IPv4
Started TCP Transmit Test 0...
TCP Transmit Test
  Transmit    : TCPv4 0.0.0.0 -> 10.1.1.1:5001
  Buffer Size : 8192; Alignment: 16384/0
  TCP_NODELAY : DISABLED (0)
  Connect     : Connected to 10.1.1.1:5001
  Send Mode   : Send Pattern; Number of Buffers: 2048
  Statistics  : TCPv4 0.0.0.0 -> 10.1.1.1:5001
16777216 bytes in 0.075 real seconds = 218453.33 KB/sec +++
numCalls: 2048; msec/call: 0.037; calls/sec: 27306.667

C:\PCATTCP-0114>

It's responding alright. But why does it say 0.0.0.0? Is it passing through only one of the network adapters?

I want 10.1.1.1 to be the server (receiver) and 10.1.1.2 to be the client (transmitter). These are the IP addresses assigned manually to each network adapter. How do I specify these addresses in TTCP?

There is also the IPERF tool which has the -B option. Unfortunately I've been only able to use this option to bind the server to the 10.1.1.1 address. I was unable to bind the client to the 10.1.1.2 address. I might be doing it wrong. Can the -B option be used for both the server as well as the client side? What does the syntax look like for the client?

Update


As you can see by the answer I posted I have figured out how to do this using IPERF. I have looked at ways to use TTCP to do the same thing and I have found the -a option, but when I tried to use it I received a Winsock Error on the client side.

On server side:

C:\PCATTCP-0114>pcattcp -r -a 10.1.1.1
PCAUSA Test TCP Utility V2.01.01.14 (IPv4/IPv6)
  IP Version  : IPv4
Started TCP Receive Test 0...
TCP Receive Test
  Local Host  : GIGA
**************
  Listening...: On TCPv4 10.1.1.1:5001

On client side:

C:\PCATTCP-0114>pcattcp -t 10.1.1.1 -a 10.1.1.2
PCAUSA Test TCP Utility V2.01.01.14 (IPv4/IPv6)
  IP Version  : IPv4
Started TCP Transmit Test 0...
TCP Transmit Test
  Transmit    : TCPv4 10.1.1.2 -> 10.1.1.2:5001
  Buffer Size : 8192; Alignment: 16384/0
  TCP_NODELAY : DISABLED (0)
*** Winsock Error: connect Failed; Error: 10061 (0x0000274D)

C:\PCATTCP-0114>

It looks like it's trying to connect to itself?

4

I reviewed the help for IPERF and I think I got it now.

On server side:

C:\>iperf -s -B 10.1.1.1
------------------------------------------------------------
Server listening on TCP port 5001
Binding to local address 10.1.1.1
TCP window size: 8.00 KByte (default)
------------------------------------------------------------
[160] local 10.1.1.1 port 5001 connected with 10.1.1.2 port 35202
[ ID] Interval       Transfer     Bandwidth
[160]  0.0-10.0 sec   420 MBytes   352 Mbits/sec

s

On client side:

C:\>iperf -c 10.1.1.1 -B 10.1.1.2
------------------------------------------------------------
Client connecting to 10.1.1.1, TCP port 5001
Binding to local address 10.1.1.2
TCP window size: 8.00 KByte (default)
------------------------------------------------------------
[132] local 10.1.1.2 port 35202 connected with 10.1.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[132]  0.0-10.0 sec   420 MBytes   352 Mbits/sec

C:\>

c

Let me know if you see any errors here.

I would still like to know if this is possible, and how to do it using TTCP? If you know the answer to this, please post it.

1

IP works by choosing the best route from source to destination. Loopback within a host is better than the Ethernet interface out from a host, so even if you think you are testing the Ethernet loop you wired between your two network adapters, you will find that the traffic sent between two IP addresses of your machine does not pass through it, instead it short-circuits through loopback.

You would need to run two distinct routing instances on a device and only make one of the external interfaces known to each if you want traffic to loop around the outside. If your device were a router, you would use VRF (Virtual Routing Facility) to separate the routing instances.

Since your machine is a host, your best bet is to install a VM and pass one of the network interfaces to the virtual machine while the other is handled by the "bare metal".

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.