lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Pulling data from a server using HTTP with lwIP


From: Robert Wood
Subject: Re: [lwip-users] Pulling data from a server using HTTP with lwIP
Date: Thu, 13 Nov 2014 15:49:21 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

Hi Simon,

Sorry, I'm obviously still not explaining this clearly.

In ack_but_no_get.pcap I have compiled FreeRTOS so that I establish the connection and do not send out a GET. In that case, you are correct in that the ACK comes back.

I then recompile FreeRTOS so that I send out a GET immediately after setting up the connection between client and host. When I run *that* version of FreeRTOS, I get no_ack_but_get.pcap

*All* packets that go between client and server are in those Wireshark pcap files. The reason that some packets will be missing is that there will be other packets on the network that are filtered out because they are nothing to do with this particular client/server issue. I filtered with ip.addr==192.168.0.205 which is the address of the lwIP board.

What seems to be happening is that the GET request overwrites the outgoing ACK. I think I proved that by putting a vTaskDelay of three seconds after establishing the connection and sending out the GET. In that case, you get the full handshake and then the GET going out.

So,

No sending out of GET.

Client -> SYN (Server receives this)
Server -> SYN ACK (Client receives this)
Client -> ACK (Server receives this)

Recompile FreeRTOS, this time sending GET immediately after establishing connection:


Client -> SYN (Server receives this)
Server -> SYN ACK (Client receives this)
Client -> GET Command

ie that

Client -> ACK packet does not get sent out. The ONLY difference is that I compile in the line that sends out the GET command.

The issue of it being a *valid* GET command is, I am sure, a completely different matter.

I still think the big question is:

Why does outgoing GET overwrite outgoing ACK if I don't put a delay in. Also, how do I poll for some sort of feedback to know that ACK has gone out?

Cheers,

Rob

On 13/11/14 14:55, Simon Goldschmidt wrote:
Robert,
it would have *greatly* helped if you would have described which packets
are the ones in question. I'm assuming you mean packets 23-25
(ack_but_no_get) and 52-55 (no_ack_but_get)?
In that case, there's nothing wrong at all with lwIP in the
no_ack_but_get trace: the ACK you seem to be missing is included in
packet #54. However, you did not yet follow the suggestions to send a
valid HTTP request, so no wonder the server does not answer.
To sum it up, the TCP connection has been established correctly, but
there's no useful data sent on it.
Simon
*Gesendet:* Donnerstag, 13. November 2014 um 15:48 Uhr
*Von:* "Robert Wood" <address@hidden>
*An:* address@hidden
*Betreff:* Re: [lwip-users] Pulling data from a server using HTTP with lwIP
Sorry, I had assumed it was just a generic term for exporting packets. I
Googled pcap and hopefully these are the right thing.

On 13/11/14 14:29, Simon Goldschmidt wrote:
 > Text files?? Really?? Please send pcap files! I want to see the traffic
 > in wireshark, not in my text editor!
 > Simon
 > *Gesendet:* Donnerstag, 13. November 2014 um 15:04 Uhr
 > *Von:* "Robert Wood" <address@hidden>
 > *An:* address@hidden
 > *Betreff:* Re: [lwip-users] Pulling data from a server using HTTP
with lwIP
 > Hopefully these two text files get attached the the mailing list. If
 > not, I'll send them directly.
 >
 > One sends no GET command and the handshake works correctly.
 >
 > The other sends the GET command, but not the ACK.
 >
 > Hope that helps. :~)
 >
 > On 13/11/14 13:51, Simon Goldschmidt wrote:
 > > I don't think I really get what your problem is. Could you send a small
 > > pcap the packets in question?
 > > Simon
 > > *Gesendet:* Donnerstag, 13. November 2014 um 14:41 Uhr
 > > *Von:* "Robert Wood" <address@hidden>
 > > *An:* address@hidden
 > > *Betreff:* Re: [lwip-users] Pulling data from a server using HTTP
 > with lwIP
 > > Ah, no, I wasn't aware of that at all.
 > >
 > > I still don't know how I'd do that as, if left to its own devices, the
 > > stack sends the ACK out anyway and I have no idea how I'd tack that
data
 > > on to the ACK.
 > >
 > > It seems like the low level stuff does take care of that for you. Is it
 > > the case that I can poll something to wait for the stack to inform me
 > > that the ACK has gone out and I can send stuff or am I looking at
it the
 > > wrong way?
 > >
 > > Thanks,
 > >
 > > Rob
 > >
 > > On 13/11/14 13:31, Simon Goldschmidt wrote:
 > > > Robert,
 > > > are you aware that it's legal for the ACK you are missing to contain
 > > > data also? In this case the packets would look like this:
 > > > SYN ->
 > > > <- SYN/ACK
 > > > ACK+DATA(GET) ->
 > > > This is what I was trying to explain in my last mail...
 > > > Simon
 > > > *Gesendet:* Donnerstag, 13. November 2014 um 14:22 Uhr
 > > > *Von:* "Robert Wood" <address@hidden>
 > > > *An:* address@hidden
 > > > *Betreff:* Re: [lwip-users] Pulling data from a server using HTTP
 > > with lwIP
 > > > It's not quite like that, I'm not explaining very well. I'll try
 > > again. :~)
 > > >
 > > > If I send the GET command out, then my board does not send the ACK to
 > > > the server for the SYN, SYN ACK, ACK handshake. This is what happens.
 > > > Bear in mind the lwIP board is the client in this case.
 > > >
 > > > Here are two different In both cases I do this in the lwIP client
 > thread:
 > > >
 > > > IP4_ADDR(&local_ip,emacIPADDR0,emacIPADDR1,emacIPADDR2,emacIPADDR3);
 > > > rc1 = netconn_bind ( xNetConn, &local_ip, 0 );
 > > > IP4_ADDR(&remote_ip,192,168,0,87);
 > > > rc2 = netconn_connect ( xNetConn, &remote_ip, 80 );
 > > >
 > > > Scenario 1:
 > > >
 > > > In this case I do not send a GET request out.
 > > >
 > > > Client -> SYN (Server receives this)
 > > > Server -> SYN ACK (Client receives this)
 > > > Client -> ACK (Server receives this)
 > > >
 > > > Scenario 2:
 > > >
 > > > In this case I send the GET command out.
 > > >
 > > > Client -> SYN (Server receives this)
 > > > Server -> SYN ACK (Client receives this)
 > > > Client -> GET Command
 > > >
 > > > So, in scenario 2, the client is not sending out the ACK in the
initial
 > > > handshake. I'm assuming it's because I need to wait for the lwIP
stack
 > > > to send the ACK. I'm assuming anyway. If that is the case, how
does my
 > > > thread know when the stack has sent the ACK to the server and I am at
 > > > liberty to send the GET request?
 > > >
 > > > I hope I've made that clearer. :~)
 > > >
 > > > I'm probably doing naive things because I'm trying to learn a lot of
 > > > stuff at the moment!
 > > >
 > > > On 13/11/14 13:09, Simon Goldschmidt wrote:
 > > > > Robert Wood wrote:
 > > > >> If I establish a connection from the board to the desktop and
do not
 > > > >> send a GET request, then lwIP does the SYN, SYN ACK, ACK handshake
 > > just
 > > > >> fine.
 > > > >>
 > > > >> If I add the [potentially incorrect] GET request, the SYNN is
 > > sent, the
 > > > >> SYN ACK is received, but my board running lwIP does not send the
 > > ACK out
 > > > >> to the desktop.
 > > > >
 > > > > Does it piggy-back the ACK on your GET request or is the GET
request
 > > > not even sent out? I'd expect to see the GET request along with the
 > > > handshake-ACK.Then, the webserver will eventually time out
waiting for
 > > > the double-CRLF.
 > > > >
 > > > > However, if lwIP does not send ANYTHING after receiving the
SYN-ACK,
 > > > there's something wrong... :-/
 > > > >
 > > > > Simon
 > > > >
 > > > > _______________________________________________
 > > > > lwip-users mailing list
 > > > > address@hidden
 > > > > https://lists.nongnu.org/mailman/listinfo/lwip-users
 > > > >
 > > >
 > > > _______________________________________________
 > > > lwip-users mailing list
 > > > address@hidden
 > > > https://lists.nongnu.org/mailman/listinfo/lwip-users
 > > >
 > > >
 > > > _______________________________________________
 > > > lwip-users mailing list
 > > > address@hidden
 > > > https://lists.nongnu.org/mailman/listinfo/lwip-users
 > > >
 > >
 > > _______________________________________________
 > > lwip-users mailing list
 > > address@hidden
 > > https://lists.nongnu.org/mailman/listinfo/lwip-users
 > >
 > >
 > > _______________________________________________
 > > lwip-users mailing list
 > > address@hidden
 > > https://lists.nongnu.org/mailman/listinfo/lwip-users
 > >
 > _______________________________________________
 > lwip-users mailing list
 > address@hidden
 > https://lists.nongnu.org/mailman/listinfo/lwip-users
 >
 >
 > _______________________________________________
 > lwip-users mailing list
 > address@hidden
 > https://lists.nongnu.org/mailman/listinfo/lwip-users
 >
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users




reply via email to

[Prev in Thread] Current Thread [Next in Thread]