Monday, April 30, 2012

[ns] Broadcasting a UDP ns2.34 802.11Ext

Hi,

I want to broadcast a packet using an udp agent. I found some solutions at
this maillist but
neither satisfactory.

I just want to send broadcast packet from 1 node to another 2 nodes in his
range. My idea was
change the dst ip to -1 and dst port to 0 because i saw somewhere that is
the way to broadcast.

I'm using the 802.11Ext model of MAC, the new module of the NS 2.34

Well, I made this way:

set udp0 [new Agent/UDP]
$ns attach-agent $node $udp0
set cbr2 [new Application/Traffic/CBR]

$cbr2 set packetSize_ 128
$cbr2 set interval_ 0.015
$cbr2 set random_ 1
$cbr2 set maxpkts_ 1000

$cbr2 attach-agent $udp0

#to broadcast i used this:
$udp0 set dst_addr_ -1
$udp0 set dst_port_ 0

In the trace file seems to be right, but i dont know if only this change of
address and port of destination
is indeed a broadcast to all neighbors.

First lines of trace file:
s 0.500000000 _2_ AGT --- 0 cbr 128 [0 0 0 0] ------- [2:0 -1:0 32 0] [0]
0 0
r 0.500000000 _2_ RTR --- 0 cbr 128 [0 0 0 0] ------- [2:0 -1:0 32 0] [0]
0 0
s 0.500000000 _2_ RTR --- 0 cbr 148 [0 0 0 0] ------- [2:0 -1:0 32 0] [0]
0 0
s 0.500025000 _2_ MAC --- 0 cbr 176 [0 ffffffff 2 0] ------- [2:0 -1:0 32
0] [0] 0 0
r 0.500546664 _1_ MAC --- 0 cbr 148 [0 ffffffff 2 0] ------- [2:0 -1:0 32
0] [0] 1 0
r 0.500546841 _0_ MAC --- 0 cbr 148 [0 ffffffff 2 0] ------- [2:0 -1:0 32
0] [0] 1 0
r 0.500571664 _1_ RTR --- 0 cbr 148 [0 ffffffff 2 0] ------- [2:0 -1:0 32
0] [0] 1 0
r 0.500571664 _1_ AGT --- 0 cbr 148 [0 ffffffff 2 0] ------- [2:0 -1:0 31
0] [0] 1 0
r 0.500571841 _0_ RTR --- 0 cbr 148 [0 ffffffff 2 0] ------- [2:0 -1:0 32
0] [0] 1 0
r 0.500571841 _0_ AGT --- 0 cbr 148 [0 ffffffff 2 0] ------- [2:0 -1:0 31
0] [0] 1 0
s 0.507505094 _2_ AGT --- 1 cbr 128 [0 0 0 0] ------- [2:0 -1:0 32 0] [1]
0 0
r 0.507505094 _2_ RTR --- 1 cbr 128 [0 0 0 0] ------- [2:0 -1:0 32 0] [1]
0 0
s 0.507505094 _2_ RTR --- 1 cbr 148 [0 0 0 0] ------- [2:0 -1:0 32 0] [1]
0 0
s 0.507530094 _2_ MAC --- 1 cbr 176 [0 ffffffff 2 0] ------- [2:0 -1:0 32
0] [1] 0 0
r 0.508051758 _1_ MAC --- 1 cbr 148 [0 ffffffff 2 0] ------- [2:0 -1:0 32
0] [1] 1 0
r 0.508051934 _0_ MAC --- 1 cbr 148 [0 ffffffff 2 0] ------- [2:0 -1:0 32
0] [1] 1 0
r 0.508076758 _1_ RTR --- 1 cbr 148 [0 ffffffff 2 0] ------- [2:0 -1:0 32
0] [1] 1 0
r 0.508076758 _1_ AGT --- 1 cbr 148 [0 ffffffff 2 0] ------- [2:0 -1:0 31
0] [1] 1 0
r 0.508076934 _0_ RTR --- 1 cbr 148 [0 ffffffff 2 0] ------- [2:0 -1:0 32
0] [1] 1 0
r 0.508076934 _0_ AGT --- 1 cbr 148 [0 ffffffff 2 0] ------- [2:0 -1:0 31
0] [1] 1 0


Thanks guys


Att,

--
Paulo Robson SF
Computação UFC
Semestre VII

6 comments:

  1. Can you tell us more about this? I'd want to find out more details.

    Feel free to visit my web-site buy a car
    Feel free to surf my blog : buying a car with bad credit,buy a car with bad credit,how to buy a car with bad credit,buying a car,buy a car,how to buy a car

    ReplyDelete
  2. Apprecіation to mу fаtheг who stаteԁ tο me regarԁing this
    blog, thіs webpage is in fаct remarkable.


    Also vіsit my web blog: may tinh

    ReplyDelete
  3. Complying with standards set for different memory card formats, ADATA's series of storage solutions are products that people can trust. Class 10 is the highest speed currently available and allows for consecutive HD shots in bursts as well as HD video. Being a smart user of memory card reader its highly important to be aware of features and specifications.

    ReplyDelete
  4. For thоse ωho could never imаgine loωering themselves to ѕomеthing beneath a basіc A4 оr 3
    serieѕ, auto loans 5 serіes came with vaгiοus enginе ѕizes
    from the 4 cylinder carbuгetter fuel inϳectеd 2.
    Apart from Wolveгine-like qualitiеs, the Z4 might bе moгe tо youг liking.


    Feel frеe to vіsit my ωeb blog; cuongnguyen.net

    ReplyDelete
  5. Tv Programming Manual

    Also visit my web page: Optoma HD33 best price

    ReplyDelete

Counter

blogger analytics