LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 07-11-2010, 06:35 AM   #1
hinatariq
LQ Newbie
 
Registered: Jul 2010
Posts: 1

Rep: Reputation: 0
in NS2 DOS and DDoS Simulation +Comparison and Analysis of Xgraph


i have to simulate DDoS and DoS in ns2 using TCP ...and then have to genrate the graph using xgraph....i want to check the packet loss...acknowledgements...bandwidth and delays........at specific time interval.......how i can do this...????
what i have done yet is that i have simulated the DDoS but dnt know how to generate these different graphs and how to do their analysis...
Any idea.........i am using NS2 for the first time......Thanks in Advance...
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 07-19-2010, 08:01 AM   #2
rohiinii
LQ Newbie
 
Registered: Jul 2010
Location: Hubli-Dharwad, Karnataka
Distribution: fedora 9
Posts: 1

Rep: Reputation: 1
NS-2 and xgraph

Hi Hinatariq,

Its past 3 months I'm learning the NS-2 tool. Since, my project is also based on simulation of DDoS attacks and traceback of the attack origin.To get the graphs, you need to write AWK scripts and redirect it to a graph within the AWK script.
e.g 1)ns test.tcl
2)awk -f losspackets.awk out.tr
3)xgraph graph1
You'll get the xgraph named graph1.
Browse the net for awk scripts and modify according to your requirements.
Its difficult to understand the flow of NS-2 in the beginning. Its necessary to understand the of the NS-2 trace file format for plotting of graphs according to your requirement. Trace file is nothing but the raw data from which you can calculate values that is to be written in AWK script and plot graphs accordingly.
Regards,
rohiinii

Last edited by rohiinii; 07-19-2010 at 12:02 PM. Reason: for more clear explanation
 
1 members found this post helpful.
Old 09-14-2010, 12:42 PM   #3
babarsaed
LQ Newbie
 
Registered: Sep 2010
Posts: 2

Rep: Reputation: 0
DOS and DDOS simulation and Plotting Graph

Hi


There are different ways to plot graph of trace files. you can use tcl language in your simulation code, awk for extracting data from trace files and compiling graphs, can use perl for extracting, using tcl in your simulation code is better choice then using awk or perl coz you have to learn another language awk or perl. so try to use tcl in your simulations for ploting graphs. i am also wandering for help for this issue

hope for the best.

regards
 
Old 09-14-2010, 06:49 PM   #4
Areswindows7
LQ Newbie
 
Registered: Sep 2010
Location: California USA
Posts: 1

Rep: Reputation: 0
Smile NS2

Try browsing the net for awk scripts and modify according to your needs.
It may be hard to figure out the flow of NS-2 in the beginning But it's necessary to understand the of the trace file format for plotting NS2 graphs per your needs. A trace file is just raw data from which you calculate values that is to be written in AWK script and plot graphs accordingly. Hope this helps...
 
Old 09-24-2010, 11:42 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,284

Rep: Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664
Example, awk ... line 101 here
http://spectral.mscs.mu.edu/Net2008I...TML/node2.html

And Google .. ns2 display out.tr .. ( 1,000,000 hits ) Example :
http://nile.wpi.edu/NS/example_srm.html

..
 
Old 09-30-2010, 10:27 PM   #6
yoh_khos
LQ Newbie
 
Registered: Sep 2010
Posts: 1

Rep: Reputation: 0
Question example please

hi, hinatariq, I'm using NS-2 for the first time right now..

and I see that u have simulated the DDoS attack on NS2, could you please share it with me..? because currently I'm having problem trying to simulate the similar case..

thanks b4.. =)

note: u could email me at yoh_khos@yahoo.co.id
 
Old 11-20-2010, 01:24 PM   #7
asif_ali_azad
LQ Newbie
 
Registered: Nov 2010
Posts: 1

Rep: Reputation: 0
Hi all,
I have to demonstrate a simulation of DDOS in NS2. Can you guide me? Anticipating for your response urgent
 
Old 11-22-2010, 09:35 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,284

Rep: Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664
Post #7 , @ asif_ali_azad : Welcome to LQ.

Suggest : Google .. DDOS in NS2 ..
http://www.google.com/webhp#hl=da&so...99a9b071bc104a

Example :
http://en.cnki.com.cn/Article_en/CJF...Z201003013.htm

.. + another 29,000 hits.
..
 
Old 06-25-2011, 11:09 AM   #9
mleoking
LQ Newbie
 
Registered: Jun 2011
Posts: 11

Rep: Reputation: Disabled
Lightbulb The Simulation and Analysis Platform for DoS attacks

The Active Queue Management and Denial-of-Service (AQM&DoS) Simulation Platform can simulate a variety of DoS attacks (Distributed DoS, Spoofing DoS, Low-rate DoS, etc.) and Active Queue Management (AQM) algorithms (RED, RRED, SFB, etc.). It automatically calculate and record the average throughput of normal TCP flows before and after DoS attacks to facilitate the analysis of the impact of DoS attacks on normal TCP flows and AQM algorithms.More Details.
 
2 members found this post helpful.
Old 06-26-2011, 01:58 PM   #10
mujtiba
LQ Newbie
 
Registered: May 2011
Posts: 14

Rep: Reputation: 2
Question

post 7 @ mleoking
i have installed ns2.32 on fedora 11
where as the recommended AQM&DoS simulatino platform is the ns-allinone-2.33 operation system (Debian 4.0 Linux ).

would the above simulation platform work for me
i am currently trying to simulate DDoS attack using different queueing schemes
 
Old 06-26-2011, 04:41 PM   #11
mleoking
LQ Newbie
 
Registered: Jun 2011
Posts: 11

Rep: Reputation: Disabled
I think it works for ns-2.32. There is no many differences between ns-2.32 and ns-2.33. Debian 4.0 is not a must either.

AQM&DoS platform is just what you want: DDoS attacks with different queuing schemes.

Hope you successively install and use it.
 
Old 06-26-2011, 04:43 PM   #12
mleoking
LQ Newbie
 
Registered: Jun 2011
Posts: 11

Rep: Reputation: Disabled
Lightbulb I think AQM&DoS Simulation Platform works for ns-2.32.

Quote:
Originally Posted by mujtiba View Post
post 7 @ mleoking
i have installed ns2.32 on fedora 11
where as the recommended AQM&DoS simulatino platform is the ns-allinone-2.33 operation system (Debian 4.0 Linux ).

would the above simulation platform work for me
i am currently trying to simulate DDoS attack using different queueing schemes
I think it works for ns-2.32. There is no many differences between ns-2.32 and ns-2.33. Debian 4.0 is not a must either.

AQM&DoS platform is just what you want: DDoS attacks with different queuing schemes.

Hope you successively install and use it.
 
2 members found this post helpful.
Old 06-27-2011, 04:11 AM   #13
mujtiba
LQ Newbie
 
Registered: May 2011
Posts: 14

Rep: Reputation: 2
@ mleoking
when i tried to change queue type by changeing the value of bn_qm in leodosh.sh to 2, 3, 4
it show me bn_qms DropTail for every change while executing
also tell me how to change tcp data of legetimate user to udp
also tell me how to find nam and trace file
 
1 members found this post helpful.
Old 06-27-2011, 06:27 AM   #14
mleoking
LQ Newbie
 
Registered: Jun 2011
Posts: 11

Rep: Reputation: Disabled
Lightbulb About the problems you had with AQM&DoS Simulation Platform

Quote:
Originally Posted by mujtiba View Post
@ mleoking
When I tried to change queue type by changeing the value of bn_qm in leodosh.sh to 2, 3, 4, it show me bn_qms DropTail for every change while executing.
There are a variety of ways to run the simulation on the AQM&DoS simulation platform, but the recommended way is to use the leodos.sh to launch the simulation rather than execute "ns leodos.tcl" directly (this is relevant to your second question as well). To execute the leodos.sh you need to change its mode to be executable by using the following command:

chmod +x leodos.sh

and run it using:

./leodos.sh

The parameters in the head of the leodos.sh file are only the default parameters to run the simulation. These parameters could be modified by following lines of code. In the original leodos.sh file, these two lines of code

task_aqm_ldos 2; #RED
task_aqm_ldos 15; #Roubust RED

rum a batch of simulations on RED and RRED queuing scheme. task_aqm_ldos is a function, in which the default parameters of the simulation are modified. If you just want to conduct one simulation using the parameters specified in the head of this file "leodos.sh", you can add the following line of code to the end of leodos.sh:

dosim 0;

and add a # before task_aqm_ldos 2; and task_aqm_ldos 15; to inactive these two batch of simulations. You can learn to modify the code of the function task_aqm_ldos to run your own batch of simulations in the future as this will save you lots of time.

Quote:
Originally Posted by mujtiba View Post
@ mleoking
How to change TCP data of legitimate user to UDP?
Normally the AQM&DoS simulation platform experiments on legitimate users using TCP protocol as TCP is more likely to be affected by DoS attacks and queuing schemes (AQM) rather than UDP. But if you do want to simulate UDP users, you can modify the file "leodos.tcl" in the following ways:

1. Replace "set agUsrSend($i) [new Agent/TCP/Newreno]" with "set agUsrSend($i) [new Agent/UDP]"
2. Replace "set apUsrSend($i) [new Application/FTP]" with "set apUsrSend($i) [new Application/Traffic/CBR]"
3. Replace "set apUsrSend($i) [new Application/Telnet]" with "set apUsrSend($i) [new Application/Traffic/Exponential]"
4. Add the following lines of code after "$agUsrSend($i) set packetSize_ $pam(ur_ps)":

if { $pam(ur_app)==0} {
$apUsrSend($i) set burst_time_ 500ms
$apUsrSend($i) set idle_time_ 500ms
$apUsrSend($i) set rate_ 100k
}
if { $pam(ur_app)==1} {
$apUsrSend($i) set rate_ 64Kb
$apUsrSend($i) set random_ 1
}



The above code is setting parameters for UDP traffic applications (CBR/Exponential). If you have no idea of CBR/Exponential, please refer to the following links:

CBR: http://www.isi.edu/nsnam/ns/doc/node508.html
Exponential: http://www.isi.edu/nsnam/ns/doc/node506.html

Quote:
Originally Posted by mujtiba View Post
@ mleoking
How to find nam and trace file
The parameter ns_of in leodos.sh is about the out files.

When ns_of:
>=3 output leodos.nam (used for nsnam to figure the simulation topology)
>=2 output leodos.tr leodos_tcp.tr leodos_queue_monitor.tr
>=1 output leodos_queue.tr (The data trace of the bottleneck queue. It is the primary analysis data source for this simulation platform)

The default value of ns_of is 2, so that it only output trace files (leodos.tr, leodos_tcp.tr, leodos_queue_monitor.tr, leodos_queue.tr). If you want to output the nam file "leodos.nam", you need to change ns_of to 3.

These output files are located in the sub-directory "result" under "aqm-dos-sim-plat"


Quote:
Originally Posted by mujtiba View Post
When I integrated Robust RED it worked correctly. But when I integrated IP Spoofing it shows me warning as shown below. It dose not generate any nam or trace file for me.

[mujtiba@ddos aqm-dos-sim-plat]$ ns leodos.tcl
ak_spf_mx 100
nt_dl 2
ur_sp 120
ak_st 60
ur_cr 10
ur_n 2
li 0
ns_of 3
ak_spf_lv 0
ak_bp 500
ak_pr 0.5
bn_qm 1
ur_st 20
ak_spf_mn 1
ak_ps 200
tm_fi 120
ak_tp 2
ur_app 0
ak_rs 0
ak_ng 1
bn_bw 1
ak_n 2
ur_ps 1000
ur_pt 1
nt_bw 10
ur_rs 0
bn_qs 100
ak_ap 1000
hp_n 25
ns_db 0
ak_cp 10
ak_sp 100
ak_tg 0
ak_mw 5
bn_dl 5
bn_qms DropTail
warning: no class variable Agent/TCP/Newreno::saddr_min

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/TCP/Newreno::saddr_max

warning: no class variable Agent/TCP/Newreno::spoof_level

warning: no class variable Agent/TCP/Newreno::saddr_min

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/TCP/Newreno::saddr_max

warning: no class variable Agent/TCP/Newreno::spoof_level

warning: no class variable Agent/UDP::saddr_min

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/UDP::saddr_max

warning: no class variable Agent/UDP::spoof_level

warning: no class variable Agent/UDP::saddr_min

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/UDP::saddr_max

warning: no class variable Agent/UDP::spoof_level


[mujtiba@ddos aqm-dos-sim-plat]$
To solve the warning:

Add the following lines to the end of ns-default.tcl ("ns-allinone-2.33\ns-2.33\tcl\lib\ns-default.tcl").
# Added by leoking spoof config 0
Agent/TCP set saddr_min 1
Agent/TCP set saddr_max 100
Agent/TCP set spoof_level 0

Agent/UDP set saddr_min 1
Agent/UDP set saddr_max 100
Agent/UDP set spoof_level 0
# Added by leoking spoof config 1

You need to modify the parameters in leodos.sh and use it to launch the simulation rather than execute "ns leodos.tcl" directly. (There are detailed explanations for how to run leodos.sh in the beginning of this thread)

According to the warnings, you also need to double check whether you have strictly followed the instructions in "integration-of-ip-spoofing.txt".

Another thing you need to check is whether you have installed AWK properly, which is a part of the ns-allinone distribution, using the command: awk

If there the following message appears:

awk: command not found

it means that you have not installed AWK. Otherwise, you have already installed it.
 
2 members found this post helpful.
Old 06-28-2011, 06:23 AM   #15
mujtiba
LQ Newbie
 
Registered: May 2011
Posts: 14

Rep: Reputation: 2
respected Sir,
need help to install awk
 
1 members found this post helpful.
  


Reply

Tags
aqm-dos, ddos-ns2, dos-ns2, ns2


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
tora simulation does not come to an end in ns2.34 mq15 Linux - Software 3 10-01-2012 01:19 PM
ns2 Wireless simulation Help md_imranullah Programming 1 06-13-2012 03:19 AM
Anti Dos Or Anti DDos Ariyan Linux - Security 3 04-11-2009 12:18 PM
how to use "xgraph" in the scripts shells with ns2.33 in fc9 messy2010 Fedora 1 01-21-2009 04:56 AM
Plz.. help me. Network Simulation(NS2)'s problems everfree General 0 06-16-2008 02:06 AM


All times are GMT -5. The time now is 11:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration