View Full Version : Setting up a home network


Benny
05-03-2004, 06:05 PM
Okay, we get a fair few threads about this, so MrP has asked me to write a thread about how to set up a home LAN. So here goes...

Firstly, you need to know about the main components of a network. We're not going to build anything massively complicated here, so I'll try to be as un-technical as I can.

The Hardware
There are several components you'll need to build your LAN. I'll explain what these are, and give some examples as I go...

The Network Interface Card
The NIC is the device which sits between the computer and the network. It can be a PCI card, a PCMCIA card, or even a USB dongle. Either way, its role is simple - to move data from a network to the computer, and vice versa. It really doesn't matter which NIC you use - so long as it is the correct media type for your network, and in this case, that means Ethernet.
Every NIC has something called a MAC address. This is a hexadecimal sequence of six bytes that is unique to every card. The first three bytes identify the manufacturer of the card, the last three represent the card's individual ID.
Suggested product: 3Com 3C509CX-TX-M - 10/100 PCI NIC
http://www.3com.com/products/prodimage/image/prd_lg_3c905cxtxmv.jpg

The Cable
Obviously, for wireless, this isn't relevant. There are two types of LAN cable that you will commonly come across - both are category 5 cables, and are terminated using the RJ45 interface. In some cases, you may see a thin, flexible white cable - this is known as Thinwire Ethernet (or 10Base2), but we won't cover that here.
One type of cable is called a "straight-through cable", or a "patch lead". This is a simple cable, and what you put onto one pin appears on the same pin at the othe end. The other type is called a "Crossover" cable. This has the receiver pins at one end wired to the transmitter pins at the other. They can be used to connect two PCs without a hub or switch, but are commonly used for joining different infrastructure devices together.
Suggested product: Any Cat5 UTP cable with RJ45 plugs!
http://www.videkonline.co.uk/pictures/cthumbs/2961GP.jpg

The Medium
In a typical home network, the medium - or infrastructure - is either a hub or a switch. A hub is a dumb device, that operates at a very low level - it sees data come in on one port, and it "repeats" this data to all the other ports it has. Simple, cheap and effective.
The next level up is called a switch. A switch is known as a layer two device, and has some intelligence built into it. A switch learns which devices are connected to which ports, and stores this information in something called a MAC address table. When a frame appears (a frame is a Protocol Data Unit that exists at layer two - it has no concept of IP addressing, and simply uses the MAC address to point at a destination). The switch reads the "address" field of any frame it sees, then looks up which port the destination MAC address exists on. IT then only forwards the frame to that one port.
This might sound complex, but in reality, it helps deliver a substantial performance increase over a hub. In addition to this, a switch also allows full duplex operation, whereas a hub only offers half-duplex. Think of duplex like this: two people talking are holding a half duplex conversation. One speaks, one listens...and then they swap. Two people typing in a chat application can both type and read simultaneously - this is known as full duplex conversation.
Suggested product: Netgear FS106 / FS108
http://www.netgear.co.uk/images/fs108.jpg

The Software
In order for the PC to make this hardware work, it needs the correct software to do so.

The Driver
The OS is unable to talk to the NIC unless it has been provided with a driver to let it do so. The driver also contains some configuration info to allow the OS to use some of the more advanced features of the hardware.
Suggested product: The latest available drivers for your OS from the NIC manufacturer

The Protocol
The OS cannot just talk randomly to a network. It needs a predefined method of communicating with other devices, and this is known as a Protocol. The most common protocol you will see is called IPv4, or TCP/IP. This operates at later three of th OSI model, and gives each device a unique address, based upon four "octets", seperated with dots. An octet is eight bits, and eight bits can generate any number from 0 to 255. A PDU at layer three is called a packet, and a packet is used to encapsulate a layer two PDU called a Frame, as discussed earlier.
Suggested Product: TCP/IP stack as installed by any modern, LAN aware OS.


How to set it all up
Crunch time...how on earth do you make this lot work?

Well, firstly, you need to make sure that you have some computers. These computers should have an OS installed onto them, they should have the NIC inserted into them, and the OS should be configured with the driver software, and an IP stack loaded.

Then, plug in and turn on the switch. Connect the switch to the PCs, using the Cat5 cable, and configure the IP stack with an IP address, subnet mask, and a Default Gateway.

For a simple LAN, you won't need to worry too much about the Default Gateway. This is only used when you are building an Internetwork and have an IP router present. For a simple, home LAN, you only need to assign an IP address to each PC.

There is an RFC which bears the number RFC1918, which has a special class C IP network reserved for "private" networks. Internet routers are configured to drop packets which refer to this IP address range, and it is explicitly reserved for LANs. This IP address space is 192.168.0.0/16. This means that any IP address starting with 192.168 is "known" to be an RFC1918 address. Typically, the normal home LAN doesn't need a huge amount of physical devices attachec to it (hosts), so people just use a standard, 254 host subnet.

Now....all the devices on your home network MUST exist in the same IP subnet. This is NOT an IP tutorial, so if you need more info, you'll need to search elsewhere.

If you're using STATIC IP addresses, configure each PC with an IP address in the 192.168.1.x range, and assign a subnet mask of 255.255.255.0. You can use 192.168.5.x...192.168.40.x or whatever you like - just as long as the first three octets are the same for every device.

In theory, this should then be enough to enable your machines to talk to each other. You will need to export a file system in order for them to share data though, and also set up other properties of the machine, such as its hostname.

Getting more complex
The process described above is all well and good for a simple, small, home LAN. However, most people need access to the Internet as well, so we need to introduce the concept of a router, and the enhanced services that these devices can offer, such as firewalls, DNS servers and DHCP.

A router is a device which has two "legs", each one sitting in a different IP network. In the case of a broadband router, one leg sits in your home LAN, the other leg sits on the Internet. What the router will do is simple in concept - it examines every packet (remember - packets at layer three, frames at layer two) that it sees on your LAN. If the IP address is destined for another host in the same network (i.e. from one PC to another in your house), then it "drops" the packet and doesn't bother with it. If the router sees that the packet is destined for an address that isn't in your house, then it will forward the packet onto its second interface, which sits on the Internet. This packet will then go on its merry way, and eventually (hopefully!) get to its host.
A router has more than one IP address, as it has more than one routing interface (note: a switch / hub aren't layer three aware, so they don't have an IP address per port).
A router is an immensely powerful device, and can do a LOT more, but that's all we need to go into for now.

However, a commercially available "broadband router" often has four basic functions. Obviously, it contains a router, or no packets would be able to leave your LAN. It may also have a small switch built into it (often four ports), or maybe just a single interface. This is a "smart" interface though, and will require an IP address, and will then connect to your LAN via a piece of Cat5.

These devices often have a DNS and DHCP server too - the DNS allows you to resolve Internet domain names to IP addresses, and the DHCP server can dish out IP addressed automatically. ou'll need to set the IP pool for your home LAN though - if you set up a LAN with the IP network of 192.168.1.x, then you'd need to configure the DHCP server with a "pool" of addresses in that range that it can give to other machines. Refer to the manual for more info about this.

They also often include what the marketers like to call a SIP Firewall. SIP stands for Stateful Inspection (of) Packets. Basically, its a semi-smart device which examines where IP packets are coming from and going to, and looks for suspicious behaviour, then stops it accordingly.

So, if you wish to connect to the Internet from your home LAN, how do you do it?

Simple really - connect the router to your LAN via the RJ45 interface. Then use a web browser to "jump onto" the device. Set it up with an IP address (I personally use the address .254 in any subnet, but you can use what you like). Then connect it to your broadband line (making sure you buy the correct device - an ADSL router won't work with a Cable broadband line!), and enter the username and password that your ISP gave you. Your router should then "dial up" and establish a connection to the Internet.

You then configure the PCs on the LAN to use automatic IP configuration via DHCP. This means that whenever they power up, they contact the DHCP server and grab all the necessary info to work correctly. If you have a server, you will want to leave this as a static IP address. Again, I like to keep all my static IP addresses in the low part of the subnet, so from .1 onwards. You would configure the DHCP pool to run from 192.168.1.50 to maybe 192.168.1.100, making sure you specify a 255.255.255.0 (24 bit) mask.

And in an ideal world, that's about all there is to it! I like Netgear's range of routers, and I would recommend that people buy either the DG834 if you just want a "wired" LAN, or the DG834G if you want wireless as well.
http://www.netgear.co.uk/images/dg834.jpg
http://www.netgear.co.uk/images/dg834g.jpg

A Word About Wireless
Wireless is the "latest thing". Its a useful way of working without wires (funny, that!). What you should know is that Wireless (using the 802.11b, 802.11a or 802.11g protocols) is NOT a replacement for the wired LAN, but an extension thereof. Its also important that you only connect wireless devices to a switch, and not a hub, as the wireless access points act as repeaters - so every packet they see on the wired LAN interface, they repeat onto the radio interface. Not good, as a mildly loaded, hub-based 100Mbit LAN will completely flood an 11Mbit/sec 802.11b wireless LAN. A switch will keep all unwanted traffic off of the wireless segment, and will preserve performance. Ideally though, if you want wireless, you should buy an "all in one" router / modem device, like the one described above.

Wireless is also insecure - you should be mindful that all your traffic and files could potentially be accessible to anyone who wants to have a snoop around. As a result, you should always use 128-bit WEP keys, and change them every week. There are stronger mechanisms available, however these are more often than not too expensive for the home user. Make sure you have good passwords, secure servers, and up-to-date antivirus and software firewalls in place on ALL machines.

Hopefully that should be all that you need to set up your own home Internetwork - if you have more questions that aren't covered in this thread, then its probably best to ask in a seperate thread. This is by no means a complete guide, and there is a fair bit I have not covered. Hopefully though, this should answer some questions without having to post them.

Good luck - and feel free to post questions if you have them. PM me if you need to, but please ask questions on the forum first.

Benny.

Benny
05-03-2004, 06:19 PM
I think that's what he had in mind for it.

B

deano vw
05-03-2004, 06:21 PM
awesome reading, especially for the network n00bs like myself :)

Big-Mac-Please
05-03-2004, 06:33 PM
I knew the wireless was a bit "open" but I didn't realise theres a need to change the encryption that often.

Wount the 128bit be fine left on its own?

Good work though :)

Benny
05-03-2004, 07:05 PM
On a loaded AP, it is possible to recover 128-bit wep keys in as little as four hours.

On the WLAN I designed at work, the WEP keys permute every 15 minutes.

B

alsl79
05-03-2004, 07:06 PM
I know the 64 bit web repeats the key every 20 hours or round abouts, but surely the 128 wep is an exponential increase so should I really be changing the keys very week?

Benny
05-03-2004, 07:10 PM
The recovery can be made from a fundamental problem with the implementation of the RC4 stream cipher, due to known weak IVs.

You can use per-packet keying, or the new Temporal Key Integrity Protocol if you wish, but I would always consider WEP to be weak, and rely on either VPN tunnels, or 802.1x authentication.

I'm off to the pub now, but I'll dig out a document that shows exactly how its done over the weekend, if you like.

EDIT: Look here: CLICK (http://lists.samba.org/archive/wireless/2001-September/000275.html)

RC4 itself is strong, the implementation of RC4 in WEP is not.

B

Harry Bo
05-03-2004, 07:16 PM
Sorry Benny, I can't really sticky it, there are too many in here already :)

However, if no one objects, I could bang it in the FAQ...?

HB

Benny
05-03-2004, 07:23 PM
Do with it what you will. MrP asked that it be a sticky, but if you'd rather it go into the FAQs, then there is only one way to settle this.

You two need to Spandex up at T9 and settle this like men...:D

Moose: Wireless can be made safe and secure. Its still not easily crackable by the casual snooper, but if someone is determined to break into the WLAN, then unless you have some form of proactive defence in place, or you twig what's going on and shut the thing down, then there isn't a whole lot you can do about it.

Apart from exercise caution when you deploy it.

B

Harry Bo
05-03-2004, 07:40 PM
I think I'll sticky it rather than dig out the Spandex for T9 ;)

HB

GDB1973
05-03-2004, 08:15 PM
Nice document, Benny.

in 3 easy steps.

Screw NIC into PC.

Plug one end of cable into PC's new NIC, the other into HUB

Switch it all on.

The PC will detect the NIC and (if it's a major brand) most likely instal drivers itself, install TCP/IP and set up using APIPA which is great for home networks!

MrP
05-03-2004, 10:27 PM
cheers benny, sorry i wasnt around to sticky it earlier :D

Boombox
07-03-2004, 12:37 PM
I have setup quite a few wireless networks, and I firmly believe that they are cr4p.

But people want what they want!! The customer is always right apparently...

GDB1973
07-03-2004, 11:53 PM
They're okay when they're used in the right way, used in the right place & used for the right reasons. But they're no substitute for a wired network!

Nut
27-07-2004, 06:59 PM
no way.. latency is pretty bad

Benny
27-07-2004, 07:17 PM
They are designed to add mobility to a network, not to replace one. They have a function in a LAN arena, but they experience problems when they are deployed in the wrong way, or too much is expected of them.

B