Problem in modified bulk-send-application

88 views
Skip to first unread message

Prakash

unread,
Feb 18, 2015, 4:46:36 AM2/18/15
to ns-3-...@googlegroups.com
Hello all

I have modified the bulk-send-application such that it takes an array of bytes as parameter and iterates over the array to send the packets of that many bytes. Now when I run the program, it works correctly for first few packets but after that it just sends packets of full MSS length. The MSS is set to 2000.

For example:

Number of packets to send = 20

arrayOfBytesToSend = [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000].

Packets received = [100, 200, 300, 400, 500, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 1500].

The first 5 packets are received correctly but others are merged into packets of 2000 bytes. I get that the simulator is trying to send packets with full MSS length. 

Question 1. Am I missing something here?

Question 2. How can I resolve this problem? I want to send fixed length packets only and not full MSS.

Thanks

Prakash

Konstantinos

unread,
Feb 18, 2015, 4:55:30 AM2/18/15
to ns-3-...@googlegroups.com
Q1: Yes, you are missing the fact that TCP does not preserve packet bounds. It is a byte-stream protocol.
Q2: Use UDP.

Prakash Agrawal

unread,
Feb 18, 2015, 5:57:27 AM2/18/15
to ns-3-...@googlegroups.com
Hello Sir

Thanks for your reply.
Is it possible to stall the system or make it wait before the next packet is created, so that the current packet is flushed to the ip layer and both are not merged? I have to use TCP. 
I tried SystemCondition::TimedWait() but its not working.

Prakash

--
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/Mf630lw9nz4/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.

Konstantinos

unread,
Feb 18, 2015, 6:27:32 AM2/18/15
to ns-3-...@googlegroups.com
You can schedule the generation of packets, but that is not BulkSend. You can create your own traffic generator and schedule the packets accordingly. 
I am not an expert on TCP to comment when the time requirements for the packets to be merged, but if they are in TCP's queue at the same time, they will be merged. 

On Wednesday, February 18, 2015 at 10:57:27 AM UTC, Prakash wrote:
Hello Sir

Thanks for your reply.
Is it possible to stall the system or make it wait before the next packet is created, so that the current packet is flushed to the ip layer and both are not merged? I have to use TCP. 
I tried SystemCondition::TimedWait() but its not working.

Prakash
On Wed, Feb 18, 2015 at 3:25 PM, Konstantinos <dinos.k...@gmail.com> wrote:
Q1: Yes, you are missing the fact that TCP does not preserve packet bounds. It is a byte-stream protocol.
Q2: Use UDP.


On Wednesday, February 18, 2015 at 9:46:36 AM UTC, Prakash wrote:
Hello all

I have modified the bulk-send-application such that it takes an array of bytes as parameter and iterates over the array to send the packets of that many bytes. Now when I run the program, it works correctly for first few packets but after that it just sends packets of full MSS length. The MSS is set to 2000.

For example:

Number of packets to send = 20

arrayOfBytesToSend = [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000].

Packets received = [100, 200, 300, 400, 500, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 1500].

The first 5 packets are received correctly but others are merged into packets of 2000 bytes. I get that the simulator is trying to send packets with full MSS length. 

Question 1. Am I missing something here?

Question 2. How can I resolve this problem? I want to send fixed length packets only and not full MSS.

Thanks

Prakash

--
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/Mf630lw9nz4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

Tommaso Pecorella

unread,
Feb 18, 2015, 8:39:41 AM2/18/15
to ns-3-...@googlegroups.com
I'm a TCP expert enough to say that the idea of adding a delay to force TCP to flush its buffers is... well, let's just say with an understatement: it's not a good idea.
If you need to "find" the message boundaries, you have to add an application-level header (or footer) to decide where a message starts and stops. A common system is to add a TLV header (Type Length Value).
Do not force the L4 protocol to do something that is not meant to do. Only bad things could happen from this.

Cheers,

T.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages