Re: Multiple NICs - custom protocol development

2007-09-22 Thread Lowell Gilbert
"Len Gross" <[EMAIL PROTECTED]> writes:

> First, thanks for the response; It's nice to see some community support.
>
> Here is what I am trying to do:
>
> I am building a custom MAC protocol for a wireless system that has different
> software on
> the "head end" and the "clients."  It is not peer-to-peer,  While the
> hardware is being developed
> I want to use Ethernet as a physical layer.
>
> So,I want to use one card running server code and one card running client
> code initially.   Later I will do
> the checkout with multiple client machines and a single server.
>
> If the OS "loops a packet back" (At the IP layer) before it gets to my "MAC
> layer" then I can't test any code.

If the client and server are sharing an IP stack, then the packets
*should* be looped back at the IP layer.  You want separate stacks for
testing with IP, and in my earlier message I listed some ways to do
that with a single machine.  Getting a second PC is always an option
too, and often a simple answer.

Another option could be to fake (or wrap) the socket calls, but I
doubt that's really going to be worthwhile for you.  I prefer to never
spend more time debugging the testbed than absolutely necessary.

Good luck.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Multiple NICs - custom protocol development

2007-09-20 Thread Len Gross
First, thanks for the response; It's nice to see some community support.

Here is what I am trying to do:

I am building a custom MAC protocol for a wireless system that has different
software on
the "head end" and the "clients."  It is not peer-to-peer,  While the
hardware is being developed
I want to use Ethernet as a physical layer.

So,I want to use one card running server code and one card running client
code initially.   Later I will do
the checkout with multiple client machines and a single server.

If the OS "loops a packet back" (At the IP layer) before it gets to my "MAC
layer" then I can't test any code.

-- Len





On 9/20/07, Lowell Gilbert <[EMAIL PROTECTED]> wrote:
>
> "Len Gross" <[EMAIL PROTECTED]> writes:
>
> > I have a host on my local 192.168.0 / 24 subnet that works fine in
> getting
> > to the Internet via a default route.via a wireless connection.
> > I want to develop some custom link protocols and I have placed two
> Ethernet
> > NICs in the box.
> > I want to be able to send packets from one NIC to the other and maintain
> the
> > link to the Internet.
> > I've tried a large number of things via rc.conf but when I ping of the
> cards
> > it is not going out the interface; it just gets looped back.   (I test
> this
> > by disconnecting the "crossover cable" between the two cards.)
> >
> > My current rc.conf has the following attempt, but this fails.
> >
> > #
> > router_enable="Yes"
> > gateway_enable="Yes"
> > #  Ethernet 1:
> > ifconfig_xl0="inet 192.168.1.1  netmask 255.255.255.0"
> > # Ethernet 2
> > ifconfig_rl0="inet 192.168.2.1  netmask 255.255.255.0"
> > #
> > # Set up loop between the two ethernet cards
> > static_routes "xtor, rtox"
> > route_rtox = "-host 192.168.1.1 192.168.2.1"
> > route_xtor = "-host 192.168.2.1 192.168.1.1"
> >
> > Can I do what I want or must I have a second development box?
>
> What you want to do doesn't make sense; there is no reason to send
> packets to yourself over a wire.  If your machine is sending packets
> to itself, the best path is over the loopback, and it doesn't make
> sense to send it over a different path.  So you need to examine *why*
> you want to do that before you can figure out the best approach to
> your root problem.
>
> I do protocol development and testing through a number of different
> approaches, but for basic development there's usually no problem with
> letting the packets go over the loopback.  For working on something
> like DHCP, I need separate IP stacks, because that will modify the
> routing tables differently on the server and the client(s).  For that,
> I find virtual machines (qemu, most recently) to be the easiest and
> most flexible environment.  I have also used environments based on
> bpf(4) interfaces when I was working with IP stacks that ran
> separately from the system's kernel.
>
> Good luck.
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Multiple NICs - custom protocol development

2007-09-20 Thread Lowell Gilbert
"Len Gross" <[EMAIL PROTECTED]> writes:

> I have a host on my local 192.168.0 / 24 subnet that works fine in getting
> to the Internet via a default route.via a wireless connection.
> I want to develop some custom link protocols and I have placed two Ethernet
> NICs in the box.
> I want to be able to send packets from one NIC to the other and maintain the
> link to the Internet.
> I've tried a large number of things via rc.conf but when I ping of the cards
> it is not going out the interface; it just gets looped back.   (I test this
> by disconnecting the "crossover cable" between the two cards.)
>
> My current rc.conf has the following attempt, but this fails.
>
> #
> router_enable="Yes"
> gateway_enable="Yes"
> #  Ethernet 1:
> ifconfig_xl0="inet 192.168.1.1  netmask 255.255.255.0"
> # Ethernet 2
> ifconfig_rl0="inet 192.168.2.1  netmask 255.255.255.0"
> #
> # Set up loop between the two ethernet cards
> static_routes "xtor, rtox"
> route_rtox = "-host 192.168.1.1 192.168.2.1"
> route_xtor = "-host 192.168.2.1 192.168.1.1"
>
> Can I do what I want or must I have a second development box?

What you want to do doesn't make sense; there is no reason to send
packets to yourself over a wire.  If your machine is sending packets
to itself, the best path is over the loopback, and it doesn't make
sense to send it over a different path.  So you need to examine *why*
you want to do that before you can figure out the best approach to
your root problem.

I do protocol development and testing through a number of different
approaches, but for basic development there's usually no problem with
letting the packets go over the loopback.  For working on something
like DHCP, I need separate IP stacks, because that will modify the
routing tables differently on the server and the client(s).  For that,
I find virtual machines (qemu, most recently) to be the easiest and
most flexible environment.  I have also used environments based on
bpf(4) interfaces when I was working with IP stacks that ran
separately from the system's kernel.

Good luck.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Multiple NICs - custom protocol development

2007-09-16 Thread Len Gross
I have a host on my local 192.168.0 / 24 subnet that works fine in getting
to the Internet via a default route.via a wireless connection.
I want to develop some custom link protocols and I have placed two Ethernet
NICs in the box.
I want to be able to send packets from one NIC to the other and maintain the
link to the Internet.
I've tried a large number of things via rc.conf but when I ping of the cards
it is not going out the interface; it just gets looped back.   (I test this
by disconnecting the "crossover cable" between the two cards.)

My current rc.conf has the following attempt, but this fails.

#
router_enable="Yes"
gateway_enable="Yes"
#  Ethernet 1:
ifconfig_xl0="inet 192.168.1.1  netmask 255.255.255.0"
# Ethernet 2
ifconfig_rl0="inet 192.168.2.1  netmask 255.255.255.0"
#
# Set up loop between the two ethernet cards
static_routes "xtor, rtox"
route_rtox = "-host 192.168.1.1 192.168.2.1"
route_xtor = "-host 192.168.2.1 192.168.1.1"

Can I do what I want or must I have a second development box?

-- Len
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"