0

I have adapted example PHP TCP listener (multi-client version, posted by javier in user contributed notes below main article, with my small fixes) to listen on port 7777 for any TCP packets / connections.

I've run this listener on my home server, via SSH, and in second SSH session I have run tcpdump to listen on the same port, to verfiy, if my PHP listener is working fine.

Listener is written so, it echoes everything, it receives, back to client and prints it out on the console.

Whenever I contact my home server, with my browser, both my listener and tcpdump are showing captured traffic, so I assume that everything is set and is working fine. But, when I try to contact the very same server on the same port from my another device (a GPS localizer) only tcpdump shows, that it has captured anything, but my PHP listener remains deaf -- does not displays anything to the console (so I assume, that it also does not sends anything back to localizer -- though I can't verify this -- because, it is unable to capture any traffic from it).

As I have been told (thanks to helpful guys from SuperUser), TCP transmission from both webbrowser and GPS localizer seems to be valid TCP packet and everything in network layer seems to be fine, therefore it looks like, the problem is somewhere in PHP listener itself.

So, I'm asking, if anybody sees anything, that I missed here?

Community
  • 1
  • 1
trejder
  • 17,148
  • 27
  • 124
  • 216
  • Do you have a firewall that could be blocking packets from the GPS localizer? – Barmar Sep 17 '12 at 06:39
  • No. And if I would have, wouldn't be also blocking TCP transmission from a webbrowser or any other kind of TCP packets? The problem must be lying somewhere else. Maybe GPS localizer is sending some garbage, not a well-formed data? I don't know. – trejder Sep 17 '12 at 17:41
  • Not if the web browser and GPS localizer have different IP addresses, and the firewall only allowed the web browser's IP. If you use Wireshark, does it report any problems with the packets from the GPS localizer? – Barmar Sep 17 '12 at 22:06
  • Have you read my question througly? :] I did mention, that I used `tcpdump` (very similar to `wireshark`) and it reports incomming TCP traffic from both localizer and webbrowser. So, I'm pretty sure that packets from both sources reaches machine, where I have listener (and `tcpdump`) running. But only traffic from webbrowser is catched by PHP listener. It remains deaf for any packets from localizer. – trejder Sep 18 '12 at 07:58
  • I know you used tcpdump, but Wireshark performs additional analysis that makes it easier to see some errors. For instance, it will report if there's a gap in the TCP sequence numbers. – Barmar Sep 18 '12 at 16:54
  • Ah, I see. Unfortunatelly I'm not able to run Wireshark, as my server (actually NAS) is to limited to run such software. – trejder Sep 18 '12 at 19:20
  • Can you use the -w option to tcpdump to put the captures in a file, and then transfer that file to a machine that can run wireshark? – Barmar Sep 18 '12 at 21:43
  • Well... I try to do this. In the mean time, you can (if you wish) [take a look](http://superuser.com/questions/474029/tcp-packets-not-captured-by-php-listener) at what this localizer is actually sending. A short example is directly in SuperUser's question. And there is also a [pastebin example](http://pastebin.com/Wjs6p846) with full data, that I receive per each session from it. – trejder Sep 20 '12 at 05:09

0 Answers0