Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Communicating across VLAN Interfaces: (7 Items)
   
Communicating across VLAN Interfaces  
Hi,

I am having problem with communicating through VLAN interfaces. Here's the behavior.

I have one physical interface with no IP address assigned to it and I create 3 VLAN interfaces with id's 512,768 and 
1024. Then I assign IP address to vlan interface with vlanid 1024. I do this setup on two system connected within the 
same network. Then, I try pinging from one node to the other via the VLAN interface. The ping doesnt succeed. I ran 
tcpdump on the two nodes and I see that the arp message arrives on the other node but io-pkt does not respond to the ARP
 message.

But, if setup an IP address on the physical (parent) interface and then perform the same set of actions, the ping works!
!

Is this a known problem? I am using revision 400 of trunk.

Thanks,
Santosh
RE: Communicating across VLAN Interfaces  
I think the minimum requirement is that the parent is IFF_UP
which also happens when you assign it an addr:

# ifconfig <parent> up

-seanb

-----Original Message-----
From: Santosh Kumar [mailto:community-noreply@qnx.com]
Sent: Wed 8/20/2008 10:53 PM
To: technology-networking
Subject: Communicating across VLAN Interfaces
 
Hi,

I am having problem with communicating through VLAN interfaces. Here's the behavior.

I have one physical interface with no IP address assigned to it and I create 3 VLAN interfaces with id's 512,768 and 
1024. Then I assign IP address to vlan interface with vlanid 1024. I do this setup on two system connected within the 
same network. Then, I try pinging from one node to the other via the VLAN interface. The ping doesnt succeed. I ran 
tcpdump on the two nodes and I see that the arp message arrives on the other node but io-pkt does not respond to the ARP
 message.

But, if setup an IP address on the physical (parent) interface and then perform the same set of actions, the ping works!
!

Is this a known problem? I am using revision 400 of trunk.

Thanks,
Santosh

_______________________________________________
Technology
http://community.qnx.com/sf/go/post12157


Attachment: Text winmail.dat 3.01 KB
Re: RE: Communicating across VLAN Interfaces  
Hi Sean,

I tried doing a ifconfig up and then set vlan. Same result. Actually without IFF_UP we cant even send packets out of the
 interface.

-Santosh
> 
> I think the minimum requirement is that the parent is IFF_UP
> which also happens when you assign it an addr:
> 
> # ifconfig <parent> up
> 
> -seanb
> 
> -----Original Message-----
> From: Santosh Kumar [mailto:community-noreply@qnx.com]
> Sent: Wed 8/20/2008 10:53 PM
> To: technology-networking
> Subject: Communicating across VLAN Interfaces
>  
> Hi,
> 
> I am having problem with communicating through VLAN interfaces. Here's the 
> behavior.
> 
> I have one physical interface with no IP address assigned to it and I create 3
>  VLAN interfaces with id's 512,768 and 1024. Then I assign IP address to vlan 
> interface with vlanid 1024. I do this setup on two system connected within the
>  same network. Then, I try pinging from one node to the other via the VLAN 
> interface. The ping doesnt succeed. I ran tcpdump on the two nodes and I see 
> that the arp message arrives on the other node but io-pkt does not respond to 
> the ARP message.
> 
> But, if setup an IP address on the physical (parent) interface and then 
> perform the same set of actions, the ping works!!
> 
> Is this a known problem? I am using revision 400 of trunk.
> 
> Thanks,
> Santosh
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post12157
> 
> 


RE: RE: Communicating across VLAN Interfaces  
Hi Santosh:

What commands do you use to create and set up the vlan interfaces?

What does ifconfig report before and after you assign the parent IP
address that makes things work?


	Robert.

-----Original Message-----
From: Santosh Kumar [mailto:community-noreply@qnx.com] 
Sent: Wednesday, August 20, 2008 11:24 PM
To: technology-networking
Subject: Re: RE: Communicating across VLAN Interfaces

Hi Sean,

I tried doing a ifconfig up and then set vlan. Same result. Actually
without IFF_UP we cant even send packets out of the interface.

-Santosh
> 
> I think the minimum requirement is that the parent is IFF_UP
> which also happens when you assign it an addr:
> 
> # ifconfig <parent> up
> 
> -seanb
> 
> -----Original Message-----
> From: Santosh Kumar [mailto:community-noreply@qnx.com]
> Sent: Wed 8/20/2008 10:53 PM
> To: technology-networking
> Subject: Communicating across VLAN Interfaces
>  
> Hi,
> 
> I am having problem with communicating through VLAN interfaces. Here's
the 
> behavior.
> 
> I have one physical interface with no IP address assigned to it and I
create 3
>  VLAN interfaces with id's 512,768 and 1024. Then I assign IP address
to vlan 
> interface with vlanid 1024. I do this setup on two system connected
within the
>  same network. Then, I try pinging from one node to the other via the
VLAN 
> interface. The ping doesnt succeed. I ran tcpdump on the two nodes and
I see 
> that the arp message arrives on the other node but io-pkt does not
respond to 
> the ARP message.
> 
> But, if setup an IP address on the physical (parent) interface and
then 
> perform the same set of actions, the ping works!!
> 
> Is this a known problem? I am using revision 400 of trunk.
> 
> Thanks,
> Santosh
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post12157
> 
> 




_______________________________________________
Technology
http://community.qnx.com/sf/go/post12159
Re: RE: RE: Communicating across VLAN Interfaces  
I program it. Here's the code:

status_t
ether_add_vlan( const char *parentif, const char *vlanname, uint16_t vlan_id)
{
    struct vlanreq vlan_data;
	struct ifreq ifr;
	status_t ret;
	
	if ( _eth_fd < 0 ) {
        if ( ( _eth_fd = socket( AF_INET, SOCK_DGRAM, 0 ) ) < 0 ) {
            return ( errno );
        }
    }
    
   	if (!parentif || !vlanname || (strlen(parentif) > IFNAMSIZ) || (strlen(vlanname) >IFNAMSIZ))
   		return(TN_SYS_ERROR_INVALID_ARG);   	
   		
    memset(&ifr,0,sizeof(struct ifreq));
    strcpy(ifr.ifr_name, vlanname);
	ret=ioctl(_eth_fd, SIOCIFCREATE, &ifr);
	if (ret!=SUCCESS) {
		if (errno!=EEXIST)
			return(errno);
		else
			return(SUCCESS);	
	}
	
    memset( &vlan_data, 0, sizeof( struct vlanreq ) );
    strcpy(ifr.ifr_name,vlanname);
    ifr.ifr_ifru.ifru_addr.sa_family=AF_INET;        
    ifr.ifr_ifru.ifru_data=(object_t)&vlan_data;
    
    ret=ioctl_socket(_eth_fd, SIOCGETVLAN, &ifr);
	if (ret!=SUCCESS)
		return(errno);
		         	
    vlan_data.vlr_tag = vlan_id;
	ret=ioctl_socket( _eth_fd, SIOCSETVLAN, &ifr );
	if (ret!=SUCCESS)
		return(errno);
		
	memset( &vlan_data, 0, sizeof( struct vlanreq ) );
	ifr.ifr_ifru.ifru_data=(object_t)&vlan_data;
	ret=ioctl_socket(_eth_fd, SIOCGETVLAN, &ifr);
	if (ret!=SUCCESS)
		return(errno);
		
	strcpy(vlan_data.vlr_parent,parentif);
	vlan_data.vlr_tag = vlan_id;
	
    return(ioctl_socket( _eth_fd, SIOCSETVLAN, &ifr ));
}

status_t
ether_del_vlan( const char *vlanname)
{
    struct vlanreq vlan_data;
	struct ifreq ifr;
	status_t ret;
	
	if ( _eth_fd < 0 ) {
        if ( ( _eth_fd = socket( AF_INET, SOCK_DGRAM, 0 ) ) < 0 ) {
            return ( errno );
        }
    }
    
   	if (!vlanname || (strlen(vlanname) > IFNAMSIZ))
   		return(TN_SYS_ERROR_INVALID_ARG);
   		
    memset(&ifr,0,sizeof(struct ifreq));
    memset( &vlan_data, 0, sizeof( struct vlanreq ) );
    strcpy(ifr.ifr_name,vlanname);
    ifr.ifr_ifru.ifru_addr.sa_family=AF_INET;    
    ifr.ifr_ifru.ifru_data=(object_t)&vlan_data;
    
    ret=ioctl_socket( _eth_fd, SIOCGETVLAN, &ifr );
    if (ret!=SUCCESS)
    	return(errno);
    	
    printf("vlan_parent=%s,vlanid=%d\n",vlan_data.vlr_parent,vlan_data.vlr_tag);
    memset( &vlan_data, 0, sizeof( struct vlanreq ) );
    ifr.ifr_ifru.ifru_data=(object_t)&vlan_data;
    vlan_data.vlr_parent[0]='\0';	
    vlan_data.vlr_tag = 0;

    ret=ioctl_socket( _eth_fd, SIOCSETVLAN, &ifr );
    if (ret!=SUCCESS)
    	return(ret);    
    ifr.ifr_ifru.ifru_data=NULL;
    
    return(ioctl(_eth_fd, SIOCIFDESTROY, &ifr));	
}

After the code runs, the out put of ifconfig contains (I create multiple):

# ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192
        inet 127.0.0.1 netmask 0xff000000
en0: flags=8043<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
        address: 00:1f:aa:ff:ff:d0
        inet 10.7.0.40 netmask 0xffffff00 broadcast 10.7.0.255
en1: flags=8043<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
        address: 00:1f:aa:ff:ff:d1
        inet 10.7.0.41 netmask 0xffffff00 broadcast 10.7.0.255
en2: flags=8002<BROADCAST,MULTICAST> mtu 1500
        address: 00:1f:aa:ff:ff:d2
en3: flags=802<BROADCAST,SIMPLEX> mtu 1500
        address: 00:1f:aa:ff:ff:d3
en4: flags=802<BROADCAST,SIMPLEX> mtu 1500
        address: 00:1f:aa:ff:ff:d4
en5: flags=802<BROADCAST,SIMPLEX> mtu 1500
        address: 00:1f:aa:ff:ff:d5
en6: flags=802<BROADCAST,SIMPLEX> mtu 1500
        address: 00:1f:aa:ff:ff:d6
en7: flags=802<BROADCAST,SIMPLEX> mtu 1500
        address: 00:1f:aa:ff:ff:d7
en8: flags=802<BROADCAST,SIMPLEX> mtu 1500
        address: 00:1f:aa:ff:ff:d8
en9: flags=802<BROADCAST,SIMPLEX> mtu 1500
        address: 00:1f:aa:ff:ff:d9
en10: flags=802<BROADCAST,SIMPLEX> mtu 1500
        address: 00:1f:aa:ff:ff:da
en11: flags=802<BROADCAST,SIMPLEX>...
View Full Message
Re: RE: Communicating across VLAN Interfaces  
On Wed, Aug 20, 2008 at 11:23:55PM -0400, Santosh Kumar wrote:
> Hi Sean,
> 
> I tried doing a ifconfig up and then set vlan. Same result. Actually without IFF_UP we cant even send packets out of 
the interface.

I did a quick test here and it worked.  Does 'ping -n ...'
behave any differently?

-seanb


lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
wm0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        capabilities rx=7<IP4CSUM,TCP4CSUM,UDP4CSUM>
        capabilities tx=3f<IP4CSUM,TCP4CSUM,UDP4CSUM,TCP6CSUM,UDP6CSUM,TSO4>
        enabled=0
        address: 00:0e:0c:34:36:88
        media: Ethernet autoselect (100baseTX)
        status: active
vlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        vlan: 1234 parent: wm0
        address: 00:0e:0c:34:36:88
        inet 11.0.0.2 netmask 0xff000000 broadcast 11.255.255.255
        inet6 fe80::20e:cff:fe34:3688%vlan0 prefixlen 64 scopeid 0x3
seanb2:/home/seanb >ping -c1 11.1
PING 11.1 (11.0.0.1): 56 data bytes
64 bytes from 11.0.0.1: icmp_seq=0 ttl=255 time=0 ms

----11.1 PING Statistics----
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0/0/0 ms   variance = 0 ms^2
Re: RE: Communicating across VLAN Interfaces  
We did a change to one of our drivers (for a broadcom chip 5691) and that seemed to make a difference. Its working now.

Thanks,
Santosh
> On Wed, Aug 20, 2008 at 11:23:55PM -0400, Santosh Kumar wrote:
> > Hi Sean,
> > 
> > I tried doing a ifconfig up and then set vlan. Same result. Actually without
>  IFF_UP we cant even send packets out of the interface.
> 
> I did a quick test here and it worked.  Does 'ping -n ...'
> behave any differently?
> 
> -seanb
> 
> 
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192
>         inet 127.0.0.1 netmask 0xff000000
>         inet6 ::1 prefixlen 128
>         inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
> wm0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         capabilities rx=7<IP4CSUM,TCP4CSUM,UDP4CSUM>
>         capabilities tx=3f<IP4CSUM,TCP4CSUM,UDP4CSUM,TCP6CSUM,UDP6CSUM,TSO4>
>         enabled=0
>         address: 00:0e:0c:34:36:88
>         media: Ethernet autoselect (100baseTX)
>         status: active
> vlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         vlan: 1234 parent: wm0
>         address: 00:0e:0c:34:36:88
>         inet 11.0.0.2 netmask 0xff000000 broadcast 11.255.255.255
>         inet6 fe80::20e:cff:fe34:3688%vlan0 prefixlen 64 scopeid 0x3
> seanb2:/home/seanb >ping -c1 11.1
> PING 11.1 (11.0.0.1): 56 data bytes
> 64 bytes from 11.0.0.1: icmp_seq=0 ttl=255 time=0 ms
> 
> ----11.1 PING Statistics----
> 1 packets transmitted, 1 packets received, 0% packet loss
> round-trip min/avg/max = 0/0/0 ms   variance = 0 ms^2