CIT 001 - Fundamentals of Computer System
CIT 001 - Fundamentals of Computer System
UNIT 1 INTRODUCTION TO PC
1.0 Introduction 5
1.1 Objectives 5
1.2 Introduction to PC 6
1.3 Central Processing Unit (CPU) 10
1.3.1 Control Unit
1.3.2 Arithmetic Logic Unit
1.4 Types of Main Memory 14
1.4.1 RAM
1.4.2 ROM
1.4.3 PROM
1.4.4 EPROM
1.5 Secondary (auxiliary) Memory 19
1.6 Input/Output devices 22
1.7 Peripherals 23
1.8 Summary 26
1.9 Solutions / Answers 28
1.10 Further Reading and References 31
1.0 INTRODUCTION
Computer is the most powerful tool man has ever created. Computers are used in almost
every working place in the modern times that is school, colleges, offices, railways,
banks, industries, hospitals etc. The word “computer” comes from the word “compute”
which means to calculate. So a computer can be considered as a calculating device that
can perform arithmetic operations at a high speed but more accurately.
Computer is a digital electronic storage device, which accepts data and set of
instructions, manipulates it, and retrieves the information at very high speed. In
other wards we can say that a computer is a data processing device which following
specific instructions, perform a sequence of operations to achieve a desired result.
In this unit we will discuss about personal computer (PC) and its components. From
here onward, the words PC and computer are used interchangeably.
1.1 OBJECTIVES
• describe the various types of memory such as RAM, ROM, PROM and
EPROM etc.;
5
Hardware and Software: An
Introduction
• define and explain the various types of I/O (Input and Output) devices; and
1.2 INTRODUCTION TO PC
Specifically, a computer receives input (data or/and instructions) through the input
devices (such as keyboard or mouse) process the data according to the specified
instructions and then presents the output (results) in a readable form on its output
device, i.e. either on its screen/monitor or on paper through the printer attached to it.
A simple analogy can be drawn between the sequence of operations performed by a
computer and man to process data.
Suppose a student asks a teacher “what happens when 8 is multiplied by 6”. He receives
the answer 40 from teacher. In the case of computer, this process can be described as
follows: The teacher’s brain receives the question through his ears (analogous to a
computer’s input device), processes the question with the help of his brain’s information
processing and analytical ability (analogous to computer’s Central Processing Unit) and
give the answer through the mouth (analogous to a computer’s output device). Further,
just as the teacher can write down the answer on a sheet of paper or blackboard, the
computer can also print the answer on a paper through a printer attached to it.
System Unit
Monitor
Keyboard Mouse
The CPU resides inside a box known as the System unit, along with various support
devices and tools for storing information. You can think of the system unit as a
container for the CPU. The system unit case can either be short and wide usually
underneath the screen (as in Figure-1) or it can be taller and narrow (Figure 2) and
generally sits below of your desk.
CPU Container
6
Introduction to PC
The most notable things in a desktop PC are the screen (or monitor), keyboard, mouse,
etc. However, from an architectural point of view, Figure 3 represents a true picture of a
PC
Memory
CPU Program
Peripherals Devices
ALU CU
Data
General Register
Keyboard
Instruction Register Disks Mnitor + Mouse
Memory Bus
Network Interface
To network
Here memory (system) bus provides a communication between the system components
(the CPU, printers, storage etc). The bus is a cable, which carries signals representing
data from one place to another. For example, when data needs to be sent from memory
to a printer, it will be sent via the system bus.
Personal Computers (PCs) are used in almost every working place such as school,
colleges, offices; railways, banks, industries, hospitals, art and entertainment etc. The
following Table illustrates various fields where we are using PCs.
Fields Uses
EDUCATION Developing and publishing course material, Drawing
pictures, Doing Research work etc.
BUSINESS AND Maintaining daily account (i.e., Sales, purchase etc.),
PERSONAL Communicate with your business partner through e-mail,
chat etc.
SCIENTIFIC Scientific research work, taking a photographs of spaces with
the help of computers etc.
HEALTHCARE For scanning any part of our bodies, Doctors can search
latest research & medicine through computers.
ART AND You can create your own drawing/painting, listening music
ENTERNTAINMENT & watching movies through computers
7
Hardware and Software: An
Introduction
1. Input Device (i.e., Keyboard, mouse, scanner etc.)
2. Processor (or CPU):
• Control Unit (CU)
• Arithmetic-Logic Unit (ALU)
• Memory Unit
3. Output Device (Visual Display Unit (Monitor/Screen), Printer etc.)
Memory (main)
Arithmetic-Logic
Unit
• The CPU is like the human brain; it has a memory and just like there is
a faculty in the brain that regulates the functioning of all parts of the body; it has
a control-unit (CU), which controls the entire operation of a computer including
its input and output devices.
• The input is released under the direction of control unit (CU) from the input
device (say key board) to the memory unit.
• The control unit directs the requisite part of input to be sent to the ALU for
being processed.
• After the processing is over, control unit directs the ALU to release the
processed output to the memory.
• Then, finally, the output is released from the memory to the output device (say
8
monitor/screen). Introduction to PC
These four functions are responsible for everything that computers do. Components of
a computer system are given in Figure 5.
CPU
(Primary Memory)
3) How do the main components of the computer communicate with each other?
a) System bus
b) Memory
c) Keyboard
d) Monitor
b) Information processing
c) Information storage
In a human body, the brain takes all major decisions and the other parts of the body
10
function as directed by the brain. Similarly, in order to work a computer, also need some Introduction to PC
sort of “brain” or “calculation capacity”. In a computer system, there is a device roughly
the size of a large postage stamp, known as the central processing unit (CPU). In a
computer system, all major calculations and comparisons are made inside the CPU . It is
also responsible for activating and controlling the operations of other units of a
computer system.
The CPU resides inside a box known as the system unit, along with various support
devices and tools for storing information. Just think of the system unit as a container for
the CPU. The system unit case, that is the metal case itself, usually sits on top of your
desk, often underneath the screen (as shown in Figure-1), or it can be taller and narrow,
in which case it generally sits underneath your desk and is referred to as a tower case (as
shown in Figure-2).
CPU reads and executes program instructions, performs calculations, and makes
decisions. The CPU is mainly responsible for storing and retrieving information on disks
and other media. It also handles information from one part of the computer to another
and directs the flow of traffic throughout the computer system. Below you can see
meaning of each word of a Control Processing Unit.
Basically the Control Unit (CU) and the Arithmetic-Logic-Unit (ALU) of a computer
system are jointly known as the Central Processing Unit (CPU). Logically we can say:
CPU=CU+ALU
11
Hardware and Software: An
Introduction
Thus the CPU has mainly two parts:
The Control Unit (CU) controls the entire operation of a computer. It is responsible of
carrying out program instructions and telling the rest of the computer system what to do.
It manages and coordinates the entire computer system.
It obtains instructions from the program stored in the main memory, interprets the
instructions, and issues signals that cause other units of the system to execute them.
Although, it does not perform any actual processing on the data, the control unit acts as
a central nervous system for the other components of the computer. It manages and
coordinates the entire computer system.
The Arithmetic-Logic-Unit (ALU) of a computer system is the place where the actual
execution of the program instructions takes place during the processing operation.
The internal architectural design of computers differs from one system to another.
However, the basic organization remains the same for all computer system. A block
diagram of the basic computer organization is shown in Figure 6. Now let us look at
each part of CPU in detail.
How does the input device know that it is the time for it to feed data into the storage unit
(or memory)? How does the ALU know what should be done with the data once those
are received?
And how the final results are sent to output device (monitor/screen or printer etc.), not
the intermediate result? All this is possible because of the control unit (CU) of the
computer system. By selecting, interpreting and seeing to the execution of the program
instructions, the control unit is able to maintain order and direct the operation of the
entire system. The control unit (CU) basically does the following things:
• The CU is responsible of carrying out program instructions and telling the rest
of the computer system what to do.
• It obtains the instructions from the program stored in the main memory,
interprets the instructions and issues signals that cause other units of the system
to execute them.
• The Instruction Register contains a current instruction once it has been fetched
from the primary memory. The control unit uses the instruction contained in the
Instruction Register to decide which circuits need to be activated (see Figure
5). Program counter contains the address of the next instruction to be fetched for
execution (Figure 5).
12
Introduction to PC
• It communicates with both the arithmetic logic unit and main memory.
• The control unit co-ordinates the activities of the other two units as well as all
peripheral and auxiliary storage devices linked to the computer.
• The CU instructs the arithmetic logic unit which arithmetic operations (such as
addition, subtraction etc.) or logical operation (comparison between two
number) is to be performed through control logic unit shown in Figure 7.
Control Unit
Fetch Unit Control Logic Unit
Instruction Register
Decode Unit
Program Counter
+1
Specialized electronic circuits (fetch and decode unit) in the control unit is designed to
fetch and decode program instructions held in the main memory. Each instruction is
read from the memory into the instruction register. The process of reading an instruction
is often referred to as the fetch-execute process.
The arithmetic Logic unit (ALU) of a computer system is the place where the actual
execution takes place.
• Relational operator (=, <, >), i.e., equal to, less-than and greater-than are used to
describe the comparison operations by the ALU.
• ALU carries out arithmetic operations on integer (whole number) and real (with
a decimal point) operands. It performs simple logical tests for integers operands
only.
• The data and instructions, stored in the primary memory prior to the processing,
are transferred as and when need to the ALU, when processing takes place.
13
Hardware and Software: An
Introduction
• No processing is done in the primary storage unit (or memory).
• Data may thus move from primary storage to ALU and back again to storage
many times before the processing is over.
• After the completion of processing, the final results, which are stored in the
storage unit, are released to an output device (monitor/screen or printer).
To understand the operation of CU, ALU etc., let us execute the statement
(or command) R=n1+n2. This statement adds two numbers n1 and n2 and
places the result in a location X (refer the Figure 8).
CONTROL UNIT
ADD INSTRUCTION
Step 1
Move
instruction to
the control unit Step 3
The control unit
signals the ALU
perform “addition
operation” on the
Memory two numbers and
Locations Numbers 1(n1)
Let R = n1+n2 to store the result
in the
Numbers 2(n2)
accumulator
Step 2
Result R The two
numbers are NUMBER 1
MEMORY UNIT brought from
memory and +
placed in the NUMBER 2
ALU
RESULT
Step 4 (ACCUMULATOR)
Send result in
memory ARITHMETIC AND LOGIC UNIT
14 (ALU)
Figure 8: CPU Operation to find data and instructions (Adding two numbers)
Introduction to PC
The data and instructions which are entered into the computer system through input
devices (keyboard, mouse etc.) have to be stored inside the computer before the actual
processing starts. Similarly, after processing, the results produced by the computer must
be kept somewhere inside the computer system before being passed onto the output
devices (monitor/screen or printer). Thus, the storage unit (primary/main memory) of a
computer system is designed to take care of all these needs.
The memory unit is the electronic device that holds data and instructions for processing.
It consists of binary cells (i.e., 0 or 1 signals) to store the information. Thus,
• the memory unit that directly communicate with the CPU is called the primary
storage or primary memory or main storage or main memory.
• when we load software from floppy disk, pen drive, hard disk or CD-ROM, it is
stored in the main memory.
• there are two types of computer (main) memory inside the computer (as shown
in Figure 9):
• Random Access Memory (RAM) is really the main store and is the place where
the program and software we load gets stored. When CPU runs a program, it
15
Hardware and Software: An
fetches the program instructions from the RAM and carries them out. Similarly,
Introduction
if the CPU needs to store the final results of calculations, it stores those in
RAM. Thus, you (CPU) can both READ data from RAM and WRITE data into
the RAM.
• If your computer has large RAM, you can run larger programs.
• RAM is known as volatile memory, that is, the stored data are lost, if the power
goes off. The following Figure 10 shows a common RAM chip.
Mother board is a microcomputer circuit board that contains slots for connecting
peripherals like RAM modules, CPU and adapter cards. Motherboards also have
electronic circuitry for handling such tasks as I/O signals from those peripheral devices.
A motherboard is the backbone of a computer system: The power of a PC highly
depends on the peripherals that its motherboard supports.
In older days, the first home PC’s uses a 64 KB of RAM memory. Today’s modern
computers need a minimum of 64 MB (recommended 128 MB or 256 MB) to run
Windows or Linux Operating system with latest number of software. A RAM memory
chips come in many different sizes ranging from 1 MB to 2 GB.
• ROM is used for storing special set of instruction, which the computer needs
when it start up (boot up).
• Unlike RAM, the information from ROM can only be READ and it is not
possible to WRITE fresh information to it. That is the CPU can only fetch or
READ instructions from ROM. This is the reason why it is called ROM.
• When we switch the computer off, the contents of the ROM does not get erased.
Therefore, it is non-volatile memory. Thus, a Read Only Memory (ROM) is
one in which information is permanently stored. The following figure shows a
relationship between the CPU and main memory (RAM and ROM).
16
Introduction to PC
RAM
CPU
ROM
Figure 11: Relationship between the CPU and main memory (RAM and ROM).
• The information stored in an EPROM chip is erased by exposing the chip for
some time to ultraviolet light.
• When an EPROM chip is in use, information can only be READ and the
information remains on the chip until it is erased.
• An EPROM differs from a PROM in that a PROM can be written to only once
and can not be erased.
• EPROMs are widely used in personal computer they enable the manufacturer to
17
Hardware and Software: An
change the contents of the PROM before the computer is actually delivered.
Introduction
This means that bugs can be removed and new versions installed shortly before
delivery.
a) Computer can communicate with other computers and can receive and send data
in various forms like text, sound, video, graphics etc.
c) The Control Unit communicates with both ALU and Main memory.
d) The Arithmetic & Logic unit (ALU) controls the entire operation of a computer. It
manages and coordinates the entire computer system.
h) ALU can perform performs logical tests only for integers operands only.
k) When we load software from floppy disk, hard disk or CD-ROM, it is stored in
the main memory.
l) RAM & ROM are the two types of computer main memory inside of a
computer.
m) Non-Volatile memory means the stored data are lost, if the power goes off.
a) RAM
b) ROM
c) PROM
18
Introduction to PC
ii) Which of the following memory loses it contents when the computer turned off?
a) RAM
b) ROM
c) PROM
iii) Which of the following memory chip is programmed during the manufacturing
process?
a) RAM
b) ROM
c) PROM
d) EEPROM
a) Sunlight
b) Ultraviolet Radiation
c) Magnetic field
d) Electric Charge
……………………………………………..………………………..
………………………………………………………………………………………
……………………………………………………………..
………………………………………..
5) What are the main functions of Control-unit (CU) and Arithmetic/Logic unit (ALU)?
……………………………………………..………………………….
………………………………………………………………………………………
19
Hardware and Software: An
……………………………………………………………..
Introduction
……………………………………..
External Storage/Auxiliary Storage (i.e. Hard Disk, Floppy Disk, CD-ROM, DVD,
Zip-Drive, magnetic tape) – provides a place where data can be permanently stored
and transferred to and from main memory (RAM).
The most important auxiliary storage devices are Hard Disk, Floppy Disk, CD-ROMs,
DVD, magnetic tapes, magnetic disks etc.
• Floppy Disk
Portable disks means that you can carry with you or can be remove
them from disk drive A.
Slower to access then hard-disks and has less storage capacity, but they are
less expensive and portable.
Non-Portable. The hard drive is the primary device that a computer uses
to store information.
Most computers have one hard drive located inside the computer case.
If a computer has one hard drive, it is called drive C. If a computer has
additional hard drives, they are called drives D, E, F, and so on.
The hard drive stores the programs on your computer. When you buy a
new program, you must first install in onto your hard drive before you can
20
run it. The hard drive is also called the hard disk, hard disk drive or fixed Introduction to PC
disk drive.
Platter
• CD-ROM Drive
CD-ROM stands for Compact Disk Read Only Memory. A CD-ROM drive
reads information from a compact disk. CD-ROMs are high capacity storage,
and like, floppy disks are portable (removable). You cannot write information
to a CD-ROM (because it is read only), you can only retrieve information.
However, CD-RW (CD Rewritable) drives are becoming more common, these
drives allow you to record data such as music files etc. onto CD-RW disks. You
can change the data on CD-RW disks.
When you type a letter in MS Word, as you type it is being stored in RAM,
when you save the file (either to your floppy disk or your hard disk) you are
saving to auxiliary storage. The next time you open your letter, you are
retrieving it from the auxiliary storage into memory. Auxiliary storage is
considered both an input and an output device.
• Magnetic tape:
The table on next page summarizes the different types of secondary (auxiliary)
memory devices:
21
Hardware and Software: An
Introduction
CD-ROM/ 650-700 MB • Portable & Medium storage Some older computers To store
CD-R/ CD- capacity cannot read CD-RW files and Optical
Inexpensive media software
• Some types (CD-RW) can be • CD-R discs are ‘write • To store
reused i.e. rewritable disk. once’, which means archive
• Can be used in certain models once data is copied to material
of DVD player it, new or additional from hard
data cannot be added disks
• To store
scanned files
such as
exam papers
• To store
applications
from the
Internet
22
Introduction to PC
DVD-ROM 4.7GB to Large storage capacity • Not all computers can Same as Optical
DVD±R 8.5GB • Some types read DVD±R or CD-ROM/
DVD±RW (DVD±RW) can be reused or DVD±RW disks. CD-R/CD-
rewritable. • DVD±R discs are RW
‘write once’, which
• Can be used in certain models means once data is
of DVD player. copied to it, new or
additional data cannot
be added
23
Hardware and Software: An
Introduction
In this section you will get introduced with the various types of I/O devices available for
computer systems. The topics discussed here briefly will be taken up in detail in the
Unit 3 of this block.
The input-output (also known as I/O) devices provide the means of communication
between the computer and the outside world. They are also known as peripheral devices
because they surround the CPU.
Without any input devices a computer would simply be a display device and not allow
users to interact with it, much like a TV.
When using a computer, you must send commands to the computer, and data to be
processed. Also, data must be returned from the computer to the user. In order to do
this, the computer makes use of input and output devices.
• Input devices (such as keyboard, mouse, joystick etc.) are used to enter data
into primary storage (or primary memory) or a hardware device that sends
information into the CPU.
The Table 3 highlights the categories of which the input devices.
Output Devices
The output generated by a computer can be transmitted to the user via some devices or
media. These devices are called output devices. The following are some examples of
24
different types of output devices commonly found on a computer. Introduction to PC
Monitor
Printer
Sound card & Speakers
Video card
Plotter
Monitor (or screen) is also called a video display unit (VDU) that displays both input
and output data. It consists of CRT (Cathode Ray Tube) technology. It is basically
electronic “gun” which shoots (emits) the beam of electrons and illuminates the pixels
on the screen.
There are two broad categories of Printers i.e., Impact & Non impact printers. Impact
printer uses striking action to press carbons against a paper to create a character. Dot
Matrix printer and Inkjet printer are some examples of impact printer. The term
DOT matrix refers to the process of placing dots to form an image. The quality of the
image is determined by the dots per inch.
Inkjet printer forms text and/or images by spraying streams of quick-drying ink on
paper. The ink is stored in disposable ink cartridges; often a separate cartridge is used
for each of the major colors. These colors are usually Black, Red/Magenta, Green/Cyan,
and Yellow (CYMK). Today, dot matrix printers are not commonly used or found
because of the low quality print outs, when compared to ink jet printers or other later
printer, technologies. A Non impact printer such as laser printer uses a laser
technology to print images on the paper. Laser printers are often used in corporate,
school, and other environments that require print jobs to be completed quickly and in
large quantities.
A Sound Card (also known as a sound board or an audio card) is an expansion card
or integrated circuit that provides a computer with the ability to produce sound that can
be heard by the user.
A Speaker is basically a hardware device connected to a computer's sound card that
outputs sounds generated by the card.
Plotter is used in engineering and architectural drawing. It uses a computer driven pen
for creating blacks and white or color graphic images like charts, graphs etc.
Peripheral devices are used to communicate with the “outside world” or hold
information over the long period. Peripheral devices may fall into 3 basic classes:
i) Input Devices: Mouse, Keyboard, trackball, Joystick, Scanner, digital camera etc.
ii) Output Devices: Display screen (Monitor), Printer and Speaker etc.
iii) Mass storage Devices: Floppy disk, Pen Drive, Hard disk, CD-ROMs etc.
25
Hardware and Software: An
The Table 4 shows internal and external devices of any computer system.
Introduction
b) When we load software from floppy disk, hard disk or CD-ROM, it is stored in
the main memory.
d) Hard-disks hold more data and are faster than floppy disks.
g) In all color monitors, each pixel is composed of three dots-red, blue and green.
h) Bandwidth determines how many times or otherwise, per second the screen is to
be refreshed.
i) Mouse
ii) Printer
iii) Monitor
26
Introduction to PC
iv) All of the above
b) CD-ROM is an example of
i) Input device
i) Zip disk
ii) Hard-disk
i) CD-ROM
ii) Hard-Disk
i) OCR
ii) OMR
iii) MICR
iv) MCR
i) Keyboard
ii) Mouse
iii) Trackball
27
Hardware and Software: An
iv) Bar code reader
Introduction
i) Pixel
ii) Resolution
iii) Bits
iv) Hertz
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………
………..
……………………………………………………………………………………
……………………………………………………………………………………
…………………………………………………………………..……
5) What is the difference between a laser and inkjet printer?
………..………………………………………………………..
………………………….
……………………………………………………………………………………
……………………………………………………………………………
6) Explain how data is stored on a Disk?
………..………………………………………………..
……………………………………………………………………………………
……………………………………………………………………………………
…………………………
7) List and compare the various optical storage media available for personal computers.
………..……………………………………………………..
……………………………………………………………………………………
……………………………………………………………………………………
……………………
28
Introduction to PC
1.8 SUMMARY
• The word “computer” comes from the word “compute” which means to
calculate. So a computer can be considered as a calculating device that can perform
arithmetic operations at a high speed but more accurately.
• A computer receives input (data or/and instructions) through the input devices
(such as keyboard or mouse), process the data according to the specified
instructions (via CPU) and then presents the output (results) in a readable form
on its output device, i.e., either on its screen/monitor or on paper through the
printer attached to it.
• The Control Unit : controls the fetching of instructions from the main memory
and the subsequent execution of these instructions. The control unit also
controls the operation of the peripheral devices (keyboard, monitor or printers
etc.) and the transfer of information between the units that make up the
computer.
• The memory of the computer is split into main memory and external
(secondary/auxiliary) memory.
29
Hardware and Software: An
Introduction
• Main memory is fast and limited in capacity. The CPU can only directly access
information in main memory. Main memory cannot retain information when the
computer is switched of. Main memory consists of a series of numbered locations called
bytes, each byte equals eight bits.
• Secondary memory is slow and virtually unlimited in capacity information
remain in it, even when the computer is switched off.
• Information on external memory cannot directly access by the CPU. The
information stored on external memory is first transferred to main memory, and
then can be accessed by the CPU.
• The internal representation of information in the computer and on external
memory is in terms of the Binary system using only the basic symbols 0 and 1.
• Programs to be executed by the computer are placed in main memory and the
CPU fetches each instruction in turn from memory and executes it.
• The memory unit that directly communicated with the CPU is called the
primary memory or main memory
• There are two types of computer (main) memory inside the computer i.e., RAM
(Volatile) and ROM (Non-volatile).
• ROM chips are supplied by computer manufacturer and it is not possible for a
user to modify the programs stored inside the ROM chip. However, in case of
PROM (non-volatile), it is possible for a user to customize a system by storing
own program in a PROM chip.
• Input devices (such as keyboard, mouse, joystick etc.) are used to enter data
into primary storage (or primary memory) or a hardware device that sends
information into the CPU.
• The output generated by a computer can be transmitted to the user via some
devices or media. These devices are called output devices such as monitor,
printer etc.
1.9 SOLUTION/ANSWERS
30
1) a) T Introduction to PC
b) T
c) T
d) F
f) T
g) T
h) T
2) d
3) a
4) d
5) d
1) a) T
b) F
c) T
d) F
f) T
g) F
h) T
i) T
J) T
k) T
l) T
m) F
2) (i) d
(ii) a
(iii) b
(iv) d
3) The control unit (CU) and the arithmetic-logic-unit (ALU) of a computer system are
jointly known as the Central Processing Unit (CPU).
The Control Unit (CU) controls the entire operation of a computer. It is responsible
to carries out program instructions and tells the rest of the computer system what to
do. It manages and coordinates the entire computer system. It obtains instructions
from the program stored in the main memory, interprets the instructions, and issues
signals that cause other units of the system to execute them. It manages and
coordinates the entire computer system.
Memory (main)
31
Hardware and Software: An
Introduction
Arithmetic-
Logic Unit
• The input is released under the direction of control unit (CU) from the input
device (say key board) to the memory unit.
• The control unit directs the requisite part of input to be sent to the ALU for
being processed.
• After the processing is over, control unit directs the ALU to release the
processed output to the memory.
• Then, finally, the output is released from the memory to the output device (say
monitor/screen).
• It obtains the instructions from the program stored in the main memory,
interprets the instructions, and issues signals that cause other units of the system
to execute them.
• The control unit uses the instruction contained in the Instruction Register to
decide which circuits need to be activated.
• It communicates with both the arithmetic logic unit and main memory.
• The control unit co-ordinates the activities of the other two units as well as all
peripheral and auxiliary storage devices linked to the computer.
• The CU instructs the arithmetic logic unit which arithmetic operations (such as
addition, subtraction etc.) or logical operation (comparison between two
number) is to be performed.
The arithmetic Logic unit (ALU) of a computer system is the place where the actual
execution takes place. It does the following:
32
• All the Arithmetic calculations such as addition, subtraction, multiplication, and Introduction to PC
division are performed and all comparisons (decisions) are made in the ALU.
• Relational operator (=, <, >), i.e. equal to, less-than and greater-than are used to
describe the comparison operations by the ALU.
• ALU carries out arithmetic operations on integer (whole number) and real (with
a decimal point) operands. It performs simple logical tests for integers operands
only.
• The data and instructions, stored in the primary memory prior to the processing,
are transferred as and when need to the ALU, when processing takes place.
• After the completion of processing, the final results, which are stored in the
storage unit, are released to an output device (monitor/screen or printer).
1) a) T b) T c) T d) T e) T f) T g) T h) F i) F j) T
4) Input devices (such as keyboard, mouse, joystick etc.) are used to enter data into
primary storage (or primary memory) or a hardware device that sends information
into the CPU. The output generated by a computer can be transmitted to the user via
some devices or media. These devices are called output devices such as Monitor,
printer, sound-card etc.
5) Inkjet printer forms text and/or images by spraying streams of quick-drying ink on
paper. The ink is stored in disposable ink cartridges; often a separate cartridge is used
for each of the major colors. These colors are usually Black, Red/Magenta,
Green/Cyan, and Yellow (CYMK). Today, dot matrix printers are not commonly
used or found because of the low quality print outs, when compared to ink jet
printers or other later printer, technologies.
A laser printer uses a laser technology to print images on the paper. Laser printers
are often used in corporate, schools, and other environments which require print
jobs to be completed quickly and in large numbers.
6) Disks stores data in tracks, Tracks are divided into sectors, sectors are divided into
clusters. A cluster is a basic unit for data storage. Hard-disks and Floppy disks stored
33
Hardware and Software: An
data in similar way. Hard-disks have multiple platters.
Introduction
Web Links:
• www.en.wikipedia.org
34
Hardware and Software: An
Introduction
UNIT 2 STORAGE ORGANISATION
2.0 Introduction 32
2.1 Objectives 32
2.2 Memory and Storage Devices 33
2.2.1 Semiconductor (Main) Memory
2.2.2 Magnetic Memory
2.2.3 Optical Memory
2.3 Memory Hierarchy 50
2.4 Summary 53
2.5 Solutions/Answers 53
2.6 Further Readings and References 55
2.0 INTRODUCTION
In the previous unit we have discussed the basics of computers such as Central
Processing Unit (CPU), Memory, Input/Output and peripheral devices. In this unit, we
will discuss one of the most important component of a computer system known as
memory unit.
Memory unit is an important component of a computer where all the data and
information is stored in the form of binary digits (combination of 0’s and 1’s) and
retrieved whenever it is necessary. Computer system uses a variety of devices for storing
the instructions and data. These memory devices can be in different categories according
to access time, storage capacity & costperbit of storage. In this unit detailed discussion
will be on storage devices and their organization.
2.1 OBJECTIVES
32
Hardware and Software: An
Introduction
2.2 MEMORY AND STORAGE DEVICES
Based on these criteria, as we have also discussed in the previous unit of this block,
memory is broadly categorized into two types:
Semiconductor memory (i.e. RAM, ROM etc.) have faster access time, smaller storage
capacity, and higher cost per bit of storage, as compared to the secondary memory.
CPU is dependent on the main memory for storage of data and instruction required for
processing. For every data/instruction, CPU sends the address to the Memory Address
Register (MAR) through address lines and a control signal to the main memory. The
main memory supplies the required information (data/instruction) to the CPU through
the Memory Data Register (MDR). The main memory answers the request of the CPU at
the speed which is slower than the CPU. During this process the CPU remains idle and
the overall system speed and performance is reduced because of speed mismatch
between CPU and memory.
To reduce the idle time of CPU or increase the speed of processing, a fast memory can
be used. This can be done by using a large size of main memory. But the cost of main
memories of large size is very expensive. To reduce the cost of large sized memory,
special type of high speed memory, known as cache memory can be used in between the
CPU and the main memory (as shown in Figure1). Thus, the cost versus access time
leads to a hierarchy of computer memory. A typical computer system supports a
hierarchy of memory system because no technology may be able to satisfy all the
requirements (speed storage capacity etc.) of a system. Memory hierarchy includes CPU
(registers), Cache memory, main memory and various secondary storage devices.
Although memory hierarchy organized in such a way to minimize the cost, but it does
not compromise the overall speed of access.
Main
CPU Cache
Memory
Memory
In this unit we will mainly focus on storage organization and storage devices such as
disk/tape, CD/DVD and ROM/PROM etc. We also discuss the memory hierarchy which
includes main memory and high speed memory such as cache memory.
Memory is an important component of a computer where all the data and information
are stored in the form of binary digits (combination of 0’s and 1’s) and retrieved
whenever it is necessary. A computer system uses a variety of devices for storing these
instructions and data. When you want to execute a computer program, the program has
to be in the main memory. Any input data needed for processing by that program should
also be in memory. All the intermediate results and outputs from the program are stored
in the memory until the machine is turned off.
The main functions of the memory are:
33
Storage Organization
To store programs, data and information into the computer.
To store the results of computation.
A computer system uses a variety of devices for storing these instructions and data.
These storage units of a computer system are ranked according to the following criteria:
1) Access time: This is the time required to locate and retrieve stored data from the
storage unit in response to program instruction. A fast access time is always
preferred.
2) Storage capacity: It is the amount of data that can be stored in the storage unit. A
large capacity memory is preferred, because it provide more space for storage.
) Cost per bit of storage: The final goal is to minimize this cost.
Based on above mentioned criteria, at present the following three kinds of memory
system are commonly used in any modern computers:
a) Processor’s internal memories: These are the small set of high speed registers
which are internal to a processor and are used as temporary locations where actual
processing is done. These are also called CPU memory.
b) Primary (main) memory: It is fast and large memory but slower than processor
memory. Primary memory has faster access time, smaller storage capacity and
higher cost per bit storage. This memory is accessed directly by the processor. It
stores programs and data which are currently needed by the CPU. The CPU
communicates directly with the main memory. The size of the main memory is kept
small because of its high cost.
c) Secondary (or auxiliary) memory: The secondary memory is mainly used for bulk
storage (mass storage) of programs, data and other information. It has much larger
capacity than main memory but slower than main memory. It basically stores system
software, compiler, assembler and useful packages, large data files etc.
A secondary storage system must offer large storage capacities, low cost per bit and
medium access times. Magnetic media have been used for such purposes for a long time.
Current magnetic data storage devices take the form of floppy disks and hard disks and
are used as secondary storage devices. But audio and video media, either in compressed
form or uncompressed form, require higher storage capacity than the other media forms
and the storage cost for such media is significantly higher.
Optical storage devices offer a higher storage density at a lower cost. CDROM can be
used as an optical storage device. Many software companies offer both operating system
and application software on CDROM today. This technology has been the main catalyst
for the development of multimedia in computing because it is used in the multimedia
external devices such as video recorders and digital recorders (Digital Audio Tape)
which can be used for the multimedia systems.
Removable disk, tape cartridges are other forms of secondary storage devices are used
for backup purposes having higher storage density and higher transfer rate.
Secondary memory cannot be accessed directly by the CPU. First the information of
these memories (which is needed by the CPU for current processing) is transferred to the
main memory and then the information can be accessed as the information of main
memory. Harddisk and floppy disks are the most common secondary memories used in
computers.
34
Hardware and Software: An
Introduction There is another type of high speed memory, known as cache memory which is
sometimes used to increase the speed of processing by making current programs and
data available to the CPU at a rapid rate. The cache memory is placed in between CPU
and main memory. Its access time is about 10 ns which is much less than that of the
main memory. The access time of main memory is about 50 ns. Because of its very high
cost, the capacity of the cache memory is 2 to 3 percent of that of the main memory.
Now let us start with the memory organization of primary storage. A primary or internal
storage section is basic to all computers.
All the memory devices can be categorized into three main categories:
• Semiconductor (or Main) memory
• Magnetic memory
• Optical memory
The following figure illustrates the storage cost, speed and capacity of these memories.
Note that cost increases with faster access speeds but decreases with access capacity.
Magnetic Disks
Cost per bit increases Secondary
Magnetic Tapes storage
35
Storage Organization
Optical Disks
You can note down the following points from the Figure3:
• Primary memories are used mainly for primary storage. It stores programs and
data which are currently needed by the CPU.
• The primary memory is a static device. There is no rotating part in it. The
examples of semiconductor memory are RAM, ROM etc.
• The primary memory is faster, compact and lighter. It consumes less power.
• The examples of magnetic memory are harddisk, floppy disk, pen drive,
magnetic disk and tapes.
Optical recording techniques have been recently used to store data on the surface of a
coated disk. Information is written to or read from an optical disk using laser beam. The
example of this serial access memory is CDROM (Compact Disk ReadOnly Memory).
Only one surface of an optical disk is used to stored data. An optical disk has very high
storage capacity, up to 20 GB. It is relatively inexpensive and has a long life of at least
1520 years. Better optical recording method which records data on multiple layers on a
disk surface has been recently introduced. This storage device is known as DVDROM
(Digital Versatile Disk ReadOnly Memory). The main drawback of the optical disk
system is its slow average access time. The Table 1 shows the some characteristics of
above various memory technologies.
There are two basic methods of accessing information from various memory devices:
36
Hardware and Software: An
Introduction
A sequentialaccess memory such as magnetic tape is organized by arranging memory
cells in a linear sequence. They do not have unique storage address that can be directly
addressed. Instead, data is presented serially for writing and is retrieved serially during
read. In other words, information on a serial device can only be retrieved in the same
sequence in which it is stored. Data are recorded one after another in a predetermined
sequence (such as in numeric order) on a storage medium. Sequential processing is quite
suitable for such applications like preparation of monthly pay slips, or monthly
electronic bills etc., where each address needs to be accessed in turn. If you are working
with sequential access device and information is stored at the last address, then data
stored at the last address cannot be accessed until all preceding locations in the sequence
have been traversed. That is locating an individual item of data requires searching of the
recoded data on the tape until the desired item is located.
In case of random access device the information is available at random, i.e., any
location in the device may be selected at random. So any location in the device can be
accessed in approximately equal time. In other words we can say that each storage
position (1) has a unique address, and (2) can be individually accessed in approximately
in equal time without searching through other storage positions. Magnetic disk and CD
ROM are the typical random access storage devices. Any data record stored on a
magnetic or optical disk can be accessed directly in approximately the same time period.
The following figure shows sequential vs. direct access storage.
Direct Access
Read/write head
D C B A
A
B
aA
Read/writ
head
Data are processed and stored in a computer system through the presence or absence of
electronic or magnetic signals. This is called a “twostate” or Binary representation of
data, this is because of transistor and other semiconductor circuits are either in
conducting and nonconducting states which is represented by 1 or 0. For Magnetic
media, such as magnetic disk or tapes, these two states are represented by having
magnetized spots whose magnetic fields have one of two different directions or
polarities.
For any electronic circuits (RAM), the conducting (ON) state represents the number 1,
while the nonconducting (OFF) state represents the number 0. For magnetic media, the
magnetic field of a magnetized spot in one direction represents a 1 while magnetism in
the other direction represents a 0.
37
Storage Organization
The smallest element of data is called a bit, which can have a value of either 0 or 1. The
capacity of memory chip is usually expressed in terms of bits. A group of 8bits is
known as bytes, which represents one character of data in most computer coding
chemes. Thus, the capacity of a computer’s memory and secondary storage devices is
usually expressed in term of bytes. Computer codes such as ASCII (American Standard
Code for Information Interchange) use various arrangements of bits to form byte that
represents numbers 0 to 9, the letters of the alphabets, and many other characters.
……………………………………………..………………………..
………………………………………………………………………………………
……………………………………………………………………..
………………………………..
c) Semiconductor, magnetic and optical memory (in terms of access speed, storage
capacity and cost per bit storage).
……………………………………………..………………………..
………………………………………………………………………………………
……………………………………………………………………..
………………………………..
2.2.1 Semiconductor (Main) Memory
All computers except very small computers contain both semiconductor as well as
magnetic memory. All modern computers use semiconductor memory as its main
38
Hardware and Software: An
Introduction memory (primary memory). Semiconductor memory is known as random access
memory (RAM) because any part of the memory can be accessed for reading and
writing. It stores programs and data which is currently (currently under execution)
needed by the CPU. RAM is used as a temporary storage only because it is volatile.
Data in RAM is lost in case of power interruption. Another part of main memory is
Read Only Memory (ROM). ROMs are those memories on which it is not possible to
write the data. They can only be read.
Main memory holds the programs and data required by the CPU for carrying out its
operations. The primary (main) storage is a semiconductor device that is built using
integrated circuits. The data is stored in binary form by main memory. Numeric as well
as nonnumeric data can be represented in binary form. With two binary digits, we can
represent four different characters. With three binary digits, we can represent eight
different characters. Computes internally use eight binary digits to represent characters
and digits (A binary digit is referred to as bit and eight bits are called a byte). 256
different characters can be represented by eight bits (one byte).
Memory can be of various types like Random Access Memory (RAM) and ReadOnly
Memory (ROM). The following chart summarizes the different types of main memory.
Main Memory
RAM ROM
39
Storage Organization
Figure 6: Types of Memory
• The Read and write memory (R/W memory) of a computer is called a RAM.
The user can write information into RAM and read information from it. It is
known as random access since any memory location can be accessed in a
random manner for reading and writing. The access time is same for each
memory locations.
• Random Access Memory (RAM) is really the main store and is the place where
the program and software we load gets stored. When CPU runs a program, it
fetches the program instructions from the RAM and carries them out. Similarly,
if the CPU needs to store the final results of calculations, it stores them in RAM.
Thus, you (CPU) can both READ data from RAM and WRITE data into the
RAM.
• RAM is a volatile memory, that is, the stored data are lost, if the power goes
off.
• There are two important types of RAMs
Static RAM (or SRAM)
Dynamic RAM (or DRAM)
Dynamic RAM stores binary information in the form of electric charge on
capacitor. Binary 1 is represented as the presence of change whereas binary
0 is represented as absence of electric charge. Stored charge has a natural
tendency to discharge, therefore it requires frequent refreshing to maintain
data. In static RAM binary values (1 , 0 ) are stored using traditional flip fly
logic gates.
• Static RAMs retain stored information only as long as the power supply is on
whereas a Dynamic RAM loses its stored information in a very short time (a
few milliseconds) even though the power supply is on.
• Dynamic RAMs are cheaper and consume less power whereas Static RAMs are
costlier and consume more power. Static RAMs have higher speed than
dynamic RAMs.
• Dynamic RAM is cheaper so used for main memory. Static Ram is faster so
used in cache memory.
Both static and dynamic RAMs use CMOS technology. CMOS devices consume less
power. Static RAMs hold information in a flipflop circuit consisting of two cross
coupled inverters. In a RAM, the memory cell must be associated with read and write
facility. The following are commonly used RAM chips:
• EDO (Extended Data Output RAM): In an EDO RAM, any memory access
stores 256 bytes of data into latches. The latches hold next 256 bytes of
information, so that in most programs which are sequentially executed, the data
are available without wait states.
• SDRAM (Synchronous DRAM) and SGRAM (Synchronous Graphics
RAM): These RAM chips use the same clock rate as the CPU uses. As a result,
the memory chips remain ready to transfer data when the CPU expects them to
be ready. SDRAM is often used as a mass storage whereas SGRAM used as a
high end graphics memory.
40
Hardware and Software: An
Introduction
• DualPorted DRAM: These types of RAM allow to access two memory
locations simultaneously. Sometimes it is also called video RAM (or VRAM).
WRAM (Window RAM) is a special version of VRAM, which is commonly
used in PCs running WINDOWS Operating System and WINDOWS
applications.
• SIMM and DIMM: They stand for singleInline and Double Inline Memory
Modules. These are small printed circuit cards, on which several DRAM
memory chips are placed. Such cards are plugged into the system board of the
computer.
• ROM is used for storing special set of instruction, which the computer needs
when it start up (boot up).
• Unlike RAM, the information from ROM can only be READ and it is not
possible to WRITE fresh information to it by the users/programmers. That is the
CPU can only fetch or READ instructions from ROM. This is the reason why it
is called ROM. The contents of ROMs are decided by the manufacturers. The
contents are permanently stored in a RAM at the time of manufacture.
• Maskedprogrammed
• Userprogrammed
• ROM chips are supplied by computer manufacturer and it is not possible for a
41
Storage Organization
user to modify the programs stored inside the ROM chip. However, in case of
PROM, it is possible for a user to customize a system by storing own program
in a PROM chip.
• Once a program has been written on to a PROM chip, the recorded information
cannot be changed i.e., the PROM becomes a ROM and it is only possible to
read the stored information.
• PROM is also a nonvolatile memory i.e., the stored information remains even
if power is switched off.
In the previous subsection, we have seen various types of semiconductor RAMs. These
high speed semiconductor storage devices (i.e., RAMs) are expensive. So we need some
inexpensive media for storage. Magnetic memory is a good alternative for this purpose.
Also the semiconductor memory has the following limitations:
1) Limited capacity: Semiconductor (primary) memory of today’s computer is not
sufficient, since most of the data processing organization requires large volume of
data.
2) Volatile memory: Semiconductor memory is volatile in nature. But now a days,
the computer system need to store data on a permanent basis.
Any modern computer uses the following two types of magnetic memory:
ii) Magnetic tapes Magnetic disks are the most common form of secondary storage
because they provide fast access and high storage capacities at a reasonable cost.
Storage Mechanisms
Magnetic disk drives contain metal disks that are coated on both sides with an iron oxide
recording material. Several disks are mounted together on a vertical shaft which
typically rotates the disks at speeds of 3600 to 7600 revolutions per minutes (rpm).
42
Hardware and Software: An
Introduction Electromagnetic read/write heads are positioned by access arms between the slightly
separated disks to read and write data on concentric, circular tracks. Data are recorded
on tracks in the form of tiny magnetized spots to form the binary digits of common
computer codes. Thousands of bytes can be recorded on each track, and there are several
hundred data tracks on each disk surface, which provides billions of storage positions
for your software and data.
There are basically two types of magnetic disk arrangements, one having a removable
disk cartridges and other having a fixed disk units. Removable disk devices are popular
because they are transportable and can be used as backup copies of your data.
Data Organizations
A magnetic disk is a surface device, which stores data on its surface. Its surface is
divided into circular concentric tracks. The number of tracks on a disk range up to 800.
Each track is divided into sectors (normally 10100). These sectors should be either
fixed or variable length sectors. The division of track into equal sized blocks or pages is
set by the operating system during disk formatting. The number of bytes stored in each
sector is kept same. Therefore, all tracks store in the same amount of data, typically
range from 450kbytes.
Track 000
500
Tracks
A sector
Trac
k499
Figure 7(a): tracks on disks. The no. of tracks Figure 7 (b): Sectors of a disk.
The number varies but there (Often 200 or more) range up to 800 is often 8 or more
sectors per track.
• Hard disks are online storage device. The term online means that the device
(harddisk) is permanently connected to the computer system and when the
computer is on, the device (harddisk) is available to store information or to give
information.
• HDD contains magnetic disks, access arms and read/write heads into a
sealed, air filtered enclosure. This technique is known as Winchester
technique.
• Winchester disk is another name for “hard disk drive”. There are two stories
behind the name Winchester disks; one is that the disk was developed at IBM’s
facility at Winchester, New York State; that had 30MB of fixed storage and
30MB of removable storage; the other is that the first model number was given
as 3030, which is also the model number of the wellknown Winchester Rifle
popular in the Wild West. Although modern disk drives are faster and hold more
data, the basic technology is the same, so Winchester has become synonymous
with hard.
• The read/write head reads data from the disk and writes data to the disk. A
disk is mounted (or stacked) on the disk drive, which has the motor that rotates
it. Harddisks together with read/write heads, access mechanism and driving
motor constitute a unit called harddiskdrive (HDD) unit. The whole unit of
HDD is fixed.
• Hard disk is also known as platter. It can not be removed or inserted into a
HDD unit. Some disks have single platter e.g., floppy disk.
44
Hardware and Software: An
Introduction • A set of corresponding tracks in all surfaces of a disk pack (i.e., the tracks
with the same diameter on the various surfaces) is called a cylinder (see Figure
9). Here, the concept of cylinder is very important because data stored on the
same cylinder can be retrieved much faster than the data were distributed among
different cylinders.
Surface 0
Disk
1 Read/write head
(One per surface)
∙
∙
∙
n
Surface (2n1)
Figure 9: A disk having n platters (0 to n1 plates). A set of corresponding tracks on all the (n1)
Surfaces, at a given radial distance, is called a cylinder
For example a 2.5 inch diameter disk pack has 6 plates (12 recording surfaces), 256
sectors per track, 5250 tracks per surface, 512 byes per sector. Then the disk capacity =
12x5250x256x512=7.69 GB Recoding Density=(512x256)/(3.14x2.5)=16688
bytes/inch.
There are several disk drives (C,D,F etc.) in a computer, which are connected to a disk
controller. The controller converts instructions received from the computer (software)
to electrical signals to operate disks. The Disk controller accepts commands from the
computer and positions the read/write head of the specified disk for reading or writing.
For reading or writing operation on a disk pack, the computer must specify the drive
number, cylinder number, surface number, and sector number. Drive number must be
specified, because a controller normally controls more than one drive.
45
Storage Organization
Following is a disk address format for disk controller of 8 drives, each disk pack having
250 cylinders, 12 surface and 256 sectors.
As soon as the read/write command is received by the disk controller, the read/write
heads are first positioned onto the specified track number (or cylinder) by moving the
arm assembly in the proper direction. The time required to position the read/write head
over proper track is called the seek time.
Seek time (Ts): The time required to move the read/write head on a specific (address) track.
• Seek time varies depending on the position of the arm assembly when a read/write
command is received.
• Seek time will be maximum, if the arm assembly is positioned on the outer most track
and the track to be reached is the inner most track and it will be zero if the arm
assembly is already on the desired track.
• The average seek time is thus specified for most systems which is generally between
few milliseconds to fractions of a second.
Note that seek time is associated only with movablehead system. For a fixedhead
system, it is always 0 because there is head for each track and no movement of head is
required for accessing a particular track.
Once the heads are positioned on the desired track, the head on the specified surface is
activated. Since the disk is continuously rotating, this head should wait for the desired
data (specified sector) to come under this head. This rotational waiting time i.e., time
required to bring the needed data (i.e., starting position of the addressed sector) under
the read/write head is called the latency time.
Latency Time (tL) or Search time: Time required to bring the needed data under
R/W head. Latency time is also a variable and depends on the following two
things:
• Distance of the desired data from the initial position of the head on the
specified track
• Rotational speed of the disk.
The average seek time is thus normally specified for most systems which is
generally of the order of 10 to 15 milliseconds.
46
Hardware and Software: An
Introduction
The total access time for a disk is equal to the seek time plus the latency time.
Floppy disks or magnetic diskettes consist of polyester film disks covered with an iron
oxide compound. The disk is not a hard plate, rather it is a very thin piece of flexible
polyester (plastic material) film, and hence it is called floppy disk. A single disk is
mounted and rotates freely inside a protective flexible cover or hard plastic jacket.
We have two different sizes of floppy disks:
• 5.25 inches.
The 3.5 inch floppy disk, having capacity of 1.44 MB, is the most widely used version.
A floppy disk rotates at 360 rmp. Its average access time is 150250 ms.
The storing capacity of a 5.25 inch floppy disk is 1.2 MB. It uses 80 tracks per surface,
96 TPI (tracks per inch), 15 sectors per track, rotating speed 300 rpm, and store 512
bytes per sector. Both sides of the disk store information.
Floppy disks are now outdated, inpalce of it, now Universal Serial Bus (USB) drive
which are also known as pen drive are used. Pen drives are having larger capacity,
which vary from 1 GB to 10 GB.
Magnetic tape is sequential access type secondary storage device. It is used for backup
in server, workstations, and large computers. The main advantages of magnetic disks,
these are cheaper and since these are removable from the drive, they provide unlimited
storage capacity (20 GB to 150 GB).
The read/write heads of magnetic tape drives record data in the form of magnetized
spots on the iron oxide coating of the plastic tape. Magnetic tape devices include tape
reels and cartridges in mainframes and midrange systems, and small cassettes or
cartridges for PCs.
The main drawback of magnetic tapes is that it store information sequentially. A file or a
particular information stored on a magnetic tape cannot be accessed directly on random
basis as it is done in the case of harddisks or floppy disks. These devices are slower, but
due to low cost, they are still widely used for massive data warehouse and other business
storage requirements.
47
Storage Organization
a) One Gigabytes (GB) equal to 220 KB.
2) Explain the volatile and nonvolatile type memory. Differentiate the volatile and
nonvolatile type memory for the following memory: RAM, ROM, PROM,
EPROM, and EEPROM.
……………………………………………..………………………..
………………………………………………………………………………………
……………………………………………………………..
…………………………………………
3) A 2.5 inch diameter disk pack has 6 plates (12 recording surfaces), 256 sectors per
track, 5268 tracks per surface, 512 byes per sector. Find the capacity and recording
density of the disk pack.
……………………………………………..………………………..
………………………………………………………………………………………
……………………………………………………………..
………………………………………..
4) Match the following:
Optical memories or Optical disks are alternate mass storage devices with huge capacity
(up to 20 GB). Higher density is achieved through tightly focused lasers which can
access a very small storage area. Information is written to or read from an optical disk
using laser beam. Only one surface of an optical disk is used to stored data. An optical
disk is relatively inexpensive, and has a long life of at least 15 years. Since the
read/write head does not touch the disk surface, there is no problem of disk wear and
head crash. The main draw back of the optical disk system is its slow average access
time. Basic types of optical disks are:
48
Hardware and Software: An
Introduction 4) DVDROM, DVDR and DVDRAM
Optical memory devices provide a huge storage capacity (up to 20 GB), at a lower cost.
Information is written to or read from an optical disk using laser beam. An optical disk
is relatively inexpensive, and has a long life of at least 15 years. Since the read/write
head does not touch the disk surface, there is no problem of head crash. The main draw
back of the optical disk system is its slow average access time.
Many software companies offer both operating system and application software on CD
ROM today. This technology has been the main catalyst for the development of
multimedia in computing because it is used in the multimedia external devices such as
video recorders and digital recorders (Digital Audio Tape) which can be used for the
multimedia systems.
CDROM
CDROM technology uses 12centimeter (4.7inch) compact disk (CDs) similar to those
used in stereo music systems. Each disk can store more than 600 MB. That is
approximately equivalent to 400 1.44 MB floppy disks or 300,000 doublespaced pages
of text.
First of all, a master disk is prepared. On a master disk, a laser records data by burning
permanent microscopic pits in a spiral track to represent 1. From master disk, CD
ROMs are produced on mass scale. Then CDROM disk drives use a laser device to read
the binary codes formed by those pits. For reading the data laser beam of less intensity is
employed. A laser system needs 25mW for writing whereas 5mW for reading.
CDROMs use long spiral tracks to store data serially, as shown in Figure10. The track
is divided into the blocks of same size as shown in the figure. A CDROM disk rotates
at a variable speed so that pits are read by the laser at a constant linear speed. The speed
of the disk is adjusted in such a way that the track possess under the read/write head at a
constant linear velocity.
Advantages
49
Storage Organization
• Removable disk from the computer, so suitable for archival storage. 5.25 inch
disks store 650 MB data.
Disadvantages
CDR (compactdisk recordable) is another optical disk technology. The user can
record (write) their own data once on a CD with CDR disk drive unit. After this
recording user can read these data as many times as desired.
CDR is suitable for data and files which are not to be changed. The user can store
permanent data, information, and files for maintaining records. CDR should be
used because of:
• High storing capacity.
• Better reliability and long life.
• Greater access time as compared to harddisk.
The major limitation of CDROM and CDR disks is that recorded data can not be
erased. However, CDRW (CDrewritable) optical disk systems have now become
available which record and erase data by using a laser to heat a microscopic point on the
disk’s surface. CDRW are of:
• Very high storing capacity. A 5.25 inch optical disk can store about 650.
• It is more reliable and having long life.
• Longer access time as compared to that of a harddisk.
DVD stands for Digital Video Disks or Digital Versatile Disks. DVD stores much
more data than CDROM. Its capacities are 4.7GB, 8.5GB, and 20GB and more. The
capacity depends on whether it is a single layer, double layer; single sided or double
sided disks. DVD uses laser beam of shorter wavelength than CDROM uses and
therefore more tracks are used. Working principles of DVD disks are same as CDROM,
CDR and CDRW.
The Speed of CDROM or DVDROM is given in terms of nX, where n is an integer.
For example 32X, in case of CD, X=150 KB/s, so 32X=32x150=4.8 MB/s. In case of
DVD, X=1.38 MB/s.
DVDR: It is a recordable DVD, same as CDR disk. The user can write data once on a
DVDR, then read the data as many times as required.
50
Hardware and Software: An
Introduction
DVDRAM: It is a rewritable DVD, same as CDRW disk. DVDRAM uses a phase
change technology to write, read and erase data.
The Table 4 on next page summarizes the different types of secondary (auxiliary)
memory devices:
Table 4: Types of Memory
51
Storage Organization
The overall goal of Memory Hierarchy is to obtain the highest possible access speed
while minimizing the total cost of the memory system. Figure12 illustrates the
components of a typical memory system.
Main I/O
Processor Magnetic Tape
Memory
Magnetic disk
Cache CPU
Memory
52
Hardware and Software: An
Introduction
A computer system uses a variety of devices for storing the instructions and data. A
storage device (or units) may vary according to the access time, storage capacity, and
costperbit of storage, as discussed in the previous section. Based on these criteria, a
memory system can be considered to consist of three groups of memories.
2) Primary (main) memory: It is fast and large memory but slower than
processor memory. Primary memory has faster access time, smaller storage
capacity and higher cost per bit storage. This memory is accessed directly by the
processor. It stores programs and data which are currently needed by the CPU.
The size of the main memory is kept small because of its high cost.
3) Secondary (or auxiliary) memory: The secondary memory is mainly used for
bulk storage (mass storage) of programs, data and other information. It has
much larger capacity than main memory but slower than main memory. It
basically stores system software, compiler, assembler and useful packages, large
data files etc.
Register
Cache memory
Faster
access
time Main memory Larger capacity &
Lower cost per bit
stored
Magnetic disk
Magnetic Tape
• CPU (register)
• Cache memory
53
Storage Organization
Main memory
Mass storage
……………………………………………..………………………..
………………………………………………………………………………………
……………………………………………………………………..
………………………………..
54
Hardware and Software: An
Introduction
2.4 SUMMARY
This unit basically explains the storage organization, storage devices for different types
of memory systems and the importance of memory hierarchy.
The memory system is categories according to access time, storage capacity & costper
bit of storage.
Based on these criteria, memory is broadly categories into two types: Primary memory
& secondary memory. All modern computers use semiconductor memory as its main
memory (or primary memory). Semiconductor memory is known as random access
memory (RAM). Although these are very fast memory but are very expensive. Thus
semiconductor (primary) memory of today’s computer is not sufficient, since these have
very limited capacity. Thus there is a need of an additional memory, which should be
inexpensive, nonvolatile in nature and having large capacity. Magnetic (secondary)
memory is a permanent nonvolatile, type memory. In this unit we have discussed the
two types of magnetic memory namely magnetic disks (i.e., harddisk and floppy disk)
and magnetic tapes. Magnetic disks are the most common form of secondary storage
because they provide fast access and high storage capacities at a reasonable cost.
In this unit we have discussed the various types of storage devices used by the computer
system. A cost effective technique for the design of large computer systems is the use of
a hierarchy of memory technologies. The overall goal of Memory Hierarchy is to obtain
the highest possible access speed while minimizing the total cost of the memory system.
2.5 SOLUTIONS/ANSWERS
1) (a) True (b) False (c) False (d) True (e) False
In other words, information on a serial device can only be retrieved in the same
sequence in which it is stored. Data are recorded one after another in a
predetermined sequence (such as in numeric order) on a storage medium. If you
are working with sequential access device and information is stored at the last
address, then data stored at the last address cannot be accessed until all
preceding locations in the sequence have been traversed. That is locating an
individual item of data requires searching much of the recoded data on the tape
until the desired item is located.
In case of random access device the information is available at random, i.e. any
location in the device may be selected at random. So any location in the device
can be accessed in approximately equal time. In other words we can say that
each storage position (1) has a unique address and (2) can be individually
55
Storage Organization
accessed in approximately in equal time without searching through other storage
positions. Magnetic disk and CDROM are the typical random access storage
devices. Any data record stored on a magnetic or optical disk can be accessed
directly in approximately the same time period.
(c) The following Figure14 illustrates the storage cost, speed and capacity of
Semiconductor, magnetic and optical memory. Note that cost increases with faster
access speeds but decreases with access capacity.
Magnetic Disks
Cost per bit increases Secondary
storage
Magnetic Tapes
Optical Disks
2) (a) Volatile memory means the stored data are lost, if the power goes off.. For
example RAM is a volatile memory. A nonvolatile memory means the information
stored in it is not lost even if the power supply goes off. A ReadOnly memory (ROM)
56
Hardware and Software: An
Introduction is a nonvolatile memory.
2) A computer system uses a variety of storage devices to store instructions and data. A
cost effective technique for the design of large computer systems is the use of a
hierarchy of memory technologies. The overall goal of Memory Hierarchy is to
obtain the highest possible access speed while minimizing the total cost of the
memory system.
Reference Websites:
• www.en.wikipedia.org
57
Storage Organization
58
Hardware and Software: An
Introduction
UNIT 3 INPUT OUTPUT DEVICES
3.0 Introduction 56
3.1 Objectives 56
3.2 Inputoutput Devices 56
3.3 Monitors 58
3.4 Printers 61
3.5 Scanners 66
3.6 Diskettes 66
3.7 Keyboard 70
3.8 Mouse 71
3.9 Tablet 71
3.10 Speaker 72
3.11 Microphone etc 72
3.12 Summary 74
3.13. Solutions/Answers 74
3.14 Further readings and References 76
3.0 INTRODUCTION
First, we will discuss briefly about input/output devices and then move on to the
function and structure of some input and output devices. Finally, we will discuss
about the newer technologies in input output devices used in computer system.
3.1 OBJECTIVES
56
Hardware and Software: An
Introduction The computer will be of no use if it is not communicating with the external world.
Thus, a computer must have a system to receive information from the outside world
and must be able to communicate results to the external world. For this purpose
computer use input/output devices. Input and output devices can also be written as I/O
devices.
Input and output devices of a computer system are the devices that connect you to
computer. Input devices let you to transfer data and user command into the computer.
Input devices technologies are rapidly developing and are used to interact with the
computer system. For example, you can type in data by using a keyboard, or you can
input data in picture form by using a scanner in computer system. Inputs are data or
signals received by the computer system and outputs are the data and signals which
are sent by it as result after processing the input.
The, output devices display the result of input data or signals after processing it.
Examples of these could be your computer’s monitor, which displays all the programs
which are running into the computer, as well as the printer, which will print out a hard
copy of the information which is saved in your computer.
Input and output devices allow the computer system to interact with the outside world
by moving data into and out of the system. An Input device is used to bring data into
the system. Examples of some input devices are:
• Keyboard
• Mouse
• Joystick
• Microphone
• Bar code reader
• Graphics tablet
An output device is used to send data out of the system. Examples of some output
devices are:
• Monitor
• Printer
• Plotter
• Speaker
Input and output devices in short are also called I/O devices. They are directly
connected to an electronic module called I/O module or device controller. For
example, the speakers of a multimedia computer system are directly connected to a
device controller called an audio card which in turn is connected to the rest of the
system.
Input and output devices are similar in operation but perform opposite functions. It is
through the use of these devices that the computer is able to communicate with the
outside world.
Input data for the computer system can be in any of the following forms:
57
Input Output Devices
• Manual inputs from a keyboard or console.
• Analog inputs from instruments or sensors.
• Inputs from a storage device, such as PenDrive, CD’s and Floppy Drives.
The speed of processor is more than the input devices, such as keyboard of computer
system. Computer system can process hundreds or thousands of characters per second.
Thus, a study of the first method i.e., manual input reflects the inability of human
operated keyboards or keypunches to supply data at a speed that matches the speed of
digital computers.
3.3 MONITORS
One of the most important output devices in computer system is its screen commonly
called monitor. It is an output device and displays all the programs and applications to
which you are running in your computer system. Monitor is the visual display unit of
the computer system. It displays images generated from the video output. Monitor of
the computer system is used to display images without keeping a permanent record
inside it.
Graphic display is made up of a series of dots called ‘pixels’ (picture elements) whose
pattern produces images in computer system. Each dot on the screen is defined as a
separate unit which can be addressed separately. Since each dot on the screen can be
controlled separately by virtue of which it gives greater flexibility in drawing pictures.
Number of dots per inch (dpi) is called the resolution of the screen and is used to
represent the quality of the computer system. There are three categories of display
screen technology:
3. Projection Displays
Monitors display what is going on in your computer. They can run at various
resolutions. It is the part of computer which looks like a TV set. After typing the
characters from the keyboard we can see them on the monitor.
The main components of a CRT monitors are the electron gun, the electron beam
controlled by an electromagnetic field and phosphor coated display screen. These
older monitors were very bulky and acquire a lot of space for installation.
Body
58
Hardware and Software: An
Introduction
Electron gun
Picture Tube
In CRT monitors image is projected on the screen by directing the electron beam on
the computer screen. To precisely direct the electron beams, copper steering coils are
used to create magnetic field inside the tube. By applying varying voltage to copper
coils a beam can be positioned at any point on the screen.
This was first introduced in watches and clocks in 1970’s. LCDS is now used to
display images in monitors. A newer technology in computer screens is TFT LCD
monitors. These are light weight monitors and are used in laptop computers.
The three main advantages of these monitors over the CRT are the use of less space
on the desk, less power consumption and flicker free screen.
Screen
Stand
These monitors are portable and consume less electricity. Images produced by these
monitors are of better quality than that of old CRT monitors. The LCD monitors have
very high resolution and emit less radiation than CRT monitors.
59
Input Output Devices
These are normally used for large group presentations. These systems can be
connected to computer and whatever appears on the computer terminal gets enlarged
and projected on a large screen.
On/Off Buttons
Body
Lens
In this computers are connected to an LCD Flat screen and images are projected on a
large screen by using overhead projector. These are popularly used for seminars, class
rooms, marketing presentations etc.
2. Gray Scale: It is monochrome type of the monitor, but it displays the output
by using the different shades of gray, made by combination of
black and white.
3. Color Monitor: It can display the output in many colors, ranging from 16 to
over 1 million different colors. These are also called as RGB
monitors, because they accept three separate signals, which are
red, green and blue.
After color classification, the most important aspect of a monitor is its screen size.
Size of computer screen is measured in diagonal inches and is given by measuring the
distance from one corner to the opposite corner (diagonally). The smallest size for
VGA monitors is 14 inches, which is also the entry level monitor for computer
system. The larger size landscape monitors can display two full pages side by side at a
time.
The resolution of a monitor means number of pixels per inch are of the monitor.
In general, the number of more pixels will be the sharper images. Most modern
monitors can display 1024 by 768 pixels. Some highend models of computer
monitors can display 1280 by 1024, or even 1600 by 1200 pixels.
60
Hardware and Software: An
Introduction Classification of Monitors on the basis of Signal
Computer monitor can be divided into two categories on the basis of signals to which
they accept. These are:
1. Analog Monitor,
2. Digital Monitor.
Analog Monitor:
These are traditional type of color monitors which are based on CRT technology.
These work like the television screen and accept analog signals.
Digital Monitor
An electronic signal that is sent as binary digits of either ON or OFF is called Digital
signal. Example given in Figure5 is of digital signals and how they look like. In the
first diagram signals are either 0 or 1 i.e., up or down for ON and OFF mode. In the
right digital pictures are shown where a pixel is either ON or OFF helping to create an
image on the display screen.
Digital
Size
Timing
The digital monitor receives digital signals and uses CRT technology. The data in
these monitors is received from video adapter. These are of different types such as
CGA (Color Graphics Adapter), EGA (Enhanced Graphics Adapter), VGA (Video
Graphics Array), SVGA (Super Video Graphics Array) and are fast and produce clear
images.
3.4 PRINTERS
61
Input Output Devices
Printers are used for producing output on paper. There are a large variety of printers
and printing devices. These devices can be classified according to the print quality and
printing speed.
There are vast varieties of printers. Classification of these printers can be done by the
technology used by them. These varieties of printers are:
1. Character Printer:
These printers can print only one character at a time. They work similar to
that of the typewriter. The examples are Daisy Wheel Printer, Dot Matrix
Printer and Inkjet Printer.
Ribbon
Body
Paper Rotation Nob
A hammer presses the wheel against a ribbon, which in turn makes an ink
stain in the shape of the character on the paper. Daisywheel printers produce
letterquality print but cannot print graphics. The print quality of this impact
printer is very low.
This is one of the most popular printers used for personal computing systems.
These printers are relatively cheaper compared to other technologies and use
impact technology. In the year, 1970s and 1980s, dot matrix impact printers
were generally considered the best combination of expense and versatility,
62
On/Off Paper In
Hardware and Software: An
Introduction and until the 1990s they were by far the most common form of printer used
with personal computers. Characters in this printer are formed by the
combination of dots.
Advantages:
• Dot matrix printers, like any impact printer, can print on multipart
stationery or make carbon copies.
• Impact printers have one of the lowest printing costs per page. As the
ink is running out, the printout gradually fades rather than suddenly
stopping partway through a job.
• They are able to use continuous paper rather than requiring individual
sheets, making them useful for data logging. They are good, reliable
and ideal for use in situations where printed content is more important
than quality.
Disadvantages:
2. Line Printer
Line printers are used to print large amount of data. These are fast speed printers
ranging from 300 to 2500 lines per minute. Examples are Drum Printers and Chain
Printers.
3. Page Printer
63
Input Output Devices
These are very high speed printers which produce high quality output. Their speed
ranges from1025 pages per minute. These printers use modern Laser Printer
technology and print whole page at one go. There are many varieties of laser page
printers and so their prices from base label to high label.
(i) Inkjet Printer: The Inkjet printer works on inkjet technology and
produce better quality print than dot matrix printers. These print by
spraying a controlled stream of tiny oink droplets accurately on the paper
forming either dot matrix or solid characters. The printing quality of this
printer is very good with the speed of 700 or more characters per second.
These are non – impact and hence are relatively less noise during printing
process. This printer can be used to print in color and is easy to use.
Advantages:
On/Off Button
Paper Out
(ii) Laser Printer: This is a high quality, high speed and high volume technology
printer. In laser printers, a laser beam is used to produce an image on a drum. The
light of the laser alters the electrical charge on the drum wherever it hits. The drum is
then rolled through a reservoir of toner, which is picked up by the charged portions of
the drum. Finally, the toner is transferred to the paper through a combination of heat
64
Hardware and Software: An
Introduction and pressure. Laser printers produce very high quality text and graphics but are very
expensive. The technology used by them is same as that of photocopy machines.
Speeds of laser printers can range from 10 pages per minute to 200 pages per minute.
Laser printers are also called page printers, because they print whole page in one go.
Standard laser printers can be classified in two categories in terms of color:
Laser Beam
Toner
Paper Out
Mirror lenses
Drum
Fusing Section
Paper In
Monochrome laser printers use a single toner. Color laser printers use four
toners to print in full color. These printers are about five to ten times as
expensive as their monochrome siblings.
65
Input Output Devices
i) Color laser printers use single toner to print.
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………
.………………………………………………………………………………..
…………………………………………………………………………………..
…………………………………………………………………………………..
.………………………………………………………………………………..
…………………………………………………………………………………..
…………………………………………………………………………………..
.………………………………………………………………………………..
…………………………………………………………………………………..
…………………………………………………………………………………..
3.5 SCANNERS
Scanner is an input device and is used to input data into the computer system in the
form of pictures. It optically scans images, printed text, handwriting, or an object, and
converts it to a digital image. Examples of scanners are desktop or flatbed scanner. In
66
Hardware and Software: An
Introduction these scanners document is placed on a glass window for scanning. Mechanically
driven scanners which move the document are typically used for largeformatted
volume of documents.
Other types of scanners are planetary scanner. This scanner takes photographs of
books and documents. Three dimensional scanners are used for producing three
dimensional models of objects.
Cover
Paper
Glass
3.6 DISKETTS
Floppy disk is a convenient data recording medium. It is called floppy because it flops
if you wave it (at least, the 5¼inch variety does). Floppy disks are portable and can
be removed from the system. Disk drives for floppy disks are called floppy drives.
Data stored in Floppy disks are slower to access than that of hard disks. But it is less
expensive than the hard disk.
The earliest floppy disks, invented at IBM company, were of 8 inches in diameter.
They became commercially available in 1971. Floppy disks of today are available in
two sizes 5.25 inches and 3.5 inches and their storage capacity ranges from 360 KB to
1.44 MB.
Floppy disks were very popular and have been seen by all computer professionals.
This is the reason why floppy disk symbol is often seen in programs on buttons and
other user interface elements related to saving of files. Now pen drive have replaced
Write Protect Switch
flopy disks and flopy disks are outdated.
Floppy
67 Shutter
Insert Button
Input Output Devices
Note: Floppy Disks were used by computer professionals from the year 1971 to the
year 2005 and are out dated now a days. Now pen drives have replaced floppy disks
and are being used by the users.
The hard disk drive in computer system is the data center of computer. All the
programs and data of computer are stored in it. It is the most important permanent
storage device of computer. Hard disk differs from the other data storage devices, in
three ways:
The first PC hard disks had a capacity of 10 megabytes and its cost was very high.
The Modern hard disks have capacities more than 500 gigabytes and are very cheap
than to previous hard disks.
68
Hardware and Software: An
Introduction
Cylinder
Head
Cover
Features of HDD:
1. Performance: The hard disk plays a very important role in overall system
performance. The speed at which the PC boots up and programs load is directly
related to the hard disk speed.
2. Storage Capacity: Hard disks have a very high storage capacity such as 500 GB
and even more. Bigger hard disk lets you store more programs and data in it.
3. Software Support: Newer software needs more space and faster hard disks to
load it efficiently. This is supported by the present age high speed hard disk
drives.
The RAM is a volatile memory i.e., the data or information saved in this memory gets
lost if power is switched off. It is permanently fixed in side the computer system.
69
Input Output Devices
IC
256 MB RAM
Computer RAM comes into many sizes such as 256 MB, 512 MB, 1 GB, 2GB etc.
Normal PC RAM’s and Laptop RAM’s are of different in sizes and shapes.
A USB flash drive is a flash memory data storage device integrated with a USB
(universal serial bus) interface. USB flash drives are typically removable and
rewritable, much shorter than a floppy disk. Nothing actually moves in a flash drive: it
is called a drive because it is designed to read and write data using the same system
commands as a mechanical hard disk drive.
A flash drive is consist of a small printed circuit board protected inside a plastic, metal
or rubberized case, robust enough to be carried with no additional protection, in a
pocket or on a key chain. To access the drive it must be connected to a USB port,
which powers the drive and allows it to send and receive data.
USB Port
Protective Cover
USB flash drive offers potential advantage over other portable storage devices. They
are more compact, faster, hold much more data, have a more durable design, and are
more reliable for lack of moving parts. Pen Drive comes in various sizes such as: 256
MB, 512MB, 1 GB, 2GB, 4GB, & 8GB.
70
Hardware and Software: An
Introduction The CD – ROM (Compact Disk read only memory) is a direct extension of audio CD.
The CDs are available in the market since late 1982. Standard CDs have a diameter of
120 mm and can hold up to 80 minutes of audio. There is mini CDs with diameters
ranging from 60 to 80 mm.
Centre
Recording Surface
3.7 KEYBOARD
It is the most common input device used for input of data and information into the
computer system. In a keyboard alphabets are printed on the keys. The first keyboard
was developed in 1800 century and was named as QWERTY keyboard. The standard
layout of letters, numbers, and punctuation is known as a QWERTY keyboard,
because the first six keys on the top row of letters spell QWERTY.
Multimedia Keys
Function Keys
Numeric Keys
Space Bar
71
Input Output Devices
Figure 16: Keyboard
3.8 MOUSE
Mouse is a handy device which can be moved on a smooth surface to simulate the
movement of cursor on the screen. It is a pointing device which is used to input data
into computer by pointing on it. Physically, a mouse contains a small case, held under
one of the user’s hand with one or more buttons.
Right Button
Roller
Plastic Cover
Left Button
Its name is derived from its shape, which looks a bit like a mouse, its connecting wire
that one can imagine to be the mouse’s tail.
Mechanical Mouse: Mechanical Mouse uses ball for the movement of cursor on the
computer screen.
Optical Mouse: Optical Mouse uses Laser rays for the movement of cursor on the
computer screen.
CordLess Mouse: CordLess Mouse is battery driven and does not need any wire for
the physical connection with motherboard.
Computer mouse are very useful in designing pictures and graphs by the multimedia
designers. Mouse pad is required to move the mouse because it provides smooth
surface.
Graphics tablet is a computer input device which allows one to handdraw images and
graphics, similar to the way one draws images with a pencil and paper. These tablets
may also be used to capture data of handwritten signatures.
72
Hardware and Software: An
Introduction Some tablets are intended as a general replacement for a mouse as the primary
pointing and navigation device for desktop computers.
Drawing Surface
Drawing Pen
Body
Graphics tablet is most suited for artists and those who want the natural feel of a pen
like object to manipulate the cursor on their screen. Wacom is the most well known
manufacturer of graphics tablets, and incredibly well respected.
3.10 SPEAKER
Speaker
Volume
On/Off
Stand
Computer speakers range widely in quality and in price. Laptops computers have
inbuilt speakers with them.
73
Input Output Devices
3.11 MICROPHONE
Head
Wire
Stand
To connect microphone, one has to insert the plug of it into the back of computer
system (generally written as mic next to it).
Integrated microphones can be found on laptops and some desktop monitors. These
Microphones are usually look like a small hole in front of the computer which when
spoken into will record your voice.
74
Hardware and Software: An
Introduction j) Graphic Tablet Can Be Used As Mouse.
……………………………………………………………………………………
……………………………………………………………………………………
………..………………………………………………………..…………………
.………………………………………………………………………………..
…………………………………………………………………………………..
…………………………………………………………………………………..
.………………………………………………………………………………..
…………………………………………………………………………………..
…………………………………………………………………………………..
……………………………………………………………………………………
……………………………………………………………………………………
………..……………………..……………………………………………………
3.12 SUMMARY
Input/output devices are the devices that connect you to your computer. Input devices
let you input data and other information into your computer and they also let you give
your computer special instructions so that it will know what to do. For example, you
can type in data by using a keyboard, or you can input data in picture form by using a
scanner or give some instruction by clicking of mouse.
On the other hand, output devices display the results of your computer’s
computations. Examples of these would be your computer’s monitor, which displays
all of the programs you’re running, as well as the printer, which will print out a hard
copy of the information.
75
Input Output Devices
3.13 SOLUTIONS/ANSWERS
(j) FALSE
2) Input devices let you input data and other information into the computer. They are
used to give special instructions to computer so that it will know what to do. For
example, you can type in data by using a keyboard, or you can input data in
picture form by using a scanner.
5) There are many different types of printers. In terms of the technology utilized,
printers fall into following categories:
1) Laser printer
2) Ink jet printer and
3) Dotmatrix printer
6) Dot matrix printer or impact matrix printer refers to a type of printer with a print
head that runs back and forth on the page and prints characters by impact,
striking an inksoaked cloth ribbon against the paper, much like a typewriter.
7) Laser printers produce very high quality text and graphics. The technology used
by them is same as that of photocopy machines. In laser printers, a laser beam
is used to produce an image on a drum. The light of the laser alters the electrical
charge on the drum wherever it hits. The drum is then rolled through a reservoir
of toner, which is picked up by the charged portions of the drum.
76
Hardware and Software: An
Introduction
(j) TRUE
2) Keyboard is an input device and is used to input data into the computer system.
Computer keyboard contains letters, numbers, function keys, arrow keys and
some special keys on it.
4) Scanner is an input device which is used to input data in the form of pictures. It
optically scans images, printed text, handwriting, or an object, and converts it to a
digital image.
6) A graphics tablet is a computer input device that allows one to handdraw images
and graphics, similar to the way one draws images with a pencil and paper.
Reference websites:
(1) www.sciencedirect.com
(2) www.ieee.org
(3) www.abcya.com
(4) www.webpedia.com
77
Software
UNIT 4 SOFTWARE
4.0 Introduction 77
4.1 Objectives 78
4.2 Classification of Software 78
4.2.1 System Software
4.2.2 Application Software
4.3 Evolution of Operating System 90
4.3.1 Serial Processing
4.3.2 Batch Processing
4.3.3 Multiprogramming
4.4 Types of Operating System 92
4.4.1 Batch Operating System
4.4.2 Real Time Operating System
4.4.3 Time Sharing Operating System
4.4.4 Personal Computer Operating System
4.4.5 Network Operating System
4.4.6 Parallel Operating System
4.4.7 Distributed Operating System
4.5 Other Criteria for Classification of Software 96
4.6 Computer Virus 97
4.7 Summary 99
4.8 Solutions/Answers 100
4.9 Further Readings and References 101
4.0 INTRODUCTION
Computer system combines software and hardware to provide a mechanism to solve some
specific tasks. In the previous unit, we had discussed some hardware devices i.e. input and
output devices and their functions. In this unit, we will discuss topics related to software
and their types such as systems software, applications software, utility software etc.
Without software, a computer will remain just like a metal box. With software, a
computer can store, retrieve, solve different types of problems, create friendly
environment for software development.
In Computer Science, the term software means a sets of instructions in the form of a
program to control the processing of computer. These programs are used for various
purposes in the computer system. A series of instructions that performs a particular task is
called “program”. The process of software development is also called programming.
Computer software can be broadly classified into two categories according to its purpose.
Systemes software and Applications software
77
Hardware and Software: An Application software is used for solving a specific problem for inventory, payroll,
Introduction
spreadsheet, word processor and presentation software etc.
There is a common misconception amongst individuals that software is data (or set of
data). But it is not. Software tells the hardware how to process the data. Computer
software provides instructions that tell the computer how to operate.
Both hardware and software are necessary for a computer to do useful job. Both are
complementary to each other. To take an analogy, a cassette player and the cassettes
purchased from the market are hardware. However, the songs recorded on the cassettes
are a form of software. The software and hardware are necessary components of
computer. To understand a computer software it is desirable to understand programming
language. Programming languages constitute the vehicle for understanding the operations
of computer hardware and software. In this unit you will learn about softwre.
4.1 OBJECTIVES
A computer can neither think nor make any judgment on its own. Also it is
impossible for any computer to independently analyze a given data and follow its own
method of solution. It needs a program to tell it what to do. A program is a set of
instructions that are arranged in a sequence that guides the computer to solve a
problem. These instructions are written in programming languages (like; BASIC,
PASCAL, C...) to help simplify the development of applications. Computer software
provides instruction that tells the computer how to operate. Software is also called
programs. Programs are usually developed using some language called “programming
language”.
Computer software can be categories into two main categories. These are system
software and application software. Function of system software are:
78
Software
System software is that category of software, which manages all the resources of
computer, and is loaded in the beginning or booting of computer. These are
designed to make the computer easier to use. System software controls the
operation of input/output devices, memory and processor etc. Windows operating
system such as Windows 95, Windows 98, Windows 2000, Windows XP
Windows Vista etc, are some examples of system software. Some functions of
system software are:
System software can be further compared as a type of program that acts like a conductor
in an orchestra. It directs all the activities and sets all the rules for how the hardware
and software work together. MS DOS and Microsoft Windows are examples of system
software or operating system software.
Some System Software are inbuilt into the computer. Examples of such software can be
given as ROM chips. This software helps to setup the computer and start it.
From the application programmer’s point of view, system software should initialize
hardware timely and efficiently and also provide better programming
environment. For example the libraries may consist of math library (for
performing mathematical functions), input/output library, graphics library (to
draw different kinds of images etc.).
Let us now discuss various types of system software’s in detail to have basic idea about
them.
1. Operating System
The operating systems (OS) are most important system software to run the computer
system. Every system must have an operating system. It directly interacts with all kinds
of hardware to provide an interface to other system software and application software
whenever it wants to access system resources such as CPU, memory, I/O devices.
79
Hardware and Software: An
Introduction
The fundamental objectives of operating system is to optimize, utilize and control various
kinds of resources: CPU, memory, I/O devices etc. so that the executions of user’
programs become easier.
Components of operating system are shown in Figure 1: The innermost layer is Hardware
Layers, followed by operating software, and application software. The last layer of this
diagram is user layer where user is connected.
The operating system must be loaded into main memory which is also called booting from
the system. One part of an operating system also called supervisor program,
which remain in the primary memory all the time. Other part of the program are
loaded into primary memory whenever it is required, otherwise it resides on hard
disk. Commonly used operating systems are MSDOS, MSWINDOWS, UNIX,
LINUX, XENUX etc.
In the early 1900s there were no operating systems. The lack of any operating system
meant that only one person could use a computer at a time. Even in the research lab, there
were many researchers competing for limited computing time. The first solution was a
reservation system, with researchers signing up for specific time slots, for performing
computing.
The high cost of early computers meant that it was essential that the rare computers be
used as efficiently as possible. The reservation system was not particularly efficient. If a
researcher finished work early, the computer remained unused until the next time slot or
next user comes. If the user time ran out, the researcher might have to pack up his or her
work in an incomplete state at an awkward moment to make room for the next user.
Let us now discuss the idea of common operating system which came into existence by
the computer researchers in early 1900s.
80
Software
Common Operating System
Originally the operating system was created by each company that manufactured a
processor and motherboard. So each operating system was proprietary, that is, unique to
each manufacturer.
Problem: changing to a new computer meant your software had to be replaced? Not good
marketing. So there was pressure early on to standardize things so that software could be
transferred to the new computer (other computer). This required more standardization in
operating systems.
The winner in the PC market was MSDOS, Microsoft's Disk Operating System, and its
twin at IBM, PCDOS, also OS written by Microsoft. Now it’s hard to recall those days
when each computer had its own unique operating system.
An operating system may process its task serially (sequentially) or concurrently (several
tasks simultaneously). It means that resources of the computer system may be dedicated
to a single program until its completion or they may be allocated among several programs
in different stages of execution.
The operating system resides in the main memory of the computer system. Following
are the basic functions performed by an operating system
(ii) File Management : File Management Program makes it easier to manage your files
and folders. Many programs were written to help the user find files, create and organize
directories, copy, move, and rename files.
(iii) Disk Management : Programs involve formatting and defragmenting disks. The
term defragmenting means, putting files on the disk, so that the whole file is in sequence.
This reduces the time to access the file. Some disk management programs even let you
specify the files that are accessed often, like the operating system itself and other
frequently used programs.
(iv) Memory Management: Memory management software handles where programs put
their current data in RAM. They move certain memoryresident items out of the way. This
81
Hardware and Software: An can effectively increase the memory available by getting all the unused pieces together in
Introduction
one spot.
(v) Security of data: The operating system handles different programs and data in the
memory, so that they do not mix or interfere with each other. It protects your computer
and data from attacks and damage from outside. Only trusted websites and programs
could be allowed to access your computer with security software.
2. Translator
The translators are the system software’s. They are used for translating the instructions
into computer readable form i.e., binary form. The instructions are written in any
computer programming language such as C or some other programming language and are
converted to computer readable form. There are many programming languages such as
machine language, assembly language, high level language. These languages allow a
person to write the software programs for system maintenance as well as applications.
These instructions are converted to binary form by translator software such as assembler,
compilers and interpreters. Let us now discuss these translator software one by one to
understand the need of language translators in programming.
(i) Assembler
The first step in the evolution of programming language was the development of assembly
language. In an assembly language mnemonics are used to represent operation
codes and strings of characters to represent address.
Figure 2: Assembler
It is the translator program which is used to translate the assembly language instructions
in binary form. As shown in figure 2, assembler converts the symbolic
instructions code of assembly language into machine language.
82
Software
The main advantage of using an assembly language programming is the efficiency of the
machine language programming resulting from it. Some of the commands which are used
in assembly language program are READ, ADD, STO & HLT and the function of these
commands are read, add, stop and halt of the execution of instruction of a program.
(i) It is machine dependent i.e., the programs written for one model of computer can’t
be executed on another model.
(ii) It is very difficult to write programs in assembly language and needs rigorous
training and expertise.
(iii) Assembly language programming is time consuming in comparison to high level
language programming.
Now let us see some code of the Assembly language program: following assembly
language program code is explained as:
Code Explanation
You can see in the above assembly language program LD, ADD and HALT commands
makes readability of program simpler for programmer.
(ii) Compiler
Since, computer doesn’t directly understand high level language programs, written in
English language to which it has to process. There is need of translators to translate the
high level language into machine language called compiler. Compilers take input as high
level language programs and produces output the machine language code of the machine
on which it is executed.
These high level language programs must be translated first into machine language and
the software which is used to convert high level language programs into machine
language (in the form of binary number, 0 & 1), is called compiler.
Programs
written in Compiler Machine
high level language
language program
such as C &
BASIC
(Source program) (Object program)
Figure 3: Compiler
83
Hardware and Software: An Compiler scans the entire program first and then checks for syntax (grammatical) errors.
Introduction
If there is any error, the computer generates a printout of the errors it has detected.
Process of detecting and removing errors from a high level language program is called
debugging.
Now let us see code of a high level language program: In the following BASIC
(Beginners all purpose symbolic instruction code) language program two numbers are
added.
10 LET X = 12
20 LET Y = 15
30 LET SUM = X+Y
40 PRINT SUM
50 END
This BASIC program adds two numbers X and Y and gives output as their sum. This
program is much simpler than assembly language program written for adding two
numbers.
(iii) Interpreter
It is another translator program for high level language. It analyzes and executes high
level language program statement line by line without looking entire program at one go
(as in the case of compiler). Each time of the program is executed; every line is checked
for syntax errors and then, is converted to equivalent machine code. It is slower than the
compiler.
Compiler Interpreter
1) Scans entire program first and then Scans program line by line.
converts it into machine code.
3. Utility Programs
A utility program performs tasks related to the maintaining of your computer’s hardware
or data. Some utility programme are included with the operating system and some is
84
Software
updated every year/time you become online with internet. By updating it becomes better
equipped to handle the needs and security of computer systems. A few examples of utility
programs are:
1) Software to convert a .pdf file format into a .doc format and vise versa.
2) Multimedia converter software to convert mp3 file format to mp4 or mpeg etc and
vise versa.
Although system software is essential for the running your computer and manage all the
resources of it. You need application software to enable the computer to solve a specific
data processing task such as payroll processing, inventory control, and insurance company
data. A software package is a group of programs for solving a specific task.
• Planning
• Writing
• Record keeping
• Calculating
• Communicating
• Drawing
• Painting etc.
The word processing means typing, editing and formatting the documents such as letters,
documents, books, and balance sheets etc. In general word, processing refers to the
processing of words i.e., simple text. A word processor is such a software package that
allows the user to create and edit the documents.
85
Hardware and Software: An Creating the documents involves typing text in the internal memory of the computer
Introduction
system and saving it on the disk. Editing a document involves correction of spelling
mistakes and deleting or moving words, sentences or paragraph, i.e., arranging text at
appropriate place in the document.
Microsoft Word is a word processing software which can be used to create, edit save and
print documents. A window of MSWord software is shown above for illustrating the
various menus present in this software. Let us now discuss the menus of this software.
Title bar: It displays the name of the program, name of the currently active word
document and control button etc.
Menu bar: It is placed below the title bar and is used for performing various tasks, such
as open, close, format etc. of the document.
Status bar: It displays information about the active task on which user is currently
working. This includes page number, line number etc. on which the user is currently
working.
Advantage of MSWord
(1) Type a document through the keyboard and save it on the disk.
(2) Correct, delete and insert characters, words, lines anywhere in the document.
(3) Retrieve documents from the disk as and when required.
(4) Move or copy paragraphs from one place to other or from one file to other.
(5) Formatting of the document as per the need of the user.
(6) Searching of files in folders of the system.
(7) Save the edited document in the disk
(8) Print a letter or document
86
Software
Although MSWord is a very good software package for word processing task, but it is
not convenient in entering data in tabular form, doing mathematical calculation and
presentation of result in graphical form.
MSExcel software package is used in place of paper sheet or ledger used by the people
in management. It is used to store information in the memory of computer system,
calculate the result, and display information on computer screen in a desired manner.
Title bar: It displays the name of the program, name of the currently active MS Excel
worksheet and control button etc.
Menu bar: It is placed below the title bar and is used for performing various tasks, such
as open, close, format etc. of the worksheet.
Status bar: It displays information about the active task on which user is currently
working. This includes page number, line number etc. on which the user is currently
working.
Features of Spreadsheet
(1) Worksheet contains rows & columns. There are 65536 rows and 256 columns in a
worksheet of MS Excel.
(2) Intersection of rows & columns gives cell, which is used for data entry.
(3) Each cell of the worksheet has unique address.
(4) New rows and columns can be inserted in a worksheet.
(5) Cell address is used for defining the formula in any worksheet.
(6) Entry in worksheet may be numbers, character values or numeric values.
(7) Currently active cell is identified by the position of the cell pointer.
(8) The cursor can be moved from one cell to another by arrow keys.
87
Hardware and Software: An
Advantage of MSExcel Spreadsheet
Introduction
3. Graphic Software
PowerPoint makes you, the presenter and independent producer of your own high equality
presentations.
Figure 6 shows the a window of PowerPoint. The features of PowerPoint Window are:
Title bar
88
Software
It is located at the top of the screen, displays the name of the presentations.
Menu bar
Status Bar
Used to display Messages regarding page number, slide number etc at the bottom of the
window.
Advantage of PowerPoint
DBMS has its role in almost every field of our life such as school, office, industry etc. It
allows storing and managing large amount of data. Various DBMS software’s are FoxPro,
Oracle, SQL, Sybase, MS Access etc.
This is the window of FoxPro DBMS software. Command window is box in FoxPro and
can be used to enter commands for the execution of the programs or for the preparation of
the project report.
Features of DBMS 89
Hardware and Software: An
• Creating data files on a computer.
Introduction
• Maintaining these file by adding, deleting, editing and updating a given set of
data items
• Generating reports based on data files
• Querying on those data files and
• Generating reports.
5) What is GUI?
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
90
Software
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
An operating system may process its task serially or concurrently. It means that the
resources of the computer system may be dedicated to a single program until its
completion or they may be allocated among several programs in different stages of
execution. Due to different processing techniques, the operating systems are classified
into different categories. Some basic categories of operating systems are explained briefly
in coming subsections.
In early computer systems, the programming was performed in 1’s and 0’s, i.e., Machine
language. The translators and data were needed to be fed into the computer system
through the input devices.
The programs first loaded into the register of the computer system. Then address of the
first instruction of the program is fetched. The result is examined by the contents of
various registers and memory locations of the machine. This type of programming causes
the low utilization of machine and user.
The program started being coded into the programming language are first changed into
the object code by translator. Then this code is automatically loaded into memory by
another program called loader. Now the execution of the program begins and the result is
produced. This type of processing uses a fixed sequence of tasks to do, hence the name
Serial Processing System.
The next logical stage after serial processing system was batch processing system. Before
we discuss batch processing system, let us discuss single program operating system and
multiple program operating systems.
Single program operating system allows only one program to run at a time. This implies
that if you are working in a spreadsheet and want to write a letter, you must shut down the
spreadsheet application and open up a word processor.
Gradually new operating systems were designed that allowed multiple programs to run at
the same time. The simplest form of this is multitasking. It allows a single user to have
the spreadsheet and the word processor open at the same time, and even more. Now the
user can see to copy data from one to the other.
A batch processing system is one in which jobs are bundled together with the
instructions necessary to allow them to be processed without intervention. Often jobs of a
similar nature can be bundled together to further increase economy. Executing series of
noninteractive jobs all at one time is called batch processing.
91
Hardware and Software: An The term batch processing originated in the days when users entered programs on punch
Introduction
cards. A punched card is basically a piece of cardboard, which has holes in it to represent
a set of machine code instructions in binary. They would give a batch of these
programmed cards to the system operator, who would feed them into the computer.
Batch jobs can be stored up during working hours and then executed during the evening
or whenever the computer is idle (free).
Batch processing is particularly useful for operations that require the computer or a
peripheral devices for an extended period of time. Once a batch job begins, it continues
until it is done or until an error occurs. Note that batch processing implies that there is no
interaction with the user while the program is being executed.
An example of batch processing is the way that credit card companies process their
billing. The customer does not receive a bill for each separate credit card purchase but
they get one monthly bill for all of that month’s purchases. The bill is created through
batch processing, where all of the data are collected and held until the bill is processed as
a batch at the end of the billing cycle. At the end of month the operator has to feed the
program into the computer. Remember that he/she may have a few programs to run, so
what he/she will do is to wait until he/she has a batch of programs to run. Let us imagine
that in the batch he has a FORTRAN program and a COBOL program to run from
punched cards.
He/she will place the cards in a tray that feeds the cards into the computer. However the
cards will not indicate which language program is in, so he/she places before the
FORTRAN program several special cards that identify the program to the computer.
He/She also puts cards at the end of the program to indicate that there is no more card left.
This entire task is called a job.
The operator has ended up with is a batch of jobs to feed into the computer. The special
cards that operator adds is part of another language that the computer understands is
called the Job Control Language or JCL for short. The JCL has commands that indicate
the start and end of jobs, which language program needs, what resources it requires
(printers etc), who wrote the program, who needs to be billed and many more.
This process of creating jobs and feeding them one after each other into the system is
called batch processing and is still common today. When the cards were fed into the
system, the computer would then look at each card in turn and decide what action to take.
92
Software
1. Move much of the work of the operator to the computer.
2. Increased performance since it was possible for job to start as soon as the
previous job finished.
Disadvantages
1. Turnaround time (total time taken in a job completion) can be long from user
standpoint
2. More difficult to debug programs
3. Due to lack of protection scheme, one batch job can affect pending jobs (for
example, read too many cards, etc)
4. A job could corrupt the monitor, thus affecting pending jobs
5. A job could enter an infinite loop
One difficulty with simple batch systems is that the computer still needs to read the deck
of cards before it can begin to execute the job. This means that the CPU is unused (or
nearly so) during these relatively slow operations.
Since, it is faster to read from a magnetic tape than from a deck of cards, it became
common for computer centers to have one or more less powerful computers in addition to
there main computer. The smaller computers were used to read decks of cards onto a tape,
so that the tape would contain many batch jobs. This tape was then loaded on the main
computer and the jobs on the tape were executed. The output from the jobs would be
written to another tape which would then be removed and loaded on a less powerful
computer to produce any hardcopy or other desired output.
Since, the computer can now perform IO in parallel with computation, it became possible
to have the computer read a deck of cards to a tape, drum or disk and to write out to a tape
printer while it was computing. This process is called SPOOLING: “Simultaneous
Peripheral Operation OnLine”.
Spooling batch systems were the first and are the simplest of the multiprogramming
systems.
One advantage of spooling batch systems is that the output from jobs is available as soon
as the job completed, rather than only after all jobs in the current cycle were finished.
As technology advanced, then serially processing the jobs soon became a handicap. What
really was needed a mean by which more than one job (program) can be held in memory
at a time, with the OS switching between them. This would then speed up the time a batch
could be processed. The only real limitation would be the size of memory.
As machines with more and more memory became available, it was possible to extend the
idea of multiprogramming as used in spooling batch systems to create systems that would
load several jobs into memory at once and cycle through them in some order, working on
93
Hardware and Software: An each one for a specified period of time. The Multiprogramming Operating System was
Introduction
born for implementing such idea. Suppose three programs in memory, two are
FORTRAN programs and the third is a COBOL program. The former requires a
FORTRAN compiler and the latter a COBOL compiler. Instead of loading the FORTRAN
compiler twice into memory, the OS only loaded it once and shared it between the two
tasks. This is called Multitasking (different tasks being run by the same program). Such
OS is called a MultiprogrammingMultitasking Operating System. However, the term
Multitasking Operating System normally means the same thing nowadays.
As discussed earlier, batch processing requires grouping of similar jobs, which consist of
programs, data and system commands.
The advantage of this type of programming is in programs with large computation time,
where need of interaction or involvement of programmer with system almost not required.
For example, programs like payroll, statistical analysis of data, and calculation of large
scientific numbers. They can submit their programs to the operators and return later after
some time to collect the output.
In other words a real time system is a system that reacts to events in the environment by
performing predefined functions within specified given time period.
A real time system is a system which ensures the exact time requirements for a job. If a
realtime system does not completed task in a certain time, it may cause a break down of
the entire system it is running. Some applications require to be serviced within a time
period:
A hard real time system guarantees that a job will complete within a specified time
period. This system must ensure that all delays on processing, input and output are
bounded. The system cannot wait indefinitely so the hard time systems are usually very
limited. There is generally no secondary storage such as disk drives as a disk request can
take a variable time low process.
Some examples of a hard real time system are the software that run the autopilot in an
jumbo jet or the imaging software on a missile.
A soft real time system is a much less restrictive version of a hard real time system. A soft
real time system does not guarantee that a job will complete within a specified time
period, however, it tries its best to finish the job as soon as possible. If a critical real time
job enters the system, the operating system may assign the highest priority to that task and
execute it continuously until it completes.
The lack of a guarantee makes a soft real time system more limited in its application for
industrial activities. Soft real time systems are used in the area of multimedia, virtual
reality etc. Some of the operating systems that provide soft real time support are Windows
NT/2000, Linux, Solaris.
With batch processing systems, there was no interaction between the user and his/her
program in execution (process) while the program was being executed. The time sharing
system allows multiple programs to simultaneously share the computer resources. In this
everything is done under operator control. The job is submitted by the user and it is
executed at some other time and the output is prepared. The delay between job submission
and job completion is called the turnaround time.
Modern computer systems are interactive. The user asks for OS services directly and
receives an immediate response. The user can easily experiment and do fast debugging.
The more popular way that programmers and users got back at the machine was the
advent of personal computers around 1980. Finally computers became small enough,
inexpensive and even an individual could own them now a days. Modern era personal
computers (PC) possess all basic features of computer and are very powerful in the term
of CPU processing.
Disk Operating System (DOS) is stored in a hard disk of the personal computer system.
Features of DOS are:
The network operating system is the collection of software and protocols (set of rules).
This collection allows the intercommunication of many computers over a computer
network. Each computer on the network has its own operating system.
(1) Each computer has its own operating system instead of running part of global system
wide operating system.
(2) Login mechanism is used to connect computer with remote server or system.
(3) Allows users to access the various resources of the network system.
(4) Users of network system are aware of where their files are kept and can move their file
from one system to another.
It is a multiprocessor operating system which works with more than on CPU in close
communication. It is also called tightly coupled system because in this system processors
share a common memory and a clock; communication usually takes place through the
shared memory. Processors in the system are divided into two categories master and
slave. Master processors, controls the slave processors.
Distributed operating systems are considered to be more reliable than single processor
based systems. They perform even if some part of the hardware is malfunctioning.
(1) Distributed operating system offers better price performance than centralized
operating system.
(2) Total computing power of distributed operating system is better than centralized
operating system.
(3) If one machine crashes the system as whole survives and keep on working.
(4) Computing power can be added in small increments.
(5) Allows many users to access common database.
(6) Allows many users to share expensive peripheral devices.
(7) Human to human communication makes easier through a wide network.
☞ Check Your Progress 2
1) What do you mean by flow control?
…………………………………………………………………………………
…………………………………………………………………………………
…………………………………………………………………………………
There are various methods to classify software into different categories. First method
which is accepted by the computer researchers world wide which we have discussed in
the section 4.2 of this unit.
However, on the basis of number of user’s, piracy policy and authority of use, software
can also be classified into following categories:
97
Hardware and Software: An
Introduction
1. Public Domain Software
Public domain software are widely used now days. Features of public domain software
are:
• Has no copyright no one owns the right to control it and any ones can make
copies of the software.
• Free to use or make copies by all.
• Can be copied, used in other programs, or changed by anyone.
2. Freeware
If small applications are developed without charging any cost it is known as freeware.
Features of freeware are:
• Has a copyright someone owns the right to determine who can make copies of
the software.
• Free to use and make copies.
• Can only give away exact copies of the software.
• Can‘t be changed or used in another program without the copyright holder’s
permission.
3. Shareware
The softwares of this category are given for some period on trial basis and later on
users are charged for using it. Features of shareware software are:
• Has a copyright.
• Allowed to use the software before paying for it.
• Can be a demo which limits some major features like the Save command.
• Can set an amount of time you can use the software.
4. Commercial Software
These software are developed by professionals for organizations for business purpose.
Features of commercial software are:
98
Software
It is necessary a computer user to know how a software is installed on computers (PCs).
Let us see how software is installed on PCs. Software installation into the
computer
The world of computers and Information Technology is going through an era of electronic
terrorism, in the form of virus. It is a problem that is potentially so dangerous that it
threatens the proper functioning of the computer system in today information usage.
We need protection from viruses, because they destroy the contents of a file or a
directory. Viruses copy themselves to other disks to spread to other computers. They can
be less harmful and just eating up machine time or they can be vastly destructive to your
files. There are more than thousands viruses known till today. Some of the category of
them are given as:
1. Trojans: This virus hides inside something else to sneak in unwanted programs. You
don’t know that they are there, like the famous Trojan horse. These often capture the login
and password of your computer.
2. Worms: These are unwanted programs that are transferred over network or Internet
connections to your system and spread themselves quickly into your computer.
3. Spy ware : Spyware programs sneak on your computer to steal important information,
like your passwords and logins and other personal identification information and then
send it off to someone else.
4. Zombie : These programs take control of your computer and use Internet connection to
attack other computers or networks or to perform criminal activities.
5. Phishing : Pronounced like the word ‘fishing’ is a message that tries to trick you into
providing information like your social security number or bank account information or
logon and password for a web site. The message may claim that if you do not click on the
link in the message and log onto a financial web site then your account will be blocked, or
some thing similar to this message.
6. Spam : It is email that you did not request and do not want. Spam of one person may
be another’s useful newsletter or sale advertisement. Spam is a common way to spread
viruses such as Trojans, Black Friday etc. into other person’s computer.
99
Hardware and Software: An
7. Browser hijacking: Hijacking occurs when one of the nastiest takes control of your
Introduction
browser, sending you to sites that you did not mean to go to. This may be a porn site or it
may look like a real banking, sales, or credit card site. The purpose of this is to steal your
personal and financial information.
Firewalls are frequently used to prevent unauthorized internet users from accessing
private networks connected to internet. All messages entering or leaving to network are
passed through the firewall, which examines each message, and blocks those which do not
meet the specified security criteria.
Figure 9 shows the concept of working of firewalls. In Figure9 those systems which are
directly connected with the internet are not secure and chances of virus infections in them
are very high. But systems which are protected with firewalls are very secure and data
stored in them is safe from the attack of viruses.
In case of virus attack on a system, it is always advisable to follow the dictum “Prevention
is better than cure”. Viruses are not omnipotent. They can be cured by using antiviral
programs. Functions of antivirus programs are:
• Prevention
• Detection
• Vaccination
• Identification, and
• Damage control
100
Software
PC Without
Fire Wall
Protection
INTERNET
PC Without
Fire Wall
Protection
Example of some antivirus and prevention software programs are: Norton AntiVirus,
Mcafee Antivirus, Quick heal Antivirus, Avast Antivirus and firewalls. Remember that
firewall is security software which acts as logical wall around your computer and blocks
unauthorized access attempts to your computer.
4.7 SUMMARY
In this unit, you have studied about software, kinds of software, types of operating
system. The term software means set of instruction or given into the computer system for 101
Hardware and Software: An processing. Software can be further divided into two categories, system software and
Introduction
application software.
System software manages all the resources of the computer and also the task of record
keeping in files and directories. The application software’s are used to do specific types of
job with the help of operating system and hardware. For example, writing letter, making
presentation slides, drawing etc.
4.8 SOLUTIONS/ANSWERS
Check Your Progress 1
1) Software: The term software means set of instruction inputted into the computer by
input devices. These programs are used for various purposes in the computer system.
A series of instructions that performs a particular task is called “program”. The
process of software development is called programming.
2) System software: System software manages all the resources of the computer and also
the task of record keeping in files and directories. System software controls the
operation of input/output devices, memory and processor etc. Windows operating
system such as Windows 95, Windows 98, Windows 2000, Windows XP Windows
Vista etc, are some examples of system software.
3) Application software: Application software’s are used to do specific types of job with
the help of operating system and hardware. For example, writing letter, making
presentation slides, drawing etc.
4) Examples of System software are: Windows XP, Windos 98 and Windows Vista
Examples of Application software are: MS office, DBMS, MS Excel, Photoshop etc..
5) Graphical User Interface is the full form of GUI. It is that feature of software in which
all the commands and instructions are displayed by using some picture or in the form
of command buttons.
6) To do specific jobs such as printer driver etc are called utility or system software’s.
These are very helpful in operating external devices.
1) Control flow determines the sequence and flow of controls in the computer system for
performing some activity (program)
102
Software
2) Functions of OS are: System Monitor activities, memory allocation and record
keeping of files and folders and it manages all the resources of computer available for
the user.
1) A batch system is one in which jobs are bundled together with the instructions
necessary to allow them to be processed without intervention. Often jobs of a similar
nature can be bundled together to further increase economy. Executing series of non
interactive jobs all at one time is called batch processing.
3) A distributed operating system is one that appears to its users like an ordinary
centralized operating system but runs on multiple independent CPU’s. These systems
are considered to be more reliable than uniprocessor based systems. They are
functional even if some of their hardware is not functioning. Have multiple CPUs,
and each CPU has its own associated memory.
Reference Websites:
• http://www.abcya.com
• http://www.ieeeexplore.org
• http://www.scidirect.coml
103
Hardware and Software: An
Introduction
UNIT 5 INTRODUCTION TO DATABASE
MANAGEMENT SYSTEMS
5.0 INTRODUCTION
We all live in an age where the world is full of data and information. You must have
heard of internet, which has become a huge source of information and also growing
everyday. The amount of data is actually very large to access and maintain. For
example, if we go to the bank to deposit or withdraw funds, if we make booking in a
hotel or railways reservation, even purchasing items from a supermarket or Mall all
these activities involves an automatic update of the database which keeps the
inventory of the store room or showroom items.
In the traditional database applications, where most of the information was stored and
accessed in either textual or numeric form. But nowadays, video clips, pictures files,
weather data, satellite images and sound image files are stored in separate and
specialized databases such as multimedia databases.
If your school Principal just wants to know the marks of a student named
Kalpana in your class. There could be more than one Kalpana in the class, but if the
data is organized in a proper manner, the information can be provided in few seconds
to the Principal. To get the right data and information you must have some database
accessing tools with you, so that information can be accessed and managed in a timely
and effectively manner. Data must therefore be collected in an organized form so that
you can get the data in very less time.
Also, in daily routine activities we come across a large number of organizations such
as, University System, Airlines, Banks, Manufacturing Company etc. The functions
performed by these organizations vary from one another. Accordingly data is needed
to store, manage and accessed.
This unit will provide you the overview of Database Management System (DBMS),
file system and its advantages including its types. Also you will learn the pictorial
representation of data in the form of EntityRelationship (ER) Diagram. You will
learn in detail about ER Diagrams and how to draw it.
102
Hardware and Software: An
Introduction
5.1 OBJECTIVES
Before DBMS came into existence traditional file approach were used for data
handling. Let us see basic differences between file approach and DBMS.
Database is the term which may be a little new to you, but understand data as the
collection of some values and when data becomes useful, it becomes information.
Now question arises how you will save data? You will save in computer memory, but
how and in what form? You will save the data in memory; the answer is in the form
of files. The answer is, you will save the data in memory and in form of files.
Data storing can be done manually also. But in case of large amount of data, this task
can become difficult and could be full of errors. So, to avoid all these difficulties
computers are used. You can say that move on to a computer from traditional filing
approach or use computerized system for data handling good for the organization
which requires a large amount of data handling.
In the traditional file processing approach, generally each business application was
designed to use one or more specialized data files containing only specific types of
data records and saved in different files.
Taking a very simple example of your daily expense, how much money you are
spending and how much you are saving can be kept in a different file. Monthly
expense would be kept in different file. An organization may keep yearly inventory
report and production department related information in different files. This system
may be better and reliable than the manual handling of the system now let us see how
103
Introduction to database
many types of files are there in the system. In order to save the relevant information in management systems
the relevant file.
Generally, there are three kinds of files: Master File, Transactional, Work File and
Database File.
Master File: A file containing static information or the information which does not
change frequently. For example employee personal details like his name, address,
spouse name etc.
Transaction File: A file in which the data is updated after every regular interval of
time. For example in sales file how much sales has happened are updated every
week or on daily basis.
Work File: This is a temporary file which helps in sorting and merging of records
from one file to another. Where a record is form by combining multiple related fields.
For example a record named Account will have fields: name, address, account no.
account type etc
Database File: It is a suite of programs which typically manages large structured sets
of determined data, offering ad hoc query facilities to many users. They are widely
used in business applications. A database management system (DBMS) can be an
extremely complex set of software programs which controls the organization,
storage and retrieval of data (fields, records and files) in a database. For example,
bank accounting system.
Now after, seeing at different files you should be able to categorize the data and can
save it in the respective files. A database management system helps in storing related
data, performing queries on data, and updating of data. Let us see some advantages of
DBMS.
DBMS has many advantages such as:
2) Provides security: Restrict users to access all the information of the database
by providing passwords and rights. There are also various coding techniques
to maintain the security of important and crucial information from
unauthorized users and accidents.
3) Data can be shared among various users: In a database system, data can be
easily shared by different users. For example, student data can be share by
teacher department subject wise, Fee department, library etc.
104
Hardware and Software: An
Introduction 4) Maintenance of data integrity: Data Integration can be understood by the
fact that the data contained in the database should be accurate and consistent.
5) Data Integrity : Since a large number of users can access database together
at the same time. So, to maintain the same data/information correct every time
and at every place during any operation is called data integrity. For example,
someone wants to make change in the address of the student Ashish record in
the Fee Department and at the same time if Librarian is also sending some
letter to Ashish’s address. The updating of address should be done at both the
places (Fee Department and Library Department) to avoid inconsistency and
such operations maintain data integrity.
Take example of an excel sheet having columns and rows where you have to save data
and also you can apply various operations such as modification, updation in the sheet.
These operations are very essential component of a DBMS.
In a database, how data is stored, how data is searched for answering a query plays
very important role. On the basis of representation of data, DBMS has been broadly
divided into four types. The division had been done in order to reduce the response
time of a query and to save memory.
Now, we will discuss about types of databases. These categories are made on the
basis of the ways in which data are stored in the database:
In business organizations or large applications, generally two types of data models are
used in DBMS: (i) relational data model (ii) object data model (it is not covered here).
But still many legacy applications are still running on hierarchical and network model.
If you want to keep track of your money or finances on weekly basis. The amount
you have spent in purchasing items. Let us say you want to note down 6 items you
purchased this week and five items next week then you will find that you are typing
105
Introduction to database
shop name and address over and over again which is a waste of time and memory management systems
space of your computer. Similarly in sequential file system, same data is stored again
and again. This is one of the major disadvantages of sequential file.
Assume that you are storing the following information again and again:
1. Item no.
2. Description of an item
3. Price
4. Quantity
5. Shop name
6. Address of shop
7. Date of purchase
If you use a flat sequential file, you have to store the same information repeatedly.
A flat sequential file, you can see, as a file having information exactly in the format in
which it is generated without proper structuring.
This system is good for very small data storage. If only few records and some tables
are required then in that case a flat file will usually serve the purpose. It does not
maintain any relationship between data stored and does not avoid redundancy of data
in the file.
For example, we can take the table below which keeps the information about the items
sold in a general store, here you will find some repetition of the data in Table 1:
Let us see the Table 2, which is having STUDENT information. This Table 2 is
having column names : Roll No., Student Name , Class, Subjects. These column
names are called attributes.
106
Hardware and Software: An
Introduction Table 2: STUDENT
Attribute
Attribute: It is the column name in the table. For example in the STUDENT table:
RollNo, Student Name, Class , Subjects are attributes.
Tuple : It is the Row in the table. We call it a data record also. For Example 12,
Prateek, XII, Computer Science together makes first record of the STUDENT table.
Relation: Collection of tuples and attributes makes a relation of a table, for example,
STUDENT relation as given in Table 2.
Primary Key: The Primary key of a table uniquely identifies the record . For
example, in a class there could be two students with the same name, as you can see
there are two Prateek in the class so, to identify a particular student there is a roll no
which is provided to every student and that is unique. It means different for every
student roll number will be different so in this case, RollNo is the primary key.
Foreign Key: The Foreign Key is the key of a table which is used for referencing the
other table for example, in a school library if Librarian wants to see issued book to a
particular student, he/she will refer that with the roll no. of that student so, in this case
in the Library table RollNo of a student is the Foreign Key which is the Primary key
in the STUDENT table. Here, BookNo is the Primary Key for LIBRARY table and
RollNo is the Foreign Key which is the Primary Key in the STUDENT Table.
Table 4: LIBRARY
107
Introduction to database
CS126 15 Digital Electronics 24/06/2009 management systems
CS127 16 MathsI 25/06/2009
There are Various Constraints in Database Systems. The constraints mean various
checks on the database which are used to validate the data in the table. These are some
constrains :
a) KEY Constraint
b) NOT NULL constraint
c) Semantic Constraint
d) Referential Integrity Constraint
Key Constraint:While designing any database, you must specify one attribute or
combinations of attributes which must be unique. That unique key becomes the
Primary Key to be used to identify tuples or records. For example RollNo is the
primary key in the STUDENT table and BOOK table BookNo is the primary key.
NOT NULL Constraint: In this validation, it says that no Primary key should have
NULL value. For example, every student must possess a roll no.
Semantic Constraint: It expresses the general restriction on the data or defines some
boundary condition on the required attribute. For example, a student can be issued two
books at a time.
For example, the LIBRARY table, RollNo 12 (student name : Prateek) must exist in
STUDENT table when referred to by the LIBRARY table.
Referential Constraint
Now let us look into another type of DBMS which is a Hierarchical DBMS.
In this kind of databases, data are stored in the form of a hierarchy. Hierarchy
database is like a tree structure which has one root and many branches. It uses the
concept of parent child relationship. In this type of database a single file may have
many relationships with many files.
This system is very advance compare to a flat file (sequential file system), where in a
business has to deal with several files which are hierarchically related to each other.
108
Hardware and Software: An
Introduction Let us take an example of Customer and Supplier System. A Store name ABC which
is a store of several departments, each department is having a storekeeper, number of
staff, and their address. Each department is having several products and each product
is having product number, product description and price. Also, the available quantity
of different products are stored in the database. Further, information about suppliers of
different products is stored in which the database.
This example of Store can be shown in a tree like structure as given below:
In the Figure Tree (T1): A department is having various products and here table
Department is acting as a parent because it has various products (Table Product which
is acting as a child). Further in fig T2, Product table has many Suppliers and in II part
it has shown that a Supplier (Supplier table with attributes Supplier_name,
Supplier_Street and Supplier_City) delivers/supplies various Orders.(Order Table
with attributes Order Number and Order_description)
Department
Storekeeper
Name of Depart No. of Staff Address
Name
Product
Product
Product No
Product description
Supplier
Supplier
Order
109
Figure 1 (c) : Tree (T3)
Introduction to database
management systems
2) This type of database is generally used in daily life organizations where data
is organized in hierarchically organized domains, component assemblies in
manufacturing, personnel organization in companies.
The basic objective of network model is to separate data structure from physical
storage,
Network Model: In this model, a parent can have many children and a child can also
have many parent records. These records are physically linked through linked lists.
Considering the same example (which we have taken for Hierarchical model) for
Network Model as:
A Store ABC which has many Customers and takes various Orders from various
Suppliers of many Products.
110
Hardware and Software: An
Introduction
A Customer record can have many Orders and Orders record can have many Products.
Product record can be owned by both Order and Product records both.
In the figure below, Supplier table shows a relation link with the Order Table .
A Supplier record can delivery many Orders.
Order
Supplier_name Supp_street Supp_city Order_no
Description
Relationlink
Here, boxes are record types and lines are links. In figure 2, Supplier has to
supply/deliver the Order. Many Suppliers can deliver/supply many Orders. This is the
relationlink between them.
You can summarize the Network Model by greater flexibility links between records of
the same type are not allowed while a record can be owned by several records of
different types .
Relational Model
In this model of DBMS, data is stored in twodimensional table (rows, and columns),
this is a model relation between two tables exists with something in common or some
data which these two tables share. Each column of a table is referred to as an
attribute and the values which it may contain is called domain of values.
This is model was proposed by IBM researcher E.F. Codd in 1970. It is more of a
concept than a data structure. Its internal architecture varies substantially from one
RDBMS to another. Relational Database model use relational concept of mathematics
in a table.
Now if you observe in the figure 3 below, table Supplier and table Order are having
Order_No (PK)
attribute Supplier_no in common and they (Supplier and Order) are related with each
Supplier_No (Primary Key) (PK)
other due to this common attribute. Order_Description
Supplier_Name
Supplier_No (FK)
Supplier_Street
Date of Order
Supplier_City
111
Figure 3: Supplier and Order Relationship (Relational Model)
Introduction to database
management systems
PK = Primary Key
FK = Foreign Key
− Supplier_No is the primary key for supplier table as it uniquely identifies the record.
− Order _No is the primary key in the Order Table since it uniquely identifies the
record.
− Supplier_No is the foreign key for the Order Table which comes from supplier
Table and used for Refreshing the Record
The contents of a table are rarely static thus the addition or deletion of a row is
required. Some advantages of relational model is:
112
Hardware and Software: An
Introduction 2) Summarize the features of Hierarchical Database.
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
Database development is having its life cycle. It can be seen as the steps involved in
database development. In next section, we will explore life cycle of database
development.
Whenever you are given a task to design a database system, then the logical steps, you
will follow is to design that system is known as life cycle of the system.
First of all a written document is prepared where you keep all the data on which the
system runs, For this purpose you can divide your work in the following steps:
a) Analysis: Analysis of the data means how frequently the data in the system is
changing, what are the sources for data etc.
b) Objective and Constraints: You must know the objectives, problems and
constraints of the system by defining these things for the system to be developed,
you will be in position to tell that is the new database is to perform, what are the
activities this new database system is going to do and in what way these activities
to be done.
c) Database Design: In this activity you will decide the master files (where
data is not frequently changing), transaction files (where data is changing very
often and some calculation has to be performed on them). On the basis of this,
database is designed conceptually, physically and logically.
d) Define scope and boundaries: here, you have to decide what is to be stored
on new database system and what to be is stored elsewhere.
Now let us see some details of conceptual, physical and logical database modeling.
113
Introduction to database
A conceptual data model identifies the highestlevel relationships between the management systems
different entities. Conceptual data model include:
Product
Supplier/Store
From the Figure 4, you can see that the only information shown via the conceptual
data model is the entities which describe the data and the relationships between those
entities and other information (such as attributes, primary key) is shown.
A logical data model describes the data in as much detail as possible, without
considering to how they will be physical implemented in the database. Features of
a logical data model include:
The steps for designing the logical data model are as follows:
Product
1) Specify primary keys for all entities.
Product_Id
2) Find the relationships between different entities.
3) Find all attributes for each entity.
Prod_des
4) If there are manytomany
Category relationships in the system, those are resolved here.
5) Normalization is done as per need.
Unit_Price
Qty
The Figure 5 is an example of a logical data model where you can observe various
Store
attributes of Product and Store tables are identified as (Product_ID, Prod_des,
Category etc): Shopkeeper/STORE
Store_Id
Store_Name
Address
Contact_No
Supplier_No
114
Basic differences between Conceptual Data Model and Logical Data Model are:
Physical data model represents how the model designed actually will be built in the
database. A physical database model shows all table structures, including column
name, column data type, column constraints, primary key, foreign key, and
relationships between tables. Features of a physical data model include:
Store_Id: Integer
Data Models are basically a way of structuring or describing data, also defines a set of
operations which can be performed on the data, such as selection, some tuples from a
table or joining of two database tables etc. When you recognize anything in a high
level or abstract view of database is called logical model.
You can categorize Data Models as a collection of conceptual tools for describing
data, data relationships and data semantics (meaning of data) and data constraints.
Recordbased Logical Models: Record based models are so named because the
database is structured in fixed format records of several types. Each record type
defines a fixed number of fields, or attributes and each field is usually of fixed
length.
As the name suggests Entity Relationship Models illustrates the relationships between
Entities.An Entity is a Real time Object like Shop, Customer, School, Department,
Supplier, Order, Buyer, Shopkeeper etc.Here, the Data Modeling the focuses on the
representation of data in the form of diagrams.
See, what a relation is; you are going to a particular shop again and again for
purchasing same kind of items. Next time when ever you will go, he will recognize
you. That means you have set up some relation with that shopkeeper.
This is a relation between two entities say Kalpana (Buyer) and Srikant (Shopkeeper).
And between them the relation is of purchase goods.
ERModel was originally proposed by Peter in 1976. Simply stated, the ER model is a
conceptual data model that views the real world as entities and relationships.
116
Hardware and Software: An
Introduction
You will find it very interesting in drawing the relationships between various entities.
Advantages of ERModel
(a) It provides the clear and readable relationship between entities in the system for
the database designer as well as for the end user.
(c) It maps well to the relational model. The data model can easily be transformed
into relational tables.
For designing ER model for any system you need three features of the system:
Entity : ENTITY
Relationships :
Attribute :
On the basis of characteristics of entities, they are divided into two categories:
• Strong Entity
117
Introduction to database
• Weak Entity management systems
Strong Entity: It is defined as “An entity type whose existence does not depend on
some other entity type”. For example Student entity is a strong entity.
Weak Entity: A weak entity is defined as “An entity type whose existence depends
on some other entity type”.
Derived Attribute: An attribute whose value can be calculated from another attribute
is known as derived attribute. For example, the attribute “Years of Experience” for
the entity type EMPLOYEE, can be derived from the difference of the current year
with the value at the attribute “Start Date” (start date of employment).
Multivalued Attribute: An attribute that may take on more than one value for a
given entity instance. For example, “Skills” is an attribute of the entity type
EMPLOYEE, that may take more than one value, that is why it is a multivalued
attribute.
ER Diagram Notations
Symbol Meaning
1. Entity Type
118
Hardware and Software: An
Introduction
3. Relationship
4. Attribute
5. Key Attribute
7. Derived Attribute
E1 1 N
R E2
The various types of Relationships are called the Degree of a Relationship which
reflect the number of entities associated with a relationship. The nary relationship is
the general form for degrees n. Special cases are the binary and ternary where the
degree is 2 or 3 respectively.
119
Introduction to database
management systems
ENTITY
OR
Entity
Entity
Entity
Entity
Entity
Whenever you are solving any problem of a database design or when you need to save
some data in the database, you need to prepare a preliminary list of functions and
transactions which the proposed system model must support. For this a activity some
of the things need to be done are:
a) Identify the list of entities and select the key or identifier for each, entity.
b) Prepare a list of relevant attributes for each entity.
c) Identify the relationships between entities in the system.
d) Finally draw a complete ERDiagram which will be the blue print of Database
Design.
For example in a University system which keeps a detailed database of the students
information. Make an ER diagram for students who are having History as a subject:
Course Teacher
ID Name Address
Cours Semeste
e r
STUDENT Has HISTORY
Semeste
r Departmen
121 t
Introduction to database
management systems
In the designing of a database the entities are converted into corresponding table
names, and their attributes are defined as the fields of the respective table. The
relationship between the entities identify the Primary Key and Foreign Keys or the
reference key with which two tables can be connected.
If we take the above example into database design, we will have two tables.
• STUDENT
• HISTORY
Attributes of the table STUDENT are: ID, Name and Address, and Course and
attributes of Table HISTORY are: Course, Teacher, Semester, Department.
These two entities are having relationship (Has). You may identify the Primary and
Foreign key in a relation ship is used for the referencing of data between two tables.
The student id which is the primary key in the Student table can be referred as the
foreign key in History table.
For designing database for this system, first of all identify the entities in this system
and their attributes. Then identify relationships between entities and finally an ER
Diagram may be drawn.
• COMPANY
• EMPLOYEE
• PROJECT
Entities Attributes
COMPANY comp_name, comp_add, no_of_emp
EMPLOYEE emp_id, ename, emp_add, sex
PROJECT project_id, proj_no, location
122
Hardware and Software: An
Introduction
– Employee works for a Project
– Company controls Projects
– Employee works for company
– Employee is assigned a Project
city
street
emp_name
emp_add comp_add
comp_name
emp_id sex
EMPLOYEE COMPANY
Work for
Controls
domain
assigned PROJECT
proj_id location
proj_no
123
Introduction to database
Figure 8: ERDiagram for Company, Employee and Project management systems
• Sybase
• MySQL
• Oracle
• MS Acess
• Informix
• SQL Server
• Foxpro
There are many areas of our life in which DBMS can be used. Some of the areas of
applications and Industries where DBMS is extensively used are:
b) MySQL is a DBMS.
124
Hardware and Software: An
Introduction
2) In daily life problems, where do you see the applications of database?
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
5.5 SUMMARY
1) (i) F
(ii) F
(iii) T
(iv) F
(v) F
(iv) For every record, there is only one parent record at the next level up in the tree
for example every county has exactly one state, every part has exactly one
department
125
Introduction to database
(v) No connections between occurrences of the same record type . management systems
(i) In Network database links between records of the same type are not allowed,
while a record can be owned by several records of different types
(ii) It cannot be owned by more than one record of the same type (patient can
have only one doctor, only one ward)
1) (a) T
(b) F
(c) T
(d) T
(i) It helps the database designers to understand the relationship between different
entities in a database. It is used as a conceptual data model, which represents the
structure and the constraints of a database that is independent of the software.
(ii) It is a tool for communications between database designers and end users
during the analysis phase of database development.
Sex
Name
Name is
Person married
to
Course_No
Id_No Course
Stud_name Name
Takes Course
Student
126
Course
No. Course
Contact Name
Name
No.
Address
Professor Teaches Course
Classroom Size
Classroom No.
4) Strong Entity: Strong entity is an entity type which exists independent of all
other entity types, in contrast with the weak entity type, whose existence depends on
some other entity type. For example, MEMBER is an entity type in the database of an
insurance company. Entity type DEPENDENT, keeps information about the
dependents of each instance of the entity type MEMBER. For example if Archana is
a member, and she has two children Elina and Angel. The company keeps
information about Elina in the entity type MEMBER and the information about Elina
and Angel in the entity type DEPENDENT. If Archana decides not to be a member
of the insurance company anymore, her information together with her children is
removed from the database. However, if Elina decides not to be a dependent anymore
that would not impact Archana, she still is a member of the company.
Derived Attributes: It is different from simple derived attributes, are those attributes
whose value can be derived (calculated) from other related attribute values that are
stored in the database. For example, ALUMNUS is an entity type of the database of a
University. “Years of Study” is an attribute of this entity type, whose value can be
easily calculated using the attributes “Start Date” (of the studies) and “Graduation
Date”.
127
Introduction to database
management systems
Check Your Progress 4
1) (a) F
(b) T
(c) T
(d) F
(e) T
2) DBMS is very useful in day to day activities. All day to day transactions can be
saved and one can maintain address book, phone diary in the form of databases.
3) ERdiagrams makes the task easy by giving a view of real world which consists
of set of objects. An ERDiagram represent entities and relationship among them.
ERDiagram is very useful for creating tables of a database.
128
Algorithm and Flow Chart
UNIT 1 ALGORITHM AND FLOW CHART
1.0 Introduction 05
1.1 Objectives 05
1.2 Problem Solving 06
1.3 Algorithm 06
1.3.1 Examples of Algorithm
1.3.2 Properties of an Algorithm
1.4 Flow Chart 11
1.4.1 Flow Chart Symbols
1.4.2 Meaning of Flowchart
1.4.3 Guidelines for Drawing Flowchart
1.4.4 Some Flowchart Examples
1.4.5 Advantages of Flowcharts
1.4.6 Limitations of Flowcharts
1.5 Summary 18
1.6 Solutions/Answers 18
1.7 Further Readings and References 21
1.0 INTRODUCTION
Intelligence is one of the key characteristics which differentiate a human being from other
living creatures on the earth. Basic intelligence covers day to day problem solving and
making strategies to handle different situations which keep arising in day to day life. One
person goes Bank to withdraw money. After knowing the balance in his account, he/she
decides to withdraw the entire amount from his account but he/she has to leave minimum
balance in his account. Here deciding about how much amount he/she may withdraw from
the account is one of the example of the basic intelligence. During the process of solving
any problem, one tries to find the necessary steps to be taken in a sequence.
In this Unit you will develop your understanding about problem solving and aproaches.
1.1 OBJECTIVES
Can you think of a day in your life which goes without problem solving? Answer to this
question is of course, No. In our life we are bound to solve problems. In our day to day
activity such as purchasing something from a general store and making payments,
depositing fee in school, or withdrawing money from bank account. All these activities
involve some kind of problem solving.
It can be said that whatever activity a human being or machine do for achieving a
specified objective comes under problem solving. To make it more clear, let us see some
other examples.
Example1: If you are watching a news channel on your TV and you want to change it to
a sports channel, you need to do some thing i.e. move to that channel by pressing that
channel number on your remote. This is a kind of problem solving.
Example 2: One Monday morning, a student is ready to go to school but yet he/she has
not picked up those books and copies which are required as per timetable. So here
picking up books and copies as per timetable is a kind of problem solving.
Example 3: If some one asks to you, what is time now? So seeing time in your watch and
telling him is also a kind of problem solving.
Example 4: Some students in a class plan to go on picnic and decide to share the
expenses among them. So calculating total expenses and the amount an individual have to
give for picnic is also a kind of problem solving.
Now, broadly we can say that problem is a kind of barrier to achieve something and
problem solving is a process to get that barrier removed by performing some sequence
of activities.
Here it is necessary to mention that all the problems in the world can not be solved. There
are some problems which have no solution and these problems are called Open Problems.
If you can solve a given problem then you can also write an algorithm for it. In next
section we will learn what is an algorithm.
1.3 ALGORITHM
Webopedia defines an algorithm as: “A formula or set of steps for solving a particular
problem. To be an algorithm, a set of rules must be unambiguous and have a clear
stopping point”.
There may be more than one way to solve a problem, so there may be more than one
algorithm for a problem.
6
Algorithm and Flow Chart
Now, if we take definition of algorithm as: “A sequence of activities to be processed
for getting desired output from a given input.” Then we can say that:
Before writing an algorithm for a problem, one should find out what is/are the inputs to
the algorithm and what is/are expected output after running the algorithm. Now let us take
some exercises to develop an algorithm for some simple problems:
While writing algorithms we will use following symbol for different operations:
Expected output:
Area of the Circle
Algorithm:
Problem 2: Ravi has to attend at least 70% of Practical Classes for C programming to be
eligible to appear in the examination. There are total 50 Practical Classes for C
programming. He has attended 20 out of 30 classes held so far. Find, at least how many
more classes to be attended by Ravi to be eligible for appearing in Practical Examination.
Expected output:
Number of classes to be attended to become eligible for appearing in examination
Algorithm:
Step6: Print Cm
Expected output:
Temperature in Celsius
Algorithm:
Step 2: C 5/9*(F32)
Problem 4 : Ramshewak goes to market for buying some fruits and vegetables. He is
having a currency of Rs 500 with him for marketing. From a shop he purchases 2.0 kg
Apple priced Rs. 50.0 per kg, 1.5 kg Mango priced Rs.35.0 per kg, 2.5 kg Potato priced
Rs.10.0 per kg, and 1.0 kg Tomato priced Rs.15 per kg. He gives the currency of Rs. 500
to the shopkeeper. Find out the amount shopkeeper will return to Ramshewak. and also
tell the total item purchased.
Before we write algorithm for solving above problem let we find out what are the inputs
to the algorithm and what is expected output.
Expected output:
Amount to be returned by shopkeeper after deducting total price of the purchased
vegetables and fruits, and total items purchased.
Algorithm:
Step1: Total 0, i 1;
8
Algorithm and Flow Chart
Spet2: Read amount purchased and unit price of itemi
Step4: i i+1
Expected output:
Factorial of N
Algorithm:
Step 2: I 1
Step 6: I I+1
Step 8: Print R
Expected output:
Table of N
Algorithm:
Step 1: I1
9
Problem Solving Techniques Step 2: Read N
Step 4: I I+1
Step 5: Repeat Step 3 and 4
Step 6: Stop
Donald Ervin Knuth has given a list of five properties for an algorithm,
Donald Ervin Knuth
these properties are:
(Courtesy: http://svana.org)
1) Finiteness: An algorithm must always terminate after a finite number of steps. It
means after every step one reach closer to solution of the problem and after a finite
number of steps algorithm reaches to an end point.
Any algorithm should have all these five properties otherwise it will not fulfill the
basic objective of solving a problem in finite time. As you have seen in previous
examples, every step of an algorithm puts you closer to the solution.
While writing an algorithm for a problem if you are writing some operations such as a
loop for performing some operation(s) repeatedly, then your loop must stop after
finite number of iteration\repetition. While solving complex activity, for example for
getting the total sum of all the items purchased from a general store, the better
approach is to calculate the price of all the items separately and then add them to get
the final sum. By doing this, you assure the finiteness and effectiveness of the
operations in your algorithm.
10
Algorithm and Flow Chart
……………………………………………..………………………..
…………………………………………………………………………………………
…………………………………………………………………………..
………………………………..
2) Explain need of an algorithm.
……………………………………………..………………………..
…………………………………………………………………………………………
…………………………………………………………..
…………………………………….…………..
3) Can there be more than one algorithm for a single problem? Give reason for your
answer.
……………………………………………..………………………..
…………………………………………………………………………………………
…………………………………………………………... ……………..
………………………………..
4) Write an algorithm to find average age of a group of 10 players.
……………………………………………..………………………..
…………………………………………………………………………………………
…………………………………………………………………………..
………………………………..
1.4 FLOWCHART
The flowchart is a diagram which visually presents the flow of data through processing
systems. This means by seeing a flow chart one can know the operations performed and
the sequence of these operations in a system. Algorithms are nothing but sequence of
steps for solving problems. So a flow chart can be used for representing an algorithm. A
flowchart, will describe the operations (and in what sequence) are required to solve a
given problem.
11
Problem Solving Techniques You can see a flow chart as a blueprint of a design you have made for solving a problem.
For example suppose you are going for a picnic with your friends then you plan for the
activities you will do there. If you have a plan of activities then you know clearly when
you will do what activity. Similarly when you have a problem to solve using computer or
in other word you need to write a computer program for a problem then it will be good to
draw a flowchart prior to writing a computer program. Flowchart is drawn according to
defined rules.
For drawing flow chart standard symbols are used. These symbols are given in Table 1.
12
Algorithm and Flow Chart
Flow charts are drawn using slandered flowchart symbols. While drawing flowchart some
guideline to be followed. Below are some guidelines for drawing flowchart:
2) The flowchart should be clear and easy to understand. There should not be any
ambiguity in understanding the flowchart. For doing this it is necessary to have all the
steps and operation very simple.
3) Usually direction of the flow of data /procedure in the system should be from left
to right or top to bottom.
4) Only one flow line should come out from a process symbol.
or
5) In the case of use of decision symbol,only one flow line should enter to
it(decision symbol), but there may be two or three flow lines coming out of the
decision symbol, one for each possible answer.
A=B
6) In a flowchart only one flow line should come to the end symbol.
13
END
Problem Solving Techniques
7) While writing steps in side the processing symbol, steps should be brief and if
necessary, you can use the annotation symbol to describe data or processing l
steps more clearly.
P=A*R
8) In the case of complex flowchart connector symbols to be used for reducing the
number of flow lines in the flowchart.
11) Once a flowchart is drawn its validity should be tested by passing through it with
a simple set of test data.
Now, we will discuss some examples on flowcharting. These examples will help in proper
understanding of flowcharting technique. This will help you in program development
process in next unit of this block.
START
READ N
For example following is a Flowchart for finding factorial of a number N:
I=1
F=1
F=F*I
NO
IS
I=I+1
I=N?
YES
PRINT F
14
END
Algorithm and Flow Chart
START
READ r
AREA = 3.14 * r * r
PRINT AREA
END
PRINT Cm
15
END
Problem Solving Techniques
START
READ F
C = 5/9 * (F – 32)
PRINT C
END
Problem 4: Ramesh goes to market for buying some fruits and vegetables. He is having a
currency of Rs 500 with him for marketing. From a shop he purchase 2.0 kg Apple priced
Rs. 50.0 per kg, 1.5 kg Mango priced Rs. 35.0 per kg, 2.5 kg Potato priced Rs. 10.0 per
kg, and 1.0 kg Tomato priced Rs. 15 per kg. He give the currency of Rs. 500 to the
shopkeeper. Find the amount shopkeeper will return to Ramesh and also tell the total item
purchased. Before we make flowchart for solving above problem let us find out what are
the inputs and what is the expected output.
START
READ AP, MP, PP, TP
PRINT RAM
RETURN
END
START
READ N
I=1
I>
10
NO
R=I*N
I=I+1
YES PRINT
R
END
As we discussed flow chart is used for representing algorithm in pictorial form. This
pictorial representation of a solution/system is having many advantagrs.These advantages
are as follows:
17
Problem Solving Techniques
1) Communication: A Flowchart can be used as a better way of communication of
the logic of a system and steps involve in the solution, to all concerned particularly to
the client of system.
2) Alterations and Modifications in Logic: any alterations in the program logic may
require redrawing of flowchart completely.
18
Algorithm and Flow Chart
3) Explain uses of Flowchart.
……………………………………………..………………………..
…………………………………………………………………………………………
…………………………………………………………... ……………..
………………………………..
4) Draw a flowchart to find the sum of first 100 natural numbers.
……………………………………………..………………………..
…………………………………………………………………………………………
…………………………………………………………... ……………..
………………………………..
5) Draw a flowchart to find the largest of three numbers x, y and z.
……………………………………………..………………………..
…………………………………………………………………………………………
…………………………………………………………... ……………..
………………………………..
1.5 SUMMARY
In this unit you have learned about an algorithm. How an algorithm to be written. This
unit explains the properties of an algorithm such as finiteness, definiteness,and
effectiveness. Further this unit covers about the flowcharting. Flowcharting is a way of
representing algorithm in the form of a diagram. You have learned about different
symbols used in drawing flowcharts. This unit also explains about guidelines for drawing
flowcharts. Finally in this unit we have discussed about advantages of flowcharts and
limitations of flowcharts.
1.6 SOLUTIONS/ANSWERS
Check Your Progress 1
1) An algorithm is “A sequence of activities to be processed for getting desired
output from a given input.”These activities may be in the form of some formula,
some operation or some inputoutput activity.
3) Yes, there may be more than one algorithm for same problem. As an algorithm states
the steps involve in getting the solution of a problem. For example if one wants to go
from point X to point Y in a city and there are many alternative paths (ways) which
are available for going to point Y from point X. One may choose any of the
alternative paths available. Similarly for solving a problem there may be more than
19
Problem Solving Techniques one alternative ways available and each way of solution can be represented in the
form of algorithm. So a single problem may have more than one algorithm.
4) Algorithm:
Step 1 : Sum 0
Step 2: I 1
Step 3: Read the age of PlayerI as Age(I)
Step 4: Sum Sum+Age(I)
Step 5: I I+1
Step 6: If I <=10 Then GOTO Step 3
Step 7: Print Average age is: Sum/10
5) i) True
ii) False
iii) False
iv) False
v) True
1) i) Steps, order
ii) Top –bottom, leftright
iii) Connector
iv) Two
v) Flowchart
2) Start the flow chart by drawing the elongated circle shape, and labeling it “START”.
ii) Move to the first action or question, and draw a rectangle or diamond as per need.
Write the action or question and then draw an arrow from the start symbol to this
shape.
iii) Put all the actions in your whole process, appropriately in the order they occur,
and linking these together using arrows to show the flow of the process.
iv) For making decision, draw arrows leaving the decision diamond for each
possible outcome from the decision, and label them with the outcome.
v) Finally to show the end of the process using an elongated circle labeled “END”.
vi) After drawing is complete, change your flow chart step to step by asking yourself
if you have correctly represented the sequence of activities and decisions involved
in the process and if needed make the necessary corrections in the drawing.
3) Flow charts are easytounderstand diagrams. Flowcharts show how steps in a process
are working together. This feature makes flowchart useful tools for communicating
20
Algorithm and Flow Chart
how processes work. Also flowcharts help in clearly documenting how a particular
job is done. A flowchart is useful in:
START
SUM = 0
N=0
N=N+1
SUM = SUM + N
YES
NO IS N =
100?
YES
PRINT
SUM
START
END
NO
PRINT PRINT
PRINT
Y X
Z 21
END
Problem Solving Techniques
22
Problem Solving Techniques
UNIT 2 PROBLEMS SOLVING USING C
PROGRAMMING LANGUAGE
2.0 Introduction 22
2.1 Objectives 22
2.2 Execution of a C Program 23
2.3 Structure of a C Programme 23
2.4 Basic Components of C Programming 26
2.4.1 Tokens and Keywords
2.4.2 Data Type and Variables in C
2.4.3 Operators and Punctuations in C
2.4.4 Constants
2.5 Statements in C Programming 33
2.5.1 Sequential Statement
2.5.2 Conditional Statements ( if, ifelse if, switchcase)
2.5.3 Iterative Statements (for loop, while loop, dowhile loop)
2.6 Array in C 42
2.7 Use of C Programming Language 43
2.8 Summary 44
2.9 Solutions/Answers 44
2.10 Further Readings and References 46
2.0 INTRODUCTION
Problem solving skill develops with time. Once you start solving smaller and simpler
problem, you become more aware about the steps required for writing solutions of the
problems. In previous unit of this block, you learned about algorithms and flowcharts. An
algorithm can not run on a computer, you have to write the algorithm in a language that a
computer can understand. The languages that a computer understands are known as
computer programming language.
The C is one of the very popular programming language. The C was written by
Kerningham and Richie in the 1970s. C is used for developing computer applications in
the area of system software, utility software such as device driver, network programming,
databade systems, and many other areas of applications software. You may take this unit
as beginning of learning a programming language. It is easy to learn other computer
programming languages after learning C.
2.1 OBJECTIVES
22
Problem Solving Techniques
C Library
MyPrg.o MyPrg
MyPrg.c Compile Link
Before we discuss about structure of a C program let us see a simple C program which
does not perform any operation and only prints “Hello World” message:
First C Programme
After you compile and run this program it will print out the message: Hello World. This is
the first C program we are exposed. Though the program is very simple, but you may
learn a few points by going through eight lines of this program. #include< inserts another
23
Problems Solving using
file. “.h”> is used for calling “header” files. These header file contain methods for C Programming Language
performing needed tasks. All header files have interface to libraries and their cod for
performing task is kept in other “.c” files.
Every C program contains a function called main. This is the starting point of the
program. #include <stdio.h> is used to allow a program to interact with the screen as
output on your computer. You will find it at the beginning of almost every C program.
The details of need of #include <stdio.h> we will discuss letter. The main() function
declares the start of the program and the two curly brackets( { and }) show the start and
end of the main function. Curly brackets in C are used to group statements in a block
together to mark the beginning and end of a function or in the body of a loop( loop will
be discussed later in this unit). This type of grouping is known as block in a program.
printf(“Hello World\n”); prints the words on your computer screen. The text to be printed
is enclosed in double quotes. The ‘\n’ at the end of the text tells the program to print a
new line as part of the output.\n is used for the purpose of more clarity in the output. By
putting \n at the end of the message to be printed it is ensured that when ever in a program
some thing more will be printed on screen it will be printed in the next line.
One more point you may note here is that C is case sensitive therefore it differentiate
between a lower case letter and a upper case letter . For example main is different than
Main.
return 0 is written in this program for completing it. Because in int main( ) int means
function main() returns an integer value, so there must be a statement that indicates what
this int value is.The statement return 0 ; indicates that main() returns a value of 0 (zero)
to the operating system(OS). If this program has completed successfully and terminated
execution it will return 0 to OS. Here you do not have to know in detail about this
concept. Without getting worried about this concept let us move on to know more about
structure of a C program. But you just remember to use the return statement in your
program when you write because main function always returns an integer.
In this program there are two functions: main and printf.
On the basis of our fist C program now let us see the basic structure of a C program
which generally has following components:
In C all comments must begin with the characters /* and end with the characters */. For
example if you write 24
Problem Solving Techniques
/* This is my First C Program */
then statement “This is my First C Program” will be treated as comment. In any program
the program header comment always comes first.
Preprocessor directives are special statements that is included in the program code as you
have seen in section 2.3.1 of this unit. These directives are not program statements but
special instructions(directives) for the preprocessor and on the basis of these directives
some activities are performed before actual program code compilation. For example
#include <stdio.h> is called preprocessor directive (command).It directs the preprocessor
to include all the functions defined in stdio.h in the program before it compiles the code
written in the program. For more clarity please see the following prinf() statement:
You remember that a preprocessor directive is written in only a single line of code. As
soon as a newline character ‘\n’ is found, the preprocessor directive is considered to end.
No semicolon (;) is used for the end of a preprocessor directive as in the case of other
statement like: printf(“Hello World\n”); or return 0;.
In general “a preprocessor is a program which processes the input data and produce
output that is used as input to another program”.
stdio.h – The #include <stdio.h> directive indicates the preprocessor to include a copy of
the standard input/output header file stdio.h in the program code.
iii) int main ( void ): Generally every program has a function called main. This is the
point from where program execution begins. The main () is placed in the source code file
as the first function for the purpose of readability. In your program there must be a
function with this name otherwise c compiler can not successfully compile and link your
program.
A function may take some value for performing operations. The value(s) given to a
function is known as arguments to the function. For example suppose you have written a
function:
for finding sum of two integers. This function return an integer and take two integers as
argument it means you can pass two values of integers to the function sum. In side
parenthesis ( ) after main, void is written, it means nothing is there inside ( ).
iv) The Function Body of main( ):The main function starts with a left brace (curly
bracket) { begins the body of every function. A corresponding right brace } ends
the function body. In side { and } are the statements to be performing the operation. For
example if you are writing a program to find the area of a circle in C, then operations need
to be performed for this purpose will be written inside {and }.
25
Problems Solving using
v) Statement(s): These are the main portion of any program. Statements written in a C Programming Language
program decides about the activity to be performed such as input operations, output
operations, logical operations etc.
vi) return 0; : Because function main() returns an integer value, there must be a
statement that indicates what this value is. The last statement is return 0 ;. It ends with a
semicolon. Also remember that all statements in C end with a semicolon.
After learning about structure of a C program, now let us see the basic components of C
programming. These components are used for writing C programs for solving problems.
Next section is going to cover almost all the basic components of C programming. This
section will give you idea for using basic components in the program you will write.
The basic component of C includes token, keywords, variables, datatypes, operators etc.
Let us see some details of these basic components of C programming language.
Token
In C language tokens are the smallest element. A token may be a single character or a
sequence of characters to form a single item for c program. Tokens can be numeric
constants, character constants, keywords, names (lable or identifiers), punctuation or
operators used for different kind of operations including arithmetic and numeric
operations.
Keywords
In any programming language, some words are reserved for some special use.These
words are not allowed to be used by programmer for their own purpose.These words are
called keywords and sometimes called reserved words also.C language like any other
programming language has defined some keywords . Every keyword have a fixed
meaning to the compiler and can not change the meaning. For example int is used for
representing integer. C keywords are given below:
Data Types in C
26
Problem Solving Techniques
Most of the time in calculation, data are used for example in finding the sum of two
numbers first of all these two numbers need to be stored in computer memory then result
obtained after adding these two numbers is again stored in the memory. Now a question
arises what size of memory should be used for storing these numbers? To answer this
question one need to know what the type of number is .A number might be an integer
(whole number such as 20) or real number (floating point number such as 10.25). An
integer needs 2 bytes for storage. One byte equals eight bits. There are three basic data
type which are:
1) Character
2) Integer
3) Real numbers
In addition to these three two other basic data types enum and void which are out of the
scope of discussion here. For real numbers float and double types are used. The size of
three basic data type in c is given in table given below.
Variables
Once you have data to store, you need to associate with a specific memory location.
These memory locations are given some names and these names are called variable
names. The value stored in these locations can change or vary throughout the program’s
lifetime. These data are referred with variable name. Each Variable has a specific type,
which is known as variable data type. This data type tells the computer how much
memory is taken by the variable to store the data.
Name of a variable must start with letters and contain letters, digits, and underscores. For
example x, y, z , sum, number_of_points, mars12 are valid variable names. A variable
must be declared in a C program before being used. Variable declaration tells the
compiler about variable name and their type.
For example: int i ; means a variable named i of integer type is declared. Now i is
available as a variable to store integer value. In C you can declare more than one variable
in single statement(line). A declaration begins with the type of the variable(s), followed
by the name of one or more variables.
float i,j,k,sum; means, four variables named i,j,k, and sum of float type are declared.
When you declare your variable it is better to have some meaningful name of a variable.
27
Problems Solving using
While you declare variables you may give explanatory comment for more clarification. C Programming Language
You can initialize a variable at the time of declaration. This is done by adding an equal’s
sign and the required value after the declaration. For example:
two variables high and low are declared and initialized. Remember that , you cannot use
any of C's keywords like main, while, switch etc as variable names.
Names or Identifiers
Sometimes called identifiers or labels.These are the names of functions , variables etc.
It can be of anything length, but it should not be too long or too short. Names are case
sensitive xyz is different from XYZ. Any name must begin with a letter and the rest can
be letters, digits, and underscores.
Operators
An operator is a kind of function which is applied to values to give a result. For example
for finding sum of two numbers ‘Addition’ operator is required. C is having a wide range
of useful operators. You are familiar with operators such as +, , / , which are used for
performing addition, subtraction, and division .
The common type of operators in C are:
i) Arithmetic Operator
ii) Assignment Operator
iii) Comparison Operator
iv) Logical Operator
v) Binary Operator
Arithmetic operators are the most commonly used operator . Comparison operators are
used for comparison of values, logical operators are used for deciding combination of
logical states, assignment operator is used assigning value to a variable, and binary
operators are used for manipulation of individual binary digits of data. Here we will not
cover binary. Now let us see in detail about each operator type mentioned above.
i) Arithmetic Operators
Subtraction
Example
10 6 will give 4
28
Problem Solving Techniques * Multiplication
Example
2*5 will give 10
/ Division
Example
8/2 will give 4
If you combine operators and values expressions are formed. The values produced by
these expressions can be stored in variables. For example: 2 + 4 * 3 is a expression and
after evaluating this expression you will get 14.
1 + 5 * 2 1 + 10 11
(1 + 4) * 2 5 * 2 10
You can use symbols for storing value. In this case, symbols are evaluated to their values
before being combined
int x=2;
int y=3;
y + x*x y + 2 * 2 y + 4 3 + 4 7
Assignment operator ( = ) is used for assigning value to a variable. Now, let us take a
problem in which speed of a car is given to 50 km/h, distance to be covered is 200km and
you have to find the time it will take to cover this distance. Here, you can use assignment
operator for assigning values:
int speed, distance, time; \*are three variables *\
speed = 50;
distance = 200;
time = distance/time; \* time will have value 4 , that is 200/50 *\
29
Problems Solving using
Problem: Write a program in C to find a+b , ab , a*b, a/b, and a%b. The value of a is C Programming Language
10 and the value of b is 5.
When you will run this program following output will come:
a+b = 15
ab = 5
a*b = 50
a/b = 2
a%b = 0
You must have noticed that prinf function is having following format :
printf(“message = %d\n”, value to print) ;
Here message is a sting of character, %d for indicating that value for printing is of integer
type. Similarly for character value printing %c and for float value printing %f are used.
In the above program fixed value to a and b are assigned but if you need to take value as
input from your computer for that in C scanf( ) function is used. As prinf( ) used for
printing output on your computer screen, scanf( ) is used for reading input from your
computer screen.The syntax for using scanf( ) is:
scanf(“%d”,&variable);
Here, %d indicate that the variable in for which data to be read is of integer and & sign is
added(prefixed) to the variable name.
The above program can be modified as follows for giving input from screen instead of
assigning fixed value.
When you will run this program following output will come:
Give vale of a: 20
Give vale of b: 4
a+b = 24
ab = 16
a*b = 80
a/b = 5
a%b = 0
Many time in programming requirement arise to compare two values. C is not having
special data type to represent logical values ( 0 or 1). In C by using char and int, with a
value of 0 means false and any other value represent true. Comparison operators are used
to compare values. When two numeric values are compared using comparison operators,
they compare values and produce a logical result.
There are six comparison operators:
Operator Meaning
== Equal to
> Greater than
< Less than
>= Greater than equal to
31
Problems Solving using
<= Less than equal to C Programming Language
!= Not equal to
I == J
Marks> 10
Marks !=100
More detailed discussion about using comparisons operators will be taken up when we
will discuss about control statements such as if statement or a for or a while statement
in subsequent section of this unit.
Logical operators are frequently used to combine comparison operators, for example if a
person is eligible for a job if his age is between 18 and 30 years then it can be written as
following expression:
age >=18 && age <=30
A person will be eligible only if this expression is evaluated to true. Let us check this
expression for a person having age 25.
Punctuation
2.4.4 Constants
A constant can be seen as a type of variable which do not change its value in program.
There are many types of constants in c such as numeric constant, character constant ,
string constant etc .
32
Problem Solving Techniques Character constants are typically just the character enclosed in single quotes; 'x', 'y', 'z'.
Some characters can't be represented in single quotes. For them a two character sequence
is used. For example:
new line ‘\n’
single quote – ‘\’’
back slash – ‘\\’
Numeric constants are an continuous sequence of digits (and may contain a period). A
numeric constant never contains a comma.
Examples of numeric constants:123, 55.45, 100
i) C is a language
ii) For storing integers data type is used.
iii) #include is a
iv) The symbol of assignment operator is
v) ‘*’ is operator
3) Write a C program which read two integers and find the product of them.
………………………………………………………………………………………
………………………………………………………………………………………
……………………………………………………………………………………….
4) Write a C program which read two float numbers and apply arithmetic operators on
them.
………………………………………………………………………………………
………………………………………………………………………………………
……………………………………………………………………………………….
A program can be seen as a collection of statements in a logical order. Every statement in
a program is assigned some specific task to perform. In a program statements may
execute in a sequential order or it may execute based on satisfaction of certain condition.
Some statements may execute more than once. In the next section we will discuss about
various types of statements in C programming.
33
Problems Solving using
• Sequential Statement C Programming Language
• Conditional Statement
• Iterative/Loop Statement
Sequential statements are those statements in a program that executes one by one in a
given sequence. For example following statements:
1. float a,b;
2. printf("Give the first number:");
3. scanf("%f",&a);
4. printf("Give the second number:");
5. scanf("%f",&b);
Above five statements are part of sequential statements of a C program. These statements
will be executed one by one in a C program.
Many time while writing program you will need to take some decisions. These decisions
are to be taken based on certain conditions. For example suppose you have to find
whether a person can vote or not. For this you need to compare the age of the person with
the minimum age required to qualify for voting right.
You can say that a program can be much more powerful if you control the order in which
statements are run. Some time you may need to select between optional sections of a
program. Suppose you are required to prepare two lists of candidates as given below:
false statements
34
Problem Solving Techniques
structure of if statement:
if( condition)
{
statement(s)
}
Here if condition is true then only statement(s) in { } will be executed. In other words
you can say that control will reach in { } only after checking condition and finding it true.
Now let us see if –else statement. This statement is used if you have to choose one from
two given set of statement(s).The structure of ifelse is
if(consition)
{
/* if condition is true this block will execute*/
35
Problems Solving using
statement(s) C Programming Language
}
else
{
/* condition is false this block will execute */
statement(s)
}
ifelse also work similar to if statement. The only difference between if and ifelse is that
in if after finding condition true a set of statement(s) is executed and in ifelse for true
value of condition one set of statement(s) is executed and for false value of condition
another set of statement(s) is executed. Below is the flowchart for ifelse statement.
false true
if (condition)
statementi statementj
statements
You can say that to decide between two courses of action ifelse is used. For example to
decide whether a student has passed an exam with a pass mark of 45 you can write c code:
/*
if (Marks >= 45)
{
printf("The Student is Pass\n");
else
{
printf("The Student is Fail\n");
}
if
false true
(conditi
on)
else if statementi
false true
(conditi
on)
statementj
false
else if true
(conditi
on)
statementk
statementl
This conditional statement is used in situations where you wish to make a multiway
decision based on certain conditions. The way of doing such type of testing is by using
several elseif statements. This works by cascading more than one comparison. As soon
as a comparison gives a true result, the following statement(s) or block is executed, and
after that no further comparisons are performed. You have already seen one example of
comparison where you found whether a student is pass or not. Suppose you have find the
grade of a student on the basis of marks of the student then you need to do many
comparison. In the following example we will find the grades depending on the exam
result.
37
Problems Solving using
{ C Programming Language
printf("Passed and Grade is B\n");
}
else if (Marks >= 45)
{
printf("Passed and Grade is C\n");
}
else
{
printf("Failed\n");
}
In this example, all comparisons are testing a single variable called Marks. There may be
cases where you have to do multiple comparisons on more than one variable. While doing
programming the same pattern can be used with more or fewer else if's. Note that finally
only else may be left out as last block.
Now, let us see one more very useful statement used for multi way decision making. This
statement is switchcase. This statement work similar to ifelseif statement.
This statement is for the multi way decision. It is well structured, but it is having one
limitation that it can be used only in certain cases where only one variable is tested for
condition checking. All branches of the decision must depend on the value of that variable
only. Also the variable used in condition checking must be an integral type (int, long,
short or char).
In switchcase statement each possible value of the variable can control a single branch
and a final, catch all leftover cases. You should use default branch (final) for catching all
unspecified cases.
Now, let us see the example below. This will clarify you the concept of switchcase.
This example takes an objective which converts an integer into a text description you can
say at this program is working to estimate the number given as input.
int number;
/* Estimate a number as none, one, two, more, many */
switch(number)
{
case 0 :
printf("The number is : None\n");
break;
case 1 :
printf("The number is :One\n");
break;
case 2 :
printf("The number is : Two\n");
break;
case 3 :
case 4 :
case 5 :
printf("The number is : More than Two\n");
break;
default :
38
Problem Solving Techniques printf("The number is : Many\n");
break;
}
}
In the above example, each case is listed with some corresponding action.For example
case 0 is associated with following action:
printf("The number is : None\n");
break;
Here, the break statement is a new thing for you to notice. The break statement prevents
any further statements from being executed by leaving the switch statement(block) , in
other words, you can say that break statement is used for transferring control to the next
block from the current block. The break statement is generally used to exit from a loop or
a switch, control passing to the first statement beyond the loop or a switch block. You can
see that the case 3 and case 4 have no following break, those continue on allowing the
same action for several values (3,4,5) of number.
The similarity between if and switch statement is that both allow a programmer to make a
selection from a number of possible actions.
You may need to write same code more than one in your program. For example if you
have to print numbers from 1 to 10 and one number in a line, then in general you will
need 10 prinf( ) statements in your program one printf for printing one number.
Loops in C
In C you have a choice of three types of loop while, dowhile and for. Before you use
any looping statement it is necessary to decide the condition which take control of the
program out of the loop. Once, control of program enters into a loop it repeats the
statement(s) in side the loop. The control comes out of the loop after test condition
becomes false. You can say that a loop runs till a test condition is true and stops when test
condition become false. Here, you may ask that how a test condition becomes false from a
true value? While a loop runs, value of variables involve in test condition also may
change and that leads to change the test condition from true to false.
The for loop is frequently used. It is very flexible in terms of condition check and
number of iterations. You can say that the for loop works well where the number of
iterations of the loop is known before the loop is entered.
Structure of for loop is:
for( initial condition; test condition; increment or decrement)
{
statement(s);
39
Problems Solving using
} C Programming Language
The beginning of the for loop consists of three parts and they are separated by
semicolons. The first part is run before the loop is entered and is usually the initialization
of the loop variable. The second is a test condition. The for loop will exit when this
condition returns false.The third and final statement runs every time the loop body is
completed. This is usually an increment or decrement of the loop counter and on the basis
of this counter value test condition retain true or become false.
Now let us see a program which uses for loop for printing numbers 1to 10.
#include <stdio.h>
void main(void)
{
int i;
for( i=1; i<= 10; i++)
{
printf(“Number: %d”,i);
}
return 0;
}
When you will run this program following output will come:
Number: 1
Number: 2
Number: 3
Number: 4
Number: 5
Number: 6
Number: 7
Number: 8
Number: 8
Number: 10
You are getting this output because:
printf(“Number: %d”,i);
statement in this program is inside a for loop which is running 10 times.
You may write a program using for loop for finding the sum of a series:
1+2+3+4+……………..+n.This program will be like:
Similar to for loop in the while loop also you can keep repeating an action until an
associated test condition returns false. The while loop is useful where the programmer
(the person writes/design the program) does not know in advance how many times the
loop will be repeated (iterated).For example in a situation where a loop terminates after
specific input from the user which make test condition false. For example in while loop if
a test condition is askin for the acceptance (Yes or No) from the users to decided about
continuity of the loop, then for terminating (coming out of the loop) the loop user has to
give value No. The syntax of while loop is:
while( condition)
{
statements(s)
}
By seeing the flowchart of whileloop you will get clearer picture of working of this loop.
Below is the Flowchart for whileloop:
while
True False
(conditi
on)
operation/statements
Now, you may write a program using while loop for finding the sum of a series:
1+2+3+4+……………..+n.This program will be like:
The do while loops is similar, but the test occurs after the loop body is executed. This
ensures that the loop body is run at least once. The while loop repeats a statement until the
test at the top proves false. The do while loop is frequently used where data is to be read.
In such process read the data, then test and verifies the data, and loops back to read again
if it was undesirable.
The syntax of dowhile loop is:
do
{
statements(s)
}
while( condition)
By seeing the flowchart of do while loop you will get clearer picture of working of this
loop.
Below is the Flow Chart for dowhileloop:
do
statements
while
(conditions) True
False
will repeatedly run inside the dowhile loop given below until you give/read 1 as
input_value .
do
{
printf("Enter 1 for exit from loop");
scanf("%d", &input_value);
}
while (input_value != 1)
42
Problem Solving Techniques
Now let us see a program which uses do while loop for printing numbers 1to 10.
#include <stdio.h>
void main(void)
{
int i=1;
do
{
printf(“Number is: %d”,i);
i=i+1;
}
while( i<=10)
return 0;
}
When you will run this program following output will come:
Number is: 1
Number is: 2
Number is: 3
Number is: 4
Number is: 5
Number is: 6
Number is: 7
Number is: 8
Number is: 8
Number is: 10
Sometimes a need arises to have many variables of the same type. For example to store
marks of different subjects of a students one need to have as many variable as the number
of subjects. In such situations array variable is very useful. In next section you will learn
arrays.
2.6 ARRAYS IN C
An array is a collection of variables of the same type. In a collection variable of the same
type, an individual variable is known as an array element of the array. Total number of
variables in the collection is known as size of the array. Each element in the array is
identified by an integer index. In C the index begins at zero and is always written inside
square brackets. For example if we have an array of type integer for storing marks of all
the papers in a semester of students in a class. In C this can be declared as:
int Marks[size];
here size is the total number of subject in that particular semester.
Here Marks is a single dimensional array.If you declare Marks like this
int Marks[10];
Then you can store marks of 10 subjects. You can identify marks of each subject
separately as Marks[0], Marks[1], Marks[2], Marks[3], …………,Marks[9].
Arrays can have more dimensions, in which case they might be declared as
int results_2d[20][5];
43
Problems Solving using
int results_3d[20][5][3]; C Programming Language
Here each of the index has its own set of square brackets.
Now let us see an example to find average percentage marks of a student in a semester.
Here we assume that student is having 6 subjects is a semester and each subject is having
maximum marks 100.
output:
Give the Marks of Subject 1: 50
Give the Marks of Subject 2:70
Give the Marks of Subject 3:75
Give the Marks of Subject 4:80
Give the Marks of Subject 5:40
Give the Marks of Subject 6:85
The average percentage Marks of the Semester is:66
Now in the last section of this unit let us see some areas of applications of C programming
language.
4) What is an array? Write a C program using array to find the largest number from a list
of 10 given numbers.
……………………………………………………………………………………………
……………………………………………………………………………………………
…………………………………………………………………………………………….
2.8 SUMMARY
In this unit, you have learned basics of C programming. This unit explained about
structure of C program, need of preprocessors, and main method in a C program. You
learned in this unit about basic components such as data type, variables and operators in
C. There are three basic types of statements in a C program sequential, conditional and
iterative. You have learned how to incorporate these statements in your program. Also
this unit covers basics of conditional and iterative constructs of C such as if, else if,
switchcase, for loop, and while loop. In the last of this unit you were introduced to the
concept of array variable.
2.9 SOLUTIONS/ANSWERS
1) i) True
ii) True
iii) False
iv) False
v) True
2) i) programming
ii) int
iii) directive
45
Problems Solving using
iv) = C Programming Language
v) multiplication
1) i) True
ii) False
iii) True
iv) False
v) False
4) An array is structure which holds multiple variables of the same data type. Consider
the case where a teacher needs to keep track of a number of students in a class. For
writing program for this application basic initial effort will be to create a specific
variable for each student. But if array is used for creating these variables then a single
variable name will serve this purpose because an array is a collection of variables of
the same type.
Program
/* Program for finding largest number from a list of 10 given numbers
#include <stdio.h>
int main(void)
{
int Number[10], Max =0;
for ( int i=0; i <10; i++) /* Loop for reading the numbers in the list*/
{
printf("Give the Number%d in the list:",i+1);
scanf("%d",&Number[i]);
}
for ( int i=0; i <10; i++) /* Loop for finding largest number in the list*/
{
if( Max < Number[i])
Max = Number[i];
47
Problems Solving using
} C Programming Language
printf("The Largest Number in the List is %d:",Max);
return(0);
}
48
Fundamentals of Data
Communication
UNIT 1 FUNDAMENTALS OF DATA
COMMUNICATION
1.0 Introduction 5
1.1 Objectives 5
1.2 Data and Signal 6
1.3 Physical Connection 7
1.3.1 Serial Transmission
1.3.2 Parallel Transmission
1.4 Data Transmission Mode 8
1.4.1 Asynchronous Transmission
1.4.2 Synchronous Transmission
1.5 Modem 10
1.5.1 What is Modem?
1.5.2 Use of Modems
1.5.3 Types of Modems
1.5.4 Working of Modem
1.5.5 Connecting a Modem
1.6 Speed of data transmission 14
1.7 Modes of data transmission 14
1.7.1 Simplex Mode
1.7.2 Half Duplex Mode
1.7.3 Full Duplex Mode
1.8 Summary 17
1.9 Solutions/Answers 17
1.10 Further Readings and References 20
1.0 INTRODUCTION
In this unit, we shall learn the basics of Data Communication. Many services and
products that we use everyday employ computer networks and data communications
in one way or another. Telephone systems, banking systems, cable television, audio
and video systems, traffic control systems and wireless telephones are just few
examples. This unit shall briefly describe about the data and signal which are the basic
units of data transmission. We shall briefly cover about the methods for sending the
signal over the different networks i.e., synchronous and asynchronous
communication. We shall also discuss about the modem, its functioning and
different modes of transmission of data.
1.1 OBJECTIVES
5
Networking and
Communication • explain internal working of a modem; and
• specify speed of data transmission.
Communication is the need of the day and not having the basic knowledge of the
communication system could easily imply to your being uneducated. In the connected
world, a computer does not work as a stand alone system but as a part of a
communication system. Besides computers the ships, the aircraft’s, the rockets, the
satellites etc. rely on the communication system for their successful operation. And
thus, communication can be said to be the one of the major factors for the rapid
modernization of the world.
Digital
Size
Timing
Figure 1: (b) Digital signal
The two most important factors affecting the transfer of a signal over a medium are
noise and attenuation. Attenuation is defined as degeneration of the signal. In data
communications, we shall be studying different ways to overcome these two factors.
Since both data and signals can be either digital or analog, four basic combinations of
data and signals can be produced:
6
Fundamentals of Data
4) Analog data converted to a digital signal Communication
In this section, we are going to cover two types of physical connection, namely Serial
Transmission and Parallel Transmission.
Figure 2:(
Figure 2:(
7
Networking and
CommunicationTransmission Advantages Disadvantages
Serial Fast transfer Short distances only,
rates More cost due to more number
of lines
Parallel Long distances Slow transfer rates
Less cost due to only one line
There are three basic elements in every communication system; namely the
transmitter, the channel and the receiver. The transmitter and the receiver are isolated
from with other and is it the channel that connects them together as shown in Figure 3:
When you speak to your friend on telephone, you are the sender. The telephone line
through which your voice is transmitted is the medium and your friend is the receiver.
This is a simple example of voice communication. The same concept holds good for
the data communication also. Data communication is the function of transporting data
from one point to another. In this case, the sender and the receiver are normally
machines, in particular, computer devices and the transmission medium may be
telephone lines, microwave links, satellite links, etc. however, the messages that are
transmitted are, data not voice conversations. Thus, the electronic system that
transfers data from one point to another are called data communication systems.
Unlike computers that process and rearrange data, data communication systems
transmit data from one point to another without any change.
The transmitting equipment converts the data of the sending system into a form that
can be sent over the communications channel, accepted by the receiving
equipment, and converted back into usable data by the receiving system. Data sent
over a communications system is in one of the following two forms: Analog or
Digital.
An analog signal used in data communications varies continuously (as a sine wave)
between a minimum and a maximum value along with time. As the signal varies, it
assumes an infinite number of specific values between the two limits. The signal
can be varied in amplitude (amplitude modulation), frequency (frequency
modulation), or phase (phase modulation) to convey the data.
A digital signal has a limited set of values (1 or 0, true or false, etc.) i.e., it will have
only two values either 0 or 1. A limited number of discrete pulses can be transmitted
in a fixed period. The unique sequence of the bits represents the data. Digital
equipments (computers and peripherals) within a system normally communicate with
8
Fundamentals of Data
each other in pure digital pulses (serial and parallel). Transmitting digital Communication
information over a distance requires the use of special equipment to convert digital
data pulses into a form acceptable to the various types of communications channels.
There are two major dataformatting methods which are used to make sure the
transmitting computer and the receiving computer(s) are synchronized:
Asynchronous (characterframed) and Synchronous (messageframed). Both
methods are used to identify intelligence transmitted in the form of serial bit streams.
9
Networking and
Communication
F Check Your Progress 1
1.5 MODEM
The process of converting binary signal to analog signal is known as modulation and
the process of converting analog signal back to binary signal is known as
demodulation.
10
Fundamentals of Data
Communication
Modems let you link your computer to the outside world i.e., Internet. You can use a
modem to send data and files to anyone. You can also access information and
download it for use on your PC.
Using a modem, you can connect directly to another computer that is also equipped
with a modem, to an online service provider, or to the Internet and World Wide Web.
When you're connected, you can send and receive files or communicate in real time
which means you communicate with little or no delay, as if you were facetoface
with the person at the other computer.
Modems let you communicate over standard telephone lines with other computer
users. You can transfer data, exchange electronic files, and even carry on a typed
conversation in real time.
These days, a modem is a vital part of a PC; without one, you'll miss out on a wide
range of opportunities. Here's a small things you can do with a modem:
1) Internal Modem
2) External Modem
11
Networking and
Communication
Internal Modem: These hardware boards you plug into an expansion slot in your
PC's system unit. Internal modems are convenient because they don't take up desk
space, and they use the computer's power supply so they are on whenever the
computer is on.
An internal modem plugs into an expansion slot inside your PC. The phone jacks are
accessed through a port on the back of the system unit.
External Modem: These are connected to the PC by plugging a cable into a port on
the system unit. External modems also have their own power cords. You must turn on
the modem when you want to make a connection. One benefit of an external modem
is that you can move it to another computer if necessary.
An external modem has controls and status lights on the front that you can use to
monitor transmissions.
Apart from choosing an internal or external modem, some main factors that one
should consider are:
• Speed: A modem's speed, called the baud rate, is measured in bits per second (bps).
Currently, speeds range from 56Kbps onwards, but the development of faster
modems is going on.
• Cost. The faster the modem, the higher the cost. External modems generally cost
higher than internal modems.
• Compression Standard: This allows modems to compress data before transmitting
it, effectively increasing transmission speeds.
If you only use your modem to send and receive email messages, you may be able to
do it with a modem as slow as 14.4Kbps. But if you use your modem to transmit and
download heavy files (having images, sound, and animation) you should go for the
fastest modem available.
A fullduplex modem consists of two sections: the transmitter and the receiver. These
two sections are functionally separate from each other.
Access to a telephone line: Modems have two jacks where you plug in standard
telephone cables. You use one jack to connect the modem to the telephone line, and
the other jack to connect the modem to a computer.
Data communications software: You need software to control the modem. Data
communications software issues commands such as telling your computer when to
dial and when to hang up. It also lets you set communications parameters such as the
data transfer rate. The software must be compatible with both the modem and your
PC.
Software drivers: You must have the necessary drivers (i.e. program) for the modem
to work with your operating system. Windows XP comes with drivers for most of the
latest modems.
12
Fundamentals of Data
1.5.5 Connecting a Modem Communication
Connecting a modem involves attaching the modem device to your PC and to the
telephone line. The modem should come with the necessary equipment, including a
standard RJ11 telephone cord as show in Figure 8. The steps you take depend on
whether you have an internal modem or an external modem.
If you have an internal modem, you must install it by removing the cover of the
system unit and plugging the modem card into a vacant expansion slot. Unless you are
extremely confident about working inside your computer, you should have the modem
installed by a professional computer technician.
If you have an external modem, however, you can easily connect it yourself.
13
Networking and
Communication
To connect an external modem to your PC, follow these steps:
1) Locate the serial cable that comes with a modem. It should have a 25pin male
connector at one end and a 25hole female connector at the other end.
2) Plug the female connector into an open 25pin serial port on the PC's system unit,
and plug the male connector into the modem device.
3) Secure the connectors using the screws on either side.
4) Locate the power cord for the modem device and plug it into an electrical wall
socket, power strip, or uninterruptible power supply. After the modem is
connected to your PC, you must connect it to the phone line. This procedure is the
same for both external and internal devices.
1) What is a modem?
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
2) Differentiate between internal modem and external modem?
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
3) Discuss various factors which one should consider while selecting a modem for
data communication?
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
4) Write down the steps to connect modem to your pc?
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
Speed of data transmission plays a major role in data communication. How fast data
can be transmitted from place to place is sometimes called bandwidth. Bandwidth is a
data transmission rate that tells the maximum amount of information (bits/second) that
can be transmitted along a channel. It is measured in kilobits, kbps, 1,000 of bits per
second, or megabits (Mbps), millions of bits per second. Actual transfers are
considerably lower because of software and protocol overhead.
Dialup modems are generally capable of a maximum bit rate of 56 kbit/s (kilobits per
second) and require the full use of a telephone line—whereas broadband technologies
14
Fundamentals of Data
support at least double this bandwidth. Communication
Broadband is often called "highspeed" Internet, because it usually has a high rate of
data transmission. In general, any connection to the customer of 256 kbit/s (0.256
Mbit/s) or greater is more concisely considered broadband Internet.
The standard broadband technologies in most residential areas are DSL (Digital
Subscriber Line) and cable modems. Telephone companies developed DSL
technology after traditional modem reached their full speed. DSL comprises several
new technologies (ADSL, VDSL, HDSL and SDSL), each differs in the first letter.
1) Simplex mode
2) Half duplex mode
3) Full duplex mode
In simplex mode of data communication, data flow is unidirectional. This means that
data travels only in one direction i.e., from a sender to a receiver. The receiver can’t
respond back to the sender. A simplex system is one i.e., designed for sending
messages in one direction only. This is illustrated in Figure 9. This is of limited
interest in an industrial communications system as feedback from the instrument is
essential to confirm the action requested has indeed occurred. The primary examples
of simplex mode are monitor & keyboard.
Monitor can only receive output from the CPU, it can’t give output back to the CPU.
1) It is inexpensive to install.
2) It is very easy to use.
The most important disadvantage is that the receiving device can’t confirm to the
sending device that weather or not it has received data accurately.
15
Networking and
Communication Half duplex communications occurs when data flows in both directions; although in
only one direction at a time as shown in Figure 10. In this mode of transmission, data
is transmitted in both the directions but when the one device is sending data to another
then the other device has to wait. Other device can only start sending the data when
one device has stopped sending. In this mode, the entire bandwidth is available for
sending data in either of the direction.
A good analogy for a halfduplex system would be a one lane road with traffic
controllers at each end. Traffic can flow in both directions, but only in one direction at
a time being regulated by the traffic controllers.
In full duplex mode of data transmission, data is transmitted in both the direction
simultaneously as shown in Figure 11. This means that both the devices in a network
can send receive the data at the same time. It is just like a 2 lanes road with traffic
moving in both the direction at the same time. In this mode, signals going in either
direction share the half capacity of – one for sending data in one direction other for
sending data in another direction.
16
Fundamentals of Data
Figure 11: FullDuplex mode of data transmission Communication
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
4) Describe Full Duplex mode of communication along with its advantages and
disadvantages.
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
1.8 SUMMARY
In this unit, we have learnt about the two building blocks of communication i.e., data
and signal. All data transmitted over any communications medium is either digital or
analog. Data is transmitted with a signal and it can take any from either digital or
analog. Noise and attenuation are two most important factors which affects the
transfer of a signal over a medium.
Any communication system mainly consists of three parts: transmitter, channel and
17
Networking and
Communication receiver. The device which sends a data or signal is called as a sender. The medium
used for the transmission of this signal is called as communication channel. The
device or party which receives the signal or data is called as receiver. Asynchronous
(characterframed) and Synchronous (messageframed) are two major data
formatting methods that are used to make sure the transmitting computer and the
receiving computer are synchronized.
For transmitting a digital data over analog network, signal is required to be converted
to analog using a technique called modulation and conversion of analog signal back to
digital signal is Demodulation. Modem is device which is an acronym for
Modulator Demodulator. Basically, it is used to connect your computer to Internet
over a telephone network. Modem design depends on nature of transmission, mode of
transmission, type of communication channel, type of modulation / demodulation
used. Basically, modems are of two types: Internal modem and external modem.
Internal modems are hardware boards you plug into an expansion slot in your PC's
system unit; where as External Modems are connected to the PC by plugging a cable
into a port on the system unit. Modem communication parameters includes
transmission speed, transfer protocol, data format etc.
There are 3 basic modes of communication i.e., Simplex mode, half duplex mode, and
full duplex mode. In simplex mode of data communication, data travels only in one
direction i.e., from sender to receiver. Keyboard is an example of simplex
communication. In this mode of transmission, data is transmitted in both the directions
but at the same time when the one device is sending data to another then the other
device has to wait. In full duplex mode of data transmission data is transmitted in
both the direction simultaneously.
1.9 SOLUTIONS/ANSWERS
1) Analog data refers to continuous nature whereas digital data refers to discrete
states. Analog signals are continuous where digital signals are discrete.
Analog signals have very large number of values in a range; digital signals can
have only a limited number of value.
3) The two major data formatting methods of transmission are described below:
18
Fundamentals of Data
has a specific start and end sequence—usually one start bit and one or two end (stop) Communication
bits. A parity bit (even or odd) maybe included ensuring the accuracy of the
transmitted data. Asynchronous characters may be transmitted one at a time or as a
string of characters; however, each character transmitted will have start and end
bits. When data signals are transmitted in this format, synchronization occurs on a
characterbycharacter basis between the transmitting and receiving devices and
provides some allowance for timing inaccuracies. Any inaccuracy in timing is
corrected with the arrival of the next character.
2) Internal Modem: These are hardware boards you plug into an expansion slot in
your PC's system unit. Internal modems are convenient because they don't take up
desk space, and they use the computer's power supply so they are switched on
whenever the computer is on.
An internal modem plugs into an expansion slot inside your PC. The phone jacks
are accessed through a port on the back of the system unit.
External Modem: These are connected to the PC by plugging a cable into a port
on the system unit. External modems also have their own power cords. You must
turn on the modem when you want to make a connection. One benefit of an
external modem is that you can move it to another computer if necessary.
An external modem has controls and status lights on the front that you can use to
monitor transmissions.
3) While selecting a modem one should consider the following factors:
• Speed: A modem's speed, called the baud rate, is measured in bits per second
(bps). Currently, speeds range from 56Kbps onwards, but the development of
faster modems is going on.
• Cost. The faster the modem, the higher the cost. External modems generally
cost higher than internal modems.
• Compression Standard: This allows modems to compress data before
transmitting it, effectively increasing transmission speeds. Common
compression standards include MNP5 and CCITT V.42bis.
19
Networking and
Communication
4) To connect an external modem to your PC, follow these steps:
i) Locate the serial cable that came with the modem. It should have a 25pin
male connector at one end and a 25hole female connector at the other end.
ii) Plug the female connector into an open 25pin serial port on the PC's system
unit, and plug the male connector into the modem device.
iv) Locate the power cord for the modem device and plug it into an electrical wall
socket, power strip, or uninterruptible power supply. After the modem is
connected to your PC, you must connect it to the phone line. This procedure is
the same for both external and internal devices.
4) In full duplex mode of data transmission, data is transmitted in both the direction
simultaneously. This means that both the devices in a network can send & receive
the data at the same time. It is just like a two lane road with traffic moving in both
the direction at the same time. In this mode, signals going in either direction share
the capacity of the link into half – one for sending data in one direction other for
sending data in another direction.
20
Fundamentals of Data
3) Behrouz A. Forouzan, “Data Communications and Networking” Communication
Tata Mcgraw Hill.
References Websites:
http://www.brainbell.com/tutorials/Networking/
http://www.networktutorials.info/
http://www.nethistory.info/
http://en.wikipedia.org/wiki/Modem
http://en.kioskea.net/contents/transmission/transmode.php3
21
Introduction to
Communication Media and
UNIT 2 INTRODUCTION TO Communication Devices
2.0 Introduction 21
Objectives 21
2.2 Network devices
22
2.2.1 Network Interface Cards
2.2.2 Ethernet Cards
2.2.3 Repeaters
2.2.4 Bridges
2.2.5 Hubs
2.2.6 Switches
2.2.7 Routers
2.2.8 Gateway
2.3 Communication Media
27
2.3.1 Twisted Pair Cable
2.3.2 Coaxial Cable
2.3.3 Optical Cable
2.4 Modes of Wireless Transmission
30
2.4.1 Radio Waves
2.4.2 Microwaves
2.4.3 Infrared
2.5 Summary
33
2.6 Solutions/Answers 34
2.7 Further Readings and References
36
2.0 INTRODUCTION
A computer network is the infrastructure that allows two or more computers (called
hosts) to communicate with each other. The network achieves this through two ways:
(i) by providing a set of rules for communication, called protocols, which should be
observed by all participating hosts (ii) through communication devices which are the
parts of a computer of network. In this unit, we shall learn about various types of
network devices like gateway, bridges routers, hubs, switches, gateway and routers.
This unit shall also describe about different types of communication channels (media)
and their advantages, disadvantages and application.
2.1 OBJECTIVES
21
Networking and
Communication • understand the basics of communication devices;
Let us learn about the basic communication devices which are used to form a network.
Network Interface cards, Hubs, bridges, repeaters, and routers are all devices that let
you connect one or more computers to other computers, networked devices, or to
other networks. Each has two or more connectors called ports into which you plug in
the cables to make the connection. Let us understand each of these communication
devices in detail.
The network interface card (NIC) provides the physical connection between the
network and the computer. Most NICs are internal, with the card fitting into an
expansion slot inside the computer. Network interface cards are a major factor in
determining the speed and performance of a network. It is a good idea to use the
fastest network card available for fast transfer of data. The most common network
interface connection today is Ethernet cards.
Ethernet cards are usually purchased separately from a computer, although many
latest computers now include an option for a preinstalled Ethernet card. Ethernet
cards contain connections for either coaxial or twisted pair cables. If it is designed for
coaxial cable, the connection will be BNC. If it is designed for twisted pair, it will
have a RJ45 connection. Some Ethernet cards also contain an AUI connector. This
can be used to attach coaxial, twisted pair, or fiber optics cable to an Ethernet card, we
would be studying different type of cabling in later part of this unit.
2.2.3 Repeaters
When a signal travels along a cable, it tends to lose strength. As signals travel along a
network cable (or any other medium of transmission), they degrade and become
distorted in a process that is called attenuation A repeater is a device that boosts a
network's signal as it passes through. The repeater does this by electrically amplifying
the signal it receives and rebroadcasting it. They are used when the total length of
your network cable exceeds the standards set for the type of cable being used.
A good example of the use of repeaters would be in a local area network using a star
topology with unshielded twistedpair cabling. If a cable is long enough, the
attenuation will finally make a signal unrecognizable by the receiver.
22
Introduction to
Communication Media and
A repeater enables signals to travel longer distances over a network. A repeater Communication Devices
regenerates the received signals and then retransmits the regenerated (or conditioned)
signals on other segments as shown in Figure 1.
Figure 1: Repeater
2.2.4 Bridge
Like a repeater, a bridge can join several LANs (Local Area Network). However, a
bridge can also divide a network to isolate traffic or problems. For example, if the
volume of traffic from one or two computers or a single department is flooding the
network with data and slowing down entire operation, a bridge can isolate those
computers or that department.
A bridge (Figure 2) is used to connect two LAN segments i.e., segment1 (LAN1) and
segment2 (LAN2). Each segment can have several computer attached to it.
Figure 2: Bridge
2.2.5 Hub
A hub is the simplest of these devices. Any data packet coming from one port is sent
to all other ports. It is then up to the receiving computer to decide if the packet is for
it. You can imagine packets going through a hub as messages going into a mailing list.
The mail is sent out to everyone and it is up to the receiving party to decide if it is of
interest.
The biggest problem with hubs is their simplicity. Since every packet is sent out to
every computer on the network, there is a lot of wasted transmission. This means that
the network can easily become bogged down.
23
Networking and
Communication
Figure 3: Hub
Hubs are typically used on small networks where the amount of data going across the
network is never very high. A hub is typically the least expensive, least intelligent,
and least complicated of the three. Every computer connected to the hub "sees"
everything that every other computer on the hub sees. The hub itself is usually
ignorant of the data being transmitted.
2.2.6 Switches
A switch does essentially what a hub does but more efficiently. By paying attention to
the traffic that comes across it, it can "learn" where particular addresses are. For
example, if it sees traffic from machine A coming in on port 2, it now knows that
machine A is connected to that port and that traffic to machine A needs to only be sent
to that port and not any of the others. The net result of using a switch over a hub is
that most of the network traffic only goes where it needs to rather than to every port.
On busy networks this can make the network significantly faster.
Figure 4: Switch
A switch steps up on a bridge in that it has multiple ports. When a packet comes
through a switch it is read to determine which computer to send the data to which
leads to increased efficiency in that packets are not going to computers that do not
24
Introduction to
require them. Communication Media and
Communication Devices
Let us take an example of email analogy where multiple people able to send email to
multiple users. The switch can decide where to send the mail based on the address.
Most large networks use switches rather than hubs to connect computers within the
same subnet.
A Switch (or Switching Hub) is a device that that can segment a larger local area
network to reduce the traffic load. One should implement a switch when you have a
network with 20 or more users that have bogged down the network by excess traffic.
It splits the network into two or more segments with devices that normally talk with
each other.
Conceptually – switching takes data from one interface and delivers it to another
interface.
2.2.7 Router
While bridges know the addresses of all computers on each side of the network,
routers know the addresses of computers, bridges, and other routers on the network.
Routers can even "listen" to the entire network to determine which sections are busiest
they can then redirect data around those sections until they are removed.
If you have a school LAN that you want to connect to the Internet, you will need to
purchase a router. In this case, the router serves as the translator between the
information on your LAN and the Internet. It also determines the best route to send
the data over the Internet.
Routers can switch and route packets across multiple networks. They do this by
exchanging protocolspecific information between separate networks. Routers have
access to more information in packets than bridges, and use this information to
improve packet deliveries. Routers are usually used in a complex network situation
because they provide better traffic management than bridges and do not pass
broadcast traffic.
The router must understand the addressing structure associated with the networking
protocols it supports and take decisions on whether, or how, to forward packets.
Routers are able to select the best transmission paths and optimal packet sizes.
2.2.8 Gateways
Let us study about another most important communication device, Gateway. If you
25
Networking and
Communication are connected to the internet, you have to enter through a gateway. Your machine is
connected to a small network and there is a gateway that connects your smaller
network to the internet. A gateway passes information from one network to another
network as your information travels across the internet.
Closely related to routers and gateways is the concept of a firewall or gateway, which
is used to restrict access from the Internet to a network or a group of networks,
controlled by an organization for security reasons.
In the network for an enterprise, a computer server acting as a gateway node is often
also acting as a proxy server and a firewall server. A gateway is often associated with
both a router, which knows where to direct a given packet of data that arrives at the
gateway, and a switch, which furnishes the actual path in and out of the gateway for a
given packet.
A gateway is an essential feature of most routers, although other devices (such as any
PC or server) can function as a gateway. A computer running Microsoft Windows
however describes this standard networking feature as Internet Connection Sharing;
which will act as a gateway, offering a connection between the Internet and an
internal network. Such a system might also act as a DHCP server. Dynamic Host
Configuration Protocol (DHCP) is a protocol used by networked devices (clients) to
obtain various parameters necessary for the clients to operate in an internet
26
Introduction to
environment. By using this protocol, system administration workload greatly Communication Media and
decreases, and devices can be added to the network with minimal or no manual Communication Devices
configurations.
2) Explain the function of hub and where should we use this communication device?
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
Communication media used for data transfer are basically divided into following two
categories:
Guided media are those that provide a physical connection between two devices. A
signal traveling through guided media is directed and contained within the physical
limits of the medium. Unguided media is used for transmitting the signal without any
physical media. It will be discussed in section 2.4.
We will now discuss these cables in detail. Let us take the twisted pair cable first.
27
Networking and
Communication
2.3.1 Twisted Pair Cable
Twisted pair cable is still the most common transmission media. A twisted pair cable
consists of two conductors which are normally made of copper. Each conductor has its
own plastic insulation typically 1 mm thick. These cables are twisted together.
The wires are twisted in a helical form, similar to a DNA molecule. Twisting is done
to reduce crosstalk.
Twisted pairs (Figure 5) are superior because of reduced crosstalk. They are very
effective for relatively short distances (a few hundred feet), but can be used for up to a
few kilometers. A twisted pair has a bandwidth to distance ratio of about 1 MHz per
kilometer. The performance of the twisted pair can be substantially improved by
adding a metallic shield around the wires. Shielded wires are much more resistant to
thermal noise and crosstalk effects. Twisted pairs used for long distance connections
(e.g., telephone lines) are usually organized as a much larger cable containing
numerous twisted pairs.
Twisting pair cabling comes in several varieties, two of which are very important:
Category 3 and Category 5. Category 5 has more twist per centimeter resulting in less
crosstalks and a better quality signal.
It has two major advantages compared to twisted pairs: (i) Better Shielding (ii) Signal
can travel longer distances at higher speeds.
Coaxial cable has a central core conductor of a solid or stranded wire enclosed in
insulating sheath. This sheath is encased in an outer conductor of metal braid and the
whole is protected by a plastic cover.
Coaxial cables can carry signals of higher frequency as compared to twisted pair
cable. A coaxial cable usually consists of four concentric cylinders: an inner
conductor, surrounded by an insulating cylinder, surrounded by an outer conductor,
surrounded by a final protective cover. This combination is called a coax as shown in
Figure 6. Coaxial cables are superior to twisted pairs both in terms of bandwidth and
communication distance, and can provide bandwidth to distance ratios in order of 10s
of MHz per kilometer. Like twisted pairs, multiple coaxes are usually housed within
one cable, which may also contain twisted pairs. Coaxial cables are extensively used
in LANs and long distance telephone trunk lines. Coaxial cables are used in cable TV
networks and Ethernet LANs due to higher bandwidth and data rate.
28
Introduction to
Communication Media and
Communication Devices
The core is used for guiding a light beam, whereas the cladding (which has a different
refractive index) acts as a reflector to prevent the light from escaping from the core.
Because optical fiber uses a light signal instead of electrons, it does not suffer from
the various noise problems associated with electromagnetic signals. The signal is
usually generated by a laser or Light Emitting Diode (LED). Optical fibers can
provide bandwidth to distance ratios in order of 100s of MHz per kilometer. Like
other cables, hundreds of optical fibers are usually housed within one cable.
They are being increasingly used by telecommunication carriers for long distance
digital trunk lines. Current trends promise that they will replace twisted pair
residential loops in the near future. It is used in backbone networks. Cable TV
companies use a combination of optical fiber and coaxial cable.
Advantages
1) Higher band width – It can support higher band width and hence can transfer data
at a higher rate.
2) Less signal attenuation – Its transmission distance is greater than the other two
and it can run for 50 KMs without regeneration.
29
Networking and
Communication 3) Immunity to electromagnetic interference
5) These cables are more immune to tapping then the copper cables.
Disadvantages
1) Radio waves
2) Micro waves
3) Infrared
Radio signals have been used for a long time to transmit analog information. They are
particularly attractive for long distance communication over difficult terrain or across
the oceans, where the cost of installing cables can be too prohibitive. A minimum
radio system consists of a transmitter and a receiver.
Radio waves are very useful in multicasting and hence used in AM and FM radios,
cordless phones and paging.
2.4.2 Microwaves
Electromagnetic waves ranging from 1 to 300 gigahertz are called micro waves.
Micro waves are unidirectional that is the sending and receiving antennas need to be
aligned.
Microwave is by far the most widely used form of radio transmission. It operates in
the GHz range with data rates in order of 100s of mbps per channel.
Telecommunication carriers and TV stations are the primary users of microwave
transmission.
31
Networking and
Communication
Figure 8: Microwaves
2.4.3 Infrared
Infrared signals range between 300 gigahertz to 400 terahertz. These can be used for
short range communication. High range infrared rays cannot be used for long range
communication as it cannot penetrate walls. This also helps in avoiding interference.
Infrared signals are generated and received using optical transceivers. Infrared
systems represent a cheap alternative to most other methods, because there is no
cabling involved and the necessary equipment is relatively cheap. Data rates similar to
those of twisted pairs are easily possible. However, applications are limited because of
distance limitations (of about one kilometer). One recent use of infrared has been for
interfacing handheld and portable computing devices to LANs as shown in Figure 9.
It cannot be used outside building as rays of sun contain infrared which leads to
interference in communication. Infrared having wide band width can be used to
transmit digital data with a very high data rate. Infrared signals can be used for
communication between keyboards, mouse and printers.
32
Introduction to
……………………………………………………………………………………… Communication Media and
Communication Devices
………………………………………………………………………………………
………………………………………………………………………………………
2) What is the typical range for radio wave transmission?
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
3) Write the procedure of transmitting micro waves for communication?
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
4) What are microwaves? Explain its advantages in communication?
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
SUMMARY
In this unit, we have learnt various kinds of communication devices like network
interface cards, hubs, bridges, repeaters switches and gateways etc. We have also
learnt their application at different levels of networking. Each of these devices let you
connect one or more computers to other computers, networked devices, or to other
networks. Each has two or more connectors called ports into which you plug in the
cables to make the connection.
The network interface card (NIC) provides the physical connection between the
network and the computer. Network interface cards are a major factor in determining
the speed and performance of a network. Ethernet cards contain connections for either
coaxial or twisted pair cables. A Repeater enables signals to travel longer distances
over a network. A repeater regenerates the received signals and then retransmits the
regenerated (or conditioned) signals on other segments on the network. A bridge can
join segments or LANs. Bridge Interconnects LAN segments at the network interface
layer level and forwards data between them.
33
Networking and
Communication One should implement a switch when you have a network with 20 or more users that
have bogged down the network by excess traffic. It splits the network into two or
more segments with devices that normally talk with each other.
In the network for an enterprise, a computer server acting as a gateway node is often
also acting as a proxy server and a firewall server. A gateway is often associated with
both a router, which knows where to direct a given packet of data that arrives at the
gateway, and a switch, which furnishes the actual path in and out of the gateway for a
given packet. A computer running Microsoft Windows however describes this
standard networking feature as Internet Connection Sharing; which will act as a
gateway, offering a connection between the Internet and an internal network.
In this unit, we have also briefly learnt about various kinds of communication media
which includes guided and unguided media. Guided media are those that provide a
conduit between two devices. Guided media includes twisted pair cable, Coaxial
cable and Fiber optic cable. A twisted pair cable consists of two conductors which are
normally made of copper. Each conductor has its own plastic insulation. These cables
are twisted together. A twisted pair has a bandwidth to distance ratio of about 1 MHz
per kilometer.
Coaxial cable has a central core conductor of a solid or stranded wire enclosed in
insulating sheath. This sheath is encased in an outer conductor of metal braid and the
whole is protected by a plastic cover. Coaxial cables can carry signals of higher
frequency as compared to twisted pair cable. Coaxial cables are extensively used in
LANs and long distance telephone trunk lines. Coaxial cables are used in cable TV
networks and Ethernet LANs due to higher band width and data rate.
For transmitting the signal without any physical media, unguided media is used.
Unguided media transports electromagnetic waves without using a physical conductor
and is often called wireless communication. It includes radio waves, microwaves and
infrared. Electromagnetic waves ranging in frequencies between 3 kilohertz and 1
gigahertz are normally called radio waves. They are Omni directional that is an
antenna transmits radio waves in all the directions. A minimum radio system consists
of a transmitter and a receiver. Radio waves are very useful in multicasting and hence
used in AM and FM radios, cordless phones and paging.
Electromagnetic waves ranging from 1 to 300 gigahertz are called micro waves.
Micro waves are unidirectional that is the sending and receiving antennas need to be
aligned. It operates in the GHz range with data rates in order of 100s of mbps per
channel. Telecommunication carriers and TV stations are the primary users of
34
Introduction to
microwave transmission. An important form of microwave system is a satellite Communication Media and
system, which is essentially a microwave system plus a large repeater in the sky. High Communication Devices
frequency micro waves cannot be received inside the building.
Infrared signals range between 300 gigahertz to 400 terahertz. These can be used for
short range communication. High range infrared rays cannot be used for long range
communication as it cannot penetrate walls. Infrared systems represent a cheap
alternative to most other methods, because there is no cabling involved and the
necessary equipment is relatively cheap. Infrared having wide band width can be used
to transmit digital data with a very high data rate.
SOLUTIONS/ANSWERS
1) A bridge connects several LANs. A bridge can also divide a network to isolate
traffic or problems. Bridge Interconnects LAN segments at the network interface
layer level and forwards frames between them.
2) A hub is the simplest of these devices. Any data packet coming from one port is
sent to all other ports. It is then up to the receiving computer to decide if the
packet is for it. A hub is typically the least expensive, least intelligent, and least
complicated of the three. Hubs are typically used on small networks where the
amount of data going across the network is never very high.
4) A Switch (or Switching Hub) is a device that that can segment a larger local area
network to reduce the traffic load. One should implement a switch when you have
a network with 20 or more users that have bogged down the network by excess
traffic. It splits the network into two or more segments with devices that normally
talk with each other.
1) The unguided media is used in wireless transmission but the guided media is used
to connect two different devices. The guided media is used some physical media
to transmit data but unguided media transmit data without any physical media.
2) The performance of the twisted pair can be improved by adding a metallic shield
35
Networking and
Communication around the wires. Shielded wires are much more resistant to thermal noise and
crosstalk effects.
3) The outer metallic wrapping of the coaxial cables serves two functions:
ADVANTAGES:
1) Higher band width – It can support higher band width and hence can transfer data
at a higher rate.
2) Less signal attenuation – Its transmission distance is greater than the other two
and it can run for 50 KMs without regeneration.
DISADVANTAGES:
36
Introduction to
4) Electromagnetic waves ranging from 1 to 300 gigahertz are called micro waves. Communication Media and
Micro waves are unidirectional that is the sending and receiving antennas need to Communication Devices
be aligned. It operates in the GHz range with data rates in order of 100s of mbps
per channel. Telecommunication carriers and TV stations are the primary users of
microwave transmission. An important form of microwave system is a satellite
system, which is essentially a microwave system plus a large repeater in the sky.
The signals transmitted by earth stations are received, amplified, and
retransmitted to other earth stations by the satellite.
Reference Website:
• http://www.brainbell.com
• http://www.networktutorials.info/
• http://www.nethistory.info/
37
Computer Networks
3.0 Introduction 37
3.1 Objectives
3.2 Why Network? 38
3.3 Network Architecture 38
3.4 Topologies 39
3.4.1. Bus Topology
3.4.2 Ring Topology
3.4.3 Star Topology
3.4.4 Tree Topology
3.4.5 Mesh Topology
3.4.6 Hybrid Topology
3.5 Classification of Network 45
3.5.1 LAN
3.5.2 MAN
3.5.3 WAN
3.6 Reference Models 50
3.6.1 OSI Models
3.6.2 TCP/IP Model
3.7 Network applications 53
3.8 Summary 54
3.9 Solutions/Answers 55
3.10 Further Readings and References 57
3.0 INTRODUCTION
The purpose of this unit is to explain the basics of computer network. A computer
network can be simply defined as the interconnection of two or more independent
computers. Applications of computer networks are found everywhere. They are used
in our homes, schools, colleges, railway stations, offices and business. They help us to
send an email, to watch a live sports event at our computer to book rail/air tickets to
do chatting with our friends. The unit explains uses of computer networks, a
client/server network, peertopeer network architecture, network topology, OSI &
TCP/IP models and some useful application of computer networks.
3.1 OBJECTIVES
37
Networking and
Communication
Whenever you have more than one computer being used at the same location,
networking them together makes a lot of sense. You transfer files between them
quickly and easily, you can also share expensive resources like laser printers, hard
disc arrays, backup tape drives, scanners, internet connections, operating system,
multimedia a S/W and so on.
In a server based network, there are computers which work as providers of services
such as file service or mail service. The computers providing the service are called
servers machine and the computers that request and use the service are called client
38
Computer Networks
machine. The server kind of machine is supposed to be most powerful than the client
machine.
In a peertopeer network, various computers on the network can act both as clients
and servers. For instance, many Microsoft Windows based computers will allow file
and print sharing. These computers can act both as a client and a server and are also
referred to as peers. Many networks are combination of peertopeer and server based
networks. The network operating system uses a network protocol to communicate on
the network to other computers. A Network Operating System (NOS) includes
Windows NT, Novell Netware, Unix, Linux and others.
3.4 TOPOLOGIES
In computer networking, topology refers to the layout of connected devices. You can
think of a topology as a structure of a network. This shape does not necessarily
correspond to the actual physical layout of the devices on the network.
Network Topology is the study of the arrangement or mapping of the elements (links,
nodes, etc.) of a network interconnection between the nodes. It also determines the
strategy for physically expanding the network, in future Topologies can be physical or
logical. Physical Topology means the physical design of a network including the
devices, location and cable installation. Logical Topology refers to the fact that how
data actually transfers in a network as opposed to its design.
Now we shall learn about different types of the topologies like bus, ring, tree, mesh in
detail.
Bus topology is a single common communication to which all the computers are
connected. It has a single length of cable with a terminator at each end as shown in the
Figure 1. It is a passive topology which means only one computer at a time can send a
message. Hence, the number of computers attached to a bus network can significantly
affect the speed of the network. A computer must wait until the bus is free before it
can transmit. Each node is connected to others nodes. The network operating system
keeps track of a unique address of each node and manages the flow of data between
machines.
39
Networking and
Communication
The bus topology is the simplest and mostly widely used with local area network
design. A bus topology is considered to be a passive topology. The computers on the
bus keep on listening. When they hear data that belongs to them, they receive.
When one device on the network wants to send a broadcast message to another device
on the network, it first makes sure no one else on the bus is transmitting, and then it
sends information out on the media. All other devices on the network see it, but only
the intended recipient accepts and processes it. This is accomplished by using data
frames which contain source and destination addresses.
Advantages
a) It is simple, reliable, and easy to be used in a small sized local area network.
b) It requires least amount of cable to connect computers together and is
therefore less expensive than other cabling arrangements.
c) It is easy to implement and extend using connectors.
d) If one computer on the bus fails, it does not affect the rest of the traffic on the
bus.
Disadvantages
a) In this topology, no two computers can transmit data at the same time.
b) It does not cope well with heavy load which can slow down a bus considerably.
c) Performance degrades as additional computers are added.
d) Terminators are required at both ends of the cable.
e) It is hard to reconfigure once it's set up.
Ring topology is also known as circular topology. This layout is similar to the linear
bus, except that the nodes are connected in a circle as shown in Figure 2. In this
topology, each node is connected to two and only two neighboring nodes. The ring
does not have an end. It is made of short segments that connect one PC to the next PC
and so on Data is accepted from one of the neighbouring nodes and is transmitted
onwards to another node .Therefore data travels in only direction from node to node
around the rings. Since, each computer retransmits what it receives, a ring is an active
network and is not subject to the signal loss problems. There is no termination
because there is no end to the ring.
40
Computer Networks
This type of topology can be found in peertopeer networks, in which each machine
manages both information processing and the distribution of data files. Examples of
such topology:
Advantages
a) It is an orderly network where every device has access to the token (control
signal) and the opportunity to transmit – because every computer is given equal
access to the token, no computer can monopolize the network.
d) It does not require network server to manage the connectivity between the
computers.
Disadvantages
a) Network adapter cards and Multi Access Units used in this topology are much
more expensive than Ethernet cards and hubs used in bus topology.
b) It is much slower than an Ethernet network under normal load.
c) It is difficult to troubleshoot.
41
Networking and
Communication d) One malfunctioning node or bad port in the Multi Access Units can create
problems for the entire network
In star topology each computer on a network communicates with a central hub (also
called as a concentrator) that resends the message either to all the computers or only
to the destination computer. A hub expands one network connection into many. For
example a fourport hub connects up to four machines. A single hub is sufficient for a
small network, however large networks require multiple hubs. But, it increases
hardware and cabling costs.
Advantages
a) It is more reliable (if one connection fails, it doesn't affect others) –The centre
of a star network is a good place to diagnose network faults and if one computer
fails whole network is not disturbed. Hub detects the fault and isolates the faulty
computer.
b) It is easy to replace, install or remove hosts or other devices, problem can be
easily detectedIt is easier to modify or add a new computer without disturbing
the rest of the network by simply running a new line from the computer to the
central location and plugging it to the hub.
42
Computer Networks
d) It has good performance
Disadvantages
It is one of the most common types of network setups that is similar to a bus topology
and a star topology. Tree topology integrates multiple star topologies together onto a
bus. In its simplest form, only hub devices connect directly to the tree bus and each
hub functions as the "root" of a tree of devices as shown in Figure 4.
Advantages
Disadvantages
a) In this topology, the overall length of each segment is limited by the type of
cabling used.
b) If the backbone line breaks, the entire segment goes down.
c) It is more difficult to configure and wire than other topologies
A type of network setup where each of the computers and network devices are
interconnected with one another as shown in Figure 5 allowing for most transmissions
to be distributed, even if one of the connections goes down, the network remains
intact.
43
Networking and
Communication
Advantages
a) It provides redundant paths between devices and hence it is more reliable and
stable.
b) The network can be expanded without disruption to current users.
Disadvantages
With the hybrid topology, two or more topologies are combined to form a complete
network. For example, a hybrid topology could be the combination of a star and bus
topology. These are also the most common in use.
In a starbus topology, several star topology networks are linked to a bus connection.
In this topology, if a computer fails, it will not affect the rest of the network.
However, if the central component, or hub, that attaches all computers in a star, fails,
then you have big problems since no computer will be able to communicate.
Advantages
a) Network expansion is very simple in case of hybrid technology
b) If one client fails, the entire network does not fail.
Disadvantages
a) If one hub fails, all connections to that hub fail, although other hubs continue
to function.
2) Define the terms Network topology, Physical topology and Logical topology.
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
3) Design BUS, STAR network topologies with LAN printer, Personal computers
and Servers.
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
4) Briefly differentiate among RING, STAR and Tree topologies.
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
5) Identify the characteristics of bus, ring and star topologies and write the best
characteristic that you think while designing a topology.
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
LAN (Figure 6) is a group of computers located in the same room, on the same floor
or in the same building that are connected to form a single network as to share
resources such as disk drives , printers, data, CPU, fax/modem, application. etc.
45
Networking and
Communication
Figure 6: LAN
LAN is generally limited to specific geographical area less than 2 K.M., supporting
high speed networks. A wide variety of LANs have been built and installed, but a few
types have more recently become dominant. The most widely used LAN system is the
Ethernet system based on the bus topology.
ADVANTAGES OF LAN
DISADVANTAGES OF LAN
46
Computer Networks
• The financial cost of LAN is still high in comparison with many other
alternatives.
• It requires memory space in each of the computers used on the network. This
reduces the memory space available for the user’s programs.
• Some type of security system must be implemented if it is important to
protect confidential data.
• Some control on the part of the user is lost. You may have to share a printer
with other users. You may face a situation like, for example, the entire network
suddenly locking up because one user has made a mistake.
Metropolitan area networks, or MANs, are large computer network usually spanning a
city. They typically use wireless infrastructure or Optical fiber connections to link
their sites.
A MAN is optimized for a larger geographical area than a LAN, ranging from several
blocks of buildings to entire cities. MANs can also depend on communications
channels of moderatetohigh data rates. A MAN might be owned and operated by a
single organization, but it usually will be used by many individuals and organizations.
MANs might also be owned and operated as public utilities or privately owned. They
will often provide means for internetworking of local networks. Metropolitan area
networks can span up to 50km, devices used are modem and wire/cable.
47
Networking and
Communication
LAN
LAN
Figure 7: MAN
1) The network size falls intermediate between LAN and WAN. A MAN typically
covers an area of between 5 and 50 km diameter. Many MANs cover an area the
size of a city, although in some cases MANs may be as small as a group of
buildings or as large as the North of Scotland.
2) A MAN often acts as a high speed network to allow sharing of regional resources.
It is also frequently used to provide a shared connection to other networks using a
link to a WAN.
Characteristics of MAN
Figure 8: WAN
WANs are used to connect LANs and other types of networks together, so that users
and computers in one location can communicate with users and computers in other
locations. Many WANs are built for one particular organization and are private.
Others, built by Internet service providers, provide connections from an organization's
LAN to the Internet. WANs are often built using leased lines. At each end of the
leased line, a router connects to the LAN on one side and a hub within the WAN on
the other. Leased lines can be very expensive. Instead of using leased lines, WANs
can also be built around public network or Internet.
Characterstics of WAN
49
Networking and
Communication
50
Computer Networks
The OSI model is an abstract description for layered communications and computer
network protocol design open system means that it can communicate with any other
system that follows the specified standards, formats and semantics. PROTOCOLS
give the rules that specify how the different parties may communicate.
51
Networking and
Communication In its most basic form, it divides network architecture into seven layers which from
top to bottom are the Application, Presentation, Session, Transport, Network, Data
Link, and Physical Layers. It is therefore often referred to as the OSI Seven Layer
Model (Figure 7).
Layer
Layer
In transmission side data flows from layer 7 to layer 1, then to cabling or suitable
medium. When data reaches the reception side it flows from layer 1 to layer 7.
Application Layer
This layer is the layer for user interaction. We mush have an application software for
dealing with the data.
Presentation Layer
It converts the data into suitable format. It does tasks like compression,
decompression, encryption and decryption.
Session Layer
52
Computer Networks
Transport Layer
This layer converts data into segments and reassembles the data stream. TCP and
UDP are the protocols used in this layer. In this layer, data is converted into so called
segments.
Network Layer
This layer translates logical address into physical address. This layer also fixes the
route for data path. Router works in this layer. In this layer data is to called a packet.
DataLink Layer
This layer provides physical identification of a device using MAC Address. It adds
source and destination address to packets and convert them into frames.
Physical Layer
This layer provides the functional requirements for activating a physical link. In this
layer data is carried from one device to another.
Now, we can better understand the OSI layer with an example. Consider that we have
to send a word document to a different network or through internet. The following are
the process that will take place:
1) In the APPLICATION LAYER, the user can edit the file by using application
2) In the PRESENTATION LAYER, user can compress the word file by using
WINRAR or WINZIP and convert the data into different format ie.zip or .rar.
He can also convert the word document into different formats.
3) In the SESSION LAYER, the particular file has to be integrated with browser for
attaching it to email or likewise clients.
5) In the NETWORK LAYER, the data is handed over to a router. The router
calculates the best path for data transmission
6) In the DATALINK LAYER, a transmission errors are handled and also flow of
data is regulated so that receivers are not swamped by fast senders.
7) In the PHYSICAL LAYER, frames are transmitted as bits through media such as
network cable, Optic fibre etc.
Just like the OSI model, the TCP/IP model has many layers which are described
below:
53
Networking and
Communication
Host to Host Network: In fact TCP/IP model does not specify this layer. But it
basically combines functionally of physical and data link layers. Starting at the
bottom, the Physical layer is what deals with hardware (wires, cables, satellite links,
NICs, etc.). Utilizing the existing Physical layer, TCP/IP does not define its own, thus
letting the layer be compatible with all network suites. This layer also encodes and
transmits data over network communications media in the form of bits which are
received by the Physical layer of the destination device. Often combined with this
layer is the Data link layer which is responsible for moving packets from the network
layer onto different hosts. Depending on the connection type, IP packets are
transmitted using various methods. Dialup modems transmit IP packets using PPP
while broadband users transmit using PPoE.
Internet Layer: This layer routes and delivers data across similar networks or
completely different networks. The Network layer is responsible for end to end packet
delivery while maintaining routing, flow control, and error control functions. An
example of this layer is the actual Internet Protocol (IP) or the Internet Protocol
Security (IPSec).
Transport Layer: The Network layer can be thought of the actual vehicle which
transports information. This layer categorizes end to end message transmissions or
connecting applications as either Transmission Control Protocol (TCP) or User
Datagram Protocol (UDP). TCP is a connectionoriented protocol which is considered
to provide a reliable byte stream. Some characteristics of TCP are traffic congestion
control, data arrives in order, data has minimal error, and duplicate data is discarded.
The top layer of the TCP/IP model is the Application layer which is used for network
communication. Ports are used by programs to transfer data through this layer. For
example, the File Transfer Protocol uses port 21 while the Hypertext Transfer
Protocol uses port 80.
TCP/IP has many benefits. TCP/IP enables crossplatform networking which is useful
in this dayinage. This suite also has superior failure recovery and the ability to add
networks without interrupting existing services. The reliability of TCP/IP is also a
huge benefit to using this protocol. The fact that if one part of the network goes down,
other parts are still able to function is what has set TCP/IP above other networking
protocols. TCP/IP is also easily expandable which allows for the unprecedented rate
of growth which the Internet possesses.
54
Computer Networks
There are wide varieties of computer application in today’s world, without computer
networking it is difficult to imagine the world. Few of these applications are described
below:
Email : Email is simply the shortened form of electronic mail, a protocol for
receiving, sending and storing electronic messages. Email has gained popularity with
the spread of the computer network. In many cases, email has become the preferred
method of communication. Emails are accessed using through email client software
like Outlook, In addition to email client softwares, Webmail has also become very
popular. Most email service providers offer this as an additional benefit, where the
user can access their mailbox over the Internet. Some email services are specifically
designed using the World Wide Web as its primary interface. Sites like Yahoo! Mail,
Google Mail and Hotmail have become very popular, as they offer individuals a
chance to open an email account at no charge.
FTP: File Transfer Protocol (FTP) is a network protocol used to exchange and
manipulate files over a computer network using Transmission Control protocol
Network. FTP is commonly used to transfer Web page files from their creator to the
computer that acts as their server for everyone on the Internet. It's also commonly
used to download programs and other files to your computer from other servers
Telnet: A terminal emulation program for TCP/IP networks such as the Internet.
Telnet is a protocol that allows you to connect to remote computers (called hosts) over
a computer network using TCP/IP. You can use software called telnet client on the
computer to make a connection to a telnet server (i.e., the remote host). Once your
telnet client establishes a connection to the remote host, your client becomes a virtual
terminal, allowing you to communicate with the remote host from your computer. In
most cases, you'll need to log into the remote host, which requires that you have an
account on that system. Occasionally, you can log in as guest or public without having
an account.
Marketing and sales: Computer networks are used extensively in both marketing and
sales organizations. Marketing professionals use them to collect, exchange, and
analyze data related to customer needs and product development cycles. Sales
application includes teleshopping, and onlinereservation services for hotels, airlines
and so on.
55
Networking and
Communication without going into a bank (an automated teller machine is an example of electronic
fund transfer, automatic paycheck is another).
3.8 SUMMARY
In this unit, we have learnt the methods to create a network. A network may consists
of multiple computers connected using some type of interface, each having one or
more interface devices such as a Network Interface Card (NIC) and/or a serial device.
Usually networks are categorized in two main categories which are: server based and
peertopeer.
Next important thing which we have learnt in this unit is Topology. Network
Topology is the study of the arrangement or mapping of the elements (links, nodes,
etc.) of a network. It studies the physical and logical interconnection between the
nodes. Topologies can be physical or logical. There are various kinds of topologies
like Star, Bus, Tree, Ring and mesh topology. Factors like money, length of cable,
future growth of network and cable type need to be considered for selecting a
network.
Bus topology is a linear topology in which all the computers are connected by a single
length of cable with a terminator at each end. It is a simple, reliable, and in daily used
small sized local area network. It requires least amount of cable to connect computer
together and is therefore less expensive than other cabling arrangements.
Ring topology is also known as circular topology. In this topology, each node is
connected to two and only two neighbouring nodes. It is an orderly network where
every device has access to the token and the opportunity to transmit. Network adapter
cards and Multi Access Units used in this topology are much more expensive than
Ethernet cards and hubs. In star topology each computer on a network communicates
with a central hub that resends the message either to all the computers or only to the
destination computer. We can use several types of cable to implement a star network
like ATM. It is expensive to install as it require more cable. Tree topology topologies
integrate multiple star topologies together onto a bus. In its simplest form, only hub
devices connect directly to the tree bus and each hub functions as the "root" of a tree
of devices. It required pointtopoint wiring for individual segments but if the
backbone line breaks, the entire segment goes down.
In a Mesh topology, each of the computers and network devices are interconnected
with one another allowing for most transmissions to be distributed, even if one of the
connections go down the network remain intact. Data travels by hopping from one
node to another and then reaches the destination. It provides redundant paths between
devices and hence it is more reliable and stable. With the hybrid topology, two or
more topologies are combined to form a complete network.
In this unit, we have learnt the basic classification of networks where each of the
networks is categorized as LAN, WAN & MAN. LAN is a group of computers
located in the same room, on the same floor or in the same building that are connected
to form a single network. Each computer connected to a LAN can be configured to be
able to access the other connected computers’ hard drives, as if they were installed
internally. A LAN comprises of different communication devices across the network
such as repeater, router, hub, switch etc. LAN’s are private networks, not subject to
tariffs or other regulatory controls.
56
Computer Networks
Metropolitan area networks, or MANs, are large computer network usually spanning a
city. They typically use wireless infrastructure or Optical fiber connections to link
their sites. A MAN is optimized for a larger geographical area than a LAN, ranging
from several blocks of buildings to entire cities. Some technologies used for
implementing LAN are ATM, FDDI, and SMDS. MAN typically use wireless
infrastructure or Optical fiber connections to link their sites.
Wide Area Network (WAN) is a computer network that covers a broad area (i.e., any
network whose communications links cross metropolitan, regional, or national
boundaries). The largest and most wellknown example of a WAN is the Internet.
WANs are used to connect LANs and other types of networks together, so that users
and computers in one location can communicate with users and computers in other
locations. Communication medium used are communication circuits which are
connected by routers. In WAN, Hosts are typically connected (or close to) the routers.
3.9 SOLUTIONS/ANSWERS
1) i) True
) False
) True
Topologies can be physical or logical. Physical Topology means the physical design
of a network including the devices, location and cable installation.
Logical Topology refers to the fact that how data actually transfers in a network as
opposed to its design.
3) a) Bus Network Topology with a Server, LAN printer and two Personal computers.
server
LAN printer
57
Networking and
Communication
b) Star Network Topology with a Server, LAN printer and two Personal computers.
Personal
Computers
Server LAN
printer
4) Following are the differences among Bus, Ring, Star and Tree Topologies.
• Ring Topology : All devices are connected to one another in the shape of a
closed loop, so that each device is connected directly to two other devices,
one on either side of it. Ring topologies are relatively expensive and difficult
to install, but they offer high bandwidth and can span large distances.
• Star Topology: All devices are connected to a centralhub. Star networks are
relatively easy to install and manage, but bottlenecks can occur because
all data must pass through the hub.
58
Computer Networks
• Money. A linear bus network may be the least expensive way to install a
network; you do not have to purchase concentrators.
• Length of cable needed. The linear bus network uses shorter lengths of
cable.
• Future growth. With a star topology, expanding a network is easily done by
adding another concentrator.
• Cable type. The most common cable in schools is unshielded twisted pair,
which is most often used with star topologies.
1) i) False
ii) True
i) Network devices such as Workstations, printers, file servers which are normally
accessed by all other computers.
ii) Network Communication Devices i.e., devices such as hubs, routers, switches etc.,
used for network connectivity.
iii) Network Interface Cards (NICs) for each network device required to access the
network. It is the interface between the machine and the physical network.
iv) Cable as a physical transmission medium.
v) Network Operating System –software applications required to control the use of
network operation and administration.
3) LAN is generally limited to specific geographical area less than 2 k.m. having
high speed networks. Metropolitan area networks can span up to 50km, devices
used are modem and wire/cable. WAN generally covers large distances (states,
countries, continents).
59
Networking and
Communication 4) D. E. Comer, “Internetworking with TCP/IP”, Pearson Education Asia, 2001
5) Comer E. Doughlas, “Computer Networks and Internets”, 2nd Ed., Pearson, 2000
6) Laura Chappell (Ed), “Introduction to Cisco Router Configuration”, Techmedia,99
7) Behrouz A. Forouzan, “TCP/IP Protocol Suit”, TMH, 2000
References Website:
• http://www.nethistory.info
• http://www.networktutorials.info/
• http://www.brainbell.com
60
Information Security
UNIT 1 INFORMATION SECURITY Concerns
CONCERNS
Structure
1.0 Introduction
1.1 Objectives
1.2 Definition and Need of Information Security
1.3 Definition Related to Information Security
1.4 Types of Threats
1.4.1 Physical Security Threats
1.4.2 Software Security Threats
1.4.3 Network Security Threats
1.4.4 Password Security Threats
1.5 Types of Security Measures
1.5.1 Physical Security Measures
1.5.2 Software Security Measures
1.5.3 Network Security Measures
1.5.4 Password Security Measures
1.5.5 Other Aspects
1.6 Encryption: A Defensive System Against Threats
1.6.1 Symmetric Key Encryption System
1.6.2 Asymmetric Key Encryption System
1.6.3 Electronic Signature
1.7 Security Policies
1.8 Summary
1.9 Answers/Solutions
1.10 References/Further Readings
1.0INTRODUCTION
In today’s, networked society where computer outsells radio and TV, Online shopping
is becoming more popular daybyday. The need for providing secure network
environments is on top priority for all organizations. Weakness in such a system may
lead to all kind of attacks, threat and loss of essential information. Information security
deals with how you can secure your personal and confidential information from the
rest of the world. In this unit, we will discuss the basic need of information security in
an organization. Why do we need to secure our information from the rest of world.
Because no one should access it, without your permission or without authentication.
We will also discuss about the threats or attacks in breaching of the information
security and how easily can a person or software penetrates into your system and
accesses your information. After accessing your information, an intruder can
manipulate, destroy or misuse your information or data. In this unit, we will also focus
on the different types of threat subjected into the information security systems. We are
also going to introduce information regarding identification and resolving different
kinds of attacks. Finally we have some basic kind of guidelines or policies for the
users who want to keep their information secure.
1.1OBJECTIVES
After studying this unit, you should be able to;
• define the term information security and its needs;
5
Information Security
• understand the terms: Integrity, Availability and Confidentiality;
• differentiate different types of attacks;
• define safety measures for an information security system against these attacks;
and
• understand and make Guidelines for secure information security system.
• Confidentiality
• Integrity
• Availability
We will discuss these terms later in this unit.
The terms, information security and computer security frequently are being used
interchangeably. Both the fields are related to each other and have the common goals
of protecting the information. But there are some differences between the two. The
basic difference in both the approaches are:
Methodology used for providing solutions and areas of Concentration
The computer security can focus on availability and correct operation of system
without any knowledge of information storage and processing by the computer.
6
Information Security
Concerns
Integrity: Those systems which always provides the correct information about the
system.
Availability: The system which provides the access on the information stored to its
users when they want so.
Generally the terms integrity, confidentiality and availability are loosely construed to
be synonymous with security. These however have different connotations with respect
to data or information. To understand better the measures and to ensure the protection
in those areas, let us define these terms:
…………………………………………………………………………………………...
7
Information Security
…………………………………………………………………………………………...
…………………………………………………………………………………………...
2) Why an Organization needs to secure their information?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
3) What is the difference between Information security and Computer security?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
4) Write down the three aim of information security?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
The first phase in the methodology is the reconnaissance phase. In this phase, the
attacker tries to gain as much information as possible about the target network. There
are two primary ways an attacker can do this: active and passive. The passive attacks
can often generate a lot of good information about the network the hacker wants to
attack. The hacker would often begin by reading through the target organization’s
website to see if any information can be gained or look for contact information for key
employees, information on other type of technology used at the organization, and any
other nugget of information which can be used in the attack. The company’s website
may be visited thoroughly or internet search engines can be used to find more
information about the network. The attackers may look for information in the DNS
servers to attack the organization. This would provide a list of server and
corresponding IP addresses. Once this is done, the hacker would move to active
attacking.
An attacker would begin scanning, looking for holes to compromise to gain access to
the network. The servers available on the internet may be scanned to look for the
known vulnerabilities. Organization’s firewall and the routers may also be looked to
search for the vulnerabilities. Next phase is gaining access. There are many ways for
an attacker to gain access to the target network. Some of the more common entry
points into the network are through the target server’s operating system.
9
Information Security
The most sophisticated threat to information systems is from the malicious software or
malicious programs. These software programs carry harmful damage to an
organization’s data and the software, without the knowledge of the users on the
systems they execute on. These programs mostly are deliberately written by
professional intruders called hackers and their motive to carry maximum damage to an
organization’s data.
The most well known of all types of malicious programs are viruses. A virus is a
program code that has a both the ability to replicate itself as well as attach itself to
other programs. Viruses exploit the details and vulnerabilities of the particular
operating systems and particular hardware platform in order to carry out their work. A
virus infected program can be categorized into different phases. The first of these is
dormant phase. Here the program just contains a copy of the virus code. When the
program in the dormant state is executed, the virus code gain control of the program
and uses this opportunity to propagate by copying itself onto other programs. This is
called propagation phase .When an infected program is run, the virus may perform the
unwanted and dangerous actions that it is capable of. This is called active phase. We
In UNIX, username and will study in detail about the virus and other malicious programs in the next unit.
password may be stored
in /etc/password file.
1.4.1 Password Security Threats
Authentication is the process of determining whether a user is the one who he/she
says he/she is , based on the information such as User ID, password, source (network
address or called ID number from which he/she is connecting). Most servers of
various kinds provide their own builtin authentication. This consists of a user and a
password list stored locally.
The builtin authentication may range from simple names and passwords stored in
clear text form to an encrypted set of information that then points to another set of
encrypted data elsewhere on the same system. However, the results are generally the
same:
1) The user connects to the server and requests a connection.
2) The server asks for authentication data.
3) The user sends a user ID and password.
4) On more secure systems, this information is encrypted before it is sent, but for
many systems, authentication information is sent as clear text.
5) The server compares the password received to the locally stored authentication
data and tries to find a match.
6) If there is a match, the user is granted access to the system.
Using the built & in authentication system is usually the easiest option, because it is
installed with the server software, and it requires no configuration outside of providing
user account information. However for some systems, the builtinauthentication is the
weakest point because the authentication data is stored on the same system to which
the users are connected. In addition, because each device has its own builtin
authentication, that requires you to maintain multiple user lists and passwords and also
provides multiple point of attack for a potential cracker. The other disadvantage of
using the builtin authentication is that you are restricted to the features provided. If
the developers provided no way to force passwords to expire, you would have to clear
them manually at regular intervals. If the software accepts only cleartext password
authentication, you are left with a security hole that anyone on your network can
exploit.
10
Information Security
1.5DIFFERENT TYPES OF SECURITY MEASURES Concerns
The measures for data protection taken by an organization reflect its awareness and
attitude towards information and Information Technology. The management should
consider information as an important resource and shared get involved in securing
essential information of the organization.
One of the best and first steps in ensuring data security is to create awareness and
develop a culture within the organization towards the ways in which information can
be lost or altered and what would be the consequences, of such an occurrence, to the
organisation and individuals. All other steps which can be taken are:
• Information Technology (IT) planning: The organization must decide on a
policy for introduction of IT. This must be done at the highest level and should
address issues such as level of protection for various aspects of information
relating to the organization.
• Selection of technology, keeping in mind obsolesces due to new innovations and
necessity for keeping in step.
• Identification of points of exposure of weak links to device means to plug them.
• Physical protection of machine and media.
Control and Monitoring the access to data, its usage, by persons and its integrity must
be clearly defined and responsibility for ensuring these must test on persons
designated for these tasks; an audit procedure would go a long way in ensuring
adherence to laid down guidelines.
There are four timehonored principles for ensuring security and recovery in case of
breaches of security:
a) Prevent: The best method is of course stopping all breaches of security before
they occur. 'Needto know' policy is an offshoot of the principle of prevention.
b) Detect: However one may try to ensure it, total security is almost impossible.
The next principle, therefore, is that you must be able to detect breaches to
security, whenever they occur, within the shortest possible time. This helps in
damage assessment and, also, in devising further preventive measures.
c) Minimise Damage: The aim here is to contain the damage, when losses occur,
to reduce the adverse effects of such damage.
We would now look at the various measures available to the PC user, to ensure
security of machine and data, relating to the principles enumerated above.
11
Information Security
• Locate the PC in such a way that it is conveniently accessible to the user but
hidden from casual passersby.
• Have likeable cupboards for floppies and keep them locked at all times, except
when used.
• Keyboard and PC locking devices can be fitted so that the PC cannot be
operated unless these locks are opened.
• Keep a record of all floppies in use; do not permit alien floppies into the
• Organization.
• Use lockable rooms for PCs, specially those handling sensitive data. Make it a
practice to lock the room when leaving it even for a short time.
• The above apply to server, gateways and the likes.
Environmental Conditions: The PCs are fairly rugged and can tolerate wide ranges
of temperatures, humidity and voltages. However, to ensure trouble free and
prolonged
life, consider the following measures:
• Have temperature and humidity gauge placed in the close proximity of PC and
keep a casual watch to ensure that conditions are within limits. Switch off if the
limits are exceeded;
• If your normal electrical supply is subject to large variations of voltage and
frequency or spikes, it is prudent to have voltage and frequency stabilizers for
the PC;
• Ensure that excessive dust or paper scrap does not accumulate near the PC;
• The plug sockets should fit snugly and cables leading to terminals and printers
should be secured properly and not left hanging;
• You may consider putting a thin transparent plastic cover on the key board if it
does not hamper your handling the keyboard;
• The most important is the use of a vacuum cleaner at regular intervals.
12
a "copy" procedure; this ensures that a backup of your data files would always Information Security
be automatically taken. Concerns
13
Information Security
Identification: The Password only indicates an object with a unique identity assigned
to it. Thus it should not become authorisation to access data without further checks, if
some measure of security is desired.
Authentication: This process verifies that a person or object is who he, she or it
claims to be. This could be achieved by asking some standard questions (from a large
selection) and getting answers to them; if the answers match with those held on the
systems, the person or object is authenticated.
Authorization: This is the last step in the process; through this, you can ensure that
only a given user, terminal or other resource, can access data to which permission has
been granted to read, write or alter; Thus a matrix can be created to indicate which
users have access to which file, records or fields.
If the user request passes the matrix he/she is allowed access, otherwise he/she is
denied access to some parts of the database.
Access Control Cards: This is the latest method and is also available on PCs. Here,
an additional card is inserted on the PC. This card has its own memory and software.
The user can program up to ten complex account codes. Anyone wanting access to a
PC has first to pass through authentication routines through this card. Only when
he/she passes, is he/she is allowed to access the PC itself. These codes can be
reprogrammed whenever required. Thus the basic problem of preventing access to the
operating system of the PC can be solved to a large extent.
14
Information Security
Check Your Progress 2
Concerns
1) Write down the different types of threats to breaches in information security?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
2) What are different Software Security Threats?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
3) What is meant by Authorisation?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
5) Write down different types of measures in information security systems?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
Let us take an example to understand better the concept of encryption. Assume you
want to send a secret message to your friend in encrypted form. For encryption of
message (MEET TODAY), we will use the following table1.
Character
A B C D E F G H I J K L M N O P Q R S T U V W
Position 1 1 1 1 1 1 1 1 1 1 2 2 2 2
1 2 3 4 5 6 7 8 9
Value 0 1 2 3 4 5 6 7 8 9 0 1 2 3
As, we want to convert this plain text to encrypted form. We will select a secret key to
encrypt this plain text. As in this example we select a secret key is 3. So you have to
add 3 in every positional value of alphabets (A, B, C, D………….X, Y, Z) to get
encrypted form of the text. As you can see from the Table1 shown, the respective
position value of the alphabets (1, 2, 3, 4……..24, 25, 26). Now, every character will
be read as the character comes on 3+ positions. In this case if we select A then it will
be D.
Now, after encryption the message will be:
• Plaintext: This is the original intelligible message or data which is fed into the
algorithm as input.
• Secret Key: The secret key is also input to the encryption algorithm. The key is
a value independent of the plaintext. The algorithm will produce a different
output depending on the specific key being used at the time. The exact
16
substitutions and transformations performed by the algorithm depend on the Information Security
key. Concerns
17
Information Security
• Plaintext: This is the readable message or data that is fed into the algorithm as
input.
• Public and Private Key: This is a pair of keys that have been selected so that if
one is used for encryption, the other is used for decryption. The exact
transformations performed by the encryption algorithm depend on the public or
private key that is provided as input.
2) Each user places one of the two keys in a public register called public key or
other accessible file. The companion key is kept private called private key. Each
user maintains a collection of public keys obtained from others.
4) When B receives the message, he decrypts it using his own private key. No
other recipient can decrypt the message because only B knows his private key.
This process is also shown in Figure 1. 3.
With this approach, all participants have access to public keys, and private keys are
generated locally by each participant and therefore need never be distributed. As long
as the system controls its private key, its incoming communication is secure. At any
time, a system can change its private key and publish the companion public key to
replace its old public key. The following figures show the encryption and
authentication processes in Public Key cryptography.
18
Information Security
Concerns
19
Information Security
key
1.7SECURITY POLICY
Before making security policies for a system, first you should analyse how the data is
important for you. After knowing the values of your data, you need to develop a set of
policies to prevent it. These types of policies are called security policies and may
apply to users, department and an organization. The policies are categorized in three
different areas listed below:
• User Policies
• IT Policies
• General Policies
User Policies
Under these policies they cover issues related to the users. They define term related to
users, what can users do with data or network. It has defined some terms which limit
the users to keep the network secure such as access permission, restriction on
programs etc. some policies are:
Internet Usage: Use of internet, mail, program with password or unencrypted data
sent over internet.
System use: They put limitations on the users to use system limited by giving a
limited permission on program installation, file sharing, instant messaging etc.
IT Policies
These policies include general policy for the IT department. Some policies are:
Backup policy: They define policy for what to back up, who back it up, storage,
testing etc.
Firewall Policy: They define which port to allow traffic or which blocked.
General Policies
High level program policy: defines how owns other policies, scope, related document
and purpose of policies. It covers:
• Crisis management
• Disaster management
20
Information Security
• Server recovery
Concerns
• Data recovery
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
2) What is the difference between Symmetric key and Asymmetric key encryption
systems?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
3) What are the components of Symmetric key encryption systems?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
4) Why do we use encrypted form of data in an Information security system?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
1.8SUMMARY
It is becoming increasingly essential for all organisations to ensure data security.
Ensuring data security on PCs and LANs is a major problem as, inherently, very few
mechanisms are provided to guard against data loss, corruption, misuse or
eavesdropping. Unless the organisation creates security awareness in its work force,
any measures for data security are not likely to prove successful.
The organisation must decide on the IT and security policy at the highest level and
ensure its strict implementation for a reasonably successful outcome. There are a
number of measures available to the organisation, specially on larger system, to ensure
data security. Equal attention, however, needs to be paid to PC security as there is an
increasing use of PCs as terminals.
21
Information Security
In this unit we discussed about the term Information security and its need. As you
know the term Information the security of, it deals with secure your personal and
confidential information from the rest of the world. We also defined the main aim
behind to secure your data. The terms are availability, integrity and confidentiality. In
these terms we secure our data. We also discuss about the threats or attacks in
breaching of the information security. How easily can a person or software penetrate
into your system and access your information. After accessing your information, it can
manipulate, destroyed or misused it. In this unit we discuss about the different types of
threat subjected into the information security systems. We also introduce information
as to how to identify and sort out these types of attacks. Finally we have some kind of
guidelines or policies for the users who want to keep their information secure.
1.9 ANSWERS/SOLUTIONS
22
on the systems they execute on. Some of this software needs a host program to Information Security
run on for e.g. Trojan Horses, Logic bombs and viruses. On the other hand some Concerns
other malicious programs do not need any host to operate like bacteria and
worms. Bacteria and worms are replicatory in nature, while others like Trojans
and worms cannot replicate. These programs mostly are deliberately written by
professional intruders called hackers and their motive to carry maximum
damage to an organization’s data.
3) Authentication is the process of determining whether a user is who he says he is
based on the information such as User ID, password, source (network address or
called ID number from which he is connecting). Most servers of any kind
provide their own builtin authentication.
4) We have had a fairly close look at the measures for data protection available on
stand alone as well as networked PCs. Some of the measures that we studied can
be implemented only on mini and main frame systems easily, while trying to
introduce them on PCs may incur too much of resource overheads. We would
now take a quick look at the protection, detection and recovery mechanisms
available on large systems. This is in order to give you pointers for discerning
when to go in for a larger system rather than a PC LAN and what facilities to
look for.
• Database Access
• Access to Operating Systems
• Access Control Cards
5) Different types of security measures are:
• Physical Security
• Network Security
• Software Security
• Password Security
• The sender and the receiver must • The sender and the receiver must
23
Information Security
share the algorithm and the key. have one of the matched pair of
keys (not the same one).
• The key must be kept secret. • One of the two leys must be kept
secret.
24
Software Vulnerabilities
UNIT 2 SOFTWARE VULNERABILITIES
Structure
2.0 Introduction
2.1 Objectives
2.2 Infection Process
2.3 Viruses
2.3.1 Classification of Viruses
2.3.2 Types of Viruses
2.3.3 Infection Methods
2.3.4 Prevention and Cure
2.4 Worm
2.5 Trojan Horses
2.5.1 Types of Trojan
2.5.2 Stopping a Trojan Horses
2.6 Emerging Attacks: Social Engineering
2.6.1 Types of Social Engineering
2.6.2 Physical Social Engineering
2.7 Summary
2.8 Answers/Solutions
2.9 References/Further Readings
2.0INTRODUCTION
Software vulnerability is defined as we have studied in the previous unit, Virus is a
common term understood as software vulnerability by average people. It is a problem
that is potentially so dangerous that it threatens the proper functioning of the computer
system in today's information age. In this unit you will learn about the unwanted
software that is deliberately bad in intent which is “wrote for fun” or “for curiosity” or
simply to challenge to create the most destructive software ever built. This software is
popularly known as “malware” which is an acronym for malicious software. Malware
does nothing useful but rather more harmful. In this unit we will study several types of
malware each of which has different goals and propagates differently.
2.1OBJECTIVES
At the end of this unit you should be able to:
• understand and define computer viruses and its evolution;
• understand the process of malware infection;
• knew different software vulnerabilities;
• identify different types of common malicious codes such as Trojan horse, virus
and worm;
• describe/apply various preventive measures and solutions for malwares; and
• various aspects of social engineering attacks.
25
Information Security
To understand how a malware infects a system, we go back to the elementary working
of a computer. On booting, the system carries out the ROM (Read Only Memory)
instructions, the first being the power on Self Test which is followed by the bootstrap
process of reading the boot record and loading of the disk operating system. The
booting process culminates into the system prompt displayed on the monitor.
The infection may begin as soon as a computer system boots from a contaminated disk
or executes an infected program. Whatever malwares are present gets activated, which
immediately begin to spread throughout the system.
Another important aspect that needs mention here is the interrupt mechanism. All
input/output activities on a PC are carried out by interrupts. We will try to understand
the concept of interrupt with an example. Let us say, a user wishes to save his program
and presses on the key board. This is treated as an interrupt. The main memory has
specific routines to handle these user requests. The program that services the interrupt
request is termed as Interrupt Service Routines (ISR's) and is located in the memory
with their addresses. Then interrupt request activates a number and not the routine
address, thus, there exists a table with the interrupt numbers and the corresponding
routine address. When an interrupt request is made, the CPU looks up the table,
performs the required routines and transfers the control back to the program.
The contents of ISR address table being in the RAM is vulnerable to modification by
user programs and that is what a virus doesmodifying the ISR'S.
The first commercial application of malware was in 1985, when two Pakistani
brothers, in order to keep track of software piracy used Brain Virus (also known as
Pakistani virus) on their low cost software sold from their outlet in Lahore. Hidden in
nearly every disk they sold, was an extra program not supplied by the original
manufacturer a snippet of computer code, selfreplicating in nature that would infect
an unauthorized user's computer by disrupting his operations. These selfreplicating
programs multiplied so fast that, today, they created a great threat to the smooth
operation of a computer.
26
Software Vulnerabilities
2) System Infectors
3) General Executable Programme Infectors
Boot Infectors: As the name suggests, they are characterized by the fact that they
physically reside in the boot sector [0 (zero)] sector of the disk. A system infected by
such a virus will have the virus residing in a particular area of the disk rather than in a
program file.
These viruses get loaded soon after the Power on Self Test and control the system and
remains in control at all times. They sometimes have the capability to trap soft booting
(i.e., CTRL ALT DEL) and remain in control even if the system is booted from a non
infected floppy, thereby contaminating the clean floppy.
Boot infectors displace information originally residing on the location which they
occupy. While writing onto the boot sector, the virus ensures that the boot record is
not deleted. Once the virus is loaded, it automatically transfers control to the area
where the boot record is available. The reason behind doing this is that the boot record
contains instructions to read booting file of an operating system and if these files are
not readable, access to the disk is not possible and so the virus becomes ineffective.
Boot infectors, typically create "Bad sectors". Boot infectors are the type which once
loaded would stay in the memory until the system is shut off and the disk reformatted.
System Infectors: This second category of viruses deals with the components of the
system itself. All machines without exception require an operating system in order to
create an environment in which the operator works. For example, in MSDOS,
COMMAND.COM contains all the internal commands. If no such command file
exists, commands such as COPY, DIR etc. are not loaded onto the memory when the
machine is booted. The System Infectors attach themselves to a file such as
COMMAND.COM or other memory resident files and manipulate these files.
System infectors differ from Boot infectors in the sense that system infectors gain
control after the computer is booted and infects a hard disk or bootable floppies which
contain the appropriate system files only. They have another peculiarity that they may
activate after a given period of time or may instantly begin subtle modifications in
system processing such as, increasing the time to perform system functions,
scrambling of data, or modification of systems error messages or information
messages.
General Executable Program Infectors: From the infection point of view, these
viruses are most dangerous and devastating of the three classes of viruses. They attach
themselves to program files and can spread to almost any executable program in any
system. These viruses change the original program instructions into a “jump” to its
own code and follow that code with a return to the original program. As a result,
whenever the program is executed, the virus gets loaded and executed first and then
allows the original program to proceed. It remains memory resident and infects each
and every program that is loaded for execution.
By attaching themselves to .EXE or COM files, they alter the file size and sometimes
multiple infections renders program files too large to be accommodated in the
memory.
The major differences between an EXE file and a COM file:
1) EXE file contains a header whereas a COM file does not.
27
Information Security
2) EXE program can contain more than one segment. But a COM has to contain
only a single segment
Scores Virus: These viruses are prevalent in Macintosh machines. Scores virus has a
built in time trigger that activates at two, four and seven days after the disk has
become infected. The consequences are varied ranging form printing problems, system
clashes and malfunctioning of disk operations. Data files are not directly affected by
this virus, but removal of this virus requires deletion of all files.
Brain Virus: This is one of the first viruses that came into being. Also known as the
Pakistani virus, it was developed by the Pakistani brothers to keep track of low cost
software that were sold out of their outlet in Lahore. The virus pops up a screen saying
"Welcome to the Dungeon". These viruses are known to destroy data and are highly
contagious.
Lehigh Virus: This virus originated at the Lehigh University Computer Centre. This
virus stays in the stack space of COMMAND.COM. With the booting of a PC from an
infected disk, the virus is spread through commands such as COPY, TYPE, and DIR
etc. On any other disk with COMMAND.COM the virus code gets copied to the other
disk and a counter is incremented on the parent. When the counter reaches a value of
4, all files of the disk gets erased. The boot sector gets ruined and also the FAT.
Friday the 13th: This virus attacks not only the COMMAND.COM but also other
executable files. When A.COM or .EXE file is executed for the first time after
booting, the virus captures a specific interrupt and inserts its own code; after which,
whenever any. EXE file is executed, the virus code is written to the end of the file
resulting in increase in size of the file by 1808 bytes. In COM files the virus code is
written in the beginning of the file.
The increase in size of the EXE and COM files causes the program to become too
large to be loaded into the memory. Also after a certain interval of time, delays are
inserted resulting in considerable slowing down of the programs. The worst disaster
occurs, if the infected. EXE or .COM is executed when the system date is Friday the
13th, all files get deleted.
Sunnyvale Slug: This does a variety of things like displaying a message "Greetings
form Sunnyvale. Can you find me?" and also sometimes modifies the COPY
Command resulting in deletion of files instead of copying.
Raindrops: This virus infects COM files. It intercepts the load and execute function
of MSDOS. It cheeks whether the file is EXE or not, if the file is not an EXE file, the
first three bytes of the file are replaced by a jump instruction at the end of the file,
where it gets attached after encryption. This results in dropping or showering of
characters on the screen like raindrops and is also accompanied by appropriate sound
effects.
28
Happy Birthday 30th: 'This virus gets activated on January 5th, if any of the infected Software Vulnerabilities
programs get executed, and will ask the user to type "Happy Birthday 30th". It might
destroy all the data stored on a disk, spacing on 1.2 MB floppy. The symptoms of this
virus is that the computer memory is reported 6KB less than actual e.g. 634 KB
instead of 640 KB.
Storm Worm: The fast spreading threat was identified as an email spamming to
Microsoft systems. It starts collecting infected computers into the Storm botnet.
A second way antivirus programs can detect a virus is through its behaviour. Antivirus
programs can often detect the presence of a previously unknown virus by catching a
virus as it tries to infect another file or disk.
To sneak past an antivirus program, many viruses use a variety of methods to spread:
• Direct infection
• Fast infection
• Slow infection
• Sparse infection
• RAMresident infection
Direct infection means that the virus infects a disk, or one or more files, each time you
run the infected program or open the infected document. If you don't do either, the
virus can't spread at all. Direct infection is the simplest but also the most noticeable
way of infecting a computer and can often be detected by antivirus programs fairly
easily.
Fast infection means that the virus infects any file accessed by an infected program.
For example, if a virus infects your antivirus program, watch out! Each time an
infected antivirus program examines a file, it can actually infect that file immediately
after certifying that the file is virusfree.
Slow infection means that the virus only infects newly created files or files modified
by a legitimate program. By doing this, viruses attempt to further mask their presence
from antivirus programs.
Sparse infection means that the virus takes its time infecting files. Sometimes it infects
a file, and sometimes it doesn't. By infecting a computer slowly, viruses reduce their
chance of being detected.
RAMresident infection means that the virus buries itself in your computer's memory,
and each time you run a program or insert a floppy disk, the virus infects that program
or disk. RAMresident infection is the only way that boot viruses can spread. Boot
viruses can never spread across a network or the Internet since they can only spread by
physically inserting an infected floppy disk into a computer, although they can still
infect individual computers attached to a network.
29
Information Security
2.3.4 Prevention and Cure
Even though the computer industry has found somewhat plausible solution to the virus
problem in the form of vaccines, it is always advisable to follow the dictum
"Prevention is better than cure". Moreover, the viruses are made faster than the
vaccines. It is a good practice to follow some simple precautionary measures which
can reduce the possibility of a virus attack. The precautionary measures are:
• The CHKDSK command can be incorporated to the AUTOEXEC.BAT to check
the disk. If the numbers of hidden files increase, the matter should be looked
into.
• The use of pirated software should be stopped.
• Write protect tags should be used on the original software diskettes.
• Proper backup of all data and program files should he kept.
• copying of files should be done carefully; a better practice is to write the COPY
command in a batch file with CHKDSK command.
• Used floppies should be reformatted.
• avoid letting the system to be used by unauthorised users.
• restrict the use of outside floppies
CURE
The viruses are not simplified used. Viruses can be cured with antiviral programs.
The antiviral programs perform one or more of the following functions:
• Prevention
• Detection
• Vaccination
• Inoculation
• Identification, and/or
• Damage control.
A good antiviral utility is one which checks whether the system has been infected or
not. These programs stop the virus from infecting the system. They do not allow the
modification of executable files, so that a file virus cannot get a foothold.
Some of them refuse to let any program make itself resident in RAM unless allowed
by the user. Others do not allow the user to run a program unless it is on a list of
approved and tested applications. The detectors warn the user of the presence of a
virus after it is loaded into the machine or disk. These programs maintain a file with a
list of checksum values of the executable files. The identifiers rely on the fact that
when the virus replicates, it makes a copy of itself.
The vaccinators inject some code into the executable files. When the vaccinated file is
run, the injected code performs an integrity check on the program being executed and
warns if any changes have been made.
The inoculators insert the virus signature into infected areas or files at appropriate
locations. When the virus performs their selfdetection, they find their signature and
believe that the memory/disk/file is already infected and so do not infect.
30
Software Vulnerabilities
The better equipped antiviral programs control damages. They may be preventive or
restorative. Preventive techniques include stopping attempts at direct access such as
formatting and deleting, or even write protecting the hard disk while testing unfamiliar
software. The restorative process is achieved by maintaining a copy of the CMOS
information, boot sector information, the file allocation table etc. in a safe area like a
floppy.
As a virus can hide itself in many different ways, it is difficult to detect all viruses
with just one antiviral program. Moreover, the virus writers keep altering the viral
code, so that it cannot be detected by any existing antiviral programs. The point to
remember is that there is no cent percent foolproof antivirus program available and,
in principle there never will be.
…………………………………………………………………………………………...
…………………………………………………………………………………………...
2) Describe the process of booting?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
3) Name the first commercial application of virus?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
5) How can you prevent your system from virus attacks?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
31
Information Security
2.4WORM
A worm shares many characteristics with a virus. The most important characteristic is
that worm is self replicating too. Worms seek to infect and replicate without targeting
and infecting specific files already present on a computer. . The two most common
ways a worm can spread are through email and security flaws in computers connected
to a network or the Internet.
If a virus infects a legitimate file, the virus code can be cleaned out and removed. But
this is not the case with worms. Worms generally create and occupy the files that
contain their code without using or involving any real data or binary files, the normal
cleanup technique for worms is to delete all infected emails or messages that provide
their containers.
Worms which use email to spread are known as massmailing worms and are typically
written in a variant of the Visual Basic programming language. They usually exploit
the Microsoft Outlook or Outlook Express emailing programs on Windows. Typically,
the worm checks a user's Outlook or Outlook Express address book for a list of stored
email addresses and then the worm sends a copy of itself to each address. Mass
mailing worms can spread particularly quickly since they tend to come from someone
that the victim knows. The recipient is likely to read the email and accidentally help
the worm spread to their own address book of email addresses. Massmailing worms
most often target Microsoft Windows users running Microsoft Outlook or Outlook
Express, because those are the most common operating systems and email programs.
Thus, one way to protect you against a massmailing worm is to either use a different
operating system (such as Linux or the Mac OS) or use a different email program.
Internet worms, in contrast, spread by searching the Internet for a computer running a
specific type of operating system or webserver with a known flaw in it. Once the
worm finds a vulnerable computer, the worm copies itself to that computer through the
known flaw and then proceeds to use that computer to look for other targets to attack.
Sometimes the mere existence of a worm mass mailing or copying itself across the
Internet can cause your computer to slow down or even crash without the worm
deliberately trying to harm your computer. Other times the worm may include a pay
load that wipes out data, infects your computer with a virus, or retrieves documents at
random from your hard disk (which could include sensitive business or highly
personal documents) before mass mailing them to everyone listed in your Microsoft
Outlook or Outlook Express address book.
Before a Trojan can attack, it must find a way to entice the victim to copy, download
and run it. Since few people would knowingly run a malicious program, Trojan must
disguise themselves as other programs that the victim believes to be harmless (such as
games, utilities or popular applications). This is not all, besides disguising themselves
as harmless programs, Trojan horses can also disguise themselves into a legitimate
program, such as Adobe Photoshop or Microsoft Excel. To do this, malicious hackers
have created special wrapper or binder programs with names such as Saran Wrap, silk
32
rope which can package any Trojan inside another program thereby reducing the Software Vulnerabilities
likelihood that someone would discover it. Since most users won’t suspect that a
program from a large, well known publisher would contain a Trojan, the victim is
likely to run the linked program containing the Trojan. Once someone has written a
Trojan, the next step is to spread it by copying in onto a victim’s computer, posting it
on a website for others to download, sending it as a file attachment via email. If
someone has a physical access to your computer, he can simply copy a Trojan to your
hard disk. If the attacker is particularly skilled he can create a custom Trojan that
mimics the appearance of a program that it unique to that particular computer such as
a company database program.
Trojans are commonly found on the websites which offer free software, such as
shareware programs. Even some people post Trojans on their own websites and
pretend to offer hacker tools or pornographic files for others to download. Naturally
some of these files are Trojans, so as soon as an unwary user downloads and runs
them, the program causes the damage as intended by their creator. Another common
way to spread a Trojan is to attach the program file to an email attachment which
might look similar to a useful utility, a contest announcement or tempting software.
Many people even send Trojans to people visiting online chat room because in that
case they don’t have to find even the email ids of the recipients. The hacker typically
invokes a friendly conversation with a potential victim and then offers to send the
person a hacker program or a tempting file. When the victim accepts the file and tries
to open it, the Trojan attacks. Hackers also send Trojans to people who use instant
messaging services such instant messenger.
If someone has physical access to your computer, he can simply copy a Trojan horse
to your hard disk. If the attacker is particularly skilled, he can create a custom Trojan
horse that mimics the appearance of a program that is unique to that particular
computer, such as a corporate login screen or a company database program. Not only
would such a Trojan horse be more likely to trick its victim, but the Trojan horse could
also perform an action specific to that particular computer, such as stealing a
company's list of credit card numbers or copying the source code of a game company's
unreleased products and posting them on the Internet.
• Joke Trojan: A joke Trojan causes no damage but may play an annoying
sound from a computer’s speaker, warp the appearance of the computer
screen ,or display a taunting message on the screen
• NVP Trojan: NVP Trojan is a Macintosh Trojan that modifies the system file
so that when the user types any text, the vowels (a,e,i,o,u) fail to appear.
33
Information Security
• Destructive Trojans: These either wipe out the hard drive or selectively delete
or modify certain files. The password stealing Trojans steal the passwords typed
through the user’s computer.
First of all, make sure you know who has access to your computer. Lock it up,
password protect it, or disconnect it from a network if you're not using it.
Second, be careful where you get your software. Anytime someone tries to give you a
program through email, a chat room, or an instant message, watch out! That program
could be infected with a Trojan horse, either with or without the sender's knowledge.
When downloading software, download only from the software publisher's official
website. If you download a program from another website, someone could have
inserted a Trojan horse into that program. Many hacker websites even post pirated
software and hacker tools for others to download, and some of those files could also
be infected with a Trojan horse.
But no matter how careful you may be with your computer, someone could also slip a
Trojan horse on your computer in your absence. To further protect yourself, consider
installing a rollback program, an antivirus program, a firewall, and an anti–Trojan
horse program.
Rollback programs: One of the biggest problems with today's software is that much
of it, once installed, seems to muck up even perfectly fine computers. Rollback
programs guard against these problems by tracking changes made to your hard disk
and taking periodic "snapshots" of the contents of your hard disk. That way, if a newly
installed program crashes your computer, you can run the rollback program to undo
the changes you made to your hard disk and return your computer to its prior
condition.
While rollback programs can recover your computer from damage caused by a Trojan
horse, virus, or even hard disk crash, they can't prevent problems from happening in
the first place. But when used together with frequent backups, a rollback program can
provide valuable insurance for your important data and reduce the chance that a Trojan
horse attack will prove catastrophic.
Some of the more popular rollback programs that you can buy include ConfigSafe
(http://www.imaginelan.com), FlashBack (http://www.aladdinsys.com), GoBack
(http://www.roxio.com), EasyRestore (http://www.powerquest.com), and Undelete
(http://www.execsoft.com).
34
Antivirus programs: Although antivirus programs are designed to detect and remove Software Vulnerabilities
computer viruses, many can also detect and remove the client files of the more
common RATs. However, antivirus programs may only recognize the most
popular Trojans, so they may not protect you against lesserknown,
destructive Trojans, RATs, or custom Trojans. Consider an antivirus program
a supplement to the defense of your computer, but not your sole defense
against Trojan horses.
An antivirus program employed with a variety of strategies. The one of the strategy is
Signatures which is involving in search out known malicious patterns in exe code.
Whenever viruses are created then a signatures can be updated; users can infected at
any time between creation and distribution of a signature such virus called zeroday
viruses. Using Antivirus program regularly harms the computer performance.
Firewalls: A firewall can isolate your computer network from any outside threats.
While a firewall can't remove a Trojan horse, it can monitor and shut down
external traffic flowing through any open ports on your computer. By shutting
down a port, a firewall prevents hackers from accessing your computer
through a RAT. Firewalls can also track and log all attempts to access your
computer, trace an intruder probing your computer for openings and sound an
alarm whenever someone tries to access your computer without your
permission.
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
2) What is a worm?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
3) What are Trojan Horses?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
4) Write down different types of Trojan?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
35
Information Security
…………………………………………………………………………………………...
The goal of social engineering is to trick someone into providing valuable information
or access to that information or resource. The social engineer targets the human nature
of a person and exploits his/her human qualities such as:
• The desire to help others: Most of the competitive companies train their
employees to behave well with the customers and pose helpful to the customers.
The attitude of “ May I help you?” sometime becomes trouble as the employees
unknowingly disclose too much information about the company
• A tendency to trust others: Human nature is to trust others easily if the
physical appearance of a person goes in consistency with the statements he is
giving. The need is to train the employees of the company to not to trust others
easily and not to disclose information in such a case.
• The fear of getting into trouble: Too many of us have seen negative reaction
by superiors because verification of identity took too long or because some
official was offended. Management must support all employees who are doing
their assignment and protecting the information resources of the enterprise.
• Careless attitude: Sometimes we get lazy and leave our passwords open or
leave some sensitive material on the desktop of our office PC which is easily
accessible to others.
The important quality of a good social engineer is i.e., is able to do the harm silently
without getting noticed. It is about bad social engineers we know. The good social
engineers live happily between us and we are not able to catch them.
Human beings are the weakest link in a security chain. We cannot be sure of the
security of a system even if we install an antivirus, firewall, cryptography based
system or anything else. The machine can never be as intelligent and as destructive as
a human being (after all human creates machines). A social engineers therefore always
tries to exploit the human factor involved for instance why to go on to install a sniffer
on a network when a simple phone call to an employee of the company can allow you
to gain access to the user_id and password. Social engineering is difficult to defend
with the hardware or the software alone. A successful defense will require effective
information security architecture, making policies and standards to be followed strictly
etc. Let us now discuss some of the prevalent social engineering types.
36
Although the majority of social engineering attacks focus on humanbased interaction Software Vulnerabilities
by the social engineer, there are also some computerbased methods that attempt to
retrieve the desired information using software programs to either gain information or
deny service to a system. A social engineering initiated based system was initiated in
1993. The user attempting to log on to the system was met with the normal prompt and
after entering the correct user name and password, had the system prompt over again.
What actually happened that a social engineer managed to get a program installed for
in front of normal signon routine, gathered the information and passed the prompt to
real signon process. About 95% of the normal user got their codes compromised at
that time.
You must have got lucrative messages in your emails, offering you something for free,
or you have won some prize or contest (without applying for it). Many people get
emails that they have turned into billionaires overnight as some of their closed relative
has died leaving all the property and wealth worth several billions. You are requested
to just disclose your valid account number so that the money can be transferred into
your account. All these types of messages are socialengineering motivated.
Two of the oldest form of social engineering are dumpster diving and shoulder
surfing. The dumpster diver is willing to get dirty to the information it needs. Too
often companies throw out important information. Sensitive information, phone
directories should be shredded before disposing.
The final two types of social engineering are third party authorization and tech
support. The typical thirdparty authorization occurs when the social engineer drops
the name of higher –up who has the authority to grant access. The tech support method
is where the social engineer pretends to be someone from the infrastructure group and
wants a user to access a system while the social engineer scopes out the connection.
They will usually ask for the user’s accountid and password so that they can see it
across the network.
Some potential security breaches are so mundane that they hardly seem to be a
concern. With all the fires that we have to fight everyday and the deadlines we have to
meet, sometimes the most often are overlooked:
• Passwords: The numberone access point for social engineers is the good old
fashioned password. After all the awareness programs and reminder cards, we
still find that employeegenerated passwords are too short or too easy to guess.
Systemgenerated passwords are too long and employees have to write them
down to remember them. Even today some systems do not require that
passwords need be changed. We find this most often in email systems and
Internet accounts. We recommend an assessment of the password length and
interval for change standards; determine if they still meet the current needs of
the user community.
• Modems: Every company has more modems than they know about. Employees
and contractors will add a modem to the system and then install products such
as pcAnywhere to improve their remote access time.
• Help desk: Put in place processes that can assist the helpdesk employee in
identifying who is on the other hand of the phone call.
• Websites: There are two problems here: the dummy site which gathers the
information and the legal site that gives away too much information. Many
hackers use the information they gather from the enterprise Web site to launch
37
Information Security
attacks on the network. Make sure that the information available will not
compromise with the information resources of the enterprise.
Another method to keep employees informed and educated is to have a web page
dedicated to security. It should be updated regularly and should contain new social
engineering ploys. It could contain a “security tip of the day” and remind employees to
look for typical social engineering signs. These signs might include the behavior such
as:
• Refusal to give contact information
• Rushing the process
• Namedropping
• Intimidation
• Small mistakes
• Requesting forbidden information or access
A social engineer with enough time, patience and resolve will eventually exploit some
weakness in the control environment of an enterprise. Employee awareness and
acceptance of safeguard will become our first line of defense in this battle against the
hackers. The best defense against social engineering requires that employees be tested
and that the bar of acceptance be raised regularly.
38
1) Define Social Engineering? Software Vulnerabilities
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
2) Write down different types of Social Engineering?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
3) What is the purpose of antivirus Programs?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
4) Write down different types of security breaches in social engineering?
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
…………………………………………………………………………………………...
2.7SUMMARY
This unit discussed about the threat faced by computer virus. It explains the evolution
characteristics of the virus and the damage they can do to a computer. We studied
different types of viruses and their characteristics. It also discussed about different
solutions and preventive measures to be taken to get rid of computer malwares.
As we know today with the growth of new applications and technologies new software
vulnerabilities are also emerging. Therefore, one has to keep track of latest
development in this field and know how to counter these problems. For example, how
mobile software is becoming common and you can see the malicious software is also
growing rapidly with them. The next unit of this block is going to discuss about
different issue of network security.
2.8 ANSWERS/SOLUTIONS
39
Information Security
Check Your Progress 1
1) The major differences between an EXE file and a COM file:
i) EXE file contains a header whereas a COM file does not.
ii) EXE program can contain more than one segment. But a COM has to
contain only a single segment
2) On booting, the system carries out the ROM instructions, the first being the
power on Self Test which is followed by the bootstrap process of reading the
boot record and loading of the disk operating system. In MSDOS, it involves
the loading of booting files. The booting process culminates into the system
prompt displayed on the monitor.
3) The first commercial application of viruses was Brain Virus (also known as
Pakistani virus).
4) A virus is a malware that, when executed tries to replicate itself into other
executable code, when it succeeds, the code is said to be infected. The infected
code when run can infect new code in turn. The virus are self replicating and
parasitic.
Viruses are classified on the basis of their mode of existence and there are three
categories of viruses:
i) BOOT Infectors
ii) SYSTEM Infectors
iii) GENERAL EXECUTABLE PROGRAM Infectors
There are few methods to prevent your system from virus attacks:
• The CHKDSK command can be incorporated to the AUTOEXEC.BAT to
check the disk. If the numbers of hidden files increase, the matter should
be looked into.
• The use of pirated software should be stopped.
• Proper backup of all data and program files should he kept.
• avoid letting the system to be used by unauthorised users.
• restrict the use of outside floppies
40
Software Vulnerabilities
• Sunnyvale Slug: This does a variety of things like displaying a message
"Greetings form Sunnyvale.
• Raindrops: This virus infects COM files. It intercepts the load and execute
function of MSDOS.
• Happy Birthday 30th: 'This virus gets activated on January 5th, if any of the
infected programs get executed, and will ask the user to type "Happy
Birthday 30th".
3) Antivirus programs are used for the purpose to detect and remove computer
viruses. It can also detect and remove the client files of the more common
RATs. The antivirus programs are considered as a supplement to the defense of
your computer, but not complete defense against Trojan horses.
4) Some potential security breaches of social engineering are:
• Passwords
• Modems
41
Information Security
• Help desk
• Websites
42
Information Security
UNIT 3 NETWORK SECURITY AND
AUTHENTICATION
Structure
3.0 Introduction
3.1 Objectives
3.2 Meaning of Network Security
3.3 Threats to Network Security
3.4 Comparison with Computer security
3.5 Security Issues for Small and Medium Sized Businesses
3.6 Tools for network Security
3.7 Elements of Network Security
3.8 Secure Network Devices
3.9 Significance of Network Layout in Network Security
3.10 Summary
3.11 Solutions/Answer
3.12 References/Further Readings
3.0INTRODUCTION
The previous two units discussed about the fundamentals of information as well as
network security issues which lead to different kinds of problem: attacks, theft of
essential information and software vulnerabilities. In this unit, we shall learn about
how to build a secure network. We shall also learn about the various parameters which
must be considered for network security. There can be various security issues involved
in small and medium sized businesses which require utmost attention for creating the
secure network. Then we shall be covering different kind of tools available for
network security, critical elements of network security like Firewall, password
mechanisms, encryption, authentication & integrity etc. Lastly, we shall study about
some secure network devices like secure modems. Let’s first study the basics of
network and network security.
3.1OBJECTIVES
After going through this unit, you should be able to:
• understand the scope of network security;
• understand the various kind of threats to any network;
• understand Denial of Service attack and its counter measures;
• compare Network security with Computer security;
• understand the challenges to any business environment regarding the network;
• understand different security issues involved with small and medium sized
businesses;
• understand the application of network security tools;
• understand firewall and its types;
• understand the password aging and password policy enforcement?;
• understand the basics of secure network devices; and
42
Information Security
• understand the importance of network layout in network security; and
Network security comprises the measures a company takes to protect its computer
system and it is a prime concern for every company which uses computers.
Compromised network security means a hacker or competitor may gain access to
critical or sensitive data, possibly resulting in data loss, or even complete destruction
of the system.
Network security involves all activities that organizations, enterprises, and institutions
undertake to protect the value and ongoing usability of assets and the integrity and
continuity of operations. An effective network security strategy requires identifying
threats, risks and vulnerabilities and then choosing the most effective set of tools to
combat them.
Unauthorized Access
43
“Unauthorized access'” is a very highlevel term that can refer to a number of different Network Security and
sorts of attacks. The goal of these attacks is to access some resource that your machine Authentication
should not provide the attacker.
44
Information Security
Small and mediumsized businesses use the Internet and networked applications to
reach new customers and serve their existing ones more effectively. At the same time,
new security threats and legislation puts increased pressure on business networks to be
reliable and secure.
Business Challenges
According to recent studies, security is the biggest challenge facing small and
mediumsized businesses. Everchanging security threats from both inside and outside
the business network can wreak havoc on business operations, affecting profitability
and customer satisfaction. Small and mediumsized businesses must also comply with
new regulations and laws created to protect consumer privacy and secure electronic
information.
Security issues for small and medium – sized businesses are classified into 5 basic
categories:
Information Theft
Information theft is big business today. Hackers break into business networks to steal
credit card or social security numbers for profit. Small and mediumsized businesses
are at risk because they are seen as an easier mark than large corporations. Protecting
the perimeter of the network is a good start, but it isn’t enough, since many
information thefts have help from a trusted insider, such as an employee or contractor.
Information theft can be costly to small and mediumsized businesses, since they rely
on satisfied customers and a good reputation to help grow their business. Businesses
which does not adequately protect their information could face negative publicity,
government fines or even lawsuits. Any security strategy must prevent theft of
sensitive electronic information from both inside and outside the business.
Business Availability
Computer worms and viruses can drastically affect the reliability of network
resources, which in turn affects businesses’ ability to respond quickly to their
customers; but worms and viruses are not the only threat to business availability. With
networks so critical to daytoday business operations, cyberterrorists have begun
targeting businesses for blackmail, threatening to bring down Websites and e
commerce operations unless their demands are met. These denialofservice (DoS)
attacks send large volumes of traffic to a critical network element, either causing it to
45
fail or to be unable to process legitimate traffic. Once again, the results are disastrous: Network Security and
data and orders are lost and customer requests are not answered. Authentication
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
2) Write down the different kinds of threats affecting network security?
...........................................................................................................................................
...........................................................................................................................................
3) Differentiate network security with respect to computer security?
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
4) Write down the different security issues related to small and medium sized
business?
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
46
Information Security
a) Antivirus software packages: These packages counter most virus threats if
regularly updated and correctly maintained.
b) Secure network infrastructure: Switches and routers have hardware and
software features which support secure connectivity, perimeter security,
intrusion protection, identity services, and security management. We will
discuss switches and routers later in this unit.
c) Dedicated network security hardware and software: Tools such as firewalls
and intrusion detection systems provide protection for all areas of the network
and enable secure connections.
d) Virtual private networks: These networks provide access control and data
encryption between two different computers on a network. This allows remote
workers to connect to the network without the risk of a hacker or thief
intercepting data.
e) Identity services: These services help to identify users and control their
activities and transactions on the network. Services include passwords, digital
certificates and digital authentication keys.
f) Encryption: Encryption ensures that messages cannot be intercepted or read by
anyone other than the authorized recipient.
g) Security management: This is the glue that holds together the other building
blocks of a strong security solution.
None of these approaches alone will be sufficient to protect a network, but when they
are layered together, they can be highly effective in keeping a network safe from
attacks and other threats to security. In addition, wellthoughtout corporate policies
are critical to determine and control access to various parts of the network.
a) Firewall
As we have discussed in our earlier discussion on the Internet and similar
networks, connecting an organization to the Internet provides a twoway flow of
traffic. This is clearly undesirable in many organizations, as proprietary
FTP stands for File
information is often displayed freely within a corporate intranet (that is, a Protocol. It is
Transfer
TCP/IP network, modeled after the Internet that only works withinused the for copying files
organization). between computer
systems.
In order to provide some level of separation between an organization's FTP server
intranet
uses well known port
and the Internet, firewalls have been deployed. A firewall is simply a group of
21.
components that collectively form a barrier between two networks.
Firewall systems protect and facilitate your network at a number of levels. They
allow email and other applications, such as file transfer protocol (FTP stands
for File Transfer Protocol. It is used for copying files between computer
systems. FTP server uses well known port 21) and remote login as desired, to
take place while otherwise limiting access to the internal network. Firewall
systems provide an authorization mechanism that assures that only specified
users or applications can gain access through the firewall.
47
Firewall systems can also be deployed within an enterprise network to Network Security and
compartmentalize different servers and networks, in effect controlling access Authentication
within the network. For example, an enterprise may want to separate the
accounting and payroll server from the rest of the network and only allow
certain individuals to access the information. Unfortunately, all firewall systems
have some performance degradation. As a system is busy checking or rerouting
data communications packets, they do not flow through the system as efficiently
as they would if the firewall system were not in place.
Type of Firewalls
There are three basic types of firewalls, and we’ll consider each of them.
Application Gateways
The first firewalls were applications gateways, and are sometimes known as
proxy gateways. These are made up of bastion hosts which run special software
to act as a proxy server. This software funs at the Application Layer of our old
friend the ISO/OSI Reference Model, hence the name. Clients behind the
firewall must be proxitized (that is, must know how to use the proxy, and be
configured to do so) in order to use Internet services. Traditionally, these have
been the most secure because they don’t allow anything to pass by default, but
need to have the programme written and turned on it order to begin passing
traffic.
Packet Filtering
Packet filtering is a technique whereby routers have ACLs (access Control
Lists) turned on as shown in Figure 3.2. By default, a router will pass all traffic
sent through it, and will do so without any sort of restrictions. Employing ACLs
48
Information Security
is a method of enforcing your security policy with regard to what sorts of access
you allow the outside world to have to your internal network and vice versa.
Router
A special purpose computer for connecting networks together. Routers also
handle certain functions, such as routing, or managing the traffic on the
networks they connect.
Proxy
This is the process of having one host act on behalf of another. A host that has
the ability to fetch documents from the Internet might be configured as a proxy
server and host on the intranet might be configured to be proxy clients. In this
situation, when a host on the intranet wishes to fetch any web page, for example,
the browser will make a connection to the proxy server, and request the given
<http://www.interhack.net/>. The proxy server will fetch the document, and
return the result to the client. In this way, all hosts on the intranet are able to
access resources on the Internet without having the ability to direct talk to the
Internet.
b) Password Mechanisms
49
Passwords are a way to identify and authenticate users as they access the Network Security and
computer system. Unfortunately, there are a number of ways in which a Authentication
password can be compromised. For Example, someone wanting to gain access
can listen for a username and a password and then can access to the network.
Here are few mechanisms to protect your password.
50
Information Security
The goal in developing an official site policy on computer security is to define
the organization's expectations for proper computer and network use and to
define procedures to prevent and respond to security incidents. In order to do
this, specific aspects of the organization must be considered and agreed upon by
the policymaking group. For example, a military base may have very different
security concerns from those of a university. Even departments within the same
organization will have different requirements.
It is important to consider who will make the network site security policy.
Policy creation must be a joint effort by a representative group of decision
makers, technical personnel, and daytoday users from different levels within
the organization. Decisionmakers must have the power to enforce the policy;
technical personnel will advise on the ramifications of the policy; and dayto
day users will have a say in how usable the policy is. A site security policy that
is unusable, unimplementable, or unenforceable is worthless.
Developing a security policy comprises identifying the organizational assets,
identifying the threats, assessing the risk, implementing the tools and
technologies available to meet the risks, and developing a usage policy. In
addition, an auditing procedure must be created that reviews network and server
usage on a timely basis. A response should be in place before any violation or
breakdown occurs as well. Finally, the policy should be communicated to
everyone who ever uses the computer network, whether employee or contractor,
and should be reviewed on a regular basis.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
2) What is firewall? Name the different types of firewall?
...........................................................................................................................................
...........................................................................................................................................
3) Explain the role of antivirus software package in network security?
...........................................................................................................................................
...........................................................................................................................................
4) Explain some few good password procedures for the security?
...........................................................................................................................................
...........................................................................................................................................
51
weren't built with moats only in the front, your network needs to be protected at all of Network Security and
its entry points. Authentication
There are some remote access systems which have the feature of a twopart procedure
to establish a connection. The first part is the remote user dialing into the system, and
providing the correct userid and password. The system will then drop the connection
and call the authenticated user back at a known telephone number. Once the remote
user's system answers that call, the connection is established, and the user is on the
network. This works well for folks working at home but can be problematic for users
wishing to dial in from hotel rooms and such when on business trips.
Other possibilities include onetime password schemes, where the user enters his user
id, and is presented with a “challenge,” a string of between six and eight numbers.
He/she types this challenge into a small device that he/she carries with him that looks
like a calculator. He/she then presses enter, and a “response” is displayed on the LCD
screen. The user types the response, and if all is correct, the login will proceed. These
are useful devices for solving the problem of good passwords, without requiring dial
back access. However, these have their own problems, as they require the user to carry
them, and they must be tracked, much like building and office keys.
No doubt many other schemes exist. Take a look at your options, and find out how
what the vendors have to offer will help you enforce your security policy effectively.
CryptoCapable Routers
A feature that is being built into some routers is the ability to use session encryption
between specified routers. Because traffic traveling across the Internet can be seen by
people in the middle who have the resources (and time) to snoop around, these are
advantageous for providing connectivity between two sites, such that there can be
secure routes.
The danger in doing this, of course, is that there is no privacy on this channel, and it's
difficult to provide the other office access to ``internal'' resources without providing
those resources to everyone on the Internet.
VPNs provide the ability for two offices to communicate with each other in such a
way that it looks like they're directly connected over a private leased line. The session
between them, although going over the Internet, is private (because the link is
52
Information Security
encrypted), and the link is convenient, because each can see each others' internal
resources without showing them off to the entire world.
A number of firewall vendors are including the ability to build VPNs in their
offerings, either directly with their base product, or as an addon. If you have needed
to connect several offices together, this might very well be the best way to do it.
53
Network Security and
• Routers: Used to route traffic between physical networks. Many routers provide
Authentication
packet filtering using access control lists (ACLs). This can enhance network
security when configured properly. Routers can be configured to drop packets
for some services and also drop packets depending on the source and/or
destination address. Therefore routers can help raise the security between
different segments on a network and also help isolate the spread of viruses.
• Switches: A switch is used to regulate traffic at the data link layer of the OSI
network model. This is the layer which uses the Media Access Control (MAC)
address. It is used to connect several systems to the network and regulates
network traffic to reduce traffic on the network media. This can reduce
collisions.
• Media: The physical cable that carries the signal for the network traffic.
• Routers can be set up to perform packet filtering to enhance network security
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
2) What is VPN?
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
3) What is the purpose of using routers in networks?
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
4) Define Switches?
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
3.10 SUMMARY
54
Information Security
In this unit we have learnt the basics of network and its security. Computer network is
defined as system of interconnected computers linked by communication systems and
it can be both public and private where network security encompasses all the
activities that organizations, enterprises and institutions undertake to protect the value
and ongoing usability of assets and integrity and continuity of operations. In brief, we
can say the network security deals in identifying all the risks and vulnerabilities to
network and to select the best tools and practices to combat them.
To combat with above mentioned threats there are various kind of tools are available
in the market. These tools can protect the computer network at many levels. These
network tools are classified into different categories like antivirus software packages,
secure network infrastructure tools, dedicated network security hardware a software
tools, Virtual private network tools & identity services etc.
3.11 ANSWERS/SOLUTIONS
4) There are three security issues related to small and medium sized businesses
are:
• Worms and Viruses
• Information thefts
• Business availability
55
Network Security and
Check Your Progress 2
Authentication
1) The different kinds of tools to network security are:
• Antivirus software
• Encryption
• Security management
• Identity services
• Virtual Private Networks
• Secure network infrastructure
Firewall systems protect and facilitate your network at a number of levels. They
allow email and other applications, such as file transfer protocol (FTP) and
remote login as desired, to take place while otherwise limiting access to the
internal network. Firewall systems provide an authorization mechanism that
assures that only specified users or applications can gain access through the
firewall
The two types of firewall are:
• Software firewall
• Network firewall
56
Information Security
• Do not use a word contained in English or foreign language dictionaries,
spelling lists, or other lists of words.
• Do not use a password shorter than six characters.
• Do use a password with mixedcase alphabetic.
• Do use a password with nonalphabetic characters (digits or punctuation).
• Do use a password that is easy to remember, so you don’t have to write it
down.
2) VPN is a private network that uses a public network to connect remote sites or
users together.
3) Routers are used to route traffic between physical networks. Many routers
provide packet filtering using access control lists (ACLs). This can enhance
network security when configured properly. Routers can help raise the security
between different segments on a network and also help isolate the spread of
viruses.
4) A switch is used to regulate traffic at the data link layer of the OSI network
model. This is the layer which uses the Media Access Control (MAC) address. It
is used to connect several systems to the network and regulates network traffic
to reduce traffic on the network media. This can reduce collisions.
BLOCK GLOSSARY
57
Security: security in terms of data or information is the protection against accidental Network Security and
Authentication
or intentional destruction or modification of data.
DNS: DNS stands for Domain Name System. DNS maps a name to an IP address and
vice versa.
SNMP: SNMP stands for Simple Network Management Protocol. It is used to manage
and monitor network devices.
Hackers: a hacker is a person who breaks into computers, usually by gaining access to
administrative controls
Viruses: viruses are computer programs which are a collection of coded instructions.
LAN: LAN stands for Local Area Network. It connects computers and resources with
in a building or buildings closed to it.
Optical fiber: It is a type of guided media for the transmission of signals from source
to destination.
Bulletin Boards: is a computer system running software that allows users to connect
and login to the system using a terminal program. Once logged in, a user could
perform functions such as downloading or uploading software and data, reading news,
and exchanging messages with other users, either through electronic mail or in public
message boards.
Cipher text: This is the scrambled message produced as output. It depends on the
plaintext and the secret key.
Public and Private Key: there are the two keys used in encryption and decryption of
text. This is a pair of keys that have been selected so that if one is used for encryption,
the other is used for decryption
58
Information Security
Malware: acronym for malicious software.
VDU: VDU stands for Visual Display Unit. It is an output device to display the
information on screen.
Antivirus: antivirus programs are designed to detect and remove computer viruses.
CHKDSK: CHKDSK stands for Check Disk. It is an MSDos command to check the
status of disk.
Worm: worms are self replicating programs to infect and replicate without targeting
and infecting specific files already present on a computer.
Trojan horse: Trojan horse is a hidden piece of code that enters into a system by
deceiving a user.
Firewall: A firewall can isolate your computer network from any outside threats.
Rollback programs: rollback program is used to undo all the changes you made to
your hard disk and return your computer to its previous condition.
ACL: ACL stands for access control list. It is a list of permissions attached to an
object.
Proxy Server: a proxy server is a server that acts as a gobetween for requests from
clients seeking resources from other servers.
59
Network Security and
Authentication
Modems: Modem is an acronym for modulator demodulator. A modem is a
communication device that converts binary signal into analog signals for transmission
over telephone lines and converts these analog signals back into binary form at the
receiving end.
SSL: it stands for Secure Sockets Layer, are cryptographic protocols that provide
security and data integrity for communications over networks.
MAC address: MAC stands for a Media Access Control, it is a unique identifier
assigned to most network adapters or network interface cards by the manufacturer for
identification.
60