# Network overhead calculation

If we do a bandwith test with iperf (or similar tool), it is important to interpret the result the correct way. Therefore we need do know, how much overhead Ethernet and other involved protocolls generate. After, we can calculate the maximum expeceted bandwith.

The simple view from Cisco CCNA to ethernet is, that Layer 2 has a maximum of 1518 bytes. But it is also important, to consider the layer 1 overheads. Cisco do not respect the IPG.

![](https://2073268332-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LoBycfPnpD0cWdOAZMk%2F-MbxWHTS8sOk1VR1EiwS%2F-MbxWXXV3TrFi6D1v7lS%2Fimage.png?alt=media\&token=b3d84051-1f4c-4cba-9e50-a7826a07e24b)

Accorting wikipedia, the Preamble, SFD and the IPG (Interpacket gap) count 20 Bytes. So this is also important to consider in the overhead calculation. So nomally we have a maximum of 1538 Bytes. With the optional vlan tag there are 1542 Bytes.

![](https://2073268332-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LoBycfPnpD0cWdOAZMk%2F-MbxWHTS8sOk1VR1EiwS%2F-MbxWa2LO-ROdgrZ6NxF%2Fimage.png?alt=media\&token=40585f48-b74c-41aa-a923-951203ffbff2)

Now, we can calculate, how much overhead we have until upper protocolls, which build on Layer 4.

Example: TCP (/UPD) over IPv4 over Ethernet (without header options):

* L1 overhead - preamble, IPG: 8+12 = 20
* L2 overhead - Ethernet header, FCS = 18
* L3 overhead - IPv4 header = 20
* L4 overhead - TCP header = 20
* (L4 overhead - UDP header = 8)

TCP: 1538 Bytes - 78 Bytes = 1460 Bytes\
1460/1538\*100= 94.93% efficiency ---> 5.07% overhead

UDP: 1538 Bytes - 66 Bytes = 1472 Bytes\
1472/1538\*100= 95.77% efficiency ---> 4.23% overhead


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ocsaf.nsec.ch/network-overhead-calculation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
