From the receiving side, it looks as though the NetHub send on the TCP connection may occasionally do a single write to the TCP socket with a buffer containing multiple XIP packets.
The Dodo code has NOT set the TCP_NOPUSH bit (since everything is coming through with the push bit set), so the expected behavior would be a separate TCP packet for each write() or send().
It's not a bug, but it does mean that the receiving code needs to be a little more complicated to cope with it (as you implemented in maiko's ether_nethub.c)
Packet 3 below contains two XIP packets in response to packets 1 and 2, packets 4 and 5 got separate responses in 6 and 7.
1 0.000000 127.0.0.1 → 127.0.0.1 TCP 138 59935 → 3994 [PSH, ACK] Seq=1 Ack=1 Win=33792 Len=62 TSval=1901363668 TSecr=1900464294
2 0.013109 127.0.0.1 → 127.0.0.1 TCP 138 59935 → 3994 [PSH, ACK] Seq=63 Ack=1 Win=33792 Len=62 TSval=1901363669 TSecr=1900464294
3 0.183270 127.0.0.1 → 127.0.0.1 TCP 200 3994 → 59935 [PSH, ACK] Seq=127565 Ack=4294889683 Win=65440 Len=124 TSval=1901363686 TSecr=1900464294
4 15.184678 127.0.0.1 → 127.0.0.1 TCP 138 59935 → 3994 [PSH, ACK] Seq=125 Ack=1 Win=33792 Len=62 TSval=1901365186 TSecr=1900464294
5 15.184771 127.0.0.1 → 127.0.0.1 TCP 138 59935 → 3994 [PSH, ACK] Seq=187 Ack=1 Win=33792 Len=62 TSval=1901365186 TSecr=1900464294
6 15.311808 127.0.0.1 → 127.0.0.1 TCP 138 3994 → 59935 [PSH, ACK] Seq=127689 Ack=4294889683 Win=65440 Len=62 TSval=1901365199 TSecr=1900464294
7 15.321862 127.0.0.1 → 127.0.0.1 TCP 138 3994 → 59935 [PSH, ACK] Seq=127751 Ack=4294889683 Win=65440 Len=62 TSval=1901365200 TSecr=1900464294
From the receiving side, it looks as though the NetHub send on the TCP connection may occasionally do a single write to the TCP socket with a buffer containing multiple XIP packets.
The Dodo code has NOT set the TCP_NOPUSH bit (since everything is coming through with the push bit set), so the expected behavior would be a separate TCP packet for each
write()orsend().It's not a bug, but it does mean that the receiving code needs to be a little more complicated to cope with it (as you implemented in maiko's ether_nethub.c)
Packet 3 below contains two XIP packets in response to packets 1 and 2, packets 4 and 5 got separate responses in 6 and 7.