relation between data rate and packet size distribution of packets sent by a tcp server

92 views
Skip to first unread message

lightw...@g2.nctu.edu.tw

unread,
Apr 23, 2014, 4:59:57 AM4/23/14
to ns-3-...@googlegroups.com
Hi,

Recently, I want to analyze packet size distribution of packets sent by a tcp server. I classify all packets into three ranges, 0~350, 351~900, and 900~1530 bytes. 

And I used OnOffHelper to build a tcp server, and used Config to set "ns3::TcpSocket::SegmentSize" to 1530.

When I set data rate of tcp server to 1Mb/s, all things went well. But when I set it to 100Mb/s, the number of range 0~350 became very high, even higher than the number of range 900~1530.

After, I used tcpdump to see the traffic, and I found that there were a lot of packets with 48 bytes.

Is there any reason about this in this situation? Cuz I really do not understand what caused it.

Plz help me.

Tommaso Pecorella

unread,
Apr 23, 2014, 3:04:30 PM4/23/14
to ns-3-...@googlegroups.com
Hi,

stupid question... are you sure that the small packets aren't the ACKs ?

If they aren't, then it would be useful to have the script showing the problem.

Cheers,

T.

吳書淮

unread,
Apr 23, 2014, 11:04:18 PM4/23/14
to ns-3-...@googlegroups.com
Hi,

I just solved this problem. I found that there were two extra small packets after each big packet.

Every time the server send a 1502 bytes packet, it send two small packet immediately. 

So I took a look into those big packets, and I found out that the "more fragment" flag was set, and in the small packets, the offset field is relative to the big packet's packet size.

At the moment, I thought it might be caused by the segment size I set to the tcp server, so I adjusted it to a smaller number. 

And the simulation were correct!

I think the problem is  I set the segment size too big that server can not send it in one packet. Am I correct?

Anyway, thank you for your reply. :)


--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/BGoGb2GzBPs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Tommaso Pecorella

unread,
Apr 24, 2014, 1:52:08 AM4/24/14
to ns-3-...@googlegroups.com
Hi,

the analysis is correct. The TCP Segment Size should be not greater than the Path MTU (minus the headers sizes). Otherwise TCP will send a packet and it will be immediately fragmented.

HOWEVER the amount of small packets seems to be incorrect. There should be at most one small packet per big one.
I'd really like to see the pcaps.

Cheers,
T

吳書淮

unread,
Apr 29, 2014, 1:31:36 AM4/29/14
to ns-3-...@googlegroups.com
Hi.

First of all, sorry for replying so late.

The attachment  is the pcap file I got after the operation of simulation. 

You could check packets with ip source 10.1.3.6​​.

If you know the reason why the server sent two more packets every time, plz let me know.

Thanks.

Joshua

Tommaso Pecorella

unread,
Apr 29, 2014, 2:48:28 AM4/29/14
to ns-3-...@googlegroups.com
Hi,

it seems that there's something strange, indeed. Packets are fragmented, but the number of fragments is kinda...wrong.

Mind sending your script as well ?

Thanks,

T.

吳書淮

unread,
Apr 29, 2014, 3:35:09 AM4/29/14
to ns-3-...@googlegroups.com
Hi,

The link below is the question I just asked in ns-3-users, and the attachment is the code.


Just download it and change the "Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (1460));" to 1530.

And if you know the answer of my question, plz help me again. I'll be grateful :)

Joshua

Tommaso Pecorella

unread,
Apr 29, 2014, 5:32:20 PM4/29/14
to ns-3-...@googlegroups.com
Hi,

with a ns-3 release close to be posted, a possible bug scared the s**t out of me.
Luckily, it's not a bug :)

Double fragmentation, that's what it is. You have 3 network segments, each with a different MTU.

WiFi: 2296
p2p: 1500
csma: 1500

BUT you changed the csma MTU to be 1508.

As a consequence, a packet sent by a node attached to the csma, and larger than 1508 bytes, is fragmented in two segments by the sender IP layer.
Afterwards, it is fragmented (again) by the csma-p2p router, resulting into 3 fragments.

Summarizing... all normal.

Cheers,

T.
Reply all
Reply to author
Forward
0 new messages