Re: [nox-dev] Instance of an application

2011-06-03 Thread Paulo César
Thanks for reply, it was very helpful.
I will try another way.

2011/6/3 Murphy McCauley 

> Every NOX component (which is a class that inherits from Component) holds a
> pointer to its context in the ctxt field.  This happens through Component's
> constructor.
>
> So within your component, you should be able to do something like...
> ... = ctxt->get_by_name("Some Other Component Name");
> .. and get a pointer to the named component (you'll need to cast it to the
> appropriate type).
>
> But I'm not entirely sure I understand what you're trying to do.  You say
> you're trying to get an instance of an application and send it to another
> controller, and my first response is, "You can't do that," so hopefully I'm
> just misunderstanding. :)
>
> -- Murphy
>
> On Friday, June 03, 2011 11:02:23 AM Paulo César wrote:
> > Hi,
> >
> > I am trying to get a instance of an application and send it to another
> > controller.
> >
> > The class Context seems to provide what I was looking for:
> > > class Context {
> > > public:
> > > ...
> > >
> > > /* Find a component and return a pointer to its instance.  Returns
> > >
> > >0 if not found. */
> > >
> > > virtual Component* get_by_name(const Component_name&) const = 0;
> > >
> > > ...
> > > }
> >
> > But I am having a problem to use Context as a parameter to a function of
> my
> > class.
> >
> > Did anyone try anything similar? (Use the class Context or get a instance
> > of a component)
> >
> > Best regards.
>



-- 

Paulo César da Rocha Fonseca

Graduando em Ciência da Computação

Laboratório de Computação Inteligente e Autônoma

Universidade Federal do Amazonas (UFAM)
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] How to change a Flow destination in a nox component

2011-06-03 Thread Ricardo Bennesby
Hi Murphy.

Thank you very much for help. Interesting.  I will consider the ethernet
addresses to change the destination, once the component is a L2 switch. Any
results I post a feedback here.

Regards.

2011/6/3 Murphy McCauley 

> The switch component is an L2 learning switch, so it makes its decisions
> based
> on ethernet addresses.  It makes this decision for every new flow, but only
> based on the ethernet address.  Once the decision is made, an exact match
> flow
> is installed (if I recall correctly) that will direct that flow out
> whatever
> port it learned the destination ethernet address is connected to (or all
> ports
> if it doesn't know where the destination is).
>
> So if you want to use the switch component to send traffic somewhere
> specific,
> it's the ethernet address that's important.
>
> I'm not sure if that helps or not -- maybe we could provide a better answer
> if
> you explained more fully what you're trying to do.
>
> -- Murphy
>
> On Friday, June 03, 2011 09:50:08 AM Ricardo Bennesby wrote:
> > Hi all.
> >
> > I would like some help in how can I change the destination of a flow that
> > arrives on nox controller before send it back to switch.
> > For example, I want that in a network with three hosts, when a host 1
> > "pings" to host 2, the component (switch.cc) makes the datapath forward
> it
> > to host 3.
> > If I chande only the flow destination IP (from 10.0.0.2 to 10.0.0.3, for
> > example) the packets continue being forwarded normally to host 2. Should
> I
> > change all the flow fields in switch component, like mac, in_port, etc?
> Is
> > this the right way?
> >
> > Thank you very much for your help and attention.
> >
> > Best regards.
>



-- 
Ricardo Bennesby da Silva
Ciência da Computação - UFAM
LabCIA - Laboratório de Computação Inteligente e Autonômica
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] Instance of an application

2011-06-03 Thread Murphy McCauley
Every NOX component (which is a class that inherits from Component) holds a 
pointer to its context in the ctxt field.  This happens through Component's 
constructor.

So within your component, you should be able to do something like...
... = ctxt->get_by_name("Some Other Component Name");
.. and get a pointer to the named component (you'll need to cast it to the 
appropriate type).

But I'm not entirely sure I understand what you're trying to do.  You say 
you're trying to get an instance of an application and send it to another 
controller, and my first response is, "You can't do that," so hopefully I'm 
just misunderstanding. :)

-- Murphy

On Friday, June 03, 2011 11:02:23 AM Paulo César wrote:
> Hi,
> 
> I am trying to get a instance of an application and send it to another
> controller.
> 
> The class Context seems to provide what I was looking for:
> > class Context {
> > public:
> > ...
> > 
> > /* Find a component and return a pointer to its instance.  Returns
> > 
> >0 if not found. */
> > 
> > virtual Component* get_by_name(const Component_name&) const = 0;
> > 
> > ...
> > }
> 
> But I am having a problem to use Context as a parameter to a function of my
> class.
> 
> Did anyone try anything similar? (Use the class Context or get a instance
> of a component)
> 
> Best regards.
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] How to change a Flow destination in a nox component

2011-06-03 Thread Murphy McCauley
The switch component is an L2 learning switch, so it makes its decisions based 
on ethernet addresses.  It makes this decision for every new flow, but only 
based on the ethernet address.  Once the decision is made, an exact match flow 
is installed (if I recall correctly) that will direct that flow out whatever 
port it learned the destination ethernet address is connected to (or all ports 
if it doesn't know where the destination is).

So if you want to use the switch component to send traffic somewhere specific, 
it's the ethernet address that's important.

I'm not sure if that helps or not -- maybe we could provide a better answer if 
you explained more fully what you're trying to do.

-- Murphy

On Friday, June 03, 2011 09:50:08 AM Ricardo Bennesby wrote:
> Hi all.
> 
> I would like some help in how can I change the destination of a flow that
> arrives on nox controller before send it back to switch.
> For example, I want that in a network with three hosts, when a host 1
> "pings" to host 2, the component (switch.cc) makes the datapath forward it
> to host 3.
> If I chande only the flow destination IP (from 10.0.0.2 to 10.0.0.3, for
> example) the packets continue being forwarded normally to host 2. Should I
> change all the flow fields in switch component, like mac, in_port, etc? Is
> this the right way?
> 
> Thank you very much for your help and attention.
> 
> Best regards.
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


[nox-dev] Instance of an application

2011-06-03 Thread Paulo César
Hi,

I am trying to get a instance of an application and send it to another
controller.
The class Context seems to provide what I was looking for:

> class Context {
> public:
> ...
> /* Find a component and return a pointer to its instance.  Returns
>0 if not found. */
> virtual Component* get_by_name(const Component_name&) const = 0;
> ...
> }



But I am having a problem to use Context as a parameter to a function of my
class.

Did anyone try anything similar? (Use the class Context or get a instance of
a component)

Best regards.

-- 

Paulo César da Rocha Fonseca

Graduando em Ciência da Computação

Laboratório de Computação Inteligente e Autônoma

Universidade Federal do Amazonas (UFAM)
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


[nox-dev] How to change a Flow destination in a nox component

2011-06-03 Thread Ricardo Bennesby
Hi all.

I would like some help in how can I change the destination of a flow that
arrives on nox controller before send it back to switch.
For example, I want that in a network with three hosts, when a host 1
"pings" to host 2, the component (switch.cc) makes the datapath forward it
to host 3.
If I chande only the flow destination IP (from 10.0.0.2 to 10.0.0.3, for
example) the packets continue being forwarded normally to host 2. Should I
change all the flow fields in switch component, like mac, in_port, etc? Is
this the right way?

Thank you very much for your help and attention.

Best regards.

-- 
Ricardo Bennesby da Silva
Ciência da Computação - UFAM
LabCIA - Laboratório de Computação Inteligente e Autonôma
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev