1. 03 Jun, 2016 6 commits
    • Philip Withnall's avatar
      pseudotcp: Correct behaviour of buffer size methods when part-closed · 11d4bb97
      Philip Withnall authored
      Correct the behaviour of pseudo_tcp_socket_get_available_bytes() and
      pseudo_tcp_get_available_send_space() when the socket is not in
      TCP_ESTABLISHED state. It’s still permissible to send and receive up
      until the local side calls pseudo_tcp_socket_close(), which means we
      may be in state TCP_ESTABLISHED *or TCP_CLOSE_WAIT*.
      11d4bb97
    • Philip Withnall's avatar
      pseudotcp: Fix EOS checks in high packet loss situations · a9a149f5
      Philip Withnall authored
      The state tracking previously assumed that if a FIN packet was sent, the
      other side received it and the preceding packets, and hence it was
      correct to sent an RST if an unexpected packet (such as a delayed
      SYN-ACK) was received.
      
      In cases where there is high packet loss, this won’t work. For example,
      peer A sends a SYN, it is received and peer B replies with a SYN-ACK
      which is also received; then peer A sends its data and a FIN, which are
      both dropped. Since it hasn’t received anything since the original SYN,
      peer B resends its SYN-ACK. If that is received, peer A was incorrectly
      treating it as an erroneous packet, and would then send a RST. In actual
      fact, it should take this as a signal that the data and FIN packets were
      dropped, and should resend them.
      
      TODO: Add unit tests
      a9a149f5
    • Philip Withnall's avatar
      pseudotcp: Propagate error codes from transmit() to callers · 4dc2b5d9
      Philip Withnall authored
      Otherwise we can’t easily differentiate between different transmission
      failures; for example: underlying socket failures, versus retransmission
      timeouts.
      4dc2b5d9
    • Philip Withnall's avatar
    • Philip Withnall's avatar
      pseudotcp: Fix pseudo_tcp_socket_recv() in state TCP_CLOSE_WAIT · a72a93e5
      Philip Withnall authored
      Previously, pseudo_tcp_socket_recv() would start returning 0 (EOS) as
      soon as a FIN segment was received from the peer, even if there was
      unread data already in the receive buffer.
      
      Instead, the unread data should all be accessible before
      pseudo_tcp_socket_recv() starts returning 0.
      a72a93e5
    • Philip Withnall's avatar
      pseudotcp: Fix retransmission of segments before handling a FIN · 02699917
      Philip Withnall authored
      Previously, if peer A transmitted one or more data segments (1),
      followed by a FIN segment (2) to peer B, and segments 1 were
      dropped, peer B would not request retransmission of them and would
      instead continue with the FIN handshake. This effectively meant
      segments 1 were lost without peer B realising.
      
      Fix this by only handling the FIN segment once its sequence number is
      acknowledged in the receive window.
      02699917
  2. 02 Jun, 2016 4 commits
  3. 01 Jun, 2016 2 commits
  4. 31 May, 2016 3 commits
  5. 30 May, 2016 6 commits
  6. 27 May, 2016 9 commits
  7. 26 May, 2016 10 commits