The overhead of TCP

42 views
Skip to first unread message

ahmad r

unread,
Aug 18, 2016, 3:37:56 PM8/18/16
to ns-3-users
Hi
I want to send 1000 bytes as data payload (say some integer numbers) from one node to another. I am using TCP over 802.11s. I borrowed the code from tcp-bulk-send.cc to do it, i.e.

    PacketSinkHelper sink ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), port));
    BulkSendHelper source ("ns3::TcpSocketFactory", InetSocketAddress (interfaces.GetAddress (Reciever), port));
    source.SetAttribute ("MaxBytes", UintegerValue (1000));
    ApplicationContainer sourceApps = source.Install (nodes.Get (Sender));

Questions:
1- in source.SetAttribute, Do I have to set 1000 bytes as the MaxBytes, or I have to add the overhead of TCP to this number? i.e is this number accounts the payload, or it is payload+overhead
2- how much is the overhead of TCP? I found this link: http://stackoverflow.com/questions/24879959/what-is-overhead-payload-and-header  but I don't know how to calculate the overhead within ns3. Is there any ns3 function that I can use for? Or can you introduce me some other useful document?

Thanks for your help,

Tommaso Pecorella

unread,
Aug 18, 2016, 7:39:45 PM8/18/16
to ns-3-users
Hi,

answers in-line.


On Thursday, August 18, 2016 at 9:37:56 PM UTC+2, ahmad r wrote:
Hi
I want to send 1000 bytes as data payload (say some integer numbers) from one node to another. I am using TCP over 802.11s. I borrowed the code from tcp-bulk-send.cc to do it, i.e.

    PacketSinkHelper sink ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), port));
    BulkSendHelper source ("ns3::TcpSocketFactory", InetSocketAddress (interfaces.GetAddress (Reciever), port));
    source.SetAttribute ("MaxBytes", UintegerValue (1000));
    ApplicationContainer sourceApps = source.Install (nodes.Get (Sender));

Questions:
1- in source.SetAttribute, Do I have to set 1000 bytes as the MaxBytes, or I have to add the overhead of TCP to this number? i.e is this number accounts the payload, or it is payload+overhead

It is just the payload, you could have found it by reading the code.
 
2- how much is the overhead of TCP? I found this link: http://stackoverflow.com/questions/24879959/what-is-overhead-payload-and-header  but I don't know how to calculate the overhead within ns3. Is there any ns3 function that I can use for? Or can you introduce me some other useful document?

You can not known the TCP overhead in advance, because it depends on the TCP flavour, the retransmissions and the packet size (which in turns depends on the application behaviour).
What you can do is to measure it.

Cheers,

T.

Reply all
Reply to author
Forward
0 new messages