-
Notifications
You must be signed in to change notification settings - Fork 19
/
index.html
109 lines (102 loc) · 4.85 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<!--
Copyright (c) 2021 Daniil Baturin and others
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Visual packet size calculator</title>
<link rel="stylesheet" href="main.css">
<link rel="icon" type="image/png" href="images/encapcalc192.png">
<link rel="manifest" href="manifest.json">
<script src="encapcalc.js"> </script>
</head>
<body>
<div class="wrapper">
<div class="content">
<h1>Visual packet size calculator</h1>
<div class="protocol-form">
<div id="protocol-list">
<!-- Generated content here -->
</div>
</div>
</div>
<details>
<summary>Options</summary>
<div class="box-wrapper">
<form name="ifaceoptions">
<span id="mtu-desc">Parent interface MTU: </span> <input type="text" value="1500" id="parent-mtu" />
<br />
<span>Calculation mode:</spam>
<br />
<input id="mode-pdu" name="mode" type="radio" value="sub" checked="checked"> Encapsulated protocol MTU (subtract overhead from the parent interface MTU)
<br />
<input id="mode-frame-size" name="mode" type="radio" value="add"> Frame size (add overhead to payload size)
</form>
</div>
</details>
<div class="box-wrapper">
<strong>Header size (overhead):</strong> <span id="overhead"></span>
<br />
<span id="result-desc"><strong>MTU:</strong></span> <span id="tunnel-mtu"></span>
</div>
<div id="share" class="box-wrapper">
<form>
<label for="sharing-link">Share this calculation:</label>
<input type="text" id="sharing-link">
<input type="button" value="Copy" id="copy-sharing-link">
</form>
</div>
<div class="box-wrapper">
<div id="protocols">
<span>Protocols:</span>
<!-- Generated content here -->
</div>
</div>
<div class="notes">
<h3>Notes</h3>
<p>
Knowing the encapsulation overhead of your protocol stack is important for configuring VPN tunnels.
You need to set the tunnel interface <abbr title="Maximum Transmission Unit">MTU</abbr> correctly, to avoid excessive packet fragmentation.
</p>
<p>
This tool allows you to easily see what each protocol adds to your packet. Click protocol buttons to add protocols to the stack.
Some protocols have additional options, e.g. if you click Ethernet, you will see VLAN and QinQ header option checkboxes.
</p>
<p>
You can click the same protocol button more than once, e.g. for the IPIP encapsulation you just click the IPv4 button twice.
</p>
<p>Examples:</p>
<ul>
<li> <a href="?protocols=IPv4,GRE,IPv6,TCP">TCP <abbr title="Maximum Segment Size">MSS</abbr> for IPv6 in GRE over IPv4</a></li>
<li> <a href="?protocols=IPv4,UDP,L2TPv3,Ethernet,Ethernet-VLAN,IPv4">MTU for IPv4 in an Ethernet VLAN over L2TPv3 over UDP.</a></li>
</ul>
<p>
Header sizes for VXLAN, LISP, and WireGuard include UDP, and STT includes TCP, because these protocols never use any other L4 protocol.
Everything else is pure header size, without any outer or inner protocols, e.g. “MPLS” is the size of a single MPLS label
(4 bytes).
</p>
</div>
<div class="copyright">
© <a href="https://www.baturin.org">Daniil Baturin</a> and contributors, 2013-2021.<br><br>
<a href="https://mit-license.org/"> <img height="31" src="images/mit-license.svg" alt="MIT license"> </a>
<a href="https://github.com/dmbaturin/encapcalc"> <img height="31" src="images/github.png" alt="GitHub"> </a>
</div>
</div>
</body>
</html>