This is an archived course. Information may be out of date, some links are broken and email addresses have been removed.

03 Lesson 3 Advanced Hardware

LESSON 3 - Deeper Down the Rabbit Hole.

In lesson two I made lots of promises "see lesson three for further
details". So now I'd better make good on them!

Lots of illustrations in this one. Dana can draw much better than I can
explain. The full document complete with illustrations is available at
http://linux.invisiblepixels.org/writings/networkcourse/3.advhardware.html

The world of networking is thick with acronyms, abbreviations and strange
expressions. A walk around a weekend computer market will reveal all sorts
of odd cables, cards, boxes with flashing lights and shiny metal objects. An
attempt to discuss every single object you might come across would result in
a document the size of the Doomsday Book, so I just want to cover a specific
category - that of ethernet LAN.

Part one looks at ethernet and a brief history of some ethernet networks.
I'm hoping this section will be of use to anyone who has bits of this old
equipment lying around and is not sure what it does.

Part two looks at "modern" networks and their peripherals and the lesson is
finished off with part three - the bits that didn't belong anywhere else.
For those of you still reading at the end, there's even a homework exercise.
<grin>


##########################
## Part One - Old Stuff ##
##########################

# Ethernet #

It's a word that gets bandied around a fair bit, but what does it actually
mean? Ethernet defines a set of rules and standards governing the physical
properties of the hardware responsible for transmitting data across a LAN.
It works like a freight train, transporting data without actually worrying
about what that data is. For this reason, ethernet is able to transport a
wide variety of networking protocols.

For cables, the ethernet specification includes electrical characteristics,
wire type and maximum length allowed. Guidelines for network cards include
signalling rates, voltages generated, frame size, how to transmit those
frames and what to do when something goes wrong. The hardware presented in
the rest of this lesson is not discussed in this much detail, but if anyone
is curious, just ask.

Rather than being some dusty old document lying untouched in a filing
cabinet, the ethernet specification is under continual evolution as new
technologies emerge. Over the years it's come to define a large array of
configurations, some of which have never seen the light of day commercially.
However several have been enormously popular, to the extent some considered
them the defacto LAN during their heyday. The networking card pictured below
rather neatly illustrates three of them.

<http://linux.invisiblepixels.org/writings/networkcourse/img/oldnic.jpg>

From left to right, the jacks belong to 10Base2, 10Base5 and 10BaseT
networks. Before going any further, I'll explain the naming convention.
Names are given in the form of X Base Y where:

* X is the speed at which the network operates, 10 for 10Mbps (Megabits per
second), 100 for 100Mbps and recently 1000Mbps for gigabit networks.

* Base is short for baseband and is another way of saying "this cable
carries just one type of traffic". Contrast this with broadband (carries
multiple services like internet, TV and voice on the one cable), and you
have a better understanding of what baseband isn't.

* Y defines some characteristic of the physical cable used.

# 10Base5 #

This is the middle connector and is the oldest network of the three. If the
picture isn't terribly clear, its just a DB-15 connector. The associated
cable is a coaxial cable known as Thick Ethernet, or Thicknet. The 10Base
part of the name you know, the 5 is an abbreviation of the ethernet law
stating a segment of Thicknet cannot be longer than 500 meters. The next
diagram shows how the 10Base5 cable is connected to the computer.

<http://linux.invisiblepixels.org/writings/networkcourse/img/auiss.jpg>

The transceiver is attached after holes are drilled in the outer sheath and
sharp spikes are driven through, connecting to the cable inside.
Appropriately enough, this is called "vampire tapping".

10Base5 was commonly used as a backbone linking different segments of a
network together. The thick, unwieldy cable is difficult to work with,
purchasing all the accessories is expensive and the process of tapping the
cable is fiddly. Not to mention the constant smell of garlic! (joke!)

As an aside, the presence of an AUI port doesn't dictate the use of a
10Base5 network. It's possible to purchase transceivers that attach to just
about any sort of cable (not just thicknet). In all cases however, you're
restricted to 10Mbps and 99 times out of 100 it will be thicknet.

# 10Base2 #

This is the connector on the left in the picture. The cable used here is
also a coaxial cable, but it's thinner and more flexible, making it easier
to work with. The transceiver is built onto the network card, eliminating
the need to purchase a separate one. These two advantages give this type of
network the nicknames Thinnet and Cheapernet.

Instead of tapping into one long cable (as with Thicknet), you use multiple
individual cables to link each computer to its two neighbours via a T-piece,
as shown below.

<http://linux.invisiblepixels.org/writings/networkcourse/img/tcon.jpg>

As before, the 2 in 10Base2 is a hint at the maximum length a network
segment is allowed to be. The exact figure is 185 meters, but 10Base185
looks a bit silly, so they rounded it up to 10Base2 instead.

# Bus Topology #

The manner in which computers on a network are connected is referred to as
topology, or architecture. It's coupled very closely to the cable used, as
the cable type dictates the physical limitations of the network along with
any auxiliary equipment required.

<http://linux.invisiblepixels.org/writings/networkcourse/img/bus5.jpg>

This layout goes hand in hand with the coaxial cables of our 10Base2 and
10Base5 networks. The computers on either end of the cable need to be fitted
with a device called a Terminator whose purpose is to absorb network traffic
(which is just electrical signals) once it reaches the ends of the cable.
This prevents those signals from being reflected back down the cable and
interfering with legitimate traffic. The picture below shows a terminated
10Base2 network.

<http://linux.invisiblepixels.org/writings/networkcourse/img/term.jpg>

The major disadvantages of a bus topology are its poor fault tolerance and
difficult troubleshooting. Due to its linear nature, an incorrectly
connected T-piece, missing or faulty terminator or a break at any point
along its length brings the whole network down. While the cause of a downed
network can be tricky to locate, the hardest troubleshooting involves trying
to fix a network whose only symptoms are "sometimes slow and unreliable".
After faulty components, the most common cause of these symptoms is a
network that breaks one or more ethernet rules.

There's much more to bus topology networks than what I've mentioned here.
With the use of the right equipment and a proper understanding of the
ethernet standard, you can create very complicated layouts. Time and
progress take their toll though, and these old coaxial networks are becoming
rarer and rarer. For this reason, I've only just touched on them, but
questions are more than welcome if you're interested in delving deeper.


##########################
## Part Two - New Stuff ##
##########################

I've arbitrarily chosen the division between "old" and "new" networks as the
evolution in topology from bus to star. In this section I'm going to start
off by looking at the star topology and the cable particular to it before
discussing the networks and peripheral equipment that huddle under the star
topology umbrella.

# Star Topology #

<http://linux.invisiblepixels.org/writings/networkcourse/img/stardot2.jpg>

This topology offers several advantages over the older bus style. Computers
are connected independently of each other, meaning any part of the link
(network card, cable or port) can fail without effecting the rest of the
network. While the central hub does present a single point of failure (if
the hub dies the whole network is down) it's a fault that can be diagnosed
within minutes and can be fixed just as quickly if there's a spare hub to
hand.

The cable most commonly associated with this topology is cat5 UTP, but in
theory other members of the UTP family can be used too. One of the principle
differences between the categories is the number of twists per foot the
cable has, with a higher number of twists able to support a higher data
rate. The twists suppress the effects of crosstalk - electromagnetic
interference caused by current travelling along a wire. Cat3 and cat4 can
only be used with 10Mbps networks, whereas Cat5 (and more recently cat5e) is
capable of supporting 10, 100 and 1000Mbps networks, making it the most
commonly installed cable, and because of that, pretty much the only one
available for purchase. The next section takes a look at cat5 Twisted Pair
more closely.

# Twisted Pair #

Rather than being a collection of eight individual wires, cat5 is actually a
group of four pairs. The pairs are colour coded blue, orange, green and
brown. Like all electrical connections, there is a positive and a negative
wire, the positive represented by a white stripe. Each pair has its own
unique function; one (the Tx pair) transmits, the other (the Rx pair)
receives. The remaining two pairs are unused on 10 and 100Mbps networks
leaving Gigabit (1000BaseT) the only one that actually uses all four.

Unless you specifically request otherwise, the cat5 you purchase will be
wired up in what's called a straight through configuration. This simply
means that each pin on one end is wired through to the same pin on the other
end. Have a look at the illustration below, in which the transmit pair is
marked Tx and the receive pair as Rx.

<http://linux.invisiblepixels.org/writings/networkcourse/img/straightthru.p
ng>

It seems no part of computing is free from some sort of religious war. With
ethernet, there is a minor skirmish surrounding the order of the colours.
The diagram above shows the colour sequence specified by EIA/TIA 568B. I
believe this is the most popular scheme, but I can't substantiate that
claim. From our home networking point of view, it doesn't matter a charged
particle if your cables conform to the 568A or 568B standard; as long as
they're straight through, they're fine. Until you start punching down cables
in a patch panel (wow, that would be one awesome home network) you don't
need to start worrying.

People are sometimes tempted to use the idle brown and blue pair for other
purposes, like a telephone or even a second computer; after all, it saves
laying more cable. This is strongly discouraged, as the additional crosstalk
generated by these normally unused wires is a prime candidate for causing
the dodgy and unreliable networks mentioned previously.

# 10BaseT #

Referring back to the photo of the network card, the RJ45 jack on the right
and its accompanying UTP cable should be familiar, so there are no prizes
for guessing the T in 10BaseT stands for Twisted. This gives no clue as to
the maximum length of cable allowed, so you must memorise the figure of 100
meters. The peripheral equipment this type of network uses is covered later
on when we discuss its bigger brother, the 100BaseT network.

The introduction of 10BaseT is widely considered the catalyst that caused
the explosion of ethernet as the network of choice.

# 1000BaseT #

In a slight deviation of order, I'd like to touch upon the 1000Mbps, or
gigabit networks that are the "new kids" on the network block. Again the T
is for Twisted pair, and mandates cat 5 or better. An alternative,
1000BaseX, is run over fibre optic cable. Owing to both incarnations being
new and expensive, this paragraph is the only mention they're getting.

# 100BaseT #

I've got some disappointing news for those who think the T stands for
Twisted. The T here is an abbreviation for all 100Mbps networks, which can
use either fibre-optic (written 100BaseFX) or UTP (100BaseTX) cables. If
using UTP, the same 100m maximum length of cable rule applies. In most
respects 100BaseTX networks look pretty much identical to their BaseT
siblings, using the same cat5 cable and RJ45 jack.

The rest of this lesson is given over to the auxiliary equipment used to
connect any of the star topology networks.

# Duplex #

Raw speed is not the only factor that determines how well a network
performs. A secondary (but no less significant) consideration is the ability
to run in full duplex mode, a concept discussed below.

Both humans and computers can communicate using one of two methods. The
first can be likened to a conversation using a CB radio or walkie-talkie.
With this setup, at any given point in time you can be either talking OR
listening, but never both. In other words, you are unable to talk (transmit)
at the same time as listen (receive). This is half duplex.

The second method is equivalent to a telephone conversation where you can
send and receive at the same time, and is called full-duplex. Humans can't
take advantage of full-duplex because our nature is to respond to what's
being said to us. The closest we get to full-duplex communication is the
Jerry Springer show when the guests just start yelling at each other.

Computers however are quite content to send and receive data simultaneously
and a 100BaseT network operating at full-duplex has roughly double the
throughput of a half-duplex network, because it doesn't need to wait for
outgoing traffic to cease before accepting incoming (and vice versa).

For a network to run in full duplex mode, both the switch and all the
network cards must support full-duplex.

# Hub #

Known technically as a multi-port repeater, this fancy name describes
exactly what a hub does. When a frame arrives on a port, it gets repeated to
all the other ports, ensuring each connected computer receives a copy. The
hub regenerates the signal at the same time, fixing any degradation caused
by attenuation on the initial journey. The diagram below shows traffic
arriving on port 5 and being repeated to all the other ports on the hub.

<http://linux.invisiblepixels.org/writings/networkcourse/img/hub3.png>

They're pretty simple devices, and while adequate for small or quiet
networks (like our home network), they actually make conditions on a busy
network worse because of their indiscriminate replication of all frames to
all ports. When performance becomes an issue, it's time for a switch.

# MAC Address #

In the networks we've looked at so far, all computers receive a copy of
every packet, yet they only respond to frames directed at them personally
and discard the rest. This raises an interesting question: How are the
computers able to distinguish between frames meant for them and frames meant
for other computers? The answer lies in the MAC address.

Every network card has its own unique serial number, called a MAC or
hardware address. Knowing the MAC address of your card isn't necessary, but
is sometimes handy when troubleshooting. Finding out your card's address is
easy if the manufacturer printed it on the card itself, if not, installing
the card and running the programme ifconfig will reveal it. A MAC address is
48 bits long, but written as 6 pairs of hexadecimal digits thus:
00:04:76:26:38:D2. The first 24 bits (3 pairs) are called the OUI or
Organisationally Unique Identifier, and identify the manufacturer of the
card in question. If you refer to
http://standards.ieee.org/regauth/oui/index.shtml/ you can see the
manufacturer of the card mentioned above is 3Com. The second half (last 24
bits or 3 pairs) is a number uniquely identifying each card.

Each ethernet frame contains both a source and destination MAC address. By
looking at the destination MAC address and comparing it to its own, a
computer decides whether or not a particular frame is meant for it or
someone else. A frame meant for someone else is simply dropped (ignored).
There is a way to make a network card accept traffic meant for other
machines, and it's called promiscuous mode.

Armed with this knowledge, we can now look at switches.

# Switch #

Often called an intelligent hub, a switch performs the same basic function
as a hub, only by making use of the MAC addresses included in each frame, it
does so in a more efficient way. A switch intercepts every frame it receives
and then does two things with it:

1. After looking at the source MAC address, it makes a note of which port
that particular frame arrived on, and as a result builds up a map of which
computers are plugged into which ports.

2. Compares the destination MAC address to the addresses in its network map
(called a MAC address table) and finds out which port the destination
computer is plugged into.

Using the information gathered in step two the switch forwards the packet
only to the port the destination computer is plugged into. It's this feature
that gives the switch its "intelligent" moniker and is responsible for a
large reduction in network traffic. If a given destination MAC address is
not present in the switch's table, then that packet gets "flooded" onto all
ports. This allows you to add and remove computers on the network without
having to configure the switch. The switch is in a constant state of
learning. Neat hey!

There's one more benefit to using a switch. A network card in promiscuous
mode and attached to a hub is able to intercept and read every packet
transversing the network. A network card (whether in promiscuous mode or
not) attached to a switch only receives traffic meant for that particular
card. This makes it harder, but not impossible, for users on the network to
intercept and read traffic not meant for them. This "security" is very easy
to circumvent and should never, ever be considered a substitute for proper
security measures.

Both switches and hubs can be found in two varieties, managed and unmanaged.
Managed ones allow you to log on and configure various features, though
exactly what you can do is dependent on the brand.

# Router #

Mysterious devices that conjure up images of expensive hardware and
technicians that do their tax returns in hexadecimal, routers are often seen
as scary. The whole aura of mystery surrounding them possibly comes from the
many and varied forms they take. Certainly, many of them are very expensive
and run very involved configurations, but they can also be very simple
devices. So simple in fact, that we'll be building one! If you have a look
at the illustration below, you'll see two networks marked, the internet, and
our home network. That computer at the junction between the two of them is
the router we'll begin configuring next lesson.

<http://linux.invisiblepixels.org/writings/networkcourse/img/starinternet.j
pg>

What they do is very simple. Sitting at the border of different networks,
they direct (or route) traffic between those networks. They can also have a
secondary function as media converters if the networks they join vary in
type, such as ethernet on one side and ISDN on the other.


############################
## Part Three - Odd Stuff ##
############################

# Cross Over Cables #

Trying to work out when to use a crossover cable causes a fair amount of
confusion. Sure, it would be possible to just list different circumstances
and the appropriate cable, but such list can never be exhaustive. For that
reason I want to explain how you can work it out for yourself.

Doing so is quite simple, and requires only three pieces of information.

1. All RJ45 jacks, whether they be on network cards, hubs, switches or
toasters are wired as follows: (Tx = transmit, Rx = receive)

<http://linux.invisiblepixels.org/writings/networkcourse/img/rjsocketsm.jpg>

2. All connections must obey the rule "Originate on the Tx, Terminate on the
Rx". To make some sense of this, you need to imagine a network connection as
being like a telephone - your words are transmitted from the mouthpiece but
end up being received by the ear piece.

<http://linux.invisiblepixels.org/writings/networkcourse/img/phones.png>

3. All hubs and switches are internally configured so that the Tx pair of
every port is wired through to the Rx pair of every port.

Right! That's all you need to know, end of lesson. Just kidding. Keeping
those three rules in mind, let's trace the path of a frame in a "normal"
connection. What we've got in the picture below are two computers plugged
into a hub. Computer on port one wants to talk to the computer on port three
so the frame begins its journey on the Tx pair of computer one. Because all
jacks are wired the same and a straight through cable is used, the frame
enters the hub on the Tx pair (originate Tx). Internal voodoo performed by
the hub flips the frame so it exits on the Rx pair. Identical jack wiring
and straight through cable mean the frame arrives at computer three on the
Rx pair, (terminate Rx) and fulfils the golden rule.

<http://linux.invisiblepixels.org/writings/networkcourse/img/supermagic.png>

Right. So what's all that got to do with cross over cables? It all comes
back to our rule "Originate on the Tx, Terminate on the Rx" - something has
to make the connection obey this rule. We know it can't ever be the jack -
they're all wired the same way, so it has be some other component of the
connection that does it. In the configuration we looked at above, the hub
(or switch) is responsible for the flip from Tx to Rx. If you have a
different situation where there is no hub/switch, you need some other
mechanism for performing the flip. This is the exact situation we looked at
in lesson two where we had two computers joined by a single cable. There is
no hub present, we can't change the wiring of the jacks so the only option
left is to use a cable that performs the Tx <--> Rx flip. Let's have a look
at a cross over cable in more detail.

<http://linux.invisiblepixels.org/writings/networkcourse/img/xover.png>

As you can see, the Tx is pair is physically wired through to the Rx pair
(and vice versa) performing the same cross over function normally carried
out by a hub/switch. By using the cross over cable, our computer to computer
connection obeys the "originate Tx terminate Rx" rule and everything works
like it should.

In a nutshell: Every connection must abide by the "originate Tx terminate
Rx" rule - if it's not taken care of by hardware, then you need a cross
over cable.


#################
## To Conclude ##
#################

After I posted lesson two, I got several responses saying "you didn't
mention this, you didn't say that..". Well I'll probably get a few more
after this lesson, but as I've said before, the topic is so huge that I
can't mention every detail about every piece of equipment. The people that
do that are O'Reilly authors. I've had to draw the line somewhere with what
I've chosen to include and omit, and it's been drawn along the "common
equipment relevant to home networking" boundary.

In this lesson we began with a look at the coax networks of the past and
then shifted our attention to the star topology networks used today. In
their most basic form, computers are connected to a central hub whose
purpose it is to repeat all incoming frames onto the receive pair of wires
on every other connected port. This enables every computer on the network to
receive a copy of every frame. Computers use the MAC addresses included
within each frame to distinguish frames intended for them.

By shifting the task of parsing source and destination MAC addresses off the
computer and onto a switch, more effective use of a network's bandwidth is
made as frames are delivered only to the computers they're addressed to.
Couple to this the ability of some switches to run in full duplex mode and
you can see the improvement in performance a switch can make to a large or
busy network.

The last section introduced the rule "Originate Tx, Terminate Rx" as a
method for working out the situations in which a cross over cable is needed.

If anyone is interested in some more nitty gritty ethernet details, I've got
a page at http://linux.invisiblepixels.org/ref/ethernet.html


##############
## Homework ##
##############

The homework exercise is another look at crossover cable situations.

1. Take a look at the following diagram, and tell me which cable you need to
use to join the two hubs together, assuming the hubs have only standard
jacks.

<http://linux.invisiblepixels.org/writings/networkcourse/img/homework1.jpg>