UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor transamdan
Visitor
193 Views
Registered: ‎12-11-2017

LWIP with fragmented packets.

Hi, I'm writing some code on the Zynq which interfaces with a server. I have the same code on a PC. They both connect to the server, sign in, get work and process it. These packets are only 500 bytes or less up to this point. So I'm very happy with all that, no faults.

The submitting of completed work is around 2800 bytes. The PC works gets accepted, but going the same in the Zynq I get no response. Perhaps my completed work is incorrect, however I have checked this so much, and believe it to be correct. So I have been looking for any differences in the packets, and capturing with wire-shark.

Capturing the Packets from the PC shown below. Sends the 2832 bytes over two packets. The two packets are sent close together, and get an ACK back.

Submit_Capture_PC.png

Now on the Zynq, things are slightly different. Its sending 2830 bytes, this is correct as my username is 2 characters less. Although the packet is split at 1500 instead of 1514, the total bytes of the two packets is correct. Look at the gap between the two packets though, 2 seconds, in that time there has been a response from the server. 

Zynq_Capture_PC.png

Trying to find differences, I noticed that in the header packets of the PC, the flag for Do Not Fragment is set. 

Capture_PC_Fragment_Flag.png

This is not set on the packets from Zynq. I dont know if this is having an effect, but would like to try setting this flag. Is it possible in the LWIP? I have tried looking in the config of the core, and the ip_frag is set by default.

LWIP_IP_options.png

My base code came from the TCP_Client, sending using the following

u8_t apiflags = TCP_WRITE_FLAG_COPY | TCP_WRITE_FLAG_MORE;

err = tcp_write(c_pcb, submit_string_to_send, 2830, apiflags);

There seems to be a few differences in the first screen shots of the packets, the PC's second part of the packet had the 'PUSH' flag set, this dosn't happen in the Zynq. This may not be an issue. All I know is the processed work gets no text response when sent from the zynq, so there must be a difference somewhere effecting this, so I'm trying to make it perform like the PC version. 

Can someone steer me in the right direction of where and what config settings to try? 

Many Thanks

Dan.

0 Kudos
3 Replies
Visitor transamdan
Visitor
177 Views
Registered: ‎12-11-2017

Re: LWIP with fragmented packets.

Spotted an issue in the code, where its going off to do something else for a couple of seconds before it recalls,
xemacif_input(netif);
I should make it check to see if there is nothing awaiting to be send before moving on to something else.
This may be the main route of the issue. I'll give it a go tonight.
0 Kudos
Visitor transamdan
Visitor
157 Views
Registered: ‎12-11-2017

Re: LWIP with fragmented packets.

Okay made the code more basic, sending the 2830 packets every few seconds. Looking at it in Wireshark. Connected on 1 Gb Ethernet to a local machine. There is a gap of 41ms between the two parts of the fragmented packet. Is this normal? 

Time to send 1500 bytes at 1Gb would be around 0.015ms. So would only contribute to less than 1 ms of that 41ms. 

I'll do some more digging. 

0 Kudos
Visitor transamdan
Visitor
70 Views
Registered: ‎12-11-2017

Re: LWIP with fragmented packets.

Okay all sorted now., Using this line of code

tcp_nagle_disable(tpcb);

I now have no delay between the packets. :)

 

0 Kudos