From 77ccb79f75204a106ee69d83a8df51d65dba1fb9 Mon Sep 17 00:00:00 2001
From: Adrian Rosinec <adrian@ics.muni.cz>
Date: Fri, 2 Dec 2022 10:16:01 +0100
Subject: [PATCH 1/3] MTU details

---
 content/cloud/faq/index.md | 40 ++++++++++++++++++++++++++++++++++----
 1 file changed, 36 insertions(+), 4 deletions(-)

diff --git a/content/cloud/faq/index.md b/content/cloud/faq/index.md
index 89ee757..6b46c42 100644
--- a/content/cloud/faq/index.md
+++ b/content/cloud/faq/index.md
@@ -40,10 +40,42 @@ Furthermore, IP addresses allocated from *public-muni-147-251-124-GROUP* and *pu
 using only *public-cesnet-78-128-251-GROUP* and *private-muni-10-16-116* for group projects.
 Follow instructions at [changing the external network](/cloud/network) in order to change your public network.
 
-## Issues with network stability in Docker
-OpenStack instances use 1442 bytes MTU (maximum transmission unit) instead of standard 1500 bytes MTU. The instance itself can set up correct MTU with its counterpart via Path MTU Discovery. Docker needs MTU set up explicitly. Refer documentation for setting up
-1442 MTU in [Docker](https://docs.docker.com/v17.09/engine/userguide/networking/default_network/custom-docker0/) or
-[Kubernetes](https://docs.projectcalico.org/v3.5/usage/configuration/mtu).
+## Issues with network MTU (Docker, kubernetes, custom network overlays)
+OpenStack compute server instances should use 1442 bytes MTU (maximum transmission unit) instead of the standard 1500 bytes MTU. The instance itself can set up the correct MTU with its counterpart via Path MTU Discovery. Docker needs MTU set up explicitly. Refer documentation for setting up 1442 MTU in Docker or Kubernetes or change the configuration with the steps below:
+
+```sh
+# edit docker configuration
+sudo vi /etc/docker/daemon.json
+
+# MTU 1442 or lower
+{
+  "mtu": 1442
+}
+
+# then restart docker
+sudo systemctl restart docker
+```
+
+To detect end-to-end maximum packet size without packet fragmentation use following linux bash function.
+
+```sh
+# detect_mtu <host>
+#   measure end-to-end MTU
+function detect_mtu() {
+  local endpoint_host="$1"
+  
+  for i_mtu in `seq 1200 20 1500` `seq 1500 50 9000`; do
+    if ping -M do -s $(( $i_mtu - 28 )) -c 5 "${endpoint_host}" >/dev/null; then
+      echo "Packets of size ${i_mtu} work as expected"
+    else
+      echo "Packets of size ${i_mtu} are blocked by MTU limit on the path to destination host ${endpoint_host}!"
+      break
+    fi
+  done
+}
+# execute
+detect_mtu www.nic.cz
+```
 
 ## Issues with proxy in private networks
 OpenStack instances can either use public or private networks. If you are using a private network and you need to access the internet for updates etc.,
-- 
GitLab


From 496b3d3d10ce6631e76b34a6c626ce0c004aaed5 Mon Sep 17 00:00:00 2001
From: Adrian Rosinec <adrian@ics.muni.cz>
Date: Fri, 2 Dec 2022 10:32:27 +0100
Subject: [PATCH 2/3] Fix links

---
 content/cloud/faq/index.md | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/content/cloud/faq/index.md b/content/cloud/faq/index.md
index 6b46c42..260b4df 100644
--- a/content/cloud/faq/index.md
+++ b/content/cloud/faq/index.md
@@ -41,8 +41,9 @@ using only *public-cesnet-78-128-251-GROUP* and *private-muni-10-16-116* for gro
 Follow instructions at [changing the external network](/cloud/network) in order to change your public network.
 
 ## Issues with network MTU (Docker, kubernetes, custom network overlays)
-OpenStack compute server instances should use 1442 bytes MTU (maximum transmission unit) instead of the standard 1500 bytes MTU. The instance itself can set up the correct MTU with its counterpart via Path MTU Discovery. Docker needs MTU set up explicitly. Refer documentation for setting up 1442 MTU in Docker or Kubernetes or change the configuration with the steps below:
+OpenStack compute server instances should use 1442 bytes MTU (maximum transmission unit) instead of the standard 1500 bytes MTU. The instance itself can set up the correct MTU with its counterpart via Path MTU Discovery. Docker needs MTU set up explicitly. Refer documentation for setting up 1442 MTU in Docker or Kubernetes or change the configuration with the steps below.
 
+### Changes in Docker daemon
 ```sh
 # edit docker configuration
 sudo vi /etc/docker/daemon.json
@@ -56,7 +57,8 @@ sudo vi /etc/docker/daemon.json
 sudo systemctl restart docker
 ```
 
-To detect end-to-end maximum packet size without packet fragmentation use following linux bash function.
+### MTU detection
+You can use following bash function to detect end-to-end maximum packet size without packet fragmentation.
 
 ```sh
 # detect_mtu <host>
@@ -75,7 +77,9 @@ function detect_mtu() {
 }
 # execute
 detect_mtu www.nic.cz
-```
+```    
+
+More information about MTU in popular platforms like [MTU in Docker](https://docs.docker.com/v17.09/engine/userguide/networking/default_network/custom-docker0/) or [MTU in Kubernetes](https://docs.projectcalico.org/v3.5/usage/configuration/mtu).
 
 ## Issues with proxy in private networks
 OpenStack instances can either use public or private networks. If you are using a private network and you need to access the internet for updates etc.,
-- 
GitLab


From 2ab55a7b1b23cae1b4e55ae61798332e98fefb71 Mon Sep 17 00:00:00 2001
From: Adrian Rosinec <adrian@ics.muni.cz>
Date: Fri, 2 Dec 2022 11:23:54 +0100
Subject: [PATCH 3/3] Fix

---
 content/cloud/faq/index.md | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/content/cloud/faq/index.md b/content/cloud/faq/index.md
index 260b4df..c4a4053 100644
--- a/content/cloud/faq/index.md
+++ b/content/cloud/faq/index.md
@@ -41,7 +41,7 @@ using only *public-cesnet-78-128-251-GROUP* and *private-muni-10-16-116* for gro
 Follow instructions at [changing the external network](/cloud/network) in order to change your public network.
 
 ## Issues with network MTU (Docker, kubernetes, custom network overlays)
-OpenStack compute server instances should use 1442 bytes MTU (maximum transmission unit) instead of the standard 1500 bytes MTU. The instance itself can set up the correct MTU with its counterpart via Path MTU Discovery. Docker needs MTU set up explicitly. Refer documentation for setting up 1442 MTU in Docker or Kubernetes or change the configuration with the steps below.
+OpenStack compute server instances should use 1442 bytes MTU (maximum transmission unit) instead of the standard 1500 bytes MTU. The instance itself can set up the correct MTU with its counterpart via Path MTU Discovery. Docker needs MTU set up explicitly. Refer documentation for setting up 1442 MTU in [Docker](https://docs.docker.com/v17.09/engine/userguide/networking/default_network/custom-docker0/) or [Kubernetes](https://docs.projectcalico.org/v3.5/usage/configuration/mtu) or change the configuration with the steps below.
 
 ### Changes in Docker daemon
 ```sh
@@ -79,8 +79,6 @@ function detect_mtu() {
 detect_mtu www.nic.cz
 ```    
 
-More information about MTU in popular platforms like [MTU in Docker](https://docs.docker.com/v17.09/engine/userguide/networking/default_network/custom-docker0/) or [MTU in Kubernetes](https://docs.projectcalico.org/v3.5/usage/configuration/mtu).
-
 ## Issues with proxy in private networks
 OpenStack instances can either use public or private networks. If you are using a private network and you need to access the internet for updates etc.,
 you can use muni proxy server *proxy.ics.muni.cz*. This server only supports HTTP protocol, not HTTPS. To configure it you must also consider what applications
-- 
GitLab