# Setting up a home network.

## alienjon

Two friends of mine and I will be moving into an apartment soon.  We've already setup for cable internet service to be installed and I was hoping for some suggestions in regards to setting it up.  The apartment is 2 stories (bedrooms, where the computers will reside) are upstairs and the tv with game consoles will be downstairs (where the cable line will be coming in).

We're planning on having a wireless router setup, and this leads me to my first question.  Will I likely get better reception putting the router downstairs (meaning that the signal moves better upwards) or upstairs (the signal moves better downwards).

I imagine my second question is a bit more intricate.  Now, while cable is probably the fastest deal around, we'd like to be fair and make sure that none of the three of us use more than our share of the bandwidth.  I imagine there is a way to filter the bandwidth so that only up to a certain amount can be used by any given ip address(s).  (My current idea is that we'd have a router that would split the signal to all three of us, and we could each have our own devices to split for any individual devices from there)  How would I go about doing this?  I imagine that this is something that has to be built into the router?  If so, what recommendations to people have for the hardware I should go with for this?

----------

## jstead1

Radio waves pretty much move up or down equally well, so put the router in a central location, somewhere where it will be easy to run a wire to the cable modem.

As far as limiting bandwidth, I don't know of any cheap wireless routers that will do what you are looking for.  You would need to build your own wireless access box.  Unless you are interested in becoming a network administrator and are doing this for practice, I really wouldn't recommend it.

I don't think it is worth it, because if you can't share the bandwidth, you won't be living together for long, because you will be unable to share anything else.

Probably the most important thing would be to make sure the router (the cheap one, not a home built wireless access point) is setup so that services that require, or work better with port triggering (such as bittorrent) have enough ports triggered so if you all wanted to download some bittorrent files at the same time, that there would be enough ports for all of you.  But you would have to figure out what services you are all going to use and set up the router accordingly.

----------

## Hu

Bandwidth shaping can be a useful tool even if all the users are willing to share.  No matter how considerate a given user may be, if one of his applications starts hogging the bandwidth, everyone will suffer until he notices and turns it off.  Bandwidth shaping can help curb that behavior.  A practical example would be to use it to prevent his system software update from disrupting time sensitive WoW traffic.

alienjon: you can probably do most or all of what you want with a Linux system using some combination of Netfilter packet marking and tc for traffic shaping.  This requires putting a Linux system between all the other computers and the Internet uplink, so that it can shape the traffic before it goes into your limited upload queue.  If you are willing to do that, I suggest arranging the bandwidth classes to guarantee 10%-20% bandwidth to each housemate, with ceilings set so that any unused bandwidth goes to whoever needs it.  You can augment this with a second, higher priority, class to expedite time sensitive traffic like ssh or WoW.  If you have P2P users in the network, you may want to give them a third class, which gets bandwidth only if nothing else needs it.  This would allow an ordering where ssh > HTTP > P2P.

----------

## alienjon

Thanks for the suggestions so far!

 *jstead1 wrote:*   

> I don't think it is worth it, because if you can't share the bandwidth, you won't be living together for long, because you will be unable to share anything else. 

 

We actually lived together in college, so I happen to know for a fact that 48 hours after having moved in, we'll be beating the everloving *$%@ out of each other   :Razz:   But seriously, this is more of an idea than something I 'have to to'.  I feel that in any environment, someone may be taking advantage of a situation and may not be aware of it, this just happens to be one that may come up.  (It was actually a concern out of one of my other roommates, but I was interested enough to want to follow up)

 *Hu wrote:*   

>  Linux system using some combination of Netfilter packet marking and tc for traffic shaping

 

I know a friend of mine who has done much more networking than I does this kind of stuff, and I'll bet this is how he does it.  Are 'netfilter packet marking' and 'tc' programs or techniques?  (I'd guess that the former is a technique and the latter a program?)

My only problem with this would be having that Linux system in the middle.  It sounds like this is mainly used in servers or large/controlled networks?  If so, then the layout of our apartment may not be suitable for this kind of setup (although I still plan on reading up on it a bit   :Cool:  )

----------

## xtz

U can buy an old machine, like IBM ThinkCentre (slim case, P4 @ 3 GHz, 512 MB DDR @ 400 MHz) for almost no money, install Gentoo (or other distro) and after configuring it, all it needs is a power cable (and the network cables, of course  :Wink: ). Then - http://lartc.org/howto/lartc.qdisc.html.

----------

## n8wunsch

You might want to look at a traffic (packet) shaping howto like: http://gentoo-wiki.com/HOWTO_Packet_Shaping. This will not give you something that user a can use only 33% of available bandwith, but it helps keeping WoW and shell sessions responsive when p2p clients are at work. Unfortunately you will need a Linux box doing this, routers that are capable of shaping are >300 bucks easy.

edit: Uh, I just saw, there is also bandwith shaping discussed in the Packet shaping howto, enjoy  :Smile: 

----------

## jstead1

Wouldn't the linux system in the middle have to be the wireless access point?

Otherwise, if it is after the wireless router, how does it know who the traffic belongs to, since the wireless router would be doing NAT?

You couldn't have it before the wireless router, otherwise, how does the traffic get to the box, unless of course everything is wired.

----------

## Hu

For best results, the Linux system should be the last computer you own on the path between your systems and the Internet.  Disable NAT on the wireless router and let Linux do it instead.

Netfilter is the general term for the kernel functionality controlled via iptables, ip6tables, and so on.  One of the features it provides is the ability to mark packets based on iptables rules.  Once marked, the traffic shaping code can use those marks as a decision point instead of examining the actual properties of the packet.  This allows you to use the full power of Netfilter to classify which packets get expedited transmission, which ones are bulk, and so on.  tc is part of sys-apps/iproute2 and is the typical way of configuring the kernel's traffic shaping rules.

----------

