This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 670
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test for PMTU discovery and packet fragmentation
- Loading branch information
Showing
2 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#! /bin/bash | ||
|
||
. ./config.sh | ||
|
||
# 700 = Linux's minimum PMTU (552) + weave framing overheads | ||
# (currently about 60, but we leave some margin). That way the PMTUs | ||
# seen by containers is still >= 552. | ||
drop_large_udp_packets="FORWARD -p udp --destination-port 6783 -m length '!' --length 0:700 -j DROP" | ||
|
||
start_suite "PMTU discovery and packet fragmentation" | ||
|
||
run_on $HOST2 "sudo iptables -I $drop_large_udp_packets" | ||
|
||
weave_on $HOST1 launch | ||
weave_on $HOST2 launch $HOST1 | ||
|
||
start_container $HOST1 --name=c1 | ||
start_container $HOST2 --name=c2 | ||
|
||
sleep 30 # give weave time to discover the PMTU | ||
|
||
# Check large packets get through. The first attempt typically fails, | ||
# since the sending container hasn't discovered the PMTU yet. The 2nd | ||
# attempt should succeed. | ||
exec_on $HOST2 c2 $PING -s 10000 c1 2>&1 1>/dev/null || true | ||
assert_raises "exec_on $HOST2 c2 $PING -s 10000 c1" | ||
|
||
run_on $HOST2 "sudo iptables -D $drop_large_udp_packets" | ||
|
||
end_suite |