TCP: Packet Size and Segment Size

540 views
Skip to first unread message

AChaure

unread,
Oct 26, 2016, 2:46:27 PM10/26/16
to ns-3-users

Hi all,

I am trying to evaluate performance of TCP Westwood for a wireless scenario. Could someone tell me what happens if the segment size is less than the packet size.

a. When the segment size is less than the packet size I could see congestion.
b. Whereas when i make it equal to the packet size I do not see congestion.

Could someone tell me what is happening?

Thanks,

A

Tommaso Pecorella

unread,
Oct 28, 2016, 3:57:42 PM10/28/16
to ns-3-users
Hi,

please remember that there's no "packet" in TCP, as TCP is a stream oriented protocol.

What you're experiencing is that if you lower the segment size, at one point you'll have a congestion (even if the application-level data rate is the same).
Guess what ? Decreasing the segment size you increase the overhead (each segment has a TCP and an IP header).

Quite a simple explanation, isn't it ?

T.

Brian

unread,
Oct 28, 2016, 5:00:47 PM10/28/16
to ns-3-users
Hey Tommaso, 

I'm new to networking but my impression is that TCP does have "packets", but not a "packet size" because obviously as you said it is a stream oriented protocol.  Can you elaborate on what you mean?

Tommaso Pecorella

unread,
Oct 28, 2016, 7:26:16 PM10/28/16
to ns-3-users
Hi,

I'm sleepy, so I'll try to cut the explanation to the bare minimum.

Definitions.
MTU - Maximum transmission unit - it's defined as the maximum payload size at L2.
IP datagram size - hopefully slightly less than the MTU.

UDP - datagram oriented protocol. Send a bunch of data through an UDP socket.
Case 1: data size < MTU - send as it is in one IP datagram.
Case 2: data size > MTU - send 2 or more datagrams (IP fragmentation, slightly inefficient).

TCP - stream oriented protocol. Send a bunch of data through a TCP socket.
Case whatever - TCP doesn't care if you send 1 byte or a LOT of bytes.
- Put the data in a buffer, when you have enough data to make a packet (or a timeout occurred), send them.
The "enough data" is the TCP segment size.

The optimum segment size is equal to the Path MTU payload. Any shorter datagram will only increase the network overhead (each segment has its own IP and TCP headers).

Problem: PMTU adaptation isn't yet implemented in ns-3 TCP.
Solution: use your head and do some offline math.

Cheers,

T.
Reply all
Reply to author
Forward
0 new messages