Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(39)

Issue 283880043: SACK implementation

Can't Edit
Can't Publish+Mail
Start Review
Created:
8 years, 4 months ago by trucanh524
Modified:
7 years, 11 months ago
Reviewers:
Tom Henderson, mattator, yannis, tomh, n.p
CC:
ns-3-reviews_googlegroups.com
Visibility:
Public.

Description

.. include:: replace.txt .. highlight:: cpp SACK option implementation in |ns3| ------------------------------------------------ This chapter describes the SACK option implementation in |ns3|. This implementation is contained in the following files: .. sourcecode:: text src/internet/model/tcp-option-sack-permitted.{cc,h} src/internet/model/tcp-option-sack.{cc,h} src/internet/model/tcp-socket-base.{cc,h} src/internet/model/tcp-option.{cc,h} src/internet/model/tcp-scoreboard.{cc,h} src/internet/model/tcp-rx-buffer.{cc,h} Model Description ***************** TCP SACK extention [Mat96] addresses the catastrophic throughput degradation of TCP in the presence of multiple packet losses from a single window of data. The SACK extension comprises of 2 options: Sack-Permitted and SACK. The Sack-Permitted, defined in class :cpp:class:`TcpOptionSackPermitted`, is sent in a SYN segment to allow the SACK option usage during a connection lifetime. The SACK option, defined in class :cpp:class:`TcpOptionSack`, is sent by a data receiver to inform the sender of non-contiguous blocks of data that have been received and queued in the receving buffer but cannot be acknowledged due to some missing segments. Each block is defined by two 32-bit unsigned integers specifying the left and the right edge of the block. Note that with the 40-byte TCP option limitation in addition to the presence of TCP Timestamp option, the maximum number of SACK blocks can be appended to each packet is 3. The class :cpp:class:`TcpSocketBase` handles the Sack-Permitted and SACK option processing to enable the use of SACK mechanism by all TCP variants available in |ns3|. Before transmitting an ACK that does not acknowledge the highest sequence number received, a receiver tries to find all isolated data chunks in the receving buffer. This is done by calling ``TcpRxBuffer::GetIsolatedDataChunks ()`` from ``TcpSocketBase::ReceivedData ()``. The returned list of isolated data blocks is then sorted by an auxiliary routine ``TcpSocketBase::ArrageSackBlocks ()`` to make sure that the block containing the segment that triggers this particular ACK packet is at the front of the list. When the SACK list is ready and the ACK segment is constructed, ``TcpSocketBase::AddOptionSack ()`` is called, which in turn calls ``TcpHeader::AppendOption ()`` to append as many SACK blocks to the packet as possible. On the sender side, a scoreboard [Bla12] handled by the class :cpp:class:`TcpScoreBoard` is maintained to keep track of SACK information. When the sender receives an ACK with SACK option appended, the sender calls ``TcpScoreBoard::Update ()`` to turn on the SACK flag for all transmitted segments that are covered by the received SACK blocks. When deciding on a packet for retransmission, the sender will skip segments with SACK flag set. References ========== .. [Mat96] M. Mathis, J. Mahdavi, S. Floyd, and A. Romanow, RFC 2018: TCP Selective Acknowledgment Options, October 1996. Available online at `<http://tools.ietf.org/html/rfc2018>`_. .. [Bla12] E. Blanton, M. Allman, L. Wang, I. Jarvinen, M. Kojio, and Y. Nishida, RFC 6675: A Conservative Loss Recovery Algorithm Based on Selective Acknowledgment (SACK) for TCP, August 2012. Available online at `<https://tools.ietf.org/html/rfc6675>`_. Validation ========== The SACK option model is tested using :cpp:class:`TcpOptionTestSuite` class and :cpp:class:`TcpSackTestSuite` class defined in `src/internet/test/tcp-option-test.cc` and `src/internet/test/tcp-sack-test.cc`, respectively. These two test suites can be run using the following commands: :: $ ./waf configure --enable-examples --enable-tests $ ./waf build $ ./test.py -s tcp-option $ ./test.py -s tcp-sack Example ======= The SACK option can be simulated using the example `tcp-variants-comparison.cc` located in ``examples/tcp``.

Patch Set 1 #

Total comments: 23

Patch Set 2 : Fixing Tom's comments on style and uploading full scoreboard implementation #

Patch Set 3 : Fixing to ensure the patch can be applied on ns-3.24 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1966 lines, -171 lines) Patch
M src/internet/model/tcp-header.h View 2 chunks +13 lines, -1 line 0 comments Download
M src/internet/model/tcp-header.cc View 14 chunks +37 lines, -25 lines 0 comments Download
M src/internet/model/tcp-option.h View 1 chunk +8 lines, -6 lines 0 comments Download
M src/internet/model/tcp-option.cc View 5 chunks +14 lines, -8 lines 0 comments Download
A src/internet/model/tcp-option-sack.h View 1 1 chunk +100 lines, -0 lines 0 comments Download
A src/internet/model/tcp-option-sack.cc View 1 2 1 chunk +154 lines, -0 lines 0 comments Download
A src/internet/model/tcp-option-sack-permitted.h View 1 chunk +65 lines, -0 lines 0 comments Download
A src/internet/model/tcp-option-sack-permitted.cc View 1 chunk +107 lines, -0 lines 0 comments Download
M src/internet/model/tcp-rx-buffer.h View 3 chunks +15 lines, -2 lines 0 comments Download
M src/internet/model/tcp-rx-buffer.cc View 1 6 chunks +88 lines, -8 lines 0 comments Download
A src/internet/model/tcp-scoreboard.h View 1 1 chunk +241 lines, -0 lines 0 comments Download
A src/internet/model/tcp-scoreboard.cc View 1 1 chunk +481 lines, -0 lines 0 comments Download
M src/internet/model/tcp-socket-base.h View 1 2 13 chunks +66 lines, -14 lines 0 comments Download
M src/internet/model/tcp-socket-base.cc View 1 48 chunks +284 lines, -105 lines 0 comments Download
M src/internet/test/tcp-option-test.cc View 1 3 chunks +102 lines, -0 lines 0 comments Download
A src/internet/test/tcp-sack-test.cc View 1 chunk +183 lines, -0 lines 0 comments Download
M src/internet/wscript View 1 2 5 chunks +8 lines, -2 lines 0 comments Download

Messages

Total messages: 9
Tom Henderson
This review contains some of the more minor comments on the code, which conforms pretty ...
8 years, 4 months ago (2015-12-22 04:18:01 UTC) #1
Tom Henderson
It seems to me that the TCP sender is not making use of the SACK ...
8 years, 4 months ago (2015-12-22 04:39:53 UTC) #2
trucanh524
Hi Tom, I've addressed your comments with my replies and question inline. Thank you very ...
8 years, 4 months ago (2015-12-28 23:32:54 UTC) #3
n.p
Hi Ahn, some comments on what you have written inline below. By the way, can ...
8 years, 4 months ago (2015-12-29 09:35:45 UTC) #4
trucanh524
On 2015/12/29 09:35:45, n.p wrote: > Hi Ahn, > some comments on what you have ...
8 years, 4 months ago (2015-12-30 23:02:06 UTC) #5
mattator
I failed to apply the patch on master and ns3-24. Against which commit should I ...
8 years, 3 months ago (2016-01-07 16:01:53 UTC) #6
trucanh524
On 2016/01/07 16:01:53, mattator wrote: > I failed to apply the patch on master and ...
8 years ago (2016-04-12 19:42:31 UTC) #7
yannis
On 2016/04/12 19:42:31, trucanh524 wrote: > On 2016/01/07 16:01:53, mattator wrote: > > I failed ...
7 years, 11 months ago (2016-05-11 12:57:25 UTC) #8
n.p
7 years, 11 months ago (2016-05-11 13:06:45 UTC) #9
On 2016/05/11 12:57:25, yannis wrote:
> On 2016/04/12 19:42:31, trucanh524 wrote:
> > On 2016/01/07 16:01:53, mattator wrote:
> > > I failed to apply the patch on master and ns3-24. Against which commit
> should
> > I
> > > apply this patch ?
> > 
> > I think the issue is fixed now.
> 
> Hi Truc,
> 
> I tried to apply the latest patch on ns3.24, but I failed too
> (i.e. there are some functions in the tcp-socket-base.cc/h which are used
> in ns3.25). Perhaps, it would be better and more convenient to have a patch 
> for the latest version (ns3.25)

Hi,

we are working on a new version, and I'd like to no spend more time on this. If
you want to help on the development, tell us something.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b