802.1q vlan range on E3000 - VIDs beyond 15 possible?

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Author Message
cron2
DD-WRT Novice


Joined: 05 Dec 2010
Posts: 29

PostPosted: Fri Jan 28, 2011 14:48    Post subject: 802.1q vlan range on E3000 - VIDs beyond 15 possible? Reply with quote
Hi,

all documentation that I can find says "there is a maximum of 15 VLANs on broadcom based WRTs". Now what I'm not completely clear about is whether this is "you can configure at maximum 15 different VLANs at the same time" or "the range of 802.1q VLAN IDs that can be used is also limited to 1..15".

Background of my question: I want to setup a Linksys E3000 as AP for 3 different ESSIDs (that's easy), to be bridged to 3 different VLANs on the wired side of things (also easy).

Now the hard part: the 3 VLANs should be handed over on a trunk port (easy) and should use 802.1q VLAN ID 920, 930, 940.

The latter seems to be the hard part - I have read all the documentation and all I can see is "you can have vlan 1...15 and vlan <n> maps to 802.1q tag <n>"... no way to create VID 920, 930, 940.

So now I try to understand whether that's just a software limitation in the GUI or the startup scripts, or whether it's a hardware limitation and just cannot be done with the E3000.

thanks in advance,

gert
Sponsor
fggs
DD-WRT Guru


Joined: 28 Jan 2008
Posts: 1741

PostPosted: Fri Jan 28, 2011 15:28    Post subject: Reply with quote
AFAIK, it's a hardware limitation.
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10143

PostPosted: Fri Jan 28, 2011 20:00    Post subject: Reply with quote
There's some speculation between LOM and I that the hardware may be capable of tagging VID's independent of the VLAN # but the driver currently maps the VID to the VLAN #. Don't hold your breath for this to ever change unless you're a programmer capable and willing to look at the driver code to try to change it. You'll just have to adapt your network to use the low VID's.
_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
cron2
DD-WRT Novice


Joined: 05 Dec 2010
Posts: 29

PostPosted: Tue Feb 01, 2011 20:42    Post subject: Reply with quote
phuzi0n wrote:
There's some speculation between LOM and I that the hardware may be capable of tagging VID's independent of the VLAN # but the driver currently maps the VID to the VLAN #. Don't hold your breath for this to ever change unless you're a programmer capable and willing to look at the driver code to try to change it.


OK - the network admin flatly refuses to cooperate, so we'll have to explore the "programmer" avenue.

I have quite some experience in programming C, but don't really understand how accessing the switch hardware under DD-WRT works (what I could find in the DD-WRT source tree is rc/vlan.c, which seems to do the NVRAM->switch config mapping via binary library switch/swlib/mipsel-uclib/libsw.a).

So - first steps first Smile - is there a datasheet (not just marketing blurb, but hard programming info) for this switch chip available? "dmesg" claims its a

roboswitch: Probing device eth0: found a 53115!

... and what I found on http://www.broadcom.com/products/Switching/Home-and-Small-Business/BCM53115 suggests that it can do all sorts of nice VLAN tricks...

thanks in advance,

gert
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10143

PostPosted: Wed Feb 02, 2011 0:05    Post subject: Reply with quote
cron2 wrote:
So - first steps first Smile - is there a datasheet (not just marketing blurb, but hard programming info) for this switch chip available?

I think the design houses that work directly with Broadcom are probably the only people that get real datasheets.

The switch driver is open source though (unlike their wireless drivers) and that's how LOM and I speculated that it may be possible based on the code. There seems to be a 4 bit value in the REG_VLAN_WRITE register used for configuring the 16 VLAN's, and a 12 bit value in the REG_VLAN_ACCESS register used for indicating the VLAN ID but it uses the same 'vid' variable for both.

Here's a couple copies of the driver, one for k2.4 builds and another for k2.6 builds, and you can also find many other revisions of the driver that have other features (jumbo frames) if you look around in other firmware sources (especially stock firmwares where we all get them 3rd hand).

http://svn.dd-wrt.com:8000/dd-wrt/browser/src/linux/brcm/linux.v24_2/drivers/net/bcm57xx/bcmrobo.c

http://svn.dd-wrt.com:8000/dd-wrt/browser/src/linux/brcm/linux-2.6.23/brcm/shared/bcmrobo.c

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
cron2
DD-WRT Novice


Joined: 05 Dec 2010
Posts: 29

PostPosted: Wed Feb 02, 2011 12:04    Post subject: Reply with quote
phuzi0n wrote:
There seems to be a 4 bit value in the REG_VLAN_WRITE register used for configuring the 16 VLAN's, and a 12 bit value in the REG_VLAN_ACCESS register used for indicating the VLAN ID but it uses the same 'vid' variable for both.


Thanks. The REG_VLAN* stuff you mentioned only seems to be for DEVID5325, while the 53115 (and all other devices) use REG_VTBL_* stuff to program the VIDs.

I'll start experimenting there (e.g. by just changing the vid value from "10" to "100" there, and then tcpdump what comes out of the switch).

Something that's still quite unclear to me is how "vconfig" (in the DD-WRT extended version) and bcmrobo communicate. There's this binary libsw.a again...

Will keep you updated with what I'll find out.

gert
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10143

PostPosted: Wed Feb 02, 2011 20:23    Post subject: Reply with quote
cron2 wrote:
phuzi0n wrote:
There seems to be a 4 bit value in the REG_VLAN_WRITE register used for configuring the 16 VLAN's, and a 12 bit value in the REG_VLAN_ACCESS register used for indicating the VLAN ID but it uses the same 'vid' variable for both.

Thanks. The REG_VLAN* stuff you mentioned only seems to be for DEVID5325, while the 53115 (and all other devices) use REG_VTBL_* stuff to program the VIDs.

Right, it's just that the code for those registers has a 4 bit value that matches 16 total VLAN's and the code implies a 12 bit value (without the product brief/experimentation it might not really be 12 bits) which matches with the 12 bit size of VID's. The product briefs for BCM5395 and BCM53115 indicates they support 4K entries and the code just writes a 16 bit value for the VID to one register so maybe they (and all others) fully support 4096 VLAN's while BCM5325 only supports 16 VLAN's but all 4k VID's.

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
tangsoft
DD-WRT User


Joined: 18 Sep 2010
Posts: 60

PostPosted: Thu Feb 03, 2011 9:41    Post subject: really need ddwrt to support vid over 15!!! Reply with quote
this kind of question confused me for quite a while too. Here the isp converts my adsl connection to FTTH, which combines iptv/voip/internet access. if i want to use my own wrt160nv3, i need to set 3 802.1Q vlans over wan port: vlan 46 /51 /85.
I will keep focus on this thread to see what improvement could happen from ddwrt.thanks.
cron2
DD-WRT Novice


Joined: 05 Dec 2010
Posts: 29

PostPosted: Thu Feb 03, 2011 23:44    Post subject: bricked... Reply with quote
short update: E3000 bricked, I did something wrong when building the kernel and/or the resulting image. Need to build serial cable and unbrick.

Given the somewhat sparse amount of documentation here - could someone tell me how exactly an E3000 image is built if I have the DD-WRT svn tree checked out? Is the config file "configs/broadcom_K26/config_std.v24-K26" suitable? Do I use "Makefile" or "Makefile.brcm26"?

thanks,

gert
buddee
DD-WRT Guru


Joined: 06 Feb 2010
Posts: 7396
Location: Little Rock

PostPosted: Fri Feb 04, 2011 1:18    Post subject: Reply with quote
Erm, just download a binary image for the E3000 and use it with your serial cable for the de-bricking?
_________________
Wireless N Config | Linking Routers | DD-WRT Wiki | DD-WRT Builds | Peacock - Broadcom FAQ

Having problems with port forwarding? Check out Port Forward Troubleshooting for more info.
cron2
DD-WRT Novice


Joined: 05 Dec 2010
Posts: 29

PostPosted: Fri Feb 04, 2011 7:55    Post subject: Reply with quote
buddee wrote:
Erm, just download a binary image for the E3000 and use it with your serial cable for the de-bricking?


Yes, the "with your serial cable" is the interesting bit regarding debricking - need to build one, working on it.

My question above was targetting something else - I'm not sure why it got bricked, and I want to verify that I'm using the right .config and Makefile files to build a working E3000 image from the DD-WRT svn source tree. If my image is borked in the first place, de-bricking will revive the router, but won't help me get closer to the goal "make the VIDs work" (or at least "see what happens with the modified bcmrobo.c")
cron2
DD-WRT Novice


Joined: 05 Dec 2010
Posts: 29

PostPosted: Fri Feb 04, 2011 14:37    Post subject: de-bricked Reply with quote
So, the router has been de-bricked, thanks to the documentation here: http://www.dd-wrt.com/phpBB2/viewtopic.php?t=62998

On to "try again to build a working new firmware image"
cron2
DD-WRT Novice


Joined: 05 Dec 2010
Posts: 29

PostPosted: Fri Feb 04, 2011 18:22    Post subject: all I get is kernel panics... Reply with quote
OK, I just don't get it. I have tried a number of different ways to build a new kernel, and all I get is crashes at boot.

It's always like this:


eth0: Broadcom BCM47XX 10/100/1000 Mbps Ethernet Controller 5.10.56.27
Unhandled kernel unaligned access or invalid instruction[#1]:
Cpu 0
$ 0 : 00000000 11009000 805c8400 00000000
$ 4 : 8112d180 80434330 a1210000 00000001
$ 8 : 00000000 80104030 00000002 804d0000
$12 : 8111d380 ffffffff 00000005 3d6f7030
...
Code: 00000000 00000000 00000000 <00000000> 00000000 00000000 00000000 00000000 00000000
Kernel panic - not syncing: Attempted to kill init!


I'm basically following these instructions: http://www.dd-wrt.com/wiki/index.php/Development and have tried about every variation of GCC versions (in the toolchain bundle, there are 3.3.6, 4.1.1 and 4.1.2 for mipsel, but neither works). I have tried building just the kernel and plugging that into an existing firmware bundle (via extract_firmware/build_firmware), or building a complete image ("make -f Makefile.brcm26 ... package") - but the net result is always the same: it will reach the "eth0: Broadcom BCM47XX" bit, and then crash.

So - what are the magic bits to build a kernel that will successfully boot on E3000?

All the rest is something I can manage to plug together, but after spending some 8 hours on different variations of building a kernel, I'm running out of ideas Sad
cron2
DD-WRT Novice


Joined: 05 Dec 2010
Posts: 29

PostPosted: Sat Feb 05, 2011 13:26    Post subject: Yee-ha! Reply with quote
OK, so here's the good news: 53115 supports vlan IDs at least up to 1024 (didn't test more).

For a quick and dirty hack, I kept the overall structure of bcmrobo.c with the 15 vlans configured from NVRAM, and added a setting "vlan10vid=920", which would map the "vlan 10" to use 802.1q tag 920 on tagged ports. Kernel prints:

bcmrobo: VLAN 10 mapped to VID 920, ports='3 4t 8', vlan10vid='920']

The chip programming changes needed are basically in two places:

- after this comment: /* set port tag - applies to untagged ingress frames */ replace "vid" with the mapped value (for packets coming in on an untagged port)

- after this comment: /* VLAN Table Address Index Reg (Page 0x05, Address 0x61-0x62/0x81-0x82) */ change "val16 = vid" to "val16 = mapped_value" before poking to

robo->ops->write_reg(robo, PAGE_VTBL, vtbli, &val16, sizeof(val16));

- I assumed that changing the arl_entry[6] stuff would also be necessary, so I changed it, but it does not seem to have an effect - would be interesting to know what it does.

Of course the linux side of things needs to be changed as well - if you remap "vlan 10" to "vlan 920", you need to have a "vlan920" interface on the Linux side, as "vlan 10" (tag 10) goes nowhere on the switch. Right now, this has to be done manually with vconfig ("vconfig add eth0 920"), as the management scripts won't have any idea that the kernel is changing the tag (non-surprisingly).

I have appended a patch (that is not usable as-is, because it has too much debug info in there still, but gives an idea what I changed).

Now for the extremely bad news: I have not managed, whatever I tried, to build a working DD-WRT kernel for E3000. Always crash. :evil:

Out of desperation, I tried TomatoUSB yesterday evening, and the resulting image worked immediately. So the patch is done vs. Tomato and not vs. DD-WRT - but the code is mostly identical, so the code bits to change are easily identified in DD-WRT bcmrobo.c as well.

(Unfortunately, the rest of our adaptions is based on DD-WRT, so changing to Tomato would be a huge amount of extra work now - so I'm still hoping for some advice how to build a working E3000 kernel/image...)



bcmrobo-c-patch1.txt
 Description:
patch for bcmrobo.c to permit arbitrary 802.1q vlan tags for the 15 predefined VLANs

Download
 Filename:  bcmrobo-c-patch1.txt
 Filesize:  5.03 KB
 Downloaded:  1478 Time(s)

phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10143

PostPosted: Sun Feb 06, 2011 0:58    Post subject: Reply with quote
Nice work!

I think it would be best to just remove the 16 VLAN limit and keep the VID and VLAN numbered the same. That should avoid a lot of trouble rewriting things to make the software aware that the VID and VLAN are numbered differently. I think the only trouble would be how to handle BCM5325 switches since they have a 16 VLAN limit, so they'd either need to be limited to VLAN+VID 0-15 still (super easy to do) or the first 16 vlan#ports variables found in nvram (a little more work). The latter would be best because there's still a lot of BCM5325's even in low/mid-priced N spec routers.

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next Display posts from previous:    Page 1 of 9
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum