Sunday, July 25, 2010
Automatic SQL Server Backup
In my case, the database files are located in the following directory:
C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA
As you may already know, you cannot backup the *.MDF and *.LDF database files directly because they are attached to the SQL Server. You could detach them, back them up, and then re-attach them but then your database will be offline for a period of time.
To solve this problem, we first need to create a SQL file that can be used later to automate our database backup. Here’s how we can do that:
CREATE AN SQL FILE
Login to Microsoft SQL Server Management Studio.
Right click on your database from the “Databases” node.
Select “Tasks” -> “Back up…”
You are now presented with the “Back up Database” window. In this window you can specify your backup settings. At a minimum, you need to create a destination for your backup. Click the “Add” button and specify a full path name for your database backup in the “File name” field. You will need to use this path name later, so let’s take note of it.
You can choose any other backup options that are important to you. Over on the left hand side is “Options”. I would click on that and decide whether you want to use “append to an existing backup set” or “overwrite all existing backup sets”.
Once you are finished with your settings, you need to create an SQL file which will be used later for the automated database backup. To create that SQL file, click on the arrow next to “Script” at the top of the window. There will be an option for “Script action to File”. Go ahead and select that option. You will then be able to save your SQL Server Script File. Take note of where you have saved this file as well.
CREATE A BATCH FILE
Now that we have created the SQL file, we need to create a batch file that can be automatically executed by the Task Scheduler. To create this file, do the following:
Open Notepad and enter the following:
sqlcmd -S .\SQLEXPRESS -i "C:\Users\Administrator\Documents\Backup.sql"
Of course, substitute the pathname with the pathname of where you saved your SQL file.
Save this file and take note of where you saved it.
Now, using Windows Explorer, go to the directory of where you created this file and rename it to have a .bat filename extension instead of .txt.
SET BATCH FILE TO RUN IN WINDOWS TASK SCHEDULER
We are now ready to add the batch file to the Task Scheduler. Rather than using the Task Scheduler GUI, I prefer to do it on the command line. You can open a command prompt as Administrator or if you are already running as Administrator, you can use Start -> Run. Either way, enter the following:
schtasks /create /sc Daily /st 03:30:00 /tn "MyTask" /tr "cmd /c C:\Users\Administrator\Desktop\Backup.bat"
Again, substitute the pathname above with that of your batch file.
Also, set the time specified to something that is desirable for you. In the above example, we run this task at 3:30 AM.
SET SECUREBACKUP TO BACKUP YOUR DATABASE
The time specified in the Task Scheduler step above is important because you need have SecureBackup automatically backup the database file after the task is complete. Since the backup took place at 3:30, you can setup SecureBackup to run the backup at say, 4:00 AM. This way you will have the most recent backup.
From within the SecureBackup software, you need to create or edit an existing Backup Job and include the location of the backup file that you chose in step 4 of “CREATE AN SQL FILE” above. If the file isn’t listed and you can’t select it from within SecureBackup, it’s because Windows Task Scheduler has not run your batch file yet. To run the batch file, simply double click on it from within Windows Explorer. It may take anywhere from 10 seconds to, possibly, a few hours depending on how large your database is. Once complete, you will have your database backup file and can select that file from within SecureBackup. You will also be able to schedule the Backup Job around how long it took for that batch file to complete.
You now have an automated backup solution for your Microsoft SQL database complete with a secure online storage solution. I hope this post was helpful to you.
Friday, May 14, 2010
To Create another User account with 'root' privileges
Let begin by check the 'root' user account.
1. Check user id for ‘root’ user account:
[root@fedora ~]# id root
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
Explanations of the command output:
A. uid=0(root) The user id for user 'root' user is 0.
B. gid=0(root) the group id for user ‘root’ is 0.
C. groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) The user ‘root’ is belong in groups; root, bin, daemon, sys, adm, disk and wheel.
2. Now we take a look at the passwd, shadow and group files that contain ‘root’ user information:
[root@fedora ~]# less /etc/passwd
root:x:0:0:root:/root:/bin/bash
[root@fedora ~]# less /etc/shadow
root:$1$B2BEWv4X$Gb.QPb6I3RwCkEkz13ow21:13080:0:99999:7:::
[root@fedora ~]# less /etc/group
root:x:0:root
bin:x:1:root,bin,daemon
daemon:x:2:root,bin,daemon
sys:x:3:root,bin,adm
adm:x:4:root,adm,daemon
tdisk:x:6:root
wheel:x:10:root
From the information gather above, to create a user that have the same power (superuser power) as a ‘root’ user in Linux system, we need to create a user with same root user uid, gid and group.
3. To create user account that has the same ability (super user) as the ‘root’ user, issue this command:
[root@fedora ~]# adduser -u 0 -o -g 0 -G 0,1,2,3,4,6,10 -M root2
Adduser command explanations:
adduser
-u 0 -o
-g 0
-G 0,1,2,3,4,6,10
-M
root2
Using Linux adduser command to create a new user account or to update default new user information.
Set the value of user id to 0.
Set the initial group number or name to 0
Set supplementary group to:
0 = root
1 = bin
2 = daemon
3 = sys
4 = adm
6 = disk
10 = wheel
'home directory' not created for the user.
User name of the new user account.
Note: you need to have the administrative privilege on the system in order to issue 'adduser' command above.
4. Now add a password for user ‘root2’ by issue the ‘passwd root2’ command, see example below:
[root@fedora ~]# passwd root2
Changing password for user root2.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
Note: you need to have the administrative privilege on the system in order to issue 'passwd' command above.
5. Check id for user root2 by issue the ‘id root2’ command, see example below:
[root@fedora ~]# id root2
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
6. Now recheck the passwd, shadow and group files that contain ‘root2’ user informations to confirm the changes:
[root@fedora ~]# less /etc/passwd
root:x:0:0:root:/root:/bin/bash
root2:x:0:0::/home/root2:/bin/bash
[root@fedora ~]# less /etc/shadow
root:$1$B2BRWv4X$Gb.MPc6I3RwCkEkT13ow21:13080:0:99999:7:::
root2:$1$bQHGH4cX$TtsV/WVdFe5cIsHWjzc.N1:13112:0:99999:7:::
[root@fedora ~]# less /etc/group
root:x:0:root,root2
bin:x:1:root,bin,daemon,root2
daemon:x:2:root,bin,daemon,root2
sys:x:3:root,bin,adm,root2
adm:x:4:root,adm,daemon,root2
disk:x:6:root,root2
wheel:x:10:root,root2
7. Everything should be ok, now try to login to system with newly created ‘root2’ account, see example:
login as: root2
root2@10.7.0.211's password:
Last login: Thu Nov 24 23:48:49 2005 from 10.7.0.112
Could not chdir to home directory /home/root2: No such file or directory
-bash-3.00#
-bash-3.00#
-bash-3.00# su –
[root@fedora ~]#
8. Make sure that you execute the su command with hyphen ( su - ) to get the PATH of the user that you become to... below is the example of the su command with hyphen and without hyphen.
Loggin in as user tenouk, then execute $PATH as example below.
[tenouk@fedora ~]$ $PATH
-bash: /usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/ tenouk/bin: No such file or directory
[tenouk@tenouk ~]$
Use the su command to change to root user as example below and then execute $PATH as example below.
[tenouk@fedora ~]$ su root
Password:
[root@fedora tenouk]# $PATH
bash: /usr/kerberos/sbin:/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/b in:/usr/bin:/home/tenouk/bin: No such file or directory
[root@fedora tenouk]#
Then try use the su - command and verify with the $PATH as example below.
[root@tenouk tenouk]# su - root
[root@tenouk ~]# $PATH
-bash: /usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin: /usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin: No such file or director y
[root@tenouk ~]#
Note: The execution of su command, without the hypen ( - ) you inherit the PATH of the current user. Use the su command, with hyphen ( su - ) to get the default PATH of the root user.
Step-by-step how to procedure above tested on:
Operating System: GNU/Linux Fedora Core 4
Kernel Name: Linux
Kernel Release: 2.6.11-1.1369_FC4
Kernel Version: #1 Thu Jun 2 22:55:56 EDT 2005
Machine Hardware: i686
Machine Processor: i686
Hardware Platform: i386
Shell: GNU bash, version 3.00.16(1)-release (i386-redhat-linux-gnu)
Installation Type: Full Installation (Custom)
SELinux: Disable
Keywords: root user, create root user account, add root user, create root user, adding root user account, root user account, add root user account.
Monday, May 3, 2010
How to Extend IBM Websphere 7 Trial Period
I. Delete the /properties/was.license file (when restarting the WAS7 server, the file will be recreated and the eval period restarts)
II. Use the java code below to generate your own license file… (the generated license file will never expire)
import java.io.File;
import java.io.FileOutputStream;
import java.io.ObjectOutputStream;
import java.util.Date;
public class WAS7LicGen {
public static void main(String[] args) throws Exception {
Date creationDate= new Date();
Date expirationDate=new Date();
FileOutputStream fos = new FileOutputStream(new File("./was.license"));
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeInt(0);
oos.writeObject(creationDate);
oos.writeObject(expirationDate);
oos.close();
fos.close();
}
}
Sunday, April 4, 2010
How to re-create the Show desktop icon on the Quick Launch toolbar in Windows XP
Click Start, click Run, type notepad in the Open box, and then click OK.
Carefully copy and then paste the following text into the Notepad window:
[Shell]
Command=2
IconFile=explorer.exe,3
[Taskbar]
Command=ToggleDesktop
On the File menu, click Save As, and then save the file to your desktop as "Show desktop.scf". The Show desktop icon is created on your desktop.
Click and then drag the Show desktop icon to your Quick Launch toolbar.
Information for advanced users
The Quick Launch toolbar uses the files in the following folder:
%userprofile%\Application Data\Microsoft\Internet Explorer\Quick Launch
Tuesday, February 23, 2010
Segmenting Your Network
Tweak your physical infrastructure to improve performance
Windows NT Magazine - March, 1999
When I think about performance tuning, I always see images of car-racing pit crews using precision instruments to make subtle adjustments to their cars' engine, tires, and chassis. To get the maximum performance from their cars, pit crews tweak their cars' parts to suit environmental factors such as track condition and air temperature. Similarly, Windows NT administrators continually apply patches and tweak settings on their networks in an ongoing effort to squeeze as much performance as possible out of their systems. This issue of Windows NT Magazine provides many suggestions to help you improve the responsiveness of the systems you administer. As you make performance improvements to your individual machines, don't forget to maintain a sound physical network infrastructure. A poorly designed physical network can completely negate any performance improvements you make on a server, just as flat tires would restrain a finely tuned Indy-car engine. Use the following tips and techniques to properly segment your network and maximize the benefits of performance tuning your systems.
What Is Network Segmenting?
Segmenting at its most basic level is the process of separating certain portions of network traffic, either for performance, security, or reliability reasons. You can use a bridge, a switch, or a router to separate your network's devices into segments.
Performance tuning is at once a science and an art. Knowing your options for grouping various devices to form a network is the science of network segmenting. However, successful networking requires you to choose your segmentation points wisely, considering all the devices on your network—this requirement is the art of network segmenting. To master this art, you must understand the types of traffic on your network and the path each type of traffic takes. Then, you must minimize the number of devices between the source and destination points of each packet.
NT Servers Between Segments
Many administrators use NT servers as routers between their network's segments because of budget constraints or because adding NICs to an existing server is easier than restructuring a network.
Figure 1 depicts a network with two servers—each of which has two NICs—and two user segments. This network might seem simplistic, but many companies employ this type of network configuration—sometimes with hundreds of user workstations. This segmenting scheme places a performance burden on the two servers. The servers not only provide standard user services, but they are also responsible for routing packets between network segments. In addition, both servers in this network design must be available for users on one segment to be able to access the other segment. If one server goes down, users on that server's segment are unable to access the failed server and are also unable to access resources on the other segment.
To maximize performance, this network's administrators need to place a bridge between the two segments, as Figure 2 depicts.
In Figure 2, each server is on the segment on which it gets the most use. Bridges don't retransmit packets that don't need to pass through them, so this configuration reduces network traffic without introducing routing overhead onto the servers. In addition, Figure 2's users won't lose access to the other network segment if one server crashes; the bridge will route traffic, so users on both sides of the network will still have access to the functional server. Bridges occasionally crash, and a bridge failure would prevent users on each segment from accessing the other segment. But most bridges crash far less often than servers crash, and in the event of a bridge crash, users on each side of the network can access the server on their segment.
Switched Environments
Suppose your network has grown to the point that you don't want to keep all your devices on one physical segment anymore. Switches provide the easiest and most common way to segment traffic. Switches and bridges behave similarly; both devices accept traffic on any of their ports, examine each packet for destination information, and transmit the packet only to the port on which the target device resides. The primary difference between a switch and a bridge is that switches work on a larger scale. Switches usually have at least a dozen ports, but bridges usually have only two ports.
Unlike switches and bridges, a hub transmits packets to all of its active ports. Many people refer to hubs as shared media because every device that connects to the hub has to share its bandwidth with all the other devices that connect to the hub. If you connect too many hubs, you end up with a shared network too large to let users work effectively.
To design a switching layout for your network, start with a switch on the central backbone of your enterprise network. This switch must extend to hubs or more switches. Users on some networks connect to the network through those secondary switches; this configuration is commonly referred to as a switched-to-the-desktop setup. This setup is becoming more common as low-cost switches are becoming more prevalent. This configuration provides more security and better performance for each user than any other network segmenting configuration, but it costs more per port than any other segmenting method.
Most companies still connect their user workstations to hubs. If your central switch connects to hubs or groups of hubs for user workstations, you can take several steps to improve your network's performance. Keeping in mind how traffic flows on your network, use the following guidelines to improve your network performance in a switched-and-shared environment.
Group frequently talking partners together. Consider keeping some servers on the same network segment as the servers' most frequent users. This concept runs contrary to the typical centralized-IS mentality, which encourages you to keep all major servers in a common area, but it might increase your network's performance. For example, if 90 percent of a server's traffic relates to your graphic arts department's production work, you might want to place that server on the graphic arts department's physical network segment. This server placement would reduce traffic on the central switch and shorten the path that the production work's packets take to get to their destination.
Give many-to-one devices their own port. When you install a switch, you know that some devices—such as servers and hubs—need their own ports on the central switch. But what about other devices that many users will attempt to access, such as an Internet connection? In general, if more than a few users routinely access a device, it needs a separate port on the switch.
Load-balance bytes on each switch port. Experts debate how many devices can and should be on each network segment. Most experts think that running between 24 and 48 devices on the same physical 10Mbps Ethernet network segment is acceptable. However, the number of devices a segment can hold depends on how much traffic each device generates. When you determine how many users to place on each logical segment of your network, consider the amount and type of traffic each user generates rather than simply balancing the number of users on each switch port. Some users (e.g., a graphic arts department) might use much more bandwidth than other users. Therefore, if you use one switch port to connect to a 24-port hub for most of your users, consider purchasing two 12-port hubs for your high-bandwidth users and connecting each hub to a separate port on the switch. This configuration will increase the high-bandwidth users' performance.
Avoid overloading your devices. One of the primary reasons for implementing switching on a network is to reduce performance bottlenecks. However, if you don't design your network properly, your network segmenting might introduce new bottlenecks. Consider the network diagram in Figure 3.
This network switch has 12 ports, 8 of which link to 10Mbps hubs and 4 of which connect directly to servers. Suppose that during peak periods, users on each of Figure 3's 8 hubs create 2Mbps to 3Mbps of bandwidth for the servers. This situation would result in a total of 16Mbps to 24Mbps heading to the network's servers. If the servers have only 10Mbps connections to the switch, one server might become overloaded if it received half the network's traffic. Make sure your network can handle user loads during periods of peak traffic.
Segmenting via Routers
Although routers commonly connect geographically dispersed networks, you can use them to segment local networks. However, because administrators usually use routers to route traffic across WAN links, bandwidth between routers is usually limited and expensive. Minimizing router traffic is a key goal of performance tuning a network that uses routers.
To reduce the bandwidth they use, most routers don't retransmit broadcast packets by default. However, you might want your router to retransmit broadcasts to improve the success rate of one of NT networks' primary housekeeping chores—name resolution. By understanding how Windows Internet Naming Service (WINS) clients resolve names on your network, you might be able to reduce traffic across your WAN links.
WINS clients have four methods for resolving a network device's name. First, they can send a broadcast packet looking for the name of the machine. If a machine with a matching name doesn't respond to the broadcast, WINS assumes that no such device exists on the network. Second, a WINS client can send a directed packet to a WINS server requesting a name resolution. If the WINS server knows the IP address of the target machine, it passes that information to the client. The other two ways that WINS clients resolve NetBIOS names are combinations of the first two methods: broadcast first, then send a directed packet if the broadcast is unsuccessful (known as mixed node), and send a directed packet first, then broadcast if the directed packet is unsuccessful (known as hybrid node). For more information about NetBIOS name resolutions, see Mark Minasi, "Inside a NetBIOS Name Resolution," March 1997.
Because broadcast packets don't typically cross routers, broadcast name resolution doesn't work if the device the client is trying to access is on another network segment. Therefore, directed packets are the primary mechanism for resolving NetBIOS names on routed networks. However, broadcasts might be useful in the network Figure 4, page 69, depicts.
As you can see, the network has two primary offices (Office B and Office C), which connect via a high-speed T1 circuit, and two satellite offices (Office A and Office D), which connect to the network via slower, 56Kbps connections. Office B and Office C include WINS servers that are replication partners. If users in Office A typically access only other devices in their office, their workstations shouldn't have to send directed requests to a WINS server across a WAN link to find local devices. If users primarily use local devices and don't have a local WINS server, you'll probably want to let them broadcast first to resolve addresses and send directed packets only when the broadcast fails. Setting client machines to mixed node might improve performance by reducing communications across the WAN link and allowing local clients to resolve the names of local devices quickly.
You might have considered another alternative that I've carefully avoided mentioning: putting a WINS server in each satellite office so that WINS servers in every office can resolve names locally without broadcasts. I don't usually recommend such a configuration; adding WINS servers to your network usually increases the number of replication partners each system has, and therefore increases the amount of replication traffic on your network. Depending on your WINS servers' replication configurations, the additional WINS servers might increase your replication traffic exponentially. You might actually reduce your network's speed by adding WINS servers. Let me put into perspective the potential for delays on a network with too many WINS servers: Microsoft had only about a dozen WINS servers on its corporate network last time I checked.
Multi-NIC, Multiprotocol Environments
Suppose budget constraints have forced you to expand your network by adding NICs to your server, and you now have a large server that contains five NICs—four NICs for user segments and one NIC for a dedicated Internet connection, as Figure 5 shows.
Also suppose that you have to leave IPX and NetBEUI running on the server to support some old DOS or Windows clients. If you accepted the NT defaults when you added all those protocols to your server, you bound each protocol (TCP/IP, NetBEUI, and IPX) to each of your five adapters. Binding each protocol to every NIC lets you plug in devices that use any of the three protocols anywhere on your network, so this approach might seem like a good time-saver for overworked administrators.
However, because of how Microsoft browsing works, binding each protocol to each NIC adds a lot of unnecessary broadcast overhead to your network. Microsoft clients and servers find out about other devices on the network through browsing. In case some of the devices on your network have only one protocol installed (e.g., an old IPX client), the server responsible for maintaining the browse list must broadcast its information to each network segment in every protocol that segment uses.
Therefore, in a multi-NIC, multiprotocol environment, you can get better network performance if you group machines by protocol, then unbind the unnecessary protocols from each server's NICs to prevent the server from sending out unnecessary broadcasts. You don't need your server to send IPX and NetBEUI browser announcements through the adapter for your Internet connection. Examine where your clients are and what protocols they're running. If you can run all your machines under one protocol, do so. But if you need multiple protocols on your network, try to group clients that use the same protocol on a network segment, then bind only the protocols necessary for each segment to that segment's NIC.
Get the Tools
Just like an Indy-car pit crew, you need the right tools to understand the traffic that travels across your network. By making subtle changes to your network's traffic patterns and reducing unnecessary traffic, you can tweak your network for maximum performance. I highly recommend getting familiar with a network-monitoring tool such as Network Monitor, a limited version of which comes with NT, or a more robust program such as McAfee's Sniffer Basic (formerly NetXRay—for information, see Michael P. Deignan, "NetXRay 3.0," January 1998), HP OpenView NetMetrix, or Concord's Network Health. (For more information about network monitoring, see Toby J. Velte, "Application Testing with Network Monitor," September 1998, and "Simulating Your NT Network," January 1999.) With the right tools in hand, you'll be well on your way to squeezing every last drop of performance out of your network.
Basics of Network Segmentation: Switching and Bridging
In previous articles, I explored the inner workings of the OSI Network Reference model, layer 2, the datalink layer, and one of its protocols, Ethernet. This week I'm going to significantly expand our simple two-host network -- one Macintosh and one e-mail server -- to include many hosts.
Our imaginary network example, the small sprocket manufacturing business, has suddenly taken off, and Mr. Spacely has hired seventy new employees. Each employee is required to have a host on the local network. All the devices are sharing the same media. The architecture is one Ethernet LAN segment.
Now the question arises, how do 72 hosts share one Ethernet LAN segment? The original Macintosh host must now share the wire with many other devices. The Ethernet protocol uses mechanisms at the LLC sub-layer of layer 2 for flow control. The network card will listen to the physical wire (layer 1) for a moment where there are no electrical pulses (transmissions). If the wire is quiet, as would be the case for our original two-host network, the Macintosh could easily place its Ethernet frame on the wire.
Consuming bandwidth on a single segment
Now, there are 71 other devices on the network that the Macintosh must contend with for frame transmission. If the Macintosh Ethernet adapter senses a transmission on the wire, the adapter will wait to transmit. After the wait period has expired, the network card will attempt once more to transmit the frame onto the wire. If the wire is still busy by another device, the Ethernet adapter will wait once more before attempting to transmit. The Ethernet adapter uses a back-off counter to tally these attempts. If the back-off counter exceeds 15 tries, the adapter will assume the wire is too busy to send the frame. It will then clean the frame from its memory.
Frame collisions
In the event two network devices transmit simultaneously, a packet collision occurs. When a collision occurs and is detected, the Ethernet adapter will generate an alarm on the wire to signal other stations of the event. If the collisions occur continuously, the adapter would dump the frame and not attempt to transmit. Such a condition would arise if too many devices were on one network segment. A scenario could occur where a faulty network card could transmit continuously, causing collisions on the network.
If we have too many hosts on the Sprocket network, it is time to break up the segment into other, smaller network segments. The primary reason for segmenting is to increase bandwidth and to span the network over greater distances. The Ethernet 10-Base T topology has a distance limitation of 100 meters in transmission.
Repeaters
The Sprockets manufacturing floor quickly outgrew the space available in the basement of the founder's parents' farmhouse. The old barn started looking pretty appealing in size and cost of space per square footage. However, the old barn was about 90 meters away from the basement corporate site.
Mr. Spacely's mother, now the VP of IT at Sprockets, knew this distance was too close to the 100-meter limitation of the existing Ethernet 10-Base T network. When Momma Spacely was baking some cookies for the quarterly company meeting, she came to the conclusion that a signal repeater was needed to bridge the extended network between the corporate site and the new manufacturing facility.
|
A repeater is a layer-1, physical-layer device that simply repeats the signal from one wire onto another wire. This is a simple way to solve the Ethernet distance limitations for the Sprockets corporation, but it does have its drawbacks. For instance, if a lot of collisions are occurring in the corporate side of the network, they will be forwarded to the manufacturing network. Hubs, which are essentially repeaters with multiple ports, would be a more common solution to the Sprockets problem. A repeater is just a means for extending the existing network.
Bridging hardware
At the weekly managers meeting, Mr. Spacely Sr., Spacely's father, who is also VP of manufacturing, expresses his concern for the numerous network outages his group is experiencing. The congested finance network in the basement facility is interfering with the manufacturing robots' access to the Oracle database servers in the family room. The VP of IT decides it is time to segment the corporate networks with layer-2 bridging devices.
|
Bridges use MAC addresses to handle traffic flow. A bridge can also filter by MAC address, a feature that makes the bridge more attractive than a repeater. This style of filtering on Ethernet is called transparent bridging
.For the Sprocket network a filter can be set in place to keep the chatty corporate frames off the manufacturing and database server network segments. Likewise, in the event bad frames are blasting across the corporate network, the transparent bridging will not forward these to other network segments.
Bridging hardware has ports on it, called an interface, where a network segment connects. Filters are handled by software in the bridging device. The bridging cache maintains a MAC address table, similar to an ARP cache, but includes a database of which interface on the bridge the MAC address resides on. This table is crucial for the filtering software.
If an Ethernet frame contains a source MAC address (SA) and a destination MAC address (DA) from a network segment on the same interface, then the frame is not forwarded to the rest of the network. The bridging software can make this distinction by using the MAC address and interface lookup table.
Local and remote bridging
Layer-2 bridging hardware is primarily used for two distinct topologies: local and remote bridged networks. The Sprocket LAN is an example of a local bridging topology. The bridge is used for connecting multiple networks into one big network.
A remote bridge topology is used when two networks are separated geographically. For instance, Sprockets may wish to extend its network to cousin Fred's machine shop in another state. Fred may require access to the database server for quality assurance and ISO 9000 certification. The Sprockets LAN can be extended with bridging hardware and a few leased lines from the phone company. Filters would definitely need to be in place for cousin Fred. You wouldn't want to tie up his two T1 leased lines with noise from the corporate office computers.
Frame flooding
When a bridge receives a broadcast from one interface, it will forward the frame to all interfaces. There are pros and cons to layer-2 frame flooding and bridging. For example, in cousin Fred's shop, floor robots' software may use broadcasts to update all the robots simultaneously with new instructions. This ensures that all robots receive the same notification and updates. The downside is that the finance network will be receiving the robot's frames since finance is sharing the same bridged network. The network can easily become overwhelmed.
The layer-2 switch
Five years have gone by since Mr. Spacely Jr. started Sprockets. It has now evolved into a large corporation with manufacturing partners in the Pacific island rim. Cousin Fred is VP of computer-integrated manufacturing as well as a proud recipient of CCIE, MSCE, and Linux certifications. All this to keep his manufacturing robots operating on a 7x24 schedule. Cousin Fred now has high-speed ATM WAN connections between his Uncle Spacely Sr.'s family room and his automated shop floor.
|
The family room, now a humble data center supporting finance, marketing, and engineering, has raised flooring and a climate-controlled environment for an IBM mainframe, five Linux servers, and two Windows 2000 servers. The family room, which Mr. Spacely Sr. aptly refers to as his hobby room, has a fast Ethernet LAN segment and a token ring network. Finance is wired into a token ring, to the data center mainframe, while the local manufacturing floor in the barn is the legacy 10-Base T Ethernet network. There are now mixed layer-2 media that must operate seamlessly.
Momma Spacely, the VP of IT, makes a bold move once more to introduce cutting edge hardware. She opts to use a layer-2 switch to connect her growing mixed-media network. A layer-2 switch is essentially a super bridging device. Instead of connecting via interfaces as Sprockets did with a bridge, the connection medium of a switch is a port, just like a port on a simple hub (repeater). Unlike a hub, a port on a switch can be configured to belong to a specific network.
The Sprocket corporate network is Ethernet using TCP/IP protocols. The token ring network is also using TCP/IP. However, token ring layer 2 and Ethernet layer 2 are entirely different frames. And don't forget cousin Fred's ATM WAN connection which uses LANE (LAN Emulation for Ethernet and Token Ring). The Sprockets network has a switch with interface cards that support all these styles of ports. The ATM switch is a special piece of hardware that works in conjunction with the layer-2 switch they use for the network. All this functionality is handled primarily at the hardware level of the switch.
VLANs
The primary layer-3 protocol in the Sprockets network is IP. The layer-2 protocols are a mixture of token ring, Ethernet, and ATM LANE. Our network-knowledgeable VP of IT decides to carve up her mixed-media and workgroup infrastructure into virtual LANs (VLANs). The physical ports of the layer-2 switch can be configured to belong to a logical network. Recall the MAC address table for the bridge we discussed earlier? Now a MAC address table is maintained with an associated VLAN. What the switch is doing is carving up the really big and flat network into manageable isolated network segments. Finance can have its own VLAN using token ring. Cousin Fred and his ATM LANE Ethernet traffic flows can be moved over to a manufacturing VLAN and so forth.
|
From the figure you can see that the Sprockets network topology is easily carved into three distinct virtual networks: manufacturing, finance, and a server farm. The technical definition of a VLAN is a virtual bridge that segments a physical broadcast domain inside of a switch. The rule of thumb is that one VLAN can not explicitly pass traffic to another. Therefore, finance traffic is now kept inside the finance token ring and Ethernet networks. Manufacturing has its own VLAN extended across an ATM LANE link. This is a good solution for managing the bandwidth, but a small problem has surfaced. How can users access the server farm if it's off on its own VLAN? The solution is a layer-3 switch, called a router, which we'll discuss in a future segment. The point that needs to be made is that the layer 2 switch will provide the ability to carve up your network into broadcast domains. To make these broadcast domains share traffic across VLANs requires a layer-3 switch (router).
Jumping through loops
The Sprockets corporation has experienced a wealth of prosperity in the past five years. The VPs at Sprockets have clearly understood the necessity of their network and have expanded it accordingly, to meet the demands of their business needs. The network certainly has come a long way since the original Macintosh client and single Intel server that once sat in the basement. The network isn't perfect yet; our heroine, Momma Spacely, the VP of IT, has added a significant amount of switches to her corporate network to accommodate the company's explosive rate of hiring. Now network path loops have surfaced and our IT warrior must come up to speed fast on the spanning-tree bridging protocol. Stay tuned for the next installment where we'll see how Momma Sprocket tackles the bridging protocol.
Michael J. Norton is a software engineer at Cisco Systems.
Ethernet Networking Explained
A Local Area Network (LAN) has been an essential tool for business computing for many years, and great fun for gaming for not quite so long. And setting up a basic small LAN is now a very easy task. But networking catalogues are full of bridges and switches and hubs and routers, making it hard for the beginner to figure out what's going on. What do you need, and what do you not?
This Web page will tell you. The first half is the stuff you need to know to knock together a basic Windows network for playing games or ordinary small business use. It tells you how the common kinds of Ethernet differ, and what to do to make your network work and keep it working. After that, there's the more technical information for people who are working with larger networks, or are just curious. Jump to the technical stuff.
Three flavours
This document will deal only with the three most popular kinds of PC networks, 10Base2, 10BaseT and 100BaseT. A number of the terms used here have different meanings when applied to older and more esoteric networking systems, but only these three flavours are currently in use for home and small business – and, often, large business – applications.
10Base2 is also called thin Ethernet or "cheapernet". 10BaseT looks to the computer like 10Base2, but offers more flexible layout. Both of these are Ethernet; the term refers both to the kind of cable used in a network, and the kind of signals sent on the cable. 100BaseT is a ten-times-faster version of 10BaseT, using the newer "Fast Ethernet" system.
The "10" in the names of the two slower flavours of Ethernet indicates that these versions have a signalling speed of 10MHz, giving a maximum useful data throughput, from the user's point of view, of about half a megabyte per second. 100BaseT uses 100MHz signalling and is commensurately faster. The "Base" in the names means they're "baseband" networks, which means that they have only one channel for data transmission, so only one device can transmit at a time. This is important; as baseband networks get more and more machines on them, it's more and more likely that two machines will try to transmit at once, causing a "collision". After a collision, the machines that caused it each wait a brief randomly chosen period of time and try again. This means that even severely congested baseband networks still work, but they get slower and slower as more and more machines are added. Special devices like switches, bridges and routers exist to deal with this problem.
The "2" in 10Base2 indicates the maximum segment length in hundreds of metres – the maximum aggregate length of cables you can use, with up to 30 computers connected, before you have to start using routers, bridges or switches, of which more later. In the real world, the maximum reliable 10Base2 segment length is 185 metres.
Just to be awkward, the "T" in 10BaseT and 100BaseT has nothing to do with cable lengths; it indicates that these systems use unshielded twisted pair (UTP) telephone-type cable, against the "RG-58" 50 ohm coaxial cable used by 10Base2.
Cables and connectors
Coaxial cable, as used in 10Base2, has a single centre conductor covered with a layer of insulation, a braided and/or aluminium foil second conductor and then the outer jacket. It's used in various versions for all sorts of high frequency applications. The old thick "10Base5" Ethernet cabling has lower loss than RG-58, and is much thicker, much more expensive and much less flexible. It's technically incompatible with 10Base2, but will generally work and can be used in a pinch.
The "twisted pair" cabling used for 10BaseT uses pairs of conductors twisted around each other to reduce susceptibility to induced currents. 10BaseT uses unshielded twisted pair (UTP) cabling, which is cheap, and comes in different "levels" or "categories"; the higher the category, the better the data carrying ability. Level 3 cable is all 10BaseT requires, though many current installations are using Level 4 or Level 5 in anticipation of faster network standards in the future.
10BaseT does not have a distinct maximum cable length – 100 to 150 metres is the generally accepted limit, but high grade low loss cable can extend this. This maximum length is the distance each computer can be from its hub, not the total cable length in the system, so a single $200 17-port hub makes it easy to cable up a good-sized office.
| "RJ-45" stands for Registered Jack 45. "BNC" variously stands for Bayonet Navy Connector, British Naval Connector, Bayonet Neill Concelman, or Bayonet Nut Connection, depending on who you ask. |
10BaseT's dual-twisted-pair cables have RJ-45 modular connectors at the end. RJ-45s look similar to the RJ-11 modular telephone connectors which are valiantly attempting to replace the antiquated giant Australian phone plugs, but have eight pins instead of the RJ-11's six. 10Base2's twist-on BNC connectors violate the standard rule of computer connectors which states that they should snag as many other cables as they can when pulled through a mess of wiring. Fortunately, most RJ-45's redress the balance; the plastic clip on the back of the connector is not only very good at catching other cables, but impressively fragile as well, and a broken clip renders the connector very unreliable.
BNCs, however, can be very unreliable when not obviously damaged at all. Frequent plugging and unplugging can make the centre pin terminal a loose fit, and corrosion can also cause problems. RJ-45 connectors at least generally LOOK wrong when they're broken.
Setting it up
The step by step procedure for installing a basic small business or game-playing LAN is now, usually, very simple – install your network cards like any other card, hook up the cable, and as soon as your operating system knows about it, it works. In Windows 95 or 98, all you've got to do is make sure you've got your workgroup name set the same as that of the people you want to connect to, and that all the computers on the network share at least one network protocol.
About the only problem you're likely to have in setting up a small network is making the cards work – a standard NE2000-compatible network card needs an IRQ and a few I/O addresses, and setting one up on a packed machine may require some resource juggling. This, however, is not a problem peculiar to networks, and since you can now get dirt cheap Plug and Play network cards, setup is often effortless. (If it's not, check out my Step By Step column on troubleshooting Plug and Play problems, here.)
There are, however, some basic facts about networks which it helps to know.
Topology?!
Topology is, for network purposes, the layout of computers and cables and other gadgets in the network. The basic topology for 10Base2 and 10BaseT is simple.
A 10Base2 segment (a segment, in this case, is a network with no bridges or switches or other fancy devices in it) contains two or more computers, each with a network card (NIC) fitted with a T-piece which accepts two network cables, or a network cable and a 50 ohm terminating resistor. Each end of the network must have a terminator and a cable connected, and everything else has two cables connected. The T-piece must go right on the network card – you can't use extension cords between the card and the T-piece.
You can take a computer out of the network by disconnecting its T-piece from the network card, leaving the cables connected to the T-piece's two arms. Disconnect in any other way, or remove either terminator, and the network stops working until you plug it back together. Every machine has to be at least 50 centimetres of cable away from every other machine, too.
| How to wire a 10BaseT crossover cable, for connecting two, but only two, machines together without a hub. This is the same kind of cable that is used to "cascade" multiple hubs into one network. The pin numbers are as you look at the contact side of the plug, with the cable running away from you. |
10BaseT, on the other hand, requires a special piece of hardware called a "hub" if you want to use more than two computers. Two machines can hook together with a simple crossover cable, but otherwise every machine on the network must have its own single lead to a port on the hub, which must therefore have enough ports to support the number of machines you wish to network. Multiple hubs can be connected together to allow larger networks; see here for more information on hubs.
Both approaches have their pros and cons. Both offer really, really cheap network cards – $40 (Australian dollars) gets you a vanilla NE2000-clone card with both 10Base2 and 10BaseT connectors. And, for 10Base2, that's pretty much where the spending stops; the network cards come with T-pieces, so all you need are enough cables and a couple of terminators, and you're in business.
For 10BaseT, you have to buy a hub as well, and this will set you back about $100 for a five port hub, or around twice as much for 17 ports. 10BaseT hubs are available in various sizes and can be "cascaded" to add more ports to your network.
So why should you bother with 10BaseT? Well, in the 10Base2 configuration, one dud cable, dodgy T-piece, duff terminator or poor connection makes the whole network stone dead until the defective component or connection is fixed – or, worse yet, just interrupts the network every now and then. Intermittent problems are the most annoying. Finding the defective component in 10Base2 is a process of elimination – you just start somewhere, anywhere, and then "divide and conquer" – cut the network in two and reterminate the two halves, then see which half still has the problem and divide it again, and so on, until you locate the source of the failure.
In 10BaseT, on the other hand, one bum cable or network adapter will only remove one machine from the segment. A dead hub will kill the network for every machine directly connected to that hub, but hubs are much more reliable and less prone to accidental damage than 10Base2 cables, T-pieces and terminators.
Repeaters, routers and hubs – the basics
Each 10Base2 segment can only be 185 metres in length, and can only accommodate 30 computers. For many applications, this is fine, and so you can get away with a $40-or-less network card in each machine and a few ten buck cables. But 185 metres can be used up surprisingly quickly in standard into-the-wall-and-up through-the-ceiling cable installations.
If you need more length, a repeater lets you join 10Base2 segments together. The Ethernet spec allows for up to four repeaters in a network – which, for the mathematically disinclined, means five segments – but only three of these segments can be "populated" – have computers connected to them. So your maximum 10Base2 cable length using repeaters is 925 metres, with 555 metres of that being useable for up to 90 computers.
This rule applies to 10BaseT, as well, because every 10BaseT hub acts as a repeater. This can result in rather complex layout diagrams, but the basic rule is easy to remember – the path between any two computers must not include more than four repeaters or hubs, or more than three populated cable segments.
Having 90 computers connected via Ethernet, though, is not a good idea unless each of them doesn't use the network much. With only 10 megabits per second shared between 90 machines, all of them trying to move data at once gives each computer a theoretical maximum bandwidth available to it of about 14 kilobytes per second. Since there'd be collisions galore from all that simultaneous chatter, the real bandwidth would be much lower, and the network would grind to a halt.
What you need to do to cut down the chatter is either increase the total shareable bandwidth by switching to Fast Ethernet (which won't actually help all that much if you've got 90 computers talking at once; the network will probably still be painfully slow), or chop the network up into smaller segments, with traffic only escaping a segment when it's actually addressed to a computer on the outside. Dividing your LAN up like this is called "internetworking", and allows big networks to be both faster and physically larger, as it overcomes the maximum cable run problems.
To get around the maximum number of repeaters problem, you have to use bridges. Bridges are more expensive than repeaters, but they let you extend your network without breaking the rules, by intelligently filtering and forwarding data based on the machine it's intended for – the bridge has enough brains to know what machine addresses are on each side of it, and block the passage of traffic addressed to a section of network which does not contain the intended recipient of the data. When calculating legal routes, you can reset your repeater count to zero if the data path goes through a bridge. The Ethernet specification allows no more than seven bridges on a network. Bridges can have multiple ports, and so connect to more than two network segments; by using multi-port bridges, you can build huge networks, because each collision domain can have up to 1024 nodes on it. In practice, any normal computers will generate enough network traffic that 1000 computers in one collision domain will hopelessly clog the network, but if they're really, really quiet, you can do it.
Routers are like bridges, only more so. They do the same data filtering, but can also connect completely different networks to each other, allowing, for example, an office network to be connected to the Internet. With the use of routers, there's no practical limit to how many machines you can network together.
Setting up Windows networking
One of Windows 95’s big selling points was that it finally made PC networking simple enough for anyone to set up. Provided your network card is correctly addressed by Windows – an automatic procedure, for current Plug and Play cards – all you have to do is add the network protocols of your choice in Network Properties.
Windows 98 doesn’t change much in this department. If you’ve set up 95’s networking, you can set up 98’s. Once your network card is working with Windows, add the clients and protocols you need in Network Properties (accessible from Control Panel, or by right-clicking the Network Neighbourhood icon and selecting Properties). For most small business networks and Internet access, all you’ll need is the Client for Microsoft Networks, the NetBEUI protocol for your network card and TCP/IP for your Dial-Up Adapter; you only need to install the first yourself, since the Internet Connection Wizard takes care of the dial-up stuff.
NetBEUI is a fast protocol that works well on networks with fewer than 50 machines, which covers the majority of situations. If your network uses IPX and/or TCP/IP, install them for your network card too; if you only want them for multiplayer gaming, turn off all of the bindings in their Properties windows, and say no to the dialogue box asking if you’d like to change your mind. The bindings let Windows use these protocols for regular network communication as well as the raw data transfer the games want, and redundant bindings slow down your network.
If you’ve got a Windows 95 computer with TCP/IP set up for its network card and leave it on the default "automatically obtain an IP address" setting, the network the computer’s connected to must have what’s called a Dynamic Host Configuration Protocol (DHCP) server connected to it to dole out an address. Without such a server, any 95 machines without addresses will fail to communicate over TCP/IP, and will furthermore slow the network down as they periodically yodel down the wire, hoping a server’s shown up.
Windows 98 does a bit better than this. Machines set to automatically obtain an address which don’t find a server will give themselves an address in the "LINKLOCAL network" IP address space, which means an address starting with 169.254 and with two more arbitrary numbers on the end. The LINKLOCAL space is a "class B network", which means the network ID is the first two numbers. All 169.254.X.X computers can see each other provided they each have a different combination of the last two numbers, and since the last two numbers can be from 0 to 255 and from 1 to 254 respectively, up to 64,515 computers can be on this network at once and address clashes are unlikely.
169.254 addresses are not, however, valid for networks connected to the Internet. Rest assured that calling your ISP and connecting with TCP/IP for the Dial-Up Adapter does not constitute "connecting to the Internet" in this sense.
Earthing 10Base2
Got a 10Base2 terminator with a little dangly thing hanging off it? It's a ground chain – or strap, or wire. If you screw the lug at the end of the chain, strap or wire to the chassis of the computer with any convenient mounting screw, you earth the shield conductor of the network cable.
This may or may not be a good thing.
The 10Base2 spec says the network "may" be grounded in one (and ONLY one) place, and doing this may reduce network errors. Grounding the network in more than one place WILL cause errors and may damage equipment thanks to potential differences between different "grounds". So don't do that.
This is especially bad if you run a 10Base2 cable between buildings, which is something you're not meant to do. Different buildings often have markedly different earth potentials, and if the cable's grounded at both ends, a hefty current can flow through the shield, causing lots of network errors and, possibly, starting fires. If some hapless person at the other end unplugs the network connector, or even just touches it if it happens to be grounded at the far end but not the near one, they can receive an electric shock.
If your network works fine without grounding, there's no need to change. If it's grounded and you're getting errors, try ungrounding it, or grounding it at the other end.
If your network has a repeater on one end of a segment, it probably automatically grounds that end. So don't ground the other one.
That's it for the basic stuff...
...now here's the more complex info.
How much is a megabit?
Computer-savvy people know that the kilo-, mega- and giga- prefixes, in computer usage, don’t mean 1,000, 1,000,000 and 1,000,000,000, as they do normally. Computers use binary arithmetic, so everything’s in powers of two, and the three prefixes indicate 1,024, 1,048,576 and 1,073,741,824 – two to the power of ten, two to the power of twenty and two to the power of thirty, respectively. Easy, right?
Well, sometimes.
RAM (Random Access Memory) is specified in these "proper" megabytes; a 64 megabyte RAM module has exactly 67,108,864 bytes of storage space, disregarding error-checking bits, if they’re present. But when it comes to hard disk sizes, manufacturers tend to specify their drives’ raw (unformatted) capacity in nice round millions and billions of bytes. Unfortunately, they call these measurements "megabytes" and "gigabytes", in order to make their drives sound bigger.
So a "6.4 gigabyte" hard drive actually has a capacity of about 5.96 real gigabytes, before you format it and lose another few per cent. You can thank the marketing people for this.
And now to network speeds. Data communication is specified not in kilobytes and megabytes, but kilobits and megabits per second – kBps and MBps, respectively, although there’s terrible inconsistency in the use of the upper and lower case "B" to indicate bits and bytes, just to annoy you further.
A bit is one-eighth of a byte – nobody’s ever decimalised the byte, because making it 10 bits would make things look smaller and slower, which the marketing people find less attractive for some reason. So, logically, you’d expect one megabyte per second to be eight megabits per second, right?
Ha! No such luck. Like hard disk capacities, network speeds are expressed in round numbers, not powers of two. A "64 kilobit" ISDN line moves exactly 64,000 bits per second, or a megabyte (the real kind, not the hard disk kind) every two minutes and eleven seconds. "10 megabit" Ethernet is good for exactly ten million bits per second, or 1.192 megabytes per second. And so on.
Bridges, switches and routers in detail
Once upon a time, you could point to a gadget that hooked network segments together and say, with confidence, what it was. Well, so I’m told, anyway. Today, there are all sorts of devices designed to move data from one network to another, with all kinds of fancy features, and their names are a highly unreliable guide to what sort of device they actually are. The three basic categories of network-joining device are switches, bridges and routers, but those definitions blur into each other so much that defining them separately is impossible. The words mean different things to different companies. You just have to look at the specification sheets and decide whether a given device is what you need. Here’s how to tell.
Bridges
A bridge, officially, is a stand-alone device or specially configured computer that connects different LANs, and allows them to act as segments of one LAN.
A bridge can only connect networks which are using an identical network protocol, like, for example, Ethernet. A bridge with appropriate connections can connect networks which are using the same protocol on different kinds of connection – bridges that have a collection of 10BaseT ports and a 10Base2 coaxial connector are common, for instance. But, canonically, if it can connect networks of different kinds, like Token Ring to Ethernet, it isn’t a bridge.
Since bridges only operate at OSI Layer 2, they cannot connect network segments which couldn’t be connected WITHOUT the bridge there, disregarding media differences. If you’re talking TCP/IP, that means that all segments connected to a bridge must have the same subnet mask – the second xxx.xxx.xxx.xxx number, subsidiary to the IP address, which determines what subnet a computer is on. Computers on different subnets can’t see each other.
Bridges, unlike simple repeaters, do not retransmit a frame until they’ve received the whole thing. This means devices on either side of a bridge can transmit simultaneously without causing collisions, and so you can use a bridge to segment a network into smaller chunks to reduce collisions and improve performance. This, indeed, is the major function of the bridge – chopping up big ungainly networks into smaller "collision domains", so the overall chatter level doesn’t bog the network down. The tiny single frame delay introduced by the bridging system is a small price to pay.
All modern bridges are "learning" bridges. This means they have the ability to figure out, by looking at where data are coming from, what machines are connected to which of their ports. They can therefore restrict packet retransmission to only the port they know connects to the network node to which the frame’s addressed. If a frame isn’t addressed to a machine the bridge knows about, it retransmits it on all ports except the one it came from, because everything on the segment the frame came from heard it at the same time the bridge did. If a given address doesn’t transmit for a given period of time, the bridge removes it from its address table, so as not to fill its table (which has a limited size) with addresses for machines which may not necessarily even be on the network any more.
Bridges can even handle being connected up in loops. If this situation were left uncorrected, it would cause instant and hopeless congestion as every bridge retransmitted every packet to every other bridge in the loop, and then got it retransmitted back, ad infinitum. The bridges deal with this by arranging themselves into what’s known as a "spanning tree"; they very quickly shut down connections between bridges until all of the loops are eliminated. This allows redundant network wiring; if one cable is cut, the bridges sort out the problem and create a new tree using a previously ignored cable.
Switches
A switch is, essentially, a bridge with knobs on. Or a really smart kind of hub. Or, in its simplest form, maybe just a multi-port bridge. Essentially, switches are a creation of marketing departments; there may be some under-the-surface differences between them and previous devices, but from an operational point of view they’re the same as earlier bridges and routers, only faster. Perhaps. A LAN with a switch joining its segments is referred to as a "switched LAN".
Like a bridge, a switch connects networks and filters packets, only sending on packets to a given network segment if they’re addressed to a device on that segment. Also like a bridge, your basic switch operates at OSI Layer 2 – it cannot change the data it’s sending, to route information from one network flavour to another. Everything connected to a Layer 2 switch has to be configured as if it were on the one network – like a bridge, these switches can only connect network segments that could be connected anyway, as far as the computer settings go. Each port on a switch can support a whole LAN or a single station. If only one station is connected to a switch port, it is said to have a "dedicated LAN".
Classier switches can do Layer 3 routing, and are thus called "Layer 3" or "Multi-layer" switches. They can connect network segments on different subnets, by routing between them. They can also create "broadcast firewalls" between ports or groups of ports (and, thus, between any devices you attach to those ports). These groups are called "bridged groups" or "virtual LANs", and each behave like a bridged network. This allows devices on one Virtual LAN to use one IP subnet (or IPX network number, or Appletalk network number range), and devices on others to use other setups. If the switch is smart enough, it can give each virtual LAN access to the others as if it were a router.
But, remember, all sorts of things are called "switches" these days. Bear in mind that something referred to as a switch can also fairly be described as a bridge or a router.
Switching, the underlying technology that gives switches their name, can be done in two basic ways – cut-through and store-and-forward. Cut-through is the newer technology whose introduction, as much as anything, can be said to have spurred the creation of the "switch" as a distinct gadget. Cut-through switches do nothing but look at the MAC addresses of the frame headers and forward the frames accordingly. A cut-through switch doesn’t care if the packet inside the frame is valid or not, and so it will cut network traffic when all is well, but won’t prevent malfunctioning software or hardware from paralysing the network with tons of rubbish packets. Cut-through forwarding is impossible between media of different speeds, so switches which support, say, 10BaseT and 100BaseT, do not use cut-through when data moves between ports of different speeds.
Store-and-forward switching is the older way of doing it. It actually looks at the packets before sending them on, which means the packets stay in the switch a little longer, but broken ones are weeded out. Under high loads, cut-through switches buffer data and hence run no faster than store-and-forward ones, but they’ve got a slight performance edge in normal operation.
An overloaded switch can make network congestion even worse than it would be without the switch, in some cases. If the switch is receiving data for a given port faster than it can pump it out of that port, it will buffer the data until it runs out of memory and then start dropping packets – throwing them away. The machines sending the data don’t know that it isn’t getting through until the network protocol sorts it out – fragmentary data causes receiving machines to request resends. This is worse than a plain old collision, because in a collision situation all of the sending machines know about the problem at once and resend practically immediately, whereas the resend requests created by a choked switch have to traverse the network path back from the receiving machine to the sender before anything can happen.
Routers
A router is a device that connects networks together, like a bridge, but is a great deal smarter. Routers operate at OSI layer 3, which means they understand both logical and physical addresses when moving data around, unlike bridges, which work at layer 2 and only understand physical addresses.
Routers analyse incoming packets and modify them, if necessary, so they’re redirected to another router or to their initially intended destination. This allows routers to send packets from one kind of network across another kind of network on their way to a destination network which can be of yet another kind, via more routers if necessary. As long as the routers know what computers live where, they can figure out the necessary route themselves.
Routers maintain a database of addresses which allows them to correctly route data among the hundreds of millions of in-use addresses accessible via the Internet. The can do this because their ability to send data to other routers lets them pay attention only to the "network number", the part of the address that indicates the network to which the computer they’re sending data to is connected, and ignore the details of the "host number", the exact machine they’re aiming at. The router at the other end can handle getting the data to the exact right machine; the sending router only has to get it to the right network.
Routers further reduce the number of addresses they need to know about by "summarising" entries together when a lot of addresses share the same route. Typical Internet routing tables contain only several tens of thousands of routes, rather than the hundreds of millions a "dumb" routing strategy would require.
It is this ability that makes routers the life-blood of the Internet, and similarly important to many other networks, but it also makes them slower than "layer 3 switches", which can generally only do limited routing within the devices directly connected to them, and do not understand multiple layer 3 protocols.
A truly "Internet-capable" switch has full routing abilities in addition to the quick address lookup capabilities of a regular switch. If it has to send data to somewhere it hasn’t recently received data from (the arriving data bringing with it routing information for replies), the switch behaves like a router. This requires much more processing power than switching and is thus slower. "Slower" in this case is a relative term; router-speed operation, even from older and cheaper models, can still provide packets much faster than a T-1 line (1.544 megabits per second) can handle. These cheaper routers’ speed of operation roughly matches the available throughput from a T-3 line (43 megabits per second). Routers are getting faster every year, too; top-of-the-line products can handle a great deal more data.
There is only any point in using a switch/router like this if some large percentage of the network traffic comes from the same places over and over again – local addresses, in other words. A switch connected to the Internet for public access as well as to a local network must also be able to preferentially cache routes to local addresses, or its address table will be rapidly filled with useless once-only Internet access routes from Net surfers.
Routers can communicate with other routers to provide better traffic management and avoid slow connections; they can, together, determine the best route through a complex WAN. Many routers are used for Media Access conversions – linking networks with different physical connections as well as different Layer 3 protocols, like for example Token Ring and Ethernet. Many routers also support scads of Layer 3 protocols, but they don’t have to in order to qualify as a router.
Some network protocols are inherently unroutable – SNA (IBM’s Systems Network Architecture, originally a set of mainframe networking protocols), NetBIOS (Network Basic Input Output System, the basis for Microsoft’s popular NetBEUI) and LAT (Digital Equipment Corporation’s Local Area Transport protocol), for instance, none of which have the innate ability to work with routers. Some of these, like SNA and NetBIOS, can sort-of-kind-of be routed by being "encapsulated" inside other, routable protocols, but these solutions are slow and inelegant. Modern routers can work wonders at integrating disparate kinds of network, such as tend to develop in large companies, but the elimination of excess protocols is still highly desirable to make management simpler, even when every protocol on the WAN is routable.
"Static" routers must have their routing tables manually updated. "Dynamic" routers build and update their own tables.
Bandwidth, and how to get more of it
A network’s bandwidth is how much data it can move per second. In a plain 10 megabit Ethernet LAN, that bandwidth is, unsurprisingly, ten megabits per second, or a bit more than a megabyte per second. The actual amount of real data throughput is considerably lower, because a lot of bandwidth is taken up by the extra formatting information tacked onto the data to be sent. But if you just look at the bits being sent, the total number per second, assuming no collisions, is ten million (if you’re wondering why this is a round number and not a power of two, check here).
Things get more complicated when you start playing with bridges and switches on larger networks. Both of these devices, after a brief learning period, forward traffic only to network segments that actually contain the computer to which the traffic is addressed.
Depending on the network, you may get a larger performance gain from segmenting a 10 megabit network than from upgrading it to 100 megabit.
If you have a 10BaseT network with, say, 32 computers on it, you could add an eight port bridge or switch with a four port hub hanging off each port. This chops the network into eight segments of four computers each, which means that each computer can yammer all it likes to its three segment companions without cutting into the 10 megabit bandwidth of any of the other segments at all. If a given computer DOES talk to a machine on a different segment, it will only take up bandwidth on those two segments, leaving half of the network untouched.
Segmented networks can therefore offer impressive "aggregate bandwidth" – the total amount of data that can be moved around the network by various machines talking to each other at once. High aggregate bandwidth does not, in this case, indicate higher bandwidth available to any one network conversation. But this is usually OK, as for most operations the transfer rate provided by a 10 megabit network is adequate, provided you can get most or all of it for yourself.
If two machines conduct a 10 megabit conversation between two ports on the bridge or switch that segments this 32 computer network, and another two conduct a similar conversation on each of the other three pairs of ports, the network will be saturated (any extra traffic will produce collisions and slow the LAN down) and an aggregate bandwidth of only 40 megabits per second will have been achieved. On the other hand, if computers on the network happen only to talk to other computers on their own segment, the lack of inter-segment network pollution means the aggregate bandwidth available will be 80 megabits per second. The worst case scenario arises if three segments all want to talk to the fourth at once; in this situation they have to share the fourth segment’s bandwidth, and the network’s aggregate bandwidth drops back to 10 megabits per second.
In this situation, an eight-segment 10MBps network clearly offers significantly less bandwidth, under all circumstances, than an unsegmented 100MBps LAN. But if you double the number of segments to 16, so each one serves only two computers, the aggregate bandwidth figures in the above examples jump to 80 and 160 megabits per second respectively, and the chance of everyone concentrating on one segment falls.
If there’s one computer that commonly attracts lots of traffic – a file server, for instance – that one computer can be given a segment to itself, and can even be given a 100BaseT network card and be connected to a 10/100MBps dual-mode switch or bridge. This gives the high-demand computer a dedicated 100 megabit connection, probably full duplex, to the whole of the rest of the network, even though any given other computer can only move ten megabits per second. If the 31 other computers all try to access the file server now, they’re sharing 100 megabits per second between them instead of 10, and will still receive data at a decent rate. Because bridges and switches prevent collisions between traffic originating on different network segments, if ten 10MBps computers simultaneously request data from the 100MBps server (and everything else happens to shut up), they’ll each get data about as fast as their network cards can handle it, without a single collision. They will, in fact, perform just as well in this situation as if they were networked to the server with 100BaseT all the way.
When there are no switches or bridges or routers to worry about, but only repeaters (remember, a standard 10BaseT hub is a repeater), network performance is easy to work out. Everything shares. It’s not quite as simple as that – in a collision situation NO data gets sent by anyone, so when the network is saturated the total useful throughput is less than the total bandwidth of the network – but at least it doesn’t matter who’s talking to who. A given number of connections will result in a given aggregate bandwidth.
Another important factor is the internal or "backplane" bandwidth of your bridge or switch. To avoid causing bottleneck problems at moments of high network use, you need a backplane bandwidth equal to the aggregate bandwidth of all of a device’s ports. If a bridge, switch or router has this much backplane bandwidth, all of its ports can be operating at full speed all of the time, and the "data pipe" inside the device is wide enough to let all of the data through.
Other definitions
ATM: The modern heir to packet switching and circuit switching, Asynchronous Transfer Mode aims to provide the efficiency and fault-tolerance of the former and the guaranteed delivery of the latter. Today’s network switches are the technological precursors to ATM; switches work with relatively large data packets of variable length, whereas ATM uses small, equal-sized "cells" of data and promises far greater speeds than current LANs over short or long distances. ATM looks, to the connected machines, like a circuit switched system – when they want to transfer data, nothing can impinge upon the 51 or 155 megabit per second pipe assigned to them. The ATM system installed has to be fast enough, of course, to handle as many concurrent pipes as are needed.
Broadcast: A "broadcast packet", in Ethernet, is a packet that will be received by every node on a LAN – it’s not addressed to anyone in particular, but to everyone in general. This leads to the concept of the "broadcast domain", which is every node that will be reached by a broadcast from any given node. Routers segment broadcast domains – broadcast packets don’t get past them.
Bus: A kind of network topology. The bus configuration, as used by 10Base2, has all of the devices on the network connected in parallel to one cable. This "cable" is really made up of separate cable segments joined at the T-pieces, but electrically speaking it can be treated as one wire. Any computer can be disconnected from this bus without affecting connectivity for everything else, but if the cable is interrupted anywhere, the whole network goes down.
Category: Twisted pair cable such as is used by 10BaseT and 100BaseT is available in various specification levels or "categories". 100BaseT requires Category 5 cable, often referred to as "Cat 5". 10BaseT will work with lower grade, thinner cable, but a lot of installers use Cat 5 cable anyway because it costs little more and makes it easy to upgrade. Make sure the cable you use really is Category 5 cable, not just something labelled "Category 5 quality".
Collision: When two devices on a baseband network like Ethernet try to send data at once, they talk over each other and cause a collision. When a collision occurs, every device that’s trying to send data pauses for a brief, random period and tries again. This simple system works less and less well as you get more and more computers on a network, which is why segmenting big networks with bridges and/or switches is a good idea. Bridges and switches are thus said to segment the "collision domain"; the group of nodes with whose transmissions it is possible for a given node’s transmissions to collide.
Duplex: In computer communications, there are three kinds of connection between two devices. The first is simplex, in which data can only flow one way. Half duplex is the system used by regular Ethernet; data can flow either way, but only one way at a time. Full duplex allows data flow in both directions at once. Ethernet supports full duplex operation, but only between two devices over twisted pair cables. Regular 10BaseT or 100BaseT cable has two physical pairs of wires in it, which in full duplex operation can be used for full bandwidth data transfer in both directions – one wire pair per direction. This works because when there are only two devices involved, so collisions are impossible. The second wire pair is normally needed for collision detection.
Full duplex doubles the aggregate bandwidth of a connection, but doesn’t greatly increase performance unless both devices send a lot of data. Many network transactions involve a lot of data going one way and only a little going the other, so there’s not much performance difference.
Hub: A hub is a common connection point for network devices. The simplest form of hub is completely passive – it contains no electronics, it’s just a collection of connected ports, and exists only to make wiring more convenient. This sort of hub doesn’t work with 10BaseT or 100BaseT Ethernet, and isn’t very practical for larger 10Base2 networks because of 10Base2’s rather limited segment length.
These days, when someone talks about a "passive" hub they probably mean one like the currently available cheap 10BaseT models. These hubs act as a simple repeater – they copy every packet received at any one of their multiple ports to all of the other ports, which keeps every hub-to-computer connection as a separate network segment.
The most common kind of hub used in small networks is the "stand-alone" variety. Despite their name, stand-alone hubs can usually be connected together with regular twisted pair cable or thick 10Base5 coaxial, so you can add more ports to your basic hub if your networking needs grow.
"Intelligent" or "manageable" hubs include features so an administrator can monitor traffic and configure, enable and disable the ports remotely. They still just copy everything they get to everywhere. The cheap 10BaseT hubs in your local computer store are probably NOT manageable, which is OK for small networks where no user is likely to be more than a 30 second walk from the hub anyway. If you’ve got hubs, bridges, switches and routers all over the place, though, being able to immediately see what’s stopped working is an obvious advantage.
"Stackable" hubs are designed from the outset to be linked together, and when you link them they act as one unit for management purposes. Linked stand-alone hubs don’t do this. Stackable hubs provide a cost-effective option for businesses starting with a medium sized network but with higher aspirations, since many models allow you to include just one more expensive manageable hub in the stack, and have it provide management access to all of the others.
The next step up the ladder, only of interest to builders of large networks, are modular hubs. These use one chassis or "card cage" into which cards, each of which provides several hub ports, are installed. The cards are cheaper per port than stackable hubs, because the power supply and casing are provided by the chassis. Cards can be installed for various different network types as needed, and a management unit may or may not be installed, according to preference.
"Switching" hubs are smart enough to know what devices are connected to what ports (figuring it out in the same way as learning bridges), and only copy packets addressed to those devices, and thus act as a limited kind of bridge – they work like a bridge, but they only have one device connected to each port.
To avoid or at least reduce confusion, the actual word "hub" is generally only used when you’re talking about Ethernet wiring. If you’re talking token ring networks instead, you should call call the conceptually similar token ring device a "multistation access unit", or MAU.
MAC address: Every node on a network has a Media Access Control address, which uniquely identifies it. On Ethernet networks, every computer’s network card has a unique MAC address. Blocks of MAC addresses (the addresses are 48 bit numbers, so there are more than 281 trillion of them available) are assigned to network card manufacturers and used sequentially, the result of which should be that no network card has the same MAC address as any other. In the real world, things like reprogrammable cards can result in two machines with the same address on one network, which can cause problems utterly mystifying to the network novice. These problems are, fortunately, extremely rare. MAC addresses are the identification system used by OSI layer 2.
Network Interface Card: Normally shortened to NIC, this is the technical term for what everyone else just calls a network card. The NIC is the board you put in your computer so you can connect the computer to a network. They’re almost always made for a particular kind of network and media, although Ethernet cards commonly have connectors for 10Base2 and 10BaseT, and may also support 100BaseT.
Node: The correct word for a processing location on a network. Things other than computers can be connected to networks – printers, traffic handling devices and so on. Every node has a unique hardware address – see MAC address.
OSI layers: The seven Open System Interconnection layers are the International Standards Organisation networking framework definition. Fortunately, users don’t need to know anything about them, except that the lower the layer number, the closer you are to the hardware. In network communication, control passes from the higher levels to the lower ones at one end, over the network connection to the next network station, and back up the levels again. All seven layers put together make up the entire network system from your application software to the wires, and how each layer actually works in the real world is defined by a plethora of other protocols. For example, Ethernet and Token Ring are two different ways of providing the services defined by OSI layers 1 and 2, the Physical and Data Link layers.
OSI layer | Name | Function |
| 7 | Application Layer | Communication between programs. This is the layer that user programs talk to. |
| 6 | Presentation Layer | Data representation conversions; this layer translates data, between what the network requires and what the computers at each end expect. |
| 5 | Session Layer | Establishes and maintains communications channels, so program on different computers can establish a link. Often combined with the Transport Layer. |
| 4 | Transport Layer | Responsible for end-to-end data transmission integrity. Makes sure that the data actually gets there, with no errors, in the right order, regardless of transmission problems. |
| 3 | Network Layer | Routes data from one network node to another. This layer translates "logical" device names and addresses into their network hardware equivalents, and does routing, if necessary, for devices that are more than one network link away. |
| 2 | Data Link Layer | Takes care of moving data from one network node to another, not more than one link away. |
| 1 | Physical Layer | Translates the bits generated by all the other layers into signals to send through the network, and translates them back into bits at the other end. |
Packet: A chunk of data transmitted over a packet-switching network. Packet-switching is any protocol in which data is broken up into these packets and can then follow various routes to its destination – different packets which together comprise one message may travel via different paths and are assembled when they arrive. Packets therefore, of necessity, contain a destination address as well as the data to be transmitted. Packets are often confused with "frames"; frames are the data structures used by the physical network hardware to move the data. Information that needs to be sent is parcelled up into a packet by the computer, and the packets are parcelled up by the network hardware into frames.
Packet switching, as used by the TCP/IP protocol on which the Internet is built, can be compared with simple "circuit switching", as used by the phone network, where a dedicated link is established from point to point whenever one device needs to communicate with another. Circuit switching is faster, works with much lower-tech equipment and guarantees that data will arrive in the same order it was sent, important for live audio and video. Packet switching is more efficient and can tolerate slower and much less reliable connections.
Repeater: A repeater is the dumbest kind of active network-connecting device. It just takes network traffic in one port and spews it out of one or more others, exactly as it gets it, but louder. This helps overcome cable losses, and lets cable runs be longer. Repeaters send while they receive, without waiting for the end of each packet to see if it’s intact or reduce collisions. Repeaters are, hence, useless as a cure for network congestion. Ordinary 10BaseT and 100BaseT hubs are, in fact, multi-port repeaters.
WAN: Wide Area Network. Any computer network that covers a large geographical area, and is composed, typically, of more than one Local Area Network. A WAN can be composed of a multiplicity of network systems. The Internet is the biggest WAN in the world, both in geographical extent and number of nodes.
| Ethernet Standards Quick Reference | |||||||||
| 10BaseT | 10MBps data rate, star wired bus topology, baseband signalling on unshielded twisted pair (UTP) cable. 10baseT cables can be up to 100 metres (328 feet) long, with a minimum cable run between nodes of 2.5 metres (about 8 feet). Maximum of 1,024 nodes per network. | ||||||||
| 100BaseT | 100BaseT, also known as "fast Ethernet", is essentially like 10BaseT, but run at 100MBps instead of 10MBps. It requires category 5 UTP cable.
| ||||||||
| 10Base2 | Thin Ethernet, or "Thinnet". 10Mbps data rate, bus topology, baseband signalling. The maximum segment length is 185 metres (607 feet). 10Base2 uses RG-58 coaxial cable, and allows 30 nodes per segment, and 90 nodes per network. The total length of the network must be less than 925 metres (3033 feet). | ||||||||
| 10Base5 | Thick Ethernet, or "Thicknet". The original "standard Ethernet", now supplanted in popularity by 10Base2. Typically 10Mbps data rate, baseband signalling, with a maximum segment length of 500 metres (1650 feet). Uses thick coaxial cable, RG-8 and RG-11. 100 nodes per segment are permitted, and 300 nodes per network. A maximum of four repeaters and 100 taps are permitted. | ||||||||
| 10BaseFL | Fibre Link Ethernet. 2GBps maximum data transfer, although normally restricted by hardware capabilities to 100MBps. Uses baseband signalling over fibre optic cable. Maximum segment length is 2000 metres (6557 feet). | ||||||||






