Network Components


Any network is made up of the same types of component parts. These range in complexity from simple cables through complex computer-like devices such as routers. Each type of component exists at a different level of the OSI model; the brief view you have had of the TCP/IP stack and its layers will help to explain the conceptual difference between hubs, switches, bridges, and routers.

As with most computing equipment, the components you choose will vary in quality and in price. It's best to buy from vendors whose names you trustLinksys, Cisco, Intel, 3Com, and Netgear all make excellent infrastructural equipment, but they are by no means the only vendors you should consider. Bear in mind the features you need in your network. Will you have a pure 10base-T or 100base-TX network? Or will you need equipment that handles both? Will you need to support Gigabit Ethernet? Will you be using a wireless network? Also, pay attention to reviews to find out what models offer the best performance and quality for the price. Some components, however, offer opportunities to save on cost; you can make your own Ethernet cables, for example.

This section will examine the different components you will be working with in a typical networking topology, and later we will discuss how FreeBSD interacts with them.

Cables

The benefit of Ethernet and other LAN link types is that for a very low cost, traffic can be carried between machines within a network at speeds that only the most expensive WAN links can reach. Those speeds range between 10Mbps for "standard" Ethernet, 100Mbps for Fast Ethernet, 1Gbps for Gigabit Ethernet, and 10Gbps for the fastest standard in wide use today, 10 Gigabit Ethernet. These speeds can be achieved with cheap cables and components, making networking between computers via Ethernet a joy compared to a low-speed WAN. The downside is that Ethernet can't be used over long distances. Because the signals aren't serialized or transmitted by equipment designed to support long-distance transmission, signals degrade with cable length.

Twisted-Pair Cables

The most commonly used cabling these days makes use of unshielded twisted-pair (UTP) cables, due to the relative simplicity and low cost of the cables and components. UTP cables connect computers' network interface cards (NICs) directly to hubs and switches without the need for repeaters or terminators, can be coiled tightly and strung through hard-to-reach areas, can be created from inexpensive components using readily available tools, and connect easily to RJ-45 phone-style jacks.

RJ-45 jack crimpers can be bought at any electronics supply store, as well as RJ-45 connectors and UTP cable. Refer to the next section for information on pin-outs so that you can attach the connectors correctly.

Note

Twisted-pair cables do vary in quality, and some types are rated for higher speed than others (and have a commensurately higher cost). This quality rating can be expressed in a supported speed, a noise rating (citing such influencing factors as attenuation, NEXT distortion levels, and return loss), or a category compliance level. If your networking needs will require high-performance equipment (for instance, if you will be transmitting data at sustained speeds in excess of 100Mbps), you will want to pay the extra cost for quality cables, such as CAT5e or CAT6.


Straight-through and Crossover Cables

The two types of twisted-pair cables are straight-through and crossover. The difference lies in whether the positions of two pairs of wires in the cable are reversed from one end to the other. The type of the devices you are connecting determines which of these two cable types you must use.

Devices with RJ-45 connectors can be thought of as either "computer-type" or "hub-type" devices. Computers, routers, bandwidth managers, and other "endpoint" devices are considered computer-type devices, and they all share the same type of wiring. Hubs and switches are hub-type devices and also share a type of wiring. Straight-through Ethernet cables are wired to connect computer-type devices to hub-type devices, but crossover cables are wired to connect a computer to a computer or a hub to a hub. The rule to remember is this: Use straight-through cables between unlike devices, and use crossover cables between like devices.

You use straight-through cable to connect unlike devices, as in these examples:

  • To connect a computer to a hub

  • To connect a computer to a switch

  • To connect a router to a hub

You use crossover cable to connect like devices, as in these examples:

  • To connect a hub to a hub

  • To connect a hub to a switch

  • To connect a computer to a computer (for instance, to play in two-player deathmatch mode)

Uplink Ports

The exception to the Ethernet cabling rule is the "uplink" port on hubs. This special port is wired as if it's a computer-type device, so you can connect a hub's uplink port to a standard port on another hub with a straight-through cable. This became necessary in large networks, in which a very long straight-through cable would be connected to a large enterprisewide hub or switch (in the server room, for example) and wound through walls and conduits to emerge in another room. This cable couldn't be connected directly to a standard port on a smaller hub; it had to be fitted to an adapter and a short crossover cable before it could talk to the smaller hub. Replacing the Ethernet cable with a long crossover cable was impractical to say the least. Hence the uplink port was borna port that allows a hub to be connected directly to another hub for which swapping out the cable for a crossover is not a viable option. Remember, though, that connecting two hubs' uplink ports together requires a crossover cableand that's a configuration that rather defeats the purpose, in any case.


How do you tell whether an Ethernet cable is a straight-through or a crossover cable? It's pretty easy: Hold up the two ends of the cable next to each other. If the color sequences of the wires match, it's a straight-through cable. If some of the wires appear out of place, it's a crossover cable.

The pin-out for a straight-through cable is shown in Figure 22.5.

Figure 22.5. Straight-through cable wiring diagram.


And to make a crossover cable, reverse the positions of pair 3 (wires 1/2) and pair 2 (wires 3/6), as shown in Figure 22.6, when crimping the second end.

Figure 22.6. Crossover cable wiring diagram.


Hubs

One end of the cable connects to your computer's Ethernet card; that much is clear. However, the other end needs to connect to something, too. Although their role has been eclipsed recently by inexpensive switches that perform similar functions, the simplest connection device for this purpose is a hub.

Hubs are devices with multiple RJ-45 ports, usually between 4 and 24, to which you can connect as many Ethernet cables as there are ports. These cables can connect to computers, other hubs, switches, or other network components as necessary. Hubs range in cost from about $20 to several hundred dollars, depending on quality, number of ports, and the capability to operate simultaneously with 10base-T and 100base-TX devices. Many hubs can only do one of the two speeds; an auto-sensing hub (often referred to as N-Way) can do either speed but costs significantly more.

Hubs range in size from small boxes no larger than your hand (or smaller) to full 19-inch rack-mountable units, and all require a power source. Some hubs are even "managed," meaning that you can telnet to them and configure each port's capabilities through a command-line interface. These hubs are naturally much more expensive than standalone hubs.

A hub is effectively a repeater, with all traffic appearing simultaneously on all ports, so a computer connected to one port on a hub will be able to see traffic to and from any other computer on the same hub. One port on a hub is usually reserved for uplinka link to another hub, a switch, or a router higher up in the network hierarchy, as laid out earlier in Figure 22.1. This "uplink" port is usually wired so that a crossover cable is not needed between the hub and its next upstream device. This port and one of the standard ports on the hub may also be wired so that they're mutually exclusive. A five-port hub might give you the option of hooking four computers together (ignoring the uplink port) or three computers to an upstream device (ignoring the fourth standard port). This behavior might be hard-wired, it might be controllable with a pushbutton or a DIP switch, it might autosense the polarity, or all the ports might be simultaneously usable. These are just some of the possible variations between different hubs.

Another matter that complicates the way hubs and other devices communicate with one another is the "duplex" mode in which they operate. In half-duplex mode, a host can only be "listening" or "talking" at one time. Full-duplex mode uses twice as many wires, enabling the host to "listen" and "talk" at the same time. Therefore, a 100Mbps Fast Ethernet link in full-duplex mode can transport up to 100Mbps on each direction simultaneously, whereas the same link in half-duplex mode can only do an aggregate total of 100Mbps in both directions.

Hubs can be thought of as a cheap replacement for switches, which we will discuss next. Because the cost of switches is dropping to nearly that of hubs, we may soon see the industry move entirely to switches, with hubs vanishing into obsolescence.

Note

If you have 1000base-T (Gigabit Ethernet) devices on your network, you can't use hubsGigabit Ethernet requires the use of switches, and Gigabit-capable switches are significantly more expensive than entry-level hubs. This is one reason why Gigabit Ethernet is still usually only found in business or university networks rather than the home.


Switches

A switch is another device that connects Ethernet devices together. A switch looks like a hub but tends to be more expensive and usually has fewer ports. It has multiple RJ-45 ports, it ranges from hand-sized to rack-sized, and the same companies that make hubs make switches, so it's easy to mistake one for the other on store shelves. They even operate somewhat similarlyyou can plug multiple devices into a switch, and a switch used in place of a hub in a network would usually give you what appears to be the same result. The difference between switches and hubs, however, is subtle yet crucial.

On a hub, all ports share the same internal wiring. All computers connected to the hub, either directly or through another hub, exist on what's known as a collision domain. In a collision domain, a signal sent to one computer gets sent to all computers within the domain. It's up to each computer's Ethernet card to identify signals destined for that computer's address and to discard all others.

A switch's internal wiring is much more complex than a hub's. Each port has its own unique wiring path connected to a common backplane and comprises its own collision domain, and hosts connected to one port can't see any traffic destined for hosts on any of the other ports. Switches incorporate the software necessary to read each packet's Ethernet header and destination MAC address (the unique identifier for each host's Ethernet card, as we will discuss later) and determine which port has the host that should get the packet. To make that determination, a switch stores an ARP cache, which is a lookup table of which hosts are on which ports. Managed switches, like managed hubs, have complete command-line interfaces and configurability, with the attendant high price and complexity. There are even VLAN switches, which connect multiple LANs together using many different kinds of cabling mechanisms.

Tip

You can often confuse a switch by moving a computer from one port to another, so it may be necessary to power-cycle the switch in this circumstance (which clears most switches' ARP caches).


Because each port on a switch has its own collision domain, switched network traffic is able to take fuller advantage of the available network bandwidth. To illustrate, consider a hub. An eight-port, 100base-TX hub with all ports in use has to divide the available 100Mbps among the eight ports. If all eight ports are simultaneously trying to do bandwidth-intensive tasks and their aggregate bandwidth demand is greater than 100Mbps, "collisions" become more common. In a collision, two ports try to transmit or receive traffic at the same time, resulting in retransmissions at the physical link level and performance well below each host's logical share of the available 100Mbps. Switches alleviate this problem. Whereas a 100Mbps hub has 100Mbps of internal wiring in total, an eight-port switch has 800Mpbs worth of wiringthe full bandwidth duplicated for every port. This is why switches tend to have fewer ports than hubs, and switches with many ports are quite expensive, especially for Gigabit Ethernet (whose switches often have full operating systems every bit as complex as FreeBSD itself).

Security and Switched Networks

A fully switched network gives you the added benefit that machines in one collision domain can't see any traffic in any other collision domain. As long as every host is on its own switched port, no eavesdropper on the local network can intercept any traffic not bound for his own computer.

Switches also protect your network from being overwhelmed by a single host that floods the network with an aggressive traffic flow, whether intentional or not, that uses all available bandwidth within the collision domain. Using switches rather than hubs, along with careful network planning, can greatly increase the network's reliability, security, and performance, thus making them worth the added cost.


Switches usually have no uplink ports. Occasionally, one or both ports have a pushbutton to select whether the ports need a straight-through or crossover cable. This is the case with some two-port switches, which serve purely as a filter to keep out irrelevant traffic. As a general rule, treat ports on a switch as hub-type devices and use crossover cables to connect one switch to another or a straight-through cable to connect a switch to a hub's uplink port. Most switches can auto-negotiate the speed and duplex mode of Ethernet cards, so you generally don't need to worry.

Routers

A router is the most complex (and expensive) of all networking devices. Routers have full operating systems and maintain tables that keep track of where entire IP networks can be found. Most small networks have only one router, at the "edge" of the network (the boundary between the LAN and the WAN that connects it to the Internet), specifying which network numbers indicate the LAN and which ones should be forwarded upstream into the WAN. You can have any number of routers in your network, though, each one managing a subnetwork and subservient to the topmost router.

What's more, routers throughout the Internet use a variety of protocols to communicate with one another and plot out what's the best way for a packet to get from one place to another. When you send out a packet, it travels upstream from router to router, until it reaches a router that knows where downstream to find your packet's destination network. That router sends your packet through the downstream route until it reaches the destination LAN and, ultimately, the destination host. Routing is the backbone of the Internet and possibly the most complex part of the way TCP/IP networking operates. You'll learn more about routing in Chapter 28, "Configuring an Internet Gateway."

Tip

You can see Internet routing in action by performing a TRaceroute; simply type TRaceroute hostname to get a listing of all the routers between you and your specified host as well as a reading of how quickly that router responds. This is also useful for seeing how well the routers are performing between you and your destination host. Here's an example:

[View full width]

# traceroute freebsd.org traceroute to freebsd.org (216.136.204.21), 64 hops max, 40 byte packets 1 dot7.orrc1.pf.example.com (203.152.186.253) 3.200 ms 0.632 ms 3.910 ms 2 pos1-0-0.orrc5.pf.example.com (192.7.4.162) 1.055 ms 0.634 ms 0.572 ms 3 gr-2-0-0-1.orpa8.pf.example.com (192.7.4.164) 1.862 ms 1.390 ms 1.426 ms 4 so-1-0-0.orpa7.pf.example.com (192.7.4.230) 1.366 ms 1.003 ms 3.606 ms 5 bas1-m.pao.yahoo.com (198.32.176.135) 1.211 ms 1.310 ms 1.378 ms 6 ge-0-2-0.msr1.sc5.yahoo.com (216.115.100.233) 2.456 ms 2.413 ms ge-1-2-0.msr2.sc5.yahoo .com (216.115.101.230) 4.885 ms 7 vl44.bas2-m.sc5.yahoo.com (66.163.160.222) 1.925 ms 2.295 ms 2.389 ms 8 freefall.FreeBSD.org (216.136.204.21) 4.577 ms 2.107 ms 3.137 ms



Most routers have either one or two LAN-side ports, either RJ-45 jacks or AUI ports that require transceiversdevices that translate the signal from one physical format to anotherto convert the interface to twisted pair. On the other side of the router is a serial cable that connects to the DSU/CSU or other such high-speed serial converter, beyond which you have WAN traffic. Routers vary greatly in size, complexity, number and type of ports, manageability, and price. Understanding how they work is one of the most important things you can learn in the networking world.

If you don't want to spend the money on a dedicated router, you can make one cheaply from any computer running FreeBSD, using the methods described in Chapter 28.




FreeBSD 6 Unleashed
FreeBSD 6 Unleashed
ISBN: 0672328755
EAN: 2147483647
Year: 2006
Pages: 355
Authors: Brian Tiemann

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net