Thoughts here...
When a router/AP is designed, the major costs are the PCB, the Chipsets, and the rest of the Bills of Material - software, for the most part, isn't much of a cost adder.
Walking things thru - let's say I want to build out a AC1200 class router. N600 for 2.4GHz, and AC1200 for 5GHz. Simple enough these days...
I can do two paths, and much if it depends on maturity of the technology, but also the business case...
Path 1 - I'm a big name, and it's a product that isn't out yet, but silicon is baking, and close to mass production.
I call down the road to Broadcom, Atheros, and Marvell - I tell them I want X/Y/Z - they give me a proposed chipset, gerbers for a reference design, a board support SW package, along with a couple of SDK boards (stretches). This along with a basic bill of materials for the reference design so that the Product guys can start working their numbers...
This is basic router/AP - now if I want to add a DLNA/Airplay/TimeMachine/NAS etc, then I've got to add the appropriate HW/SW needed on top of the Reference HW/SW design (this is where most bugs creep in)
Add that... And because this is new stuff, there's a fair amount of NRE costs that are going to go with it.
Path 2 - mature stuff... even if I'm a Tier One OEM, when we get into the rinse/lather/repeat mode in the business cycle, I still want to get "new" product onto the shelf - so I go to an ODM - these are companies you here about once in a while - Cameo is one, Gemstar is another - Taiwan is full of the white box folks that build things, and they're very good at it. And the margins here on Manf, they're very tight, as expected, because the Tier1 OEM is working to recover the NRE spent on the leading edge product.
There again, we talk about features, and basic costs FOB somewhere, these days for the US is typically either LongBeach or SFO/Oakland.
Really what it comes down to - this process is iterative - from 1st Gen through followups - and it's tightly coupled on the HW and SW.
To roll one's own - it's entirely possible - MicroTik is a good example of this with their routerboard line, and when you get the HW, they have a link/license for the SW, which is open source, and one can tinker at will... there are others...
in the end however, the SOC/WiFi chipset vendors - they want you locked into their platforms on a generational basis - they make the code and toolchains exclusive, and the cost to jump out very high indeed...
Qualcomm has been banging that drum for over 15 years in the mobile space, and that's why everyone else is now having a hard time breaking in - it's not just the basic BOM, it's the tools and dev environment, and that is where the lock in exists.
sfx