Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Build a router from scratch

  1. Aug 22, 2015 #1
    Hi,

    I want to build a router from scratch

    Does anyone have a good guide to help me get started ?

    Thanks,
     
  2. jcsd
  3. Aug 22, 2015 #2

    Averagesupernova

    User Avatar
    Gold Member

    Yes. Go to school for electrical engineering and computer science. I know this sounds like a cocky answer but anyone who would ask that question does not understand the complexities of this endeavor.
     
  4. Aug 22, 2015 #3
    I understand the complexities... I have studied in this specific field , but a long time ago. - finished practical engineering and computer science.
    But, for the past 5 years my main focus was on networking, on a high level... more of how packets are routed through the internet.
    And I work as a router testing engineer.. so I have a basic understanding of their architecture.
    Just need a guide, or a book ... something to start with.
     
  5. Aug 22, 2015 #4

    Averagesupernova

    User Avatar
    Gold Member

    I would assume you need to learn how to program up microprocessors in assembly language. That would be the first step. You should probably dissect routers and similar equipment to learn how they work.
     
  6. Aug 22, 2015 #5

    sophiecentaur

    User Avatar
    Science Advisor
    Gold Member

    Then I guess you will have seen the level of complexity of the PCBs that are used in commercial routers. Do you have access to suitable equipment to manufacture a circuit yourself?
     
  7. Aug 23, 2015 #6

    meBigGuy

    User Avatar
    Gold Member

    Give me a break. What a bunch of terrible negative advice.

    Why do you all have to be that way. I see it here a lot, and some of the people in this thread are MASTERS at pointing out how something is "too complex" and then provide no help. Acting like Smarty pants know it alls
    If you can't say anything USEFUL or supportive, then don't post. Your advice is useless.

    If you want to point out something is complex, at least link to some information that will support or illustrate your argument. Not one answer showed or shared any understanding of routers or router complexity. It's like I said I wanted to make cookies from scratch and you all start telling me how hard it is to manage a wheat farm.

    So, in response to the original question.

    A great place to start is dd-wrt, ( http://www.dd-wrt.com/wiki/index.php/What_is_DD-WRT? )an open source router that runs on a variety of different hardware. The source code is available.
    By studying that firmware you can also begin to learn what is required from a system hardware standpoint.

    1. Do you really understand router top level functions. Could you make a list of top level features a typical router might support
    2. DO you have a reason for doing this? Are there router features that you think are needed in the marketplace, but are not provided.
    3. Do you really want to build router hardware (that is, design and implement your own fully integrated microprocessor and communications peripherals system)
    4. "Designing from scratch" can mean many things. Why would you design your own ethernet stack when there are stacks available? Or your own TCP stack?
    Do you know what an ethernet stack or TCP stack are?
    5. Since you work at testing routers, do you understand all of the low level functional blocks and interfaces incorporated within the hardware and firmware?

    Hopefully that will give you some idea of the complexity of the task you have chosen for yourself.

    What does a "router testing ENGINEER" do, anyway? WHat, exactly, do you ENGINEER. It seem strange that you can design tests for a router, but would ask that very general, almost bottomless question on a forum.
     
  8. Aug 23, 2015 #7
    Hi, thanks for the informative reply!
    I once made a project of controlling a robot from PC via a transmitter connected to the RS-232 exit, was real fun and interesting to get this thing going just by hitting keys on my keyboard.
    I remember programming it with assembly, and used visual basic to draw its movement on a map - but it was quite long ago.. so I need to refresh my memory on that.

    1. I know router top level functions - this is actually my main focus today.
    2. I want to do this in order to help myself better understand routers, and maybe develop something new.. it just sounds existing to build it form scratch!
    3. Yes.
    4. I suppose I can use some existing libraries, and not do everything from scratch ... so goes for hardware.. I'm not interested in building my chips by myself (using transistors, and logical gates) , I can buy dedicated chips and program them (as long as I remind myself how).
    5. I have the big picture.. and this is one of the things that drives me to build a router.. I want to better understand it on the low level.

    For the past 5 years or so I've been working with router networks, and I learned a lot about all their features and functions - on a high level , main focus was the interaction between routers and switches in the network.

    On my job today , I do high level testing and I design tests for routers... I test high level router functions - such as routing protocols using sniffers and traffic generators.
    I've been exposed to the main building blocks of a generic router, and I want to dive in and get to know how it works on the lowest level - I believe I can do this since I had some experience in programming hardware and have some knowledge in electronics and programming.
     
  9. Aug 23, 2015 #8
    I have found this guide - which I think fits my porpuse -
    http://www.learn-c.com/alltoget.htm

    Is it still relevant? :D (its from y2k)
    Is there anything similar more up to date?
     
  10. Aug 23, 2015 #9

    meBigGuy

    User Avatar
    Gold Member

    I don't know what the best online resource is to learn C (if that is what you were thinking you would get from that link). I would look for an online lecture series, like college courses. You should search this forum's programming section, or possibly post there. For example https://www.physicsforums.com/threads/programming-resources.15689/

    The link you posted is somewhat "relevant", but there is not much content there.

    learning C is one thing
    learning operating system functions is another
    learning driver structures is another
    and it goes on and on

    I'm a hardware designer, so I could go on and on about what you need to know there. But, you need to get some firmware under your belt in order to understand your hardware requirements.

    Take a look at the dd-wrt source code. You will actually learn a lot just trying to download the latest build.

    I think you would have more fun (and it is much more realistic) if you tried to work with and contribute to the dd-wrt community. You might even be able to help them with testing.
    You have a lot to learn, and that will get you inside a real router.
     
  11. Aug 23, 2015 #10
    Thanks a lot for your help!
     
  12. Aug 23, 2015 #11
  13. Aug 23, 2015 #12

    meBigGuy

    User Avatar
    Gold Member

    Not even close. It just tells you a little bit about the top level of a C program and a super simple program. It's hard for me to relate to how you arrived at that statement.

    A basic computer consists of a cpu with an ISA (instruction set architecture), memory system and io system. Each of those are broken down into many sub systems. And "io system" will include mass storage, and all video/audio/communications functions, or anything else the cpu controls, each of which has numerous subsystems.

    https://en.wikipedia.org/wiki/Computer_architecture
    https://en.wikipedia.org/wiki/Computer_hardware
    https://en.wikipedia.org/wiki/Software_architecture
     
  14. Aug 23, 2015 #13

    Averagesupernova

    User Avatar
    Gold Member

    meBigGuy I still stand by my original post. Anyone who asks a question like that with without adding what they already know clearly does not understand the depth of their endeavor. Making cookies from scratch is generally agreed upon that one goes to the supermarket to buy the basic ingredients, etc. I seriously doubt anyone would think a person would start out buying a quarter section of land and raising every single ingredient themselves. From a computer systems perspective I seriously doubt anyone considers that building a desktop computer from scratch would consist of buying the monitor, tower, speakers, mouse, keyboard, cabling, speakers, etc. and just plugging them in. A router is a pretty compact device and building it from scratch I would think cannot have many interpretations. I would think the advice given here is pretty helpful. Having never done any rock climbing or mountain climbing I would appreciate an answer that says "you don't know what you are getting into" if one day I woke up and said I wanted to climb Mt. Everist.
     
  15. Aug 23, 2015 #14
    I know it is extremly complex.
    I didn't say I want it done by tomorrow.
    I have a lot of free time now, so I can put the effort.. I have you. I have google.. I have brain( hope enough).
    It is a challenge... and it will take me years.. I don't mind.
     
  16. Aug 23, 2015 #15

    sophiecentaur

    User Avatar
    Science Advisor
    Gold Member

    Your problem was to use the term "from scratch"in your OP. The answer to that would have to be "you couldn't". If you had asked for something specific then you would have got some interested answers.
    Don't get cross; think before you ask.
    I have a feeling that, by the time you learn 'all' about making one, they could be old technology. These things are done by teams of Engineers, each with their own expertise (and equipment).
    Why not choose a particular aspect and become a bit of an expert on that? You could easily get to know much more than other people in that particular topic.
     
  17. Aug 23, 2015 #16

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    Actually, it's Mount Everest. :wink:

    Building custom computers yourself is a niche thing, especially with hard-core gamers.

    I've actually built a system in the manner you describe: I selected a motherboard, a case, a CPU, some RAM, disk drives, monitor, graphics card, etc., and assembled the whole shebang. And it worked! Still does, after almost 8 years.

    If people (a lot of them) didn't want to build or customize their own computers, but just settled for what came off the shelf, businesses like Newegg.com probably wouldn't exist.

    Still, wanting to build a router from scratch is a little out there. :rolleyes:
     
  18. Aug 23, 2015 #17
    I know it is kind of a wide topic ( to build a router), but I feel I'm missing something.. I don't feel like I did something great just by being an expert in a small field of something huge.
    By the way..

    where is the boundary of a specific field? when does one feel he crossed it?..
     
  19. Aug 23, 2015 #18

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    There aren't usually any bright lines to tell you this. To some extent, accumulated knowledge can be (and is ) used in a variety of different fields.

    Building a router is a little like wanting to build a bridge: if the bridge is small, you can probably pull it off. If you want to build a copy of the Golden Gate Bridge, that's a little more ambitious.

    Most routers sold today are not built up from a bunch of discrete components, like resistors or single transistors, and stuff. The router function is provided by custom-designed integrated circuits and probably some software burned into a ROM. Sure, you could buy a router, take it apart, and re-assemble the components, but that's just mechanics.

    It's not clear what your goal is here, except to say, "I built a router."
     
  20. Aug 23, 2015 #19

    meBigGuy

    User Avatar
    Gold Member

    I think I have given you a map of the landscape and we have all told you how tough the terrain is. I don't think there is anything else we can provide at this point.
    You can delve into computer architecture to understand the hardware you need, and you can delve into one of the best router implementations out there, DD-WRT, to understand the firmware required. (I use DD-WRT).

    The DD-WRT firmware is very router specific, and until you are capable of understanding it, you will accomplish nothing. That in itself is a huge task. The hardware is secondary, and you should limit you study there to what is required to understand the firmware (which won't be trivial)

    Once you can find your way through the dd-wrt source code, you are ready to ask new questions. But, at that point, you will be talking on the dd-wrt forums, not here.

    Good Luck.
     
  21. Aug 23, 2015 #20
    The first thing you need is a good electric motor. It's important the rotor not wobble so it makes an even cut in the wood ...

    An internet router you say? Hmm... o:)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Build a router from scratch
Loading...