Nothing Special   »   [go: up one dir, main page]

Number Sysems Ops Networking

Download as pdf or txt
Download as pdf or txt
You are on page 1of 58

Operating Systems Introduction

SECTION ONE : Part 1

Overview
This module introduces you to the subject of operating systems. It is an introductory course that
will take you approximately 30-40 hours to complete (including the exercises) depending upon
your level of prior knowledge.

Learning Outcomes
At the end of this section you should be able to

 define what an operating system is

 list four functions performed by an operating system

 briefly explain the difference between a general purpose operating system and a
dedicated operating system

 classify software according to either business, operating system, utility, education or


entertainment categories

 identify from a list which items are input or output devices

 explain the difference between a single-user and a multi-user operating system

 classify common operating systems as either single-user or multi-user

What is an operating system?


An operating system (OS) is a collection of system programs that together
control the operation of a computer system. Typical operating systems are
Windows 10, Linux, Android.
An operating system generally only runs on a specific hardware platform.

1
What does an operating system do?
An operating system controls the way in which the computer system functions. In order to do
this, the operating system includes programs that

 initialize the hardware of the computer system

 provide basic routines for device control

 provide for the management, scheduling and interaction of tasks

 maintain system integrity and handle errors

Where are operating systems found?


There are many types of operating systems, the complexity of which varies depending upon what
type of functions are provided, and what the system is being used for. Some systems are
responsible for managing many users on a network.
Other operating systems do not manage user programs at all. These are typically found in
hardware devices like petrol pumps, airplanes, video recorders, washing machines and car
engines. These are often referred to as dedicated operating systems.

What is a general-purpose operating system?

Windows NT Workstation is known as a general-purpose operating system. This is because it


provides the ability to run a number of different programs, such as games, word processing,
business applications and program development tools.

What is a program?
A program is a set of instructions that performs a task. When we talk about programming a
computer or writing a computer program, we mean writing a set of instructions that the computer
can execute. Developers (people who write programs) need to use special software to write
programs, often called compilers.

Dedicated Operating Systems


An operating system designed for a single purpose is often called a dedicated operating system.
It performs a specific purpose, such as controlling the environment in a building, controlling a
2
petrol pump, or opening and closing an automatic door. Dedicated operating systems cannot be
used to run other types of programs such as games or business software.

A simple operating system for a security control system


An operating system for a security control system (such as a home alarm system) would consist
of a number of programs. One of these programs would gain control of the computer system
when it is powered on, and initialize the system.

The first task of this initialize program would be to reset (and probably test) the hardware sensors
and alarms. Once the hardware initialization was complete, the operating system would enter a
continual monitoring routine of all the input sensors. If the state of any input sensor changed, it
would branch to an alarm generation routine.

What are Input and Output devices?


Input and output devices are components that form part of the computer system. These devices
are controlled by the operating system.

Input devices provide input signals such as commands to the operating system. These commands
received from input devices instruct the operating system to perform some task or control its
behavior. Typical input devices are a keyboard, mouse, temperature sensor, air-flow valve or
door switch. In the previous example of our simple security control system, the input devices
could be door switches, alarm keypad panel and smoke detector units.

Output devices are instruments that receive commands or information from the operating system.
Typical output devices are monitor screens, printers, speakers, alarm bells, fans, pumps, control
valves, light bulbs and sirens.

SECTION ONE : Part 2

What is a single-user operating system?


We are all familiar with the concept of sitting down at a computer system and writing documents
or performing some task such as writing a letter. In this instance there is one keyboard and one
monitor that you interact with.
Old Operating systems such as Windows 95, Windows NT Workstation and Windows 2000
professional were essentially single user operating systems.
They provided you the capability to perform tasks on the computer system such as writing

3
programs and documents, printing and accessing files.

Consider a typical home computer. There is a single keyboard and mouse that accept input
commands, and a single monitor to display information output. There may also be a printer for
the printing of documents and images.
In essence, a single-user operating system provides access to the computer system by a single
user at a time. If another user needs access to the computer system, they must wait till the current
user finishes what they are doing and leaves.
Students in computer labs at colleges or University often experience this. You might also have
experienced this at home, where you want to use the computer but someone else is currently
using it. You have to wait for them to finish before you can use the computer system.

What is a multi-user operating system?


A multi-user operating system lets more than one user access the computer system at one time.
Access to the computer system is normally provided via a network, so that users access the
computer remotely using a terminal or other computer.
In the early days of large multi-user computers, multiple terminals (keyboards and associated
monitors) were provided. These terminals sent their commands to the main multi-user computer
for processing, and the results were then displayed on the associated terminal monitor screen.
Terminals were hard-wired directly to the multi-user computer system.
Today, these terminals are generally personal computers and use a network to send and receive
information to the multi-user computer system. Examples of multi-user operating systems are
UNIX, Linux (a UNIX clone) and mainframes such as the IBM AS400.

The operating system for a large multi-user computer system with many terminals is much more
complex than a single-user operating system. It must manage and run all user requests, ensuring
they do not interfere with each other. Devices that are serial in nature (devices which can only be
used by one user at a time, like printers and disks) must be shared amongst all those requesting
them (so that all the output documents are not jumbled up). If each user tried to send their
document to the printer at the same time, the end result would be garbage. Instead, documents
are sent to a queue, and each document is printed in its entirety before the next document to be
printed is retrieved from the queue. When you wait inline at the cafeteria to be served you are in
a queue. Imagine that all the people in the queue are documents waiting to be printed and the
cashier at the end of the queue is the printer.

Operating system utilities


The operating system consists of hundreds of thousands of lines of program instructions and
these are stored on hard disk of the computer. Portions of the operating system are loaded into
computer system memory (RAM) when needed. To manage the computer system, users, printers,

4
files and write programs, the operating system is generally provided with a number of utility
programs. The utilities are used for

 Managing Files and Documents

 Development of Programs and Software

 Communicating between people and with other computer systems

 Managing user requirements for programs, storage space and priority

Operating System Interfaces


In addition, the operating system provides each user with an interface that accepts, interprets and
executes user commands or programs. This interface is commonly called a SHELL or command
line interpreter (CLI). In some systems this might be a simple text mode line-by-line entry using
keywords (such as MSDOS or UNIX), in other systems it might be highly graphical using
windows and a pointing device such as a mouse (such as X-Windows).

Advantages and problems of multi-user operating systems


The advantage of having a multi-user operating system is that normally the hardware is very
expensive, and it lets a number of users share this expensive resource. This means the cost is
divided amongst the users. It also makes better use of the resources. Since the resources are
shared, they are more likely to be in use than sitting idle being unproductive.
One problem with multi-user computer systems is that as more users access it, the performance
becomes slower and slower. Another disadvantage is the cost of hardware, as a multi-user
operating system requires a lot of disk space and memory. In addition, the actual software for
multi-user operating systems tend to cost more than single-user operating systems.

What is a multi-tasking operating system?


A multi-tasking operating system provides the ability to run more than one program at once. For
example, a user could be running a word processing package, printing a document, copying files
to the floppy disk and backing up selected files to a tape unit. Each of these tasks the user is
doing appears to be running at the same time.
A multi-tasking operating system has the advantage of letting the user run more than one task at
once, so this leads to increased productivity. The disadvantage is that more programs that are run
by the user, the more memory that is required.

Multithreading
Introduction

5
When the computers were first invented, they were capable of executing one program at a
time. Thus once one program was completely executed, they then picked the second one to
execute and so on. With time, the concept of timesharing was developed whereby each
program was given a specific amount of processor time and when its time got over the
second program standing in queue was called upon (this is called Multitasking, and we
would learn more about it soon). Each running program (called the process) had its own
memory space, its own stack, heap and its own set of variables. One process could spawn
another process, but once that occurred the two behaved independent of each other. Then
the next big thing happened. The programs wanted to do more than one thing at the same
time (this is called Multithreading, and we would learn what it is soon). A browser, for
example, might want to download one file in one window, while it is trying to upload
another and print some other file. This ability of a program to do multiple things
simultaneously is implemented through threads (detailed description on threads follows
soon).

Multitasking vs. Multithreading

As explained above, Multitasking is the ability of an operating system to execute more than
one program simultaneously. Though we say so but in reality no two programs on a single
processor machine can be executed at the same time. The CPU switches from one program
to the next so quickly that appears as if all of the programs are executing at the same time.
Multithreading is the ability of an operating system to execute the different parts of the
program, called threads, simultaneously. The program has to be designed well so that the
different threads do not interfere with each other. This concept helps to create scalable
applications because you can add threads as and when needed. Individual programs are all
isolated from each other in terms of their memory and data, but individual threads are not
as they all share the same memory and data variables. Hence, implementing multitasking is
relatively easier in an operating system than implementing multithreading.

Hey, wait!!! all that's fine but I still do not understand fully what threads are!!!

What is a thread???

A thread can be defined as a semi-process with a definite starting point, an execution


sequence and a terminating point. It maintains its own stack where it keeps the exception
handlers, the scheduling priority and other details that the system might need to re-activate
that thread.

Well, it seems like a complete process to me then why do we call it a semi-process!!!

That is because a full-blown process has its own memory area and data, but the thread
shares memory and data with the other threads.

A process/program, therefore, consists of many such threads each running at the same time
within the program and performing a unique task.

Threads are also called lightweight processes that appear to run in parallel with the main
program. They are called lightweight because they run within the context of the full-blown
program taking advantage of the resources allocated for the program.

On a single processor system, threads can be run either in a preemptive mode or in a


cooperative mode.

In the preemptive mode, the operating system distributes the processor time between the
threads and decides which thread should run next once the currently active thread has
completed its time-share on the processor. Hence the system interrupts the threads at
regular intervals to give chance to the next one waiting in the queue. So no thread can

6
monopolize the CPU at any given point of time. The amount of time given to each thread to
run depends on the processor and the operating system. The processor time given to each
thread is so small that it gives the impression that a number of threads are running
simultaneously. But, in reality, the system runs one thread for a couple of milliseconds, then
switches to the other and so on. It keeps a count of all the threads and cycles through them
giving each of them a small amount of the CPU time. The switching between threads is so
fast that it appears as if all the threads are running simultaneously.

But, what does switching mean?? It means that the processor stores the state of the
outgoing thread (it does so by noting the current processor register values and the last
instruction-set the thread was about to perform), restores the state of the incoming thread
(again by restoring its processor register values and picking the last instruction-set where it
had left itself) and then runs it. But this style has its own flaws. One thread can interrupt
another at any given time. Imagine what would happen if one thread was writing to a file
and the other interrupted it and started writing to the same file. Windows 95/NT, UNIX use
this style of managing their programs/threads.

In cooperative mode, each thread can control the CPU for as long as it needs it. In this
implementation, one thread can starve all the others for processor time if it so chooses.
However, if a thread is not using the processor it can allow another thread to use it
temporarily. Running threads can only give up control either if a thread calls a yield function
or if the thread does something that would cause it to block, such as perform I/O. Windows
3.x uses this kind of implementation.

On some systems, you can have both the cooperative and preemptive threads running
simultaneously (Threads running with high priorities often behave cooperatively while
threads running at normal priorities behave preemptively). Since you are not sure whether
the system would let threads run in a cooperative or a preemptive model, it is always safer
to assume that preemption is not available. You should be designing your program in such a
way that processor-intensive threads should yield control at specific intervals. When the
currently running thread wants to yield it means that the thread is willing to give up CPU
control. The system then looks for threads that are ready to run and which are of the same
or higher priority as the current thread. If it finds any then it pauses the execution of the
current thread and activates the next thread, waiting in the queue. But, if it cannot find any
thread of the same or higher priority then control returns to the thread that yielded. Still if a
thread wants to give up control and let a thread of lower priority take over, then the thread
goes into a sleep mode for a certain amount of time letting the lower priority thread run.

On a multi-processor system, the operating system can allocate individual threads to the
separate processors, which thus fastens the execution of the program. The efficiency of the
threads also increases significantly because the distribution of the threads on several
processors is faster than sharing time-slices on a single processor. It is particularly useful to
have a multi-processor system for 3D modeling and image-processing.

Are threads actually needed!!!

We all have fired a print command to print something. Imagine what would happen if the
computer stopped responding while the printing is going on. Oh No!! Our work will come to
a stop till the nasty print work is going on. But as we all know, nothing like this happens.
We are able to do the normal work with the computer (like editing/saving a file) or drawing
a graphic and listening to music etc without getting bothered with the print job. Now, this is
possible because separate threads are executing all these tasks. You would have all noticed
that the database or a web server interacts with a number of users simultaneously. How are
they able to do that?? It is possible because they maintain a separate thread for each user
and hence can maintain the state of all the users. If the program is run as one sequence
then it is possible that failure in some part of the program will disrupt the functioning of the

7
entire program. But, if the different tasks of the program are in separate threads then even
if some part of the program fails, the other threads can execute independent of it and will
not halt the entire program.

Wow!! This sounds good. So, if we start writing threaded applications, we would never come
across those nasty crashes in our program.

Hold on!! We are not yet over.

No doubt, writing multithreaded applications gives you an edge over non-threaded


applications but threading can become a very costly concept, if not used judiciously. A few
apparent drawbacks are listed below. If one program has many threads, then threads in the
other programs will naturally get less of the processor time. Besides, a large amount of
processor time is consumed in controlling the threads. The system also needs sufficient
memory to store the context information of each thread. Hence, large number of threads is
a blow to memory, bugging the entire system and ultimately slowing the system down.
Besides, a program has to be designed really well to support a large number of threads
otherwise it would be more of a curse than a boon. While killing each of the threads you
need to be aware of the repercussions that it might involve and handle them appropriately.

Designing threaded programs-few tips

There are numerous ways that you can design a good multi-threaded application. Here we
would get a general glimpse but as we proceed (in the later parts of this article) you would
understand things better. Threads can be of different priorities (we would see in the later
parts of this article series how to decide their priority levels). Say, we need to draw a
graphic or do a big mathematical computation and at the same time want to get user input.
We should first keep all the individual tasks (like drawing an image, or doing computation or
asking for user-input) in separate threads. We should then allocate a higher priority to the
thread, which is expecting user-input so that its responsiveness is high, and the thread,
which is drawing the graphic or doing the calculation, at a lower priority so that the entire
CPU time is not bogged down by these tasks.

Again, say based on the user-input the program has to do some processing. If the
processing is long then it may take some time to complete and the user is un-necessarily
made to wait till it is over. In such cases, we should keep separate threads, one to read
user input and the other to handle any lengthy operations based on the input. This will
make the program more responsive. It will also give the user the flexibility to cancel the
operation at any point of the running of the thread. Hence, applications that use user-input
should always have one thread to handle input, which will keep the user interface active at
all times, and let the processor-intensive tasks execute on separate threads

In the case of drawing graphics, the application should always be listening to messages (like
a repaint command) from the system. If the application gets busy doing some other work
then the screen might remain blank for a long time, which of course is not very appealing
visually. So, in such cases it is advisable to have one thread always dedicated to handling
messages (like repaint) from the underlying system.

Always remember that a thread, which manages time-critical tasks, should be given a high
priority and the others a low priority. Like the thread listening for client requests should
always remain responsive and hence allotted high priority. A user-interface thread that
manages interactions with the users should delegate all requests immediately to the worker
threads rather than trying to work on those requests. This way, it will remain responsive to
the users at all times.

8
What is software and what is application software?
Software is just another name for program. We often use the term to refer to a group of
programs. For example, you might get asked the question "what sort of software do you have?".
In this case, the person is asking you what types of software do you have, and how many
different software programs do you have. I guess you could think of someone asking a snake
collector the question "What sort of snakes do you have?". For the snake collector, they
obviously have many different types and sometimes several of the same species. Software is
similar. So you might respond to such a question by answering that you have some word
processing software such as Microsoft Word and some games such as Quake and Sim City.
Application software excludes the operating system and those programs that are part of the
operating system. In general, you buy application software for your computer. An example might
be a word processor or a reference atlas.

What are general categories of application software?


In general, software is divided into a number of general categories.

Business Business software allows users to perform tasks related to running a


business, such as paying accounts, keeping track of goods and items for
sale, inventory software and writing reports.
Examples of business software are Microsoft Works and Lotus Notes.

Education Education software is designed to teach or educate users. These include


encylodedias, reference books and instructional programs.
Examples of education software are Encylopedia Britannica and
Microsoft Magic School Bus.

Entertainment/ Entertainment software is designed for you to have fun with! Its purpose
Games is to keep you entertained! This includes games software.
Examples of entertainment software are Microsoft Age of Empires
and Sim City 2000.

Utility Utility software is designed for you to perform routine tasks associated
with the storage and manipulation of your information. This includes
software such as schedulers, clocks, media players and communication
tools.
Examples of utility software are McAfee Virus Scan and Arcada
backup software.

Revision Exercise 1
9
List FOUR things an operating system does.

List THREE home appliance devices in your home that probably have an operating system
controlling their function.

List FOUR hardware devices on a typical home computer that an operating system has to
initialize when it is turned on.

List THREE possible errors that might occur in a typical home computer that an operating
system has to handle.

State THREE possible basic routines an operating system might provide for handling a hardware
device.

PART TWO : Section 1

10
Learning Outcomes
At the end of this section you should be able to

 list four typical parts (modules) of an operating system

 state three functions performed by a real-time executive

 explain the difference between pre-emptive and co-operative switching

 discuss the relationship between system performance and system overhead

 identify the essential operations that need to be performed in order to switch from one
program to another

 define the terms context switching, system overhead, time-slice, quantum period and
scheduling

 distinguish between first-in first-out and round robin scheduling

What are the various parts of an Operating System?


In this section we look at that part of the operating system that is responsible for running
programs, called the real-time executive or kernel.
An operating system for a large-scale computer that is used by many people at once is a very
complex system. It contains many millions of lines of instructions (commands that the computer
executes) written by programmers. To make operating systems easier to write, they are
constructed as a series of modules (programs), each module responsible for one function. Typical
modules in a larger multi-user operating system could be,

 Kernel (also known as the executive)

 Process manager

 Scheduler

 File manager

What is a real-time executive?


The core of all operating systems is called a REAL TIME EXECUTIVE (also known as the
kernel). Some of the functions that it performs are

 switching between programs

 hardware device control and programming

11
 memory management

 process management

 scheduling (deciding what programs to run)

 inter-process communication

 processing of exceptions and interrupts


Our simple security monitoring system would not have all of the above, as it would probably be
a single task system, running only one program. As such, it would not need to perform
scheduling of more than one program or allow communication to take place between programs
(called inter-process communication). Memory management would be unnecessary, as the
program would easily fit into the available memory of the computer.
An operating system designed to handle a large number of people would need a real-time
executive that performs all of the above. User programs are generally stored on disk, thus need to
be loaded into memory before being executed. This presents the need for memory management,
as the memory of the computer would need to be searched for a free area in which to load a
persons program into. When the user was finished running the program, the memory consumed
by it would need to be freed up and made available for another user when required.
Process scheduling and management is also necessary, so that all programs would be executed
and run fairly. There is no point if a program by a specific user runs to such an extent that it
denies the running of any other programs, making every other user wait. In addition, some
programs might need to be executed more frequently than others, for example, checking network
communications or printing. Some programs may need to be temporarily halted, then restarted
again later, so this introduces the need for inter-program communication.

What is a computer program?


Programs are a series of instructions to the computer. When a software programmer (a person
who writes programs to run on a computer system) develops a program, it is converted into a
long list of instructions that is executed by the computer system.
In operating systems we talk more of a process (part of a program that is in some stage of
execution) than a program. This is because in modern operating systems, only a portion of a
program is loaded at any one time. The rest of the program sits waiting on a disk unit till it is
needed. This saves memory space.
Processors execute computer programs. A processor is a chip in the computer that executes
program instructions. Processors execute millions of instructions per second.

How do operating systems run more than one program at once?


Some systems run only a single process at a time, other systems run multiple processes at once.
Most computer systems are single processor based, and a processor can only execute one
instruction at a time, so how is it possible for such a single processor system run multiple

12
processes? The simple answer is that it doesn’t. The processor of the computer runs one process
for a short period of time, then is switched to the next process and so on. As the processor
executes millions of instructions per second, this gives the appearance of many processes
running at once.

What is co-operative and preemptive switching?


In a computer system that supports more than one process at once, some mechanism must be
used to switch from one task to another. There are two main methods used to perform this
switching.

 Co-operative switching means that a task that is currently running will voluntarily give
up the processor at some time, allowing other processes to run.

 Preemptive switching means that a running task will be interrupted (forced to give up)
and the processor given to another waiting process.
The problem with co-operative switching is one process could hang and thus deny execution of
other processes, resulting in no work being done. An example of a co-operative system was
Windows 3.1
Pre-emptive scheduling is better. It gives more response to all processes and helps prevent (or
reduce the number of occurrences of) the dreaded machine lockup. Windows NT workstation is
an example of such as operating system.
Note: Only 32-bit programs in Windows 95 are pre-emptive switched. 16-bit programs are still
co-operatively switched, which means it is still easy for a 16-bit program to lock up a Windows
95 computer.

A multi-user operating system allows more than one user to share the same computer system at
the same time. It does this by time-slicing the computer processor at regular intervals between
the various programs run by each user.
In this example, there are five people that share the processor hardware and main memory on a
time basis. Consider a 486 Intel processor running at 50MHz. This processor is capable of about
6 million instructions per second.
If we decided that we would share the hardware by letting each user run for 1/5th of a second,
this would mean each user could execute about 1.2 million instructions each time they have the
processor.
We start off by giving the first user (which we will call Bart) the processor hardware, and run
Barts program for 1/5th of a second. When the time is up, we intervene, save Barts program state
(program code and data) and then start running the second user program (for 1/5th of a second).
This process continues till we eventually get back to user Bart. To continue running Bart's
program, we restore the programs code and data and then run for 1/5th of a second.

13
What is dispatching?
It will be noted that it takes time to save/restore the programs state and switch from one program
to another (called dispatching). This action is performed by the kernel, and must execute
quickly, because we want to spend most of our time running user programs, not switching
between them.

What is system overhead?


The amount of time that is spent in the system state (running the kernel and performing tasks like
switching between user programs) is called the system overhead, and should typically be below
10%. Too much time spent performing system tasks in preference to running user programs will
result in poor performance for user programs, which will appear to run very slowly.

What is required to switch from one program to another?


This switching between user programs is done by part of the kernel. To switch from one program
to another requires,

 a regular timed interrupt event (provided by a clock)

 saving the interrupted programs state and data

 restoring the next programs state and data

 running that program till the next timed interrupt occurs


The timed event is usually about 1 to 10 milliseconds apart and generated by a real-time clock.
To save and restore program states requires hardware support, a feature supported by Intel
processors.

What is context switching?


When the processor is switched from one process to another, the state (processor registers and
associated data) must be saved, because at some later date the process will be restarted and
continue as though it was never interrupted. Once this state has been saved, the next waiting
process is activated. This involves loading the processor registers and memory with all the
previously saved data and restarting it at the instruction that was to be executed when it was last
interrupted.
The process of switching from one process to another is called context switching. A time period
that a process runs for before being context switched is called a time slice or quantum period.

What is scheduling?
Deciding which process should run next is called scheduling, and can be done in a wide variety
of ways.

14
Co-operative schedulers are generally very simple, as the processes are arranged in a ROUND
ROBIN queue. When a running process gives itself up, it goes to the end of the queue. The
process at the top of the queue is then run, and all processes in the queue move up one place.
This provides a measure of fairness, but does not prevent one process from monopolizing the
system (failing to give itself up).
Pre-emptive scheduling uses a real-time clock that generates interrupts at regular intervals (say
every 1/100th of a second). Each time an interrupt occurs, the processor is switched to another
task. Systems employing this type of scheduling generally assign priorities to each process, so
that some may be executed more frequently than others.

First in First Out Scheduling


A FIFO queue is a list of available processes awaiting execution by the processor. New processes
arrive and are placed at the end of the queue. The process at the start of the queue is assigned the
processor when it next becomes available, and all other processes move up one slot in the queue.

Round Robin Scheduling


One of the problems with the FIFO approach is that a process may in fact take a very long time
to complete, and thus holds up other waiting processes in the queue. To prevent this from
happening, we employ a pre-emptive scheduler that lets each process run for a little while. When
the time-slice is up, the running process is interrupted and placed at the rear of the queue. The
next process at the top of the queue is then started.

Other ways of scheduling processes


It is common now in operating systems today for processes to be treated according to priority.
This may involve a number a different queues and scheduling mechanisms, using priority based
on previous process activity, how it has been executing for and how long it has been since it last
was executed by the processor.

Revision Exercise 2
List FIVE functions that a real time executive does.

What is co-operative switching and how does it differ from pre-emptive switching?

15
What is dispatching?

What happens to the performance of running user programs when system overhead increases?

What is a time-slice?

What is scheduling?

What is one problem with First-In-First-Out queues when used to schedule processes.

16
17
Introduction to Computer Hardware
Number Systems
Binary Numbers

Having grown up with decimal number we all tend to take then for granted. However in our
study of computers we need to use number which differ from the decimal (base 10).
Lets look in detail at a decimal number system and recall the 'rules' associated with this system.
First consider the following decimal number:
136.25. What does this actually mean?
In its full incantation this number means:
102 * 1 = 100.0
101 * 3 = 30.0
100 * 6 = 6.0
10-1 * 2 = 0.2
10-2 * 5 = 0.05
total = 136.25

Now consider the binary number 1101.01. Again in its full form this means:
23 * 1 = 1000.0 (8 in decimal)
22 * 1 = 100.0 (4 in decimal)
21 * 0 = 00.0 (0 in decimal)
20 * 1 = 1.0 (1 in decimal)
2-1 * 0 = 0.0 (0.0 in decimal)
2-2 * 1 = 0.01 (0.25 in decimal)
total = 1101.01 (13.25 in decimal)

The following shows the first integers and their binary equivalents (and how they are derived):
decimal binary
18
0 0000 (0 * 23 + 0 * 22 + 0 * 21 + 0 * 20)
1 0001 (0 * 23 + 0 * 22+ 0 * 21+ 1 * 20)
2 0010 (0 * 23+ 0 * 22+ 1 * 21+ 0 * 20)
3 0011 (0 * 23+ 0 * 22+ 1 * 21+ 1 * 20)
4 0100 (0 * 23+ 1 * 22+ 0 * 21+ 0 * 20)
5 0101 (0 * 23+ 1 * 22+ 0 * 21+ 1 * 20)
6 0110 (0 * 23+ 1 * 22+ 1 * 21+ 0 * 20)
7 0111 (0 * 23+ 1 * 22+ 1 * 21+ 1 * 20)
8 1000 (1 * 23+ 0 * 22+ 0 * 21+ 0 * 20)
9 1001 (1 * 23+ 0 * 22+ 0 * 21+ 1 * 20)

Adding Binary Numbers


Just as decimal numbers can be added together to give a new value two binary numbers can be
added together. The basic rules
are:

0+0=0
0+1=1
1+0=1
1 + 1 = 0 (carry 1 to the next column)
For example:

01101000 +
00101001
________
= 10010001
or
11101000 +
10101001
19
________
= 110010001

Hexadecimal Numbers
Although it is very convenient for computers to use 0 and 1 (as these correspond to the
absence/presence of a voltage or current, the direction of a magnetic field i.e. north/south, etc.) it
is difficult for humans to readily identify binary numbers. Hexadecimal (Hex) can act as an
interim number system between binary and ourselves as it is more recognizable yet readily
convert to and from binary.
In the hexadecimal system 16 (rather than 10 in decimal or two in binary) symbols/digits
(number characters) are used. The hexadecimal system uses the digits 0 through 9 and the letters
A through F (uppercase or lowercase) to represent the decimal numbers 0 through 15. One
hexadecimal digit is equivalent to 4 bits, and 1 byte can be expressed by two hexadecimal digits.
For example, binary 0101 0011 corresponds to hexadecimal 53. To prevent confusion with
decimal numbers, hexadecimal numbers in programs or documentation are usually followed by
H or preceded by &H (e.g. Visual Basic), or 0x (e.g. C++).
Thus, 10H = decimal 16; 100H = decimal 162 = decimal 256.
A table providing decimal, binary, and hex equivalents for the first 16 integers is:

DECIMAL BINARY HEX

0 0000 0

1 0001 1

2 0010 2

3 0011 3

4 0100 4

5 0101 5

6 0110 6

7 0111 7

8 1000 8

9 1001 9

10 1010 A

11 1011 B

20
12 1100 C

13 1101 D

14 1110 E

15 1111 F

A few further examples of binary and hexadecimal numbers follow:


0100 1100 0001 1111 = 4C1FH
1101 0110 1100 0000 = D6C0H

Signed Binary Integers


When we were discussing binary numbers above we only consider unsigned (by default) positive
integers. However, it is also necessary to use negative numbers as well as real numbers. In the
following section we will be considering how binary numbers can represent both positive and
negative values, i.e. signed integers. In a later section we will see have 'floating point' number
are used to represent real numbers.

If we consider eight binary digits using unsigned values (as above) we can represent the range of
values from 0 to 255 (a total of 28 values). However, if we allow the right most bit in a binary
number (the Most Significant Bit - MSB) to represent the sign of
the number (i.e. 0 means a positive number and 1 means a negative number), whereas the other
seven digits represent the magnitude of the number. For example:
00000001 represents +1
10000001 represents -1
00010101 represents +21
10010101 represents -21
01111111 represents +127
11111111 represents -127

Although these signed integers have solved the problem of representing positive and negative
values they do not lend themselves to binary arithmetic that are performed using 'logic circuits'.
An alternative system known as "two's complement" is a better system for this.

Two's Complement

21
As defined by the Microsoft Press, 'Computer Dictionary', 2nd Ed., 'Complement' means:
'Loosely, a number that can be thought of as the "mirror image" of another number written to the
same base, such as base 10 or base 2. Complements are commonly used to represent negative
numbers. Two types of complements are encountered in computer-related contexts:

Radix-minus-1 complements and true complements.


A radix-minus-1 complement is known in the decimal system as a nine's complement and in
the binary system as a one's complement.
True complements are known in the decimal system as ten's complement and in binary as two's
complement a form commonly used to represent negative numbers in processing. See also
complementary operation, nine's complement, one's complement, ten's complement, two's
complement. '

Now what does this really mean?


First "two's complement" is used to describe numbers from -128 to +127. In this system if the
value of the MSB is:

0 then the rest of the seven bits represent normal binary numbers, i.e. 0 to 127 are
possible;
1 then this represents -128 which is to be added to the total of the other seven bits that
represent a normal binary number.
Still confused? Here are a few examples:

00000001 represents 1 (a positive number, i.e. the MSB is 0, and the other
seven bits totalling 1)

00000101 represents 5 (a positive number, i.e. the MSB is 0, and the other
seven bits totalling 5)

10000001 represents -127 (a negative number, i.e. the MSB is -128 to which
we add the total of other seven bits, i.e. 1, therefore -127)

10000101 represents -123 (a negative number, i.e. the MSB is -128 to which
we add the total of other seven bits, i.e. 5, therefore -123)

11011111 represents -33 (a negative number, i.e. the MSB is -128 to which we
add the total of other seven bits (64+16+8+4+2+1), i.e. 95, therefore

22
-33)

So what the significance of "two's Complement"?


As stated above two's complement is very important when we wish to perform a subtraction
between two binary numbers. This arises as logic circuits can readily add two numbers and we
will see that adding one binary number to the two's complement of another binary number is
equivalent to a subtraction operation. Therefore two's complement not only enables the storage
of both positive and negative integers but hence enables both addition and subtraction operations.

We need to be able to generate negative numbers in the two's complement binary number
system. This is achieved by first 'flipping' all of the binary digits within the corresponding
positive number such that all the 1s become 0's and 0's become 1's.
(This process is referred to as taking the one's complement). In order to create the two's
complement we simply add 1 to this result. For example the decimal number 13 can be
represented in two complement as: 00001101

if we wish to generate -13 we need to first take its one's complement i.e.:
11110010
and when we add 1 the two's component is discovered to be:
11110011
You should be able to see that this represents -13 (-128+64+32+16+0+0+2+1)
Once we have decided that we are working in two's complement representation and using eight
bit numbers then numbers such as 200 or -135 are out-of-range and not valid. If the
addition/subtraction of two binary number leads to number out of this range than an overflow
error is encounted. This error can be readily detected by comparing the carry -n and carry out bits
of the MSB (sign bit), but more of this later. It is worthwhile noting that in order to increase the
range of number that can be handled more bits can be used to store the number. For example if
we use 16 bits then numbers in the range -32768 (-1*216-1) to +32767 (216-1-1)]

Lets look at a few examples of two's complement arithmetic


Example 1: 18-11 = ?
18 is represented as 00010010
11 is represented as 00001011
The one's complement of 11 is 11110100

23
The two's complement of 11 is 11110101

Now if we add 18 to the two's complement of 11 we get:

00010010 +
11110101
00000111 (with a carry of 1 which is ignored in this case)
00000111 is binary for 7 therefore we have what we wanted i.e. 18-11.
Example 1: 7-9 = ?
7 is represented as 00000111
9 is represented as 00001001
The one's complement of 9 is 11110110
The two's complement of 9 is 11110111

Now if we add 7 to the two's complement of 9 we get:


00000111 +
11110111
________
11111110 (with no a carry)
11111110 is binary for -2 (-128+64+32+16+8+4+2) therefore we have what we wanted i.e. 7-9.
Another way of showing that 11111110 corresponds to -2 simply take its two's complement and
see that its 00000010 i.e. 2.

In example 1 we intentionally ignored the carry bit, however there are times when the presence
of a carry bit would signify an overflow and these need to be considered (e.g. 64+96). The ALU
of the CPU can detect an overflow condition by comparing the states of the carry in to and carry
out from, the sign bit.
The following two examples exemplify this comparison, the first has the same value in the carry-
in as the carry-out and therefore gives the correct result. However in the second case the values
in the carry-in and carry-out differ and therefore the results is incorrect.

Exercises in Using Two's Complement

24
To ensure that you understand two's complement for all of the following additions first convert
the decimal numbers to eight bit two's complement binary representation, add the numbers
together and check your results.

Example 1:

Question :
110 + 110 = ?
Answer:
000000012 +
000000012
________
000000102 = 210

Example 2:
Question :
110 - 110 = ?
Answer:
000000012 +
111111112 (i.e. the two's complement of 000000012)
________
000000002 = 010 (Note: the carry into and out of the MSB (i.e. sign bit) is 1 therefore this is a
valid answer)

Example 2:
Question :
-110 - 210 = ?
Answer:
111111112 + (i.e. the two's complement of 000000012)
111111102 (i.e. the two's complement of 000000102 i.e. 210)
25
________
111111012 = -310 (Note: the carry into and out of the MSB is 1 therefore this is a valid answer)

Questions
1) 410 + 310 = ?
2) 310 - 410 = ?
3) -410 - 310 = ?
4) 1310 + -1710 = ?
5) 9610 + 3210 = ? (Note something 'special' occurs here!)

Further Exercises
What is the (8 bit) two's complement representation of:

1) 110
2) 1010
3) 6710
4) 12710
5) -110
6) -6610
7) -12810

Real Numbers
Thus far we have seen how bits stored in a computer can be used to represent unsigned integers
using the binary number system and with a slight modification signed integers can also be
represented. Additionally, by using more and more bits larger (absolute) numbers can be
represented. However, what about numbers such as 1.5 or 657.674, i.e. real numbers, how can
we represent these.

There are two possible answers to this question. It is possible to use a:


1.fixed-point representation; or a

26
2.floating point representation.

Fixed-point Representation
As we have seen above binary numbers could have the equivalent of a decimal point, a so-call
binary point, which can separate the integer part of the number from the fractional part. For
example the real binary number 101.11 would represent
4+0+1+1/2+1/4 or 5.75.

Note 1: The more bits bit used to assign the integer part increases the range of integers that may
be represented while increasing the number of bits representing to fractional component
increases the precision to which a number (e.g. an approximation of Pi) could be represented.
Note 2: Within fixed-point binary numbers moving the binary point to the left one position has
the effect of dividing the number by two and moving it to the right multiples the number by two
(c.f. with the decimal system in which a move left divides by 10 and right multiples by 10).
However, how is the position of the binary point indicated, i.e. how can the number 101.11 be
distinguished from 10.111?
The answer to this is that it is up to the programmer to decide and ensure that his code treats the
integer part differently from the fractional part. For example a programmer could decide that a
number should be represented by 16 bits i.e. 2 bytes. The first byte representing the integer part
and the second representing the fractional part. These latter eight bits would give the number the
precision of 1 in 256 (enough to represent cents if the programmer was concerned with money).
Note: In modern languages such a C, C++, Visual BASIC there is no fixed-point number types
already defined by the language. (Although the 'date' and 'currency' number types defined in
Visual BASIC is related to fixed-point representations.)

Floating-point Numbers
A floating-point number is similar to scientific notation, in which a number is expressed in two
parts. The first is called the mantissa and the other the exponent. For example the number:
1903810 can be written as 1.9038x104
In this case the mantissa is 1.9038 and the exponent is 4
Here is another example:
0.0032510 can be written as 3.25x10-3
Here the mantissa is 3.25 and the exponent -3.
We could use the same system in binary however a slightly different system is usually employed
in floating-point binary numbers.
27
In this case all of the mantissa appears to the right of the decimal point. For example:
1101.00112 becomes 0.110100112 x 24; and
0.0001012 becomes 0.1012x2-3

Storage of Floating-point Numbers


When floating-point numbers are employed then two different pieces of information need to be
stored in memory, i.e. the
mantissa and exponent. The more bits that are used to describe the mantissa the more precisely
the number can be specified.
The more bits used to store the exponent provides a greater range of numbers.
For example a floating-point number could use 12 bits to store the mantissa and 4 bits are used to
store the exponent. These added together give 16 bits or 2 bytes and are often referred to as a 2
byte word. Most modern computer languages provide two types of floating-point numbers
(floats), single precision and double precision (doubles). In a typical language such a C++ or
Visual BASIC 4 bytes are used for single precision floats whilst 8 bytes are used for doubles.
Before we look in detail at the structure of a floating-point number it is worthwhile adding a
word of warning. Different computer systems use different data representations for floating point
numbers. They vary in the number of bytes used, the order of the bytes, and also whether two's
complement or signed integer representations are employed. A ramification of this is that the
transfer of floating-point data between different computer platforms can be very difficult or
impossible without special translation programs to adjust the formatting of the data.
Now let us consider a typical example of the structure of a 2 byte floating-point number, that
uses first 12 bits to represent the mantissa and the other 4 bits to represent the exponent. We
must consider how negative numbers and numbers in the range 1>x>-1 are represented. One
answer is to use two's complement to represent both the mantissa and the exponent. Hence a 1 in
the fist column of the mantissa leads to a negative number and a 1 in the first bit of the exponent
would represent that the
exponent is 2-x, i.e. a fractional number. This method is used extensively in a range of computer
languages.

Here is an example:

Floating-point numbers in Two's Complement Binary

Decimal Eqv. of the Expo Decimal Eqv. of


Mantissa Decimal Value
mantissa nent the exponent

0100000 1/2 + 0 + 0 + 0 + 0 + 0 + 0001 21 (= 2) (1/2 + 0 + 0 + 0 + 0 + 0 + 0)*21 =

28
0 0000 0 (= 1/2) 1

0100000 1/2 + 0 + 0 + 0 + 0 + 0 + (1/2 + 0 + 0 + 0 + 0 + 0 + 0)*2-1


1111 -8+4+2+1 (= -1)
0 0000 0 (= 1/2) = 1/4

0110100 1/2 + 1/4 + 0 + 1/16 + 0 (1/2 + 1/4 + 0 + 1/16 + 0 + 0 +


0101 25 = 32
1 0000 + 0 + 1/128 1/128)*25 = 26.25

Further Question
If four bytes were used to represent a floating point number and employed the above system
what would be the smallest, greatest, and smallest positive fraction that could be handled by this
system? (NB: Often floating-point numbers stored in four bytes are referred to as single precision
reals where as if eight are used then these are known as double precision reals.)
Partial Answer
Assuming that the mantissa is stored in the first three bytes and the final bytes stores the
exponent and both are in two's complement format then:
The largest single precision number would be:
01111111 11111111 11111111 01111111

The smallest number (most negative) would be:


10000000 00000000 00000000 01111111

The smallest positive fraction would be:


00000000 00000000 00000001 10000000
Important Note on Real Number Representations
As there exists a range of various systems and formats to store real numbers in general the
transfer of such numbers from computer to computer is highly problematic. As such transfers
should be done with caution.
It is therefore important that those working with real numbers should understand how the are
stored in the computer. Also it is very apparent from the above programs that exact comparisons
of floating point numbers is to be avoided.

ASCII

29
Thus far in the course we have only considered how integers (both unsigned and signed) as well
as real number are represented and therefore stored in memory. What about letters, words,
sentences, etc. (often referred to as strings)
The answer is to develop a system in which each character is given a number code. For example
the letter 'A' could be coded as the number 1 and 'b' as 2, etc. Once such a system has been set up
the codes developed would encompass a 'character set'.
The most common character set in use today in a wide range of computer systems is ASCII.
(Note in ASCII 'A' is not represented by the number 1 it is given the number 65).
According to Microsoft Press Computer dictionary ASCII is an acronym standing for:
American Standard Code for Information Interchange. A coding scheme using 7 or 8 bits that
assigns numeric values to up to 256 characters, including letters, numerals, punctuation marks,
control characters, and other symbols. ASCII was developed in 1968 to standardize data
transmission among disparate hardware and software
systems and is built into most minicomputers and all personal computers.
ASCII Equivalents: 'A' Through 'Z'

Value Description Value Description Value Description

65 A 66 B 67 C

68 D 69 E 70 F

71 G 72 H 73 I

74 J 75 K 76 L

77 M 78 N 79 O

80 P 81 Q 82 R

83 S 84 T 85 U

86 V 87 W 88 X

89 Y 90 Z

Similarly ASCII codes of 97 through to 122 represent lowercase a to z, respectively

ASCII Equivalents: '0' Through '9'


Value Description
48 0

30
49 1
50 2
51 3
52 4
53 5
54 6
55 7
56 8
57 9
ASCII is not the only coding system that has been devised to represent characters however it is
widely used. It has one major drawback in that it only uses 256 character codes, not enough to
store all of the characters in all of the known languages, as well as common symbols. In order to
store all of these a greater range of numbers must be used. Unicode has been defined for this
purpose:

Unicode
Unicode is a character-encoding scheme that uses 2 bytes for every character. The International
Standards Organization (ISO) defines a number in the range of 0 to 65,535 (216 – 1) for just
about every character and symbol in every language (plus some empty spaces for future growth).
On all 32-bit versions of Windows, Unicode is used by the Component Object Model (COM),
the basis for OLE and ActiveX technologies. Unicode is fully supported by Windows NT.
Although both Unicode and DBCS have double-byte characters, the encoding schemes are
completely different.

Within Microsoft's common operating systems and products the following character sets are
used:

Environment Character set(s) used


Visual Basic (V5) Unicode 32-bit object libraries
Unicode 16-bit object libraries ASCII + other
Windows NT API Unicode
Windows 95 API ASCII + other

31
As you can see from the above tables of ASCII values both letters and numbers can be
represented by a single byte. As such, it is possible to store the number 1.234 as a string of 5
characters or in the floating-point representation discussed above. The former has the advantage
that it can be readily transferred between computers however as its a string of characters doing
arithmetic on it is not really possible.

32
BASIC NETWORK CONCEPTS
Networks are an interconnection of computers. These computers can be linked together using a
wide variety of different cabling types, and for a wide variety of different purposes.
The basis reasons why computers are networked are

 to share resources (files, printers, modems, fax machines)

 to share application software (MS Office)

 increase productivity (make it easier to share data amongst users)


Take for example a typical office scenario where a number of users in a small business require
access to common information. As long as all user computers are connected via a network, they
can share their files, exchange mail, schedule meetings, send faxes and print documents all from
any point of the network.

It would not be necessary for users to transfer files via electronic mail or floppy disk, rather, each
user could access all the information they require, thus leading to less wasted time and hence
greater productivity.
Imagine the benefits of a user being able to directly fax the Word document they are working on,
rather than print it out, then feed it into the fax machine, dial the number etc.
Small networks are often called Local Area Networks [LAN]. A LAN is a network allowing easy
access to other computers or peripherals. The typical characteristics of a LAN are,

 physically limited (< 2km)

 high bandwidth (> 1mbps)

 inexpensive cable media (coax or twisted pair)

 data and hardware sharing between users

 owned by the user

BASIC NETWORK COMPONENTS


There are a number of components which are used to build networks. An understanding of these
is essential in order to support networks. This is a discussion on some of the elements which
make up a network [LAN].

Network Adapter Cards


A network adapter card plugs into the workstation, providing the connection to the network.
Adapter cards come from many different manufacturers, and support a wide variety of cable
media and bus types [ISA, MCA, EISA, PCI, PCMCIA]. New cards are software configurable,
using a software program to configure the resources used by the card. Other cards are PNP [plug
and Play], which automatically configure their resources when installed in the computer,
simplifying installation. With an operating system like Windows 95, auto-detection of new

33
hardware makes network connections simple and quick.
On power-up, the computer detects the new network card, assigns the correct resources to it, and
then installs the networking software required for connection to the network. All the user need do
is assign the network details like computer name.
For Ethernet or 10BaseT cards, each card is identified by a twelve digit hexadecimal number.
This number uniquely identifies the computer. These network card numbers are used in the
Medium Access [MAC] Layer to identify the destination for the data. When talking to another
computer, the data you send to that computer is prefixed with the number of the card you are
sending the data to.
This allows intermediate devices in the network to decide in which direction the data should go,
in order to transport the data to its correct destination.

So How Do Peripheral Cards Work?


Peripheral cards require a software driver to function. This software driver provides the interface
between the card and the operating system, making the services provided by the card available to
the user.
The software driver is normally configured to match the resource settings of the card. This is
done by a configuration utility, and stored either in the executable file, or a separate file (like .ini
or .cfg).
It is obviously important for the configuration settings in the software driver to match those
configured on the peripheral card.
The resources used by the card are either set by jumpers (or slide switches). New cards can also
be configured using a software program, rather than by manually setting jumpers on the card.
Where cards are software configurable, the cards retain their configuration when the power is
turned off.
The software driver provides the follow functions

 initialization routine

 interrupt service routine

 procedures to transmit and receive data

 procedures for status, configuration and control


The basic operation looks something like,

 card receives data

 card generates interrupt by asserting interrupt request line

 processor responds to interrupt request and jumps to service routine

 service routine instructs processor to read data from port location

34
 interrupt service routine releases processor to continue previous work

Installing A Peripheral Card


This section discusses basic techniques for installing peripheral cards. By following standardized
procedures, this will help to minimize damage to the system or peripheral card, and reduce the
possibility of incorrect installation.

1. Determine the resources used by the computer


Use the previous tables to determine the interrupts, memory and port addresses used by
the current hardware in the computer.

2. Read the install manual


Check the disk for a read.me file (and read it). Read the manual and take note of the
jumper switches used by the card. Identify where these are located on the card.

3. Determine resources to be used by the card


Allocate resources to the card which do not conflict with existing hardware.

4. Observe electrostatic protection in handling the card


Use a wrist strap and ground yourself properly before handling the card. Handle the card
by the edges. Do not touch the components or edge connector. Use electrostatic bags or
an electrostatic mat.

5. Configure the card jumpers


Set the jumpers on the card

6. Insert the card


Remove the system base unit cover and insert the card into a spare peripheral bus slot.
Observe electrostatic precautions.

7. Load the software driver


If the card was provided with a software driver, install the software driver. This might
involve running an INSTALL program, or copying the drivers to the hard disk. It might
also mean adding the driver name to the config.sys file (DEVICE=xxxxx.sys).

8. Configure the driver software


If the driver software needs to be configured (specify which resources the card is using),
this information might be stored in a separate file (.ini or .cfg). Often, when installing the
software, it will ask for configuration details. These must be the same as the hardware
jumpers used by the card.

9. Test card (run diagnostics where provided)


If the card was provided with diagnostic software, run that now to test the card and
driver. This is a good way to test if the installation was done correctly.

10. Test the machine


Test some of the other software packages on the system (like networking, serial
communications and printing) to see if they still work. If they don't, this indicates a
probable conflict of resources. In Windows 95 or NT, run the diagnostic program to
check for interrupt and resource conflicts (MSD or WINMSD).

Summary of Installing Network Cards in Servers and Workstations


35
 ISA cards are a problem

 check what resources are already being used

 do not share resources between two cards

 interrupts can only be shared on EISA and MCA cards

 run the diagnostics software after installation

 if the computer hangs, remove one board at a time until the problem disappears

Brief Guide to BUILDING WIRING


The following is a very brief overview of the components that make up the wiring standards for
commercial buildings. The objectives of such standards is to

 define a generic voice and data wiring system that is multi-purpose and multi-vendor

 help minimize cost of administration

 simplify network maintenance and changes


A building wiring system covers a number of different elements

 horizontal wiring

 backbone wiring

Horizontal Wiring
The horizontal wiring extends from the wall outlet to the system center (telecommunications
closet). It includes the

 the wall outlet

 the horizontal cable

 cables used to interconnect components [cross-connects or patch cables] in the


telecommunications closet (TC)
Some general features of the horizontal wiring scheme are

 uses star topology

 limit of 90 meters (295') from TC to wall outlet

 limit of 3 meters (10') to connect from wall outlet to PC

 patch cords and cross-connect leads are limited to 6 meters (20')

 minimum of two outlets per user (phone+data)

 standardized media, Outlet A=4pair 100ohm UTP, Outlet B=same or 2 pair 150ohm STP
36
Backbone Wiring The backbone wiring system interconnects telecommunication closets,
equipment rooms and entrance facilities (i.e., the outside world). Some general features are

 star topology

 maximum of two hierarchical levels

 interconnections between any two TC must not go through more than 3 cross connects

 use of recognized media

 adherence to distance limitations

Cabling
Cable is used to interconnect computers and network components together. There are THREE
main cable types used today [twisted pair, coax and fiber optic]. The choice of cable depends
upon a number of factors, like

 cost

 distance

 number of computers involved

 speed

 requirements [called bandwidth] i.e., how fast data is to be transferred

Twisted Pair (Shielded Twisted Pair and Unshielded Twisted Pair)


Becoming the cable of choice for new installations, twisted pair cable is readily accepted as the
preferred solution to cabling. It provides support for a range of speeds and configurations, and is
widely supported by different vendors.
Shielded twisted pair uses a special braided wire which surrounds all the other wires, which
helps to reduce unwanted interference.
The features of twisted pair cable are,

 used in token ring (4 or 16MBps), 10BaseT (Ethernet 10MBps), 100BaseT (100Mbps)

 reasonably cheap

 reasonably easy to terminate [special crimp connector tools are necessary for reliable
operation

 UTP often already installed in buildings

37
 UTP is prone to interference, which limits speed and distances

 low to medium capacity

 medium to high loss

 category 2 = up to 1Mbps (Telephone wiring)

 category 3 = up to 10Mbps (Ethernet and 10BaseT)

 category 5 = 100MBps (supports 10BaseT and 100BaseT)


Unshielded Twisted Pair cable used in Category 5 looks like

Category 5 cable uses 8 wires. The various jack connectors used in the wiring closet look like,

The patch cord which connects the workstation to the wall jack looks like,

Distance limitations exist when cabling. For category 5 cabling at 100Mbps, the limitations
effectively limit a workstation to wall outlet of 3 meters, and wall outlet to wiring closet of 90
meters.
All workstations are wired back to a central wiring closet, where they are then patched
accordingly. Within an organization, the IT department either performs this work or sub-
contracts it to a third party.

38
In 10BaseT, each PC is wired back to a central hub using its own cable. There are limits imposed
on the length of drop cable from the PC network card to the wall outlet, the length of the
horizontal wiring, and from the wall outlet to the wiring closet.

Patch Cables
Patch cables come in two varieties, straight through or reversed. One application of patch cables
is for patching between modular patch panels in system centers. These are the straight through
variety. Another application is to connect workstation equipment to the wall jack, and these
could be either straight through or reversed depending upon the manufacturer. Reversed cables
are normally used for voice systems.

How to determine the type of patch cable


Align the ends of the cable side by side so that the contacts are facing you, then compare the
colors from left to right.

If the colors are in the same order on both plugs, the cable is straight through. If the colors
appear in the reverse order, the cable is reversed.

Coaxial Cable
Coaxial cable has traditionally been the cable of choice for low cost, small user networks. This
has been mainly due to its ease of use and low cost. Persons with mininal network understanding
can readily build a LAN using coax components, which can often be purchased in kit ready
format.
The general features of coaxial cable are,

 medium capacity

 Ethernet systems (10Mbps)

 slighter dearer than UTP

 more difficult to terminate

 not as subject to interference as UTP

 care when bending and installing is needed

 10Base2 uses RG-58AU (also called Thin-Net or Cheaper Net)

 10Base5 uses a thicker solid core coaxial cable (also called Thick-Net)
39
Thin coaxial cable [RG-58AU rated at 50 ohms], as used in Ethernet LAN's, looks like

The connectors used in thin-net Ethernet LAN's are T connectors (used to join cables together
and attach to workstations) and terminators (one at each end of the cable). The T-connectors and
terminators look like

Fiber Optic
Fiber optic cable is considered the default choice for connections involving high speed [large
bandwidth requirements like video, large database systems], long distances and interconnecting
networks. It costs more than either twisted pair or coax, and requires special connectors and
jointing methods.
The features of fiber-optic cable systems are,

 expensive

 used for backbones [linking LAN’s together] or FDDI rings (100Mbps)

 high capacity [100Mbps]

 immune to electromagnetic interference

 low loss

 difficult to join

 connectors are expensive

 long distance
Fiber optic is often used to overcome distance limitations. It can be used to join two hubs
together, which normally could not be connected due to distance limitations. In this instance, a
UTP to Fiber transceiver [often referred to as a FOT] is necessary.

NETWORK SEGMENTS
A network segment

 is a length of cable

40
 devices can be attached to the cable

 has its own unique address

 has a limit on its length and the number of devices which can be attached to it

Large networks are made by combining several individual network segments together, using
appropriate devices like routers and/or bridges.

In the above diagram, a bridge is used to allow traffic from one network segment to the other.
Each network segment is considered unique and has its own limits of distance and the number of
connections possible.
When network segments are combined into a single large network, paths exist between the
individual network segments. These paths are called routes, and devices like routers and bridges
keep tables which define how to get to a particular computer on the network. When a packet
arrives, the router/bridge will look at the destination address of the packet, and determine which
network segment the packet is to be transmitted on in order to get to its destination.

41
In the above diagram, a packet arrives whose destination is segment B. The bridge forwards this
incoming packet from segment A to the B segment.

REPEATERS
Repeaters EXTEND network segments. They amplify the incoming signal received from one
segment and send it on to all other attached segments. This allows the distance limitations of
network cabling to be extended. There are limits on the number of repeaters which can be used.
The repeater counts as a single node in the maximum node count associated with the Ethernet
standard [30 for thin coax].

Repeaters also allow isolation of segments in the event of failures or fault conditions.
Disconnecting one side of a repeater effectively isolates the associated segments from the
network.
Using repeaters simply allows you to extend your network distance limitations. It does not give
you any more bandwidth or allow you to transmit data faster.

42
It should be noted that in the above diagram, the network number assigned to the main network
segment and the network number assigned to the other side of the repeater are the same. In
addition, the traffic generated on one segment is propagated onto the other segment. This causes
a rise in the total amount of traffic, so if the network segments are already heavily loaded, it's not
a good idea to use a repeater.
Summary of Repeater features

 increase traffic on segments

 have distance limitations

 limitations on the number that can be used

 propagate errors in the network

 cannot be administered or controlled via remote access

 cannot loop back to itself (must be unique single paths)

 no traffic isolation or filtering

BRIDGES
Bridges interconnect Ethernet segments..
The advantages of bridges are

 increase the number of attached workstations and network segments

 since bridges buffer frames, it is possible to interconnect different segments which use
different MAC protocols

 since bridges work at the MAC layer, they are transparent to higher level protocols

 by subdividing the LAN into smaller segments, overall reliability is increased and the
network becomes easier to maintain

 help localize network traffic by only forwarding data onto other segments as required
(unlike repeaters)
The disadvantages of bridges are

 the buffering of frames introduces network delays

 bridges may overload during periods of high traffic

 in complex networks, data may be sent over redundant paths, and the shortest path is not
always taken

 bridges pass on broadcasts, giving rise to broadcast storms on the network

43
Bridges are ideally used in environments where there a number of well defined workgroups, each
operating more or less independent of each other, with occasional access to servers outside of
their localized workgroup or network segment. Bridges do not offer performance improvements
when used in diverse or scattered workgroups, where the majority of access occurs outside of the
local segment.
The diagram below shows two separate network segments connected via a bridge. Note that each
segment must have a unique network address number in order for the bridge to be able to
forward packets from one segment to the other.

Ideally, if workstations on network segment A needed access to a server, the best place to locate
that server is on the same segment as the workstations, as this minimizes traffic on the other
segment, and avoids the delay incurred by the bridge.
Summary of Bridge features

 operate at the MAC layer (layer 2 of the OSI model)

 can reduce traffic on other segments

 broadcasts are forwarded to every segment

 most allow remote access and configuration

 often SNMP (Simple Network Management Protocol) enabled

 loops can be used (redundant paths) if using spanning tree algorithm

 small delays introduced

 fault tolerant by isolating fault segments and reconfiguring paths in the event of failure

 not efficient with complex networks

 redundant paths to other networks are not used (would be useful if the major path being
used was overloaded)

 shortest path is not always chosen by spanning tree algorithm

ROUTERS

44
Packets are only passed to the network segment they are destined for. They work similar to
bridges and switches in that they filter out unnecessary network traffic and remove it from
network segments. Routers generally work at the protocol level.
Routers were devised in order to separate networks logically. For instance, a TCP/IP router can
segment the network based on groups of TCP/IP addresses. Filtering at this level (on TCP/IP
addresses, also known as level 3 switching) will take longer than that of a bridge or switch which
only looks at the MAC layer.
Typically, an organization which connects to the Internet will install a router as the main
gateway link between their network and the outside world. By configuring the router with access
lists (which define what protocols and what hosts have access) this enforces security by restricted
(or allowing) access to either internal or external hosts.
For example, an internal WWW server can be allowed IP access from external networks, but
other company servers which contain sensitive data can be protected, so that external hosts
outside the company are prevented access (you could even deny internal workstations access if
required).

Summary of Router features

 use dynamic routing

 operate at the protocol level

 support complex networks

 the more filtering done, the lower the performance

 provides security

 segment networks logically

 broadcast storms can be isolated

HUBS
There are many types of hubs. Passive hubs are simple splitters or combiners that group
workstations into a single segment, whereas active hubs include a repeater function and are thus
capable of supporting many more connections.

45
Nowadays, with the advent of 10BaseT, hub concentrators are being very popular. These are
very sophisticated and offer significant features which make them radically different from the
older hubs which were available during the 1980's.
These 10BaseT hubs provide each client with exclusive access to the full bandwidth, unlike bus
networks where the bandwidth is shared. Each workstation plugs into a separate port, which runs
at 10Mbps and is for the exclusive use of that workstation, thus there is no contention to worry
about like in Ethernet.
These 10BaseT hubs also include buffering of packets and filtering, so that unwanted packets (or
packets which contain errors) are discarded. SNMP management is also a common feature.

Ports can also be buffered, to allow packets to be held in case the hub or port is busy. And,
because each workstation has it's own port, it does not contend with other workstations for
access, having the entire bandwidth available for it's exclusive use.
The ports on a hub all appear as one Ethernet segment. In addition, hubs can be stacked or
cascaded (using master/slave configurations) together, to add more ports per segment. As hubs
do not count as repeaters, this is a better option for adding more workstations than the use of a
repeater.
Hub options also include an SNMP (Simple Network Management Protocol) agent. This allows
the use of network management software to remotely administer and configure the hub. Detailed
statistics related to port usage and bandwidth are often available, allowing informed decisions to
be made concerning the state of the network.
In summary, the advantages for these newer 10BaseT hubs are,

 each port has exclusive access to its bandwidth (no CSMA/CD)

 hubs may be cascaded to add additional ports

 SNMP managed hubs offer good management tools and statistics

 utilize existing cabling and other network components


46
 becoming a low cost solution

NETWORK TOPOLOGY
Topology refers to the way in which the network of computers is connected. Each topology is
suited to specific tasks and has its own advantages and disadvantages.
The choice of topology is dependent upon

 type and number of equipment being used

 planned applications and rate of data transfers

 required response times

 cost
There are FOUR major competing topologies

 Bus

 Ring

 Star

 FDDI
Most networking software support all topologies.

Bus Topology
 all workstations connect to the same cable segment

 commonly used for implementing Ethernet at 10mbps

 the cable is terminated at each end

 wiring is normally done point to point

 a faulty cable or workstation will take the entire LAN down

 two wire, generally implemented using coaxial cable during the 1980's
The bus cable carries the transmitted message along the cable. As the message arrives at each
workstation, the workstation computer checks the destination address contained in the message
to see if it matches it's own. If the address does not match, the workstation does nothing more.
If the workstation address matches that contained in the message, the workstation processes the
47
message. The message is transmitted along the cable and is visible to all computers connected to
that cable.
There are THREE common wiring implementations for bus networks

 10Base2 (thin-net, CheaperNet) 50-ohm cable using BNC T connectors, cards provide
transceiver

 10Base5 (ThickNet) 50-ohm cable using 15-pin AUI D-type connectors and external
transceivers

 10BaseT (UTP) UTP cable using RJ45 connectors and a wiring centre

Physical Implementation Of A Bus Network

The above diagram shows a number of computers connected to a Bus cable, in this case,
implemented as Thin Ethernet. Each computer has a network card installed, which directly
attaches to the network bus cable via a T-Connector.
It is becoming common to use 10BaseT (UTP) for implementing Ethernet LANS. Each
workstation is wired in star fashion back to a concentrator wiring centre (hub). The hub is a
multi-port device supporting up to about 32 ports. One of these ports is connected to a server, or
the output of the hub can be connected to other hubs.

Ethernet 802.3: Carrier Sense Multiple Access with Collision Detection (CSMA/CD)
This protocol is commonly used in bus (Ethernet) implementations.

48
Multiple access refers to the fact that in bus systems, each station has access to the common
cable.
Carrier sense refers to the fact that each station listens to see if no other station is transmitting
before sending data.
Collision detection refers to the principle of listening to see if other stations are transmitting
whilst we are transmitting.
In bus systems, all stations have access to the same cable medium. It is therefore possible that a
station may already be transmitting when another station wants to transmit.
Rule 1 is that a station must listen to determine if another station is transmitting before initiating
a transmission. If the network is busy, then the station must back off and wait a random interval
before trying again.
Rule 2 is that a station which is transmitting must monitor the network to see if another station
has begun transmission. This is a collision, and if this occurs, both stations must back off and
retry after a random time interval. As it takes a finite time for signals to travel down the cable, it
is possible for more than one station to think that the network is free and both grab it at the same
time.
CSMA/CD models what happens in the real world. People involved in group conversation tend
to obey much the same behavior.

Physical Bus Cable Limits


10Base2 THIN ETHERNET NETWORK LAYOUT
Limitations

 maximum number of trunk segments = 5

 maximum trunk segment length = 607 feet (185 meters)

 maximum network trunk cable = 3035 feet (925 meters)

 maximum number of stations on a trunk segment = 30

 minimum distance between T connectors = 1.5 feet (0.5 meters)


Rules

 each end of the trunk segment is terminated in 50-ohms

 one of the terminators is grounded

 connector splices are kept to a minimum


Cabling

 BNC-T type connectors

49
 RG58-AU 50-ohm cable, 0.2"

10Base5 THICK ETHERNET NETWORK LAYOUT


Limitations

 maximum number of trunk segments = 5

 maximum trunk segment length = 1640 feet (500 meters)

 maximum network trunk cable = 8200 feet (2500 meters)

 maximum number of stations on a trunk segment = 100

 minimum distance between transceivers = 8 feet (2.5 meters)

 maximum transceiver cable length = 165 feet (50 meters)


Rules

 each end of the trunk segment is terminated in 50-ohm

 one of the terminators is grounded

 connector splices are kept to a minimum


Cabling

 Transceivers 802.3

 50-ohm cable RG-11

 Male DIX connector


Wiring of the DIX Connector

Bus Network Topology Summary


Advantages Disadvantages
Easy to
Limits on cable length and Workstation numbers
implement
Low Cost Difficult to isolate network faults
A cable fault affects all workstations

50
As the number of workstations increase, the speed of the network slows down

Ring Topology
 workstations connect to the ring

 faulty workstations can be bypassed

 more cabling required than bus

 the connectors used tend to cause a lot of problems

 commonly used to implement token ring at 4 and 16mbps

 four wire, generally STP or UTP

Physical Implementation Of A Ring Network


Each workstation is connected back to a Multiple Access Unit (MAU), which supports up to
eight workstations. Additional MAU are cascaded to provide greater workstation numbers.

51
Wiring is performed in a physical star fashion, with cables wired directly from each workstation
back to the MAU.

IEEE 802.5 Token Ring


This protocol is widely used in ring networks for controlling station access to the ring. A short
message (called a token) is circulated around the ring, being passed from station to station (it
originates from a controller or master station which inserts it onto the ring).
A station which wants to transmit waits for the token to arrive. When the token arrives, the
station changes it from a token to a connector message, and appends its message. This new
message is then placed on the outgoing side of the ring.
Each station passes on received tokens if they have nothing to transmit. They monitor connector
messages to see if the message is addressed to them. If connector messages are addressed to
them, they copy the message, modify it to signify its receipt, then send it on around the ring.
Connector messages which are not addressed to them are passed directly on to the next station in
the ring.
When the connector message travels full circle and arrives at the original sending station, it
checks the message to see if it's been received. It then discards the message and replaces it with a
token.

52
Either

53
Or

Physical Ring Cable Limits


TOKEN RING NETWORK LAYOUT
Limitations

 maximum number of workstations = 96

 maximum number of 8228 MAU's = 12

 maximum patch cable distance between an 8228 MAU and a station (not including 8'
adapter cable) = 150 feet (45 meters)

 maximum patch cable distance between two 8228's = 150 feet (45 meters)

 maximum patch cable connecting all 8228's = 400 feet (120 meters)
Rules

54
 stations are connected into the jacks of the 8228 units

 patch cables interconnect RO to RI for 8228 units.

 the last RO is connected to the first RI to form a ring.


Cable

 patch cables generally type 6 (26 awg) or 1 (22 awg)

 type 1 for lengths > 66 feet (20 meters)

 IBM 8310574 MIC connectors

 alternatively, UTP with RJ45 connectors

Ring Topology: Summary

Advantages Disadvantages

Cable failures affect limited users Costly Wiring

Equal access for all users Difficult Connections

Each workstation has full access


Expensive Adaptor Cards
speed to the ring

As workstation numbers increase


performance diminishes slightly

Star Topology
 all wiring is done from a central point (the server or hub)

 has the greatest cable lengths of any topology (and thus uses the most amount of cable)

 generally STP or UTP, four wire

55
Star Topology: Summary

Advantages Disadvantages

Hub failure cripples all workstations


Easy to add new workstations
connected to that hub

Centralized control Hubs are slighty more expensive than thin-Ethernet

Centralized network/hub monitoring

FDDI Topology
 100mbps

 normally implemented over fiber optic (fast-Ethernet, UTP)

 dual redundancy built in by use of primary and secondary ring

 automatic bypassing and isolation of faulty nodes

56
Fiber Distributed Data Interface
FDDI is based on two counter rotating 100-Mbit/sec token-passing rings. The rings consist of
point to point wiring between nodes which repeat the data as it is received.
The primary ring is used for data transmission; the secondary is used for data transmission or to
back up the primary ring in the event of a link or station failure. FDDI supports a sustained
transfer rate of about 80Mbps, a maximum of 1000 connections (500 nodes) and a total distance
of 200 kilometers end to end. There is a maximum distance of 2 kilometers between active
nodes.

FDDI Station Types


There are two main types of stations, class A which attach directly to dual rings; or class B
which attach to a station acting as a concentrator.
A concentrator is a specialized workstation that attaches to the ring and has multiple ports that
allow attachment of other devices in a physical star configuration. These may be cascaded.

Logical Networks versus Physical Networks


A logical network describes how the network operates. A physical network describes how the
network has been cabled. It is thus possible to have a physical star, logical bus network. In other
words, the network operates as a bus network, but the cabling has been implemented using star
topology.

57
58

You might also like