Friday, November 21, 2014

2.3.2 DTN Router vs. TCP/IP Router

Internet layer used TCP and IP protocols through the network. TCP operates at each end point of the path and manages end to end delivery of message segments. IP operates on all nodes on the path and routes message datagram. Internet routers as shown in Figure 2.18 do not need a transport layer for routing. They only implemented for maintenance purposes.

Figure 2.18: Internet Router [9]
In a DTN, the protocol stacks of all nodes include both bundle and transport layers. DTN gateways have the same double stack layers as DTN routers as shown in Figure 2.19. DTN gateways can run different lower layer protocols on each side of their double stack. This allows DTN gateway to span two regions that use different lower layer protocols.


Figure 2.19: DTN Router [9]

Wednesday, November 19, 2014

Netbeans IDE With Sencha Touch

1) Requirements:

i) Download the Netbeans IDE (I use the latest version 8):
https://netbeans.org/

ii) Download the latest Sencha plugin from here:
https://bitbucket.org/addicticks/nbplugin-senchacmd/downloads

iii) Download the Sencha Touch library from here(I use latest touch-2.4.1, rename it as touch):
http://www.sencha.com/

2) Create new project

Choose New>Java Web>Web Application. Press the Next button. Name the app “SenchaApp”. Choose the project location. Press the Next button.

Select Tomcat as the servers and click the Finish button.

3) Prepare Sencha App Structure

i) Inside web folder, create the app folder, views folder, models folder, controllers folder in NetBeans to add your javascript files into.

ii) Add previously download "touch" folder into web folder.

4) Add sencha library

i) Right click on the SenchaApp application and select Properties from the drop down menu

ii) Under the Libraries menu, choose “Add Libraries” and from the window that opens click “Create…”

iii) Name the Library “Sencha_Touch” and choose “Class Library” from the drop down.

iv) Under the “Classpath” tab, click on “Add JAR/Folder” and select the “touch” folder previously downloaded.

v) Click “OK” and choose the newly created “Sencha_Touch” library.

create an app.js file in the app folder. Type Ext followed by a “.” — If the steps above were followed correctly, the code completion should work.

5) Code/create your sencha touch application

6) Run Application

Hit Run.

Your application should start in the default browser with the url : localhost:8084/SenchaApp/

Reference: http://techtalktone.wordpress.com/2012/02/22/using-netbeans-ide-with-sencha-touch/

Monday, November 17, 2014

High CPU activity problem: Stop and disable AVGIDSagent service


AVG user mostly will experience CPU High activity. Computer become slow and hardly to use. This is because of AVGIDSagent service using a lot of the computer resources. Blame AVG for that.
To solve that problem, follow this guide:

1) At tray, Temporary disabled AVG protection.
2) Open Windows Services
3) Open AVGIDSagent service. Stopped the service by changed its status from “Automatic” to “Disabled”
4) Enable AVG protection again.

Everythng is back on high speed as normal.

Reference:
http://www.thefreewindows.com/16279/stop-disable-avgidsagent-service-reduce-cpu-activity/

7zip command to batch zip all folders and unzip all zip files

7zip is very usefull to do batch jobs through command line. I usually use these command and create a batch file for easy use later. Just simply put the command in text file and rename .txt as .bat.

This is command for batch unzip all zip files into each respective folders name:

@echo off
for /F "delims=" %%I IN (' dir /b /s /a-d *.zip ') DO (
    "c:\Program Files\7-Zip\7z.exe" x -y -o"%%~dpI\%%~nI" "%%I"
)
pause

This is command for batch zip all folders into each respective zips name:

for /d %%X in (*) do "c:\Program Files\7-Zip\7z.exe" a "%%X.zip" "%%X\"

Sunday, November 16, 2014

2.3 Comparison of TCP/IP and DTN

Internet layers and DTN layers are identical except that DTN architecture implements store and forward message switching by overlaying a new protocol layer called bundle layer. It is placed on top of Transport layers. The bundle layer ties together the Transport layers and below with application programs to communicate across multiple regions. Bundles are also called messages switched. The bundle layer stores and forwards entire bundles or bundle fragments between nodes. A single bundle layer protocol is used across all networks that make up a DTN. By contrast, the layers below the bundle layer which is transport layer and below are chosen for their appropriateness to the communication environment of each region.
Figure 2.14 shows the DTN layer compares to the Internet layer [9]. Bundle consists of a source-application user data, Control Information provided by source application and destination application which describes how to process, store, dispose and handle user data and a Bundle header. Bundles extend the hierarchy of data-object encapsulation performed by the Internet protocols.

Figure 2.14: Comparison Internet Protocol Layers with DTN Protocol Layers
Figure 2.15 shows how bundle-layer encapsulation works in the context of TCP/IP protocols. A bundle layer may break whole bundles or messages into fragments as an IP layer may break a whole datagram into fragments. If bundles are fragmented, the bundle layer at the final destination reassembles them.

Figure 2.15: Bundle Encapsulation [9]
            On intermittently connected links with long delays, conversational protocols such as TCP/IP that involves many end to end round trips may take impractical amounts of times or connectivity failure. To overcome this problem, DTN bundle layers communicate between themselves using simple sessions with minimal or no round trips as shown in Figure 2.16. Acknowledgement from the receiving node is depending on the class of service selected as shown in Figure 2.17. The lower layer protocols that support bundle layer exchange may of course follow the existing TCP. But on intermittently connected links with long delays, minimal conversational lower layer protocols can be implemented [9].

Figure 2.16: Minimal conversational lower layer protocols [9]
The bundle layer provides six classes of Bundle Services:
i.                    Custody Transfer: Responsible of data retransmission to an accepting node. The sending node can recover its retransmission resources. The accepting node returns a custodial acceptance acknowledgement to the previous custodian.
ii.                  Return Receipt: Confirmation to the source. It is a reply to the sender application that the bundle has been received by the destination application.
iii.                Custody Transfer Notification: Notify the source when a node accepts a custody transfer of the bundle.
iv.                Bundle Forwarding Notification: Notify the source when a bundle is forwarded to another node.
v.                  Priority of Delivery
vi.                Authentication: Verify sender identity and message integrity.
In this thesis, the bundle service class (i), (v) and (vi) is used to form a store and forward overlay network and provide the key capabilities of bundle protocol which is custody based retransmission and able to cope with intermittent connectivity [10].

Figure 2.17: Class of Bundle Service [9]

Thursday, November 13, 2014

2.2.2 Architecture of DTN

The DTN architecture implements store and forward message switching by overlaying the bundle layer on top of heterogeneous regional networks. Bundles also called messages (message switched). The bundle layer stores and forward bundle fragments between nodes. A single bundle layer protocol is used in all regional networks and make up a DTN.
DTN designed to use storage within the network to support the store and forward operation over a networking path as shown in Figure 2.8. IP end to end communication in between the source and destination must wait for complete path while DTN store and forward delivery did not need to wait for a complete path. DTN store and forward delivery will perform incremental progress without end to end path. 


Figure 2.8: Store and forward delivery
Application Data Units (ADUs) are a DTN-enabled application that sends messages of arbitrary length.  The bundle layer transformed the ADUs into "bundles" which is a one or more protocol data unit. Bundles are forwarded by DTN nodes and have two or more "blocks" of data as shown in Figure 2.9. 

Figure 2.9: Bundles
Application data or other information in each block used to deliver the containing bundle to its destinations.  Blocks used to hold information in the header or payload portion of protocol data units in other protocol architectures.  It is called "block" instead of "header" because blocks may not appear at the beginning of a bundle due to particular processing requirements [8].
Bundle layer as shown in Figure 2.10 support end to end transfer across heterogeneous network protocol stacks. An essential element of the bundle-based style of forwarding is that bundles have a place to wait in a queue until a communication contact is available.  Size of storage used in this operation is depending on the system requirement. The assumptions for this operation as follows:
i.                    Storage is available and well-distributed throughout the network.
ii.                  Storage is sufficiently persistent and robust to store bundles until forwarding can occur.
iii.                This "store-and-forward" model is a better choice than attempting to effect continuous connectivity or other alternatives.

Figure 2.10: Bundle Space
Bundle Protocol nodes and endpoints are identified by name. Bundle Protocol names are used Uniform Resource Identifier (URI). Each URI begins with a scheme name followed by a series of characters where the syntax is defined by the scheme. This is examples of Bundle Protocol name:
i.                    dtn://thismachine/ping
ii.                  dtn:pop:mailto:myemail@gmail.com
The bundle protocol is designed with a Primary Bundle Block, payload block which contains the ADU data itself and a set of other blocks. The following fields are all present in the primary bundle block [3]:
i.        Creation Timestamp - a concatenation of the bundle is creation time and a monotonically increasing sequence number such that the creation timestamp is guaranteed to be unique for each ADU originating from the same source.  The creation timestamp is based on the time-of-day an application requested an ADU to be sent (not when the corresponding bundle(s) are sent into the network).  DTN nodes are assumed to have a basic time synchronization capability.
ii.      Lifespan - the time-of-day at which the message is no longer useful.  If a bundle is stored in the network (including the source is DTN node) when its lifespan is reached, it may be discarded.  The lifespan of a bundle is expressed as an offset relative to its creation time.
iii.    Class of Service Flags - indicates the delivery options and priority class for the bundle.
iv.    Source EID - EID of the source.
v.      Destination EID - EID of the destination.
vi.    Report-To Endpoint ID - an EID identifying where should be sent.  This may or may not identify the same endpoint as the Source EID.
vii.  Custodian EID - EID of the current custodian of a bundle.
The lifespan field is very useful in an attempt to keep the email data in this offline email system for a longer period of time until it transferred to another device. Another block such as metadata block is used to identify the content. It could be used to implement ‘network as a database’ and can be encrypted separately from the payload. The payload block indicates information about the contained payload and the payload itself.
Binding interprets an endpoint identifier (EID) to select the next hop or next region specific layer the bundle can be forwarded toward its destination. Figure 2.11 shows the bundle layer through every region specific layer. Late binding means that the binding of a bundle is a destination to a particular set of destination identifiers or addresses does not necessarily happen at the bundle source. Binding might occur at the source, during transit or at the destination. DTN nodes use some form of persistence storage and stored bundles can maintain even if the system restarts. Persistence assumes that storage is available, distributed well through the network and store bundles sufficiently until forwarding can occur [9].

Figure 2.11: Bundle Overlay
DTN can store bundles at intermediate nodes. It can still route even there is a waiting time. Primarily the route will be forwarded to the nodes that will have connectivity later on. In Figure 2.12, data can be transferred directly between user computer A (PC A) and user computer B (PC B) when both are connected. When the PC B is disconnected, DTN routes data to Temporary Data Storage and deliver it later to the PC B. When the PC B is reconnected, data stored in the Temporary Data Storage is delivered even if PC A is disconnected. 

Figure 2.12: Bundle Routing
Security also can be provided to protect against unauthorized use. Bundle Authentication Block (BAB) as shown in Figure 2.13 [7], provides hop-by-hop authentication and integrity protection for the bundle between adjacent bundle nodes. Unauthorized resource utilization can be prevented by enabling modified bundles to be detected and discarded at the first node at the destination receiver.


Figure 2.13: Bundle Authentication Block (BAB)