<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.nsnam.org/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=RubenMartinez</id>
	<title>Nsnam - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.nsnam.org/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=RubenMartinez"/>
	<link rel="alternate" type="text/html" href="https://www.nsnam.org/wiki/Special:Contributions/RubenMartinez"/>
	<updated>2026-04-13T16:22:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9429</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9429"/>
		<updated>2015-04-10T13:13:17Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Weekly Reports */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Default build is intended for (http://artes.esa.int/projects/mudsat-dtn-m2m-satellite-applications). This includes an implementation specific behaviour: MUDSAT blcok re-tx control (mutiple re-transmission of green data segments).&lt;br /&gt;
&lt;br /&gt;
This is not specified in the RFC. In order to avoid it, manually remove this line:&lt;br /&gt;
&lt;br /&gt;
 File: include/ltp_int.h&lt;br /&gt;
 Line 49:/// This is for the MUDSAT build, TODO:  make this a configure param later&lt;br /&gt;
 Line 50:#define MUDSAT&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To perform tests use parameters -testType and -testNum:&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=0&amp;quot;&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=rx -testNum=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Test numbers are assigned according to the following section.&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=1&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=2&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
LTPlib follows this optional approach: RFC 5326 - 4.1. Transmission Request&lt;br /&gt;
&lt;br /&gt;
   For bandwidth efficiency reasons, implementations MAY choose to instead mark the&lt;br /&gt;
   entire segment (within which the red-part boundary falls) as red-&lt;br /&gt;
   part, causing green-part data falling within the segment to also be&lt;br /&gt;
   treated as red-part.&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Both red and green data is sent together in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
NS-3 emu&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Red Data - Type (0x03 - Red Data, Checkpoint , EORP). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Green Data - Type (0x07 - Green Data, Checkpoint , EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
Despite of that, interoperability is still possible and the full block is successfully transmitted.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=3&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 200 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
LTPLib:&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 2 red segments and 2 Green Segments. &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x00 - Red Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x02 - Red Data, EORP) ---&amp;gt; A chunk of Green data is merged with red data in this segment&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x07 - Green Data, EOB)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
NS3 emu:&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 2 red segments and 3 Green Segments. &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x00 - Red Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x02 - Red Data, EORP)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x07 - Green Data, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=4&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 2000 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
&lt;br /&gt;
LTPlib specific behaviour: closing an open socket associated to an unfinished block generates a CS segment. &lt;br /&gt;
&lt;br /&gt;
IMO the all-green case is not being properly handled.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=5&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* PCAP Files: [[File:ltplib-500-all-green.pcap| LTPlib pcap file]] - [[File:ns3-500-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
 &lt;br /&gt;
==== Test 6: 5000 byte block ( &amp;gt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
* PCAP Files: [[File:ltplib-5000-all-green.pcap| LTPlib pcap file]] - [[File:ns3-5000-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=6&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
- Use byte block of 100 KB.&lt;br /&gt;
Edit the point-to-point link using Packet Error Rates of: 1%,5%,10%,15%,20%,25%,30%.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=retrans&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mobility ==&lt;br /&gt;
&lt;br /&gt;
[[File:core-mobility-ltp.png]]&lt;br /&gt;
&lt;br /&gt;
*Set-up two MBR nodes and a wireless network.&lt;br /&gt;
*Perform disconnections by manually drag and dropping the nodes out of range.&lt;br /&gt;
&lt;br /&gt;
==== Test 1.  Nodes are disconnected at the start of the transmission, then connectivity is resumed after 30 seconds.====&lt;br /&gt;
*The transmission was successful in this case.&lt;br /&gt;
&lt;br /&gt;
====Test 2. Nodes are connected at the start, they lose connectivity in the middle of the transmission, and reconnect after 30 seconds.====&lt;br /&gt;
&lt;br /&gt;
*All the data is successfully transmitted and acknowledged, but there is redundancy.&lt;br /&gt;
*The ns-3 client repeats the transmission several times before closing the transmission session.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class.&lt;br /&gt;
&lt;br /&gt;
== Week 6 ==&lt;br /&gt;
 -Provided an UDP Convergence Layer Adapter; it offers an API to LTP, performs socket management, and address bindings (mapping between LTP Engine Ids and IP addresses).&lt;br /&gt;
- Provided a LtpProtocolHelper and a basic (not reliable) transmission example between two nodes.&lt;br /&gt;
== Week 7 ==&lt;br /&gt;
&lt;br /&gt;
- Moved LTP Engine Ids to IP addresses resolution to a LtpRoutingProtocol Class.&lt;br /&gt;
- Defined a base ConvergenceLayerAdapter class from which other types of CLAs can inherit.&lt;br /&gt;
- Improved UDP CLA.&lt;br /&gt;
- Implemented method UdpSocketImpl::GetTxAvailable() for use in UDP CLA.&lt;br /&gt;
- Fixed problems with the provided example and expanded it to transmit red and green data segments.&lt;br /&gt;
- Improved main protocol receiver logic to handle additional situations: start of reception, reception of red data, reception of green data, miss-colored segments, reception of checkpoint.&lt;br /&gt;
- Reviewed another GSOC's student mid-term code.&lt;br /&gt;
== Week 8 ==&lt;br /&gt;
- Fixed a problem which caused segments with the wrong type to be delivered.&lt;br /&gt;
- Provided several fixes and improved functionality of convergence layer, udp convergence layer and ltp-helper&lt;br /&gt;
- Provided a basic link state cue implementation.&lt;br /&gt;
- Offered a full list of features ordered by priority and re-scheduled the project timeline accordingly.&lt;br /&gt;
== Week 9 ==&lt;br /&gt;
&lt;br /&gt;
I have finished all the features required for basic data transmission:&lt;br /&gt;
&lt;br /&gt;
    Protocol events are based on notifications from lower layer link state cues. &lt;br /&gt;
    Start Transmission procedure.&lt;br /&gt;
    Drop packet procedures.&lt;br /&gt;
    Handle Miscolored segments.&lt;br /&gt;
    Notifications to Client Service instance (application using the protocol).&lt;br /&gt;
    Signify Red Part (data sent reliably).&lt;br /&gt;
    Signify Green Data Segment (data that does not require reliability).&lt;br /&gt;
    Signify Transmission Completed.&lt;br /&gt;
    Stop Transmission procedure.  &lt;br /&gt;
&lt;br /&gt;
I have also been working on providing retransmission based reliability, and implemented the basic &amp;quot;handshake&amp;quot; mechanism:&lt;br /&gt;
&lt;br /&gt;
1. Sender sends Data Checkpoint.&lt;br /&gt;
2. Receiver confirms reception of data up to this point with a Report Segment.&lt;br /&gt;
3. Sender answers with a Report Acknowledgement Segment.&lt;br /&gt;
&lt;br /&gt;
== Week 10 ==&lt;br /&gt;
&lt;br /&gt;
The protocol currently supports basic data transmission, and offers&lt;br /&gt;
a simplified protocol for retransmission based reliability.&lt;br /&gt;
&lt;br /&gt;
== Week 11 == &lt;br /&gt;
&lt;br /&gt;
*Submitting fixes and providing a stable version of the protocol capable of retransmission based reliability.&lt;br /&gt;
*Writing tests.&lt;br /&gt;
*Writing documentation.&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=File:Core-mobility-ltp.png&amp;diff=9428</id>
		<title>File:Core-mobility-ltp.png</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=File:Core-mobility-ltp.png&amp;diff=9428"/>
		<updated>2015-04-10T13:00:34Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9427</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9427"/>
		<updated>2015-04-10T12:59:59Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Protocol Validation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Default build is intended for (http://artes.esa.int/projects/mudsat-dtn-m2m-satellite-applications). This includes an implementation specific behaviour: MUDSAT blcok re-tx control (mutiple re-transmission of green data segments).&lt;br /&gt;
&lt;br /&gt;
This is not specified in the RFC. In order to avoid it, manually remove this line:&lt;br /&gt;
&lt;br /&gt;
 File: include/ltp_int.h&lt;br /&gt;
 Line 49:/// This is for the MUDSAT build, TODO:  make this a configure param later&lt;br /&gt;
 Line 50:#define MUDSAT&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To perform tests use parameters -testType and -testNum:&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=0&amp;quot;&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=rx -testNum=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Test numbers are assigned according to the following section.&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=1&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=2&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
LTPlib follows this optional approach: RFC 5326 - 4.1. Transmission Request&lt;br /&gt;
&lt;br /&gt;
   For bandwidth efficiency reasons, implementations MAY choose to instead mark the&lt;br /&gt;
   entire segment (within which the red-part boundary falls) as red-&lt;br /&gt;
   part, causing green-part data falling within the segment to also be&lt;br /&gt;
   treated as red-part.&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Both red and green data is sent together in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
NS-3 emu&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Red Data - Type (0x03 - Red Data, Checkpoint , EORP). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Green Data - Type (0x07 - Green Data, Checkpoint , EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
Despite of that, interoperability is still possible and the full block is successfully transmitted.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=3&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 200 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
LTPLib:&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 2 red segments and 2 Green Segments. &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x00 - Red Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x02 - Red Data, EORP) ---&amp;gt; A chunk of Green data is merged with red data in this segment&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x07 - Green Data, EOB)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
NS3 emu:&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 2 red segments and 3 Green Segments. &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x00 - Red Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x02 - Red Data, EORP)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x07 - Green Data, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=4&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 2000 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
&lt;br /&gt;
LTPlib specific behaviour: closing an open socket associated to an unfinished block generates a CS segment. &lt;br /&gt;
&lt;br /&gt;
IMO the all-green case is not being properly handled.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=5&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* PCAP Files: [[File:ltplib-500-all-green.pcap| LTPlib pcap file]] - [[File:ns3-500-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
 &lt;br /&gt;
==== Test 6: 5000 byte block ( &amp;gt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
* PCAP Files: [[File:ltplib-5000-all-green.pcap| LTPlib pcap file]] - [[File:ns3-5000-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=6&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
- Use byte block of 100 KB.&lt;br /&gt;
Edit the point-to-point link using Packet Error Rates of: 1%,5%,10%,15%,20%,25%,30%.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=retrans&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mobility ==&lt;br /&gt;
&lt;br /&gt;
[[File:core-mobility-ltp.png]]&lt;br /&gt;
&lt;br /&gt;
*Set-up two MBR nodes and a wireless network.&lt;br /&gt;
*Perform disconnections by manually drag and dropping the nodes out of range.&lt;br /&gt;
&lt;br /&gt;
==== Test 1.  Nodes are disconnected at the start of the transmission, then connectivity is resumed after 30 seconds.====&lt;br /&gt;
*The transmission was successful in this case.&lt;br /&gt;
&lt;br /&gt;
====Test 2. Nodes are connected at the start, they lose connectivity in the middle of the transmission, and reconnect after 30 seconds.====&lt;br /&gt;
&lt;br /&gt;
*All the data is successfully transmitted and acknowledged, but there is redundancy.&lt;br /&gt;
*The ns-3 client repeats the transmission several times before closing the transmission session.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9285</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9285"/>
		<updated>2015-02-05T18:13:53Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Protocol Validation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Default build is intended for (http://artes.esa.int/projects/mudsat-dtn-m2m-satellite-applications). This includes an implementation specific behaviour: MUDSAT blcok re-tx control (mutiple re-transmission of green data segments).&lt;br /&gt;
&lt;br /&gt;
This is not specified in the RFC. In order to avoid it, manually remove this line:&lt;br /&gt;
&lt;br /&gt;
 File: include/ltp_int.h&lt;br /&gt;
 Line 49:/// This is for the MUDSAT build, TODO:  make this a configure param later&lt;br /&gt;
 Line 50:#define MUDSAT&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To perform tests use parameters -testType and -testNum:&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=0&amp;quot;&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=rx -testNum=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Test numbers are assigned according to the following section.&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=1&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=2&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
LTPlib follows this optional approach: RFC 5326 - 4.1. Transmission Request&lt;br /&gt;
&lt;br /&gt;
   For bandwidth efficiency reasons, implementations MAY choose to instead mark the&lt;br /&gt;
   entire segment (within which the red-part boundary falls) as red-&lt;br /&gt;
   part, causing green-part data falling within the segment to also be&lt;br /&gt;
   treated as red-part.&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Both red and green data is sent together in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
NS-3 emu&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Red Data - Type (0x03 - Red Data, Checkpoint , EORP). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Green Data - Type (0x07 - Green Data, Checkpoint , EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
Despite of that, interoperability is still possible and the full block is successfully transmitted.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=3&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 200 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
LTPLib:&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 2 red segments and 2 Green Segments. &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x00 - Red Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x02 - Red Data, EORP) ---&amp;gt; A chunk of Green data is merged with red data in this segment&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x07 - Green Data, EOB)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
NS3 emu:&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 2 red segments and 3 Green Segments. &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x00 - Red Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x02 - Red Data, EORP)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x07 - Green Data, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=4&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 2000 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
&lt;br /&gt;
LTPlib specific behaviour: closing an open socket associated to an unfinished block generates a CS segment. &lt;br /&gt;
&lt;br /&gt;
IMO the all-green case is not being properly handled.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=5&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* PCAP Files: [[File:ltplib-500-all-green.pcap| LTPlib pcap file]] - [[File:ns3-500-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
 &lt;br /&gt;
==== Test 6: 5000 byte block ( &amp;gt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
* PCAP Files: [[File:ltplib-5000-all-green.pcap| LTPlib pcap file]] - [[File:ns3-5000-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=6&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
- Use byte block of 100 KB.&lt;br /&gt;
Edit the point-to-point link using Packet Error Rates of: 1%,5%,10%,15%,20%,25%,30%.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=retrans&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9233</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9233"/>
		<updated>2015-01-12T17:46:48Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Retransmission tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Default build is intended for (http://artes.esa.int/projects/mudsat-dtn-m2m-satellite-applications). This includes an implementation specific behaviour: MUDSAT blcok re-tx control (mutiple re-transmission of green data segments).&lt;br /&gt;
&lt;br /&gt;
This is not specified in the RFC. In order to avoid it, manually remove this line:&lt;br /&gt;
&lt;br /&gt;
 File: include/ltp_int.h&lt;br /&gt;
 Line 49:/// This is for the MUDSAT build, TODO:  make this a configure param later&lt;br /&gt;
 Line 50:#define MUDSAT&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To perform tests use parameters -testType and -testNum:&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=0&amp;quot;&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=rx -testNum=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Test numbers are assigned according to the following section.&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=1&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=2&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
LTPlib follows this optional approach: RFC 5326 - 4.1. Transmission Request&lt;br /&gt;
&lt;br /&gt;
   For bandwidth efficiency reasons, implementations MAY choose to instead mark the&lt;br /&gt;
   entire segment (within which the red-part boundary falls) as red-&lt;br /&gt;
   part, causing green-part data falling within the segment to also be&lt;br /&gt;
   treated as red-part.&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Both red and green data is sent together in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
NS-3 emu&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Red Data - Type (0x03 - Red Data, Checkpoint , EORP). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Green Data - Type (0x07 - Green Data, Checkpoint , EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
Despite of that, interoperability is still possible and the full block is successfully transmitted.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=3&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 200 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
LTPLib:&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 2 red segments and 2 Green Segments. &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x00 - Red Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x02 - Red Data, EORP) ---&amp;gt; A chunk of Green data is merged with red data in this segment&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x07 - Green Data, EOB)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
NS3 emu:&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 2 red segments and 3 Green Segments. &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x00 - Red Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x02 - Red Data, EORP)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x07 - Green Data, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=4&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 2000 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
&lt;br /&gt;
LTPlib specific behaviour: closing an open socket associated to an unfinished block generates a CS segment. &lt;br /&gt;
&lt;br /&gt;
IMO the all-green case is not being properly handled.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=5&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* PCAP Files: [[File:ltplib-500-all-green.pcap| LTPlib pcap file]] - [[File:ns3-500-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
 &lt;br /&gt;
==== Test 6: 5000 byte block ( &amp;gt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
* PCAP Files: [[File:ltplib-5000-all-green.pcap| LTPlib pcap file]] - [[File:ns3-5000-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=6&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
Core configuration GUI. Edit the point-to-point link and set PER property to 50%.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9232</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9232"/>
		<updated>2015-01-12T13:33:15Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Validation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Default build is intended for (http://artes.esa.int/projects/mudsat-dtn-m2m-satellite-applications). This includes an implementation specific behaviour: MUDSAT blcok re-tx control (mutiple re-transmission of green data segments).&lt;br /&gt;
&lt;br /&gt;
This is not specified in the RFC. In order to avoid it, manually remove this line:&lt;br /&gt;
&lt;br /&gt;
 File: include/ltp_int.h&lt;br /&gt;
 Line 49:/// This is for the MUDSAT build, TODO:  make this a configure param later&lt;br /&gt;
 Line 50:#define MUDSAT&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To perform tests use parameters -testType and -testNum:&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=0&amp;quot;&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=rx -testNum=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Test numbers are assigned according to the following section.&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=1&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=2&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
LTPlib follows this optional approach: RFC 5326 - 4.1. Transmission Request&lt;br /&gt;
&lt;br /&gt;
   For bandwidth efficiency reasons, implementations MAY choose to instead mark the&lt;br /&gt;
   entire segment (within which the red-part boundary falls) as red-&lt;br /&gt;
   part, causing green-part data falling within the segment to also be&lt;br /&gt;
   treated as red-part.&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Both red and green data is sent together in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
NS-3 emu&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Red Data - Type (0x03 - Red Data, Checkpoint , EORP). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Green Data - Type (0x07 - Green Data, Checkpoint , EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
Despite of that, interoperability is still possible and the full block is successfully transmitted.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=3&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 200 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
LTPLib:&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 2 red segments and 2 Green Segments. &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x00 - Red Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x02 - Red Data, EORP) ---&amp;gt; A chunk of Green data is merged with red data in this segment&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x07 - Green Data, EOB)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
NS3 emu:&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 2 red segments and 3 Green Segments. &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x00 - Red Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x02 - Red Data, EORP)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x07 - Green Data, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=4&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 2000 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
&lt;br /&gt;
LTPlib specific behaviour: closing an open socket associated to an unfinished block generates a CS segment. &lt;br /&gt;
&lt;br /&gt;
IMO the all-green case is not being properly handled.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=5&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* PCAP Files: [[File:ltplib-500-all-green.pcap| LTPlib pcap file]] - [[File:ns3-500-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
 &lt;br /&gt;
==== Test 6: 5000 byte block ( &amp;gt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
* PCAP Files: [[File:ltplib-5000-all-green.pcap| LTPlib pcap file]] - [[File:ns3-5000-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=6&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9231</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9231"/>
		<updated>2015-01-12T13:09:51Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Default build is intended for (http://artes.esa.int/projects/mudsat-dtn-m2m-satellite-applications). This includes an implementation specific behaviour: MUDSAT blcok re-tx control (mutiple re-transmission of green data segments).&lt;br /&gt;
&lt;br /&gt;
This is not specified in the RFC. In order to avoid it, manually remove this line:&lt;br /&gt;
&lt;br /&gt;
 File: include/ltp_int.h&lt;br /&gt;
 Line 49:/// This is for the MUDSAT build, TODO:  make this a configure param later&lt;br /&gt;
 Line 50:#define MUDSAT&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To perform tests use parameters -testType and -testNum:&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=0&amp;quot;&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=rx -testNum=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Test numbers are assigned according to the following section.&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=1&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=2&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data ====&lt;br /&gt;
&lt;br /&gt;
LTPlib follows this optional approach: RFC 5326 - 4.1. Transmission Request&lt;br /&gt;
&lt;br /&gt;
   For bandwidth efficiency reasons, implementations MAY choose to instead mark the&lt;br /&gt;
   entire segment (within which the red-part boundary falls) as red-&lt;br /&gt;
   part, causing green-part data falling within the segment to also be&lt;br /&gt;
   treated as red-part.&lt;br /&gt;
&lt;br /&gt;
The whole segment is marked as RED.&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
NS-3 emu&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Red Data - Type (0x03 - Red Data, Checkpoint , EORP). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Green Data - Type (0x07 - Green Data, Checkpoint , EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
Despite of that, interoperability is still possible and the full block is successfully transmitted.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=3&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 200 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data ====&lt;br /&gt;
&lt;br /&gt;
LTPLib:&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 2 red segments and 2 Green Segments. &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x00 - Red Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x02 - Red Data, EORP)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x07 - Green Data, EOB)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
NS3 emu:&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 2 red segments and 2 Green Segments. &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x00 - Red Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x02 - Red Data, EORP)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x07 - Green Data, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Type (0x0E) Cancel from receiver. &lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
&lt;br /&gt;
LTPlib specific behaviour: closing an open socket associated to an unfinished block generates a CS segment. &lt;br /&gt;
&lt;br /&gt;
IMO the all-green case is not being properly handled.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=5&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* PCAP Files: [[File:ltplib-500-all-green.pcap| LTPlib pcap file]] - [[File:ns3-500-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
 &lt;br /&gt;
==== Test 6: 5000 byte block ( &amp;gt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
* PCAP Files: [[File:ltplib-5000-all-green.pcap| LTPlib pcap file]] - [[File:ns3-5000-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=6&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9229</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9229"/>
		<updated>2015-01-09T13:19:40Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Nominal operation tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Default build is intended for (http://artes.esa.int/projects/mudsat-dtn-m2m-satellite-applications). This includes an implementation specific behaviour: MUDSAT blcok re-tx control (mutiple re-transmission of green data segments).&lt;br /&gt;
&lt;br /&gt;
This is not specified in the RFC. In order to avoid it, manually remove this line:&lt;br /&gt;
&lt;br /&gt;
 File: include/ltp_int.h&lt;br /&gt;
 Line 49:/// This is for the MUDSAT build, TODO:  make this a configure param later&lt;br /&gt;
 Line 50:#define MUDSAT&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To perform tests use parameters -testType and -testNum:&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=0&amp;quot;&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=rx -testNum=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Test numbers are assigned according to the following section.&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=1&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=2&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data ====&lt;br /&gt;
&lt;br /&gt;
LTPlib follows this optional approach: RFC 5326 - 4.1. Transmission Request&lt;br /&gt;
&lt;br /&gt;
   For bandwidth efficiency reasons, implementations MAY choose to instead mark the&lt;br /&gt;
   entire segment (within which the red-part boundary falls) as red-&lt;br /&gt;
   part, causing green-part data falling within the segment to also be&lt;br /&gt;
   treated as red-part.&lt;br /&gt;
&lt;br /&gt;
The whole segment is marked as RED.&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
NS-3 emu&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Red Data - Type (0x03 - Red Data, Checkpoint , EORP). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Red Data - Type (0x07 - Green Data, Checkpoint , EOB). &lt;br /&gt;
&lt;br /&gt;
Despite of that interoperability is possible and the full block is successfully transmitted.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=3&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 200 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data ====&lt;br /&gt;
&lt;br /&gt;
LTPLib:&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 2 red segments and 2 Green Segments. &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x00 - Red Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x02 - Red Data, EORP)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x07 - Green Data, EOB)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
NS3 emu:&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 2 red segments and 2 Green Segments. &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x00 - Red Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x02 - Red Data, EORP)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x07 - Green Data, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Type (0x0E) Cancel from receiver. &lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
&lt;br /&gt;
LTPlib specific behaviour: closing an open socket associated to an unfinished block generates a CS segment. &lt;br /&gt;
&lt;br /&gt;
IMO the all-green case is not being properly handled.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=5&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* PCAP Files: [[File:ltplib-500-all-green.pcap| LTPlib pcap file]] - [[File:ns3-500-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
 &lt;br /&gt;
==== Test 6: 5000 byte block ( &amp;gt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
* PCAP Files: [[File:ltplib-5000-all-green.pcap| LTPlib pcap file]] - [[File:ns3-5000-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=6&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9228</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9228"/>
		<updated>2015-01-08T17:37:06Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Protocol Validation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Default build is intended for (http://artes.esa.int/projects/mudsat-dtn-m2m-satellite-applications). This includes an implementation specific behaviour: MUDSAT blcok re-tx control (mutiple re-transmission of green data segments).&lt;br /&gt;
&lt;br /&gt;
This is not specified in the RFC. In order to avoid it, manually remove this line:&lt;br /&gt;
&lt;br /&gt;
 File: include/ltp_int.h&lt;br /&gt;
 Line 49:/// This is for the MUDSAT build, TODO:  make this a configure param later&lt;br /&gt;
 Line 50:#define MUDSAT&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To perform tests use parameters -testType and -testNum:&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=0&amp;quot;&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=rx -testNum=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Test numbers are assigned according to the following section.&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=1&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=2&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data ====&lt;br /&gt;
&lt;br /&gt;
LTPlib follows this optional approach: RFC 5326 - 4.1. Transmission Request&lt;br /&gt;
&lt;br /&gt;
   For bandwidth efficiency reasons, implementations MAY choose to instead mark the&lt;br /&gt;
   entire segment (within which the red-part boundary falls) as red-&lt;br /&gt;
   part, causing green-part data falling within the segment to also be&lt;br /&gt;
   treated as red-part.&lt;br /&gt;
&lt;br /&gt;
The whole segment is marked as RED.&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
NS-3 emu&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Red Data - Type (0x03 - Red Data, Checkpoint , EORP). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Red Data - Type (0x07 - Green Data, Checkpoint , EOB). &lt;br /&gt;
&lt;br /&gt;
Despite of that interoperability is possible and the full block is successfully transmitted.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=3&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 200 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data ====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 2 red segments and 2 Green Segments. &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x00 - Red Data)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x02 - Red Data, EORP)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x04 - Green Data)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Type (0x07 - Green Data, EOB)&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
&lt;br /&gt;
LTPlib specific behaviour: closing an open socket associated to an unfinished block generates a CS segment. &lt;br /&gt;
&lt;br /&gt;
IMO the all-green case is not being properly handled.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=5&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* PCAP Files: [[File:ltplib-500-all-green.pcap| LTPlib pcap file]] - [[File:ns3-500-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
 &lt;br /&gt;
==== Test 6: 5000 byte block ( &amp;gt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
* PCAP Files: [[File:ltplib-5000-all-green.pcap| LTPlib pcap file]] - [[File:ns3-5000-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=6&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9227</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9227"/>
		<updated>2015-01-08T16:43:22Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Protocol Validation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Default build is intended for (http://artes.esa.int/projects/mudsat-dtn-m2m-satellite-applications). This includes an implementation specific behaviour: MUDSAT blcok re-tx control (mutiple re-transmission of green data segments).&lt;br /&gt;
&lt;br /&gt;
This is not specified in the RFC. In order to avoid it, manually remove this line:&lt;br /&gt;
&lt;br /&gt;
 File: include/ltp_int.h&lt;br /&gt;
 Line 49:/// This is for the MUDSAT build, TODO:  make this a configure param later&lt;br /&gt;
 Line 50:#define MUDSAT&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To perform tests use parameters -testType and -testNum:&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=0&amp;quot;&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=rx -testNum=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Test numbers are assigned according to the following section.&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=1&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=2&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data ====&lt;br /&gt;
&lt;br /&gt;
Both implementations follow this optional approach: RFC 5326 - 4.1. Transmission Request&lt;br /&gt;
&lt;br /&gt;
   For bandwidth efficiency reasons, implementations MAY choose to instead mark the&lt;br /&gt;
   entire segment (within which the red-part boundary falls) as red-&lt;br /&gt;
   part, causing green-part data falling within the segment to also be&lt;br /&gt;
   treated as red-part.&lt;br /&gt;
&lt;br /&gt;
The whole segment is marked as RED.&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2. Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:ltplib-500-mixed.pcap| LTPlib pcap file]] - [[File:ns3-500-mixed.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=3&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 200 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data ====&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
&lt;br /&gt;
LTPlib specific behaviour: closing an open socket associated to an unfinished block generates a CS segment. &lt;br /&gt;
&lt;br /&gt;
IMO the all-green case is not being properly handled.&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=5&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* PCAP Files: [[File:ltplib-500-all-green.pcap| LTPlib pcap file]] - [[File:ns3-500-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
 &lt;br /&gt;
==== Test 6: 5000 byte block ( &amp;gt; MTU) , all green data (SUCCESS) ====&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x04 (Green Data).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*LTPlib only: 10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
* PCAP Files: [[File:ltplib-5000-all-green.pcap| LTPlib pcap file]] - [[File:ns3-5000-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=6&amp;quot;&lt;br /&gt;
 ltpd -v -m C -w 0 -R 0 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9226</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9226"/>
		<updated>2015-01-08T15:25:35Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Protocol Validation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Default build is intended for (http://artes.esa.int/projects/mudsat-dtn-m2m-satellite-applications). This includes an implementation specific behaviour: MUDSAT blcok re-tx control (mutiple re-transmission of green data segments).&lt;br /&gt;
&lt;br /&gt;
This is not specified in the RFC. In order to avoid it, manually remove this line:&lt;br /&gt;
&lt;br /&gt;
 File: include/ltp_int.h&lt;br /&gt;
 Line 49:/// This is for the MUDSAT build, TODO:  make this a configure param later&lt;br /&gt;
 Line 50:#define MUDSAT&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To perform tests use parameters -testType and -testNum:&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=0&amp;quot;&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=rx -testNum=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Test numbers are assigned according to the following section.&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
*  Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data ====&lt;br /&gt;
&lt;br /&gt;
Note:  LTPLib marks the whole segment as RED.&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data ====&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data ====&lt;br /&gt;
&lt;br /&gt;
NS-3 Emu :&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
LTPLib :&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
&lt;br /&gt;
LTPlib specific behaviour: closing an open socket associated to an unfinished block of data generates a CS segment. &lt;br /&gt;
&lt;br /&gt;
IMO the all-green case is not being properly handled.&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
&lt;br /&gt;
* PCAP Files: [[File:ltplib-500-all-green.pcap| LTPlib pcap file]] - [[File:ns3-500-all-green.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Test 6: 5000 byte block ( &amp;gt; MTU) , all green data ====&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9225</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9225"/>
		<updated>2015-01-08T14:44:23Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Test 5: 500 byte block ( &amp;lt; MTU) , all green data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To perform tests use parameters -testType and -testNum:&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=0&amp;quot;&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=rx -testNum=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Test numbers are assigned according to the following section.&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
*  Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data ====&lt;br /&gt;
&lt;br /&gt;
Note:  LTPLib marks the whole segment as RED.&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data ====&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data ====&lt;br /&gt;
&lt;br /&gt;
NS-3 Emu :&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
&lt;br /&gt;
LTPLib :&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
&lt;br /&gt;
MUDSAT blcok re-tx ctr to 2: this is an implementation specific behaviour intended for  (http://artes.esa.int/projects/mudsat-dtn-m2m-satellite-applications).&lt;br /&gt;
&lt;br /&gt;
It is not specified in the RFC.&lt;br /&gt;
&lt;br /&gt;
Manually remove this line from include/ltp_int.h&lt;br /&gt;
&lt;br /&gt;
 /// This is for the MUDSAT build, TODO:  make this a configure param later&lt;br /&gt;
 #define MUDSAT&lt;br /&gt;
&lt;br /&gt;
==== Test 6: 5000 byte block, all green data ====&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9224</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9224"/>
		<updated>2015-01-08T14:20:49Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Test 5: 500 byte block ( &amp;lt; MTU) , all green data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To perform tests use parameters -testType and -testNum:&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=0&amp;quot;&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=rx -testNum=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Test numbers are assigned according to the following section.&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
*  Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data ====&lt;br /&gt;
&lt;br /&gt;
Note:  LTPLib marks the whole segment as RED.&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data ====&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data ====&lt;br /&gt;
&lt;br /&gt;
NS-3 Emu :&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
&lt;br /&gt;
LTPLib :&lt;br /&gt;
&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
*10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
&lt;br /&gt;
==== Test 6: 5000 byte block, all green data ====&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9223</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9223"/>
		<updated>2015-01-08T14:20:29Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Test 5: 500 byte block ( &amp;lt; MTU) , all green data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To perform tests use parameters -testType and -testNum:&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=0&amp;quot;&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=rx -testNum=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Test numbers are assigned according to the following section.&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
*  Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data ====&lt;br /&gt;
&lt;br /&gt;
Note:  LTPLib marks the whole segment as RED.&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data ====&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data ====&lt;br /&gt;
&lt;br /&gt;
NS-3 Emu :&lt;br /&gt;
&lt;br /&gt;
10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
&lt;br /&gt;
LTPLib :&lt;br /&gt;
&lt;br /&gt;
10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
10.0.0.1 --&amp;gt; 10.0.0.2. Type 0x07 (Green Data, EOB).&lt;br /&gt;
10.0.0.1 --&amp;gt; 10.0.0.2. Type 0xC ( Cancel from Sender).&lt;br /&gt;
&lt;br /&gt;
==== Test 6: 5000 byte block, all green data ====&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9222</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9222"/>
		<updated>2015-01-08T09:51:52Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Client using NS-3 emu - Node 1 (10.0.0.1) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To perform tests use parameters -testType and -testNum:&lt;br /&gt;
&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=nominal -testNum=0&amp;quot;&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu -testType=rx -testNum=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Test numbers are assigned according to the following section.&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
*  Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data ====&lt;br /&gt;
&lt;br /&gt;
Note:  LTPLib marks the whole segment as RED.&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data ====&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data ====&lt;br /&gt;
&lt;br /&gt;
Note: LTPlib sends 3 copies of the same segment, Type 0x07 (Green Data, EOB) followed by a Cancellation from Sender Segment.&lt;br /&gt;
&lt;br /&gt;
==== Test 6: 5000 byte block, all green data ====&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9221</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9221"/>
		<updated>2015-01-08T09:45:53Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Test 5: 500 byte block ( &amp;lt; MTU) , all green data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; data ( 5000, 65);&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
*  Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data ====&lt;br /&gt;
&lt;br /&gt;
Note:  LTPLib marks the whole segment as RED.&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data ====&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data ====&lt;br /&gt;
&lt;br /&gt;
Note: LTPlib sends 3 copies of the same segment, Type 0x07 (Green Data, EOB) followed by a Cancellation from Sender Segment.&lt;br /&gt;
&lt;br /&gt;
==== Test 6: 5000 byte block, all green data ====&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9220</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9220"/>
		<updated>2015-01-08T09:45:22Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Test 5: 500 byte block ( &amp;lt; MTU) , all green data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; data ( 5000, 65);&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
*  Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data ====&lt;br /&gt;
&lt;br /&gt;
Note:  LTPLib marks the whole segment as RED.&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data ====&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data ====&lt;br /&gt;
&lt;br /&gt;
Note: LTPlib sends 3 copies of the same segment (Type 0x07 - Green Data, EOB) followed by a Cancelation from Sender Segment.&lt;br /&gt;
&lt;br /&gt;
==== Test 6: 5000 byte block, all green data ====&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9219</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9219"/>
		<updated>2015-01-07T17:14:16Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Server running LTPlib - Node 2 (10.0.0.2) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in server mode on 10.0.0.2 and specify 10.0.0.1 as the source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; data ( 5000, 65);&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
*  Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data ====&lt;br /&gt;
&lt;br /&gt;
Note:  LTPLib marks the whole segment as RED.&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data ====&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data ====&lt;br /&gt;
&lt;br /&gt;
Note: LTPlib sends 3 copies of the same segment followed by a Cancelation from Sender Segment.&lt;br /&gt;
&lt;br /&gt;
==== Test 6: 5000 byte block, all green data ====&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9218</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9218"/>
		<updated>2015-01-07T17:13:08Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Client using LTPlib - Node 1 (10.0.0.1) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in 10.0.0.2 2 as server and specify 10.0.0.1 as source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
* Using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
* Block data is specified in file: ltpd.in.&lt;br /&gt;
&lt;br /&gt;
* In order to send green data the '-R' (length of red data) parameter must be used with a value smaller than the size of the block.&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m C -R 100 -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; data ( 5000, 65);&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
*  Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data ====&lt;br /&gt;
&lt;br /&gt;
Note:  LTPLib marks the whole segment as RED.&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data ====&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data ====&lt;br /&gt;
&lt;br /&gt;
Note: LTPlib sends 3 copies of the same segment followed by a Cancelation from Sender Segment.&lt;br /&gt;
&lt;br /&gt;
==== Test 6: 5000 byte block, all green data ====&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9217</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9217"/>
		<updated>2015-01-07T17:06:15Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Nominal operation tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in 10.0.0.2 2 as server and specify 10.0.0.1 as source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
Node 1: using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
Block data is specified in file: ltpd.in&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; data ( 5000, 65);&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block ( &amp;lt; MTU ) full red data.  (SUCCESS)====&lt;br /&gt;
*  Data block is sent in a single segment - Type (0x03 - Red Data, Checkpoint , EORP, EOB). &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-500.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-500.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block( &amp;gt; MTU ) full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data Block is split into 4 red segments. &lt;br /&gt;
* 1st to 3th Segment Type (0x00 - Red Data). 4th Segment Type (0x03 - Red Data, Checkpoint , EORP, EOB)&lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 500 byte block ( &amp;lt; MTU) , 200 bytes red and 300 bytes green data ====&lt;br /&gt;
&lt;br /&gt;
Note:  LTPLib marks the whole segment as RED.&lt;br /&gt;
&lt;br /&gt;
==== Test 4: 5000 byte block ( &amp;gt; MTU), red data and green data ====&lt;br /&gt;
&lt;br /&gt;
==== Test 5: 500 byte block ( &amp;lt; MTU) , all green data ====&lt;br /&gt;
&lt;br /&gt;
Note: LTPlib sends 3 copies of the same segment followed by a Cancelation from Sender Segment.&lt;br /&gt;
&lt;br /&gt;
==== Test 6: 5000 byte block, all green data ====&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9216</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9216"/>
		<updated>2015-01-07T16:38:49Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Test 1: 500 byte block, full red data. - Received and ACKed. (SUCCESS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in 10.0.0.2 2 as server and specify 10.0.0.1 as source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
Node 1: using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
Block data is specified in file: ltpd.in&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; data ( 5000, 65);&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block, full red data. - Received and ACKed. (SUCCESS)====&lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Data block is sent in a single segment - Type (0x03) - Red Data, Checkpoint , EORP, EOB. &lt;br /&gt;
* 10.0.0.1 &amp;lt;--- 10.0.0.2.  Report Segment - Type (0x08). &lt;br /&gt;
* 10.0.0.1 ---&amp;gt; 10.0.0.2. Report ACK Segment - Type (0x09).&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block, full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
* Data Block is split into 4 red segments. Last segment contains EOB. 10.0.0.1 ==&amp;gt; 10.0.0.2&lt;br /&gt;
* Report Segment is sent. 10.0.0.1 &amp;lt;== 10.0.0.2&lt;br /&gt;
* Report Segment is ACKed. 10.0.0.1 ==&amp;gt; 10.0.0.2&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 5000 byte block, red data and green data ====&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9215</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9215"/>
		<updated>2015-01-07T15:58:41Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Test 2: 5000 byte block, full red data. (SUCCESS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in 10.0.0.2 2 as server and specify 10.0.0.1 as source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
Node 1: using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
Block data is specified in file: ltpd.in&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; data ( 5000, 65);&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block, full red data. - Received and ACKed. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block, full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
* Data Block is split into 4 red segments. Last segment contains EOB. 10.0.0.1 ==&amp;gt; 10.0.0.2&lt;br /&gt;
* Report Segment is sent. 10.0.0.1 &amp;lt;== 10.0.0.2&lt;br /&gt;
* Report Segment is ACKed. 10.0.0.1 ==&amp;gt; 10.0.0.2&lt;br /&gt;
* PCAP Files: [[File:node1-ltplib-blockSize-5000.pcap| LTPlib pcap file]] - [[File:node1-ns3-blockSize-5000.pcap| NS3-emu pcap file]]&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 5000 byte block, red data and green data ====&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9214</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9214"/>
		<updated>2015-01-07T15:51:41Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Protocol Validation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
== Validation ==&lt;br /&gt;
&lt;br /&gt;
* LTP is run over UDP. Layer 2 MTU is set to 1500 bytes.&lt;br /&gt;
* Node 2 acts as a server and runs LTPlib.&lt;br /&gt;
* Node 1 acts as client and uses both LTPlib and NS-3 emulation (for comparison purposes).&lt;br /&gt;
&lt;br /&gt;
==== Server running LTPlib - Node 2 (10.0.0.2)  ====&lt;br /&gt;
Run LTPlib in 10.0.0.2 2 as server and specify 10.0.0.1 as source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
==== Client using LTPlib - Node 1 (10.0.0.1) ====&lt;br /&gt;
&lt;br /&gt;
Node 1: using LTPLib as client.&lt;br /&gt;
&lt;br /&gt;
  ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
Block data is specified in file: ltpd.in&lt;br /&gt;
&lt;br /&gt;
==== Client using NS-3 emu - Node 1 (10.0.0.1)  ====&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Block data is specified in script as std::vector&amp;lt;uint8_t&amp;gt; data ( 5000, 65);&lt;br /&gt;
&lt;br /&gt;
=== Nominal operation tests ===&lt;br /&gt;
&lt;br /&gt;
====Test 1: 500 byte block, full red data. - Received and ACKed. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
====Test 2: 5000 byte block, full red data. (SUCCESS)====&lt;br /&gt;
&lt;br /&gt;
Behaviour is analogous for both implementations (only minor changes in sizes and serial numbers).&lt;br /&gt;
&lt;br /&gt;
* Data Block is split into 4 red segments. Last segment contains EOB. 10.0.0.1 ==&amp;gt; 10.0.0.2&lt;br /&gt;
* Report Segment is sent. 10.0.0.1 &amp;lt;== 10.0.0.2&lt;br /&gt;
* Report Segment is ACKed. 10.0.0.1 ==&amp;gt; 10.0.0.2&lt;br /&gt;
* PCAP Files: node1-ltplib.pcap - node1-ns3.pcap&lt;br /&gt;
&lt;br /&gt;
==== Test 3: 5000 byte block, red data and green data ====&lt;br /&gt;
&lt;br /&gt;
=== Retransmission tests ===&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9213</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9213"/>
		<updated>2015-01-05T18:45:39Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
=== Node 2 (10.0.0.2) ===&lt;br /&gt;
Run LTPlib in 10.0.0.2 2 as server and specify 10.0.0.1 as source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
=== Node 1 (10.0.0.1) ===&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
&lt;br /&gt;
Nominal operation.&lt;br /&gt;
&lt;br /&gt;
*Test 1: 500 byte block, full red data. - Received and ACKed. (SUCCESS)&lt;br /&gt;
*Test 2: 5000 bytes block, full red data. - Received and ACKed. (SUCCESS)&lt;br /&gt;
&lt;br /&gt;
Node 1: using LTPLib as client with block data: ltpd.in&lt;br /&gt;
 ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
node1-ltplib.pcap&lt;br /&gt;
&lt;br /&gt;
Node 1: using ns-3 implementation as client with block data: std::vector&amp;lt;uint8_t&amp;gt; data ( 5000, 65);&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot; &lt;br /&gt;
node1-ns3.pcap&lt;br /&gt;
&lt;br /&gt;
*Test 3: 5000 byte block, red data and green data.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9212</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9212"/>
		<updated>2015-01-05T18:39:28Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
=== Node 2 (10.0.0.2) ===&lt;br /&gt;
Run LTPlib in 10.0.0.2 2 as server and specify 10.0.0.1 as source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
=== Node 1 (10.0.0.1) ===&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
&lt;br /&gt;
Nominal operation.&lt;br /&gt;
&lt;br /&gt;
*Test 1: 500 byte block, full red data. - Received and ACKed. (SUCCESS)&lt;br /&gt;
*Test 2: 5000 bytes block, full red data. - Received and ACKed. (SUCCESS)&lt;br /&gt;
&lt;br /&gt;
LTPLib block data: ltpd.in&lt;br /&gt;
 ltpd -v -m C -D 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
node1-ltplib.pcap&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot; &lt;br /&gt;
node1-ns3.pcap&lt;br /&gt;
*Test 3: 5000 byte block, red data and green data.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9209</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9209"/>
		<updated>2014-12-31T20:01:15Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Protocol Validation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
=== Node 2 (10.0.0.2) ===&lt;br /&gt;
Run LTPlib in 10.0.0.2 2 as server and specify 10.0.0.1 as source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
=== Node 1 (10.0.0.1) ===&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
&lt;br /&gt;
Test 1: 500 byte block, full red data, no losses. - Received and ACKed. (SUCCESS)&lt;br /&gt;
&lt;br /&gt;
Test 2: 1000 byte block, red data and green data.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9208</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9208"/>
		<updated>2014-12-31T19:57:57Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Node 2 (10.0.0.2) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
== Node 2 (10.0.0.2) ==&lt;br /&gt;
Run LTPlib in 10.0.0.2 2 as server and specify 10.0.0.1 as source (use ltp-deepspace IATA defined port in both sides).&lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
== Node 1 (10.0.0.1) ==&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9207</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9207"/>
		<updated>2014-12-31T19:55:50Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
== Node 2 (10.0.0.2) ==&lt;br /&gt;
Run LTPlib server mode in 10.0.0.2/24 &lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
== Node 1 (10.0.0.1) ==&lt;br /&gt;
&lt;br /&gt;
Set eth0 to prosmiscuous mode:&lt;br /&gt;
&lt;br /&gt;
 ifconfig eth0 promisc&lt;br /&gt;
&lt;br /&gt;
cd into ns-3 directory and run:&lt;br /&gt;
 ./waf --run &amp;quot;scratch/ltp-emu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9206</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9206"/>
		<updated>2014-12-29T17:17:58Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
 [[File:Core-tcp-scenario.png]]&lt;br /&gt;
&lt;br /&gt;
Notes on installation of LTPlib:&lt;br /&gt;
&lt;br /&gt;
 autoreconf --install&lt;br /&gt;
 ./configure &lt;br /&gt;
 sudo apt-get install libssl-dev (required library not being checked by configure)&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Run LTPlib server mode in 10.0.0.2/24 &lt;br /&gt;
&lt;br /&gt;
 ltpd -v -m S -L 10.0.0.2:1113 -S 10.0.0.2:1113 -D 10.0.0.1:1113&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9205</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9205"/>
		<updated>2014-12-29T16:56:23Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Protocol Validation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
Topology setup: two nodes connected with a point to point link&lt;br /&gt;
&lt;br /&gt;
 10.0.0.1/24 &amp;lt;-------------&amp;gt; 10.0.0.2/24&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9204</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=9204"/>
		<updated>2014-12-29T16:50:16Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Protocol Validation =&lt;br /&gt;
The validation is performed using The Common Open Research Emulator (CORE).&lt;br /&gt;
Ns-3 implementation is validated for interoperability against LTPLib [https://down.dsg.cs.tcd.ie/ltplib/]&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
Start core daemon.&lt;br /&gt;
&lt;br /&gt;
 sudo /etc/init.d/core-daemon start&lt;br /&gt;
&lt;br /&gt;
Run core-gui.&lt;br /&gt;
&lt;br /&gt;
 core-gui&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8927</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8927"/>
		<updated>2014-08-11T14:08:35Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Final Code Review ==&lt;br /&gt;
&lt;br /&gt;
The final code review for the project can be found in [1], this review contains the final version of the model, including a helper, examples, tests and documentation.&lt;br /&gt;
&lt;br /&gt;
The provided test-suites can be run as follows:&lt;br /&gt;
     ./test.py -s ltp-protocol&lt;br /&gt;
     ./test.py -s ltp-channel-loss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://codereview.appspot.com/123190043/&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8926</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8926"/>
		<updated>2014-08-11T14:02:02Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* 3. Retransmission based reliability */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8925</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8925"/>
		<updated>2014-08-11T14:01:44Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data + Retrams CP. ''' DONE (merged both cases together)'''# &lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8922</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8922"/>
		<updated>2014-08-08T00:07:03Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data. ''' DONE'''&lt;br /&gt;
# Retrams CP.&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8921</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8921"/>
		<updated>2014-08-05T15:10:59Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* 3. Retransmission based reliability */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data.&lt;br /&gt;
# Retrams CP.&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS: '''DONE'''&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8920</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8920"/>
		<updated>2014-08-04T13:48:20Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Partially taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data.&lt;br /&gt;
# Retrams CP.&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS:&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8919</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8919"/>
		<updated>2014-08-04T13:47:42Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* 3. Retransmission based reliability */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Not taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.'''DONE'''&lt;br /&gt;
# Retrams Data.&lt;br /&gt;
# Retrams CP.&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS:&lt;br /&gt;
# Stop RS timer.'''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8915</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8915"/>
		<updated>2014-07-23T11:00:23Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Not taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer. '''DONE'''&lt;br /&gt;
# Start RS Timer.&lt;br /&gt;
# Retrams Data.&lt;br /&gt;
# Retrams CP.&lt;br /&gt;
# Stop CP Timer. '''DONE'''&lt;br /&gt;
# Retrans RS:&lt;br /&gt;
# Stop RS timer.&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8909</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8909"/>
		<updated>2014-07-22T11:01:12Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* 3. Retransmission based reliability */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Not taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Send RAS. '''DONE'''&lt;br /&gt;
# Start CP Timer.&lt;br /&gt;
# Start RS Timer.&lt;br /&gt;
# Retrams Data.&lt;br /&gt;
# Retrams CP.&lt;br /&gt;
# Stop CP Timer.&lt;br /&gt;
# Retrans RS:&lt;br /&gt;
# Stop RS timer.&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8908</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8908"/>
		<updated>2014-07-21T23:01:06Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* 1. Basic data transmission */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. '''DONE''' (No Cancellation sent for now)&lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Not taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Start CP Timer.&lt;br /&gt;
# Start RS Timer.&lt;br /&gt;
# Retrams Data.&lt;br /&gt;
# Retrams CP.&lt;br /&gt;
# Stop CP Timer.&lt;br /&gt;
# Retrans RS:&lt;br /&gt;
# Stop RS timer.&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8907</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8907"/>
		<updated>2014-07-21T22:59:16Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. &lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Not taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP. '''DONE''' (Only syncronous checkpoints for now).&lt;br /&gt;
# Send RS. '''DONE'''&lt;br /&gt;
# Start CP Timer.&lt;br /&gt;
# Start RS Timer.&lt;br /&gt;
# Retrams Data.&lt;br /&gt;
# Retrams CP.&lt;br /&gt;
# Stop CP Timer.&lt;br /&gt;
# Retrans RS:&lt;br /&gt;
# Stop RS timer.&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8905</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8905"/>
		<updated>2014-07-19T16:38:15Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Convergence Layer Adapter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP sent''', '''RS sent''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. &lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Not taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP.&lt;br /&gt;
# Send RS.&lt;br /&gt;
# Start CP Timer.&lt;br /&gt;
# Start RS Timer.&lt;br /&gt;
# Retrams Data.&lt;br /&gt;
# Retrams CP.&lt;br /&gt;
# Stop CP Timer.&lt;br /&gt;
# Retrans RS:&lt;br /&gt;
# Stop RS timer.&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8904</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8904"/>
		<updated>2014-07-18T12:23:09Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP received''', '''RS received''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. &lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE (Not taking RPs into account)'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP.&lt;br /&gt;
# Send RS.&lt;br /&gt;
# Start CP Timer.&lt;br /&gt;
# Start RS Timer.&lt;br /&gt;
# Retrams Data.&lt;br /&gt;
# Retrams CP.&lt;br /&gt;
# Stop CP Timer.&lt;br /&gt;
# Retrans RS:&lt;br /&gt;
# Stop RS timer.&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8903</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8903"/>
		<updated>2014-07-18T12:20:45Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* 1. Basic data transmission */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP received''', '''RS received''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. &lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure. '''DONE'''&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP.&lt;br /&gt;
# Send RS.&lt;br /&gt;
# Start CP Timer.&lt;br /&gt;
# Start RS Timer.&lt;br /&gt;
# Retrams Data.&lt;br /&gt;
# Retrams CP.&lt;br /&gt;
# Stop CP Timer.&lt;br /&gt;
# Retrans RS:&lt;br /&gt;
# Stop RS timer.&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8902</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8902"/>
		<updated>2014-07-18T12:20:33Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* 1. Basic data transmission */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP received''', '''RS received''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. &lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment. '''DONE'''&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure.&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP.&lt;br /&gt;
# Send RS.&lt;br /&gt;
# Start CP Timer.&lt;br /&gt;
# Start RS Timer.&lt;br /&gt;
# Retrams Data.&lt;br /&gt;
# Retrams CP.&lt;br /&gt;
# Stop CP Timer.&lt;br /&gt;
# Retrans RS:&lt;br /&gt;
# Stop RS timer.&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8892</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8892"/>
		<updated>2014-07-16T14:12:03Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP received''', '''RS received''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. &lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part. '''DONE'''&lt;br /&gt;
# Signify Green Data Segment.&lt;br /&gt;
# Signify Transmission Completed. '''DONE'''&lt;br /&gt;
# Stop Transmission procedure.&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP.&lt;br /&gt;
# Send RS.&lt;br /&gt;
# Start CP Timer.&lt;br /&gt;
# Start RS Timer.&lt;br /&gt;
# Retrams Data.&lt;br /&gt;
# Retrams CP.&lt;br /&gt;
# Stop CP Timer.&lt;br /&gt;
# Retrans RS:&lt;br /&gt;
# Stop RS timer.&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8876</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8876"/>
		<updated>2014-07-14T11:02:54Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP received''', '''RS received''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues. '''DONE'''&lt;br /&gt;
# Start Transmission procedure. '''DONE'''&lt;br /&gt;
# Drop packet procedures. &lt;br /&gt;
# Handle Miscolored segments. '''DONE'''&lt;br /&gt;
# Notifications to Client Service instance. '''DONE'''&lt;br /&gt;
# Signify Red Part.&lt;br /&gt;
# Signify Green Data Segment.&lt;br /&gt;
# Signify Transmission Completed.&lt;br /&gt;
# Stop Transmission procedure.&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP.&lt;br /&gt;
# Send RS.&lt;br /&gt;
# Start CP Timer.&lt;br /&gt;
# Start RS Timer.&lt;br /&gt;
# Retrams Data.&lt;br /&gt;
# Retrams CP.&lt;br /&gt;
# Stop CP Timer.&lt;br /&gt;
# Retrans RS:&lt;br /&gt;
# Stop RS timer.&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8875</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8875"/>
		<updated>2014-07-13T17:04:02Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: /* Features ordered by priority */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP received''', '''RS received''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
=== 1. Basic data transmission ===&lt;br /&gt;
# Link state cues.&lt;br /&gt;
# Start Transmission procedure.&lt;br /&gt;
# Stop Transmission procedure.&lt;br /&gt;
# Drop packet procedures.&lt;br /&gt;
# Handle Miscolored segments.&lt;br /&gt;
# Notifications to Client Service instance.&lt;br /&gt;
# Signify Red Part&lt;br /&gt;
# Signify Green Data Segment&lt;br /&gt;
# Signify Transmission Completed&lt;br /&gt;
# Stop Transmission procedure&lt;br /&gt;
&lt;br /&gt;
=== 2. Model validation ===&lt;br /&gt;
# Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
# Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
=== 3. Retransmission based reliability ===&lt;br /&gt;
# Send CP.&lt;br /&gt;
# Send RS.&lt;br /&gt;
# Start CP Timer.&lt;br /&gt;
# Start RS Timer.&lt;br /&gt;
# Retrams Data.&lt;br /&gt;
# Retrams CP.&lt;br /&gt;
# Stop CP Timer.&lt;br /&gt;
# Retrans RS:&lt;br /&gt;
# Stop RS timer.&lt;br /&gt;
&lt;br /&gt;
=== 4. Cancellation ===&lt;br /&gt;
# Cancel Session (Send CX)&lt;br /&gt;
# Start Cancel Timer&lt;br /&gt;
# Cancel ACK (Send CAX)&lt;br /&gt;
# Stop Cancel Timer&lt;br /&gt;
# Retransmit CX&lt;br /&gt;
&lt;br /&gt;
=== 5. Advanced kwnoledge about environment and other considerations ===&lt;br /&gt;
# Management Information Base&lt;br /&gt;
# Suspend Timers&lt;br /&gt;
# Resume Timers&lt;br /&gt;
# Handle System Error conditions.&lt;br /&gt;
# Authentication Extensions.&lt;br /&gt;
# Security Extensions.&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8874</id>
		<title>GSOC2014LTP</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=GSOC2014LTP&amp;diff=8874"/>
		<updated>2014-07-13T13:25:47Z</updated>

		<summary type="html">&lt;p&gt;RubenMartinez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
Return to [[GSOC2014AcceptedProjects | GSoC 2014 Accepted Projects]] page.&lt;br /&gt;
&lt;br /&gt;
== Project overview ==&lt;br /&gt;
&lt;br /&gt;
* '''Project name:'''  Licklider Transmission Protocol (LTP).&lt;br /&gt;
&lt;br /&gt;
* '''Student:''' [mailto:rubenmartinez.vidal@gmail.com Rubén Martínez]&lt;br /&gt;
&lt;br /&gt;
* '''Mentors:''' [mailto:tomh@tomh.org Tom Henderson], [mailto:tommaso.pecorella@unifi.it Tommaso Pecorella]&lt;br /&gt;
&lt;br /&gt;
* '''Abstract:''' Licklider Transmission Protocol (LTP) is a point to point protocol for environments with long round-trip delays (such as deep space communications). This project will provide a RFC compliant implementation, it will consist of a ns-3 module with its corresponding testsuits, examples, helpers and documentation.&lt;br /&gt;
&lt;br /&gt;
* '''Code Repository ''': http://code.nsnam.org/rmartinez/ns-3-dev-ltp&lt;br /&gt;
&lt;br /&gt;
= Approach =&lt;br /&gt;
&lt;br /&gt;
This protocol can be deployed at two different leves: on top of either the Data-Link-Layer or the Transport Layer (UDP). The best approach should be to start with an UDP implementation, this will ensure compliance with already&lt;br /&gt;
existing implementations. A data-link-layer implementation can also be done depending on how the project advances, and will be be taken into consideration after the results of the mid-term review (see schedule section).&lt;br /&gt;
&lt;br /&gt;
== Development methodology ==&lt;br /&gt;
&lt;br /&gt;
I will use an iterative-incremental development methodology, each iteration will include implementation, documentation (doxygen style comments, thorough the source code), and testing. Development will be divided &lt;br /&gt;
on 3 main tasks:&lt;br /&gt;
&lt;br /&gt;
* Task 1: This task consist in developing the ltp-headers and a SDNV codec (Self-Delimiting Numeric Values) a type of data encoding used in DTN protocols. This task consist on defining several data-structures and their serialization/deserialization methods. &lt;br /&gt;
&lt;br /&gt;
* Task 2: This task will focus on developing the backbone of the protocol by defining the classes: ltp-packet-queues, ltp-session-records and the basic structure of the ltp-protocol. This will define the main data structures required in control logic used to handle: packets, sessions, protocol state, timers, etc. &lt;br /&gt;
* Task 3: This task will focus on the Send() and Receive() methods of the ltp-protocol class, these methods implement the control logic of the protocol.&lt;br /&gt;
&lt;br /&gt;
== Testing approach ==&lt;br /&gt;
&lt;br /&gt;
This project will have testing and cross-validation against existing implementations. &lt;br /&gt;
&lt;br /&gt;
First, testing will we performed as part of the development cycle. It will use a test case based approach using the standard methods provided by the ns-3 API in the form of the TestSuite and TestCase classes. This project will have two kind of tests:&lt;br /&gt;
&lt;br /&gt;
* Unit Tests: each task will have a group of test vectors, those tests will ensure that the internal workings of each developed class works in isolation.&lt;br /&gt;
* System tests: these tests will be provided mainly with examples, it will consist on using the developed module together with already tested ns-3 modules.&lt;br /&gt;
&lt;br /&gt;
Lastly, the implementation will be cross-validated against existing implementations of the LTP, such as ION-DTN (JPL) or LTPlib (Trinity College Dublin).  This cross-validation will be performed using a shared file descriptor to which both implementations can read or write traffic. The FdNetDevice class provided by the ns-3 API will be used to achieve this task.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== Block Diagram ===&lt;br /&gt;
[[File:Ltp-block-diagram.png]]&lt;br /&gt;
=== LTP Protocol Send Logic===&lt;br /&gt;
[[File:send-diagram.png|1000px]]&lt;br /&gt;
=== LTP Protocol Receive Logic===&lt;br /&gt;
[[File:Ltp-recieve-diagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
The final product of the project will be a ns-3 module, so the main deliverables will be the several sections of this module:&lt;br /&gt;
&lt;br /&gt;
* Deliverable 1 - model and helper: will contain the main functionalities of the protocol and the helper classes to simplify its  use. 	&lt;br /&gt;
         &lt;br /&gt;
::Deliverable 1.1 - Packet Headers and SDNV codec.    &lt;br /&gt;
::Deliverable 1.2 - LTP-Protocol auxiliary structures (Data Queues and Session State Records).&lt;br /&gt;
::Deliverable 1.3 - LTP-Protocol Core.&lt;br /&gt;
::Deliverable 1.4 - LtpNetDevice.&lt;br /&gt;
::Deliverable 1.5 - LtpStackHelper.&lt;br /&gt;
* Deliverable 2 - test: this deliverable will contain the several testsuits used.&lt;br /&gt;
&lt;br /&gt;
::Deliverable 2.1 - Unit Tests. Packet Headers and SDNV codec: check correctness.&lt;br /&gt;
::Deliverable 2.2 - Unit Tests, LTP-Protocol Auxiliary, check methods, timeouts and data handling correctness.&lt;br /&gt;
::Deliverable 2.3 - Unit Tests, NetDevice implementation, check methods.&lt;br /&gt;
::Deliverable 2.4 - Unit Tests: protocol implementation, communication between nodes, retransmissions, cancellation of communication.	 &lt;br /&gt;
&lt;br /&gt;
*Deliverable 3 - examples : this deliverable will contain several examples on how to install and use the protocol. &lt;br /&gt;
*Deliverable 4 - Cross-Validation: This deliverable will contain several tests using FdNetDevices to perform cross-validation with existing implementations. (4.1 early tests basic protocol, 4.2 final validation).&lt;br /&gt;
&lt;br /&gt;
= Schedule =&lt;br /&gt;
&lt;br /&gt;
*Week 1 - May 19 - May 25. '''D-1.1. D-2.1.'''&lt;br /&gt;
*Week 2 - May 26 - June 1.&lt;br /&gt;
*Week 3 - June 2 - June 8. '''D-1.2. D-2.2.'''&lt;br /&gt;
*week 4 - June 9 - June 15.&lt;br /&gt;
*Week 5 - June 16 - June 22.&lt;br /&gt;
*Week 6 - June 23 - June 29: Mid-Term Evaluation.&lt;br /&gt;
*Week 7 - June 30 - July 6. '''D-1.3. D-2.3. D-4.1.'''&lt;br /&gt;
*Week 8 - June 7 - July 13.&lt;br /&gt;
*Week 9 - July 14 - July 20. '''D-1.4.'''&lt;br /&gt;
*Week 10 - July 21 - July 27. '''D-1.5'''&lt;br /&gt;
*Week 11 - July 28 - August 3. ''' D-3, D-2.4'''&lt;br /&gt;
*Week 12 - August 4 - August 10. '''D-4.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mid Term Review ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code is composed of 2 patches in Rietveld issues 97540043 [1] and&lt;br /&gt;
105340046 [2]. &lt;br /&gt;
&lt;br /&gt;
The first corresponds to the SDNV [3] encoding supportused in DTN protocols, from which I contributed the test-suite.&lt;br /&gt;
&lt;br /&gt;
The second is a partial implementation of the LTP protocol containing:&lt;br /&gt;
packet data structures, protocol management classes and basic API&lt;br /&gt;
functions for communication with higher layer protocols.&lt;br /&gt;
&lt;br /&gt;
To run test suites, the command is ./test.py -s ltp-protocol. Additionally the interested&lt;br /&gt;
reader can look at the ltp-protocol.rst document, or the wiki page [4] for details on the purpose of each class and how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
*[1] https://codereview.appspot.com/97540043/&lt;br /&gt;
*[2] https://codereview.appspot.com/105340046/&lt;br /&gt;
*[3] http://www.dtnrg.org/wiki/SDNV&lt;br /&gt;
*[4] http://www.nsnam.org/wiki/GSOC2014LTP&lt;br /&gt;
&lt;br /&gt;
= List of Features =&lt;br /&gt;
&lt;br /&gt;
== Convergence Layer Adapter ==&lt;br /&gt;
*Link state cues (callbacks in convergence layer adapter) : '''Link Up''', '''Link Down''', '''CP received''', '''RS received''', '''EOB dequeued''', '''CX dequeued'''.&lt;br /&gt;
&lt;br /&gt;
== Ltp Core==&lt;br /&gt;
*Drop packet procedures: simple discard or Cancellation segment transmission.&lt;br /&gt;
*Start Transmission procedure: Event triggered on reception of '''Link Up''' signal. Response: dequeue and tx all packets.&lt;br /&gt;
*Start CP Timer: Event triggered on reception of '''CP received''' signal, Response: start CP timer.&lt;br /&gt;
*Stop CP timer : Event triggered on reception of RS segments, response: stop CP timer.&lt;br /&gt;
*Start RS Timer: Event triggered on reception of '''RS Timer''' signal, Response: start RS timer.&lt;br /&gt;
*Stop RS Timer: Event triggered by reception of RA, response: stop RS timer.&lt;br /&gt;
*Start Cancel Timer: Event triggered on reception of '''CX dequeued''', response: start cancel timer.&lt;br /&gt;
*Stop Cancel Timer: Event triggered on reception of CAX segment, response: stop cancel timer.&lt;br /&gt;
*Stop Transmission procedure: Event triggered on reception of '''Link Down''', Response: start dequeing of segments.&lt;br /&gt;
*Suspend Timers: Event triggered on reception of '''Remote peer link Down''', Response: suspend timers.&lt;br /&gt;
*Resume Timers: Event triggered on reception of '''Remote peer link Up''', Response: resume timers.&lt;br /&gt;
*Retrans CP: Event triggered by expiration of CP timer, Response: Check Retransmission limit, enqueue new CP segment.&lt;br /&gt;
*Retrans RS: Event triggered by expiration of RS timer, Response: Check Retransmission limit, enqueue new RS segment.&lt;br /&gt;
*Signify Red Part: Reception of EORP and CP, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Green Data Segment: Reception of GD segment, response: Send notification to Client Service instance.&lt;br /&gt;
*Signify Transmission Completed: All data transmited (signal '''EOB dequeued''') and RP ackd, response: send notification to client service instance and start Close session.&lt;br /&gt;
*Send RP: Original reception of regular CP or asynchronous CP. Response: perform checks then: 1. drop and send CR OR 2. compute bounds of reception claim and send RP.&lt;br /&gt;
*Retrans Data: triggered on reception of RS, response: Send RA segment, stop CP timer, if reception claim indicates incomplete data reception: check retransmission limit then send CS if exceeded or retransmit missed Data segment if not.&lt;br /&gt;
*Retransmit Cancellation segment: triggered on expiration of Cancel timer. response: send copy of CX.&lt;br /&gt;
*ACK cancellation: triggered on reception of CX, response: if received CS send CAS, if received CR sned CAR.&lt;br /&gt;
*Cancel Session: triggered on reception of CAX, reponse: stop cancel timer and close session.&lt;br /&gt;
*Handle Miscolored segments: reception of red-part with offset higher than green-part. response: discard.&lt;br /&gt;
&lt;br /&gt;
== Other==&lt;br /&gt;
*Management Information Base: Database with times of operation of LTP engines, provides link state cues:  '''Remote peer link Up, Remote peer link Down'''.&lt;br /&gt;
*Handle System Error conditions.&lt;br /&gt;
*Notifications to Client Service instance: session start, green-part segment arrival, red-part reception, transmission session completion, transmission-session cancellation, reception-session cancellation, initial-transmission completion.&lt;br /&gt;
*Security Extensions.&lt;br /&gt;
*Integrate SOCIS 2013 bundle protocol implementation with LTP in a separate repo (Tom)&lt;br /&gt;
*Set up virtual machine environment with CORE network emulator to test interoperability against ns-3 implementation (Tom)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ordered by priority ==&lt;br /&gt;
&lt;br /&gt;
# Link state cues.&lt;br /&gt;
# Start Transmission procedure.&lt;br /&gt;
# Stop Transmission procedure.&lt;br /&gt;
# Drop packet procedures.&lt;br /&gt;
# Handle Miscolored segments.&lt;br /&gt;
# Notifications to Client Service instance.&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
= Weekly Reports =&lt;br /&gt;
&lt;br /&gt;
== Week 1  == &lt;br /&gt;
&lt;br /&gt;
'''Finished - Deliverables 1.1 and 2.1'''&lt;br /&gt;
&lt;br /&gt;
*Providing SDNV [http://www.dtnrg.org/wiki/SDNV] encoding support (this a numeric format commonly used on packet fields of DTN protocols). This encoding format was already implemented in Dizhi Zhou's BP [http://www.nsnam.org wiki/SOCIS2013BundleProtocolProject] project. I have expanded it with the corresponding test-suite and moved it to src/network/utils/, for use in both Bundle and LTP protocols. Currently under review in https://codereview.appspot.com/97540043/]&lt;br /&gt;
*Implementation of all LTP packet structures, this includes: Segment Header, Segment Trailer, and Content Header (for all segment variants: data, reports, report acknowledgments, etc.). The implementation including the corresponding tests and documentation.&lt;br /&gt;
&lt;br /&gt;
== Week 2  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Implementation of the Ltp queue-set, this is a class containing the dual queue structure (internal operations and application data) used for LTP outbound traffic. The implementation and the corresponding test case can be found on the project repository.&lt;br /&gt;
&lt;br /&gt;
*Implementation of the session state record, this is a class to keep track of the state of an LTP transmission session, this class is basically a wrapper that handles several flags, counters, timers and lists. An early version can be found in the project repository.&lt;br /&gt;
&lt;br /&gt;
== Week 3  == &lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.2 and 2.2 '''&lt;br /&gt;
&lt;br /&gt;
*Fixed several issues in the session state record.&lt;br /&gt;
*Provided a test-case for the session state record.&lt;br /&gt;
*Provided an early concept design for the LTP API.&lt;br /&gt;
&lt;br /&gt;
== Week 4 ==&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Finished the design of the LTP API functions used for interaction with the upper layer.&lt;br /&gt;
*Included all the required auxiliary structures inside the LTP core class.&lt;br /&gt;
*Performed minor fixes to auxiliary structures.&lt;br /&gt;
*Provided a test-case for the LTP API functions.&lt;br /&gt;
&lt;br /&gt;
== Week 5 ==&lt;br /&gt;
&lt;br /&gt;
'''Working on Deliverables 1.3 and 2.3 '''&lt;br /&gt;
&lt;br /&gt;
*Documentation: ltp-protocol.rst&lt;br /&gt;
*Preparing the mid-term review.&lt;br /&gt;
*Fixing issues in the LTP API class and small tweaks to auxiliary classes.&lt;br /&gt;
*Improving test-case class..&lt;/div&gt;</summary>
		<author><name>RubenMartinez</name></author>
	</entry>
</feed>