signetlabdei / quic-ns-3

QUIC implementation for ns-3
GNU General Public License v2.0
44 stars 17 forks source link

Duplicate transport parameters reception error #48

Open duncanmcl opened 6 days ago

duncanmcl commented 6 days ago

In the Quic code base at https://github.com/signetlabdei/quic, there is a problem causing "Duplicate transport parameters reception" error and stopping the connection.

I tested Quic on 5G NR network. It has a slotted physical layer, so it is possible that some packets arrive to a cell phone at the same time in the same slot. In the initial handshake of Quic, a client first sends and Initial packet. With the current default settings, the server replies with "Version Negotiation" and "Handshake" packets. In a 5G network, these to packets may arrive to the client at the same time. When they arrive to the client at the same time, the client is trying to send its replies "initial" and "handshake" frames together. However, the total size is larger than MTU, so they are divided into two packets. This causes the server to run function QuicSocketBase::OnReceivedTransportParameters, twice. However, running it twice gives the error "Duplicate transport parameters reception" and stops the connection.

I fixed the problem by adding the following code after the "else if (quicHeader.IsHandshake () and m_socketState == CONNECTING_SVR)" in quic-socket-base.cc . There may be a better way to fix it.

if(m_couldContainTransportParameters){
          if (IsVersionSupported (quicHeader.GetVersion ()))
                  {
                  m_couldContainTransportParameters = false;
                    SendInitialHandshake (QuicHeader::HANDSHAKE, quicHeader, p);
                  }
                else
                  {
                    unsupportedVersion = true;
                    SendInitialHandshake (QuicHeader::VERSION_NEGOTIATION, quicHeader,
                                          p);
                  }
      }

Below is the netanim log of a simulation that failed with "Duplicate transport parameters reception" error. As it is a NR simulation, the packet arrival and depature times are a bit different than real simulation, so it is not possible to see that "Version Negotiation" and "Handshake" packets arriving the client at the same time.


<p fId="0" fbTx="0.415028563" lbTx="0.415029596" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 0 protocol 17 offset (bytes) 0 flags [none] length: 1289 10.0.0.5 &gt; 10.0.0.6) ns3::UdpHeader (length: 1269 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=1253, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 0 protocol 17 offset (bytes) 0 flags [none] length: 1249 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 1229 49153 &gt; 50000) ns3::QuicHeader (|1|Initial|
|ConnectionID 3843182036917871616|
|Version 0|
PacketNumber 1|
|) ns3::QuicSubHeader (|STREAM010|
|Stream Id 0|
|Length 1200|
) ns3::QuicTransportParameters ([initial_max_stream_data 4294967295|
|initial_max_data 4294967295|
|initial_max_stream_id_bidi 1|
|idleTimeout 300|
|omit_connection 0|
|max_packet_size 1460|
|ack_delay_exponent 3|
|initial_max_stream_id_uni 1]
) Payload (size=1178)" tId="4" fbRx="0.415028563" lbRx="0.415029596" />
<p fId="4" fbTx="0.415029596" lbTx="0.415030629" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 1 protocol 17 offset (bytes) 0 flags [none] length: 1289 14.0.0.6 &gt; 14.0.0.5) ns3::UdpHeader (length: 1269 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=1253, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 0 protocol 17 offset (bytes) 0 flags [none] length: 1249 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 1229 49153 &gt; 50000) ns3::QuicHeader (|1|Initial|
|ConnectionID 3843182036917871616|
|Version 0|
PacketNumber 1|
|) ns3::QuicSubHeader (|STREAM010|
|Stream Id 0|
|Length 1200|
) ns3::QuicTransportParameters ([initial_max_stream_data 4294967295|
|initial_max_data 4294967295|
|initial_max_stream_id_bidi 1|
|idleTimeout 300|
|omit_connection 0|
|max_packet_size 1460|
|ack_delay_exponent 3|
|initial_max_stream_id_uni 1]
) Payload (size=1178)" tId="3" fbRx="0.415029596" lbRx="0.415030629" />
<p fId="3" fbTx="0.415030629" lbTx="0.415030729" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 63 id 0 protocol 17 offset (bytes) 0 flags [none] length: 1249 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 1229 49153 &gt; 50000) ns3::QuicHeader (|1|Initial|
|ConnectionID 3843182036917871616|
|Version 0|
PacketNumber 1|
|) ns3::QuicSubHeader (|STREAM010|
|Stream Id 0|
|Length 1200|
) ns3::QuicTransportParameters ([initial_max_stream_data 4294967295|
|initial_max_data 4294967295|
|initial_max_stream_id_bidi 1|
|idleTimeout 300|
|omit_connection 0|
|max_packet_size 1460|
|ack_delay_exponent 3|
|initial_max_stream_id_uni 1]
) Payload (size=1178)" tId="6" fbRx="0.425030629" lbRx="0.425030729" />
<p fId="6" fbTx="0.425030729" lbTx="0.425030734" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 0 protocol 17 offset (bytes) 0 flags [none] length: 57 1.0.0.2 &gt; 7.0.0.2) ns3::UdpHeader (length: 37 49153 &gt; 49153) ns3::QuicHeader (|1|Version Negotiation|
|ConnectionID 3843182036917871616|
|Version 0|
PacketNumber 0|
|) Payload (size=12)" tId="3" fbRx="0.435030729" lbRx="0.435030734" />
<p fId="6" fbTx="0.425030734" lbTx="0.425030738" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 1 protocol 17 offset (bytes) 0 flags [none] length: 50 1.0.0.2 &gt; 7.0.0.2) ns3::UdpHeader (length: 30 49153 &gt; 49153) ns3::QuicHeader (|1|Handshake|
|ConnectionID 3843182036917871616|
|Version 0|
PacketNumber 1|
|) ns3::QuicSubHeader (|MAX_DATA|
|Maximum Data 2098352|
)" tId="3" fbRx="0.435030734" lbRx="0.435030738" />
<p fId="3" fbTx="0.435030734" lbTx="0.435030813" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 1 protocol 17 offset (bytes) 0 flags [none] length: 97 14.0.0.5 &gt; 14.0.0.6) ns3::UdpHeader (length: 77 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=61, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 63 id 0 protocol 17 offset (bytes) 0 flags [none] length: 57 1.0.0.2 &gt; 7.0.0.2) ns3::UdpHeader (length: 37 49153 &gt; 49153) ns3::QuicHeader (|1|Version Negotiation|
|ConnectionID 3843182036917871616|
|Version 0|
PacketNumber 0|
|) Payload (size=12)" tId="4" fbRx="0.435030734" lbRx="0.435030813" />
<p fId="3" fbTx="0.435030813" lbTx="0.435030887" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 2 protocol 17 offset (bytes) 0 flags [none] length: 90 14.0.0.5 &gt; 14.0.0.6) ns3::UdpHeader (length: 70 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=54, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 63 id 1 protocol 17 offset (bytes) 0 flags [none] length: 50 1.0.0.2 &gt; 7.0.0.2) ns3::UdpHeader (length: 30 49153 &gt; 49153) ns3::QuicHeader (|1|Handshake|
|ConnectionID 3843182036917871616|
|Version 0|
PacketNumber 1|
|) ns3::QuicSubHeader (|MAX_DATA|
|Maximum Data 2098352|
)" tId="4" fbRx="0.435030813" lbRx="0.435030887" />
<p fId="4" fbTx="0.435030813" lbTx="0.435030892" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 0 protocol 17 offset (bytes) 0 flags [none] length: 97 10.0.0.6 &gt; 10.0.0.5) ns3::UdpHeader (length: 77 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=61, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 63 id 0 protocol 17 offset (bytes) 0 flags [none] length: 57 1.0.0.2 &gt; 7.0.0.2) ns3::UdpHeader (length: 37 49153 &gt; 49153) ns3::QuicHeader (|1|Version Negotiation|
|ConnectionID 3843182036917871616|
|Version 0|
PacketNumber 0|
|) Payload (size=12)" tId="0" fbRx="0.435030813" lbRx="0.435030892" />
<p fId="4" fbTx="0.435030892" lbTx="0.435030966" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 1 protocol 17 offset (bytes) 0 flags [none] length: 90 10.0.0.6 &gt; 10.0.0.5) ns3::UdpHeader (length: 70 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=54, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 63 id 1 protocol 17 offset (bytes) 0 flags [none] length: 50 1.0.0.2 &gt; 7.0.0.2) ns3::UdpHeader (length: 30 49153 &gt; 49153) ns3::QuicHeader (|1|Handshake|
|ConnectionID 3843182036917871616|
|Version 0|
PacketNumber 1|
|) ns3::QuicSubHeader (|MAX_DATA|
|Maximum Data 2098352|
)" tId="0" fbRx="0.435030892" lbRx="0.435030966" />
<p fId="0" fbTx="0.453028563" lbTx="0.453029805" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 1 protocol 17 offset (bytes) 0 flags [none] length: 1551 10.0.0.5 &gt; 10.0.0.6) ns3::UdpHeader (length: 1531 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=1515, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 1 protocol 17 offset (bytes) 0 flags [none] length: 1511 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 1491 49153 &gt; 50000) ns3::QuicHeader (|1|Handshake|
|ConnectionID 3843182036917871616|
|Version 4059165169|
PacketNumber 2|
|) ns3::QuicSubHeader (|STREAM110|
|Stream Id 0|
|Offset 1200|
|Length 1460|
) ns3::QuicTransportParameters ([initial_max_stream_data 4294967295|
|initial_max_data 4294967295|
|initial_max_stream_id_bidi 1|
|idleTimeout 300|
|omit_connection 0|
|max_packet_size 1460|
|ack_delay_exponent 3|
|initial_max_stream_id_uni 1]
) Payload (size=1178) Payload Fragment [0:260]" tId="4" fbRx="0.453028563" lbRx="0.453029805" />
<p fId="4" fbTx="0.453029805" lbTx="0.453031047" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 2 protocol 17 offset (bytes) 0 flags [none] length: 1551 14.0.0.6 &gt; 14.0.0.5) ns3::UdpHeader (length: 1531 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=1515, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 1 protocol 17 offset (bytes) 0 flags [none] length: 1511 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 1491 49153 &gt; 50000) ns3::QuicHeader (|1|Handshake|
|ConnectionID 3843182036917871616|
|Version 4059165169|
PacketNumber 2|
|) ns3::QuicSubHeader (|STREAM110|
|Stream Id 0|
|Offset 1200|
|Length 1460|
) ns3::QuicTransportParameters ([initial_max_stream_data 4294967295|
|initial_max_data 4294967295|
|initial_max_stream_id_bidi 1|
|idleTimeout 300|
|omit_connection 0|
|max_packet_size 1460|
|ack_delay_exponent 3|
|initial_max_stream_id_uni 1]
) Payload (size=1178) Payload Fragment [0:260]" tId="3" fbRx="0.453029805" lbRx="0.453031047" />
<p fId="3" fbTx="0.453031047" lbTx="0.453031168" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 63 id 1 protocol 17 offset (bytes) 0 flags [none] length: 1511 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 1491 49153 &gt; 50000) ns3::QuicHeader (|1|Handshake|
|ConnectionID 3843182036917871616|
|Version 4059165169|
PacketNumber 2|
|) ns3::QuicSubHeader (|STREAM110|
|Stream Id 0|
|Offset 1200|
|Length 1460|
) ns3::QuicTransportParameters ([initial_max_stream_data 4294967295|
|initial_max_data 4294967295|
|initial_max_stream_id_bidi 1|
|idleTimeout 300|
|omit_connection 0|
|max_packet_size 1460|
|ack_delay_exponent 3|
|initial_max_stream_id_uni 1]
) Payload (size=1178) Payload Fragment [0:260]" tId="6" fbRx="0.463031047" lbRx="0.463031168" />
<p fId="0" fbTx="0.454028563" lbTx="0.454029384" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 2 protocol 17 offset (bytes) 0 flags [none] length: 1024 10.0.0.5 &gt; 10.0.0.6) ns3::UdpHeader (length: 1004 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=988, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 2 protocol 17 offset (bytes) 0 flags [none] length: 984 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 964 49153 &gt; 50000) ns3::QuicHeader (|0|1|0|1|0|1 Octet|
|ConnectionID 3843182036917871616|
|PacketNumber 3|
) ns3::QuicSubHeader (|STREAM110|
|Stream Id 0|
|Offset 2660|
|Length 940|
) Payload Fragment [260:1200]" tId="4" fbRx="0.454028563" lbRx="0.454029384" />
<p fId="0" fbTx="0.454029384" lbTx="0.454030616" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 3 protocol 17 offset (bytes) 0 flags [none] length: 1538 10.0.0.5 &gt; 10.0.0.6) ns3::UdpHeader (length: 1518 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=1502, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 3 protocol 17 offset (bytes) 0 flags [none] length: 1498 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 1478 49153 &gt; 50000) ns3::QuicHeader (|0|1|0|1|0|1 Octet|
|ConnectionID 3843182036917871616|
|PacketNumber 4|
) ns3::QuicSubHeader (|STREAM010|
|Stream Id 1|
|Length 1456|
) Payload (size=1400) Payload Fragment [0:56]" tId="4" fbRx="0.454029384" lbRx="0.454030616" />
<p fId="4" fbTx="0.454029384" lbTx="0.454030205" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 3 protocol 17 offset (bytes) 0 flags [none] length: 1024 14.0.0.6 &gt; 14.0.0.5) ns3::UdpHeader (length: 1004 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=988, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 2 protocol 17 offset (bytes) 0 flags [none] length: 984 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 964 49153 &gt; 50000) ns3::QuicHeader (|0|1|0|1|0|1 Octet|
|ConnectionID 3843182036917871616|
|PacketNumber 3|
) ns3::QuicSubHeader (|STREAM110|
|Stream Id 0|
|Offset 2660|
|Length 940|
) Payload Fragment [260:1200]" tId="3" fbRx="0.454029384" lbRx="0.454030205" />
<p fId="3" fbTx="0.454030205" lbTx="0.454030284" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 63 id 2 protocol 17 offset (bytes) 0 flags [none] length: 984 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 964 49153 &gt; 50000) ns3::QuicHeader (|0|1|0|1|0|1 Octet|
|ConnectionID 3843182036917871616|
|PacketNumber 3|
) ns3::QuicSubHeader (|STREAM110|
|Stream Id 0|
|Offset 2660|
|Length 940|
) Payload Fragment [260:1200]" tId="6" fbRx="0.464030205" lbRx="0.464030284" />
<p fId="4" fbTx="0.454030616" lbTx="0.454031848" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 4 protocol 17 offset (bytes) 0 flags [none] length: 1538 14.0.0.6 &gt; 14.0.0.5) ns3::UdpHeader (length: 1518 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=1502, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 3 protocol 17 offset (bytes) 0 flags [none] length: 1498 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 1478 49153 &gt; 50000) ns3::QuicHeader (|0|1|0|1|0|1 Octet|
|ConnectionID 3843182036917871616|
|PacketNumber 4|
) ns3::QuicSubHeader (|STREAM010|
|Stream Id 1|
|Length 1456|
) Payload (size=1400) Payload Fragment [0:56]" tId="3" fbRx="0.454030616" lbRx="0.454031848" />
<p fId="3" fbTx="0.454031848" lbTx="0.454031968" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 63 id 3 protocol 17 offset (bytes) 0 flags [none] length: 1498 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 1478 49153 &gt; 50000) ns3::QuicHeader (|0|1|0|1|0|1 Octet|
|ConnectionID 3843182036917871616|
|PacketNumber 4|
) ns3::QuicSubHeader (|STREAM010|
|Stream Id 1|
|Length 1456|
) Payload (size=1400) Payload Fragment [0:56]" tId="6" fbRx="0.464031848" lbRx="0.464031968" />
<p fId="0" fbTx="0.455028563" lbTx="0.455029795" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 4 protocol 17 offset (bytes) 0 flags [none] length: 1538 10.0.0.5 &gt; 10.0.0.6) ns3::UdpHeader (length: 1518 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=1502, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 4 protocol 17 offset (bytes) 0 flags [none] length: 1498 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 1478 49153 &gt; 50000) ns3::QuicHeader (|0|1|0|1|0|1 Octet|
|ConnectionID 3843182036917871616|
|PacketNumber 5|
) ns3::QuicSubHeader (|STREAM110|
|Stream Id 1|
|Offset 1456|
|Length 4|
) Payload Fragment [56:60] ns3::QuicSubHeader (|STREAM110|
|Stream Id 1|
|Offset 1460|
|Length 1445|
) Payload Fragment [60:1400] Payload Fragment [0:105]" tId="4" fbRx="0.455028563" lbRx="0.455029795" />
<p fId="4" fbTx="0.455029795" lbTx="0.455031027" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 5 protocol 17 offset (bytes) 0 flags [none] length: 1538 14.0.0.6 &gt; 14.0.0.5) ns3::UdpHeader (length: 1518 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=1502, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 4 protocol 17 offset (bytes) 0 flags [none] length: 1498 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 1478 49153 &gt; 50000) ns3::QuicHeader (|0|1|0|1|0|1 Octet|
|ConnectionID 3843182036917871616|
|PacketNumber 5|
) ns3::QuicSubHeader (|STREAM110|
|Stream Id 1|
|Offset 1456|
|Length 4|
) Payload Fragment [56:60] ns3::QuicSubHeader (|STREAM110|
|Stream Id 1|
|Offset 1460|
|Length 1445|
) Payload Fragment [60:1400] Payload Fragment [0:105]" tId="3" fbRx="0.455029795" lbRx="0.455031027" />
<p fId="3" fbTx="0.455031027" lbTx="0.455031147" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 63 id 4 protocol 17 offset (bytes) 0 flags [none] length: 1498 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 1478 49153 &gt; 50000) ns3::QuicHeader (|0|1|0|1|0|1 Octet|
|ConnectionID 3843182036917871616|
|PacketNumber 5|
) ns3::QuicSubHeader (|STREAM110|
|Stream Id 1|
|Offset 1456|
|Length 4|
) Payload Fragment [56:60] ns3::QuicSubHeader (|STREAM110|
|Stream Id 1|
|Offset 1460|
|Length 1445|
) Payload Fragment [60:1400] Payload Fragment [0:105]" tId="6" fbRx="0.465031027" lbRx="0.465031147" />
<p fId="0" fbTx="0.459028563" lbTx="0.459029805" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 5 protocol 17 offset (bytes) 0 flags [none] length: 1551 10.0.0.5 &gt; 10.0.0.6) ns3::UdpHeader (length: 1531 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=1515, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 5 protocol 17 offset (bytes) 0 flags [none] length: 1511 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 1491 49153 &gt; 50000) ns3::QuicHeader (|0|1|0|1|0|1 Octet|
|ConnectionID 3843182036917871616|
|PacketNumber 6|
) ns3::QuicSubHeader (|STREAM110|
|Stream Id 1|
|Offset 2905|
|Length 15|
) Payload Fragment [105:120] ns3::QuicSubHeader (|STREAM110|
|Stream Id 1|
|Offset 2920|
|Length 1434|
) Payload Fragment [120:1400] Payload Fragment [0:154] ns3::QuicSubHeader (|MAX_DATA|
|Maximum Data 4194304|
) ns3::QuicSubHeader (|ACK|
|Largest Acknowledged 1|
|Ack Delay 448314|
|Ack Block Count 0|
|First Ack Block 1|
)" tId="4" fbRx="0.459028563" lbRx="0.459029805" />
<p fId="4" fbTx="0.459029805" lbTx="0.459031047" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 6 protocol 17 offset (bytes) 0 flags [none] length: 1551 14.0.0.6 &gt; 14.0.0.5) ns3::UdpHeader (length: 1531 2152 &gt; 2152) ns3::GtpuHeader ( version=1 [ PT  S  PN ], messageType=255, length=1515, teid=1, sequenceNumber=0, nPduNumber=0, nextExtensionType=0) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 5 protocol 17 offset (bytes) 0 flags [none] length: 1511 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 1491 49153 &gt; 50000) ns3::QuicHeader (|0|1|0|1|0|1 Octet|
|ConnectionID 3843182036917871616|
|PacketNumber 6|
) ns3::QuicSubHeader (|STREAM110|
|Stream Id 1|
|Offset 2905|
|Length 15|
) Payload Fragment [105:120] ns3::QuicSubHeader (|STREAM110|
|Stream Id 1|
|Offset 2920|
|Length 1434|
) Payload Fragment [120:1400] Payload Fragment [0:154] ns3::QuicSubHeader (|MAX_DATA|
|Maximum Data 4194304|
) ns3::QuicSubHeader (|ACK|
|Largest Acknowledged 1|
|Ack Delay 448314|
|Ack Block Count 0|
|First Ack Block 1|
)" tId="3" fbRx="0.459029805" lbRx="0.459031047" />
<p fId="3" fbTx="0.459031047" lbTx="0.459031168" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 63 id 5 protocol 17 offset (bytes) 0 flags [none] length: 1511 7.0.0.2 &gt; 1.0.0.2) ns3::UdpHeader (length: 1491 49153 &gt; 50000) ns3::QuicHeader (|0|1|0|1|0|1 Octet|
|ConnectionID 3843182036917871616|
|PacketNumber 6|
) ns3::QuicSubHeader (|STREAM110|
|Stream Id 1|
|Offset 2905|
|Length 15|
) Payload Fragment [105:120] ns3::QuicSubHeader (|STREAM110|
|Stream Id 1|
|Offset 2920|
|Length 1434|
) Payload Fragment [120:1400] Payload Fragment [0:154] ns3::QuicSubHeader (|MAX_DATA|
|Maximum Data 4194304|
) ns3::QuicSubHeader (|ACK|
|Largest Acknowledged 1|
|Ack Delay 448314|
|Ack Block Count 0|
|First Ack Block 1|
)" tId="6" fbRx="0.469031047" lbRx="0.469031168" />
<p fId="6" fbTx="0.464030284" lbTx="0.464030291" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 2 protocol 17 offset (bytes) 0 flags [none] length: 82 1.0.0.2 &gt; 7.0.0.2) ns3::UdpHeader (length: 62 49153 &gt; 49153) ns3::QuicHeader (|0|1|0|1|0|1 Octet|
|ConnectionID 3843182036917871616|
|PacketNumber 1|
) ns3::QuicSubHeader (|CONNECTION_CLOSE|
|Application Error Code TRANSPORT_PARAMETER_ERROR|
|Reason Phrase Length 40|
|Reason Phrase Duplicate transport parameters reception|
)" tId="3" fbRx="0.474030284" lbRx="0.474030291" />

After adding the new code the last packet in the log becomes:

<p fId="6" fbTx="0.46303117" lbTx="0.46303127" meta-info="ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 2 protocol 17 offset (bytes) 0 flags [none] length: 1242 1.0.0.2 &gt; 7.0.0.2) ns3::UdpHeader (length: 1222 49153 &gt; 49153) ns3::QuicHeader (|0|1|0|1|0|1 Octet|
|ConnectionID 3843182036917871616|
|PacketNumber 2|
) ns3::QuicSubHeader (|STREAM010|
|Stream Id 0|
|Length 1200|
) ns3::QuicTransportParameters ([initial_max_stream_data 4294967295|
|initial_max_data 4294967295|
|initial_max_stream_id_bidi 1|
|idleTimeout 300|
|omit_connection 0|
|max_packet_size 1460|
|ack_delay_exponent 3|
|initial_max_stream_id_uni 1]
) Payload (size=1178)" tId="3" fbRx="0.47303117" lbRx="0.47303127" />