## A200 Address Resolution and Neighbor Discovery (Theorie)
Das RFC 826 definiert das Address Resolution Protocol (ARP). In RFC 4861 wird das Neighbor Discovery Protocol (NDP) spezifiziert. RFC 826 定义了地址解析协议(ARP)。RFC 4861 规定了邻居发现协议(NDP)。
1.**Wozu wird ARP eingesetzt? Was ist der Unterschied zu NDP?****ARP 的用途是什么?它与 NDP 的区别是什么?**
My answer: ARP is used to convert the IPv4 Address to Hardware address, i.e. MAC address.
NDP is used in IPv6 protocol
While ARP works by broadcasting requests, NDP uses ICMPv6 messages and **multicast** addresses to achieve more efficient neighbor discovery.
2.**Beschreiben Sie den Aufbau einer ARP-PDU und erläutern Sie die Bedeutung der einzelnen Felder!****描述 ARP-PDU 的结构并解释各个字段的含义!**
Hardware type 2
protocol type 2
hardware size 1
protocol size 1
op code 2
src_ip: 4
src_hw: 6
dst_ip: 4
dst_hw: 6(ff)
3.**Welche unterschiedlichen ARP-PDUs gibt es? Welche NDP-PDUs gibt es?****有哪些不同的 ARP-PDU?NDP-PDU 又有哪些?**
reply and request
NA NS RS rA
4.**Wie lang (in Bytes) ist eine ARP-PDU in einem Netz in dem IPv4 und Ethernet eingesetzt werden?****在 IPv4 和以太网网络中,ARP-PDU 的长度是多少字节?** 28
5.**Wie lang (in Bytes) ist eine Neighbor Solicitation Nachricht?****Neighbor Solicitation 消息的长度是多少字节?**
6.**Das RFC 826 spricht von einer Tabelle (table), deren Implementierung meist als ARP-Cache bezeichnet wird. Was soll laut RFC mit einer Ethernet-SDU passieren, wenn kein Eintrag zur Ziel-IP-Adresse in der Tabelle gefunden wird?****RFC 826 提到了一张表(table),其实现通常称为 ARP 缓存。RFC 规定如果表中没有找到目标 IP 地址的条目,对以太网 SDU 应该怎么处理?**
First, the host broadcast the ARP request packet to every neighbor in the network.
If the host receives the ARP reply packet, add the entry to both sides.
else drop the packet.
### A300 Fragmentierung und IP-Tunneling (Theorie)
i) In wie viele Fragmente wird ein IP-Paket mit Größe 9000 Byte zerlegt, um über ein Ethernet mit MTU = 1500 Byte übertragen zu werden? Geben Sie eine vollständige Rechnung an! 一个大小为 9000 字节的 IP 包在 Ethernet 的 MTU 为 1500 字节的情况下会被分成多少个片段?请提供完整的计算过程!
ii) Nennen Sie drei Gründe dafür, dass Netzbetreiber IP-Fragmentierung in ihren Netzen verbieten. Erläutern Sie diese Gründe! 请列举网络运营商在其网络中禁止 IP 分片的三个原因,并对这些原因进行解释!**Three Reasons Why Network Operators Prohibit IP Fragmentation and Their Explanations**
IP fragmentation occurs when a packet exceeds the Maximum Transmission Unit (MTU) of a network link and must be broken into smaller fragments. Many **network operators prohibit IP fragmentation** due to the following reasons:
- Fragmentation increases the number of packets that must be processed, leading to **higher CPU and memory usage** in routers and firewalls.
- Each fragment requires additional headers, increasing **network overhead** and reducing effective data transmission efficiency.
- Reassembly at the destination requires buffer space, which can cause delays and resource exhaustion in high-throughput environments.
**2. Security Risks & Susceptibility to Attacks**
- Fragmentation makes networks vulnerable to **fragmentation-based attacks**, such as **overlapping fragments (Teardrop attack)** and **tiny fragment attacks** used to evade security filters.
- Intrusion Detection Systems (IDS) and firewalls may struggle to inspect fragmented packets, allowing attackers to **bypass security policies** and smuggle malicious payloads.
- Attackers can send fragmented packets with missing fragments, causing **DoS (Denial of Service)** by exhausting resources on the target system waiting for reassembly.
**3. Complications in Path MTU Discovery (PMTUD) & Packet Loss Issues**
- Many modern networks use **Path MTU Discovery (PMTUD)** to dynamically determine the optimal packet size. If fragmentation is allowed, incorrect PMTUD settings can result in persistent retransmissions.
- If a single fragment of a fragmented packet is lost, the entire packet must be retransmitted, leading to **higher packet loss rates** and inefficiencies.
- Some middleboxes (e.g., NAT devices, firewalls) drop fragmented packets, causing unpredictable failures in communication.
### **Conclusion:**
Because of these issues, **network operators often prohibit IP fragmentation and instead rely on techniques like MSS (Maximum Segment Size) adjustment and PMTUD** to ensure efficient packet transmission without fragmentation.
------
**网络运营商在其网络中禁止 IP 分片的三个原因及其解释**
IP 分片(IP Fragmentation)发生在数据包超过网络链路的 **最大传输单元(MTU)** 时,需要拆分成多个小片进行传输。许多**网络运营商禁止 IP 分片**的原因如下:
iii) Wie wird in modernen TCP/IP-Implementierungen dafür gesorgt, dass Fragmentierung in der Regel nicht erforderlich ist? 在现代的 TCP/IP 实现中,是如何确保通常情况下不需要分片的?
### **How Do Modern TCP/IP Implementations Avoid the Need for Fragmentation?**
Modern TCP/IP implementations use several techniques to **minimize or eliminate IP fragmentation**, ensuring efficient packet transmission. The key mechanisms include:
#### **1. Path MTU Discovery (PMTUD)**
- **PMTUD dynamically determines the maximum packet size** that can be transmitted without fragmentation.
- It works by sending packets with the **Don't Fragment (DF) flag** set. If a router cannot forward the packet due to MTU limitations, it drops the packet and sends an **ICMP "Fragmentation Needed" message** back to the sender.
- The sender then **reduces the packet size** accordingly until it finds a suitable MTU.
- **Drawback:** Some networks block ICMP messages, causing PMTUD to fail.
#### **2. TCP Maximum Segment Size (MSS) Adjustment**
- During the **TCP handshake**, both communicating hosts negotiate the **Maximum Segment Size (MSS)**, which defines the largest payload a TCP segment can carry.
- The MSS is set to ensure that the TCP segment, when combined with headers, does not exceed the MTU.
- This prevents the need for IP fragmentation at the transport layer.
#### **3. IPv6 Enforces No Fragmentation by Routers**
- Unlike IPv4, **IPv6 does not allow routers to fragment packets**. Instead, **only the sender can fragment** based on the discovered MTU.
- IPv6 requires **end-to-end PMTUD**, ensuring that packets fit within the smallest MTU along the path.
- This shifts the responsibility of fragmentation from routers to the sender, improving network efficiency.
#### **4. Datagram Packetization Layer Path MTU Discovery (DPLPMTUD)**
- To address ICMP blocking issues in traditional PMTUD, **DPLPMTUD** uses **probe packets** of increasing sizes to discover the optimal MTU.
- This method is more reliable since it does not rely on ICMP messages.
- Supported in protocols like **QUIC and modern TCP implementations**.
### **Conclusion:**
Modern TCP/IP implementations avoid fragmentation by:
1.**Using PMTUD** to dynamically adjust packet sizes.
2.**Negotiating MSS** in TCP to prevent oversized packets.
3.**Relying on IPv6's no-fragmentation rule** and sender-side control.
4.**Using DPLPMTUD** as an advanced method for MTU discovery.
------
### **在现代的 TCP/IP 实现中,是如何确保通常情况下不需要分片的?**
现代 TCP/IP 实现采用多个技术来**减少或避免 IP 分片**,从而提高数据传输效率。主要方法包括:
#### **1. 路径 MTU 发现(PMTUD)**
- **PMTUD 负责动态确定数据包的最大可传输大小**,以避免分片。
- 它通过发送 **“不分片(DF)”标志** 的数据包来测试路径 MTU。
- 如果路由器无法转发该数据包(因为 MTU 限制),它会丢弃数据包并返回 **ICMP “需要分片”** 消息。
i) Erklären Sie anhand eines Beispiels auf einer Ihrer VMs wie link-local Adressen aus der MAC-Adresse abgeleitet werden! 请结合您虚拟机中的一个示例,解释链路本地地址是如何从 MAC 地址派生的!
1. Split the MAC address into two halves:
-`08:00:27:53:8a:e0` → `08:00:27` and `53:8a:e0`
2. Insert `FF:FE` in the middle:
-`08:00:27:FF:FE:53:8a:e0`
3. Invert the 7th bit (Universal/Local bit) of the first byte (08):
- Convert `08` to binary: `00001000`
- Flip the **7th bit**: `00001010` (which is `0A` in hex)
- New identifier: **0A:00:27:FF:FE:53:8A:E0**
4.
5. ```
FE80::0A00:27FF:FE53:8AE0
```
ii) Wie implementiert IPv6 „Broadcasts”? IPv6 是如何实现“广播”的?
iii) Welches sind die privaten Adressbereiche in IPv6, analog zu 10.0.0.0/8, 172.16.0.0/12 und 192.168.0.0/16 in IPv4? IPv6 中的私有地址范围与 IPv4 中的 10.0.0.0/8、172.16.0.0/12 和 192.168.0.0/16 对应的是什么?
iv) Für besondere Zwecke, außer für den privaten Gebrauch, sind noch weitere Bereiche reserviert. Wie teilt sich der IPv6 Addressraum auf? Hinweis: IANA, ignorieren Sie die vom IETF reservierten Bereiche 除了私人用途外,还有其他特殊用途的地址范围被保留。IPv6 地址空间如何划分?提示:请参考 IANA,并忽略由 IETF 保留的范围。