https://confluence.atlassian.com/bbkb/troubleshooting-bitbucket-cloud-mtu-mss-issues-858778091.html

To protect your data, and ensure you can access Bitbucket Cloud consistently, we've added a distributed denial-of-service (DDoS) protection solution.

The solution sends clean traffic to Bitbucket Cloud via a tunnel which adds an extra 24 bytes to all packets. Because this is the case, the maximum packet size supported by the Bitbucket Cloud platform is 1476 bytes.

Our solution will not forward individual IP packets larger than 1476 bytes to Bitbucket Cloud. In some instances, a device on your path to Bitbucket Cloud may incorrectly adjust the MSS we advertise to a higher value than what we support. When this occurs, you may experience issues connecting to the platform over HTTPS and/or SSH.

How to determine the MSS value received by your computer when communicating with Bitbucket

For Linux or OSX users

  1. Start a packet capture by entering the command below in a terminal. It will display only the packets that come from Bitbucket Cloud and carry the MSS option we need to look at:

    sudo tcpdump -i `netstat -nr |grep -E '(^[dD]efault|^0\\.0\\.0\\.0)'|sed 's/.* //g'` -nn src net 104.192.143.0/24 and tcp[13]=18
    
  2. Attempt to connect to Bitbucket Cloud and reproduce the failure you're experiencing.

  3. Stop the capture by pressing 'ctrl-c'.

    1. If the result shows the "mss" as 1436, you're not affected by an MTU issue. The result will look similar to the following example:

      mybox:~ user1$ sudo tcpdump -i `netstat -nr |grep -E '(^[dD]efault|^0\\.0\\.0\\.0)'|sed 's/.* //g'` -nn src net 104.192.143.0/24 and tcp[13]=18
      Password:
      tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
      listening on en0, link-type EN10MB (Ethernet), capture size 262144 bytes
      10:14:55.460704 IP 104.192.143.2.443 > 172.22.57.225.56524: Flags [S.], seq 4152693889, ack 3904719392, win 28480, options [mss 1436,sackOK,TS val 301417943 ecr 797338616,nop,wscale 7], length 0
      10:14:55.465935 IP 104.192.143.2.443 > 172.22.57.225.56519: Flags [S.], seq 2774522829, ack 4278176036, win 28480, options [mss 1436,sackOK,TS val 301417944 ecr 797338616,nop,wscale 7], length 0
      
    2. If the result shows the 'mss' as a value higher than 1436, then a device on your path is adjusting the 'mss' incorrectly. The result will look similar to the following example:

      mybox:~ user1$ sudo tcpdump -i `netstat -nr |grep -E '(^[dD]efault|^0\\.0\\.0\\.0)'|sed 's/.* //g'` -nn src net 104.192.143.0/24 and tcp[13]=18
      Password:
      tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
      listening on en0, link-type EN10MB (Ethernet), capture size 262144 bytes
      07:30:07.446633 IP 104.192.143.2.22 > 192.168.0.103.40408: Flags [S.], seq 2581941579, ack 3766129149, win 28480, options [mss 1440,sackOK,TS val 202645932 ecr 3326411,nop,wscale 7], length 0
      

For Windows users

  1. Download and install Wireshark https://www.wireshark.org/#download (or use the portable app version if you prefer not to install it).

  2. Start the capture by double-clicking on the network connection used to connect to Bitbucket (most likely "Local Area Connection"):

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/eec9a05b-9831-46e9-a0db-fecaa5aef137/ScreenShot2016-11-03at9.10.44AM.png

    Try to connect to Bitbucket.

  3. Look for the MSS value in the captured packets:

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/0b8e0abc-c05a-4407-ad1e-a93b4610f7eb/ScreenShot2016-11-03at9.16.26AM.png

  4. f the result shows the "mss" as 1436 or lower, you're not affected by an MTU issue. If the result shows the 'mss' as a value higher than 1436, then a device on your path is adjusting the 'mss' incorrectly.

Solutions and workarounds

Root cause

It is very likely that the incorrect MSS adjustment is happening on the device connecting you to the internet, or by your ISP. To correct this talk to the team who manages your network, or your ISP. You'll need to tell them that a device on your internet connection is incorrectly adjusting the TCP MSS upwards to a value higher than 1436. To solve this they should either lower it to 1436 or switch to a different software/device that does not exhibit this behavior.

Workaround

Anything that will drop the MTU of your connection to 1476 or below should solve this. The simplest way is to adjust the MTU of your workstation to 1476 or lower. The following workarounds require admin rights to your operating system.