Main Site Documentation

Fast Ethernet


#1

Hello, I have problems with my cobra board. I want to send Data from the analog-in-port through ethernet to a PC.
I need to send the Data at a speed of 10-20 kS to the PC. I think the ethernet funktion of the board is to slow for this. It is fast if you want to Send one big byte-array. But I want to send a small array or only one single byte and that very often, then its to slow, isn`t it?
The only solution for my problem is to programm the whole Ethernet thing with RLP.
Is it possible to make it easier?
Or is it possible to only write the outputregister of the Ethernet through rlp and do the other stuff trough managed Code?

So, anyone an Idea what to do?


#2

IIRC, we did some tests and Ethernet speed was about 100KBytes/sec. Maybe it is slow in your case because you are processing the data which makes it slow. Or you are sending small packets which cause a lot of overhead.

You said you are sending one byte or small array already so this is the problem. What you can do is buffer the data on your end and then send on network when you have large buffer.


#3

Thanks for your fast reply.
The Thing is that I need to transmit the Data on the analog-in-port as fast as possible. So I don`t want to buffer the data.
Then there is no other (easier) solution than rlp!?
Because I think ethernet trough rlp is not very easy.


#4

RLP will not make the network faster. You are sending little packets on network and this is very slow due to overhead.


#5

Over what distance you need to send this data? If it’s not too far you can consider XBee.


#6

The distance is very close, only a few meters. But we want to do it with ethernet.
Is the sending over XBee much faster?


#7

for your small packets, it is.
And, if it’s only a few meter, why not use a longer USB cable (i used one up to 5m successfully) and use CDC.


#8

Has the original poster actually measure the throughput, or is he assuming that it will be too slow?

Is TCP or UDP being used?

With TCP, the large number of small packets will cause a slow down due to waiting for acks from the remote end.

Using UDP will significantly reduce the overhead, and improve the throughput.

Of course, with UDP it is possible to lose packets, but if you are not on a very busy network it is unlikely.


#9

I meassured the throuput and I use UDP allready.
But the throughput is still much too slow.
I thougt that I can send with 10-20 kSample, every Sample in its own paket. But I can only send about 400 pakets per second.
Do you think that this has to be faster?


#10

I assume you have checked to make sure you are not limited by the analog sampling rate.

I have never tried to determine the maximum UDP packet rate on a Cobra. 400 seems like a good number of packets.

Are you doing any other processing?

Could you prepare a program which just reads the analog input and sends a data packet, determine the rate, and post the results along with your code?

BTW, I don’t think you are going to get 10-20K packets per second. It would be interesting to see if that rate could be achieved on a PC.


#11

I`m not limited by the analog sampling rate. I checked it.

You both (Mike and Gus) told me that such high packet-rates as I need, are not possible. So I think I have to buffer the data and send bigger pakets or I have to use another technology like USB or something.

It was my fault to think that ethernet is that fast.

Thank you for your quick help.


#12

Ethernet is fast :slight_smile: If you read online you will see how Ethernet packets have large overhead, about 35 bytes so if you are sending 1 byte of data, this becomes 36 bytes on the network! But if you send 1000 bytes then this is 1035 bytes on the network.


#13

Be careful with USB. USB is not interrupt driven so there is a lot of polling in the background. This may have an effect on the analog sampling rate you could achieve. But, it should be easy to run a quick test.

Serial communications is a low overhead way of sending data, and you would not have to worry about the size of packets, althought you would need to deliniate each message. You would need to convert from the TTL levels to the RS-232 voltages.