This is a static, read-only archive of Wireshark Q&A. Older questions and answers from October 2017 and earlier can be found at osqa-ask.wireshark.org.
0

Cause Of Server Hello Delay

asked Nov 24 '17

I've been trying to pin down the cause of some of my web servers being occasionally slow to respond. This problem seems to occur infrequently at first but then starts to happen more often for several days before going away again. They are Windows servers running an Apache 2.4.27 reverse proxy with a Tomcat (7 or 8) based web server behind them (various Atlassian products, one on each server). Using Wireshark I've managed to track down that there's a delay in the Server Hello being sent back from the server to the client, but I don't know what is causing this delay. I've setup a script to use cURL to request a page every minute to help with the diagnosis.

237 2017/297 07:57:30.571296    10.0.0.6    123.223.100.1   TLSv1.2 571 Client Hello
244 2017/297 07:57:30.796302    10.0.0.6    123.223.100.1   TCP 571 [TCP Retransmission] 56426 → 443 [PSH, ACK] Seq=1 Ack=1 Win=66560 Len=517
245 2017/297 07:57:30.814021    123.223.100.1   10.0.0.6    TCP 66  443 → 56426 [ACK] Seq=1 Ack=518 Win=132096 Len=0 SLE=1 SRE=518
389 2017/297 07:57:41.044311    123.223.100.1   10.0.0.6    TLSv1.2 1506    Server Hello
…
398 2017/297 07:57:41.086327    10.0.0.6    123.223.100.1   TLSv1.2 173 Application Data

Server Trace

64  2017-10-24 07:57:30.574615  212.159.78.240  123.223.100.1   TLSv1.2 571 Client Hello
72  2017-10-24 07:57:30.799403  212.159.78.240  123.223.100.1   TCP 571 [TCP Retransmission] 56426 → 443 [PSH, ACK] Seq=1 Ack=1 Win=66560 Len=517
73  2017-10-24 07:57:30.799441  123.223.100.1   212.159.78.240  TCP 66  443 → 56426 [ACK] Seq=1 Ack=518 Win=132096 Len=0 SLE=1 SRE=518
274 2017-10-24 07:57:41.028342  123.223.100.1   212.159.78.240  TLSv1.2 2958    Server Hello
…
295 2017-10-24 07:57:41.089469  212.159.78.240  123.223.100.1   TLSv1.2 173 Application Data

How can I track down what is causing the delay in the Server Hello message? Is this caused by Apache not responding for this delay or is it something else?

Using strace along with cURL on an Ubuntu client I can see the following extra lines that correspond with the delay, but I've no idea what they mean. Can anyone help with these as well?

19807 18:23:43.514170 poll([{fd=3, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 0) = 0 (Timeout)
19807 18:23:43.514371 rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7ff57b636150}, NULL, 8) = 0
19807 18:23:43.514449 poll([{fd=3, events=POLLIN}], 1, 0) = 0 (Timeout)
19807 18:23:43.514502 rt_sigaction(SIGPIPE, NULL, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7ff57b636150}, 8) = 0
19807 18:23:43.514550 rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7ff57b636150}, NULL, 8) = 0
19807 18:23:43.514596 poll([{fd=3, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 0) = 0 (Timeout)
19807 18:23:43.514642 rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7ff57b636150}, NULL, 8) = 0
19807 18:23:43.514688 poll([{fd=3, events=POLLIN}], 1, 1000) = 0 (Timeout)
19807 18:23:44.515978 rt_sigaction(SIGPIPE, NULL, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7ff57b636150}, 8) = 0
19807 18:23:44.516264 rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7ff57b636150}, NULL, 8) = 0
19807 18:23:44.516522 poll([{fd=3, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 0) = 0 (Timeout)
19807 18:23:44.516825 rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7ff57b636150}, NULL, 8) = 0
19807 18:23:44.516946 poll([{fd=3, events=POLLIN}], 1, 1000) = 0 (Timeout)
19807 18:23:45.518250 rt_sigaction(SIGPIPE, NULL, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7ff57b636150}, 8) = 0
19807 18:23:45.518524 rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7ff57b636150}, NULL, 8) = 0
19807 18:23:45.518780 poll([{fd=3, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 0) = 0 (Timeout)
19807 18:23:45.519008 rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7ff57b636150}, NULL, 8) = 0
19807 18:23:45.519112 poll([{fd=3, events=POLLIN}], 1, 1000) = 0 (Timeout)
19807 18:23:46.520385 rt_sigaction(SIGPIPE, NULL, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7ff57b636150}, 8) = 0

Comments

Not really a Wireshark question. As usual, at the application level Wireshark can tell you what happened but not why.

User 98587 ( Nov 24 '17 )

Thanks for the response, sorry yeah I guess it's not the best place to post this. Maybe some other Wireshark users had come across this though.

User 2001 ( Nov 24 '17 )

1 Answer

0

answered Nov 27 '17

There are some things you can do, including using Wireshark to dig a bit further - you've done a good job being able to measure the delay so that's a great start. Get a good understanding the moving parts of the system. I imagine it will be something like this:

client PC ---> Reverse Proxy ---> TomCat ---> Database
                              \
                                ------------> Authentication

Using the above as an example (please check your topology though), trace the TCP flows between the Reverse Proxy and TomCat, TomCat to the Database and the Reverse Proxy to the Authentication solution. You can do this using tcpdump on the loopback adapter.

Run the loopback traces at the same time as the traces you were already collecting. Capture some examples of the problem. Start with your external trace to establish a time frame for the problem. So using your trace above as an example, establish the time frame as being from 07:57:30.799403 to 07:57:41.028342 - adjust for time sync difference between your external trace device and the Ubuntu clock. Now look in that time frame for similar delays in the TCP flows you have collected from the loopback adapter.

You can get a blow-by-blow explanation of multi-tier analysis like this in the Network Trace Analysis Guide you'll find here - https://community.tribelab.com/course...

Best regards...Paul

Comments

Hi Paul Thanks for the reply, that's really useful. I'll have a dig around and see what else I can find.

User 2001 ( Nov 27 '17 )

I've been doing some more analysis of this issue again (as it reared it's ugly head once more) and there's some strange data between the client hello and server hello. In Wireshark on the server side I see a lot of [ACK] and [PSH, ACK] messages supposedly sent back and forth between the client and the server. However the Wireshark trace from the client shows none of this. How can this be? Is there something wrong with my Wireshark setup on the client that could miss this, or is something else going on?

An example of the trace on the server is shown below, and the pattern continues until Server Hello is sent.

1388    2017/339 21:54:52.134583    10.0.0.6    123.223.100.1   TLSv1.2 583 Client Hello
1390    2017/339 21:54:52.192195    123.223.100.1   10.0.0.6    TCP 66  443  >  57964 [ACK] Seq=1 Ack=518 Win=132352 Len=0 TSval=3072330 TSecr=3869925647
1391    2017/339 21:54:52.329721    123.223.100.1   10.0.0.6    TCP 171 3389  >  60562 [PSH, ACK] Seq=87950 Ack=37273 Win=63702 Len=117
1392    2017/339 21:54:52.383557    10.0.0.6    123.223.100.1   TCP 60  60562  >  3389 [ACK] Seq=37273 Ack=88067 Win=255 Len=0
1393    2017/339 21:54:52.843804    123.223.100.1   10.0.0.6    TCP 171 3389  >  60562 [PSH, ACK] Seq=88067 Ack=37273 Win=63702 Len=117
1394    2017/339 21:54:52.858582    10.0.0.6    123.223.100.1   TCP 203 60562  >  3389 [PSH, ACK] Seq=37273 Ack=88184 Win=255 Len=149
1395    2017/339 21:54:52.869197    123.223.100.1   10.0.0.6    TCP 54  3389  >  60562 [ACK] Seq=88184 Ack=37422 Win=63553 Len=0
1397    2017/339 21:54:53.389326    123.223.100.1   10.0.0.6    TCP 171 3389  >  60562 [PSH, ACK] Seq=88184 Ack=37422 Win=63553 Len=117
1398    2017/339 21:54:53.443987    10.0.0.6    123.223.100.1   TCP 60  60562  >  3389 [ACK] Seq=37422 Ack=88301 Win=254 Len=0
1399    2017/339 21:54:53.903923    123.223.100.1   10.0.0.6    TCP 171 3389  >  60562 [PSH, ACK] Seq=88301 Ack=37422 Win=63553 Len=117
1400    2017/339 21:54:53.918689    10.0.0.6    123.223.100.1   TCP 203 60562  >  3389 [PSH, ACK] Seq=37422 Ack=88418 Win=254 Len=149
1401    2017/339 21:54:53.928363    123.223.100.1   10.0.0.6    TCP 54  3389  >  60562 [ACK] Seq=88418 Ack=37571 Win=63404 Len=0
User 2001 ( Dec 07 '17 )

I installed npcap on the server and traced the loopback adapter as well. I don't see anything obvious, just a lot of traffic to the database, which seems continuous throughout anyway. I did see some strange TCP data on the server side which wasn't seen in the client trace as I've mentioned in my answer on this post.

User 2001 ( Dec 07 '17 )
cc-by-sa Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.