Jean Fellipe de Almeida Pimentel
Túlio César Faria Pinto
Loss Monitor
   Usado para monitorar números de pacotes transferidos, bem como pacotes
    perdidos.

   Pode ser usado com uma função chamada a cada X segundos e assim obter o
    throughput.
   A classe Agent tem os seguintes atributos:

       addr_         Endereço de origem
       dst_      Endereço de destino
       size_     Tamanho do pacote em bytes
       type_     Tipo do pacote
       fid_          Identificador de fluxo
       prio_     Prioridade
       flags_        Flags
       defttl_       TTL padrão
   A classe LossMonitor herda as funcionalidades de Agent

   Seus próprios atributos são:

       nlost_          Número de pacotes perdidos
       npkts_          Número de pacotes recebidos
       bytes_          Número de bytes recebidos
       lastPktTime_ Hora do último pacote recebido
       expected_       Número de sequência esperado para o próximo pacote
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]


$ns duplex-link $n0 $n3 1Mb 100ms DropTail
$ns duplex-link $n1 $n3 1Mb 100ms DropTail
$ns duplex-link $n2 $n3 1Mb 100ms DropTail
$ns duplex-link $n3 $n4 1Mb 100ms DropTail
proc attach-expoo-traffic { node sink size burst idle rate } {
     set ns [Simulator instance]
     set source [new Agent/UDP]
     $ns attach-agent $node $source
     set traffic [new Application/Traffic/Exponential]
     $traffic set packet-size $size
     $traffic set burst-time $burst
     $traffic set idle-time $idle
     $traffic set rate $rate
     $traffic attach-agent $source
     $ns connect $source $sink
     return $traffic
}
set sink0 [new Agent/LossMonitor]
set sink1 [new Agent/LossMonitor]
set sink2 [new Agent/LossMonitor]


$ns attach-agent $n4 $sink0
$ns attach-agent $n4 $sink1
$ns attach-agent $n4 $sink2


set source0 [attach-expoo-traffic $n0 $sink0 200 2s 1s 100k]
set source1 [attach-expoo-traffic $n1 $sink1 200 2s 1s 200k]
set source2 [attach-expoo-traffic $n2 $sink2 200 2s 1s 300k]
set f0 [open out0.tr w]
set f1 [open out1.tr w]
set f2 [open out2.tr w]


proc finish {} {
      global f0 f1 f2
      close $f0
      close $f1
      close $f2
      exec xgraph out0.tr out1.tr out2.tr -geometry 800x400 &
      exit 0
}
proc record {} {
     global sink0 sink1 sink2 f0 f1 f2
     set ns [Simulator instance]
     set time 0.5
     set bw0 [$sink0 set bytes_]; set bw1 [$sink1 set bytes_]; set bw2 [$sink2 set bytes_];
     set now [$ns now]
     puts $f0 "$now [expr $bw0/$time*8/1000000]"
     puts $f1 "$now [expr $bw1/$time*8/1000000]"
     puts $f2 "$now [expr $bw2/$time*8/1000000]"
     $sink0 set bytes_ 0; $sink1 set bytes_ 0; $sink2 set bytes_ 0;
     $ns at [expr $now+$time] "record"
}
$ns at 0.0 "record"
$ns at 1.0 "$source0 start”
$ns at 1.0 "$source1 start"
$ns at 1.0 "$source2 start"
$ns at 5.0 "$source0 stop"
$ns at 5.0 "$source1 stop"
$ns at 5.0 "$source2 stop"
$ns at 6.0 "finish"
$ns run
Loss Monitor
Bibliografia:

   LossMonitor Class Reference
    http://www.auto-nomos.de/ns2doku/class_loss_monitor.html


   NS Manual
    www.isi.edu/nsnam/ns/doc/ns_doc.pdf


   Network Simulator – Visão Geral da Ferramenta de Simulação de Redes
    http://www.cis.udel.edu/~portnoi/articles/networksimulator-sepa.pdf

More Related Content

DOC
Study of aloha protocol using ns2 network java proram
PDF
Cs757 ns2-tutorial-exercise
ODP
ekb.py - Python VS ...
PPTX
Scripting ppt
DOCX
PPTX
PHP in 2018 - Q4 - AFUP Limoges
PPTX
Scripting ppt
PDF
Redis & ZeroMQ: How to scale your application
Study of aloha protocol using ns2 network java proram
Cs757 ns2-tutorial-exercise
ekb.py - Python VS ...
Scripting ppt
PHP in 2018 - Q4 - AFUP Limoges
Scripting ppt
Redis & ZeroMQ: How to scale your application

What's hot (20)

PDF
Symfony messenger - PHPers Summit 2019
PDF
ZeroMQ Is The Answer
PDF
Пишем для asyncio - Андрей Светлов, PyCon RU 2014
PDF
ZIP
AnyMQ, Hippie, and the real-time web
PDF
Créer une base NoSQL en 1 heure
PDF
All I know about rsc.io/c2go
PDF
ZeroMQ: Messaging Made Simple
PPTX
Cyclone + Eventsource (realtime push-сообщения)
PPTX
Introducing PHP Latest Updates
PDF
JavaSE7 Launch Event: Java7xGroovy
DOCX
Jose dossantos.doc
PDF
GoでKVSを書けるのか
PDF
What's new in PHP 5.5
PDF
RestMQ - HTTP/Redis based Message Queue
PPTX
A new way to develop with WordPress!
PDF
Swiftの関数型っぽい部分
PPT
NS2: Binding C++ and OTcl variables
PDF
Hacking parse.y (RubyConf 2009)
DOC
How to send files to remote server via ssh in php
Symfony messenger - PHPers Summit 2019
ZeroMQ Is The Answer
Пишем для asyncio - Андрей Светлов, PyCon RU 2014
AnyMQ, Hippie, and the real-time web
Créer une base NoSQL en 1 heure
All I know about rsc.io/c2go
ZeroMQ: Messaging Made Simple
Cyclone + Eventsource (realtime push-сообщения)
Introducing PHP Latest Updates
JavaSE7 Launch Event: Java7xGroovy
Jose dossantos.doc
GoでKVSを書けるのか
What's new in PHP 5.5
RestMQ - HTTP/Redis based Message Queue
A new way to develop with WordPress!
Swiftの関数型っぽい部分
NS2: Binding C++ and OTcl variables
Hacking parse.y (RubyConf 2009)
How to send files to remote server via ssh in php
Ad

Viewers also liked (10)

PDF
(07) instalaã§ã£o de programas
PDF
AIX - Gerência de Processos
PPT
Gerência de Processos: Deadlocks
PDF
(08)inicializacao e gerencia_de_processos
PPT
Window scheduling algorithm
PPT
Scheduling In Linux
PDF
Linux scheduler
PPT
Process scheduling linux
PPTX
Windows process-scheduling
PPTX
CPU scheduling algorithms in OS
(07) instalaã§ã£o de programas
AIX - Gerência de Processos
Gerência de Processos: Deadlocks
(08)inicializacao e gerencia_de_processos
Window scheduling algorithm
Scheduling In Linux
Linux scheduler
Process scheduling linux
Windows process-scheduling
CPU scheduling algorithms in OS
Ad

Similar to Loss Monitor (20)

PDF
ns-simple.pdf
PPT
Ns network simulator
PPTX
Ns2 ns3 training in mohali
PPT
NS2-tutorial.ppt
PDF
NS2-tutorial.pdf
PPT
Ns 2 Network Simulator An Introduction
PDF
NS-2 Tutorial
PPTX
Working with NS2
PDF
Introduction to ns2
PPS
Ns2 introduction 2
PDF
Error Control in Multimedia Communications using Wireless Sensor Networks report
PPT
ns2-lecture.ppt
PDF
Ns tutorial
PPT
Extending ns
PDF
Ns2: OTCL - PArt II
PPTX
PDF
Code from LPW 2012 Template::Toolkit Workshop
KEY
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
PPT
Network Simulator Tutorial
PDF
Workshop on command line tools - day 2
ns-simple.pdf
Ns network simulator
Ns2 ns3 training in mohali
NS2-tutorial.ppt
NS2-tutorial.pdf
Ns 2 Network Simulator An Introduction
NS-2 Tutorial
Working with NS2
Introduction to ns2
Ns2 introduction 2
Error Control in Multimedia Communications using Wireless Sensor Networks report
ns2-lecture.ppt
Ns tutorial
Extending ns
Ns2: OTCL - PArt II
Code from LPW 2012 Template::Toolkit Workshop
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Network Simulator Tutorial
Workshop on command line tools - day 2

More from Jean Pimentel (12)

PDF
Segurança em P2P
PDF
Introdução ao P2P
PDF
Multimídia - Imagens
PDF
Fluxo MPEG
PDF
PPT
Sistemas Imunológicos Artificiais
PPT
AIX - Sistemas de Arquivos
PPT
AIX - Gerência de Memória
PPT
Windows Mobile
PPT
RIP - Routing Information Protocol
PPS
Redes Mesh - Protocolos de Roteamento
PPT
Redes Mesh - Introdução
Segurança em P2P
Introdução ao P2P
Multimídia - Imagens
Fluxo MPEG
Sistemas Imunológicos Artificiais
AIX - Sistemas de Arquivos
AIX - Gerência de Memória
Windows Mobile
RIP - Routing Information Protocol
Redes Mesh - Protocolos de Roteamento
Redes Mesh - Introdução

Recently uploaded (20)

PPTX
The various Industrial Revolutions .pptx
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
DOCX
search engine optimization ppt fir known well about this
PDF
The influence of sentiment analysis in enhancing early warning system model f...
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
Flame analysis and combustion estimation using large language and vision assi...
PDF
A proposed approach for plagiarism detection in Myanmar Unicode text
PDF
Five Habits of High-Impact Board Members
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PPTX
Chapter 5: Probability Theory and Statistics
PPTX
Modernising the Digital Integration Hub
PPTX
2018-HIPAA-Renewal-Training for executives
PPTX
Benefits of Physical activity for teenagers.pptx
PPT
Geologic Time for studying geology for geologist
The various Industrial Revolutions .pptx
Final SEM Unit 1 for mit wpu at pune .pptx
A contest of sentiment analysis: k-nearest neighbor versus neural network
OpenACC and Open Hackathons Monthly Highlights July 2025
search engine optimization ppt fir known well about this
The influence of sentiment analysis in enhancing early warning system model f...
Hindi spoken digit analysis for native and non-native speakers
1 - Historical Antecedents, Social Consideration.pdf
Taming the Chaos: How to Turn Unstructured Data into Decisions
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Flame analysis and combustion estimation using large language and vision assi...
A proposed approach for plagiarism detection in Myanmar Unicode text
Five Habits of High-Impact Board Members
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
Chapter 5: Probability Theory and Statistics
Modernising the Digital Integration Hub
2018-HIPAA-Renewal-Training for executives
Benefits of Physical activity for teenagers.pptx
Geologic Time for studying geology for geologist

Loss Monitor

  • 1. Jean Fellipe de Almeida Pimentel Túlio César Faria Pinto
  • 3. Usado para monitorar números de pacotes transferidos, bem como pacotes perdidos.  Pode ser usado com uma função chamada a cada X segundos e assim obter o throughput.
  • 4. A classe Agent tem os seguintes atributos: addr_ Endereço de origem dst_ Endereço de destino size_ Tamanho do pacote em bytes type_ Tipo do pacote fid_ Identificador de fluxo prio_ Prioridade flags_ Flags defttl_ TTL padrão
  • 5. A classe LossMonitor herda as funcionalidades de Agent  Seus próprios atributos são: nlost_ Número de pacotes perdidos npkts_ Número de pacotes recebidos bytes_ Número de bytes recebidos lastPktTime_ Hora do último pacote recebido expected_ Número de sequência esperado para o próximo pacote
  • 6. set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] set n4 [$ns node] $ns duplex-link $n0 $n3 1Mb 100ms DropTail $ns duplex-link $n1 $n3 1Mb 100ms DropTail $ns duplex-link $n2 $n3 1Mb 100ms DropTail $ns duplex-link $n3 $n4 1Mb 100ms DropTail
  • 7. proc attach-expoo-traffic { node sink size burst idle rate } { set ns [Simulator instance] set source [new Agent/UDP] $ns attach-agent $node $source set traffic [new Application/Traffic/Exponential] $traffic set packet-size $size $traffic set burst-time $burst $traffic set idle-time $idle $traffic set rate $rate $traffic attach-agent $source $ns connect $source $sink return $traffic }
  • 8. set sink0 [new Agent/LossMonitor] set sink1 [new Agent/LossMonitor] set sink2 [new Agent/LossMonitor] $ns attach-agent $n4 $sink0 $ns attach-agent $n4 $sink1 $ns attach-agent $n4 $sink2 set source0 [attach-expoo-traffic $n0 $sink0 200 2s 1s 100k] set source1 [attach-expoo-traffic $n1 $sink1 200 2s 1s 200k] set source2 [attach-expoo-traffic $n2 $sink2 200 2s 1s 300k]
  • 9. set f0 [open out0.tr w] set f1 [open out1.tr w] set f2 [open out2.tr w] proc finish {} { global f0 f1 f2 close $f0 close $f1 close $f2 exec xgraph out0.tr out1.tr out2.tr -geometry 800x400 & exit 0 }
  • 10. proc record {} { global sink0 sink1 sink2 f0 f1 f2 set ns [Simulator instance] set time 0.5 set bw0 [$sink0 set bytes_]; set bw1 [$sink1 set bytes_]; set bw2 [$sink2 set bytes_]; set now [$ns now] puts $f0 "$now [expr $bw0/$time*8/1000000]" puts $f1 "$now [expr $bw1/$time*8/1000000]" puts $f2 "$now [expr $bw2/$time*8/1000000]" $sink0 set bytes_ 0; $sink1 set bytes_ 0; $sink2 set bytes_ 0; $ns at [expr $now+$time] "record" }
  • 11. $ns at 0.0 "record" $ns at 1.0 "$source0 start” $ns at 1.0 "$source1 start" $ns at 1.0 "$source2 start" $ns at 5.0 "$source0 stop" $ns at 5.0 "$source1 stop" $ns at 5.0 "$source2 stop" $ns at 6.0 "finish" $ns run
  • 13. Bibliografia:  LossMonitor Class Reference http://www.auto-nomos.de/ns2doku/class_loss_monitor.html  NS Manual www.isi.edu/nsnam/ns/doc/ns_doc.pdf  Network Simulator – Visão Geral da Ferramenta de Simulação de Redes http://www.cis.udel.edu/~portnoi/articles/networksimulator-sepa.pdf