Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Raw ethernet packet using bpf0 and bpf1: (10 Items)
   
Raw ethernet packet using bpf0 and bpf1  
Hi,

I am using QNX 6.5

Is it possible to have more than one bpf created.

I would like to have two bpf one named
/dev/bpf0
/dev/bpf1

So i can use those two devices bound to the two network adapters of my motherboard.

Thank you
Re: Raw ethernet packet using bpf0 and bpf1  
  As far as I know you will need two instances of io-pkt in order to 
achieve that.
Re: Raw ethernet packet using bpf0 and bpf1  
Do you mean launch io-pkt for each network interface?
This is already done...


-----Message d'origine----- 
From: Gervais Mulongoy
Sent: Thursday, February 28, 2013 2:50 PM
To: general-networking@community.qnx.com
Subject: Re: Raw ethernet packet using bpf0 and bpf1

  As far as I know you will need two instances of io-pkt in order to
achieve that.




_______________________________________________

General
http://community.qnx.com/sf/go/post99607
To cancel your subscription to this discussion, please e-mail 
general-networking-unsubscribe@community.qnx.com 
Re: Raw ethernet packet using bpf0 and bpf1  
Wait you launched both and it only created a single bpf dev entry? I'll 
have to look at the implementation to confirm.


On 02/28/2013 12:02 PM, Michele Damoiseau wrote:
> Do you mean launch io-pkt for each network interface?
> This is already done...
>
>
> -----Message d'origine-----
> From: Gervais Mulongoy
> Sent: Thursday, February 28, 2013 2:50 PM
> To: general-networking@community.qnx.com
> Subject: Re: Raw ethernet packet using bpf0 and bpf1
>
>    As far as I know you will need two instances of io-pkt in order to
> achieve that.
>
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post99607
> To cancel your subscription to this discussion, please e-mail
> general-networking-unsubscribe@community.qnx.com
>
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post99611
> To cancel your subscription to this discussion, please e-mail general-networking-unsubscribe@community.qnx.com

Re: Raw ethernet packet using bpf0 and bpf1  
Wait you launched both and it only created a single bpf dev entry? I'll 
have to look at the implementation to confirm.


On 02/28/2013 12:02 PM, Michele Damoiseau wrote:
> Do you mean launch io-pkt for each network interface?
> This is already done...
>
>
> -----Message d'origine-----
> From: Gervais Mulongoy
> Sent: Thursday, February 28, 2013 2:50 PM
> To: general-networking@community.qnx.com
> Subject: Re: Raw ethernet packet using bpf0 and bpf1
>
>    As far as I know you will need two instances of io-pkt in order to
> achieve that.
>
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post99607
> To cancel your subscription to this discussion, please e-mail
> general-networking-unsubscribe@community.qnx.com
>
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post99611
> To cancel your subscription to this discussion, please e-mail general-networking-unsubscribe@community.qnx.com

Re: Raw ethernet packet using bpf0 and bpf1  
I just tried the following:

1) io-pkt-v4 -dpcnet -i1 -ptcpip prefix=/net1
2) io-pkt-v4 -de1000 -i2 -ptcpip prefix=/net2

Each instance of Io-pkt lives at its own prefix. Note that this means 
that all network apps will need to be told which prefix to use or they 
will complain that they can't find the network stack at the default 
prefix of /.  Further note, you can configure one instance to live at 
the default location, just omit the "-ptcpip prefx=.*" bit.

Following the above steps, I now have two distinct sets of bpf interfaces.

/net1/dev/bpf*
/net2/dev/bpf*

If I want to use the first bpf interface, I specify the prefix:

SOCK=/net1 myNetApp

If I want to use the second bpf interface, I specify the prefix:

SOCK=/net2 myNetApp



How are you launching both instances of io-pkt?

Re: Raw ethernet packet using bpf0 and bpf1  
Actually, I was launching io-pkt via enum utilities.
I have tried after that manually, but my mistake was not to define pci index 
of each interface...

Thanks for that information. Now, I could have now /net1/dev/bpf0 and 
/net2/dev/bpf0!

But a last question, how can I launch netmanager after that, in order to 
define IP address on each interface?
How to pass the prefix to all the network applications?

Many thanks
Regards
Michele


-----Message d'origine----- 
From: Gervais Mulongoy
Sent: Friday, March 01, 2013 2:39 PM
To: general-networking@community.qnx.com
Subject: Re: Raw ethernet packet using bpf0 and bpf1

I just tried the following:

1) io-pkt-v4 -dpcnet -i1 -ptcpip prefix=/net1
2) io-pkt-v4 -de1000 -i2 -ptcpip prefix=/net2

Each instance of Io-pkt lives at its own prefix. Note that this means
that all network apps will need to be told which prefix to use or they
will complain that they can't find the network stack at the default
prefix of /.  Further note, you can configure one instance to live at
the default location, just omit the "-ptcpip prefx=.*" bit.

Following the above steps, I now have two distinct sets of bpf interfaces.

/net1/dev/bpf*
/net2/dev/bpf*

If I want to use the first bpf interface, I specify the prefix:

SOCK=/net1 myNetApp

If I want to use the second bpf interface, I specify the prefix:

SOCK=/net2 myNetApp



How are you launching both instances of io-pkt?





_______________________________________________

General
http://community.qnx.com/sf/go/post99629
To cancel your subscription to this discussion, please e-mail 
general-networking-unsubscribe@community.qnx.com 

Re: Raw ethernet packet using bpf0 and bpf1  
You will need to start netmanager manually for each instance of io-pkt. 
In my previous example, you would do something like this:

SOCK=/net1 netmanager
SOCK=/net2 netmanager
Re: Raw ethernet packet using bpf0 and bpf1  
Great, thanks!!!

However, how can I define SOCK=/net1 when I am working in a C++ environment?

For example, if I want to use the function getifaddrs(), how to get 
interfaces linked to SOCK=/dev/net1?

Many thanks


-----Message d'origine----- 
From: Gervais Mulongoy
Sent: Monday, March 04, 2013 2:14 PM
To: general-networking@community.qnx.com
Subject: Re: Raw ethernet packet using bpf0 and bpf1

You will need to start netmanager manually for each instance of io-pkt.
In my previous example, you would do something like this:

SOCK=/net1 netmanager
SOCK=/net2 netmanager




_______________________________________________

General
http://community.qnx.com/sf/go/post99662
To cancel your subscription to this discussion, please e-mail 
general-networking-unsubscribe@community.qnx.com 

Re: Raw ethernet packet using bpf0 and bpf1  
You would need to set it prior to starting your app:

SOCK=/net1 youAppGoesHere

This means that this instance of your application will use the 
SOCK=/net1 environment variable. You can not change it once it is set as 
far as I know, so you would need to launch another instance with 
SOCK=/net2 to connect to the other stack.