Subject: Re: Vrrp Query.

From: "Rajnish Madan" <[email-masked]>
Date: Mon, 11 Dec 2000 10:04:22 +0530

Hi All,

Actually last weekend i tried to create and send a gratituous ARP on my
NetBSD1.4.1,
but in vain. I created the complete Ethernet frame and sent it on the Raw
socket. But it
didn't work.

After this i downloaded libnet API and saw how it works, for IP packets it
uses RAW socket
and for Ethernet frames it uses the link layer device (bpf0 etc). And in the
documentation
it says for sending the Ethernet Frame we need to use the Link layer
Interface rather than RAW
sockets. But i had seen the LINUX implementations in which RAW Sockets are
being used to send the Ethernet Frames.

I understand that for sending the IP packets we have a IP_HDRINCL setsockopt
which suppressess
the creation of the IP header, is there any way i can suppress the creation
of Ethernet header
also using a RAW socket.

Write now i am using the following command to create the RAW socket
sockFd = socket(PF_INET, SOCK_RAW, htons(0x0806));

and in the sendto address i passed my interface name "ex0"

Any help/guidance in this regard will be greatly appreciated.
Thanks in Advance
Rajnish

----- Original Message -----
From: Sumandra Majee <[email-masked]>
To: Rajnish Madan <[email-masked]>
Sent: Thursday, November 23, 2000 3:08 AM
Subject: Re: Vrrp Query.

> At 04:53 PM 11/22/00 +0530, you wrote:
> >Hi Sumandra,
> >
> >I am planning to implement VRRP on NetBSD1.4.1 running on router.
> >I am still in phase of understanding the concept and henceforth lots of
> >doubt coming in back of my mind, may be b'coz of lack of solid networking
> >background. Here are my doubts, pls bear with them even if they are too
> >basic:-)
> >
> >1. I understand that a VRRP deamon need to send gratituous ARP request
for
> >the
> >IP address it owns to all the hosts on the network. How can I send
> >gratituous ARP request?
>
> By opening a raw socket you can make any type of packet. So you will make
> your own ARP packet and send it.
>
>
> >2. How can a ethernet card will be set to promiscuous mode? I may need
this
> >as i am planning to
> >have configuration in which a VRRP router could participate in more than
one
> >virtual routers.
>
> NetBSD must have an IOCTL op which should allow you to put the ethernet
> card in promiscuous mode.  So basically open the
> ethernet device and do an ioctl(fd,....) type call. You should be able to
> find the exact call from manual or by looking at tcpdump code since
> it also set the i/f to promiscuous mode.
>
> >3. How can i make my application to listen for the ARP request and
forward
> >the
> >packets to IP layer.
>
> Again raw socket. But why do you need to listen to ARP req.? You will be
> changing arp table of the host anyway, isn't it?
>
> I think you ought to take a look at the linux vrrpd implementation,  that
> will answer lot of your question.
>
>
>
> >Thanks in advance
> >Rajnish
> >
> >
> >----- Original Message -----
> >From: Sumandra Majee <[email-masked]>
> >To: Rajnish Madan <[email-masked]>
> >Sent: Wednesday, November 22, 2000 2:07 AM
> >Subject: RE: Vrrp Query.
> >
> >
> > > At 10:17 AM 11/21/00 +0000, you wrote:
> > > >Hi,
> > > >
> > > >I have a doubt. If the ethernet address is indeed changed to Virtual
MAC
> > > >address then how the condition in which a router catering to two
virtual
> > > >routers will be handled, as it will have two different Virtual MAC
> > > >addresses
> > > >associated with each of these.
> > >
> > >
> > > I am not sure I understood your question right. VRRP/HSRP are all
layer3
> > > (read IP) protocol. An interface can have more than one IP address,
but
> > > will be bound to same MAC address. So if the interface fails than all
the
> > > associated IP address on that interface fails over.
> > >
> > > If you put the i/f in promiscuous mode, you will have to filter out
> >packets
> > > and your performance of the system is going to go down the toilet.
Unless
> > > you are building a protype experimental box this  will  not stand in
> > > comparison to similar boxes. Also if you think about faults it is more
> > > likely that the i/f itself or the box  itself might go down and that
is
> > > what VRRP is protecting you from.
> > >
> > > Perhaps I can answer your queston if you can tell me the kind of box
you
> > > are working on. From your posting it looks like you are using a UNIX
based
> > > system and putting VRRP on top of it. Depending whether it is a true
UNIX
> > > box or something like BSD running on a router (like Juniper), you can
play
> > > games with your implementation.
> > >
> > > Sumandra
> > >
> > >
> > > >Thanks in Advance
> > > >Rajnish
> > > >
> > > >
> > > >
> > > >----------
> > > >From:   Sumandra Majee[SMTP:[email-masked]]
> > > >Sent:   Tuesday, November 21, 2000 1:31 AM
> > > >To:     Rajnish Madan; [email-masked]'
> > > >Subject:        Re: Vrrp Query.
> > > >
> > > >At 03:42 PM 11/20/00 +0000, Rajnish Madan wrote:
> > > > >Hi All,
> > > > >
> > > > >I have a basic query regarding how the VRRP works.
> > > > >
> > > > >As I understand, the router have its physical MAC address, say X,
> > > > >which a host uses for the communication. The ethernet card will be
> >having
> > > > >this MAC address onto it. All the packets which have this MAC
address
> >are
> > > > >being picked and forwarded by the router.
> > > > >
> > > > >Now consider the case in which the VRRPd starts running on R1 as
master
> > > > >and is backed up by R2.
> > > > >At this moment R1 starts picking up the packets destined for the
> >Virtual
> > > > >MAC Address,
> > > > >say V (by telling to the hosts thru gratituous ARP).
> > > > >
> > > > >Does this mean that the hardware address of the Ethernet card to be
> > > > >changed to V.
> > > >
> > > >In the implementation I know of the ethernet address is indeed
changed to
> > > >the virtual MAC. There are variant of VRRP where the card is
> > > >essentially in promiscuous mode.
> > > >
> > > > >If YES
> > > > >         1. What about the hosts which do not have (for any reason)
the
> > > > > ARP table modified with IP mapping to V.
> > > > >         2. In case a Router is acting as master for two (the
virtual
> > > > > routers), which virtual MAC address the Ethernet card
> > > > >             to be set, as both the virtual router will be having
their
> > > > > seperate Virtual MAC addresses.
> > > > >If NO
> > > > >         1. Do we need to set the Ethernet card in the promiscuous
mode
> >to
> > > > > accept all the packets and filter out depending
> > > > >             on the Virtual MAC address.
> > > > >         2. Only the packets with the destination link MAC address
as
> >the
> > > > > Virtual address need to be picked by the VRRPd
> > > > >             other packets with the physical MAC address or any
other
> >MAC
> > > > > address will be handled the same way as they
> > > > >            were previuosly when no VRRPd was running.
> > > > >
> > > > >Thanks in advance
> > > > >Rajnish
> > >
> > >
>
>