ns 2.35: connecting one agent to more than one agents
Sara Elouadaa <[email protected]> Wed, 24 Apr 2019 19:53:11 +0100
| Newsgroups | gmane.network.simulator.isi |
|---|---|
| Message-ID | <CAG4q0jFqYtahVey9CX-PrUbuve9YnvRZOGoMBiqgUDjht2Ei1A@mail.gmail.com> |
--0000000000005396d905874b3755 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear all, I am using ns 2.35 and want to implement a new protocol of the application layer. The protocol allows the neighboring nodes of a wireless network to exchange different messages. For that, I developed a new application and derived a transport agent from UDP class to send and receive the new application's packets. The problem I have consists of connecting a node to more than one nodes. Example: I created three agents and attached each one to a node like this: set udp_a [new Agent/UDP/UDPscp] set udp_b [new Agent/UDP/UDPscp] set udp_c [new Agent/UDP/UDPscp] $ns attach-agent $n0 $udp_a $ns attach-agent $n1 $udp_b $ns attach-agent $n2 $udp_c Then I tried to connect node n1 to its two neighbors n0 and n2 like this: $ns connect $udp_a $udp_b $ns connect $udp_c $udp_b As a result, n1 connects only to n2 but never to n0. So I tried to connect n1 to its two neighbors through different port numbers like this : $ns connect $udp_a $udp_b 0 $ns connect $udp_c $udp_b 1 But, it gives the following error message: wrong # args: should be "_o3 self class proc src dst" <simulator connect line 1> invoked from within "$ns connect $udp-a $udp-b 0" I would be grateful if anybody can help me on that. Thanks & Regards _____________________________________________________ *EL OUADAA Sara* *PhD Student at Ecole Mohammadia d'Ing=C3=A9nieurs* *Graduated Engineer in Telecoms and Networks.* *Ecole Nationale des Sciences Appliqu=C3=A9es de Tanger (ENSAT).Mobile: 00212666501904* --0000000000005396d905874b3755 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr">Dear al= l,</div><div dir=3D"ltr"><br><div>I am using ns 2.35 and want to implement = a new protocol of the application layer. The protocol allows the neighborin= g nodes of a wireless network to exchange different messages. For that, I d= eveloped a new application and derived a transport agent from UDP class to = send and receive=C2=A0 the new application's packets.</div><div><br></d= iv><div>The problem I have consists of connecting a node to more than one n= odes.</div><div><br></div><div>Example:</div><div>I created three agents an= d attached each one to a node like this:</div><div><div><br></div><div><fon= t color=3D"#0000ff">set udp_a [new Agent/UDP/UDPscp]</font></div><div><font= color=3D"#0000ff">set udp_b [new Agent/UDP/UDPscp]</font></div><div><font = color=3D"#0000ff">set udp_c [new Agent/UDP/UDPscp]=C2=A0</font></div><div><= font color=3D"#0000ff"><br></font></div><div><font color=3D"#0000ff">$ns at= tach-agent $n0 $udp_a</font></div><div><font color=3D"#0000ff">$ns attach-a= gent $n1 $udp_b=C2=A0<br></font></div><div><font color=3D"#0000ff">$ns atta= ch-agent $n2 $udp_c</font><br></div><div><br></div><div><div>Then I tried t= o connect node n1 to its two neighbors n0 and n2 like this:</div><div><br><= /div><div><div><font color=3D"#0000ff">$ns connect $udp_a $udp_b=C2=A0</fon= t></div><div><font color=3D"#0000ff">$ns connect $udp_c $udp_b=C2=A0</font>= </div></div><div><br></div><div>As a result, n1 connects only to n2 but nev= er to n0.=C2=A0</div><div>So I tried to connect n1 to its two neighbors thr= ough different port numbers like this :</div><div><br></div><div><font colo= r=3D"#0000ff">$ns connect $udp_a $udp_b 0</font></div><div><font color=3D"#= 0000ff">$ns connect $udp_c $udp_b 1</font></div></div><div><br></div><div>B= ut, it gives the following error message:</div><div><br></div><div><font co= lor=3D"#0000ff"><span style=3D"font-family:Roboto,Arial,sans-serif;font-siz= e:14px">wrong # args: should be "_o3 self class proc src dst"</sp= an><br style=3D"font-family:Roboto,Arial,sans-serif;font-size:14px"><span s= tyle=3D"font-family:Roboto,Arial,sans-serif;font-size:14px"><simulator c= onnect line 1></span><br style=3D"font-family:Roboto,Arial,sans-serif;fo= nt-size:14px"><span style=3D"font-family:Roboto,Arial,sans-serif;font-size:= 14px">invoked from within</span><br style=3D"font-family:Roboto,Arial,sans-= serif;font-size:14px"><span style=3D"font-family:Roboto,Arial,sans-serif;fo= nt-size:14px">"$ns connect $udp-a $udp-b 0"</span>=C2=A0=C2=A0</f= ont><br></div><div><br></div><div>I would be grateful if anybody can help m= e on that.<br></div><br><div dir=3D"ltr" class=3D"m_-3923016268240424165gma= il_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr">= <div><div dir=3D"ltr"><span style=3D"background-color:rgb(255,255,255)"><fo= nt face=3D"arial, helvetica, sans-serif" color=3D"#000000">Thanks & Reg= ards</font><br><font color=3D"#0000ff">____________</font></span><font colo= r=3D"#0000ff">_________________________________________</font><div><font co= lor=3D"#0000ff"><span><br></span><i style=3D"font-family:arial,sans-serif;f= ont-size:13px;background-color:rgb(255,255,255)">EL OUADAA Sara</i></font><= /div><div><font color=3D"#0000ff"><i style=3D"font-family:arial,sans-serif;= font-size:13px;background-color:rgb(255,255,255)">PhD Student at Ecole Moha= mmadia d'Ing=C3=A9nieurs<br></i><i style=3D"font-size:13px"><div style= =3D"display:inline"><i style=3D"font-size:13px"><i style=3D"font-size:13px"= ><div style=3D"display:inline">Graduated Engineer in Telecoms and Networks.= </div></i></i></div></i><i style=3D"font-family:arial,sans-serif;font-size:= 13px;background-color:rgb(255,255,255)"><br><div><i style=3D"font-size:13px= "><i style=3D"font-size:13px"><div><i style=3D"font-size:13px">Ecole Nation= ale des Sciences Appliqu=C3=A9es de Tanger (ENSAT).</i></div>Mobile: 002126= 66501904</i></i></div></i></font></div></div></div></div></div></div></div>= </div></div></div></div></div></div></div> --0000000000005396d905874b3755--