[ns] Sending packets internally from a node

2012-06-25 Thread Zubair Ahmed Khan

Good Morning All,
Hope every body is fine :)
I have a few questions, i will be really thankful if some body can please
guide me, i am stuck and feel like i am in no mans land or on mars :(
I want to send a copy of each packet received at one node (say X1) to
another node (say X2).  I have the reference of X2 inside X1, I have
studied a lot of stuff for this purpose but i am unable to find an entry
point to start implementation :(

2ndly, is there a way to find out (using C++) that X1 is in range of X2?


Thanking you in advance, please somebody at least give me a hint.


Warm Regards,
Zubair Ahmed Khan


[ns] Sending packets over TCP or UDP ;(

2010-01-05 Thread adel belkhiri


Dear friends,


I'm designing an agent (application layer) that sends packets over a Manet 
environment. I notice that my agent is derived from the Agent class since
I coudn't derive it from Application class because ns2 do not allow them to 
send significant data payload. The problem is that some packets are lost
due to many reasons (such as collision, arp or routing problems, etc.). so, I 
want to know how to use protocols like TCP or UDP to ensure that packets
sent by my agent will arrive at their destination.

Thanks a lot for any suggestion.


  
_
Windows Live: Make it easier for your friends to see what you’re up to on 
Facebook.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092009

[ns] Sending packets from agents

2009-07-13 Thread Τσιλιγγίρης Γεώργιος

Hi all,

Does anybody node if I can send a packet from an agent to a node based
on the nodes ID?

George


[ns] Sending packets one by one

2006-10-17 Thread m . tharwat

How to send just one packet, and how to include a specific data in the body of
this packet, and how to chech that packet has been received by the receiver
node?



Re: [ns] sending packets

2006-10-09 Thread Pedro Vale Estrela


Inside my recv() function I do like this without problems:


// clone the current packet and change some fields
Packet* new_p = clone_pkt(p);

hdr_ip*new_iph  = hdr_ip::access(new_p);

new_iph-daddr() = ...;
new_iph-saddr() = addr();

// change fields on the current packet
iph-daddr() = id2iaddr(th-b_id);
iph-saddr() = addr();


// send original packet somewhere
send(p, 0);

// send cloned packet elsewhere
send(new_p, 0);

...





 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
 Of Larry Brigman
 Sent: segunda-feira, 9 de Outubro de 2006 19:14
 To: ns-users@ISI.EDU
 Subject: [ns] sending packets
 
 
 I am working on a queuing model.  There are times that I need to
 send more than one packet in the recv function.
 
 Because of the way NS models things it looks like after a single send or
 target-recv(p,h) I cannot send again without an error.
 
 Is there a way to write a recv function that is allowed to send more than
 once?
 
 Also when I am rescheduling my class to deque packets, about the time I
 need to
 deque two or more packets NS detects that time has gone backwards!
 
 
 I am running this on FC4 using 2.29 version of NS.
 
 Thanks for any help provided.
 Larry





Re: [ns] sending packets

2006-10-09 Thread Larry Brigman

On 10/9/06, Pedro Vale Estrela [EMAIL PROTECTED] wrote:

 Inside my recv() function I do like this without problems:


 // clone the current packet and change some fields
 Packet* new_p = clone_pkt(p);

 hdr_ip*new_iph  = hdr_ip::access(new_p);

 new_iph-daddr() = ...;
 new_iph-saddr() = addr();

 // change fields on the current packet
 iph-daddr() = id2iaddr(th-b_id);
 iph-saddr() = addr();


 // send original packet somewhere
 send(p, 0);

 // send cloned packet elsewhere
 send(new_p, 0);

That doesn't seem to work for me when my class inherits from the queue class.

In my recv function I am doing:
while ((pkt = deque()) != NULL) {
send(pkt,0);
}

I get this error:
Scheduler: attempt to schedule an event with a NULL handler.  Don't DO that.

If I change it to use the handler that is inherited from the queue class as
while ((pkt = deque()) != NULL) {
send(pkt,qh_);
}

I get an error like:
Scheduler: Event UID not valid!


If I only do process one packet each time recv is called but always
schedule() with a small
delay, I get NS time backwards error.

I need to schedule every 5-10ms even if no packets are arriving as the
object may have
held packets because of the queuing functions.



Re: [ns] sending packets

2006-10-09 Thread Larry Brigman

No, I need to send different p during the same recv function.
(ie I need to deque multiple packets)

On 10/9/06, Raghu-kisore Neelisetti [EMAIL PROTECTED] wrote:
 Hi,
  Iam not sure If i understood you right. You cannot send the same 'p'
 over and over again (If this what u meant). The way to avoid the problem
 is
 target-recv(p,h)
 //Now make a copy of the p that you sent before and then
 target-recv(p,h)

 Iam sorry if i misunderstood you.
 raghu.


  Larry Brigman [EMAIL PROTECTED] 10/09/06 1:14 PM 
 I am working on a queuing model.  There are times that I need to
 send more than one packet in the recv function.

 Because of the way NS models things it looks like after a single send or
 target-recv(p,h) I cannot send again without an error.

 Is there a way to write a recv function that is allowed to send more
 than once?

 Also when I am rescheduling my class to deque packets, about the time I
 need to
 deque two or more packets NS detects that time has gone backwards!


 I am running this on FC4 using 2.29 version of NS.

 Thanks for any help provided.
 Larry







[ns] Sending packets from different flows to a destination via two different paths

2006-06-23 Thread Nicholas Loulloudes

Hello,

I have created two nodes in ns2 which are connected to each other using two
links.

I have created also two different UDP flows on n0 (source node) to be
transmitted to n1 (destination node).

Is it possible to have packets belonging to flow 1 routed from one link and
packets belonging to flow 2 routed from the other link?

Thank you in advance?

-- 
Nicholas Loulloudes

Postgraduate at Communication Networks and Software.

BSc in Computer Science.


[ns] sending packets from objects within agent

2006-03-27 Thread elise hu

Hi,

i have implemented a routing agent for ad-hoc routing, but i have a problem: 
the agent attached to a node has several 'roles', so the agent has a central 
subclass of agent, and contains several objects which take care of different 
behaviours.
Now i need to send packets from those objects - how should i transmit the 
Scheduler used in the central agent ?  Or should i just transmit target_ ?
(or should i use another way to get those packets sent ?) (i use ns-2.29)
Masters of ns ;-) , i hope you can help me !
thanks,

Elise

_
Free blogging with MSN Spaces  http://spaces.msn.com/?mkt=nl-be