Networking

From LANPartyWiki
Revision as of 12:52, 30 April 2017 by imported>Admin
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

A LAN by definition requires a network. This isn't as complicated as you might think.

Basic Setup

The simplest setup for a small event would be a router connected with a network cable to a network switch, and a network cable from the network switch connected to each attendee's computer or console.

This setup allows:

  • Each computer or console to talk to each other
  • All computers and consoles to connect to the internet

This setup will work absolutely fine for a small or ad-hoc event, but for larger events, read on for more reliable and manageable networks.

Routers

A router typically performs many functions which result in a useable network and internet connection:

  • Automatically assignes IP addresses to devices so they can communicate with the router and each other (DHCP)
  • Resolve domain names to IP addresses, so devices can communicate with internet addresses (DNS)
  • Route traffic to and from the internet (Routing / Gateway)
  • Translate traffic from private LAN addresses to your public internet IP address (NAT)
  • Allow or block network traffic using rules for security (Firewall)
  • Control the speed and priority of traffic to improve performance (Shaping, Limiting, QoS)

Most routers typically perform nearly all of these functions, not just routing, so it's important to understand a "router" does more than just "route"!

ISP Provided Routers

Routers provided by internet service providers (ISPs) usually do a great job at providing internet access at full speed, but what they lack is control and monitoring. They will be completely adequate for small events of fewer than approximately 15 attendees, but more people than this and you will need this extra control and monitoring that enterprise routers provide.

pfSense

pfSense is free, open source router software that can be installed as an operating system on a computer, or bought pre-installed on official pfSense hardware via their partners. Replacing the venue's ISP provided router with a pfSense router will give you a lot more control over your network configuration, and also give you lots of monitoring facilities such as current bandwidth usage, and a list of open connections.

Hardware Requirements

pfSense cannot be installed on a ISP provided router, which typically use ARM processors.

The approximate hardware requirements for a self-install pfSense router:

Item Requirement Notes
Processor 1.5GHz x86 or x86-64 Intel or AMD processors from the last 8 years
Memory 2GB
Storage 4GB Flash memory works well
Network Interfaces Two Interfaces (WAN and LAN) Intel network interfaces have the best performance, but other vendors (e.g. Realtek) will work too, though they offload processing to the processor

Modems

If your venue has an ADSL, VDSL or cable internet connection, you will need to use a modem between the ISP internet socket and the pfSense router. Here are examples for each type of internet connection:

Connection Type Example Modem
VDSL Draytek Vigor 130
ADSL Draytek Vigor 130
Cable (DOCSIS) Netgear CM1000

Configuration

Configuring pfSense is outside of the scope of this wiki, but you can find help in the following places:

Installing 3rd Party Firmware on ISP-Provided Routers

There are a number of projects which allow you to install new routing software on some ISP-provided routers:

Not all routers are supported, it can be a complex process in some cases, and there is a risk that you will "brick" the router in the process.

Switches

Network switches allow all the devices connected to them to communicate with each other. For example, a 16 port switch with one port connected to a router would allow 15 computers or console to communicate with each other, and also access the internet via the router.

Port Speeds

Each port on a network switch will have a maximum speed in megabits per second.

Standard Speed Maximum Transfer Rate Notes
10BASE-T 10 Mbps 1.25 MB/s Old switches or hubs connect at this speed
100BASE-TX 100 Mbps 12.5 MB/s Some cheaper switches only offer ports with this speed
1000BASE-T 1000 Mbps (1Gbps) 125 MB/s Commonly known as "Gigabit". Typically the maximum speed that network interfaces in computers and consoles support

Megabits per second vs Megabytes per second

Megabits per second (Mbps or mbit) are the units used for measuring the bandwidth available for a connection. Megabytes per second (MB/s or MBps) is a measure of how much data can be transferred across the connection per second. Lowercase "b" denotes bits, and uppercase "B" denotes bytes.

To convert from Mbps to MB/s, divide by 8, as there are 8 bits in a byte. This can be useful when you need to know how quickly a file will transfer across a connection.

For example, to calculate how long a 1GB (1 Gigabyte) file will take to transfer across a 100 Mbps (100 Megabits per second) connection:

100 Mbps ÷ 8 = 12.5 MB/s

1000 MB ÷ 12.5 MB/s = 80 seconds

Avoiding Bottlenecks

When choosing a switch to use, at a minimum make sure the port speeds are faster than your venue's internet connection, and if your budget allows, match the maximum port speed of the devices you'll be connecting.

For example, if your venue's internet connection is 60mbps, then a switch with 100Mbps ports will allow each attendee to use the internet at full speed. However, if the venue's internet connection is 300mbps, then you will need a switch with 1Gbps ports (1000Mbps) for each attendee to be able to use the internet at full speed.

If your attendees will either be transferring files between each others computers, or downloading files from your local servers, then a switch with 1Gbps ports is recommended, as it will significantly speed up these transfers.

Using Several Switches

Seveal switches can be connected together if needed, for example to connect more devices, or to connect devices in another room.