Bugzilla – Bug 2953
Application packet Rx size larger than Tx size
Last modified: 2018-07-15 17:38:34 UTC
Overview: The packet size created by BulkSendApplication is 512 bytes. But when received by PacketSink, the packet size is 536 bytes. Steps to reproduce: 1. Modify bulk-send-application.cc to output packet size upon generating packet. In BulkSendApplication::SendData, add the line 'std::cout<<"Tx size: "<< packet->GetSize() << "\n";' after creating packet. 2. Modify packet-sink.cc to output packet size upon receive. In PacketSink::HandleRead, add the line 'std::cout<<"Rx size : "<< packet->GetSize() << "\n";' after receiving packet. 3. Run lena-dual-stripe example located in src/lte/examples with the following settings: simTime = 10s epc = true epcDl = true epcUl = false Actual Results: Packet size for Tx is 512 bytes and for Rx is 536 bytes Expected Results: Same packet size in Tx and Rx
One more setting to configure. useUdp = false
Created attachment 3139 [details] Lena-dual-stripe for reproduction
Created attachment 3140 [details] BulkSendApplication for reproduction
Created attachment 3141 [details] PacketSink for reproduction
It's normal. TCP does not preserve the packet boundaries, because it's a stream-oriented protocol (unlike UDP). The TCP packet size is fixed by the TCP Segment Size. You can change it in TcpSocket's Attribute named SegmentSize: .AddAttribute ("SegmentSize", "TCP maximum segment size in bytes (may be adjusted based on MTU discovery)", UintegerValue (536), MakeUintegerAccessor (&TcpSocket::GetSegSize, &TcpSocket::SetSegSize), MakeUintegerChecker<uint32_t> ())