Hi,
I am using a Tiva C Series Connected Launchpad EK-TM4C1294XL for my project. I managed to completly rewrite the uip_example application in TivaWareLibrary/boards/ek-tm4c1294xl/enet_uip to send and retrieve data over port 8080 and controlling an AD5754 D/A converter. But when sending a lot of data UIP refuses to work correctly.
First I send 4-bytes-packes in an interval of 10 ms from an application on my laptop over the network to the device. It looks like this.
Client side:
Connecting to server... Connection established! Receiving... V0.1 396 B/s (sent=396 B, received=0 B) 792 B/s (sent=1.160 kB, received=0 B) 1.160 kB/s (sent=2.320 kB, received=0 B) 1.547 kB/s (sent=3.867 kB, received=0 B) 1.934 kB/s (sent=5.801 kB, received=0 B) 2.320 kB/s (sent=8.121 kB, received=0 B) 2.707 kB/s (sent=10.828 kB, received=0 B) Statistics: 1584/s (sent=11088, received=0) Programm finished.
Unfortunately the data rates a wrong.
Server side:
Initialize AD5754... Initialize Ethernet... Registering interrupts... Using Internal PHY. Waiting for MAC to be ready... MAC ready. Waiting for Link. Link Established. Waiting for IP address... Starting network listener... IP: 192.168.178.20 CONNECTED POLL (received=149, sent=0) ACKED POLL (received=353, sent=5) POLL (received=553, sent=5) POLL (received=757, sent=5) POLL (received=957, sent=5) POLL (received=1161, sent=5) POLL (received=1361, sent=5) POLL (received=1561, sent=5) POLL (received=1765, sent=5) POLL (received=1965, sent=5) POLL (received=2169, sent=5) POLL (received=2369, sent=5) POLL (received=2573, sent=5) POLL (received=2773, sent=5) POLL (received=2789, sent=5) CLOSED (received=2789, sent=5) CLOSED (received=2789, sent=5)
You can cleary see that there were 11088 bytes sent from the client but only 2789 received on the server. Also the server gives me two times the message that the connection was closed. Why?
The next problem happens when I remove the 10 ms delay on the client side for more speed. After a while the server stops receiving data for a while and then receives some chunks of data in undefined intervals of 30 seconds to 1 minute or sometimes more. After it has received some chunks of data it refuses to work completely and on client side the application is not able to send more data. I guess because the sending buffer is full. Here an example:
Client side:
Connecting to server... Connection established! Receiving... V0.1 371.891 kB/s (sent=371.891 kB, received=0 B) 825.578 kB/s (sent=1.169 MB, received=0 B) 1.254 MB/s (sent=2.424 MB, received=0 B) 1.703 MB/s (sent=4.127 MB, received=0 B) 1.977 MB/s (sent=6.104 MB, received=0 B) 2.220 MB/s (sent=8.324 MB, received=0 B) 2.472 MB/s (sent=10.797 MB, received=0 B) 2.926 MB/s (sent=13.723 MB, received=0 B) 3.394 MB/s (sent=17.117 MB, received=0 B) 3.854 MB/s (sent=20.971 MB, received=0 B) 4.309 MB/s (sent=25.280 MB, received=0 B) [TERMINATED]
Here the data rates are also wrong. Sorry for this.
Server side:
CONNECTED POLL (received=149689, sent=0) ACKED POLL (received=289602, sent=5) ERR ERR ERR ERR POLL (received=523048, sent=5) POLL (received=763451, sent=5) POLL (received=996124, sent=5) POLL (received=1243484, sent=5) POLL (received=1486979, sent=5) POLL (received=1727382, sent=5) POLL (received=1913675, sent=5) POLL (received=2051269, sent=5) ERR ERR ERR ERR POLL (received=2147894, sent=5) POLL (received=2296310, sent=5) POLL (received=2402211, sent=5) POLL (received=2552173, sent=5) POLL (received=2798760, sent=5) POLL (received=3046893, sent=5) POLL (received=3294253, sent=5) POLL (received=3541613, sent=5) ERR ERR ERR ERR POLL (received=3790519, sent=5) POLL (received=4033241, sent=5) POLL (received=4279055, sent=5) POLL (received=4521004, sent=5) POLL (received=4523323, sent=5) POLL (received=4524869, sent=5) POLL (received=4526415, sent=5) × 4 POLL (received=4529507, sent=5) × 13 POLL (received=4531053, sent=5) × 25 POLL (received=4531826, sent=5) POLL (received=4532599, sent=5) POLL (received=4532599, sent=5) × 2 ...
I shortened the output of the server and replaced multiple occurrences of the same line with " × <occurrences>". You can also see here some lines which say "ERR". That is the forth problem I have. It seems that the server sometimes receives wrong characters but normally it should not be possible to send wrong packages over TCP/IP. If a package was wrong the client should send them again.
In summary there are 4 issues:
- I get two times the CLOSED message (uip_closed()).
- I do not receive all data which have been sent from the client.
- When there were sent a lot of data uip refuses to received after a while.
- Sometimes there were received wrong characters.