• No results found

Sending data between four computers

5.4 Microengine program evaluation

5.4.4 Sending data between four computers

This section is comparing Intel’s SDK [16] RX block and our mirror RX block. We also look at different configurations of communication between the computers. To get closer to 1Gb/s in bandwidth, we need more than two computers in our test, as we saw in section 5.4.2. It is also interesting to see what is happening when you get close to maximum theoretical bandwidth.

Testing with 2 computers sending2x109 bytes each over 4 threads each to 2 other computers, as shown in figure 5.6 gave us problems. This test should give us more than 500 million bytes in each thread.

In the beginning, our Logger was loosing packets. First we thought the Intel SDK RX block was too slow, so we wrote a new one. We were still loosing packets, so we rewrote the RX block to only send the first 64 bytes of each packet to the logger. We did a test where computer 53 was sending data to computer 52, and at the same time, computer 55 was sending to 46. We were still loosing packets as you can see in figure 5.10, and figure 5.11, at the boxes labeled1 mirrorport. Each box is the bytes or packets transferred by one thread.

Each thread should be over 500 million bytes, but we do not even get 400 million bytes. We are measuring all bytes in the IP and TCP header as sent data. From section 5.4.3 we see that we should at least have 345000 packets. These packets with 40 bytes in IP and TCP headers give 13.800.000 extra bytes. This gives a total size of 513.800.000 bytes. However, there might be some collisions, and the switch or network cards in the computers drop some packets since we are close to the maximum bandwidth. It gets harder and harder to find the source of missed or extra packets the closer to maximum theoretical bandwidth we get. However, we are not doing good enough.

After some more thinking, it occurred to us that the port we are monitoring is full duplex.

This means that it can have 1Gb/s going both ways at the same time and the connection from the switch to our IXP card is only 1Gb/s. So we should loose packets if the port we were monitoring had a throughput where the flows both ways were over 1Gbp/s combined.

380 400 420 440 460 480 500 520 540

106 x Bytes

53->521 mirrorport55->46 53->522 mirrorports55->46

Figure 5.10: Bytes transferred by threads. One and two mirrorports. Each box is one thread.

250000 300000 350000 400000 450000 500000

Packets

53->52 55->46 53->52 55->46 1 mirrorport 2 mirrorports

Figure 5.11: Packets transferred by threads. One and two mirrorports. Each box is one thread.

We then set up the Cisco 2970 switch to monitor the port with two ports, one that mirrored the TX traffic and one for the RX traffic. This way we can monitor the port even if there is 1Gbit/s traffic both ways. Figure 5.10 and figure 5.11, show that we are doing much better now, at the boxes labeled2 mirrorports,

Each thread or box in the figure, is over 500 million bytes. From section 5.4.3, we see that we are in the same range as then we are transferring between two computers.

Since we wrote a new RX block, we wanted to see how it performs compared to Intel’s SDK RX block. To see if it makes any difference, we did the same test on both. In this test, computer

53 was sending to computer 46, at the same time as computer 52 was sending to computer 55.

We have 4 threads in each connection, and send2x109 bytes. The results are shown in figure 5.12 and figure 5.13.

525.2 525.25 525.3 525.35 525.4 525.45 525.5

106 x Bytes

53->46Intel SDK RX52->55 53->46Our mirror RX52->55

Figure 5.12: Bytes transferred by threads by the RX blocks. Each box is one thread.

488000 488050 488100 488150 488200 488250 488300

Packets

53->46Intel SDK RX52->55 53->46Our mirror RX52->55

Figure 5.13: Packets transferred by threads by the RX blocks. Each box is one thread.

We see that they transfer approximately the same number of bytes and packets. Still, one box represents one thread. Well, the tests are not exactly the same. We believe the difference is caused by the test computers. See section 5.4.3 where we wrote about the test computers.

There are still some strange things though. If we swap 52 and 46, in the figure 5.6, so that 53 sends to 52 and 46 sends to 55, we get the results shown in figure 5.14 and 5.15. We wanted to see if this is the case with the Intel SDK RX block as well, so we did the same test with that RX block as shown in the figure. The Intel SDK RX block gives the same result.

490 495 500 505 510 515 520 525 530

106 x Bytes

53->52Intel SDK RX46->55 53->52Our mirror RX46->55

Figure 5.14: Bytes transferred by threads by the RX blocks. Each box is one thread.

300000 350000 400000 450000 500000

Packets

53->52Intel SDK RX46->55 53->52Our mirror RX46->55

Figure 5.15: Packets transferred by threads by the RX blocks. Each box is one thread.

We see that we did not get all packets going from 46 to 55. Our program is the same, and the same switches were used. We only changed which computer sent data to which. In both

tests, the data goes opposite ways. We do not know why this happens, or where the problem is.

We tried to swap the ports for 52 and 46 on the switch, but that did not change anything.

We do not know the reason for this. The Cisco 2970 switch has not dropped packets accord-ing to its statistics, however, we do not know about the CNet switch, since it does not have a management interface.

If both computers send the traffic the same way, we seem to get all bytes, but the difference in observed packets is large. In this test 55 is sending to 52 and 53 to 46. This is shown in figure 5.16 and 5.17.

516 516.5 517 517.5 518 518.5 519 519.5 520

106 x Bytes

55->52 53->46

Figure 5.16: Bytes transferred by threads. Each box is one thread.

Our IXP card gets the same packets if the traffic comes from one or two interfaces, so that all packets come from one interface, should not affect our Logger. Since both computers are sending data the same way, they will try to send more data than the line can transfer. This might be the reason for the big difference in sent packets. The CNet switch in figure 5.6 might drop packets if its buffers are full, and the computers need to retransmit. The logger is running on eight contexts in one microengine, and we know from section 5.4.2, that this is enough for logging the packets.

The lesson learned from this section is that our mirror RX and Intel’s SDK RX block both perform well enough for line speed. Networks can behave in ways that are hard to explain.

We also saw that when getting very close to line speed, we can get some strange behavior.

We swapped computer 52 and 46, and ended up with different results, which is strange. Most important is that our system is able to monitor close to line speed. If we could have made smaller packets, it would stress the system even more. This might be an interesting test, but we felt like these tests and the real live test in section 5.6 is enough to show that the Logger works.

In the next section, we will see how much time the XScale uses to read through all the entries in the hash table.

330000 340000 350000 360000 370000 380000 390000

Packets

55->52 53->46

Figure 5.17: Packets transferred by threads. Each box is one thread.