Rate of Network Transmition UDP/ TCP much slower than expected

I’m using Etherenet J11D wrote some app over LAN. currently the speed is much slower than I would expect.
when using UDP ~ 90 packets of 1 KB per second meaning rate is 90KB???
and when using TCp it is even slower ~40 packet of 1KB per second ~ 40KB Per second

it sounds weird to me that these are the rates while my switch allows rates of MBPS is this gadgeteer limitation?
any way to have LAN rate faster?

what was the rate you’ve managed to reach?

that;s still quite slow, isn’t it?
are you using UDP/ TCP?
is it possible that you post the code you are using?
Thanks!

thanks, but even if I perepare the buffer before hand and only send it is still dlow so I do not thing the data preparation is the only bottle neck?
Does anyone know the rates using
Hydra / cerberus with ethernet ENC28?
or Hdr120 with ethernet J11D.
?

I could reach more than 400KByte/sec via UDP with G120 and ENC28.
Couldn’t test this with EMX and BuiltinEthernet so far because of UDP bug.
But 90/40 KB/sec is way to slow.

here http://www.tinyclr.com/forum/topic?id=9813 is my test code

We have tested the download speeds on EMX using the following code:


using System;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;

using GHI.Premium.Net;

using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using System.Net.Sockets;
using System.Net;
using System.IO;

namespace Network_Speed_Tests
{
    public partial class Program
    {
        WebRequest request;
        Stream stream;

        DateTime timeStarted;

        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
            Debug.Print("Initializing network");
            ethernet_ENC28.Interface.Open();
            //NetworkInterfaceExtension.AssignNetworkingStackTo(ethernet_ENC28.Interface);

            ethernet_ENC28.Interface.NetworkInterface.EnableDhcp();
            ethernet_ENC28.Interface.NetworkInterface.EnableDynamicDns();

            ethernet_ENC28.Interface.NetworkAddressChanged += new NetworkInterfaceExtension.NetworkAddressChangedEventHandler(Interface_NetworkAddressChanged);
            Debug.Print("Awaiting network address");
        }

        void Interface_NetworkAddressChanged(object sender, EventArgs e)
        {
            Debug.Print("Requesting URI");

            request = WebRequest.Create("http://www.ghielectronics.com/downloads/resources/graphics/fullsize/HowCanIHelp.jpg");

            WebResponse response = request.GetResponse();


            if (response != null)
            {
                stream = response.GetResponseStream();
                long totalSize = response.ContentLength;

                timeStarted = DateTime.Now;

                byte[] buffer = new byte[1024];
                int bytesToRead;

                Debug.Print("Awaiting response completion");

                //We are testing the raw networking speeds, so we will do nothing with the incomming data
                while ((bytesToRead = stream.Read(buffer, 0, buffer.Length)) > 0)
                {
                }

                TimeSpan elapsedTime = (DateTime.Now - timeStarted);
                long totalSeconds = elapsedTime.Seconds;

                if (elapsedTime.Minutes > 0)
                    totalSeconds += (elapsedTime.Minutes * 60);

                long bitsPerSecond = ((totalSize / elapsedTime.Seconds) * 8); //Internet speeds are measured in bits per second (Kb/s) not bytes per second (KB/s)

                Debug.Print("Finished downloading " + totalSize.ToString() + " bytes in " + elapsedTime.Seconds.ToString() + " seconds.");
                Debug.Print("Accomplishing " + bitsPerSecond.ToString() + "bits per second");
            }
        }
    }
}

The result was ~235 Kb/s (29KB/s) via HTTP. The speeds will vary with differentials in latency between server and client, as well as processor speeds. Please remember that what your ISP classifies your internet speed at (say 10Mb down stream) and all internet transaction speeds (what you see in the download dialog of IE or FireFox) are measured in bits per second as well as your downstream speeds in TCP are limited by your upstream speeds.

We will test downloading to the EMX as soon as possible.

I think upload will be faster. And not using HTTP will be even faster.

Your test is testing the HTTP speed not the network speed itself.