Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[testing] Enhancement: Two new tests for pop #1445

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions network_simulator/input/tcp/pop/pop-reordering.pkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Test for a packet received out of order.

// Accept a connection.
+.0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 500
+.0 bind(500, ..., ...) = 0
+.0 listen(500, 1) = 0
+.2 accept(500, ..., ...) = 0

// Receive SYN packet.
+.2 TCP < S seq 0(0) win 65535 <mss 1450,wscale 0>
// Send SYN-ACK packet.
+.0 TCP > S. seq 0(0) ack 1 win 65535 <mss 1450,wscale 0>
// Receive ACK on SYN-ACK packet.
+.2 TCP < . seq 1(0) ack 1 win 65535 <nop>

// Succeed to accept connection.
+.0 wait(500, ...) = 0

// Read data.
+.1 read(501, ..., 1000) = 1000

// Receive out of order data packet.
+.1 TCP < P. seq 1001(1000) ack 1 win 65535 <nop>

// Send ACK packet.
+.0 TCP > . seq 1(0) ack 1 win 65535 <nop>

// Receive in order data packet.
+.1 TCP < P. seq 1(1000) ack 1 win 65535 <nop>

// Data read.
+.0 wait(501, ...) = 0

// Send ACK packet
+.6 TCP > . seq 1(0) ack 2001 win 63535 <nop>

// Read data.
+.1 read(501, ..., 1000) = 1000

// Data read.
+.0 wait(501, ...) = 0
33 changes: 33 additions & 0 deletions network_simulator/input/tcp/pop/pop-retransmission.pkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Test for blocking pop with duplicate packet.

// Accept a connection.
+.0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 500
+.0 bind(500, ..., ...) = 0
+.0 listen(500, 1) = 0
+.2 accept(500, ..., ...) = 0

// Receive SYN packet.
+.2 TCP < S seq 0(0) win 65535 <mss 1450,wscale 0>
// Send SYN-ACK packet.
+.0 TCP > S. seq 0(0) ack 1 win 65535 <mss 1450,wscale 0>
// Receive ACK on SYN-ACK packet.
+.2 TCP < . seq 1(0) ack 1 win 65535 <nop>

// Succeed to accept connection.
+.0 wait(500, ...) = 0

// Read data.
+.1 read(501, ..., 1000) = 1000

// Receive data packet.
+.1 TCP < P. seq 1(1000) ack 1 win 65535 <nop>

// Data read.
+.0 wait(501, ...) = 0

// Receive data packet again.
+.1 TCP < P. seq 1(1000) ack 1 win 65535 <nop>

// Send ACK packet.
+.0 TCP > . seq 1(0) ack 1001 win 65535 <nop>