# TCP Maximum Segment Size Chain

This module contains the MSSChain flow analysis chain which can be used by PATHspider’s Observer for recording TCP Maximum Segment Size details.

class pathspider.chains.mss.MSSChain

  This flow analysis chain records details of the TCP Maximum Segment Size (MSS) option in the flow record. It will determine the length and value of the field if present in SYN packets.

  Field Name | Type | Meaning
  --- | --- | ---
  `mss_len_fwd` | int | Length of the MSS option field including kind and length in the forward direction.
  `mss_len_rev` | int | Length of the MSS option field including kind and length in the reverse direction.
  `mss_value_fwd` | int | Value of the MSS option field in the forward direction.
  `mss_value_rev` | int | Value of the MSS option field in the reverse direction.

  new_flow(rec, ip)

    For a new flow, all fields will be initialised to `None`.

    Parameters

      - rec (dict) – the flow record

      - ip (plt.ip or plt.ip6) – the IP or IPv6 packet that triggered the creation of a new flow record

    Returns

      Always `True`

    Return type

      bool

  tcp(rec, tcp, rev)

    Records TCP Maximum Segment Size Details.

    TCP Maximum Segment Size

      The TCP options will be parsed for the MSS option for all SYN packets. If the option is found, the length and value for the option will be recorded in the flow.

    Parameters

      - rec (dict) – the flow record

      - tcp – the TCP segment that was observed to be part of this flow

      - rev (bool) – True if the packet was in the reverse direction, False if in the forward direction

    Returns

      Always True

    Return type

      bool