Multiple UDP listener problems with uIP stack

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

What about the 1Gbit Ethernet. One year ago you could find the XC-2g (Gigabit) in makefiles from XMOS.
It showed to be an internal test-plattform.

Some days ago I read somewhere in the XMOS sdocumentation - contact XMOS for more information about 1Gb solutions.

Have anyone done that already and can share the info ?

Since you need an ASIC anyway on the PHY layer, it could maybe take some burden away of the CRC and give the XMOS a in&out nibbles that are above the MII, giving higher bandwidth. I do not need more than 25 Mbit for the moment since - My laptop have full load by computing FFTs of all Ethernet data but for other applications.

Is it the uIP that is the limiting part for the moment?
Are all AVB based on the uIP ?

A 5 port 100 Mbit Ethernet switch with a 1Gbit Backbound-Bandwidth is below 10$ today. That's the same price as a low-priced USB2.0 hub.
WLAN is soon everywhere, so with the laptop the Ethernet port is always free to use when you are on the move and need to connect you (XMOS) device.

Hmm, why did I spend so much time thinking of the USB :?:


Probably not the most confused programmer anymore on the XCORE forum.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

OK so now I have a simple webserver running on the XDK with the old xtcp module

What is the trick in general to apply the sockets in an existing project?

Is it to replace:

module_xtcp* with module_xsockets.0v4

and refactor? the client,server and layer xtcp_* with socket_*
Are the function arguments more or less compatible with the xtcp ones ?

(the xtcp_ is embedded in structs as well)

(I would prefers to not make the change manually, but I should do it so I understand the code :oops: )

Of course, fell free to update all code above the Transport Layer for us. Maybe it's time to GIT so you get some help for free? Like Berni and others that have spent time with the higher OSI levels.
Probably not the most confused programmer anymore on the XCORE forum.
sleepless
Junior Member
Posts: 7
Joined: Wed Nov 10, 2010 10:44 pm

Post by sleepless »

Probably not the answer you are looking for, but I cut out the XMOS XTCP layer all together and just interfaced directly with UIP as I need very low latency. No offense against XTCP, but it is not sockets and I didn't need a generic any-core solution so a channel interface was unnecessary. Also takes out a potentially weak link (though it adds my own). Took me about a day (look at the uip_server loop and xtcpd_appcall, which is a UIP callback function, uip is also pretty well commented though they really like gotos) to figure it out and implement a simple UDP listener/client. I haven't looked in a bit but I think my in and back out latency is closer to 150us (via wireshark) though my packets are pretty small so your mileage may vary.

My daughter wants me to include this: :lol:
User avatar
BEBDigitalAudio
Experienced Member
Posts: 82
Joined: Thu Nov 11, 2010 7:45 pm

Post by BEBDigitalAudio »

Sleepless, you should look to my xsockets library then... I wrote it to have a socket based interface ;)

Liltroll, I performed some extensive tests about the high load that can be handled/produced by xsockets.
I made a test application which sends a 1400 bytes packet as fast as possible (the test application just fills the buffer and sends it, so I can see just the time needed by the CPU without any audio processing time)

The worst time I have seen between packets using -O3 optimization is betwee 350 and 390 microseconds between each packet (around 600 microseconds without optimization)

I am also currenty testing direct access to the socket layer (the client must run then on the same core than uIP), and I was able to go under 200 microseconds (since there is no synchronization time needed between threads)

The test has run full load yesterday during 6 hours, and I did not see any packet loss.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

There is allot of modules belonging to this new document:

https://www.xmos.com/download/public/AV ... 5v0%29.pdf

It containing Ethernet 1.4 and xtcp 2.0 and allot of more stuff.
Probably not the most confused programmer anymore on the XCORE forum.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

Thanks Mika interesting document.

Hmm I notice in it they refer to the following in references:
[XEth10] XMOS Ethernet Component Design Guide. Xmos Ltd. 2010.
[XTCP10] XMOS TCP/IP Component Design Guide. Xmos Ltd. 2010.
Any chance of someone pointing to these docs at Xmos as I would be interested in reading them?

regards
Al
User avatar
BEBDigitalAudio
Experienced Member
Posts: 82
Joined: Thu Nov 11, 2010 7:45 pm

Post by BEBDigitalAudio »

Apparently, XTCP2.0 and Ethernet 1.4 exist somewhere... but not on the XMOS components page ;)

I just checked on the XMOS website, and it's still the "old" Ethernet 1.3 and XTCP 1.3

Does anybody know if XMOS released these new versions somewhere ?
(I heard that the multiple UDP listener problem was solved with last XTCP version)

And as Folknology said, it would be great if the "user's manual" would be available
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

If you have acess to the AVB kit via your XMOS account, there is so many new modules in the AVB5.0 that my laptop was eating files forever.
Even the xmos-common is new.
I think it was 19 +-1 new modules in the kit.

(They released the new L2 Ethernet AVB kit Monday this week, and that included allot of new stuff, since it included XDK and XDK+XAI as well)

PS. The gigabit Ethernet module is there as well DS.
Probably not the most confused programmer anymore on the XCORE forum.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

I checked the license:

The new modules that are signed:

Software License

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal with
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:


are now uploaded here
https://github.com/xcore
Probably not the most confused programmer anymore on the XCORE forum.
User avatar
BEBDigitalAudio
Experienced Member
Posts: 82
Joined: Thu Nov 11, 2010 7:45 pm

Post by BEBDigitalAudio »

I still have the "old" 4.0 AVB. I will download the 5.0 right now, and verify that I can put the 1.4 Ethernet driver in it.

By the way, I just uploaded the xsockets 0.5 on the project page.