[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.5 _2_ AGT --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 0] [0] 0 0 r 0.5 _2_ RTR --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 0] [0] 0 0 s 0.5 _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 2 0] --- [2:0 -1:0 32 0] [0] 0 0 r 0.500546664 _1_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 32 0] [0] 1 0 r 0.500546841 _0_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 32 0] [0] 1 0 r 0.500571664 _1_ RTR --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 32 0] [0] 1 0 r 0.500571664 _1_ AGT --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 31 0] [0] 1 0 r 0.500571841 _0_ RTR --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 32 0] [0] 1 0 r 0.500571841 _0_ AGT --- 0 cbr 148 [0 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 2 0] --- [2:0 -1:0 32 0] [1] 0 0 r 0.508051758 _1_ MAC --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 32 0] [1] 1 0 r 0.508051934 _0_ MAC --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 32 0] [1] 1 0 r 0.508076758 _1_ RTR --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 32 0] [1] 1 0 r 0.508076758 _1_ AGT --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 31 0] [1] 1 0 r 0.508076934 _0_ RTR --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 32 0] [1] 1 0 r 0.508076934 _0_ AGT --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 31 0] [1] 1 0 Thanks guys Att, -- Paulo Robson SF Computação UFC Semestre VII
Re: [ns] Broadcasting a UDP ns2.34 802.11Ext
Hi, I have no solution for you in NS2. However, I have a remark on your address/port choice. I guess that by choosing -1, you fill the address field with 255.255.255.255 as IP address in dotted decimal notation? The port number choice of 0 is a bit strange. Although you are using IP broadcast you - strictly speaking - still need a legitimate port number. Indeed, you choose a particular protocol by choosing the port address. As an example, DHCP uses IP broadcast initially based on UDP67 / UDP68. Regards, Frank On May 1, 2012, at 5:36 AM, Paulo Robson S. F. wrote: > > 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.5 _2_ AGT --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 0] [0] > 0 0 > r 0.5 _2_ RTR --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 0] [0] > 0 0 > s 0.5 _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 2 0] --- [2:0 -1:0 32 > 0] [0] 0 0 > r 0.500546664 _1_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 32 > 0] [0] 1 0 > r 0.500546841 _0_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 32 > 0] [0] 1 0 > r 0.500571664 _1_ RTR --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 32 > 0] [0] 1 0 > r 0.500571664 _1_ AGT --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 31 > 0] [0] 1 0 > r 0.500571841 _0_ RTR --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 32 > 0] [0] 1 0 > r 0.500571841 _0_ AGT --- 0 cbr 148 [0 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 2 0] --- [2:0 -1:0 32 > 0] [1] 0 0 > r 0.508051758 _1_ MAC --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 32 > 0] [1] 1 0 > r 0.508051934 _0_ MAC --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 32 > 0] [1] 1 0 > r 0.508076758 _1_ RTR --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 32 > 0] [1] 1 0 > r 0.508076758 _1_ AGT --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 31 > 0] [1] 1 0 > r 0.508076934 _0_ RTR --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 32 > 0] [1] 1 0 > r 0.508076934 _0_ AGT --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 31 > 0] [1] 1 0 > > > Thanks guys > > > Att, > > -- > Paulo Robson SF > Computação UFC > Semestre VII
Re: [ns] Broadcasting a UDP ns2.34 802.11Ext
Hi, You can see it on ns-2.34/tcl/ex/wireless-flooding.tcl and ns-2.34/tcl/ex/802.11/broadcast_validation.tcl witch uses a specific broadcast agent. Further details in ns-2.34/common/packet.h on lines 676 and 677: init(p); // Initialize bits_[] (HDR_CMN(p))->next_hop_ = -2; // -1 reserved for IP_BROADCAST (HDR_CMN(p))->last_hop_ = -2; // -1 reserved for IP_BROADCAST Regards, Alysson Oliveira 2012/5/2, Frank Wetzels : > > Hi, > > I have no solution for you in NS2. However, I have a remark on your > address/port choice. > I guess that by choosing -1, you fill the address field with 255.255.255.255 > as IP address > in dotted decimal notation? The port number choice of 0 is a bit strange. > Although you are using IP broadcast > you - strictly speaking - still need a legitimate port number. Indeed, you > choose a particular protocol by choosing > the port address. As an example, DHCP uses IP broadcast initially based on > UDP67 / UDP68. > > Regards, > Frank > > On May 1, 2012, at 5:36 AM, Paulo Robson S. F. wrote: > >> >> 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.5 _2_ AGT --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 0] >> [0] >> 0 0 >> r 0.5 _2_ RTR --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 0] >> [0] >> 0 0 >> s 0.5 _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 2 0] --- [2:0 -1:0 >> 32 >> 0] [0] 0 0 >> r 0.500546664 _1_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 >> 32 >> 0] [0] 1 0 >> r 0.500546841 _0_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 >> 32 >> 0] [0] 1 0 >> r 0.500571664 _1_ RTR --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 >> 32 >> 0] [0] 1 0 >> r 0.500571664 _1_ AGT --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 >> 31 >> 0] [0] 1 0 >> r 0.500571841 _0_ RTR --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 >> 32 >> 0] [0] 1 0 >> r 0.500571841 _0_ AGT --- 0 cbr 148 [0 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 2 0] --- [2:0 -1:0 >> 32 >> 0] [1] 0 0 >> r 0.508051758 _1_ MAC --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 >> 32 >> 0] [1] 1 0 >> r 0.508051934 _0_ MAC --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 >> 32 >> 0] [1] 1 0 >> r 0.508076758 _1_ RTR --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 >> 32 >> 0] [1] 1 0 >> r 0.508076758 _1_ AGT --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 >> 31 >> 0] [1] 1 0 >> r 0.508076934 _0_ RTR --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 >> 32 >> 0] [1] 1 0 >> r 0.508076934 _0_ AGT --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 >> 31 >> 0] [1] 1 0 >> >> >> Thanks guys >> >> >> Att, >> >> -- >> Paulo Robson SF >> Computação UFC >> Semestre VII > > > -- Alysson Oliveira
Re: [ns] Broadcasting a UDP ns2.34 802.11Ext
Hi guys, thanks for the feedback. Alysson, The Agent PBC is a broadcast but is only ping, I tested it before and is no good for me. I dont understand this agent Flooding at all, I need to use it? Are you saying the only way to broadcast is to use one of those agents? My way is wrong? Another question, Is possible the follow scenario? : one node(n1) broadcasting and two another(n2 and n3) nodes as a cbr traffic flow like n2 ---> n3 and n3 receiving the broadcasting packets of n1 and the traffic of n2? Thank you! 2012/5/2 Alysson Oliveira > Hi, > > You can see it on ns-2.34/tcl/ex/wireless-flooding.tcl and > ns-2.34/tcl/ex/802.11/broadcast_validation.tcl witch uses a specific > broadcast agent. > > Further details in ns-2.34/common/packet.h on lines 676 and 677: > init(p); // Initialize bits_[] > (HDR_CMN(p))->next_hop_ = -2; // -1 reserved for IP_BROADCAST > (HDR_CMN(p))->last_hop_ = -2; // -1 reserved for IP_BROADCAST > > Regards, > Alysson Oliveira > > > 2012/5/2, Frank Wetzels : > > > > Hi, > > > > I have no solution for you in NS2. However, I have a remark on your > > address/port choice. > > I guess that by choosing -1, you fill the address field with > 255.255.255.255 > > as IP address > > in dotted decimal notation? The port number choice of 0 is a bit strange. > > Although you are using IP broadcast > > you - strictly speaking - still need a legitimate port number. Indeed, > you > > choose a particular protocol by choosing > > the port address. As an example, DHCP uses IP broadcast initially based > on > > UDP67 / UDP68. > > > > Regards, > > Frank > > > > On May 1, 2012, at 5:36 AM, Paulo Robson S. F. wrote: > > > >> > >> 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.5 _2_ AGT --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 0] > >> [0] > >> 0 0 > >> r 0.5 _2_ RTR --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 0] > >> [0] > >> 0 0 > >> s 0.5 _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 2 0] --- [2:0 -1:0 > >> 32 > >> 0] [0] 0 0 > >> r 0.500546664 _1_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 > >> 32 > >> 0] [0] 1 0 > >> r 0.500546841 _0_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 > >> 32 > >> 0] [0] 1 0 > >> r 0.500571664 _1_ RTR --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 > >> 32 > >> 0] [0] 1 0 > >> r 0.500571664 _1_ AGT --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 > >> 31 > >> 0] [0] 1 0 > >> r 0.500571841 _0_ RTR --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 > >> 32 > >> 0] [0] 1 0 > >> r 0.500571841 _0_ AGT --- 0 cbr 148 [0 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 2 0] --- [2:0 -1:0 > >> 32 > >> 0] [1] 0 0 > >> r 0.508051758 _1_ MAC --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 > >> 32 > >> 0] [1] 1 0 > >> r 0.508051934 _0_ MAC --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 > >> 32 > >> 0] [1] 1 0 > >> r 0.508076758 _1_ RTR --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 > >> 32 > >> 0] [1] 1 0 > >> r 0.508076758 _1_ AGT --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 > >> 31 > >> 0] [1] 1 0 > >> r 0.508076934 _0_ RTR --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 > >> 32 > >> 0] [1] 1 0 > >> r 0.508076934 _0_ AGT --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 > >> 31 > >> 0] [1] 1 0 > >> > >> > >> Thanks guys > >> > >> > >> Att, > >> > >> -- > >> Paulo Robson SF > >> Computação UFC > >> Semestre VII > > > > > > > > > -- > Alysson Oliveira > -- Paulo Robson SF Computação UFC Semestre VII
Re: [ns] Broadcasting a UDP ns2.34 802.11Ext
Hi, I forgot to show this page: http://www.math.unipd.it/~cpalazzi/fastbroadcast.html what do you think of this broadcast agent? Att 2012/5/2 Paulo Robson S. F. > Hi guys, thanks for the feedback. > > Alysson, > > > The Agent PBC is a broadcast but is only ping, I tested it before and is > no good for me. > > I dont understand this agent Flooding at all, I need to use it? > > Are you saying the only way to broadcast is to use one of those agents? > My way is wrong? > > Another question, > Is possible the follow scenario? : one node(n1) broadcasting and two > another(n2 and n3) nodes as a cbr traffic flow like n2 ---> n3 and n3 > receiving the broadcasting packets of n1 and the traffic of n2? > > Thank you! > > > > 2012/5/2 Alysson Oliveira > >> Hi, >> >> You can see it on ns-2.34/tcl/ex/wireless-flooding.tcl and >> ns-2.34/tcl/ex/802.11/broadcast_validation.tcl witch uses a specific >> broadcast agent. >> >> Further details in ns-2.34/common/packet.h on lines 676 and 677: >> init(p); // Initialize bits_[] >> (HDR_CMN(p))->next_hop_ = -2; // -1 reserved for IP_BROADCAST >> (HDR_CMN(p))->last_hop_ = -2; // -1 reserved for IP_BROADCAST >> >> Regards, >> Alysson Oliveira >> >> >> 2012/5/2, Frank Wetzels : >> > >> > Hi, >> > >> > I have no solution for you in NS2. However, I have a remark on your >> > address/port choice. >> > I guess that by choosing -1, you fill the address field with >> 255.255.255.255 >> > as IP address >> > in dotted decimal notation? The port number choice of 0 is a bit >> strange. >> > Although you are using IP broadcast >> > you - strictly speaking - still need a legitimate port number. Indeed, >> you >> > choose a particular protocol by choosing >> > the port address. As an example, DHCP uses IP broadcast initially based >> on >> > UDP67 / UDP68. >> > >> > Regards, >> > Frank >> > >> > On May 1, 2012, at 5:36 AM, Paulo Robson S. F. wrote: >> > >> >> >> >> 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.5 _2_ AGT --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 0] >> >> [0] >> >> 0 0 >> >> r 0.5 _2_ RTR --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 0] >> >> [0] >> >> 0 0 >> >> s 0.5 _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 2 0] --- [2:0 -1:0 >> >> 32 >> >> 0] [0] 0 0 >> >> r 0.500546664 _1_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 >> -1:0 >> >> 32 >> >> 0] [0] 1 0 >> >> r 0.500546841 _0_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 >> -1:0 >> >> 32 >> >> 0] [0] 1 0 >> >> r 0.500571664 _1_ RTR --- 0 cbr 148 [0 2 0] --- [2:0 >> -1:0 >> >> 32 >> >> 0] [0] 1 0 >> >> r 0.500571664 _1_ AGT --- 0 cbr 148 [0 2 0] --- [2:0 >> -1:0 >> >> 31 >> >> 0] [0] 1 0 >> >> r 0.500571841 _0_ RTR --- 0 cbr 148 [0 2 0] --- [2:0 >> -1:0 >> >> 32 >> >> 0] [0] 1 0 >> >> r 0.500571841 _0_ AGT --- 0 cbr 148 [0 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 2 0] --- [2:0 -1:0 >> >> 32 >> >> 0] [1] 0 0 >> >> r 0.508051758 _1_ MAC --- 1 cbr 148 [0 2 0] --- [2:0 >> -1:0 >> >> 32 >> >> 0] [1] 1 0 >> >> r 0.508051934 _0_ MAC --- 1 cbr 148 [0 2 0] --- [2:0 >> -1:0 >> >> 32 >> >> 0] [1] 1 0 >> >> r 0.508076758 _1_ RTR --- 1 cbr 148 [0 2 0] --- [2:0 >> -1:0 >> >> 32 >> >> 0] [1] 1 0 >> >> r 0.508076758 _1_ AGT --- 1 cbr 148 [0 2 0] --- [2:0 >> -1:0 >> >> 31 >> >> 0] [1] 1 0 >> >> r 0.508076934 _0_ RTR --- 1 cbr 148 [0 2 0] --- [2:0 >> -1:0 >> >> 32 >> >> 0] [1]
Re: [ns] Broadcasting a UDP ns2.34 802.11Ext
Hi guys again :) Sorry for too much questions :) When I tried to add the scenario above ( broadcasting + cbr traffic flow) the dst_addr_ -1 didn't work anymore, the simulation finishes but the trace file ends incomplete. For my luck, i tried, i don't know why, to set dst_addr_ -2 and works! In the trace shown n1 sends a broadcast, n2 sends its cbr traffic and n3 receive both flows. But when i tried to add a forthy node to receive the broadcasting, it didn't appears in the trace file. i'm trying to solve this problem. So, why dst_addr_ -2 work? 2012/5/2 Paulo Robson S. F. > Hi, > > I forgot to show this page: > http://www.math.unipd.it/~cpalazzi/fastbroadcast.html > what do you think of this broadcast agent? > > Att > > > 2012/5/2 Paulo Robson S. F. > > Hi guys, thanks for the feedback. >> >> Alysson, >> >> >> The Agent PBC is a broadcast but is only ping, I tested it before and is >> no good for me. >> >> I dont understand this agent Flooding at all, I need to use it? >> >> Are you saying the only way to broadcast is to use one of those agents? >> My way is wrong? >> >> Another question, >> Is possible the follow scenario? : one node(n1) broadcasting and two >> another(n2 and n3) nodes as a cbr traffic flow like n2 ---> n3 and n3 >> receiving the broadcasting packets of n1 and the traffic of n2? >> >> Thank you! >> >> >> >> 2012/5/2 Alysson Oliveira >> >>> Hi, >>> >>> You can see it on ns-2.34/tcl/ex/wireless-flooding.tcl and >>> ns-2.34/tcl/ex/802.11/broadcast_validation.tcl witch uses a specific >>> broadcast agent. >>> >>> Further details in ns-2.34/common/packet.h on lines 676 and 677: >>> init(p); // Initialize bits_[] >>> (HDR_CMN(p))->next_hop_ = -2; // -1 reserved for IP_BROADCAST >>> (HDR_CMN(p))->last_hop_ = -2; // -1 reserved for IP_BROADCAST >>> >>> Regards, >>> Alysson Oliveira >>> >>> >>> 2012/5/2, Frank Wetzels : >>> > >>> > Hi, >>> > >>> > I have no solution for you in NS2. However, I have a remark on your >>> > address/port choice. >>> > I guess that by choosing -1, you fill the address field with >>> 255.255.255.255 >>> > as IP address >>> > in dotted decimal notation? The port number choice of 0 is a bit >>> strange. >>> > Although you are using IP broadcast >>> > you - strictly speaking - still need a legitimate port number. Indeed, >>> you >>> > choose a particular protocol by choosing >>> > the port address. As an example, DHCP uses IP broadcast initially >>> based on >>> > UDP67 / UDP68. >>> > >>> > Regards, >>> > Frank >>> > >>> > On May 1, 2012, at 5:36 AM, Paulo Robson S. F. wrote: >>> > >>> >> >>> >> 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.5 _2_ AGT --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 0] >>> >> [0] >>> >> 0 0 >>> >> r 0.5 _2_ RTR --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 >>> 0] >>> >> [0] >>> >> 0 0 >>> >> s 0.5 _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 2 0] --- [2:0 >>> -1:0 >>> >> 32 >>> >> 0] [0] 0 0 >>> >> r 0.500546664 _1_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 >>> -1:0 >>> >> 32 >>> >> 0] [0] 1 0 >>> >> r 0.500546841 _0_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 >>> -1:0 >>> >> 32 >>> >> 0] [0] 1 0 >>> >> r 0.500571664 _1_ RTR --- 0 cbr 148 [0 2 0] --- [2:0 >>> -1:0 >>> >> 32 >>> >> 0] [0] 1 0 >>> >> r 0.500571664 _1_ AGT --- 0 cbr 148 [0 2 0] --- [2:0 >>> -1:0 >>> >> 31 >>> >> 0] [0] 1 0 >>> >> r 0.500571841 _0_ RTR --- 0 cbr 148 [0 2 0] --- [2:0 >>> -1:0 >>> >> 32 >>> >> 0] [0] 1 0 >>> >> r 0.500571841 _0_ AGT --- 0 cbr 148 [0 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 >>>
Re: [ns] Broadcasting a UDP ns2.34 802.11Ext
Hi Paulo, Read carefully the documents I had pointed before! They would explain you how to proceed. Regards, Alysson 2012/5/2, Paulo Robson S. F. : > Hi guys again :) > > Sorry for too much questions :) > > When I tried to add the scenario above ( broadcasting + cbr traffic flow) > the dst_addr_ -1 didn't work anymore, the simulation finishes but the trace > file ends incomplete. > For my luck, i tried, i don't know why, to set dst_addr_ -2 and works! > In the trace shown n1 sends a broadcast, n2 sends its cbr traffic and n3 > receive both flows. > > But when i tried to add a forthy node to receive the broadcasting, it > didn't appears in the trace file. > i'm trying to solve this problem. > > So, why dst_addr_ -2 work? > > 2012/5/2 Paulo Robson S. F. > >> Hi, >> >> I forgot to show this page: >> http://www.math.unipd.it/~cpalazzi/fastbroadcast.html >> what do you think of this broadcast agent? >> >> Att >> >> >> 2012/5/2 Paulo Robson S. F. >> >> Hi guys, thanks for the feedback. >>> >>> Alysson, >>> >>> >>> The Agent PBC is a broadcast but is only ping, I tested it before and is >>> no good for me. >>> >>> I dont understand this agent Flooding at all, I need to use it? >>> >>> Are you saying the only way to broadcast is to use one of those agents? >>> My way is wrong? >>> >>> Another question, >>> Is possible the follow scenario? : one node(n1) broadcasting and two >>> another(n2 and n3) nodes as a cbr traffic flow like n2 ---> n3 and n3 >>> receiving the broadcasting packets of n1 and the traffic of n2? >>> >>> Thank you! >>> >>> >>> >>> 2012/5/2 Alysson Oliveira >>> Hi, You can see it on ns-2.34/tcl/ex/wireless-flooding.tcl and ns-2.34/tcl/ex/802.11/broadcast_validation.tcl witch uses a specific broadcast agent. Further details in ns-2.34/common/packet.h on lines 676 and 677: init(p); // Initialize bits_[] (HDR_CMN(p))->next_hop_ = -2; // -1 reserved for IP_BROADCAST (HDR_CMN(p))->last_hop_ = -2; // -1 reserved for IP_BROADCAST Regards, Alysson Oliveira 2012/5/2, Frank Wetzels : > > Hi, > > I have no solution for you in NS2. However, I have a remark on your > address/port choice. > I guess that by choosing -1, you fill the address field with 255.255.255.255 > as IP address > in dotted decimal notation? The port number choice of 0 is a bit strange. > Although you are using IP broadcast > you - strictly speaking - still need a legitimate port number. Indeed, you > choose a particular protocol by choosing > the port address. As an example, DHCP uses IP broadcast initially based on > UDP67 / UDP68. > > Regards, > Frank > > On May 1, 2012, at 5:36 AM, Paulo Robson S. F. wrote: > >> >> 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.5 _2_ AGT --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 >> 0] >> [0] >> 0 0 >> r 0.5 _2_ RTR --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 0] >> [0] >> 0 0 >> s 0.5 _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 2 0] --- [2:0 -1:0 >> 32 >> 0] [0] 0 0 >> r 0.500546664 _1_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 >> 32 >> 0] [0] 1 0 >> r 0.500546841 _0_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 >> 32 >> 0] [0] 1 0 >> r 0.500571664 _1_ RTR --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 >> 32 >> 0] [0] 1 0 >> r 0.500571664 _1_ AGT --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 >> 31 >> 0] [0] 1 0 >> r 0.500571841 _0_ RTR --- 0 cbr 148
Re: [ns] Broadcasting a UDP ns2.34 802.11Ext
Hi Paulo, Sorry to bother you, but I have just seen your question and I have a similar problem: I would like a source node (n0) to broadcast CBR packets via UDP to 1 hop neighbors (n1,n2) in a wireless dhoc network (either CMU 802.11 or 802.11 ext). After if that succeeds, I would like to increase the number of receivers. - Did your solution (i.e., by setting dst_addr_ -2 ) finally work for 40 nodes? - What was your final solution? (if you have a code example) I would really appreciate if you help me with this, Thanks in advance, Best, Behnaz Paulo Robson S. F. wrote: > > > 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.5 _2_ AGT --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 0] [0] > 0 0 > r 0.5 _2_ RTR --- 0 cbr 128 [0 0 0 0] --- [2:0 -1:0 32 0] > [0] > 0 0 > s 0.5 _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 2 0] --- [2:0 -1:0 32 > 0] [0] 0 0 > r 0.500546664 _1_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 > 32 > 0] [0] 1 0 > r 0.500546841 _0_ MAC --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 > 32 > 0] [0] 1 0 > r 0.500571664 _1_ RTR --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 > 32 > 0] [0] 1 0 > r 0.500571664 _1_ AGT --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 > 31 > 0] [0] 1 0 > r 0.500571841 _0_ RTR --- 0 cbr 148 [0 2 0] --- [2:0 -1:0 > 32 > 0] [0] 1 0 > r 0.500571841 _0_ AGT --- 0 cbr 148 [0 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 2 0] --- [2:0 -1:0 32 > 0] [1] 0 0 > r 0.508051758 _1_ MAC --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 > 32 > 0] [1] 1 0 > r 0.508051934 _0_ MAC --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 > 32 > 0] [1] 1 0 > r 0.508076758 _1_ RTR --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 > 32 > 0] [1] 1 0 > r 0.508076758 _1_ AGT --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 > 31 > 0] [1] 1 0 > r 0.508076934 _0_ RTR --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 > 32 > 0] [1] 1 0 > r 0.508076934 _0_ AGT --- 1 cbr 148 [0 2 0] --- [2:0 -1:0 > 31 > 0] [1] 1 0 > > > Thanks guys > > > Att, > > -- > Paulo Robson SF > Computação UFC > Semestre VII > > robson.pauloufc@gmail.combehnaz.bostanip...@gmail.com -- View this message in context: http://old.nabble.com/Broadcasting-a-UDP-ns2.34-802.11Ext-tp33775543p34646055.html Sent from the ns-users mailing list archive at Nabble.com.