TCP out-of-order packet events

Another phenomenon that you will see in networks is previous segment loss and out-of-order segments. Both relate to packets arriving out of order, and in some cases indicate a problem.

When you see this on a network connection, it might happen due to network problems or an interruption in capture. In this recipe we will focus on this issue and what it can cause.

Getting ready

Start Wireshark and connect it on a mirrored port. The three phenomena that we want to focus on in this recipe are:

  • Previous segment lost: This occurs when a packet arrives with a sequence number higher than the next expected sequence number on that connection, indicating that one or more packets prior to the flagged packet did not arrive
  • Out-of-order packet: This occurs when a packet is seen with a sequence number lower than the previously received packet on that connection
  • Previous segment not captured (Wireshark Version 1.8.x and higher): This is like the previous segment lost

How to do it...

When will it happen?

You might see these in the following events:

  • At the beginning of capture: This event occurs when you start a capture during an open connection. In this case, you will see packets on a connection without the SYN/SYN-ACK/ACK, therefore, Wireshark thinks something went wrong.
  • Real packet losses: In this case you will also see retransmissions of the lost packets and/or duplicate ACKs telling the sender to send the lost packets.
    When will it happen?

    In the previous screenshot, we see a good example for severe packet losses. What we see here is that 10.0.0.6 is trying to browse website 62.90.90.210. During this, the TCP segments of 1420 bytes each are sent to the web server and we see that between packets 334 and 336 three packets are missing, and between packets 338 and 340 two packets are missing. In both cases, Wireshark notices: TCP's previous segment is not captured.

  • Delay variations: This can happen due to packets that take different routes from the source to destination. To check this use Tracert, and look for route changes between the source and destination (if it happens on the organization network) you can, for example, configure traps on the routers that will tell you when this happens.
  • Data capture problems: It can be that packets are sent and received properly, but Wireshark will not have captured them. It can be because of various reasons:
    • Because of very heavy traffic Wireshark might lose packets in high bit rates (over 150-180 Mbps). To avoid this problem, use other tools (mostly commercial).
    • In case your laptop is not strong enough, lack of memory or CPU power will not enable Wireshark to work fast enough. This is easy to find out, and you are probably aware of it.
    • When port buffers on a LAN switch are too small, packets can be dropped. Connect to the switch (as with console or telnet connection) and use the switch command line to check for the problem.
    • Capturing data on a wireless network, when for some reason you don't see all packets that are sent. See Chapter 7, Ethernet, LAN Switching, and Wireless LAN.

How it works...

In this case, things are simple. The TCP sender sends the packets to the receiver. These packets are numbered by their bytes. When a packet does not arrive in order, it is a problem that Wireshark notices. We can have two reasons for this:

  • A real problem: In this case you will see retransmissions and duplicate ACKs that are TCP's response to packets that are received out of order
  • A capture problem: In this case you will see only out-of-order packets, and since you don't see any response to the suspected lost and out-of-order packets, they probably are not
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.67.85