CIT-001: Fundamentals of Computer Systems

Page 1

Introduction to PC

UNIT 1 INTRODUCTION TO PC Structure

Page Nos.

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

After going through this unit, you will be able to:

describe the Main components of Personal Computer (PC);

discuss the role of CPU, CU and ALU;

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

define the various types of peripheral devices.

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. From the outside, a computer looks like:

System Unit Monitor Keyboard Mouse Figure 1: Computer System (or Desktop PC)

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 Figure 2: A System Unit ­ A Tower Case

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 General Register

Data

Instruction Register

Disks

Mnitor

Keyboard + Mouse

Memory Bus

Network Interface To network

Figure 3: A Computer System: An Architectural Point of View

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. Table1: Area of Applications of PC Fields EDUCATION

Uses 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 Every modern computer system consists of three basic sections: 7


Hardware and Software: An 1. Introduction

2.

3.

Input Device (i.e., Keyboard, mouse, scanner etc.) Processor (or CPU): • Control Unit (CU) • Arithmetic­Logic Unit (ALU) • Memory Unit Output Device (Visual Display Unit (Monitor/Screen), Printer etc.)

Memory (main)

Input Devices

Central Processing Unit Control Unit

Output­Devices

Arithmetic­Logic Unit

Figure 4: Block Diagram of a Computer

The basic parts of a computer are shown in Figure 4.

Input Devices such as Keyboard, Mouse or Scanner are used to enter input (data or/and instructions), directly into the computer.

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.

Processing of data is done in the arithmetic and logic unit (ALU). It performs Arithmetic and logic operations such as addition, subtraction, multiplication, and division. Here, the word “Logic” is used because a computer (unlike a calculator) has a capacity to do logical operations also, such as comparing two numbers etc. The function of a computer can be described as follows: • • • • 8

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


Introduction to PC

monitor/screen). Thus, a computer does mainly the following four functions: 1) Receiving Input : Accept information from outside through various input devices such as Keyboard, Mouse, etc. 2) Process Information : Perform arithmetic and logical operations on the information 3) Produce output : Communicate information to the outside world through output devices like monitor, printer etc. 4) Store information: Store the information in storage devices like, hard disk, pen drive etc. These four functions are responsible for everything that computers do. Components of a computer system are given in Figure 5.

(Auxiliary Storage Device­Floppy/Pen drive/CD­ROM)

CPU (Input Device) (Output Device)

(Primary Memory) Figure 5: Components of a Computer System

☞ Check Your Progress 1 1) State True/False against each of the following statements: a) The CPU resides inside a box known as the System unit. b) Every modern computer system consists of three basic sections­input devices, Processor (CPU) and Output devices. c) Hardware in the mechanical and electrical devices, which we can see and touch. d) ALU stands for Automatic Logic Unit. e) Peripheral devices allow people to interact with the CPU.

f) Primary memory is the part of the computer that executes program instructions.

9


Hardware and Software: An Introduction

g) The Control unit tells the rest of the computer system how to carry out a program’s instructions. 2) What are the five main components of a computer system? a)

CPU, CD­ROM, Mouse, Keyboard, Sound Card

b)

Memory, Video Card, Monitor, Software, Hardware

c)

Modem, Keyboard, Word Processor, Printer, Screen.

d)

CPU, Memory, System Bus, Input, Output

3) How do the main components of the computer communicate with each other?

a)

System bus

b)

Memory

c)

Keyboard

d)

Monitor

a)

4) The main functions of the computer are: Receive input and produce output

b)

Information processing c) Information storage d) All of the above. 5) The two main parts of the CPU are:

a) Control Unit & Memory b) Addresses & Register c) Addresses and ALU d) Control Unit & ALU

1.3 CENTRAL PROCESSING UNIT (CPU) 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 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.

Introduction to PC

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.

Central

Processin g

Unit

It is a Unit because it is a chip, which

consists of transistors It is called a processor because it does arithmetic and logical operation

It is central because it controls all activities of a system. A block diagram of a modern computer is shown in Figure 6: Control Unit Arithmetic Input Devices

& Logic Unit

Output Devices

Primary Storage

Secondary Storage

Communication Devices

Figure 6: A Block Diagram of a Basic Computer Organization.

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:

Control Unit (CU) ; and

Arithmetic­Logic Unit (ALU).

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.

1.3.1

Control Unit (CU)

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:

12

It manages and coordinates the entire computer system.

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).


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 Control Logic Unit

Fetch Unit Instruction Register Decode Unit

Program Counter

+1

Figure 7: Control Unit

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.

1.3.2

Arithmetic­Logic Unit (ALU)

The arithmetic Logic unit (ALU) of a computer system is the place where the actual execution takes place. •

All the Arithmetic calculations such as addition, subtraction, multiplication, and 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. 13


Hardware and Software: An Introduction

No processing is done in the primary storage unit (or memory).

Intermediate results generated in the ALU are temporarily transferred back to the primary storage unit until needed at later time.

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).

The accumulator is used to accumulate results. It is the place where the answers of many operation are stored temporarily before being sent to the computer's memory (see Figure 6). Only the final result is transmitted to the memory unit for storage.

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).

CENTRAL PROCESSING UNIT CONTROL UNIT ADD INSTRUCTION Step 1 Move instruction to the control unit

Memory Locations

Numbers 1(n1) Let R = n1+n2 Numbers 2(n2) Result R

MEMORY UNIT

Step 2 The two numbers are brought from memory and placed in the ALU

Step 3 The control unit signals the ALU perform “addition operation” on the two numbers and to store the result in the accumulator NUMBER 1

+ NUMBER 2

RESULT

14

Step 4 (ACCUMULATOR) Send result in memory ARITHMETIC AND LOGIC UNIT

(ALU)

Figure 8: CPU Operation to find data and instructions (Adding two numbers)


Introduction to PC

1.4 TYPES OF MAIN MEMORY 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.

it basically stores the necessary programs of system software, which are required to execute the user’s program.

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): 1. RAM (Random Access Memory) 2. ROM (Read Only Memory)

Figure 9: Main Memory : ROM (Non­volatile) and RAM (Volatile)

1.4.1 •

Random Access Memory (RAM) 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 Introduction

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 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.

Figure 10: RAM Chip (size 128 MB)

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.

1.4.2

16

Read Only Memory (ROM)

A Read­Only memory (RAM) is one in which information is permanently stored. Computer almost always contains a small amount of Read­Only Memory (RAM).

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).


Introduction to PC

CPU

RAM

ROM Figure 11: Relationship between the CPU and main memory (RAM and ROM).

1.4.3

Programmable Read Only Memory (PROM)

A variation of ROM chip is programmable read only memory (PROM). A PROM is a memory chip on which data can be written only once.

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, 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 non­volatile memory i.e., the stored information remains even if power is switched off.

The basic difference between PROM and a ROM is that a PROM is manufactured as blank memory, whereas a ROM is programmed during the manufacturing process. To write data on a PROM chip, you need a special device called a PROM programmer or a PROM burner. The process of programming a PROM is sometimes called burning the PROM.

1.4.4

Erasable Programmable Read Only Memory (EPROM)

Once the information is stored in a ROM chip or a PROM chip, it cannot be changed. However, there is another type of memory chip called erasable programmable read­only memory (EPROM) that overcomes this problem.

As the name implies, it is possible to erase information stored in an EPROM chip and the chip can be reprogrammed to store new information by using a special device called a PROM programmer or a PROM burner.

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 Introduction

change the contents of the PROM before the computer is actually delivered. This means that bugs can be removed and new versions installed shortly before delivery.

☞ Check Your Progress 2 1) State True/False against each of the following statements: a) Computer can communicate with other computers and can receive and send data in various forms like text, sound, video, graphics etc. b) A digital computer operates on Hexadecimal digits 0,1,….9,A,B,…,F. 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.

e) The process of reading an instruction is often referred to as the fetch­ execute process. f) ALU is not a part of the CPU. g) ALU can do only arithmetic & logical operations.

h) ALU can perform performs logical tests only for integers operands only. i) The accumulator is the place where the answers from many operations are stored temporarily before being put out to the computer's memory. j)

Primary memory is directly communicated with the CPU.

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.

2) Multiple Choices Questions i)

18

The different types of memory units are:

a)

RAM

b)

ROM

c)

PROM

d)

All of the above


Introduction to PC

ii) Which of the following memory loses it contents when the computer turned off? a) RAM b) ROM c) PROM d) All of the above iii) Which of the following memory chip is programmed during the manufacturing process? a) RAM b) ROM c) PROM d) EEPROM iv) EEPROM can be it erased by exposing to: a) Sunlight b) Ultraviolet Radiation c) Magnetic field d) Electric Charge 3) What is a CPU and explain how it works? ……………………………………………..……………………….. ……………………………………………………………………………………… …………………………………………………………….. ……………………………………….. 4) Sketch a block diagram on a computer system and explain the function of various parts of a computer system. ……………………………………………..……………………….. ……………………………………………………………………………………… …………………………………………………………….. ………………………………………..

5) What are the main functions of Control­unit (CU) and Arithmetic/Logic unit (ALU)? ……………………………………………..…………………………. ……………………………………………………………………………………… 19


Hardware and Software: An Introduction

…………………………………………………………….. ……………………………………..

1.5 SECONDARY (AUXILIARY) MEMORY DEVICES 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). Secondary memory is also known as auxiliary memory or secondary storage. This is a Non­volatile type memory; it means the stored data and programs do not get lost, even after the computer is switched off. Unlike RAM which looses the contents when the computer is turned off, and ROM, to which it is not possible to add anything new, the auxiliary storage devices allows the computer to record information semi­permanently, so it can be used later by the same computer or another computer. Auxiliary storage devices are also useful in transferring data and programs from one computer to another computer. They can also be used as a back­up storage, which allows back up the valuable information that you are working on. So even if by some accident if your computer crashes and the data in it is unrecoverable, you can restore it from back­ups. The most important auxiliary storage devices are Hard Disk, Floppy Disk, CD­ROMs, DVD, magnetic tapes, magnetic disks etc. •

Floppy Disk  Portable. Usually the A drive on your computer. Portable disks means that you can carry with you or can be remove them from disk drive A. A standard floppy disk can hold 1.44 MB of data. Slower to access then hard­disks and has less storage capacity, but they are less expensive and portable. •

Hard Disk/Hard Drive Non­Portable. The hard drive is the primary device that a computer uses to store information.

 In most of the computers partitioning of hard drive is done and each portion is given a separate drive name. For example a 80GB Hard Disk may be partitioned into four drives C, D, E and G each of 20 GB.  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 disk drive.

Introduction to PC

 The size of a Hard Drive is measured in Gigabytes. A 20+ GB hard drive is common for new computers, and the larger the hard drive, the more programs you can store on your computer.

 A Hard Disk/Hard Drive is shown in Figure 12. R/W Head

Platter

Figure 12: Hard Disk

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: Magnetic tape is a magnetically coated strip of plastic on which data can be encoded. Tapes for computers are very similar to the tapes used to store the music. Storing data on tapes is considerably cheaper than storing data on disks. Tapes also have larger storage capacities, ranging from a few hundred kilobytes to gigabytes. Magnetic tapes are used for taking backup of the large date from computer system. The table on next page summarizes the different types of secondary (auxiliary) memory devices:

21


Hardware and Software: An Introduction

Medium

Capacity

Advantages

Disadvantages

Hard Disk

Variable

• Usually integrated into the PC • Slower computer performance when disk • very robust is full

Floppy Disks

1.44 MB

Portable disk. • Very small storage Useful for booting older PC’s capacity • Some older applications • Easily damaged only save to A drives • Medium for propagation of viruses

• For transferring small files between computers

CD­ROM/ CD­R/ CD­

650­700 MB

• Portable & Medium storage capacity Inexpensive • Some types (CD­RW) can be reused i.e. rewritable disk. • Can be used in certain models of DVD player

Some older computers cannot read CD­RW media • CD­R discs are ‘write once’, which means once data is copied to it, new or additional data cannot be added

Magnetic Tape

20 GB to 2 TB

• Very large storage capacity • Disks are durable, robust and rewritable • Inexpensive

To store data and files • To store software

Storage mechani sm Magnetic

Magnetic

To store files and Optical software • To store archive material from hard disks • To store scanned files such as exam papers • To store applications from the Internet

Data cannot be • To store accessed immediately files • Required tape • Ide drive and third party al for large software scale daily • Tape drives for and weekly backup large capacity tapes can be very expensive operations particularly for servers.

Table 2: Comparison of different storage devices:

22

Primary Uses

Magnetic


Introduction to PC

DVD­ROM DVD±R DVD±RW

4.7GB to 8.5GB

Large storage capacity • Some types (DVD±RW) can be reused or rewritable. • Can be used in certain models of DVD player.

• Not all computers can read DVD±R or DVD±RW disks. • DVD±R discs are ‘write once’, which means once data is copied to it, new or additional data cannot be added

Same as CD­ROM/ CD­R/CD­ RW

Optical

23


Hardware and Software: An Introduction

1.6 INPUT­OUTPUT DEVICES 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. Table 3: Categories of Input Devices Category Keying device Pointing Devices

Pen based computing Speech recognizers Optical character Recognizer Other devices

Device Name Keyboard Punch card reader Mouse Joystick Touch Screen Light Pen

Optical scanner Bar Code Reader Magnetic Ink Character Recognition (MICR) Digital Camera Web cam Smart Cards Telephone

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.

1.7 PERIPHERAL DEVICES 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 Introduction

The Table 4 shows internal and external devices of any computer system. Internal Devices

Motherboard

CPU, RAM, cache, ROM circuits containing the BIOS and startup programs. Chipsets (controllers). Ports, busses and slots. EIDE interface, USB, AGP, etc.

Drives

Hard disk(s), diskette drive, CD­ROM, DVD, etc.

External Devices

Plug­in cards Graphics card (video adapter), network card, SCSI controller. Sound card, video and TV card. Modem and ISDN card.

Keyboard Mouse Joystick Screen Printer Scanner Speakers External drives Tape drive MIDI units Modem Digital camera

☞ Check Your Progress 3 1) State True/False against each of the following statements: a) Primary memory is directly communicated with the CPU. b) When we load software from floppy disk, hard disk or CD­ROM, it is stored in the main memory.

c) Auxiliary memory is long term and non­volatile memory. d) Hard­disks hold more data and are faster than floppy disks. e) CD­R drive is short for compact disk recordable drive. f) All color computer monitors are also known as RGB monitors 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)

VGA uses analog signals rather than digital signals.

j)

CD ROMs are capable of storing up to 650 MB of data which is equivalent to 450 floppy disk (each having 1.44 MB capacity).

2) Multiple choice questions: a) Which of the following is an input device? 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 ii) Output device iii) Both Input & Output iv) None on these

c) Which of the following is slowest in accessing data? i) Zip disk ii) Hard­disk iii) Floppy disk iv) Magnetic tape d) Which of the following is generally used for back­ups? i) CD­ROM ii) Hard­Disk iii) Floppy disk iv) Magnetic tapes e) Which technology is used in the evaluation of aptitude test? i) OCR ii) OMR iii) MICR iv) MCR f) An input device that is used widely in supermarkets is i) Keyboard ii) Mouse iii) Trackball 27


Hardware and Software: An Introduction

iv) Bar code reader g) The refresh rate of a monitor is measured in terms of i) Pixel ii) Resolution iii) Bits iv) Hertz 3) Differentiate between memory & storage.

…………………………………………………………………………………… …………………………………………………………………………………… …………………………………………………………………………………… 4) What are the input and output devices? ……….. …………………………………………………………………………………… …………………………………………………………………………………… …………………………………………………………………..…… 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. •

Every Computer has the general structure shown in Figure 13:

INPUT

CPU

MAIN Memory

OUTPUT

EXTERNAL Memory

Figure 13: System Bus

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.

A computer consists of a Central Processing Unit (CPU), memory and various devices which can be categorized as Input/Output Devices. Information is communicated between these separate units by the Systems Bus.

The Central Processing Unit (CPU) performs the actual processing of data. The data it processes is obtained, via the system bus, from the main memory. Results from the CPU are then sent back to main memory via the system bus.

In addition to computation the CPU controls and co­ordinates the operation of the other major components. The CPU has two main components, namely: Control Unit (CU) and an Arithmetic/Logic Unit (ALU).

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 Arithmetic/Logical Unit (ALU): carries out arithmetic operations on integer (whole number) and real (with a decimal point) operands. It can also perform simple logical tests for equality and greater than and less than between operand.

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.

The basic difference between PROM and a ROM is that a PROM is manufactured as blank memory, whereas a ROM is programmed during the manufacturing process.

Once the information is stored in a ROM chip or a PROM chip it cannot be changed. However, there is another type of memory chip called Erasable Programmable Read­Only Memory (EPROM) that overcomes this problem.

Secondary memory (Auxiliary memory) provides a place where data can be permanently stored and transferred to and from main memory (RAM). Such as Hard Disk, Floppy Disk, Pen Drive, CD­ROM, DVD, Zip­Drive, magnetic tape.

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 Check Your Progress 1 30


Introduction to PC

1) a) T b) T c) T d) F f) T g) T h) T 2) d 3) a 4) d 5) d

Check Your Progress 2 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. The Arithmetic­Logic­Unit (ALU) of a computer system is the place where the Central Processing Unit actual execution of the program instructions takes place during the processing operation. 4) The Figure 14 shows the block diagram of a computer system:

Memory (main)

31


Hardware and Software: An Introduction

Input Devices

Control Unit

Output­Devices

Arithmetic­ Logic Unit Figure 14: Block Diagram of a Computer

The function of a computer can be described as follows: •

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).

5) The control unit (CU) basically does the following things: •

It manages and coordinates the entire computer system.

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 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.

Introduction to PC

• No processing is done in the primary storage unit (or memory). •

Intermediate results generated in the ALU are temporarily transferred back to the primary storage unit until needed at later time.

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).

The accumulator is used to accumulate results. It is the place where the answers from many operations are stored temporarily before being put out to the computer's memory. Only the final result is transmitted to the memory unit for storage.

Check Your Progress 2 1) a) T b) T c) T d) T e) T f) T g) T h) F i) F j) T 2) a(i), b(iii), c(iv), d(iv), e(ii), f(iv), g(iv). 3) Memory is volatile and costly. Storage is slower and less costly. 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 Introduction

data in similar way. Hard­disks have multiple platters. 7) CD­ROMs drives are standard equipment today. CD­R is read­only. CD­RW is readable & writable both. DVD­ROMs offer more storage capacity than CD­ROMs.

1.10 FURTHER READINGS AND REFERENCES 1. P. K. Sinha, Computer Fundamentals, BPB Publication, New Delhi 2007. 2. P. Sudharsan & J. Jeyabalan, Computers­systems and applications, JAICO

Publishing House, Mumbai, 2005. 3. V.Rajaraman, Fundamentals of Computers, PHI Publication, New Delhi 2008. 4. T.N. Srivastava, An Introduction to Computers & their Application to Banking, Macmillan, Macmillan India Limited, 2000.

Web Links: •

34

www.en.wikipedia.org


Hardware and Software: An Introduction

UNIT 2 STORAGE ORGANISATION Structure

Page Nos.

2.0 Introduction 2.1 Objectives 2.2 Memory and Storage Devices 2.2.1 2.2.2 2.2.3

2.3 2.4 2.5 2.6

32 32 33

Semiconductor (Main) Memory Magnetic Memory Optical Memory

Memory Hierarchy Summary Solutions/Answers Further Readings and References

50 53 53 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 & cost­per­bit of storage. In this unit detailed discussion will be on storage devices and their organization. In this unit, we will concentrate on storage organization of the different types of memory devices such as RAM, ROM, Hard­disk, Floppy disk, Magnetic disk, Magnetic Taps, CD­ROM, and DVD etc. RAM, ROM comes under semiconductor memory, Hard­disk, Floppy disk, and Magnetic tapes come under magnetic memory and CD­ROM, DVD etc comes under Optical memory.

2.1 OBJECTIVES After going through this unit, you should be able to:

describe the key characteristics of the memory system;

distinguish among various types of memories such as semiconductor, magnetic & optical memory;

describe the various secondary storage devices such as Hard-disk, floppy disk, CD-ROM, DVD-ROM etc.; and

• 32

describe the importance of memory hierarchy.


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: •

Primary or main memory (also called semiconductor memory)

Secondary or auxiliary memory (magnetic memory/Optical memory). 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 Figure­1). 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.

CPU

Cache Memory

Main Memory

Figure 1: Memory Organization

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. 33

The main functions of the memory are:


)

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. CD­ROM can be used as an optical storage device. 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. Removable disk, tape cartridges are other forms of secondary storage devices are used for back­up 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. Hard­disk 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. The most common memory hierarchy is shown in Figure 2:

Cache Memory

CPU

Primary Memory

Secondary Memory

Figure 2: Memory Hierarchy

Now let us start with the memory organization of primary storage. A primary or internal storage section is basic to all computers. Storage locations and addresses A memory is made up of a large number of cells, with each cell capable of storing one bit. The cells may be organized as a set of addressable words (or locations). Each of these words (or locations) can store a fixed number of bits called word length of that particular primary storage. For example a given memory is divided into N words, where N is some power of 2. Thus each word or location has a unique number, called the address of that location. This unique number is used to identify that particular location. Each location can store either a data item or an instruction and its address remains the same regardless of its contents. The address range is generally denoted as 0….(N­1), where 0 is the start address and (N­1) is the highest address. For example if a memory has 512 locations, then the address ranges between 0 to 511. Thus, at address 0 we find a first word, at address 1 a second word, at address 2 a third word, and so on up to the final words at the highest address. This type of memory organization is known as a Random Access Memory (RAM). 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. Access speed increases Primary storage Main Primary Storage Capacity decreases Memory Magnetic Disks Cost per bit increases Secondary Magnetic Tapes storage 35


Storage Organization

Optical Disks Figure 3: Storage Media Cost, Speed and Capacity Trade­offs

You can note down the following points from the Figure­3:

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 magnetic and optical memories are slow compared to semiconductor memory. But they are cheaper than semiconductor memory. They are not static devices. They are either in the form of a rotating disk or tape. All computers contain both semiconductor as well as magnetic memory.

The examples of magnetic memory are hard­disk, 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 CD­ROM (Compact Disk Read­Only 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 15­20 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 DVD­ROM (Digital Versatile Disk Read­Only 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. Table 1: Some Memory Technologies Technology

Semiconductor Memories Magnetic Memories Optical Memories

Nature of storage medium Electronic Magnetic Optical (laser beam)

Access Mode

Volatile/ Nonvolatile

Average cost (Rs/bit)

Volatile

Access Time (in sec) 10­8

Random (or Direct) Sequential/Rand om Random

Non­volatile

10­1

10­6

Non­volatile

1

10­7

10­2

There are two basic methods of accessing information from various memory devices: Sequential or serial access or Direct or Random access 36


Hardware and Software: An Introduction

A sequential­access 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

Figure 5: Sequential Vs. Direct Access Storage Device.

Basic Storage fundamental: Data are processed and stored in a computer system through the presence or absence of electronic or magnetic signals. This is called a “two­state” or Binary representation of data, this is because of transistor and other semiconductor circuits are either in conducting and non­conducting 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 non­conducting (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


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 8­bits 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.

Storage Organization

☞ Check Your Progress 1 1) State True or False for the followings: a) Semiconductor memory is random access memory b)

Secondary memory is slower than main memory but that has a larger capacity.

c)

Primary memory is mainly used for bulk storage. d) Optical memory is slower than semiconductor memory.

d)

In sequential access memory any memory location can be accessed directly. 2) Differentiate between the following: a) Sequential Vs. Random access memory. ……………………………………………..……………………….. ……………………………………………………………………………………… …………………………………………………………….. ………………………………………..

b) Primary Vs. secondary storage ……………………………………………..……………………….. ……………………………………………………………………………………… …………………………………………………………………….. ……………………………….. 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 non­numeric 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). The capacity of a computer’s memory is usually expressed in term of bytes. Coding system 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 (symbols) used in computer system. Storage capacities are frequently measured in Kilobytes (KB), Megabytes (MB), Gigabytes (GB), or Terabytes (TB). Table­2 summarizes the commonly used names with Abbreviations and number of bytes for these storage capacities.

Table 2: Commonly used names, Abbreviations and storage capacity in bytes Name (Abbreviations) Byte (B) Kilobytes (KB) Megabytes (MB) Gigabytes (GB) Terabytes (TB)

Number of Bytes 1 1024 1024*1024 (about one million) 1024*1024*1024 1024*1024*1024*1024

Types of Main Memory Memory can be of various types like Random Access Memory (RAM) and Read­Only Memory (ROM). The following chart summarizes the different types of main memory.

Main Memory

RAM

39

DRAM

SDRAM

ROM

PROM

EPROM


Figure 6: Types of Memory

Storage Organization

RAM (Random Access 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 flip­flop 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

Dual­Ported 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 single­Inline 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 (Read Only Memory)

A Read­Only memory (ROM) is a non­volatile memory, i.e., the information stored in it is not lost even if the power supply goes off. Thus, a Read Only Memory (ROM) is one in which information is permanently stored.

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. Computer almost always contains a small amount of Read­Only memory (ROM). It is much cheaper compared to RAMs when produced in large volumes.

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.

From programming mode point of view, we have •

Masked­programmed

User­programmed

ROMs in which contents are written at the time of IC manufacture are called mask­programmed ROMs. PROM, EPROM and EEPROM or any other kind of PROM are user programmable ROMs. If we simply write (or say) ROM it means masked programmed ROMs are called PROM, EROM and EEROM etc. •

An example of ROM is Toshiba mask ROM, TCS 534000.

PROM (Programmable ROM)

41

A variation of ROM chip is programmable read only memory (PROM). A PROM is a memory chip on which data can be written only once.

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, it is possible for a user to customize a system by storing own program in a PROM chip.

• • •

Storage Organization

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 non­volatile memory i.e., the stored information remains even if power is switched off. The basic difference between PROM and a ROM is that a PROM is manufactured as blank memory, whereas a ROM is programmed during the manufacturing process. To write data on a PROM chip, you need a special device called a PROM programmer or a PROM burner. The process of programming a PROM is sometimes called burning the PROM. Earlier most of the electronic typewriter had a PROM chip. Table 3: Different category of Memory Memory RAM ROM PROM EPROM EEPROM

2.2.2

Category Read­write memory Read­only memory Read­only memory Read­only memory Read­only memory

Volatility Volatile Non­volatile Non­volatile Non­volatile Non­volatile

Writing Mechanism Electrically Mask Electrically Electrically Electrically

Erasure Electrically Not­possible Not­possible Using UV light Electrically

Magnetic Memory

In the previous sub­section, 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.

Thus, there is a need of an additional memory, which should be inexpensive, non­ volatile in nature and having large capacity. Magnetic material is inexpensive and quite long lasting material, so it is an ideal choice for us. Magnetic memory is a permanent non­volatile memory. Any modern computer uses the following two types of magnetic memory: Magnetic Disks: Hard disks & Floppy disks.

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 10­100). 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 4­50kbytes.

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. Magnetic disks are semi­random devices. A track on a disk is selected in a random fashion, but data is written to or read from a sector in a serial fashion.

2.2.2.1 Hard­disk drives (HDD) • Hard disks are on­line storage device. The term online means that the device (hard­disk) is permanently connected to the computer system and when the computer is on, the device (hard­disk) is available to store information or to give information.

43

• HDD stores programs, data, operating system, compiler, Assemblers, application programs etc.


Storage Organization

Storage organization in HDD:

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 well­known 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.

Thus, Winchester disk is a sealed “hard disk” having rotation speed typically 7200 rpm. Disk is having 5000 to 10000 concentric tracks per centimeter and about 100000 bits per centimeter around circumference. The Figure 8 illustrates a portion of Winchester disk.

Figure 8: Winchester disk­ a portion of disk track

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. Hard­disks together with read/write heads, access mechanism and driving motor constitute a unit called hard­disk­drive (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.

To increase the storage capacity several hard­disks (platters) are mounted (stacked) vertically, normally at a distance of an inch. This is known as disk pack or multi­platter configuration.

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)

2 ∙ ∙ ∙ n

Surface (2n­1)

Figure 9: A disk having n platters (0 to n­1 plates). A set of corresponding tracks on all the (n­1) Surfaces, at a given radial distance, is called a cylinder

Capacity, density and speed Suppose a HDD (or disk pack) having n plates, has: then total number of recording surfaces m=2*n and t= tracks per surface p= sector per tracks s=bytes per sectors, π =3.14 then  Storage capacity of disk=(m*t*p*s) bytes  If d is the diameter of the disk, Then the density of the recording is: Density=(s*p)/(π*d) byte/inch. 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. Drive number 3­bits

Cylinder number 13 bits

Surface number 4 bits

Sector number 8­bits

Access time on magnetic disk Magnetic disks are semi­random devices. A track on a disk is selected in random fashion, but data is written to or read from a sector in serial fashion. In order to access information from a disk, the disk address of the desired data has to be specified. The disk address is specified in terms of track number, surface number and the sector number. Information is always written from the beginning of a sector and can be read only from the tracks beginning of track. 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 movable­head system. For a fixed­head 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.

Access time= Seek time + Latency time The average access time for most disk systems is usually between 10 to 100 milliseconds. 2.2.2.2 Floppy Disks 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:

3.5 inches, and

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 150­250 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. 2.2.2.3 Magnetic Tapes 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 hard­disks 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.

☞ Check Your Progress 2

47

1) State True or False for the following statements:


Storage Organization

a) One Gigabytes (GB) equal to 220 KB. b) Magnetic disk having higher storage capacity than Magnetic tapes. c) Tracks with the same diameter on the various surfaces are known as a cylinder. d) Time required to bring the needed data under R/W head is known as seek time. 2) Explain the volatile and non­volatile type memory. Differentiate the volatile and non­volatile 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:

1) Semiconductor memory

a) Hard­disk

2) Magnetic memory

b) CD­ROM

3) Optical memory

c) Floppy disk

4) Double side double density

d) RAM

2.2.3

Optical Memories

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: 1) CD­ROM (Compact­Disk Read Only Memory) 2) WORM (Write Once Read many) or CD­R (CD­Recordable). 3) Erasable Optical Disk 48


Hardware and Software: An Introduction

4) DVD­ROM, DVD­R and DVD­RAM 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. CD­ROM CD­ROM technology uses 12­centimeter (4.7­inch) 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 double­spaced 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 CD­ROM 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. CD­ROMs use long spiral tracks to store data serially, as shown in Figure­10. The track is divided into the blocks of same size as shown in the figure. A CD­ROM 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.

Sector of equal length

Figure 10: A CD­ROM disk layout Advantages

49

High storing capacity.

Mass copy of information stored, which is very cheaper.


Removable disk from the computer, so suitable for archival storage. 5.25 inch disks store 650 MB data.

Storage Organization

Disadvantages •

Longer access time as compared to that of a magnetic hard disk (because locating a desired address involve first moving the head to the specific area then adjusting the rotating speed and then reading the address, and then to find and access the specific sector).

Information can not be updated because it is a read­only (permanent) memory.

WORM or CD­R (CD­Recordable) CD­R (compact­disk recordable) is another optical disk technology. The user can record (write) their own data once on a CD with CD­R disk drive unit. After this recording user can read these data as many times as desired. CD­R is suitable for data and files which are not to be changed. The user can store permanent data, information, and files for maintaining records. CD­R should be used because of: •

High storing capacity.

Better reliability and long life.

Greater access time as compared to hard­disk.

Erasable Optical disk or CD­RW (CD­rewritable) The major limitation of CD­ROM and CD­R disks is that recorded data can not be erased. However, CD­RW (CD­rewritable) 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. CD­RW 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 hard­disk.

DVD­ROM, DVD­R and DVD­RAM DVD stands for Digital Video Disks or Digital Versatile Disks. DVD stores much more data than CD­ROM. 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 CD­ROM uses and therefore more tracks are used. Working principles of DVD disks are same as CD­ROM, CD­R and CD­RW. The Speed of CD­ROM or DVD­ROM 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. DVD­R: It is a recordable DVD, same as CD­R disk. The user can write data once on a DVD­R, then read the data as many times as required. 50


Hardware and Software: An Introduction

DVD­RAM: It is a rewritable DVD, same as CD­RW disk. DVD­RAM 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 Medium

Capacity

Advantages

Hard Disk

Variable

Usually integrated into the PC • very robust

Floppy Disks

51

1.44 MB

Portable disk. Useful for booting older PC’s • Some older applications only save to A drives

Disadvantages

Primary Uses

• Slower computer performanc e when disk is full

To store data and files • To store software

Very small storage capacity • Easily damaged • Medium for propagation of viruses

• For transferring small files between computers

Storage mechanism Magnetic

Magnetic


Storage Organization

2.3 MEMORY HIERARCHY In the previous section, we have discussed the various types of memory systems such as semiconductor (main) memory, magnetic memory and optical memory. In this section, we will discuss the hierarchy of these memory systems.

CD­ROM/ CD­R/CD­ RW

650­700 MB

Portable & Medium storage capacity • Inexpensive • Some types (CD­ RW) can be reused i.e. rewritable disk. • Can be used in certain models of DVD player

Some older computers cannot read CD­RW media • CD­R discs are ‘write once’, which means once data is copied to it, new or additional data cannot be added

To store files and software • To store archive material from hard disks • To store scanned files such as exam papers • To store applications from the Internet

DVD­ROM DVD±R DVD±RW

4.7GB to 8.5GB

• Large storage capacity • Some types (DVD±RW) can be reused or rewritable. • Can be used in certain models of DVD player.

• Not all computers can read DVD±R or DVD±RW disks. • DVD±R discs are ‘write once’, which means once data is copied to it, new or additional data cannot be added

Same as.. CD­ROM/ CD­R/CD­RW

As you have seen in the previous section, faster memory technology (such as 20GB to • Very Large • Data cannot be Magnetic semiconductor memory) is 2TB + storage capacity accessed tape more expensive. In addition • Disks are immediately fast memory requires power durable, robust • Requires tape drive and rewriteable and third party supply till the information • Inexpensive software needs to be stored. • Tape drives for Furthermore, the memory large capacity tapes can be very with less cost (such as expensive Optical memory) have very high access time, that is the time taken by CPU to access the memory location is high, which result in a slower operation and less utilization of CPU. Thus the cost versus access time leads to a memory hierarchy.

To store files • Ideal for large scale daily and weekly backup operations, particularly for servers.

Optical

Optical

Magnetic

The overall goal of Memory Hierarchy is to obtain the highest possible access speed while minimizing the total cost of the memory system. Figure­12 illustrates the components of a typical memory system.

Main Memory

I/O Processor

Cache Memory

CPU

Magnetic Tape

Magnetic disk

52


Hardware and Software: An Introduction Figure 12: Components of memory system

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 cost­per­bit 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.

1) Processor’s internal (CPU) memories: consisting of the small set of high speed registers which are internal to a processor and are used as temporary locations where actual processing is done.

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.

A typical storage hierarchy is shown in Figure­13. Register

Cache memory Faster­ access time Larger capacity & Main memory Lower cost per bit stored

Magnetic disk

Magnetic Tape

Figure 13: The Memory hierarchy

A block diagram of storage hierarchy, as shown in Figure­13 includes:

53

CPU (register)

Cache memory


Storage Organization

Main memory Secondary storage & Mass storage As we move up the storage hierarchy, we encounter memory elements having faster access time, less capacity and higher cost per bit stored. When we move down, we have a larger storage capacity, slower access time and lower cost per bit stored. Thus, CPU storage components generally have the fastest access time, the smallest storage capacity and the highest cost per bit stored. The cache memory which is placed in between the CPU and the main memory is a very high speed semiconductor memory used to enhance the speed of main memory. The main (primary) memory falls next in the memory hierarchy list. Secondary storage media such as hard­disk/magnetic disk memories make up the level of hierarchy just below the main memory. Secondary storage devices are at the bottom of the memory hierarchy. Secondary storage devices such as magnetic tapes are used for backup/archival storage. These are very cost effective so used for mass storage of data, when fast access time is not required.

☞ Check Your Progress 3 1) State True or False for the following statements: a) The main draw back of the optical disk system 0 is its slow average access time. b) CD­ROM has longer access time as compared to that of a magnetic hard disk.

c) In CD­R data can be written once and read indefinitely.

3) Explain the need of memory hierarchy. ……………………………………………..……………………….. ……………………………………………………………………………………… …………………………………………………………………….. ……………………………….. 4) Match the following:

1) CD­ROM

a) Write once read many times

2) CD­R

b) Read and write indefinitely

3) CD­RW

c) Read only

4) DVD­ROM

d) Write once, read indefinitely & having capacity up to 20GB

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 & cost­per­ 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, non­volatile in nature and having large capacity. Magnetic (secondary) memory is a permanent non­volatile, type memory. In this unit we have discussed the two types of magnetic memory namely magnetic disks (i.e., hard­disk 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

Check Your Progress 1 1) (a) True (b) False (c) False (d) True (e) False 2) (a) A sequential­access memory is organized by arranging memory cells in a linear sequence. They do not have unique storage address that can be directly addressed. 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. 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. 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


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. (b)

Table 5: Differences between Primary Memory and Secondary Memory Primary (semiconductor) memory

(c)

Storage Organization

Secondary 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.

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.

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 CPU. The size of the main memory is kept small because of its high cost.

It basically stores system software, compiler, assembler and useful packages, large data files etc.

The following Figure­14 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.

Access speed increases Primary storage Semiconductor Storage Capacity decreases Memory Magnetic Disks Cost per bit increases Secondary storage Magnetic Tapes Optical Disks

Figure 13: Storage media cost, Speed and capacity trade­offs

Check Your Progress 2 1) (a) True (b) False (c) True (d) False 2) (a) Volatile memory means the stored data are lost, if the power goes off.. For example RAM is a volatile memory. A non­volatile memory means the information stored in it is not lost even if the power supply goes off. A Read­Only memory (ROM) 56


Hardware and Software: An Introduction

is a non­volatile memory.

Table 6: Types of Memory Memory

Category

Volatility

Writing Mechanism

Erasure

RAM ROM

Read­write memory Read­only memory

Electrically Mask

Electrically Not­possible

PROM

Read­only memory

Electrically

Not­possible

EPROM

Read­only memory

Electrically

Using UV light

EEPROM

Read­only memory

Volatile Non­ volatile Non­ volatile Non­ volatile Non­ volatile

Electrically

Electrically

3) disk capacity= 12x5268x256x512=7.716 GB and

Recoding density=(512x256)/(3.14x2.5)=16688 bytes/inch. 4) 1­(d), 2­(a), 3­(b), 4­(c)

Check Your Progress 3 1) True (b) True (c) True 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. 3) 1­(c), 2­(a), 3­(b), 4­(d)

2.6

FURTHER READING AND REFERENCES

1. P. K. Sinha, Computer Fundamentals, BPB publication, New Delhi, 2007. 2. P. Sudharsan & J. Jeyabalan, Computers­systems and applications, JAICO

Publishing House, Mumbai, 2005. 3. V.Rajaraman, Fundamentals of Computers, PHI Publication, New Delhi 2008. 4. T.N. Srivastava, An introduction to computers& their application to banking, Macmillan, Macmillan India limited, New Delhi, 2000.

Reference Websites: •

57

www.en.wikipedia.org


Storage Organization

58


Hardware and Software: An Introduction

UNIT 3 INPUT OUTPUT DEVICES Structure 3.0 Introduction 3.1 Objectives 3.2 Input­output Devices 3.3 Monitors 3.4 Printers 3.5 Scanners 3.6 Diskettes 3.7 Keyboard 3.8 Mouse 3.9 Tablet 3.10 Speaker 3.11 Microphone etc 3.12 Summary 3.13. Solutions/Answers 3.14 Further readings and References

Page Nos. 56 56 56 58 61 66 66 70 71 71 72 72 74 74 76

3.0 INTRODUCTION Input­output devices are very important component of computer systems. In previous units of this Block, we have discussed various components of computer system. In this unit, we will discuss about input/output devices, of computer system. 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 After studying this unit you should be able to understand: • the basic concepts of input/output devices;

functions of Input/output devices;

types of input/output devices;

types of monitors, printers, scanners and graphics tablet; and

newer technologies in computer hardware (I/O devices).

3.2 INPUT­OUTPUT DEVICES

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

Joy­stick

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


• • •

Manual inputs from a keyboard or console. Analog inputs from instruments or sensors. Inputs from a storage device, such as Pen­Drive, CD’s and Floppy Drives.

Input Output Devices

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: 1.

Normal Cathode Ray Tube (CRT)

2.

Liquid Crystal Display (LCD) / (TFT LCD)

3.

Projection Displays

3.3.1 Normal Cathode Ray Tube Monitors (CRT) 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

Monitor

On/Off Button Base

58


Hardware and Software: An Introduction

Figure 1 (a): PC Monitor

Electron gun

Picture Tube Figure 1 ( b):Cathode Ray 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.

3.3.2 Liquid Crystal Displays (LCD) 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 Figure 2: LCD Monitor

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.

3.3.3 Projection Displays

59


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.

Input Output Devices

On/Off Buttons Body

Lens Figure 3: LCD Overhead Projector

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. Classification of Monitors on the basis of Color In terms of color capabilities, monitors can be divided into following types: 1. Monochrome:

These monitors display the result in two colors, i.e., black/white, green/black, amber/black. One color is for background of the screen and other for the foreground and you may see it being used at railway reservation counters.

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. Classification of Monitors on the basis of Size 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. Classification of Monitors on the basis of Resolution 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 high­end 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: Electronic signal that is sent by signals of varying frequency instead of sent as ON or OFF data transmission is called analog signal. Analog allows equipment to handle information that continuously changes such as voltage, current, wave etc. Analog signals can be represented by wave sign and watches which changes there position continuously.

Figure 4: Analog Signal

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 Figure­5 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 Figure 5: Digital Signal

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


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.

Input Output Devices

There are vast varieties of printers. Classification of these printers can be done by the technology used by them. These varieties of printers are: Printing Technology : impact printers vs. non impact printers Impact printers use variations of standards typewriter printing mechanism where a hammer strikes paper through inked ribbon. A non­impact printer uses chemical, heat or electrical signals to each or induces symbols on paper. Many of these require special coated or treated paper to print characters on them.

3.4.1

Classification of printers on the basis of Speed

On the basis of speed printers are of following types:

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. (a) Daisy ­ Wheel Printer: This printer is similar to a ball­head typewriter. This type of printer has a plastic or metal wheel on which the shape of each character is embossed. Ribbon

Body Paper Rotation Nob

Figure 6: Daisy­Wheel Printer

A hammer presses the wheel against a ribbon, which in turn makes an ink stain in the shape of the character on the paper. Daisy­wheel printers produce letter­quality print but cannot print graphics. The print quality of this impact printer is very low. (b) Dot­Matrix Printer:

Paper Out

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.

Figure 7: Dot Matrix Printer

Dot­Matrix printer creates characters by striking pins against an ink soaked ribbon. Each pin makes a dot and combinations of dots form characters and illustrations. The moving portion of the printer is called the print head of Dot matrix printer.

Advantages: • • •

Dot matrix printers, like any impact printer, can print on multi­part 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: • • •

Impact printers are usually noisy. They can only print low resolution graphics, with limited color performance, and limited quality. Per minute page printing is low.

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


These are very high speed printers which produce high quality output. Their speed ranges from10­25 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.

3.4.2

Input Output Devices

Classification of Printers on the basis of Quality The various types of printers based on print quality are as follows (i) Ink­jet 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: Compared to other printers, inkjets printers have a number of advantages. These are:

• • •

They are quieter in operation than impact printers. They can print finer, smoother details through higher print head resolution It can produce photographic­quality printing.

Paper Out

Disadvantages:

On/Off Button

Figure 8: Ink­Jet Printer

Disadvantages of Inkjet printers are: • The ink is often very expensive. • Many intelligent ink cartridges contain a microchip that communicates the estimated ink level to the printer; this may cause the printer to display an error message, or incorrectly inform the user that the ink cartridge is empty. • The very narrow inkjet nozzles are prone to clogging due to dried ink. (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 photo­copy 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: •

Monochrome laser printer, and Color laser printer. Laser Beam

Toner Paper Out

Mirror lenses

Drum Fusing Section Paper In Figure 9: Laser Printer

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.

☞ Check Your Progress 1 1) State True/False against each of the following statements: a) Keyboard is an input device. b) Monitor Is An Input Device. c) Printer Is An Input Device. d) Joy­Stick Is An Output Device. e) Speaker Is An Output Device. f) Microphone Is An Input Device. g) Daisy­wheel printers prints high quality printing h) Dot­Matrix printer is characters printer. 65


i) Color laser printers use single toner to print.

Input Output Devices

j) The laser printers are very cheaper.

2) What do you mean by input devices? …………………………………………………………………………………… …………………………………………………………………………………… …………………………………………………………………………………… 3) What do you mean by output devices? …………………………………………………………………………………… …………………………………………………………………………………… …………………………………………………………………………………… 4) Name some of the input and output devices. …………………………………………………………………………………… …………………………………………………………………………………… …………………………………………………………………………………… 5) What are the various types of printers? .……………………………………………………………………………….. ………………………………………………………………………………….. …………………………………………………………………………………..

6) What do you mean by dot­matrix printer? .……………………………………………………………………………….. ………………………………………………………………………………….. ………………………………………………………………………………….. 7) What do you mean by Laser Printers? .……………………………………………………………………………….. ………………………………………………………………………………….. …………………………………………………………………………………..

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 large­formatted 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

Figure 10: Optical Scanner

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. Floppy Disks come into three sizes: (1) 8 Inches Floppy Disk (2) 5.25 Inches Floppy Disk (3) 3.5 Inches Floppy 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

Figure 11: Floppy Disk Drive & Floppy

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.

3.6.1 Hard Disk Drive (HDD) 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: Size (usually larger), Speed (usually faster) and Permanence (usually fixed in the PC and not removable). 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

Figure 12: Hard Disk Drive

Features of HDD: Some of the main features of hard disk are: 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.

3.6.2 Random Access Memory (RAM) Random access memory (RAM) of a computer system is a type of computer data storage device. It works similar to integrated circuits and allows the stored data to be accessed in any order, i.e. at random. The word random thus refers to the fact that any piece of data can be returned in a constant time, regardless of its physical location. 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 Figure 13: Random Access Memory

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.

3.6.3 Pen Drive 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

Figure 14: Pen Drive

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.

3.6.4 Compact Disk (CD)

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 Figure 15: Compact CD

The amount of information that can be written on a CD is determined by the disc recording capacity as well as the physical and logical formats used. There are various versions of CD such as CD­R (CD Readable), CD­RW (CD Read­Write), SACD (Super Audio CD), VCD (Video Compact Disk), and DVD (Digital Versatile Disk).

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. In general a computer keyboard has following key: 1. Alphanumeric Keys: It includes letters and numbers. 2. Punctuation Keys: These include comma, period, semicolon etc. 3. Special Keys: These can be, function keys, control keys, arrow keys and Caps Lock keys etc. Multimedia Keys Function Keys

Space Bar

71

Numeric Keys


Input Output Devices

Figure 16: Keyboard

All the modern keyboards of computer are classified as: (a) Original PC keyboard having 84 keys, (b) Advance Technology (AT) Keyboard having 101­104 keys, and (c) Multimedia Keyboard having 120 – 140 keys.

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

Figure 17: Computer Mouse

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. Mouse could be mechanical, optical or cordless types. 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. Cord­Less Mouse: Cord­Less 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.

3.9 GRAPHICS TABLET Graphics tablet is a computer input device which allows one to hand­draw 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 Figure 18: Graphics Tablet

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 Computer speakers, or multimedia speakers, are external speakers, commonly equipped with a low­power internal amplifier. A plug and socket for of the external speakers are used to connect it with computer system.

Speaker Volume

On/Off

Stand Figure 19: Multimedia Speaker

Computer speakers range widely in quality and in price. Laptops computers have inbuilt speakers with them.

73


Input Output Devices

3.11 MICROPHONE A microphone is an acoustic­to­electric transducer or sensor and is used to convert sound signals into electrical signals. It was originally invented by Emile Berliner in 1877, and allows you to record voices or sounds and place them onto computers, generally as a wave file.

Head Wire

Stand Figure 20: Voice Recording Microphone

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.

☞ Check Your Progress 2 1) True / False against each of the following statements: a) Cordless mice are directly connected with computer. b) Mouse Is Not A Pointing Device. c) Floppies Are Used To Store Data. d) Scanner Is Used To Print Documents. e) Printer Is Used To Display Pictures. f) Monitor Is Used To Scan Pictures. g) Microphone converts sound into electrical signal. h) A Computer Attached With Speaker Is Called Multimedia Computer. i) Speakers Are Used For Listening Audio Signals. 74


Hardware and Software: An Introduction

j) Graphic Tablet Can Be Used As Mouse. 2) What is mean by keyboard? …………………………………………………………………………………… …………………………………………………………………………………… ………..………………………………………………………..…………………

3) What is a mouse and what are its types? .……………………………………………………………………………….. ………………………………………………………………………………….. ………………………………………………………………………………….. 4) What is a scanner and what is their functions? .……………………………………………………………………………….. ………………………………………………………………………………….. ………………………………………………………………………………….. 5) What is multimedia speaker? Where they are used? …………………………………………………………………………………… …………………………………………………………………………………… ………..……………………..…………………………………………………… 6) What is use multimedia graphics tablet? …………………………………………………………………………………… ……………………………………………………………………………………

………..……………………………………………………………………

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 Check Your Progress 1 1) (a) TRUE

(b) FALSE

(c) FALSE

(d) FALSE

(e) TRUE

(f) TRUE

(g) FLASE

(h) TRUE

(i) FALSE

(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. 3) Output devices display the result of your computer’s computations. Examples of these would be your computer’s monitor, which displays all the programs which are running into the computer, or the printer used for getting result as printout. 4) Some Examples of Input devices are: Keyboard, Mouse, Joy­stick, Microphone, and Graphics tablet. Some examples of output devices are: Monitor, Printer, Plotter and Speaker 5) There are many different types of printers. In terms of the technology utilized, printers fall into following categories: 1) 2) 3)

Laser printer Ink­ jet printer and Dot­matrix 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 ink­soaked 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 photo­copy 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.

Check Your Progress 2 1) (a) FALSE (b) FALSE

(c) TRUE

(d) FALSE (e) FALSE

(f) FALSE

(g) TRUE (h) TRUE

(i) TRUE 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. 3) Computer mouse is an input device. It is used to point on the instructions and commands are input by clicking on them by it. A mouse has two – three buttons on it and is moved on the mouse pad which gives smooth surface for its movement. Mouse is consists of a small case, held under one of the user’s hands, with one or more buttons. 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. 5) Computer speakers, or multimedia speakers, are external speakers, commonly equipped with a low­power internal amplifier. These are used to listen audio signals in computer system. 6) A graphics tablet is a computer input device that allows one to hand­draw images and graphics, similar to the way one draws images with a pencil and paper.

3.14 FURTHER READINGS AND REFERENCES 1) Computer Fundamentals by V Raja Raman, PHI Publication New Delhi, Year 2008 2) Computer Fundamentals by P K Sinha and Preeti Sinha, BPB Publication New Delhi, Year 2007 3) Computer Fundamentals and Personal Computer Software by V C Jain, BPB Publication New Delhi, Year 2006 4) Comdex Computer Course Kit by Vikas Gupta, Dreamtech Publication, N Delhi, Year 2007

Reference websites: (1) www.sciencedirect.com (2) www.ieee.org (3) www.abcya.com (4) www.webpedia.com

77


Software

UNIT 4 SOFTWARE Structure 4.0 Introduction 4.1 Objectives 4.2 Classification of Software 4.2.1 System Software 4.2.2 Application Software 4.3 Evolution of Operating System 4.3.1 Serial Processing 4.3.2 Batch Processing 4.3.3 Multiprogramming 4.4 Types of Operating System 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 4.6 Computer Virus 4.7 Summary 4.8 Solutions/Answers 4.9 Further Readings and References

Page Nos. 77 78 78 90

92

96 97 99 100 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. Now, let us understand the term software. 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 System software supports a general programming environment for development and security of different units of programs by programmers. Such environment is not supported at hardware level. Operating system is a part of system software. 77


Hardware and Software: An Introduction

Application software is used for solving a specific problem for inventory, payroll, 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 After studying this unit you should be able to understand:

• • • • •

the basic concepts of software; differentiate between application software and system software; various categories of software; batch processing system, multiprogramming system; and development stages in operating system.

4.2 CLASSIFICATION OF SOFTWARE The term software in computer science can be compared as the life of any living organism without which it has no significance. If you use a player piano as an analogy, the piano can be thought of as the hardware and the roll of music as the software. 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:

4.2.1

78

System 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:

Used by the computer to accomplish a task.

Manages all the resources of computer

Create database and keeps it update after every transaction

Arrangement of files in alphabetical order

Controls the internal functions of computer

Controls other devices connected to the CPUs

Software

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. Types of System Software System software can be classified into following categories: 1. Operating system 2. Translator and 3. Utility programs 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

Figure 1: Layers of Operating system

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 MS­DOS, MS­WINDOWS, UNIX, LINUX, XENUX etc. History of Operating System 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


Common Operating System

Software

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 MS­DOS, Microsoft's Disk Operating System, and its twin at IBM, PC­DOS, 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 is system software which may be viewed as an organized collection of software, consisting of procedures for operating a computer and providing an environment for execution of programs. Operating system manages resources of the computer system, such as memory, processor, file system and I/O devices. Other programs rely on facilities provided by the operating system to gain access to computer system resources. 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.

Functions of Operating System The operating system resides in the main memory of the computer system. Following are the basic functions performed by an operating system (i) Resource Management : Operating System is responsible for allocating various resources such as I/O devices, memory etc. to the user effectively. It schedules the processes by time management and memory management. It also keeps track of all the I/O devices and CPU so that there would be no wastage of time and all the devices remain busy all the time. (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 de­fragmenting disks. The term de­fragmenting 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 memory­resident items out of the way. This 81


Hardware and Software: An Introduction

can effectively increase the memory available by getting all the unused pieces together in 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.

Assembly language program

Assembler

(Source program)

Machine language program

(Object program) 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. In order to execute an assembly language program on a computer, it should first be translated to its equivalent machine language program. The translator which does this is known as assembler. The input to an assembler is the assembly language program and is known as source program. Its output is the equivalent machine language program and is known as the object program. The assembler is a system program which is supplied by the computer manufacturer. Assembly language programs are also called low level language programs. 82


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.

Software

The main disadvantages of an assembly language are:

(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

LDA, 12 LDB, 15 ADD A, B LD (200), A HALT

: : : : :

Load register A with 12 Load register B with 15 A ← A + B Save the result in the location address 200 Halt the process

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 high level language such as C & BASIC

Compiler

(Source program)

Machine language program

(Object program)

Figure 3: Compiler

83


Hardware and Software: An Introduction

Compiler scans the entire program first and then checks for syntax (grammatical) errors. If there is any error, the computer generates a print­out 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 20 30 40 50

LET LET LET PRINT END

X Y SUM SUM

= = =

12 15 X + Y

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.

Difference between Compiler and Interpreter Compiler

Interpreter

1) Scans entire program first and then converts it into machine code.

Scans program line by line.

2) Translates the entire program to machine code, after debugging the program and execution takes place in the end.

After each execution every line is checked for syntax errors and then converted to object code.

3) Program execution time is less.

Program execution time is more.

4) Debugging process is slow. (Step by step execution checking)

Debugging process is fast. (Step by step execution checking)

5) Suitable for large programs.

Suitable for small programs.

6) Programs produced by compilers run much faster than interpreter.

Programs produced by interpreters run slower than compilers.

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


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:

Software

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. 3) SORT/MERGE software for sorting and merging large volume of business data into single sorted list.

4.2.2 Application Software 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. A number of powerful application software packages, which does not require significant programming knowledge, have been developed. These are easy to learn and use as compared to the programming languages. Software can be used by people to solve general problems. It can be used to do more than one task such as:

• • • • • • •

Planning Writing Record keeping Calculating Communicating Drawing Painting etc.

There is no limitation of activities can be done by this softwares. What can be done with general purpose application software is only limited by the imagination of the user. Use of variety of software depends upon the requirement of the type such as letter typing, making presentation, making tables and storing data in a databases. Some examples of such application software are: 1. Word Processing Package 2. Spreadsheet Package 3. Graphics Software, and 4. Database Management Software 1. Word Processing Package 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 Introduction

Creating the documents involves typing text in the internal memory of the computer 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.

Figure 4: Screen shot ­ MS­Word

Microsoft Word is a word processing software which can be used to create, edit save and print documents. A window of MS­Word 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 MS­Word MS­Word processor software allows us to do following tasks: (1) (2) (3) (4) (5) (6) (7) (8)

Type a document through the keyboard and save it on the disk. Correct, delete and insert characters, words, lines anywhere in the document. Retrieve documents from the disk as and when required. Move or copy paragraphs from one place to other or from one file to other. Formatting of the document as per the need of the user. Searching of files in folders of the system. Save the edited document in the disk Print a letter or document

2. Electronic Spreadsheet Package 86


Although MS­Word 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.

Software

MS­Excel 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.

Figure 5: Screen shot­ MS­Excel

Some, common applications of MS Excel worksheet are: Inventory control, Payroll, Income Tax calculation, Price list and invoice billing. Let us now discuss the menus of this software. 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 The common features of MS Excel worksheets are: (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 Introduction

Advantage of MS­Excel Spreadsheet MS­Excel software allows us to do following tasks: (1) (2) (3) (4)

Result of calculation is accurate and fast. Project reports can be prepared easily and quickly by the user. Worksheet is saved in electronic file and can be modified when required Mathematical formula’s such as trigonometric formulas, statistical formula’s are inbuilt along with this software and can be used for analysis of project results. (5) Data can also be used to generate graphs for the comparison and analysis of project reports. (6) Two worksheets can be merged for the purpose of report generation from two worksheets. 3. Graphic Software Graphic software is used to create and manipulate presentation graphics, freehand graphics, charts etc. Some common graphic software’s are MS Power point, Lotus­ Graphics, Harvard Graphics etc. Image processors such as Photo­paint and Photoshop are also called graphic software. In this section, we will discuss some components of graphics software, PowerPoint. PowerPoint is a complete presentation graphics package. It gives you everything you need to produce a professional looking presentation text handling, outlining, drawing, graphics, clip and art, and so on. It also offers rich speaker support and aids to help you create truly effective presentations. PowerPoint makes you, the presenter and independent producer of your own high equality presentations.

Figure 6: Screen shot ­ PowerPoint

Figure 6 shows the a window of PowerPoint. The features of PowerPoint Window are:

88

Title bar


It is located at the top of the screen, displays the name of the presentations.

Software

Menu bar It is located below the title bar and lists the options. Status Bar Used to display Messages regarding page number, slide number etc at the bottom of the window. Advantage of PowerPoint PowerPoint graphics software allows us to do following tasks: Create a blank presentation Text can be added by using text box Change the fonts, size and color of the text Add drawing objects Presentations can be saved in the memory of the computer Pictures and sounds files can be inserted at appropriate place in the presentation Project reports can be presented by using PowerPoint 4. Data Base Management System (DBMS) 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.

Figure 7: Screen shot ­ FoxPro

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 Introduction

• •

• Creating data files on a computer. • 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.

☞ Check Your Progress 1 1) What do you mean by software?

………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… 2) What do you mean by system software?

………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… 3) What is application software?

………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… 4) Give some example of system software and application software?

………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… 5) What is GUI? ………………………………………………………………………………………… ………………………………………………………………………………………… ………………………………………………………………………………………… 6) What is utility Software? Explain its function. ………………………………………………………………………………………… ………………………………………………………………………………………… ………………………………………………………………………………………… 7) What is use of the MS­Word?

90


…………………………………………………………………………………………

Software

………………………………………………………………………………………… …………………………………………………………………………………………

4.3 EVOLUTION OF OPERATING SYSTEM 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.

4.3.1

Serial Processing System

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.

4.3.2

Batch 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 multi­tasking. 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 non­interactive jobs all at one time is called batch processing. 91


Hardware and Software: An Introduction

The term batch processing originated in the days when users entered programs on punch 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.

Figure 8: Job Processing in Batch Processing

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. Advantage and disadvantage of Batch Processing System 92


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.

Software

Disadvantages

1. Turn­around 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 Spooling Batch Processing Systems 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 On­Line”. 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.

4.3.3

Multiprogramming System

Multiprogramming Systems (1960s ­ present); Multiprogramming means sharing resources between more than one program’s, device. It requires several programs to reside in memory at the same time. Since, several processes are to be kept in memory at the same time, these require some form of memory management. 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 Introduction

each one for a specified period of time. The Multiprogramming Operating System was 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 Multiprogramming­Multitasking Operating System. However, the term Multitasking Operating System normally means the same thing nowadays.

4.4 TYPES OF OPERATING SYSTEM In this section, we will discuss general properties, types of application advantages, disadvantages and basic requirements of different types of operating systems.

4.4.1 Batch Operating System 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. Major disadvantages of this Operating System is: (1) Non­interactive environment (2) Off line debugging of the program by the operator (3) No control over intermediate results of a program (4) No flexibility in developing software

4.4.2 Real Time Operating System A real­time operating system (RTOS) is an operating system that guarantees a certain capability within a specified time constraint. Primary role of real time operating system is to process data in quick time. 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 real­time 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: • Industrial Control Systems • Automobiles (Brake Control) • Airplane Guidance 94


• Medical Devices

Software

There are two types of real time systems: 1. Hard Real Time Systems 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. 2. Soft Real Time Systems 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.

4.4.3 Time­Sharing Operating System

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.

4.4.4 Personal Computer Operating System 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. The operating system of PCs consists of two parts. (1) Basic Input Output System (BIOS) (2) Disk Operating System (DOS) (1) Basic Input Output System (BIOS)

95


Hardware and Software: An Introduction

Basic Input Output Systems (BIOS) in PCs are stored in a non­erasable memory called Read Only Memory (ROM). When power is turned on BIOS takes control of the system in the beginning of booting. (2) Disk Operating System (DOS) Disk Operating System (DOS) is stored in a hard disk of the personal computer system. Features of DOS are: (1) File management (2) Directory management (3) Memory management (4) Utility program management, and (5) Executive program management.

4.4.5 Network Operating System 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.

Features of network operating system are: (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.

4.4.6 Parallel Operating System 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. Advantages of parallel system are: (1) (2) (3)

(4) (5) (6) (7)

(8) (9) 96

Increased throughput Economical Increased reliability Graceful degradation fail­soft systems Symmetric multiprocessing (SMP). Each processor runs an identical copy of the operating system. Many processes can run at a time without performance deterioration. Most modern operating systems support SMP. (10) Each processor is assigned a specific task; master processor schedules and


allocated work to slave processors.

Software

4.4.7 Distributed Operating System A distributed operating system is one that looks 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 uni­processor based systems. They are functional even if some of their hardware is not functioning or out of order. 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. Advantages of distrusted operating system are: (1) (2) (3) (4) (5) (6) (7)

Distributed operating system offers better price performance than centralized operating system. Total computing power of distributed operating system is better than centralized operating system. If one machine crashes the system as whole survives and keep on working. Computing power can be added in small increments. Allows many users to access common database. Allows many users to share expensive peripheral devices. Human to human communication makes easier through a wide network.

☞ Check Your Progress 2 1) What do you mean by flow control?

………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… 2) List functions of operating system?

………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… 3) What is real­time operating system?

………………………………………………………………………………… ………………………………………………………………………………… …………………………………………………………………………………

4.5 OTHER CRITERIA FOR CLASSIFICATION OF SOFTWARE 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

Has the most resistive copyright. Have to buy the software before you can use it. Can usually make one copy of the software as a backup copy. A backup copy is used in case something goes wrong with the original software. Can not give away or sell the backup copy. Can not copy look at the program’s code, change, or use the software in another program without the copyright holder’s permission.


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

Software

Software can be installed into the computer by the following way:

1. Built into the computer’s circuits, the ROM chips. 2. Loaded into the computer from a secondary storage device, like a floppy disk or hard disk drive. 3. Typed in from the keyboard. 4. From the Bluetooth Technology, Infrared Ray Technology and Wi­Fi Network Technology. 5. From the backup of LAN servers. After copying finally installation setup is executed.

4.6 COMPUTER VIRUS 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 : Spy­ware 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 Introduction

7. Browser hijacking: Hijacking occurs when one of the nastiest takes control of your 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.

4.6.1 How to protect your computer from viruses To protect computers from unauthorised access firewalls are used. A firewall is an integrated collection of security measures designed to prevent unauthorized electronic access to a network computer. To protect your computer from unauthorized access, viruses and spam you need to install anti­viruses and firewalls to your computer system. 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 Figure­9 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 anti­viral programs. Functions of anti­virus programs are:

100

Prevention

Detection

Vaccination

Identification, and

Damage control


Software

PC Without Fire Wall Protection

INTERNET

PC Without Fire Wall Protection (High risk of virus attack)

Fire Wall

Fire Wall Protection PC (Very low risk of virus attack)

Figure 9: Firewall in Network

Example of some antivirus and prevention software programs are: Norton Anti­Virus, Mcafee Antivirus, Quick heal Anti­virus, 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.

☞ Check Your Progress 3 1) What do you understand by batch processing system?

………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… 2) What is multiprogramming system?

………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… 3) What is distributed operating system?

………………………………………………………………………………… ………………………………………………………………………………… …………………………………………………………………………………

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 Introduction

processing. Software can be further divided into two categories, system software and 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. Further we have also discussed, batch processing system, multiprogramming system. Batch processing system is a system in which similar types of jobs are bundled at one place and then are processed by the CPU in one go. Multiprogramming system means processing of multiple programs at the same time by proper scheduling of jobs and computer memory.

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. 7) MS­Word is word processing application software and is used to write letters, creating tables, writing documents (books etc.)

Check Your Progress 2 1) Control flow determines the sequence and flow of controls in the computer system for performing some activity (program)

102


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.

Software

3) A Operating System which performs its activities in a fixed constraint of timing is called real­time operating system. A real­time operating system (RTOS) is an operating system that guarantees a certain capability within a specified time constraint. A real­time computer system is used in a large computerized environment, where the events are to be performed by their association with one another. The events must be accepted and processed in very short time and have some dead line.

Check Your Progress 3 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. 2) Multiprogramming means sharing resources between more than one program’s, device. It requires several programs to reside in memory at the same time. Since several processes are to be kept in memory at the same time, they require some form of memory management. 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 uni­processor 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.

4.9 FURTHER READINGS AND REFERENCES 1) Computer Fundamentals by P K Sinha & Preeti Sinha, BPB Publication New Delhi, Year,2008 2) Computer Fundamentals by V Raja Raman, PHI Publication New Delhi, Year 2007 3) Computer Fundamentals and Personal Computer Software by V C Jain BPB Publication New Delhi, Year 2006 4) Comdex Computer Course Kit by Vikas Gupta, Dreamtech Publication, N Delhi, Year 2007

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 Structure 5.0 Introduction 5.1 Objectives 5.2 Introduction to Databases

Page Nos.

102 103 103

5.2.1 File System vs. DBMS 5.2.2 Types of DBMS

5.3 Databases Development Life Cycle

5.3.1 Fundamentals of Data Modeling 5.3.2 Entity Relation Models 5.3.3 ER Models and Database Design

5.4 5.5 5.6 5.7

Applications of DBMS Summary Solutions/Answers Further Readings

112

122 123 124 126

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 Entity­Relationship (ER) Diagram. You will learn in detail about ER Diagrams and how to draw it. 102


Hardware and Software: An Introduction

5.1 OBJECTIVES After going through this unit, you will be able to:

describe Database Management System and File System;

advantage and uses of DBMS;

explain types of DBMS;

explain and draw Entity Relation Diagrams (ERD); and

list applications of Databases.

5.2 INTRODUCTION TO DATABASE A Database Management System (DBMS) is formally defined as: A database management system (DBMS) is a collection of programs which enables users to create and maintain a database. The DBMS is hence a general­purpose software system that facilitates the processes of defining, constructing and manipulating databases for various applications. Before DBMS came into existence traditional file approach were used for data handling. Let us see basic differences between file approach and DBMS.

5.2.1

File System vs. 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.

5.2.2

Traditional File System or File Oriented Approach

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


many types of files are there in the system. In order to save the relevant information in the relevant file.

Introduction to database management systems

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:

1) Reduction in data redundancy: It means that DBMS helps in removing

duplicate data from the database. If any type of duplicate entry arises, then there is man (DBA, database administrator) who can Centrally control the data and arrange data in non duplicate forms on the basis of Primary Key . now what is a Primary Key ? It is a unique field and has non duplicate information. For example, Roll Number is always unique and different for every student which is not repeated. So, Roll Number is a primary key to store the student data uniquely. You will notice that Redundancy leads to several problems: i) Duplication of Efforts. ii) Save the storage space / memory where data is saved.

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.

5.2.3

Types of DBMS

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: •

Sequential (“Flat File”)

Hierarchical

Network

Relational 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. Broadly Classification of DBMS is done on the basis on various parameters like: a) Number of users of system whether single user or multi user system. b) General purpose or special purpose database. Flat File: A flat file c) How data is stored and can be accessed. can be defined as a text file in which you Now let us discuss these different categories of DBMS one by one. can organize the data in your own format Sequential Files and it is not linked with any other file. In this the data is In this approach, data is stored in a single file (flat file). You must have worked in processed in the way Microsoft Excel Spread sheet files; spread sheets are sequential in nature and act as the data is stored. flat files. 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


shop name and address over and over again which is a waste of time and memory 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.

Introduction to database management systems

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: Table 1: ITEM SOLD Item Name Bread Butter Biscuits Maggi

Price 12 25 30 25

Quantity 1 1 2 1

Store Name ABC ABC ABC ABC

Date of Sale 26­02­2009 26­02­2009 26­02­2009 28­02­2009

Advantages of File System: a) It is simple and easy to implement. b) It can be used for small databases. c) It is used where no links between data or files are required Disadvantage of File System: a) Duplication of data Entries b) Since the access mode is sequential or in a single order, the system gets slower for large databases. c) The file is hard to recover if it is corrupted or system crashes. Before we discuss other types of database, you should understand various terminologies like attribute, tuple, record, keys and constraints in databases: 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

Tuple

Table 2: STUDENT

Attribute Student Name Prateek Srikant Prateek Kalpana Elina

RollNo 12 13 14 15 16

Class XII XII XII XII XII

Subjects Computer Science Maths Computer Science Computer Science Maths

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. Table3: STUDENT table and its Primary Key RollNo (Primary Key) 12 13 14 15 16 18

Student Name Prateek Srikant Prateek Kalpana Elina Kalpana

Class

Subjects

XII XII XII XII XII XII

Computer Science Maths Computer Science Computer Science Maths Computer Science

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 BookNo (Primary Key) CS123 CS124 CS125 107

RollNo (Foreign Key) 12 23 14

Title

Issued Date

Database Systems Hardware Concepts Systems Software

26/05/2009 12/05/2009 22/06/2009


CS126 CS127

15 16

Digital Electronics Maths­I

24/06/2009 25/06/2009

Introduction to database management systems

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) b) c) d)

KEY Constraint NOT NULL constraint Semantic Constraint 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. Referential Constraint: This check requires that a data of an attribute which is referred to should actually exists as an entity in some table. DBMS keeps a check on the referential integrity when a referenced value is inserted or changed. For example, the LIBRARY table, RollNo 12 (student name : Prateek) must exist in STUDENT table when referred to by the LIBRARY table. RollNo 12

Student Name Prateek

Class XII

Subjects Computer Science

Referential Constraint

BookNo CS123

RollNo 12

Title Database Systems

Issued Date 26/05/2009

Arrow represents a referential integrity Constraint. Now let us look into another type of DBMS which is a Hierarchical DBMS. Hierarchical Databases Model 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

Name of Depart

No. of Staff

Address

Product Product No

Product description

Figure 1 (a): Tree (T1)

Product Product No

Product description

Supplier Supplier No.

Supplier name Supplier_street Hierarchial Model

Figure 1(b) : Tree (T2)

Supplier Suppplier_name

Supplier_Street

Order Order _No

109

Supplier_City

Order _description

Figure 1 (c) : Tree (T3)

Supplier_city


Introduction to database management systems

Advantages of Hierarchical Databases: Hierarchical database is having following advantage: 1) Hierarchical model is simple to construct.

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.

3) Accessing of data is faster in hierarchical database compared to sequential database.

Network Model/Network Database Network model was developed in mid 1960s as part of work of CODASYL (Conference on Data Systems Languages) which proposed programming language COBOL (1966) and then network model (1971). The basic objective of network model is to separate data structure from physical storage, Compared to hierarchical database, network database eliminates unnecessary duplication of data with associated errors and costs. 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. Advantages of Network Model over Hierarchical Model a) It eliminates unnecessary duplication of data with associated errors and costs . b) It uses concept of a data definition language, data manipulation language c) It uses concept of m:n linkages or relationships , which means that an owner record can have many member records. Similarly a member record can have several owners. But a hierarchical model allows only 1:n 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. Customer: Customer No, Customer name, address, City. Order : Order No, Order Description, Supplier no, Order Date Supplier : Supplier No, Supplier Name, Address, Contact No. Product : Product No, ProductDescription,ProductPrice 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.

Supplier_name

Supp_street

Supp_city

Order_no

Supplier link

Order Description

Order link Relation­link

Figure 2: Records and Links (Network Model)

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 relation­link 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 two­dimensional 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. •

• •

You can understand Relational Model where Each row is a record or tuple Each column is an attribute For example, details of a shop where a Product (product­no, product description, price, quantity), and its Supplier details (supplier no, supplier name, production­no) are stored in two tables. Let us say these are named as Product and Supplier. SUPPLIER ORDER 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_Street Supplier_City

Supplier_No (FK) Date of Order

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 A relational database is a finite set of relational schemas. A relational scheme is defined as the relational model which represents data as two­dimensional tables called relations. The contents of a table are rarely static thus the addition or deletion of a row is required. Some advantages of relational model is:

1) 2) 3)

Mostly used by the most popular type of DBMS in use. It has various integrity rules which ensure data consistency. Easy to use and handle data. Remember that a "relation" is a table of records, not a linkage between records. The degree of a relation is the number of attributes in the table, For example if a table (relation) is having four columns then the degree of that table is four. 1 attribute is a unary relation­for example, the wife has one husband. 2 attributes is a binary relation­for example, two employee works in two departments. N attributes is an n­ary relation for example many relationship is SUPPLY between supplier and Project. Where each relationship associates three entities, Supplier, Part and Project ­ whenever Supplier supplies part to Project.

☞ Check Your Progress 1 1) State True/False for the following statements: i) A record is collection of unrelated fields. ii) In sequential file, data redundancy does not occur. iii) Columns in a table are known as attributes. iv) In relational model, relations are established in the form of parent­child relationship v) Relationship between University and its students is unary relation. 112


Hardware and Software: An Introduction

2) Summarize the features of Hierarchical Database. ……………………………………………………………………………………… ……………………………………………………………………………………… ……………………………………………………………………………………… 3) What are the restrictions with Network 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.

5.3 DATABASE DEVELOPMENT LIFE CYCLE 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.

e) Testing of database: It is to checking whether the new proposed database developed by you fulfills all client requirements or not, in other words functionality of the system are checked during testing.

f) Maintenance of database system: After the database system is developed, it need to be maintained, it includes correction of some mistake, adding new components into the system or adding some new features as per new needs of the client etc. Now let us see some details of conceptual, physical and logical database modeling. Conceptual Data Model

113


A conceptual data model identifies the highest­level relationships between the different entities. Conceptual data model include: • • •

Introduction to database management systems

the important entities and the relationships among them. no attribute of entities are specified at this level. primary key is specified, at this level. The Figure 4 is an example of a conceptual data model: Product

Supplier/Store

Figure 4: Conceptual Design

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. Logical Data Model 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: All entities and relationships among them. All attributes for each entity. The primary key for each entity. Foreign keys (keys which are used for identifying the relationship between different entities). • Normalization is done at this level. • • • •

The steps for designing the logical data model are as follows: Product

4) 5)

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 If there are many­to­many relationships in the system, those are resolved here. Category 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, Shopkeeper/STORE Category etc): Store_Id

Store_Name Address Contact_No Supplier_No

114 Figure 5: Logical Design


Hardware and Software: An Introduction

Basic differences between Conceptual Data Model and Logical Data Model are: In a logical data model, primary keys are present, whereas in a conceptual data model, no primary key is present. • In a logical data model, all attributes are specified within an entity. No attributes are specified in a conceptual data model. • Relationships between entities are specified using primary keys and foreign keys in a logical data model. In a conceptual data model, the relationships are simply stated, not specified, so we simply know that two entities are related, but we do not know that what attributes are used for this relationship. •

Physical Data Model 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: Specification of all tables and their columns. Foreign keys which are used to identify relationships between tables. Denormalization may occur based on user requirements. Also physical considerations may cause the physical data model to be quite different from the logical data model. Physical data model will be different for different RDBMS. For example, data type for a column may be different between MySQL and SQL Server. • • •

Product (28 bytes)

In Figure 6 memory to be occupied by various Tables and their attributes are shown. Product Id: Integer

For example Product will take (28 bytes) Prod_desc: Varchar (20) Price : Float Qty: Float

Store (44 bytes) Store_Id: Integer

115

Store_Name: Varchar (20) Contact_no: Integer Address: Varchar (20)


Introduction to database management systems

Figure 6: Physical Design

5.3.1 Fundamentals of Data Modeling 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. Object­based Logical Models: It describes data at conceptual and view levels. We will study Entity­Relationship (ER) modeling in the next section. ER model represents the relationship between different entities in the system. Record­based 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.

5.3.2 Entity Relationship Models 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. Entity­relationship model: A logical representation of the data for an organization or for a business area. The E­R model consists of entities which have attributes and relationships between these entities. ER­Model 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 ER­Model ER­Model is useful because it facilitates communication between the database designer and the end user during requirement analysis. Following are the main advantages of ER models: (a) It provides the clear and readable relationship between entities in the system for the database designer as well as for the end user. (b) It views an enterprise as being composed of entities that have relationships between them. (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: 1) Entities: It specifies real world items in the system. 2) Relationships: It signifies the meaningful dependencies between entities of the systems. 3) Attributes: It specifies properties of entities and relationships. The graphical representation of these features are : Entity :

ENTITY

Relationships :

Attribute : Entity Type: Generally a collection of entities which share common properties or characteristics. For example, in the database of a University, STUDENT is an entity type. There are many students in a University and they share common characteristics such as: each one has a name, a roll number, department etc. On the basis of characteristics of entities, they are divided into two categories: • 117

Strong Entity


Weak Entity 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.

Introduction to database management systems

Weak Entity: A weak entity is defined as “An entity type whose existence depends on some other entity type”. For example, in the database of a company EMPLOYEE is an entity type. Some companies keep information about the dependents of each employee. In this case, the entity DEPENDENT is a weak entity, since the existence of one of its instances depends on the existence of the corresponding instance in the EMPLOYEE entity type. Attribute: A property or characteristic of an entity type that is of interest to the organization. For example: name is an attribute of the entity STUDENT, similarly roll number also is an attribute of entity STUDENT. Key Attribute: An attribute that uniquely identifies individual instances of an entity type. For example, roll number is a key attribute of the STUDENT entity type. Each student has a unique roll number. 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. An ER Diagram is used for representing ER­Model. There are some standard symbols which are used in ER­diagram for representing entity, attributes etc. Following is a list of symbols used in ERD:

ER Diagram Notations Symbol

Meaning

1.

Entity Type

2.

Weak Entity Type

118


Hardware and Software: An Introduction

3.

Relationship

4.

Attribute

5.

Key Attribute

6.

Multi Valued Attribute

7.

Derived Attribute

E1

1

R

N

E2

Cardinality Relation 1: N for E1:E2 in R

The various types of Relationships are called the Degree of a Relationship which reflect the number of entities associated with a relationship. The n­ary 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

In a relationship entities are diagrammatically represented as follows:

ENTITY

OR Entity

a) One and only one instance of an entity

Entity

b) Zero or one instance of an entity

Entity

c) One or more (>1) instances of an entity

Entity

d) Zero or more (>0) instances of an entity

Entity

e) More than one (>1) instances of an entity

☞ Check Your Progress 2 1) State True/False for the following statements:­ a) ER model represent relationship between entities. b) Multivalued attribute can take only one value. c) In binary relationship only two entity types participate in a relation. d) An attribute is a property of an entity. 120


Hardware and Software: An Introduction

2) Explain the reasons why we study the E­R model of a database. ……………………………………………………………………………………… ……………………………………………………………………………………… ……………………………………………………………………………………… 3) What is “degree of a relationship”? Give a simple example for each of the three types of relationships described in this unit and draw the corresponding E­R diagrams. ……………………………………………………………………………………… ……………………………………………………………………………………… ……………………………………………………………………………………… 4) Explain term strong entity, relationship, simple attribute, derived attribute. ……………………………………………………………………………………… ……………………………………………………………………………………… ………………………………………………………………………………………

5.3.3

ER Models and Database Designs

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 ER­Diagram 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 E­R diagram for students who are having History as a subject: 1) In this case there are two entities Student and History. 2) Relationship between Student and History subject is that he has history as a subject. 3) Attributes of Student entity are ID, Name , Address, Course. 4) Attributes of History are Course, Teacher, Semester and Department.

Course

ID Cours e

121

Semeste r

Name

STUDENT

Teacher

Address

Has

HISTORY

Departmen t

Semeste r


Introduction to database management systems

Figure7: ER­Diagram of student and subject taken

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. Mapping of ER Diagram into a Database Design 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. If we take another example of a software company which handles many software projects. The company controls these projects which are managed by employees of the company. An employee supervises other employees who works on a project. 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. Here in this system we may have mainly three entities:

COMPANY

EMPLOYEE

PROJECT Entities and their attributes Entities COMPANY EMPLOYEE PROJECT

Attributes comp_name, comp_add, no_of_emp emp_id, ename, emp_add, sex project_id, proj_no, location

The various relationships which hold among these entities are: 122


Hardware and Software: An Introduction

Employee works for a Project

Company controls Projects

Employee works for company

Employee is assigned a Project

An ER­Diagram showing relationship among entities Company, Employee and Project is shown in Figure 8:

city street emp_name emp_add emp_id

comp_add

comp_name

sex

EMPLOYEE

COMPANY

Work for

Controls

domain PROJECT

assigned

proj_id

location proj_no

123


Figure 8: ER­Diagram for Company, Employee and Project

Introduction to database management systems

5.4 APPLICATIONS OF DBMS DBMS is a type of computer application dedicated to managing a database. Database applications span a huge variety of needs and purposes from small scale to large scale. The term database application usually refers to software for tasks like keeping and maintaining records. It is a software where you can easily access data, (Data Retrieval), insertion, deletion and updating of records. There are many DBMS available in market, some of these are: •

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: •

Banking and Insurances

Railways

Hospitals and Health Sector

Retail Marketing

IT industry BPO

Education

Transport

Manufacturing

Share Market

☞ Check Your Progress­3 1) State true/false for the following statements: a) Oracle is not a DBMS. b) MySQL is a DBMS. c) An ER­diagram gives a view of the system and entities of the systems. d) DBMS can not be used in the area of banking applications. e) In a student table, roll number can be a primary key of the table. 124


Hardware and Software: An Introduction

2) In daily life problems, where do you see the applications of database? ……………………………………………………………………………………… ……………………………………………………………………………………… ……………………………………………………………………………………… 3) Explain the importance of ER­Diagrams. ……………………………………………………………………………………… ……………………………………………………………………………………… ………………………………………………………………………………………

5.5 SUMMARY A Database management system (DBMS) can be seen as a software package which allows users to design, create, access and maintain and view data. In databases, you can store and maintain data property. You can present the database design pictorially in the form of ER­Diagram, The database system supports multiple views of the same data. For example, a clerk may only be able to see his details, whereas the manager can view the details of all the clerks working under him. In this unit we have discussed the types of databases, like relational, network and Hierarchical databases. We have discussed about the relation between the attribute values, entity types etc. We have discussed the two approaches for storming data in computers i.e file system approach and database approach. There are some limitations of File System Approach which includes data redundancy, data independence and difficult to get quick answers to simple queries. So, database approach is brought into practice for handling data properly and efficiency.

5.6 SOLUTIONS AND ANSWERS Check Your Progress 1 1)

(i) F (ii) F (iii) T (iv) F (v) F 2) Features of Hierarchical Database: (i) Features of Hierarchical Database can be defined as a set of record "types" for example supplier record type, department record type, part record type (ii) A set of links connecting all record types in one data structure diagram (tree) (iii) At most one link between two record types, hence links need not be named (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 management systems

(v) No connections between occurrences of the same record type . 3) Restrictions in Network Data Model (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)

Check Your Progress 2 1) (a) T (b) F (c) T (d) T 2) The E­R model of a database is studied because: (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. 3) “Degree of a relationship” is the number of entity types that participate in a relationship. Unary relationship is a relationship between the instances of a single entity type. Binary relationship is a relationship between the instances of two entity types. Ternary relationship is a relationship among the instances of three entity types.

Sex Name

is married to

Name

Person

Figure 9(a): Unary Relationship

Course_No

Id_No

Course Name

Stud_name

Student

Takes

Course

126 Figure 9(b): Binary Relationship


Hardware and Software: An Introduction

Course No.

Contact No.

Name

Course Name

Address

Professor

Teaches

Course

Classroom

Size

Classroom No.

Figure 9 (c) : Ternary Relationship

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. Relationship: Entity relation is a meaningful association between (or among) entity types. For example, the relation between STUDENT and COURSES OFFERED entity types is that each student in the University takes some of the courses offered in the University. Simple Attributes: It is different from composite attributes, it cannot be broken down into smaller components. For example, in STUDENT entity type. Roll Number is a simple attribute, while Name is a composite attribute since it consists of First Name and Family Name. 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


Check Your Progress 4

Introduction to database management systems

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) ER­diagrams makes the task easy by giving a view of real world which consists of set of objects. An ER­Diagram represent entities and relationship among them. ER­Diagram is very useful for creating tables of a database.

5.7 FURTHER READINGS AND REFERENCES 1) Elmasari, Navathe, “Fundamentals of Database Systems”, Addision Wesley, New Delhi. Year 2000. 2) Korth,Silbertz,Sudarshan, “Database Concepts”. McGraw Hill, Singapore, Year 2002. 3) Date C J. “ An Introduction to Database Systems”, Addision Wesley,New Delhi,Year 1986.

Reference Web Link: http://www.databasedev.co.uk/

128


UNIT 1

ALGORITHM AND FLOW CHART

Structure 1.0 Introduction 1.1 Objectives 1.2 Problem Solving 1.3 Algorithm 1.3.1 Examples of Algorithm 1.3.2 Properties of an Algorithm 1.4 Flow Chart 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 1.6 Solutions/Answers 1.7 Further Readings and References

Algorithm and Flow Chart

Page Nos. 05 05 06 06 11

18 18 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 After going through this unit you should be :

able to define problem;

able to define algorithm;

write algorithms for simple problems;

explain properties of an algorithm;

the meaning of flowchart;

explain the need of flow chart;

explain different symbols used in flow chart;

draw flow chart for simple problems; and

5


Problem Solving Techniques

convert a flow chart into an algorithm and vice­versa.

1.2 PROBLEM SOLVING 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 time­table. So here picking up books and copies as per time­table 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 Algorithm can be defined as: “A sequence of activities to be processed for getting desired output from a given input.” 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


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:

Algorithm and Flow Chart

1. Getting specified output is essential after algorithm is executed. 2. One will get output only if algorithm stops after finite time. 3. Activities in an algorithm to be clearly defined in other words for it to be unambiguous. 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: ‘+’ for Addition ‘­’ for Subtraction ‘*’ for Multiplication ‘/’ for Division and ‘’ for assignment. For example AX*3 means A will have a value of X*3

1.3.1

Example of Algorithm

Problem 1: Find the area of a Circle of radius r. Inputs to the algorithm: Radius r of the Circle. Expected output: Area of the Circle Algorithm: Step1: Read\input the Radius r of the Circle Step2: Area PI*r*r // calculation of area Step3: Print Area 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. Inputs to the algorithm: i.Percentage of Attendance Required ii.Total Number of Classes iii. Number of Classes held so far iv.Number of classes attended so far by Ravi Expected output: Number of classes to be attended to become eligible for appearing in examination Algorithm: Step1: Read Total Number of Classes C

7


Problem Solving Techniques

Step2: Read Percentage Required P Step3: Read Classes already attended Ca Step4: Total Classes to be attended Ct C*P/100 Step5: More Classes to be attended CmCt­Ca Step6: Print Cm

Problem 3: Convert temperature Fahrenheit to Celsius Inputs to the algorithm: Temperature in Fahrenheit Expected output: Temperature in Celsius Algorithm: Step 1: Read Temperature in Fahrenheit F Step 2: C 5/9*(F­32) Step 3: Print Temperature in Celsius: C 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. Inputs to the algorithm are: 1. amount of different items purchase, for example 2.0 kg Apple etc. 2. price of the items, for example Mango is Rs. 35.0 per kg 3. total amount given to the shopkeeper 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


Spet2: Read amount purchased and unit price of itemi

Algorithm and Flow Chart

Step3: Total Total + amount of itemi* price per unit of itemi Step4: i i+1 Step5: Repeat Step 2 to 4 for each purchased item Step6: Read Total amount given to the shopkeeper as GivenAmount Step7: RefundAmount  GivenAmount­Total Step8: Print amount to be refund is Rs.: RefundAmount Step9: Print total item purchased are: i Problem 5: Find factorial of N. Inputs to the algorithm are: 1. Number N Expected output: Factorial of N Algorithm: Step 1 : Result R1 Step 2: I 1 Step 3: Read the Number N Step 4: Compare I with N Step 5: If I <=N Then R  R*I ,Otherwise GOTO Step 8 Step 6: I I+1 Step 7: Repeat Step 4 and 6 Step 8: Print R Problem 6: Print the Table of N. Inputs to the algorithm are: Number N Expected output: Table of N Algorithm: Step 1: I1 9


Problem Solving Techniques

Step 2: Read N Step 3: If I <= 10 then Print I*N otherwise GOTO Step 6 Step 4: I I+1 Step 5: Repeat Step 3 and 4 Step 6: Stop

1.3.2

Properties of algorithm

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.

2) Definiteness: Each step of an algorithm must be precisely defined. It is done by well thought actions to be performed at each step of the algorithm. Also the actions are defined unambiguously for each activity in the algorithm.

3) Input: Any operation you perform need some beginning value/quantities

associated with different activities in the operation. So the value/quantities are given to the algorithm before it begins.

4) Output: One always expects output/result (expected value/quantities) in terms of

output from an algorithm. The result may be obtained at different stages of the algorithm. If some result is from the intermediate stage of the operation then it is known as intermediate result and result obtained at the end of algorithm is known as end result. The output is expected value/quantities always have a specified relation to the inputs.

5) Effectiveness: Algorithms to be developed/written using basic operations. Actually operations should be basic, so that even they can in principle be done exactly and in a finite amount of time by a person, by using paper and pencil only. 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.

☞ Check Your Progress 1 1) What is an 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. ……………………………………………..……………………….. ………………………………………………………………………………………… ………………………………………………………………………….. ………………………………..

5) State True/False for the following statements: i) An algorithm should take finite amount of time to compete. ii) Ambiguous steps are allowed in an algorithm. iii) Complex problems can not have an algorithm. iv) For any problem algorithm can be developed. v) A correct algorithm always gives expected output.

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.

1.4.1 Flowchart Symbols For drawing flow chart standard symbols are used. These symbols are given in Table 1. Table1: Flow chart Symbols Symbols

Meaning/Used for Start or end of the programme

Used for writing steps of operations/action or processing function of a programme Input or output operation

Decision making and branching operations

Connector or joining of two parts in a flow chart

Flow line used for showing flow of data

Magnetic Tape used for secondary storage/Backup

Magnetic Disk used for secondary storage/Backup 12


Algorithm and Flow Chart

1.4.2 Meaning of Flowchart A flowchart is a diagrammatic representation of algorithm. It clearly illustrates the sequence of operations to be performed for getting the solution of a problem. For simple problems flow charts may not be very useful but for complex and large problems flow chars are very helpful in understanding the logic of the problem. Flowcharts are used as a link of communication between programmers and clients for whom the program to be developed. If you are having a flowchart for your program then you can use it in explaining the program to others. Once the flowchart is drawn, it becomes easy to write the computer program. Flowcharts can be used for preparing a better documentation of a complex problem.

1.4.3 Guidelines for drawing A Flowchart Flow charts are drawn using slandered flowchart symbols. While drawing flowchart some guideline to be followed. Below are some guidelines for drawing flowchart: 1) First of all list all necessary requirements in a logical order. 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

A compare B

A > B

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

Where P = Price, A = Amount, and R = Rate 8) In the case of complex flowchart connector symbols to be used for reducing the number of flow lines in the flowchart. 9) Intersection of flow lines should be avoided to make a flowchart more effective and for better way of communication.

10) A flowchart must have a logical start and end. 11) Once a flowchart is drawn its validity should be tested by passing through it with a simple set of test data.

1.4.4 Some examples of Flowcharts 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 I = I + 1

IS I = N ? YES PRINT F

14 END


Algorithm and Flow Chart

Figure 1: Flowchart for factorial N

Some more examples of flowchart: Problem 1: Find the area of a circle of radius r. START

READ r

AREA = 3.14 * r * r

PRINT AREA

END

Figure 2: Flowchart for finding area of a circle.

START

Problem 2: Ravi has to attend at least 70% of Practical Classes for C Programming to be READ C eligible to appear in the examination. There are total 50 Practical Classes for C READ P Programming. He has already attended 20 out of 30 classes held so far. Find at least how READ Ca many classes to be attended by Ravi to be eligible for appearing in Practical Examination. * Total number of classes C * Percentage Required P Ct = C * P/100 * Number of Classes Already Attended C a * Number of Classes to be Attendended C Cm = Ct t – Ca * More classes to be attended Cm

PRINT Cm

END

15


Problem Solving Techniques

Figure 3: Flowchart for checking eligibility to appear in practical exam.

Problem 3: Convert temperature Fahrenheit to Celsius. START

READ F

C = 5/9 * (F – 32)

PRINT C

END

Figure 4: Flowchart for convert I to C.

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. * Apple Price AP * Mango Price MP 16

* Apple Amount AW * Mango Amount MW


* Potato Price PP * Tomato Price TP * Amount Given AM

* Potato Amount PW * Tomato Amount TW * Return Amount RAM

Algorithm and Flow Chart

START READ AP, MP, PP, TP

READ AW, MW, PW, TW READ R TOTAL = AP*AW + MP* MW + PP* PW + TP*TW RAM = AM – TOTAL PRINT RAM

RETURN END

Figure 5: Flowchart for cost calculation and return amount

Problem 6: Print the Table of N START

READ N

I = 1

I > 10

NO R = I * N I = I + 1

YES END

PRINT R

Figure 6: Flowchart for printing table of N

1.4.5 Advantages of using Flowcharts 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) Effective analysis: A flowchart of a problem can be used for effective analysis of the problem.

3) Documentation of Program/System: Program flowcharts are a vital part of a good program documentation. Program document is used for various purposes like knowing the components in the program, complexity of the program etc.

4) Efficient Program Maintenance: Once a program is developed and becomes

operational it needs time to time maintenance. With help of flowchart maintenance become easier. 5) Coding of the Program: Any design of solution of a problem is finally converted into computer program. Writing code referring the flowchart of the solution become easy.

1.4.6

Limitations of using Flowcharts

1) Complexity of Logic: If program logic is complex then flowchart of the program becomes complicated. 2) Alterations and Modifications in Logic: any alterations in the program logic may require re­drawing of flowchart completely. 3) Reuse is Not Possible: As the flowchart symbols cannot be typed, always reproduction of flowchart symbols are required.

☞ Check Your Progress 2 1) Fill in the blanks: i) A program flowchart indicates the_________ to be performed and the __________ in which they occur. ii) A program flowchart is generally read from _____________ to ______________ iii) Flowcharting symbols are connected together by means of__________________ iv)

Connectors are used to join ______________portions of a flowchart.

v) The __________is one of the best ways of representing a program. 2) Explain steps involve in drawing of a flowchart. …………………………………………..……………………….. ………………………………………………………………………………………… …………………………………………………………... …………….. …………………………………..

18


3) Explain uses of Flowchart. ……………………………………………..………………………..

Algorithm and Flow Chart

………………………………………………………………………………………… …………………………………………………………... …………….. ……………………………….. 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 input­output activity. 2) Algorithms are developed for solving problems. A 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. Randomly writing any sequence of activity will never solve any problem and selection of activities for solving a problem need to have certain basic norms and those norms are considered as characteristics of an algorithm. So the algorithms are required for solving problems. 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 Player­I 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

Check Your Progress 2 1) i) Steps, order ii) Top –bottom, left­right 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 easy­to­understand diagrams. Flowcharts show how steps in a process are working together. This feature makes flowchart useful tools for communicating 20


how processes work. Also flowcharts help in clearly documenting how a particular job is done. A flowchart is useful in: •

Defining and analyzing processes of a system;

For presenting a step­by­step picture of the process for analysis and communication to the clients and users of the system.

Algorithm and Flow Chart

4) The required flowchart is given in Figure given below: START

SUM = 0

N=0

N = N + 1 SUM = SUM + N

YES IS N = 100?

NO

YES

PRINT SUM

START END

Figure 7: Flowchart for sum of first 100 natural numbers

READ X, Y,

Z

5) A flowchart to find the largest of three numbers x, y and z.

YES

Y > Z

NO

X>

YES

Y

X >Z NO

PRINT

PRINT

Y

Z

END

YES

PRINT X

21


Problem Solving Techniques

Figure 8: Flowchart for finding out the largest of three numbers

1.7 FURTHER READINGS AND REFERENCES 1) Block 1(Introduction to Algorithms) of MCS­031­ Analysis and Design of

Algorithm, IGNOU MCA Course, Year 2005. 2) Programming in C by R Subburaj, Vikas Publishing House, Delhi, Year 2000. 3) Complete Knowledge in C by Sukhendu Dey and Debobrataa Dutta, Narosa Publishing House, Delhi, Year 2009.

Reference Web Links: i) ii) iii) iv)

22

http://www.webopedia.com/TERM/a/algorithm.html http://www.scriptol.org/computer­algorithm.html http://www.edrawsoft.com/flowchart­symbols.php http://www.softpanorama.org/Algorithms/flowcharts.shtml


Problem Solving Techniques

UNIT 2 PROBLEMS SOLVING USING C PROGRAMMING LANGUAGE Structure 2.0 Introduction 2.1 Objectives 2.2 Execution of a C Program 2.3 Structure of a C Programme 2.4 Basic Components of C Programming

Page Nos. 22 22 23 23 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.6 2.7 2.8 2.9 2.10

42 43 44 44 46

2.5.1 Sequential Statement 2.5.2 Conditional Statements ( if, if­else if, switch­case) 2.5.3 Iterative Statements (for loop, while loop, do­while loop)

Array in C Use of C Programming Language Summary Solutions/Answers Further Readings and References

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 After going through this unit you should be :

• • • • • • 22

explain the need of C programming language; explain C program structure; explain basic components of C program; write simple C program; explain sequential, conditional, iterative statements, and use array variables in C programs.


Problem Solving Techniques

2.2 EXECUTION OF A C PROGRAM C is a high level programming language. It is having a rich set of library. A library is a collection of specific programs/functions used in different programs. When we write our programs in C , there are libraries of functions to help us so that we do not have to write the same code over and over. Using the library functions will also make it easier to write and learn to program. You can take a function as a module often consisting of a set of statements to perform specific task. Process of execution of a C program is given in Figure 1. C Library

MyPrg.c

MyPrg.o

Compile

Source File (C Program)

Link

Object File (Machine Languages)

MyPrg Executable File

Figure1: Process of Execution of a C Program

2.3 STRUCTURE OF A C PROGRAM 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 1. /* This is My First C Program */ 2. #include <stdio.h> Comments. 3. /* The First C Program to print Hello World */ 4. int main( ) The main() function is always the point from where your 5. { program starts running. 6. printf(“Hello World\n”); 7. return 0; Print out a message and ‘\n’ means “new line 8. } character”.

Return ‘0’ from main function A blocks of code are marked by { … }

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


file. “.h”> is used for calling “header” files. These header file contain methods for performing needed tasks. All header files have interface to libraries and their cod for performing task is kept in other “.c” files.

Problems Solving using C Programming Language

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: 1. program header comment 2. preprocessor directives (if any) 3. int main ( void ) 4. { 5. statement(s); 6. return 0 ; 7. } Now let us see the meaning of each line of this structure: i) Program Header Comment: A comment is description used for clarification. It helps a reader of the program understand the purpose or functionality of statements in the program. A C program may have several comments in whole program. It is good to have comment in the beginning of a program which state about the objective of the program for which it is used. How to write a Comment? 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. ii) Preprocessor Directives: 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: printf(“Hello World\n”); statement in program given in previous page function printf( ) is defined in stdio.h and has been included in that program. 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. Prototype for writing a function is: return type function_name ( arguments) 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: int sum( int a, int b) 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


v) Statement(s): These are the main portion of any program. Statements written in a program decides about the activity to be performed such as input operations, output operations, logical operations etc.

Problems Solving using C Programming Language

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.

2.4 BASIC COMPONENTS OF PROGRAMMING 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.

2.4.1 Tokens and Keywords 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: auto break case char const continue static

default do double else enum extern void

float for goto if int volatile

register return short signed sizeof long

struct switch typedef union unsigned while

Now let us learn about data types and variables in C.

2.4.2 Data Type and Variables in C 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. Table 1: Data Types in C

Data Type Char Int

Size( in Bytes) 1 2

Meaning Character Integer

Float

4

Floating point

double

8

Long floating point

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


While you declare variables you may give explanatory comment for more clarification. 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:

Problems Solving using C Programming Language

int high = 25; /* Maximum Length */ int low = 10; /* Minimum Length */ 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. Different operators perform different kind of operations such as arithmetical operations, logical operations etc .In next section we will learn about different operators in C.

2.4. 3 Operators and Punctuations in C 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) ii) iii) iv) v)

Arithmetic Operator Assignment Operator Comparison Operator Logical Operator 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 Commonly used arithmetic operators in C are + Addition Example 4+6 will give 10 ­ 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 % Modulos (give remainder from integer division) Example 5%2 will give 1 Assignment and Expressions 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. A simple expression is an assignment statement. An expression is evaluated and the result is saved in a variable. For example expression: a = (i * j) + k , the result will be saved after evaluating : (i*j)+k in variable a. The result will be saved after evaluation. In any expression, operators *, / and % will be performed before + or ­. If you want to have different order of evaluation the you have to use brackets. Any expression in brackets will evaluate first. For example, if you write expression: 2 + 4 * 3 as : (2+4)*3 then you will get 18. One important point to note about / operator is that when division is performed between two integers, the result will be an integer, and remainder is discarded. For example if expression: 15/4 is evaluated it will give 3 as result. You can use modulus operator(%) between integers only. Never divide a number by zero in your program, this will cause an error, and usually due to this your program will crash (will terminate abnormally). Some examples of operators, according to precedence. 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 ii) Assignment Operator 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


Problem: Write a program in C to find a+b , a­b , a*b, a/b, and a%b. The value of a is 10 and the value of b is 5.

Problems Solving using C Programming Language

C Program for showing use of arithmetic operators /* C program for arithmetic operations */ #include <stdio.h> int main( void ) { int a= 10; /* a is initialized with value 10 */ int b = 5 ; /* a is initialized with value 10 */ printf(“a+b = %d\n”,a+b) ; printf(“a­b = %d\n”,a­b) ; printf(“a*b = %d\n”,a*b) ; printf(“a/b = %d\n”,a/b) ; printf(“a%b = %d\n”,a%b) ; return 0 ; } When you will run this program following output will come: a+b = 15 a­b = 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. /* C program for arithmetic operations */ #include <stdio.h> int main( void ) { int a, b /* a and b are declared */ printf(“Give vale of a: ”); scanf(“%d”,&a); printf(“Give vale of b: ”); scanf(“%d”,&b); printf(“a+b = %d\n”,a+b) ; printf(“a­b = %d\n”,a­b) ; printf(“a*b = %d\n”,a*b) ;

30


Problem Solving Techniques

printf(“a/b = %d\n”,a/b) ; printf(“a%b = %d\n”,a%b) ; return 0 ; } When you will run this program following output will come: Give vale of a: 20 Give vale of b: 4 a+b = 24 a­b = 16 a*b = 80 a/b = 5 a%b = 0

Special Operators ++ and ­­ In C some operators allow abbreviation of certain types of arithmetic assignment statements. These operators are ++ and ­­. i++ or ++i is equivalent to i = i+1; i­­ or ­­i is equivalent to i = i­1; /* Arithmetic operators */ #include <stdio.h> Now let us see an example program which shows how to use ++ and ­­ : \* C program to show the use of ++ and ­­ *\ int main(void) { int a,c; int b=10; a=5; c= a+b; \* C is assigned 10+5 *\ printf(“Sum: %d + %d ­> %d\n”,a,b,c); a++; b­­; prinf(“Now a=%d \n”,a); prinf(“Now b=%d\n”,b); c= a+b; \* C is assigned 9+4 *\ printf(“Now Sum is: %d + %d ­> %d\n”,a,b,c); return 0; } iii) Comparison Operator 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 == > < >= 31

Meaning Equal to Greater than Less than Greater than equal to


<= !=

Less than equal to Not equal to

Problems Solving using C Programming Language

These comparison operators are used in expression like: I == J Marks> 10 Marks !=100 Example of use of comparison operator int x= 5; (x < 10)  (4 < 10)  true (x = = 5)  (5 = = 5)  false 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. iv) Logical Operators AND, OR and NOT are the commonly used logical operators in C. Operator Meaning | | OR && AND ! NOT a || b will be true if either of a or b is having value true. It will be false only if both a and b are having false value, a && b will be true if both a and b are having true value, otherwise false. If a is true then !a will be false. 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. 25 >=18 && 25<=30  true && true  true We can come to conclusion that false && anything is always false, true || anything is always true. Punctuation In C programming language Semicolons(;), colons(:), commas( , ), apostrophes( ‘), quotation marks(“), braces( [ ]) , brackets( { } ), and parentheses( ( ) ) ; : , ‘ “ [ ] { } ( ) are punctuation symbol.

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

 Check Your Progress 1 1) State True/False for the following statements:

i)

A program in C is compiled before running it. ii) C is a case sensitive language. iii) For storing an character value variable of integer type is used. iv) In C register is a valid variable name. v) In C ++ is an operator. 2) Fill in the Blank:

i)

ii) iii) iv) v)

C is a ­­­­­­­­ language For storing integers ­­­­­­­­­ data type is used. #include is a ­­­­­­ The symbol of assignment operator is­­­­ ‘*’ 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.

2.5 STATEMENTS IN C PROGRAMMING A program consists of statements. These statements may be a variable declaration, arithmetical expression, logical expression, call of a function etc. According to the nature of statements belong to different category. These categories are: 33


Sequential Statement

Conditional Statement

Iterative/Loop Statement

2.5.1

Problems Solving using C Programming Language

Sequential 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.

2.5.2

Conditional Statements

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. Age >= Age required for voting 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: 1. Who will be appearing in examination 2. Who will not be appearing in examination On the basis of percentage of attendance of student. The condition is that ­ if a student is having 75 % or more attendance will be appearing in the examination otherwise not. To decide whether a student will be appearing in examination or not, you need to compare his percentage of attendance with 75 (the percentage of attendance required to appear in exam), and then make a decision about what to do next. • • • •

In C there are some conditional statements: if if­else if­else if swithch­case are there for performing conditional operation. Now we will discuss about if, if­else, and if true if­else if, and switch­case one by one. Below is the flow chart of if statement. (condition)

false

statements 34


Problem Solving Techniques

Figure 2: Flowchart for if statement

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. /* if evaluated expression is not 0 */ if (expression) { /* then execute this block */ } /* Continue other operations in sequence*/ /*Example program to test whether a given number is greater than 10 */ #include <stdio.h> void main(void) { int num = 20; /* initialize num by 20*/ if( num > 10) { printf(“The number is greater than 10\n”); } printf(“The number is:%d”,num); return 0; } The output of this program will be: The number is greater than 10 The number is:20 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 if­else is

35

if(consition) { /* if condition is true this block will execute*/


Problems Solving using C Programming Language

statement(s) } else { /* condition is false this block will execute */ statement(s) } if­else also work similar to if statement. The only difference between if and if­else is that in if after finding condition true a set of statement(s) is executed and in if­else 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 if­else statement.

false

if (condition)

true

statementj

statementi

statements

Figure 3: Flowchart for if­else statement

You can say that to decide between two courses of action if­else 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"); }

Another conditional statement is if­elseif­else.This statement is also known as ladder if statement. Flowchart for if­else if­else is given below.

36


Problem Solving Techniques

if

false

(conditi

true

on)

false

else if

statementi

true

(conditi on)

false

else if

statementj

true

(conditi on)

statementl

statementk

Figure 4: Flowchart for if­else if

This conditional statement is used in situations where you wish to make a multi­way decision based on certain conditions. The way of doing such type of testing is by using several else­if 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. if (Marks >= 75) { printf("Passed and Grade is A\n"); } else if (Marks >= 60) 37


{ printf("Passed and Grade is B\n"); } else if (Marks >= 45) { printf("Passed and Grade is C\n"); } else { printf("Failed\n"); }

Problems Solving using C Programming Language

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 switch­case. This statement work similar to if­else­if statement. The switch­case 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 switch­case 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 switch­case. 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.

2.5.3 Iterative Statements 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. There is concept of loop in C programming. Conceptually a loop is like a circle. If you walk on border of a circle after completing a round you will reach to the same point. There may be a set of statements in a program which are executed several time. Such statements are called iterative statements. This concept helps in writing such program where same code is repeated several time. You can only write once that code in a loop and run the loop as many time as required. In the next section we will discuss about for and while loop of C. Loops in C In C you have a choice of three types of loop while, do­while 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

39

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);


}

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: //Programe for finding sum of series: 1+2+3+4+……………..+n #include <stdio.h> void main(void) { int i,n,sum=0; printf(“Give the Number of n:”); scanf(%d”,&n); for( i=1; i<= n; i++) { sum = sum+i; } printf(“The sum of the series is: %d”,sum); return 0; } If you run this program and give 5 as value of n then it will print: The sum of the series is:15 The while Loop

40


Problem Solving Techniques

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 while­loop you will get clearer picture of working of this loop. Below is the Flowchart for while­loop:

True

while (conditi on)

False

operation/statements

Figure 5: while loop flowchart

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: //Programe for finding sum of series: 1+2+3+4+……………..+n #include <stdio.h> void main(void) { int i,=1; int n,sum=0; printf(“Give the Number of n:”); scanf(%d”,&n); while ( i<= n) { sum = sum+i; i=i+1; } printf(“The sum of the series is: %d”,sum); return 0; } If you run this program and give 7 as value of n then it will print: The sum of the series is:28 41


Problems Solving using C Programming Language

The do­while Loop 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 do­while 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 do­while­loop:

do statements

while (conditions)

True

False

Figure 6: Flowchart for do­while loop

Syntax of do­while loop: do { statement(s) } while (condition) For example the statements : printf("Enter 1 for exit from loop"); scanf("%d", &input_value); will repeatedly run inside the do­while 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


int results_3d[20][5][3]; Here each of the index has its own set of square brackets.

Problems Solving using C Programming Language

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. /* Finding average marks using array variable*/ #include <stdio.h> int main(void) { int Marks[6], sum =0; for ( int i=0; i <6; i++) { printf("Give the Marks of Subject %d:",i+1); scanf("%d",&Marks[i]); sum = sum+Marks[i]; } printf("The average percentage Marks of the Semester is:%d",sum/6); return(0); } 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.

2.7 USES OF C PROGRAMMING LANGUAGE C is extensively used for developing applications in various area of computer applications. Initially, it was used for system development work, for example, in developing the operating system. You may ask why C is used in these areas? It is mainly because it produces code that runs very fast. You can say nearly as fast as code written in assembly language. Here is some examples of the use of C : Operating Systems Language Compilers Assemblers Text Editors Print Spoolers Network Drivers Data Bases Program Language Interpreters Utility Programs

 Check Your Progress 2

44


Problem Solving Techniques

1) State True/False for the following statements: i) switch­case statement is used for the multi way decisions. ii) C programming language can not be used for writing device drivers. iii) if statement is conditional statement. iv) while loop and do­while loop are same. v) An array is a collection of variables of different data type. 2) Write a C program to find largest among three numbers. ………………………………………………………………………………………… ………………………………………………………………………………………… …………………………………………………………………………………………. 3) Write a C program to find sum of series: 12 +22 + 32 +…… + 102. ………………………………………………………………………………………… ………………………………………………………………………………………… …………………………………………………………………………………………. 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, switch­case, for loop, and while loop. In the last of this unit you were introduced to the concept of array variable.

2.9 SOLUTIONS/ANSWERS Check Your Progress 1 1) i) True ii) True iii) False iv) False v) True 2) i) programming ii) int iii) directive 45


iv) = v) multiplication

Problems Solving using C Programming Language

3) \* Program for multiplication *\ #include <stdio.h> int main( void ) { int num1, num2, product ;\* Three variable of integer type declared *\ printf(“Enter First Integer Value: “) ; scanf(“%d”, &num1) ;\* read num1 *\ printf(“Enter Second Integer Value: “) ; scanf(“%d”, &num2) ;\* read num2 *\ product = num1 * num2 ; \* product of num1 and num2 *\ printf(“The Product = %d\n”, product) ; return 0 ; } 4) /* Appication of Arithmetic Operators on floating point numbers */ #include <stdio.h> int main() { float a,b; printf("Give the first number:"); scanf("%f",&a);

printf("Give the second number:"); scanf("%f",&b); printf("a+b=%f\n",a+b); printf("a­b=%f\n",a­b); printf("a*b=%f\n",a*b); printf("a/b=%f\n",a/b); return 0; }

Check Your Progress 2 1) i) True ii) False iii) True iv) False v) False

2) /* Program to find largest among three numbers */ #include <stdio.h> #include<conio.h> main() { int num1,num2,num3; clrscr();

46


Problem Solving Techniques

printf("Eenter three enteger values\n"); scanf ("%d%d%%d",&num1,&num2,&num3); if ((num1>num2)&&(num1>num3)) { printf("%d is greatest\n",num1); } else if((num1<num2)&&(num2>num3)) { printf("%d is greatest\n",num2); } else { printf("%d isgreatest\n",num3); } } 3) //Programe for finding sum of series: 12 +22 + 32 +…… + 102. #include <stdio.h> void main(void) { int i=1; int,n = 10,sum=0; printf(“Give the Number of n:”); scanf(%d”,&n); while(i<= n) { sum = sum+i*i; i = i+1; } printf(“The sum of the series is: %d”,sum); return 0; } 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.

47

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];


} printf("The Largest Number in the List is %d:",Max); return(0); }

Problems Solving using C Programming Language

2.10 FURTHER READINGS AND REFERENCES 1) Programming in C by R .Subburaj, Vikas Publishing House, Delhi, Year 2000. 2) Complete Knowledge in C by Sukhendu Dey and Debobrata Dutta, Narosa Publishing House, Delhi, Year 2009.

Reference Web Links: i) http://www.le.ac.uk/cc/tutorials/c/ccccover.html ii) http://www.lysator.liu.se/c/bwk­tutor.html iii) http://en.wikipedia.org

48


Fundamentals of Data Communication

UNIT 1 FUNDAMENTALS OF DATA COMMUNICATION Structure

Page Nos.

1.0 Introduction

Objectives Data and Signal Physical Connection

5 5 6 7

1.4 Data Transmission Mode

8

1.1 1.2 1.3

1.3.1 Serial Transmission 1.3.2 Parallel Transmission 1.4.1 Asynchronous Transmission 1.4.2 Synchronous Transmission

1.5 Modem

10

1.6 Speed of data transmission 1.7 Modes of data transmission

14 14

1.5.1 1.5.2 1.5.3 1.5.4 1.5.5

What is Modem? Use of Modems Types of Modems Working of Modem Connecting a Modem

1.7.1 Simplex Mode 1.7.2 Half Duplex Mode 1.7.3 Full Duplex Mode

1.8 Summary 1.9 Solutions/Answers 1.10 Further Readings and References

1.0

17 17 20

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

After going through this unit, you should be able to: •

define basic constituents of communication system;

understand different types of Signals i.e. digital signal and analog signal;

list types of transmissions; 5


Networking and Communication

1.2

explain internal working of a modem; and

specify speed of data transmission.

DATA AND SIGNAL

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. In the most fundamental sense, communication involves implicitly the transmission of information from one point to another through a succession of processes. Information being sent is also referred to as data. Data and signals are the two basic building blocks of computer networks. Data transmitted over any communications medium is either digital data or analog data. Analog data (Figure 1 (a)) refer to continuous nature (or states) whereas digital data (Figure 1(b)) refer to discrete states. For example analog watch continuously gives you information in term of hour, minutes and second. Digital data, on the other hand moves suddenly from one to another i.e. 8:30 p.m. to 8:31 p.m. Data is transmitted with a signal and it can take any form either digital signal or analog signal. 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.

Figure 1: (a) Analog signal

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

1)

Digital data converted to a digital signal

2)

Digital data converted to an analog signal

3)

Analog data converted to an analog signal


4)

Analog data converted to a digital signal

Fundamentals of Data Communication

Each of these combinations has different mechanism to representation internally.

1.3

PHYSICAL CONNECTION

In this section, we are going to cover two types of physical connection, namely Serial Transmission and Parallel Transmission.

1.3.1 Serial Transmission In data communication, serial transmission (Figure 2 (a) refers to the sequential transmission of signal and data. The bits are sent sequentially over a single line. It is because serial transmission requires less signal processing and it is less prone to error than parallel transmission of data or signal. The serial transmission is preferred for longer distance transmission of data as a check digit or parity bit can be sent along it easily. DIFFERENT MODES OF DATA TRANSMISSION

Figure 2:(

Figure 2:( 1.3.2 Parallel Transmission In data communication, parallel transmission (Figure 2(b)) refers to simultaneous transmission of the signal or data. The bits are sent separately through different paths simultaneously. For parallel transmission it requires multiple electrical wires for transmitting multiple bits simultaneously. Transmission of multiple bits simultaneously leads to higher data transfer rates than serial transmission. In parallel data transmission, electrical wires are less reliable for long distances because of error and corrupt transmissions.

7


Networking and Transmission Communication

Advantages

Serial

Fast transfer rates

Parallel

Long distances

1.4

Disadvantages Short distances only, More cost due to more number of lines Slow transfer rates Less cost due to only one line

DATA TRANSMISSION MODE

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:

Figure 3: Data transmission mode

Let’s understand the communication system with help of an example: 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


each other in pure digital pulses (serial and parallel). Transmitting digital 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 data­formatting methods which are used to make sure the transmitting computer and the receiving computer(s) are synchronized: Asynchronous (character­framed) and Synchronous (message­framed). Both methods are used to identify intelligence transmitted in the form of serial bit streams.

1.4.1

Fundamentals of Data Communication

Asynchronous Transmission

Asynchronous transmission of data is commonly found in landline communications systems and some forms of teletype communications. Generally, asynchronous, or character­framed, transmission is used to transmit seven­ or eight­bit data, usually in ASCII (American Standard Code for International Interchange) character format. Each character has a specific start and end sequence—usually one start bit and one or two end (stop) bits. Figure 4 illustrates the transmission format of an asynchronous data stream. 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 character­by­character 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.

Figure 4: Asynchronous data transmission

1.4.2

Synchronous Transmission

Most tactical digital information links communicate using synchronous messages. Synchronous transmission is a more sophisticated method of data transmission. It sends data in long uninterrupted streams, with a predefine start and stop sequence. The start sequence is generally referred to as the preamble. The principal function of the preamble is to alert the receiver of incoming data and provide a reference to synchronize the receiver with the transmitted signal. Following the preamble is a start code that informs the receiving equipment of the beginning of the message data. The basic format of the synchronous data message is shown in Figure 5. The incoming bit stream is then used to synchronize the receiver timing. A stop code follows the message data to indicate the end of transmission.

Figure 5: Synchronous data transmission

9


Networking and Communication

F Check Your Progress 1 1) Differentiate analog data and digital data? ………………………………………………………………………………………… ………………………………………………………………………………………… ………………………………………………………………………………………… 2) Write down the three basic elements of a communication system? ………………………………………………………………………………………… ………………………………………………………………………………………… ………………………………………………………………………………………… 3) Write down the two different data formatting methods? ………………………………………………………………………………………… ………………………………………………………………………………………… …………………………………………………………………………………………

1.5

MODEM

In this section we will discuss several issues related to a Modem. 1.5.1

What is Modem?

Modem is an acronym for modulator demodulator. The meaning of the word modulator is to change and the meaning of the word demodulator is to unchange or restore to an original condition. A modem is a communication device that converts (i.e., modulate) binary signal into analog signals for transmission over telephone lines and converts (i.e., demodulate) these acoustics analog signals back into binary form at the receiving end. 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. The Figure 6 shows the data transmission through modem

10


Fundamentals of Data Communication

Figure 6: Data transmission through a modem

1.5.2

Use of Modems

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 face­to­face 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: • Exchange data directly with other computer users • Access an online service or the Internet to gather information or to distribute information about anything, anywhere • Exchange electronic mail • Play interactive online games • Make hotel or airline reservations • Check stock prices • Online Shopping • Online enrollment with the course, the list is exhaustive.

1.5.3

Types of Modems

There are two basic types of modems: 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 e­mail 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.

1.5.4

Working of a Modem

A full­duplex modem consists of two sections: the transmitter and the receiver. These two sections are functionally separate from each other. In order to make a connection using a modem you need the following: 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


1.5.5 Connecting a Modem

Fundamentals of Data 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 RJ­11 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.

Figure 7: Connection to an external modem with telephone line

Figure 8: Different types of connecting wires

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 25­pin male connector at one end and a 25­hole female connector at the other end. 2) Plug the female connector into an open 25­pin 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.

F Check Your Progress 2 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? ………………………………………………………………………………………… ………………………………………………………………………………………… …………………………………………………………………………………………

1.6

SPEED OF DATA TRANSMISSION

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. Dial­up 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


support at least double this bandwidth.

Fundamentals of Data Communication

Broadband is often called "high­speed" 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.7

MODES OF DATA TRANSMISSION

There are 3 modes of data communication: 1) Simplex mode 2) Half duplex mode 3) Full duplex mode

1.7.1 Simplex Mode In simplex mode of data communication, data flow is uni­directional. 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.

Figure 9: Simplex mode of transmission

Advantages of simplex mode: 1) It is inexpensive to install. 2) It is very easy to use. Disadvantages of simplex mode: 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.

1.7.2 Half Duplex Mode 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. An example of a half­duplex system is a two­party system such as a "walkie­talkie" style two­way radio, wherein one must use "Over" or another previously designated command to indicate the end of transmission, and ensure that only one party transmits at a time, because both parties transmit on the same frequency. A good analogy for a half­duplex 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.

Figure 10: Half­Duplex mode of data transmission

Advantages of half duplex mode: 1) 2)

Enables two­way Communications Less costly than Full duplex mode of communication Disadvantages of half duplex mode:

1)

Only one device can transmit at a time. 2) Costs more than simplexFull DuplexFull Duplex refers to the transmission of data in two directions simultaneously.

1.7.3 Full Duplex Mode 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


Figure 11: Full­Duplex mode of data transmission

Fundamentals of Data Communication

The primary example of full duplex mode is telephone conversation. Advantages of full duplex mode: •

There is fast transmission of data.

It is more efficient

Disadvantage of full duplex: •

It is difficult as well as expensive to install.

High cost is involved

Huge maintenance cost

F Check Your Progress 3 1) What is bandwidth? Write down the unit of speed in data transmission? ………………………………………………………………………………………… ………………………………………………………………………………………… ………………………………………………………………………………………… 2) Write down the different DSL technologies available? ………………………………………………………………………………………… ………………………………………………………………………………………… ………………………………………………………………………………………… 3) Write down the different modes of data transmission? ………………………………………………………………………………………… ………………………………………………………………………………………… ………………………………………………………………………………………… 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 (character­framed) and Synchronous (message­framed) 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. Speed of data transmission plays a major role in data communication. Data transmission mainly depends on Bandwidth. Bandwidth is a data transmission rate that tells the maximum amount of information (bits/second) that can be transmitted along a channel. Broadband is often called "high­speed" Internet, because it usually has a high rate of data transmission. 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

Check Your Progress 1 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. 2) The three basic elements in every communication system are: • transmitter, • channel, • receiver. 3) The two major data formatting methods of transmission are described below: Asynchronous Transmission: Asynchronous transmission of data is commonly found in landline communications systems and some forms of teletype communications. Generally, asynchronous, or character­framed, transmission is used to transmit seven­ or eight­bit data, usually in ASCII character format. Each character 18


has a specific start and end sequence—usually one start bit and one or two end (stop) 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 character­by­character 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.

Fundamentals of Data Communication

Synchronous Transmission: Most tactical digital information links communicate using synchronous messages. Synchronous transmission is a more sophisticated method of data transmission. It sends data in long uninterrupted streams, with a predefine start and stop sequence. The start sequence is generally referred to as the preamble. The principal function of the preamble is to alert the receiver of incoming data and provide a reference to synchronize the receiver with the transmitted signal. Following the preamble is a start code that informs the receiving equipment of the beginning of the message data. The basic format of the synchronous data message. The incoming bit stream is then used to synchronize the receiver or demodulator timing. A stop code follows the message data to indicate the end of transmission.

Check Your Progress 2 1) Modem is an acronym for modulator/demodulator. The meaning of the word modulator is to change and the meaning of the word demodulator is to unchange or restore to an original condition. A modem is a communication device that converts (i.e., modulate) binary signal into analog signals for transmission over telephone lines and further reconverts (i.e., demodulate) these acoustics analog signals back into binary form at the receiving end. 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 25­pin male connector at one end and a 25­hole female connector at the other end. ii) Plug the female connector into an open 25­pin serial port on the PC's system unit, and plug the male connector into the modem device. iii) Secure the connectors using the screws on either side. 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.

Check Your Progress 3 1) Bandwidth is a data transmission rate that tells the maximum amount of information that can be transmitted along a channel. The unit of speed in data transmission is Kbps (kilo bytes per second). 2) The different DSL technologies available are: ADSL, VDSL, HDSL and SDSL 3) There are 3 modes of data communication are: i) Simplex mode ii) Half­duplex mode iii) Full­duplex mode 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. Advantages of full duplex mode • •

There is fast transmission of data It is more efficient

Disadvantage of full duplex • • •

It is difficult as well as expensive to install High cost is involved Huge maintenance cost

1.10 FURTHER READINGS AND REFERENCES 1) PK Sinha & Priti Sinha, “Foundations of Computing”, BPB Publication. 2) A.S. Tanenbaum, “Computer Networks”, Pearson Education Asia, 4th Ed. 20


3) Behrouz A. Forouzan, “Data Communications and Networking” Tata Mcgraw Hill.

Fundamentals of Data Communication

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 Communication Devices

UNIT 2 INTRODUCTION TO COMMUNICATION MEDIA AND COMMUNICATION DEVICES Structure

Page Nos.

2.0 Introduction

Objectives

21

21

2.2 Network devices

22

2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8

Network Interface Cards Ethernet Cards Repeaters Bridges Hubs Switches Routers Gateway

2.3 Communication Media

27

2.3.1 Twisted Pair Cable 2.3.2 Co­axial 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 2.7 Further Readings and References

34

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

After going through this unit, you should be able to:

21


Networking and Communication

understand the basics of communication devices;

understand the basics of NIC, hub, repeater, bridges;

understand usage of a router;

understand the functionality of a switch;

understanding different types of cabling like twister pair of cables, optical fibers, co­axial etc.; and •

2.2

understanding wireless media of communication.

NETWORK 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.

2.2.1 Network Interface Cards 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.

2.2.2 Ethernet Cards Ethernet cards are usually purchased separately from a computer, although many latest computers now include an option for a pre­installed 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 RJ­45 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 re­broadcasting 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 twisted­pair cabling. If a cable is long enough, the attenuation will finally make a signal unrecognizable by the receiver. 22


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 as shown in Figure 1.

Introduction to Communication Media and Communication Devices

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


require them. 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.

Introduction to Communication Media and Communication Devices

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 Let us study about another important communication device, router. A router translates information from one network to another; it is similar to an intelligent bridge. Routers select the best path to route a message, based on the destination address and origin. The router can direct traffic to prevent head­on collisions, and is smart enough to know when to direct traffic along shortcuts. 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. A simple way to think of a router is like a computer that can be programmed to understand, possibly manipulate, and route the data it’s being asked to handle. All routers include some kind of user interface for configuring how the router will treat traffic. The really large routers include the equivalent of a good amount of programming language to describe how they should operate as well as the ability to communicate with other routers to describe or determine the best way to get network traffic from point A to point B. Routers can switch and route packets across multiple networks. They do this by exchanging protocol­specific 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. Gateway Interconnects networks at higher layers than bridges or routers. A gateway usually supports address mapping from one network to another, and may also provide transformation of the data between the environments to support end­to­end application connectivity. Gateways typically limit the interconnectivity of two networks to a subset of the application protocols supported on either one. Routers exemplify special cases of gateways. Gateways, also called protocol converters, can operate at any layer of the networking model. The job of a gateway is much more complex than that of a router or a switch. Typically, a gateway must convert one protocol into another. 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. Gateways make communication possible between different architectures and environments. They repackage and convert data going from one environment to another so that each environment can understand the other's environment data. Gateways can change the format of a message so that it will conform to the application program at the receiving end of the transfer. The main functionality of a gateway is to convert protocols among communications networks. A router by itself transfers, accepts and relays packets only across networks using similar protocols. A gateway on the other hand can accept data formatted for one protocol and convert it to data formatted for another protocol before forwarding it. A gateway can be implemented in hardware, software or both, but they are usually implemented by software installed within a router. A gateway must understand the protocols used by each network linked into the router. Gateways are slower than bridges, switches and (non­gateway) routers. A gateway is a network point that acts as an entrance to another network. On the Internet, a node or stopping point can be either a gateway node or a host (end­point) node. Both the computers of Internet users and the computers that serve pages to users are host nodes, while the nodes that connect the networks in between are gateways. For example, the computers that control traffic between company networks or the computers used by internet service providers (ISPs) to connect users to the internet are gateway nodes. 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


environment. By using this protocol, system administration workload greatly decreases, and devices can be added to the network with minimal or no manual configurations.

Introduction to Communication Media and Communication Devices

 Check Your Progress 1 1) Differentiate between a bridge and a router. ……………………………………………………………………………………… ……………………………………………………………………………………… ……………………………………………………………………………………… 2) Explain the function of hub and where should we use this communication device? ……………………………………………………………………………………… ……………………………………………………………………………………… ……………………………………………………………………………………… 3) What is the function of gateway? ……………………………………………………………………………………… ……………………………………………………………………………………… ……………………………………………………………………………………… 4) What is the functionality of switches? ……………………………………………………………………………………… ……………………………………………………………………………………… ………………………………………………………………………………………

2.3

COMMUNICATION MEDIA

Communication media used for data transfer are basically divided into following two categories: 1) Guided media, and 2) Unguided media 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. Guided media includes the following: 1) Twisted pair cable 2) Coaxial cable 3) Optic Fiber cable 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.

Figure 5: Twisted Pair Cable

2.3.2 Co­axial Cable 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. The outer metallic wrapping serves two functions: a) Acts as a shield against noise. b) Acts as second conductor to complete the circuit. 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

Figure 6: Coaxial Cable

2.3.3

Optical Cable

An optical fiber consists of two concentric cylinders: an inner core surrounded by a cladding. Both the core and the cladding are made of transparent plastic or glass material as shown in Figure 7, which transmits signals in the form of light. Optical fiber use reflections to guide light through a channel. The density of core and cladding must differ sufficiently to reflect the beam of light instead of refracting. 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.

Figure 7: Optical Fiber 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 4) These cables are much lighter than the copper cables 5) These cables are more immune to tapping then the copper cables. Disadvantages 1) Installation or maintenance – It’s a new technology and hence needs expertise which is not available everywhere. 2) Unidirectional – Propagation of light is unidirectional and we need two fibers for bidirectional communication. 3) Costly – the cables and interfaces used are relatively expensive.

 Check Your Progress 2 1) What is the difference between Guided media and Unguided media? ……………………………………………………………………………………… ……………………………………………………………………………………… ……………………………………………………………………………………… 2) How can you improve the performance of twisted pair cables? ……………………………………………………………………………………… ……………………………………………………………………………………… ……………………………………………………………………………………… 3) What is the purpose of the outer metallic wrapping in co­axial cables? ……………………………………………………………………………………… ……………………………………………………………………………………… ……………………………………………………………………………………… 4) Describe the principal of optical fiber and its advantages and disadvantages? ……………………………………………………………………………………… ……………………………………………………………………………………… ………………………………………………………………………………………

2.4

MODES OF WIRELLESS TRANSMISSION

Unguided media transports electromagnetic waves without using a physical conductor and is often called wireless communication. Signals are broadcasted through air and received by all who have devices to receive them. It can be categorized as follows: 1) Radio waves 2) Micro waves 3) Infrared

2.4.1 Radio Waves 30


Electromagnetic waves ranging in frequencies between 3 kilohertz and 1 gigahertz are normally called radio waves. Radio waves are easy to generate, can travel long distances and can penetrate buildings easily, therefore widely used for communication. They are omni­directional meaning that they travel in all directions from the source, so the transmitter and receiver do not have to be carefully aligned physically.

Introduction to Communication Media and Communication Devices

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. Another increasingly­popular form of radio is cellular radio, which is currently being used by carriers for providing mobile telephone networks. These operate in the VHF (very high frequency) band and subdivide their coverage area into conceptual cells, where each cell represents a limited area which is served by a low­power transmitter and receiver station. As the mobile user moves from one cell area to another, its communication is handed over from one station to another. Radio waves transmitted by one antenna are susceptible to interference by another antenna due to this Omni­ directional property. Radio waves can be received both inside and outside the building. 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. An important form of microwave system is a satellite system, which is essentially a microwave system plus a large repeater in the sky as shown in Figure 8. The signals transmitted by earth stations are received, amplified, and retransmitted to other earth stations by the satellite. Like other microwave systems, the bandwidth is subdivided into channels of 10s of MHz each, providing data rates in order of 100s of mbps. Because of their high bandwidths, satellites are capable of supporting an enormous number and variety of channels, including TV, telephone, and data. The satellite itself, however, represents a major investment and typically has a limited lifetime (at most a few decades). Unidirectional property of microwave helps in avoiding interference by a pair of aligned antenna to another. High frequency micro waves cannot be received inside the building. Micro waves help in unicasting communication due to their unidirectional property and hence used in cell phones, satellite networks etc.

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 infra­red has been for interfacing hand­held 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.

Figure 9: Infrared Transmission

 Check Your Progress 3 1) Write down the different types of unguided media? 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. A router translates information from one network to another; it is similar to an intelligent bridge. Routers select the best path to route a message, based on the destination address and origin. 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. 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 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. A switch steps up on a bridge in that it has multiple ports. 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. Gateway Interconnects networks at higher layers than bridges or routers. A gateway usually supports address mapping from one network to another, and may also provide transformation of the data between the environments to support end­to­end application connectivity. Gateways make communication possible between different architectures and environments. 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. An optical fiber consists of two concentric cylinders: an inner core surrounded by a cladding. Both the core and the cladding are made of transparent plastic or glass material. Optical fiber use reflections to guide light through a channel. 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. Cable TV companies use a combination of optical fiber and coaxial cable. Advantage of optical fiber is that it offers higher bandwidth and has less signal attenuation. Disadvantage of optical fiber is that it is unidirectional and costly. 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


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. High frequency micro waves cannot be received inside the building.

Introduction to Communication Media and Communication Devices

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. Infra­red 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 Check Your Progress 1 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. A router translates information from one network to another; it is more intelligent than a bridge. Routers select the best path to route a message, based on the destination address and origin. In contrast to bridges few of the large routers may include programs for their operations. 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. 3) Gateway Interconnects networks at higher layers than bridges or routers. A gateway usually supports address mapping from one network to another, and may also provide transformation of the data between the environments to support end­ to­end application connectivity. The main functionality of a gateway is to convert protocols among communications networks. A gateway on the other hand can accept a packet formatted for one protocol and convert it to a packet formatted for another protocol before forwarding it. Gateways work on all seven OSI layers. 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.

Check Your Progress 2 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 co­axial cables serves two functions: a) Acts as a shield against noise. b) Acts as second conductor to complete the circuit. 4) An optical fiber consists of two concentric cylinders: an inner core surrounded by a cladding. Both the core and the cladding are made of transparent plastic or glass material. Optical fiber use reflections to guide light through a channel. The density of core and cladding must differ sufficiently to reflect the beam of light instead of refracting. 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. 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: 1) Installation or maintenance – It’s a new technology and hence needs expertise which is not available everywhere. 2) Unidirectional – Propagation of light is unidirectional and we need two fibers for bidirectional communication. 3) Costly – the cables and interfaces used are relatively expensive.

Check Your Progress 3

1) There are three different kinds of unguided media: i) Radio Wave ii) Micro Wave iii) Infrared 2) Radio waves frequency is ranging between 3 kilohertz and 1 gigahertz. 3) 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. Like other microwave systems, the bandwidth is subdivided into channels of 10s of MHz each, providing data rates in order of 100s of mbps. Because of their high bandwidths, satellites are capable of supporting an enormous number and variety of channels, including TV, telephone, and data

36


4) 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 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.

Introduction to Communication Media and Communication Devices

Unidirectional property of microwave helps in avoiding interference by a pair of aligned antenna to another.

FURTHER READINGS AND REFERENCES 1) William Stallings, “Data and Computer Communications”, Sixth Edition, Prentice Hall 2) Behrouz A. Forouzan, “Data Communications and Networking”, Tata Mcgraw­Hill. 3) A.S. Tanenbaum, “Computer Networks”, Pearson Education Asia, 4th Ed. 4) Behrouz A. Forouzan, “TCP/IP Protocol Suit”, Tata Mcgraw­Hill.

Reference Website: •

http://www.brainbell.com

http://www.networktutorials.info/

http://www.nethistory.info/

37


Computer Networks

UNIT 3 COMPUTER NETWORKS Structure

Page Nos.

3.0 Introduction 3.1 Objectives 3.2 Why Network? 3.3 Network Architecture

37 37

3.4 Topologies

38 38 39

3.5

45

3.6

3.4.1. 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6

Bus Topology Ring Topology Star Topology Tree Topology Mesh Topology Hybrid Topology

Classification of Network 3.5.1 LAN 3.5.2 MAN 3.5.3 WAN

Reference Models

50

3.6.1 OSI Models 3.6.2 TCP/IP Model

3.7 3.8 3.9 3.10

Network applications Summary Solutions/Answers Further Readings and References

53 54 55 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, peer­to­peer network architecture, network topology, OSI & TCP/IP models and some useful application of computer networks.

3.1 OBJECTIVES After going through this unit, you should be able to: •

define basic network concepts;

list different type of topologies;

differentiate network topologies;

classify computer network; and

make a comparison between LAN, MAN and WAN.

37


Networking and Communication

3.2 WHY NETWORK? We use a Computer Network for the following reasons: a) Resource sharing: A network is needed because of the desire to make all programs, data, and equipment available to anyone on the network without regard to the physical location of the resource and the user. Load sharing is another aspect of resource sharing. b) High reliability: A network may have alternative sources of supply (e.g., replicated files, multiple CPUs, etc.). In case of one resource failure, the others could be used and the system continues to operate at reduced performance. This is a very important property for military, banking, air traffic control, and many other applications. c) Saving money: A network may consist of many powerful small computers, one per user, with data kept on one or more shared file server machines, which offers a much better price/performance ratio than mainframes. In this model, the users are called clients, and the whole arrangement is called the client­server model. d) Scalability: The ability to increase system performance gradually by adding more processors (incremental upgrade). e) Powerful communication medium: Networks make cooperation among far­ flung groups of people easy where it previously had been impossible. In the long run, the use of networks to enhance human­to­human communication may prove more important than technical goals such as improved reliability.

3.3 NETWORK ARCHITECTURE 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. A network may comprise of multiple computers connected through interface, as a Network Interface Card (NIC) and appropriate networking software that provides the server or client functionality. The third component besides NIC and network is communication media for carrying data from one machine to another machine. Usually networks are categorized in two main categories which are: • •

Cline/Server based network Peer­to­peer network

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


machine. The server kind of machine is supposed to be most powerful than the client machine.

Computer Networks

In a peer­to­peer 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 peer­to­peer 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. Following are the considerations for choosing a Topology: • Costing: Some kind of topology may be less expensive compared to others in terms of installation (for example Bus topology). • Length of cable: It is needed to connect machines in a network. • Network scalability: The topology should support future growth of network without much expenditure. • Cable types: There are difference types of cable media: unshielded twisted pair, coaxial cable, Fiber optics. The most common cable is unshielded twisted pair, which is most often used with star topology . Now we shall learn about different types of the topologies like bus, ring, tree, mesh in detail.

3.4.1

Bus Topology

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

Figure 1: Bus topology

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.

3.4.2

Ring Topology

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 peer­to­peer networks, in which each machine manages both information processing and the distribution of data files. Examples of such topology: 1) IBM Token Ring 2) Fiber Distributed Data Interface (FDDI)

Figure 2: Ring 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. b) It performs better than a star topology under heavy network load. c) It can create much larger network using Token Ring. 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

3.4.3

Star Topology

In star topology each computer on a network communicates with a central hub (also called as a concentrator) that re­sends the message either to all the computers or only to the destination computer. A hub expands one network connection into many. For example a four­port 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.

Figure 3: Star Topology

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 detected­It 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. c) Use of multiple cables types in a same network with a hub. 42


d) It has good performance

Computer Networks

Disadvantages

a) It is expensive to install as it require more cable, it costs more to cable a star

network because all network cables must be pulled to one central point, requiring more cable length than other networking topologies.

b) Central node dependency, if central hub fails, the whole network fails to operate.

c) Many star networks require a device at the central point to rebroadcast or switch the network traffic.

3.4.4

Tree Topology

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.

Figure 4: Tree topology

Advantages a)

It required point­to­point wiring for individual segments.

b)

It is easily supported by several hardware and software vendors. 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

3.4.5

Mesh Topology

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

Figure 5: Mesh Topology

While the data is traveling on the Mesh Network it is automatically configured to reach the destination by taking the shortest route which means the least number of hops. Advantages

b)

a) It provides redundant paths between devices and hence it is more reliable and stable. The network can be expanded without disruption to current users. Disadvantages

a)

It requires more cabling than the other LAN topologies.

b)

The implementation of this topology is quite complicated.

3.4.6 Hybrid Topology 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 star­bus 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.

F Check Your Progress 1 44


Computer Networks

1) State True/ False: i) Physical design of a network including the devices, location and cable installation. ii) In bus topology, two computers can transmit data at the same time. iii) In star network, a passive hub merely acts as a connecter point and does not amplify or regenerate signals. 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. ……………………………………………………………………………………… ……………………………………………………………………………………… ………………………………………………………………………………………

3.5 CLASSIFICATION OF NETWORKS There are mainly three types of networks: 1) LAN (Local Area Network) 2) MAN (Metropolitan Area Network) 3) WAN (Wide Area Network)

3.5.1 Local Area Network (LAN) 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. Intermediate nodes (i.e., repeaters, bridges and switches) allow to be connected together to from larger LANs. A LAN may also be connected to another LAN or to WANs and MANs using a “router” device. There are essentially five components of a LAN: 1) Network devices such as Workstations, printers, file servers which are normally accessed by all other computers. 2) Network Communication Devices i.e., devices such as hubs, routers, switches etc. used for network connectivity. 3) Network Interface Cards (NICs) for each network device required to access the network. It is the interface between the machine and the physical network. 4) Cable as a physical transmission medium. 5) Network Operating System –software applications required to control the use of network operation and administration. Characteristics of LAN • It connects computers in a single building, block or campus, i.e. they work in a restricted geographical area. • LAN’s are private networks, not subject to tariffs or other regulatory controls. • LAN’s operate at relatively high speed when compared to the typical WAN (.2 to 100 MB /sec). • There are different types of Media Access Control methods in a LAN, the prominent ones are Ethernet, Token ring. • The networking is done through Buses or Rings. ADVANTAGES OF LAN

It allows sharing of expensive resources such as Laser printers, software and mass storage devices among a number of computers. • LAN allows for high­speed exchange of essential information. • It contributes to increased productivity. A LAN installation should be studied closely in the context of its proposed contribution to the long range interest of the organization. DISADVANTAGES OF LAN

46


• 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.

3.5.2

Computer Networks

Metropolitan Area Network (MAN)

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 moderate­to­high 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

A Metropolitan Area Network is a large computer network that spans a metropolitan area or campus. Its geographic scope falls between a WAN and LAN. MANs provide Internet connectivity for LANs in a metropolitan region, and connect them to wider area networks like the Internet. 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 1) It generally covers towns and cities (50 kms) 2) It is developed in 1980s. 3) Communication medium used for MAN are optical fibers, cables etc. 4) Data rates adequate for distributed computing applications.

3.5.3

Wide Area Network (WAN)

Wide Area Network (Figure 8) is a network system connecting cities, countries or continents, a network that uses routers and public communications links. The largest and most well­known example of a WAN is the Internet. 48


Computer Networks

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 1) It generally covers large distances (states, countries, continents). 2) Communication medium used are satellite, public telephone networks which are connected by routers. 3) Routers forward packets from one to another (Table 1) a route from the sender to the receiver. Table 1: Difference between LAN, WAN and MAN Characteristics

LAN

MAN

WAN

1) form

Full

It stands for local area network.

It stands for wide area network.

2) 3) 4) 5) y

Cost Speed Range Topolog

Less Costly Upto 10­100 Mbps 1 Km Bus and Ring

It stands for metropolitan area network. More Costly 5­ 10 Mbps Upto 50 Kms Distributed Queue Dual Bus [DQDB]

Costliest 256 Kbps to 2 Mbps Up to 10000 Kms ATM, Frame Relay, Sonet

49


Networking and Communication

50

6) Locatio n of computers connected in the system

Computers are located within the same building.

7) es

LAN’s example can be an office whose different departments such as personnel, accounting etc. are located in the same building and connected via bus topology using Ethernet cards.

Exampl

Computers are located in the city and are connected using modems or telephone lines so that they can be easily connected with each other. Example of MAN is bank whose different branches in a city like Delhi are connected using public telephone exchange and the system are connected with each other using LAN within each branch and different branches are connected using modem and bridges.

Computers are distributed all over the country or the continent. The connection is made via satellite communication link or via internet. WAN’s example is the connection of various branches of MNC such as Proctor & Gamble. These branches are linked using microwave satellite communication system or internet connection. Each branch has its own LAN circuit. But the different LAN’s in various branches are communicating with head office using WAN link.


Computer Networks

F Check Your Progress 2 1) State True/ False:

i) LAN does not allow for high­speed exchange of essential information between key people in an organization

ii) A MAN is optimized for a larger geographical area than a LAN, ranging from several blocks of buildings to entire cities 2) Write down the basic components of a LAN. ……………………………………………………………………………………… ……………………………………………………………………………………… ……………………………………………………………………………………… 3) Compare and contrast LAN, MAN and WAN in terms of their coverage area. ……………………………………………………………………………………… ……………………………………………………………………………………… …………………………………………………………………………………… 4) Identify the examples of networks around you and classify them in terms of LAN, MAN and WAN. ……………………………………………………………………………………… ……………………………………………………………………………………… ……………………………………………………………………………………… 5) Name the devices which are used to connect network components. ……………………………………………………………………………………… ……………………………………………………………………………………… ………………………………………………………………………………………

3.6 REFERENCE MODELS In this section, we will discuss two reference models:

3.6.1

OSI (Open System Interconnection) Model

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). A layer is a collection of conceptually similar functions that provide services to the layer above it and receives service from the layer below it. On each layer an instance provides services to the instances at the layer above and requests service from the layer below. For example, a layer that provides error­free communications across a network provides the path needed by applications above it, while it calls the next lower layer to send and receive packets that make up the contents of the path. Conceptionally two instances at one layer are connected by a horizontal protocol connection on that layer. The following are the layers of OSI model:

Layer

Layer

Figure 9: OSI Model

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 This layer manages connections between different application layers.

52


Transport Layer

Computer Networks

This layer converts data into segments and re­assembles 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. Data­Link 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 softwares like Microsoft word or Word Viewer etc. 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. 4) In the TRANSPORT LAYER, data is converted to segments. Source IP and destination IP are added to each packets. Frame checks and parity bits are also added in this layer 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 DATA­LINK 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.

3.6.2

TCP/IP Model (Transmission Control Protocol / Internet Protocol)

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. Dial­up modems transmit IP packets using PPP while broadband users transmit using PPoE.

Figure 10: TCP/IP Model

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 connection­oriented 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 cross­platform networking which is useful in this day­in­age. 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

3.7 NETWORK APPLICATIONS 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: Person­to­person communication: Real­time systems, such as videoconferencing and virtual meeting environments over the network or internet, allow remote users to communicate with no delay, possibly seeing and hearing each others as well. 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. Interactive entertainment: Computer network is extensively being used in entertainment industry. Services like Video on demand in which the user can select any movie or TV program ever made, in any country, and have it displayed on his screen instantly. Other applications include Live and interactive TV in which audience may participate in quiz shows, multiplayer real­time games flight simulators, etc. 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 online­reservation services for hotels, airlines and so on. Financial services: Today's financial services are totally depended on computer networks. Application includes credit history searches, foreign exchange and investment services, and electronic fund transfer, which allow user to transfer money 55


Networking and Communication

without going into a bank (an automated teller machine is an example of electronic fund transfer, automatic pay­check 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 peer­to­peer. 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 re­sends 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 point­to­point 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


) )

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.

Computer Networks

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 well­known 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 Check Your Progress 1 1) i) True False True 2) 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. 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.

Bus Topology: All devices are connected to a central cable, called the bus or backbone. Bus networks are relatively inexpensive and easy to install for small networks.Ethernet systems use a bus topology.

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.

Tree Topology: A tree topology combines characteristics of linear bus and star topologies. It consists of groups of star­configured workstations connected to a linear bus backbone cable.

5) Properties that can be considered best while Choosing/designing a Topology (Bus, Ring and Star) Network scalability i.e. The topology showed future growth of machine without much expenditure.(star) •

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.

Check Your Progress 2 1) i) False ii) True 2) There are essentially five components of a LAN: 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). 4) LAN : Colloge network, Library network, small office or a internet cafe . MAN : Cable TV network. WAN : Internet, VPN WAN links 5) Switches, Hub, Bridges, Routers etc.

3.10 FURTHER READINGS AND REFERENCES 1) William Stallings, Data and Computer Communications, Sixth Edition, Publication : Prentice Hall 2) Behrouz A. Forouzan, Data Communications and Networking, Publication: Mcgraw­Hill 3) A. S. Tanenbaum, “Computer Networks”; Pearson Education Asia, 4th Ed., 2003. 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: • • •

60

http://www.nethistory.info http://www.networktutorials.info/ http://www.brainbell.com


UNIT 1 INFORMATION SECURITY CONCERNS Structure 1.0

1.4

Introduction Objectives Definition and Need of Information Security Definition Related to Information Security Types of Threats

1.5

Types of Security Measures

1.1 1.2 1.3

1.6

1.7 1.8 1.9

Information Security Concerns

1.4.1 1.4.2 1.4.3 1.4.4

Physical Security Threats Software Security Threats Network Security Threats Password Security Threats

1.5.1 1.5.2 1.5.3 1.5.4 1.5.5

Physical Security Measures Software Security Measures Network Security Measures Password Security Measures Other Aspects

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

Security Policies Summary 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 day­by­day. 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.

1.2DEFINATION AND NEEDS OF INFORMATION SECURITY The core principle of information security is CIA i.e, Confidentiality, Integrity, and Availability.

Information Security means protection of information and information system from unauthorized access, modification and misuse of information or destruction. The basic of information security is to deal with protecting data from people or software having malicious intentions. In this unit we discuss about the factors which are responsible to introduce a threat to an organization system and the defensive mechanisms which can be adopted by the organization against them. As shown in the Figure 1.1, the information security is mainly concerned with the three aspects of data regardless of the form they take data. •

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

Figure 1.1: Components of Information Security

One question might have come up in your mind that how important is the Information Security in a system? Briefly we can say the basic needs to introduce information security systems are to ensure that the information stored securely in systems. Now a days, the information is collected, processed and stored in computer and transmitted through a network to the other computers. This information is confidential which is about their employees, customers, products, researches, financial information etc. if this precious information falls in wrong hands then it will be misused. So, in an organization we need a secure and powerful system which can stop any hackers or software to penetrate. So, the field of information security has grown up a great deal in recent years which answers the issue of protection of confidential information in business environment.

1.3 DEFINITION RELATED TO INFORMATION SECURITY The information security has three aims i.e., integrity, confidentiality and availability. They have different meaning with respect to data, information and system. They also address different areas of information security systems. Integrity: Those systems which always provides the correct information about the system. Confidentiality: Those unauthenticated person or software system can’t be able to go through the systems and cannot read/view any confidential information. 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: Security: “Data or information security is the protection of data against accidental or intentional, destruction, disclosure or modification”. Computer data security refers to the technological safeguards and managerial procedure which can be applied to computer hardware, software and data to ensure that organizational assets and individual privacy are protected. Privacy: Is a concept applied to an individual. It is the right of an individual to decide what information he/she wishes to share with others or is willing to accept from others.

Check Your Progress 1 1)

Define Information Security?

…………………………………………………………………………………………... 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?

…………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………...

1.4DIFFERENT TYPES OF THREATS Under information security policies, they cover up all issues related to the software hacking. Practically, an organization must be ready to handle different types of attacks on the security of an organization. In this section we discuss the four types of threats for breaching the security of an organization. •

Physical Security Threats

Network Security Threats

Software Security Threats

Password Security Threats

1.4.1

Check your system in terms to physical security on the 8 basis of listed categories.

Physical Security Threats

Physical security basically describes measures to prevent from attackers for accessing a resource, or information stored on physical media. It also provides guidance to the attackers how to design structures to protect various unfriendly acts. Physical security in an organization is not a trivial task as it might seems to be on the first sight. It might include a closed­circuit television to monitor an intruder’s entry and also to monitor to day­to­day functioning of the internal workers so that they might also not be able to tamper with the security of the system, and also includes security lighting and fencing to badge access and heating, ventilation and air­conditioning. Another area of physical security is to manage the backup power in the event of power failure. The use of uninterruptible power supplies is usually adopted by most of the organizations which do not have another backup facility such as diesel generators. A physical intruder may penetrate into the system and walk out with the main server of the organization by disconnecting it from other devices or simply he/she might turn off the firewall by


disconnecting the cables while the organization still believes that they are very well protected because they have installed an advanced firewall.

Information Security Concerns

Physical security threats may classified into four major categories:

Electrical: Electrical threats are come from insufficient voltage of different devices and hardware systems.

Environmental: these types of threats are due to natural disasters such as fires, flooding, storms etc. Environmental threats can also occur from extreme temperature or humidity.

Hardware: Hardware threats deals with their physical hardware damage or its theft.

Maintenance: Maintenance threats may arise from poor handling of electronic components such as poor cabling, poor device labeling, etc.

1.4.2

Network Security Threats

There are many ways by which attackers can invade a network. Each attacker has his/her own bag of tricks that can be used to break into a system. The basic network invasion involves five main components: reconnaissance, scanning, gaining access, maintaining access and covering tracks. It might seem odd to think of a methodology for hackers; but as with anything else, time matters. So to maximize time most hackers may follow a similar methodology. 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. To maintain access, an attacker may upload a custom application onto the compromised server which can act as a back door for the attacker which allows him to enter and exit into the network at his/her own wish. Once an attacker has determined his/her mechanism for getting back into the server, the last step in the hacker methodology is to cover his/her tracks. A clever attacker may just modify his/her log entries to show that the traffic was originating from a different IP address. 1.4.3

Software Security Threats 9


Information Security

In UNIX, username and password may be stored in /etc/password file.

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 will study in detail about the virus and other malicious programs in the next unit.

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 built­in authentication. This consists of a user and a password list stored locally. The built­in 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 built­in­authentication 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 built­in 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 built­in 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 clear­text password authentication, you are left with a security hole that anyone on your network can exploit. 10


1.5DIFFERENT TYPES OF SECURITY MEASURES

Information Security 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 time­honored 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. 'Need­to know' policy is an off­shoot 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.

d)

Recovery: There must be enough resilience in the system to recoup the losses/damage and become functional, by reinstating the status, at the earliest. 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.

1.4.2

Physical Security

These measures are for PCs being used in offices. The PC may be in use by an individual or being shared between two or more users. The measures available are: •

Physically bolt down the PC to a table so that it cannot be casually lifted and taken away.

11


Information Security

Locate the PC in such a way that it is conveniently accessible to the user but hidden from casual passers­by.

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.

1.4.3

Software Security

As is apparent from the views, on security, provided on PCs of various leading magazines, there is hardly any security provided on the PC. There are some measures you can take to ensure that data is not corrupted or modified by unauthorised users and to reinitiate the database to its known status in case this happens and these are:

12

Use original software for Operating System, compilers or software packages. You may have to pay for it, but you can then be sure that it would be bug­free, known also as "licensed" software.

Use correct procedures for shutting down the PC so that all files etc. would be properly closed.

If you develop your own applications, introduce passwords to access your application; these passwords should not be visible on the screen when keyed­in.

Keep back­ups of all your files. Whenever you operate on any file, (specially in update/append/alter mode), if you have your own programs they should include


a "copy" procedure; this ensures that a back­up of your data files would always be automatically taken.

1.4.4

Information Security Concerns

Network Security

The protection required for networked systems is much more extensive as physical security measures are totally inadequate; it is also extremely difficult to know who, when and how someone is accessing your data; in LANs, generally there would be one server which holds the shareable data on network and services the requests of various nodes; the normal method used is password identity for permitting access; the measures which can be adopted for additional security, are

Keep the servers away and allow limited physical access to them.

Run servers in the background mode; thus the server can be booked on, for use in the network, but, for direct use of the server, a separate password would be necessary.

Some networks provide auditing facilities, which can be used to advantage.

Be aware that the network cables can be tapped, so try and shield or conceal them to prevent easy access; if possible use optical fiber.

Use codes and ciphers in data communication; remember, however, that this would impose considerable overheads on your resources.

Use fiber­optic cables for highly sensitive networks as those are difficult to tap; however, here too it may be possible to steal data through sensing the perturbations of the fiber itself.

Prohibit the use of passwords embedded in communication access scripts; if this is unavoidable, use encryption for passwords.

Consider the use of see­through devices for any system accessed through networks or through dial up.

Protection against virus: A number of measures are available for reducing the risk of being attacked by computer virus:

Build employee awareness of the risk.

Do not allow the use of outside programs for company PCs or networks.

Do not interface company networks to outside "Bulletin Boards".

Make system/server files "Read only".

Try and obtain source code for important software in use and compile it in­ house.

If source code is difficult to follow, it should ring a warning bell in your head.

Check executable code, using "debug" or separate utilities to study code structure and check spaces for viruses.

1.4.5

Password Security

In most organisations or computer systems, the only authorisation for data access is giving the correct password; rightly speaking, this is only the first step; the whole process would be: 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.

1.4.6

Other Aspects

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: Larger systems provide various mechanisms to prevent access to data. User classes can be defined automatically prohibiting access to data by user class. User can be given only "query view" of the data so that he/she can have only "read" access to a limited amount of data. In some systems, certain terminal numbers can display or access only some parts of database, thus, even a user with higher access permissions cannot access some data on those terminals. Access to Operating Systems: In some systems, the operating system is written in a lower level language and users are not given the use of that language. Thus, the user cannot alter any part of the operating system. Some operating systems follow the concept of access control levels. In this, any program which has equal or higher access control level cannot access any routines which are below that level. The operating system routines are placed at much lower level and paths are predefined for access to these, which incidentally, are via other system routines placed at a high level. From this point of view 'UNIX' is not a secure Operating System as, 'C', which is the language in which 'UNIX' is written, is also available to the user as a programming language, however, it has many good security features. 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


Check Your Progress 2 1)

Information Security Concerns

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?

…………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………...

4)

Write the other aspects of the security measures?

…………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... 5)

Write down different types of measures in information security systems?

…………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………...

1.6ENCRYPTION: A DEFENSIVE SYSTEM AGAINST THREATS Encryption ensures the confidentiality requirements of a system. Sensitive Information must travel over the public channels (such as the Internet) can be defended by the encryption, or secret codes. Information security relies heavily on encryption. The goal of encryption is to make it impossible for a hacker who obtains a cipher text 15


Information Security

(encrypted information) as it passes on the network to recover the original message. Encryption is the mutation of information in any form (text, video, and graphics) into a form readable only with the decryption key. A key is a very large number, usually a string of zeroes and ones. There are two main kinds of encryption known today: symmetric encryption and asymmetric encryption systems:

Symmetric Key Encryption Systems

1.6.1

Symmetric encryption systems, also known as secret or private key encryption systems/conventional encryption/single key encryption were the only type of encryption in use prior to the development of asymmetric key encryption systems. These types of systems rely on generating a common key called secret key for both encryption and decryption. In such a system, both the parties i.e., the transmitter and the receiver must trust each other and preserve a copy of the secret key to encrypt and decrypt the messages. They also must ensure that the key is not leaked or overheard in transmission such as local phones etc. Anyone having access to the key may misuse it for encrypting or decrypting the secret messages. 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. Table 1: Representation of alphabets and their Respective Position Values Character Position Value

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

1

2

3

4

5

6

7

8

9

1 0

1 1

1 2

1 3

1 4

1 5

1 6

1 7

1 8

1 9

2 0

2 1

2 2

2 3

Plain Text (Message) = MEET TODAY 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: Cipner Text (Encrypted Message) = PHHW WRGDB The text after encryption will be called Cipher text. A symmetric encryption scheme has five ingredients as depicted in Figure 1. 2:

16

Plaintext: This is the original intelligible message or data which is fed into the algorithm as input.

Encryption Algorithm: The encryption algorithm performs various substitutions and transformations on the plaintext.

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


substitutions and transformations performed by the algorithm depend on the key.

Ciphertext: This is the scrambled message produced as output. It depends on the plaintext and the secret key. For a given message, two different keys will produce two different ciphertexts. The ciphertext is apparently random stream of data and, as it stands, is unintelligible.

Decryption algorithm: This is essentially the encryption algorithm run in reverse. It takes the ciphertext and the secret key and produces the original plaintext.

Information Security Concerns

Figure 1.2 A Simplified Model of a Symmetric Encryption

Although such a system is easy to use because of the existence of a single key to be shared by both the parties, but it has some disadvantages which has resulted into non­ acceptance of such systems frequently. A secret key encryption system suffers from the problems of key distribution, generation, transmission and storage of keys. Secure key distribution is cumbersome in large networks and practically infeasible for a vendor having several thousands of customers. It is also impractical for a large group of users which are previously unknown, further every customer is to be assigned a new secret key which can never be shared with any other customer/party. More popular solution to widespread open network security is a newer, more sophisticated form of encryption, first developed in 1970 called Asymmetric key encryption.

1.6.2

Asymmetric Key Encryption Systems:

Asymmetric key encryption systems are also known as Public –key encryption systems. These systems use two keys, one key to encrypt the message and the other corresponding key to decrypt the message. The two keys are mathematically related so that the data encrypted by one can be decrypted by the other. This system is based on a pair of keys one of them is known as public key which can be made public to all the users, the other key is called private key which is always kept confidential and never exposed. Both the keys should however be protected for any modifications, since keys once modified can never be further used for encryption or decryption. A public key encryption scheme has six ingredients: 17


Information Security

Plaintext: This is the readable message or data that is fed into the algorithm as input.

Encryption Algorithm: The encryption algorithm performs various substitutions and transformations on the plaintext.

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.

Ciphertext: This is the scrambled message produced as output. It depends on the plaintext and the key. For a given message, two different keys will produce two different ciphertexts.

Decryption algorithm: This is essentially the encryption algorithm run in reverse. It takes the ciphertext and the secret key and produces the original plaintext.

The essential steps are the following: 1)

Each user generates a pair of keys to be used for encryption and decryption of messages.

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.

3)

If user A wishes to send a confidential message to user B then A encrypts the message using B’s public key.

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

Figure 1.3: Encryption in Public Key Cryptosystems

Public key crypto system can also be used for authentications which ensure that the message is only sent by the user A and it is a authenticated message by user A. In this case, user A encrypts the message and transmits over network. Now, this cipher text can only be decrypted by the public key of user A. Hence, it is a authenticated message only sent by user A. This process is show below in the Figure 1. 4.

Figure 1.4: Authentication in Public Key Cryptosystems

Table summarizes the main differences and the important aspects of the symmetric and Asymmetric encryption systems: Symmetric Encryption

Public­Key Encryption

• The same algorithm with the same key is used for encryption and decryption

• One algorithm is used for encryption and decryption with a pair of keys, one for encryption and one for decryption

• The sender and the receiver must share the algorithm and the key

• The sender and the receiver must have one of the matched pair of keys(not the same one)

The key must be kept secret

• It must be impossible or atleast impractical to decipher a message if no other information is available • Knowledge of the algorithm plus samples of ciphertext must be insufficient to determine the key

• One of the two leys must be kept secret • It must be impossible or atleast impractical to decipher a message if no other information is available • Knowledge of the algorithm plus one of the keys plus samples of ciphertext must be insufficient to determine the 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: Password Policies: This policy is used to prevent an unauthorized access on user account. It defines procedure for users must change their password often, complexity rule and other items. 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. Client update policy: They define policies to update client. General Policies High level program policy: defines how owns other policies, scope, related document and purpose of policies. It covers: Business continuity policy: in this category, it includes following plan:

20

Crisis management

Disaster management


Server recovery

Data recovery

Information Security Concerns

Check Your Progress 3 1)

Write down the different types of policies for information security?

…………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... 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 Check Your Progress 1 1)

Information Security is used to protect information and information system from unauthorized access, modification, and misuse of information or destruction. The basic of information security is to deal with protecting data from people or software having malicious intentions.

2)

The basic need to introduce information security systems is to ensure that the information is stored securely in systems. Now a day, the information are collected, processed and stored in computer and transmitted through a network to the other computers. This information is confidential about their employees, customers, products, researches, financial information etc. If this precious information is caught in wrong hands then it will get misused this information. So, in an organization we need a secure and powerful system which can’t penetrated by any hackers or software.

3)

The basic differences between information security and computer security in terms of: • Methodology used • Areas of Concentration

4)

The three aim of information security are: • Integrity • Confidentiality • Availability

Check Your Progress 2 1)

The main Security threats are: • Physical Security • Network Security • Software Security • Password Security

2)

22

The most sophisticated threat to information systems is from the malicious software or malicious programs. These software programs do harmful damage to an organization’s data and the software, without the knowledge of the users


on the systems they execute on. Some of this software needs a host program to run on for e.g. Trojan Horses, Logic bombs and viruses. On the other hand some 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 built­in 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.

Information Security Concerns

• Database Access • Access to Operating Systems • Access Control Cards 5)

Different types of security measures are: • Physical Security • Network Security • Software Security • Password Security

Check Your Progress 3 1)

The policies are categorized in three different areas listed below: • User Policies • IT Policies • General Policies

2)

The basic difference between Symmetric key or Asymmetric key encryption systems are: Symmetric Encryption

Public­Key Encryption

In symmetric key, same key is used for encryption and decryption

In asymmetric key, two different keys are used for encryption and decryption. One key is used for encryption and other key is used for decryption.

The sender and the receiver must

The sender and the receiver must 23


Information Security

share the algorithm and the key.

• 3)

The key must be kept secret.

have one of the matched pair of keys (not the same one). •

One of the two leys must be kept secret.

A symmetric encryption scheme has five components: • Plaintext • Encryption Algorithm • Secret Key • Ciphertext • Decryption algorithm

4)

Sensitive Information must travel over the public channels (such as the Internet) can be defended by the encryption, or secret codes. Information security relies heavily on encryption. The goal of encryption is to make it impossible for a hacker who obtains a cipher text (encrypted information) as it passes on the network to recover the original message. Encryption is the mutation of information in any form (text, video, and graphics) into a form readable only with the decryption key. A key is a very large number, usually a string of zeroes and ones. There are two main kinds of encryption known today: symmetric encryption and asymmetric encryption systems:

1.10

REFERENCES/FURTHER READINGS

• Networks Security Essentials: Application & Standards by W. Stallings, Pearson Education. • Foundations of cryptography­II Basic Applications, by Oded Goldreich, Cambridge university press. • http://en.wikipedia.org/wiki/Information_security • http://en.wikipedia.org/wiki/Encryption • http://www.comptechdoc.org/independent/security/recommendations/secpolgen. html • http://netsecurity.about.com/ • http://www.cert.org/

24


UNIT 2 SOFTWARE VULNERABILITIES

Software Vulnerabilities

Structure 2.0 2.1

2.2 2.3

Introduction Objectives Infection Process Viruses

2.3.1 Classification of Viruses 2.3.2 Types of Viruses 2.3.3 Infection Methods 2.4 2.5

2.3.4 Prevention and Cure

Worm Trojan Horses

2.5.1 Types of Trojan 2.5.2 Stopping a Trojan Horses

2.6

Emerging Attacks: Social Engineering

2.7

Summary Answers/Solutions References/Further Readings

2.8 2.9

2.6.1 Types of Social Engineering 2.6.2 Physical Social Engineering

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.

2.2THE PROCESS OF INFECTION

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 does­modifying 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, self­replicating in nature that would infect an unauthorized user's computer by disrupting his operations. These self­replicating programs multiplied so fast that, today, they created a great threat to the smooth operation of a computer.

A boot sector is a sector of a hard disk, floppy disk, or data storage device that contains code for booting programs stored in other parts of the disk.

2.3VIRUSES 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. It replicates by being copied or initiating its copying to other program, computer boot sector or document. Viruses can be transmitted as attachments to an e­mail note, downloaded file or be present on a diskette or CD. Some viruses start their effects as soon as their code is executed; other viruses lie dormant unless circumstances cause their code to be executed by the computer. Generally speaking, viruses hide within computer files rather than sitting out in open, in some obvious, visible and separate form. But viruses must be run in order to allow them to proceed with their destruction work. Until this happens they cannot do any harm. This explains why the most effective technique for fending off viruses is to inspect all files and media that enter the system and then looking for possible signs of infections and then refusing to copy the infected material into memory.

2.3.1

Classification of Viruses

Viruses are classified on the basis of their mode of existence and there are three categories of viruses:

1) 26

Boot Infectors


2)

System Infectors

3)

General Executable Programme Infectors

Software Vulnerabilities

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 MS­DOS, 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)

2.3.2

EXE program can contain more than one segment. But a COM has to contain only a single segment

Types of Viruses

The virus list has become a non ending entity with new viruses joining the list every other day. We would be discussing some of the most commonly prevalent viruses in the computer industry. 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 MS­DOS. 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 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.

Software Vulnerabilities

Storm Worm: The fast spreading threat was identified as an email spamming to Microsoft systems. It starts collecting infected computers into the Storm botnet.

2.3.3

Infection Methods

Antivirus programs can spot a virus in one or two ways. First, the antivirus program may recognize a particular virus's signature, which is nothing more than the specific instructions embedded in the virus that tell it how to behave and act. A virus's signature is like a criminal's fingerprint & each one is unique and distinct. 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

RAM­resident 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 virus­free. 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. RAM­resident 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. RAM­resident 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 anti­viral programs. The anti­viral programs perform one or more of the following functions: •

Prevention

Detection

Vaccination

Inoculation

Identification, and/or

Damage control.

A good anti­viral 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 self­detection, 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 anti­viral 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 anti­viral program. Moreover, the virus writers keep altering the viral code, so that it cannot be detected by any existing anti­viral programs. The point to remember is that there is no cent percent foolproof anti­virus program available and, in principle there never will be.

Check Your Progress 1 1)

What is the difference between .EXE and .COM files?

…………………………………………………………………………………………... …………………………………………………………………………………………... 2)

Describe the process of booting?

…………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... 3)

Name the first commercial application of virus?

…………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………...

4)

What is virus and classified different types of viruses available?

…………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………...

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 e­mails or messages that provide their containers. Worms which use email to spread are known as mass­mailing 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. Mass­mailing 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 mass­mailing 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.

2.5 TROJAN HORSES Each kind of virus has different goals and objectives as we saw in the case of the previous two. Like a virus, a Trojan horse is a hidden piece of code. Viruses enter in a system secretly where Trojan horse enter by deceiving a user. A user allows or invites a Trojan into the system, believing in it, but actually Trojan horse contain some malicious code to perform some malicious activity. 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 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.

Software Vulnerabilities

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 e­mail 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 e­mail 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 log­in 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.

2.5.1

Types of Trojan

Once a Trojan has entered your computer , it may offer different kinds of attacks which range from harmless to destructive including ­­displaying taunting or annoying messages , wiping out data, stealing information such as password, placing another malware on the PC, allowing remote access to your computer. Some of them are listed as under:

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.

IconDance Trojan: The IconDance minimizes all application windows and then starts rapidly scrambling all the desktop icons, it does nothing more than make you take the time to reorganize your desktop window.

33


Information Security

2.5.2

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.

Stopping Trojan Horses

To protect yourself against Trojan horses, use a combination of different protective tools and a little common sense. 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. Although originally designed to protect against software conflicts, rollback programs can also protect your computer against viruses or Trojans. The moment a Trojan wipes out your data, run your rollback program to return your computer to the state it was in before the Trojan horse wiped out your hard disk. 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.imagine­lan.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 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 lesser­known, 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.

Software Vulnerabilities

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 zero­day 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.

Check Your Progress 2 1)

Describe different types of viruses?

…………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... 2)

What is a worm?

…………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... 3)

What are Trojan Horses?

…………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... 4)

Write down different types of Trojan?

…………………………………………………………………………………………... …………………………………………………………………………………………... …………………………………………………………………………………………... 35


Information Security

…………………………………………………………………………………………...

2.6 EMERGING ATTACKS: SOCIAL ENGINEERING Social Engineering is the name given to a category of security attacks in which someone manipulates others into revealing information that can be used to steal data access to systems, access to cellular phones , money or even your own identity. The complexity of such attacks may vary from very low to high. Gaining access to information over the phone or over website that one may visit has added new dimensions to the field of social engineering. Social engineering is basically the acquisition of sensitive information or inappropriate access privileges by an outsider based upon the building of an inappropriate trust relationship with the insiders. The “outsider” does not always refer to a person who is not an employee of the company or is stranger to you; an employee who tries to tamper the company policies is also a social engineer. 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 anti­virus, 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.

2.6.1 36

Types of Social Engineering


Although the majority of social engineering attacks focus on human­based interaction by the social engineer, there are also some computer­based 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 sign­on routine, gathered the information and passed the prompt to real sign­on process. About 95% of the normal user got their codes compromised at that time.

Software Vulnerabilities

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 social­engineering 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 third­party 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 account­id 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 number­one access point for social engineers is the good old­ fashioned password. After all the awareness programs and reminder cards, we still find that employee­generated passwords are too short or too easy to guess. System­generated 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 e­mail 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 help­desk 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.

2.6.2

Physical Social Engineering

A social engineer can simply walk in and behave like an employee. The employees of a company are generally not being trained to challenge strangers or if they have been trained there has not been much reinforcement of the challenge process. It is needful that all personnel on site wear appropriate identification. Some organizations require only visitors to wear badges. Therefore to become an employee a visitor must simply remove the badge. By ensuring that only authorized personnel are permitted access, the employees will have a safe working environment. Because there is neither hardware nor software available to protect an enterprise against social engineering, it is essential that good practices be implemented. Some of those practices might be: •

Require anyone there to perform service to show proper identification.

Establish a standard that passwords are never to be spoken over the phone.

Implement a standard that forbids passwords from being left lying about

Implement Caller ID technology for the help desk and other support functions.

To be effective, policies, procedures, and standards must be taught and reinforced to the employees. This process must be ongoing and must not exceed six months between reinforcement times. It is not enough to just publish policies and expect employees to read, understand and follow what is required. They need to be taught to emphasize what is important and how it will help them to do their jobs. This training should begin at new employee orientation and continue throughout employment. When a person becomes an ex­employee, a final time of reinforcement should be done during the exit interview process. 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

Name­dropping

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.

Check Your Progress 3 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 MS­DOS, 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

Check Your Progress 2 1)

There are the lists of some viruses:

• 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 became infected.

• 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.

• Lehigh Virus: This virus originated at the Lehigh University Computer Centre. This virus stays in the stack space of COMMAND.COM.

• Friday the 13th: This virus attacks not only the COMMAND.COM but also other executable files. 40


• Sunnyvale Slug: This does a variety of things like displaying a message

Software Vulnerabilities

"Greetings form Sunnyvale.

• Raindrops: This virus infects COM files. It intercepts the load and execute function of MS­DOS.

• 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". 2)

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.

3)

A Trojan Horse is a program in which malicious or harmful code is contained inside a apparently harmless software or file in such a way that it can get control and do its chosen form of damage, such as running file allocation table on the hard disk. Before a Trojan can attack, it must find a way to entice the victim to copy, download and run it. Trojans are commonly found on the websites that offer free software, such as shareware programs.

4)

The different types of Trojans are: • Joke Trojan • NVP Trojan • IconDance Trojan • Destructive

Check Your Progress 3 1)

Social Engineering is the name given to a category of security attacks in which someone manipulates others into revealing information that can be used to steal data ,access to systems ,access to cellular phones , money or even your own identity. The complexity of such attacks may vary from very low to high. Gaining access to information over the phone or over website that one may visit has added new dimensions to the field of social engineering.

2)

The different types of social engineering are:

• Dumpster diving and shoulder surfing. • Third party authorization and tech support. 3)

4)

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. Some potential security breaches of social engineering are: • Passwords • Modems 41


Information Security

• Help desk • Websites

2.9 REFERENCES/FURTHER READINGS • • • • • • •

42

Cryptography and network security principles and practice by William Stallings, Pearson publication. Computer Networks, by Andrew S. Tanenbaum, Fouth Edition, Prentice Hall of India. Networks Security Essentials: Application & Standards by W. Stallings, Pearson Education. en.wikipedia.org/wiki/Trojan_horse_(computing) en.wikipedia.org/wiki/Computer_virus

http://netsecurity.about.com/ http://www.cert.org/


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:

42

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


Information Security

understand the importance of network layout in network security; and

3.2 WHAT IS NETWORK SECURITY Let us first revisit the concept of network. A computer network is simply a system of interconnected computers. That is used every day to conduct transactions and communications among businesses, government agencies and individuals. The networks consist of "nodes", which are "client" terminals (individual user PCs), and one or more "servers" and/or "host" computers. They are linked by communication systems, some of which might be private, such as within a company and others which might be open to public access. The obvious example of a network system that is open to public access is the Internet, but many private networks also utilize publicly­ accessible communications. Today, most companies' host computers which can be accessed by their employees whether in their offices over a private communications network, or from their homes or hotel rooms while on the road through normal telephone lines. Hence, security plays a crucial role in that. Now, let us understand the concept of Network Security. 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.

3.3THREATS TO NETWORK SECURITY There are various threats identified for network security. Let us discuss few of them in brief: Viruses: Computer programs written by devious programmers and designed to replicate themselves and infect computers when triggered by a specific event. Viruses reproduce themselves by attaching themselves to other files that the user does not realize are infected. Viruses spread today mainly through E­mail attachments. The attachment may be a file that is a legitimate file but the virus may be attached as a macro program in the file. An example is a Microsoft word file. These files can contain macro programs which can be run by Microsoft Word. A virus may infect these files as a macro and when they get on the next user's computer, they can infect other files. These virus programs normally take advantage of a security vulnerability of the running application. Viruses can directly affect executable files or Dynamic Link Library (DLL) files that the operating systems and applications use to run. Usually the virus will spread before it will do anything that may alert the user of its presence. Unauthorized Access

43


“Unauthorized access'” is a very high­level term that can refer to a number of different sorts of attacks. The goal of these attacks is to access some resource that your machine should not provide the attacker.

Network Security and Authentication

Trojan Horse Programs Trojan horse software is the software that appears to have some useful function, but some hidden purpose awaits inside. This purpose may be to send sensitive information from inside your organization to the author of the software. To prevent Trojan horse programs from infiltrating your organization is to implement the countermeasures. Allowing only approved software with proper testing to be run in the organization will minimize the threat of these programs. The organizational security policy can help ensure that all members of the organization operate in compliance with this countermeasure. Data interception: It involves eavesdropping on communications or altering data packets being transmitted. Social engineering: Social engineering is concerned with obtaining confidential network security information through no technical means, such as posing as a technical support person and asking for people's passwords. DoS (Denial­of­Service) Attacks DoS (Denial­of­Service) attacks are probably the nastiest, and most difficult to address. These are the nastiest, because they're very easy to launch, difficult (sometimes impossible) to track, and it isn't easy to refuse the requests of the attacker, without also refusing legitimate requests for service. The premise of a DoS attack is simple: send more requests to the machine than it can handle.

3.4 COMPARISON WITH COMPUTER SECURITY When the term computer security is used, it specifically refers to the security of one computer, although the overall security of each individual computer is required for network security. When the term network security is used, it refers to the security of the network in general. This includes such issues as password security, network sniffing, intrusion detection, firewalls, network structure and so forth. Securing network infrastructure is like securing possible entry points of attacks on a country by deploying appropriate defense. Computer security is more like providing means to protect a single PC against outside intrusion. The former is better and practical to protect the civilians from getting exposed to the attacks. The preventive measures attempt to secure the access to individual computers­­the network itself­­ thereby protecting the computers and other shared resources such as printers, network­ attached storage connected by the network. Attacks could be stopped at their entry points before they spread. As opposed to this, in computer security the measures taken are focused on securing individual computer hosts. A computer host whose security is compromised is likely to infect other hosts connected to a potentially unsecured network. A computer host's security is vulnerable to users with higher access privileges to those hosts.

3.5 SECURITY ISSUES FOR SMALL AND MEDIUM­

SIZED BUSINESSES

44


Information Security

Small and medium­sized 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 medium­sized businesses. Ever­changing security threats from both inside and outside the business network can wreak havoc on business operations, affecting profitability and customer satisfaction. Small and medium­sized 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: Worms and Viruses As per research, Computer worms and viruses remain the most common security threat, with 75 percent of small and medium businesses affected by it.. Worms and viruses can have a devastating effect on business continuity and the bottom line. Smarter, more destructive strains are spreading faster than ever, infecting an entire office in seconds. Cleaning the infected computers takes much longer. The catastrophic results are lost orders, corrupted databases and angry customers. As businesses struggle to update their computers with the latest operating system patches and antivirus software, new viruses can penetrate their defenses any day of the week. Meanwhile, employees spread viruses and spyware by unwittingly accessing malicious Websites, downloading untrustworthy material, or opening malicious e­mail attachments. These attacks are unintentionally invited into the organization, but still cause significant financial losses. Security systems must detect and repel worms, viruses, and spyware at all points in the network. 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 medium­sized 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 medium­sized 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 day­to­day business operations, cyber­terrorists have begun targeting businesses for blackmail, threatening to bring down Websites and e­ commerce operations unless their demands are met. These denial­of­service (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: data and orders are lost and customer requests are not answered.

Network Security and Authentication

Check Your Progress 1 1)

What is Network Security.

........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... 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?

........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ...........................................................................................................................................

3.6TOOLS FOR NETWORK SECURITY There are many strong tools available for securing a computer network. Tools to protect your enterprise network have been evolving for the last two decades, roughly the same amount of time that people have been trying to break into computer networks. These tools can protect a computer network at many levels, and a well­ guarded enterprise deploys many different types of security technologies. The most obvious element of security is often times the most easily overlooked: physical security—namely, controlling access to the most sensitive components in your computer network, such as a network administration station or the server room. No amount of planning or expensive equipment will keep your network secure if unauthorized personnel can have access to central administration consoles. Even if a user does not have evil intent, an untrained user may unknowingly provide unauthorized outside access or override certain protective configurations. Let us briefly discuss few of these network security tools: 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, well­thought­out corporate policies are critical to determine and control access to various parts of the network.

3.7ELEMENTS OF NETWORK SECURITY Network security is broad domain term which includes many key elements. Let us discuss these elements in brief:

a)

Firewall As we have discussed in our earlier discussion on the Internet and similar networks, connecting an organization to the Internet provides a two­way 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 Transfer Protocol. It is TCP/IP network, modeled after the Internet that only works within the used for copying files organization). between computer systems. FTP server In order to provide some level of separation between an organization's 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 e­mail 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 compartmentalize different servers and networks, in effect controlling access 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.

Network Security and Authentication

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.

Figure 3.1: A Sample Application Gateways

These are also typically the slowest, because more processes need to be started in order to have a request serviced. Figure 3.1 shows an application gateways. 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.

Figure 3.2: A Sample Packet Filtering Gateway

Few terms specific to firewalls and networking are going to be used throughout this section, so let's understand them all together. 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. Access Control List (ACL) Many routers now have the ability to selectively perform their duties, based on a number of facts about a packet that comes to it. This includes things like origination address, destination address, destination service port, and so on. These can be employed to limit the sorts of packets that are allowed to come in and go out of a given network. 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)

49

Password Mechanisms


Passwords are a way to identify and authenticate users as they access the computer system. Unfortunately, there are a number of ways in which a 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.

Network Security and Authentication

Password Aging and Policy Enforcement Password aging is a feature that requires users to create new passwords every so often. Good password policy dictates that passwords must be a minimum number of characters and a mix of letters and numbers. Smart cards provide extremely secure password protection. Good password procedures include the following: • Do not use your login name in any form (as is, reversed, capitalized, doubled etc.). • Do not use your first, middle, or last name in any form or use your spouse’s or children’s names. • Do not use other information easily obtained about you. This includes license plate numbers, telephone numbers, social security numbers, the make of your automobile, the name of the street you live on etc. • Do not use a password of all digits or all the same letter. • 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 mixed­case alphabetic. • Do use a password with non­alphabetic characters (digits or punctuation).

• Do use a password that is easy to remember, so that you don’t have to write it down.

c)

Elements of Networking Security: Encryption As we discussed earlier, a firewall system is a hardware/software configuration that sits at perimeter between a company's network and the Internet, controlling access into and out of the network. Encryption can be understood as a method of ensuring privacy of data and that only intended users may view the information. Authentication and Integrity Authentication is simply making sure users are who they say they are. When using resources or sending messages in a large private network, not to mention the Internet, authentication is of the utmost importance. Integrity knows that the data sent has not been altered along the way. Of course, a message modified in any way would be highly suspect and should be completely discounted. Message integrity is maintained with digital signatures. A digital signature is a block of data at the end of a message that attests to the authenticity of the file. If any change is made to the file, the signature will not verify. Digital signatures perform both an authentication and message integrity function.

d)

Developing a Site Security Policy

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 policy­making 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 day­to­day users from different levels within the organization. Decision­makers must have the power to enforce the policy; technical personnel will advise on the ramifications of the policy; and day­to­ 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.

Check Your Progress 2 1)

Write down the different tools available for Network Security?

........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... 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?

........................................................................................................................................... ...........................................................................................................................................

3.8SECURE NETWORK DEVICES In this unit, we have already learnt that the firewall is only one entry point to your network. Modems, if you allow them to answer incoming calls, can provide an easy means for an attacker to sneak around, your front door (or, firewall). Just as castles

51


weren't built with moats only in the front, your network needs to be protected at all of its entry points.

Network Security and Authentication

Secure Modems, Dial­Back Systems If modem access is to be provided, this should be guarded carefully. The terminal server, or network device that provides dial­up access to your network needs to be actively administered, and its logs need to be examined for strange behavior. Its passwords need to be strong ­­ not ones that can be guessed. Accounts that aren't actively used should be disabled. In short, it's the easiest way to get into your network from remote: guard it carefully. There are some remote access systems which have the feature of a two­part procedure to establish a connection. The first part is the remote user dialing into the system, and providing the correct user­id 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 one­time 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. Crypto­Capable 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. Virtual Private Networks Given the ubiquity of the Internet, and the considerable expense in private leased lines, many organizations have been building VPNs (Virtual Private Networks). Traditionally, for an organization to provide connectivity between a main office and a satellite one, an expensive data line had to be leased in order to provide direct connectivity between the two offices. Now, a solution that is often more economical is to provide both offices connectivity to the Internet. Then, using the Internet as the medium, the two offices can communicate. 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 add­on. If you have needed to connect several offices together, this might very well be the best way to do it.

3.9 SIGNIFICANCE OF NETWORK LAYOUT IN

NETWORK SECURITY

The network layout has much influence over the security of the network. The placement of servers with respect to the firewall and various other computers can affect both network performance and security. There may even be areas of the network which are more secure than others. Some of these areas may be further protected with an additional firewall. A typical secure network diagram is shown below in Figure 3.3:

Figure 3.3: Typical Secure Network Diagram

In the above diagram, the box labeled "IDS" is an intrusion detection system which may be a computer or devised designed to log network activity and detect any suspicious activity. In this diagram, it is shown outside the firewall on the semi­private network and protecting the servers on the private network. It may be a good idea to place IDS just inside the firewall to protect the entire private network since an attack may be first launched against a workstation before being launched against a server. The IDS protecting the servers could be moved to protect the entire private network, but depending on cost and requirements it is also good to protect your servers, especially the mail server. The semi­private network is commonly called a "DMZ" (for DeMilitarized Zone) in many security circles. In this diagram, the semi­private network contains a mail relay box to increase security since the mail server is not directly accessed. The mail relay box routes mail between the internet and the mail server. Other network equipment used includes:

53


Routers: 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 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

Network Security and Authentication

Check Your Progress 3 1)

What are crypto­capable routers?

........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... 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. An organizational network may be susceptible to various kinds of threats like virus, Trojan horse, unauthorized access, executing commands illicitly, vandals / destructive behavior (which includes data destruction and data diddling), social engineering, Denial of Service attacks etc. 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

Check Your Progress 1 1)

A computer network is simply a network of interconnected computers. The networks consist of several nodes called clients (individual user PCs), and one or more servers and/or host computers. Network security comprises the measures a company takes to protect its computer system and it is a prime concern for every company that uses computers.

2)

The different types of network security threats are: • Virus • DoS Attack • Trojan horse • Social engineering • Unauthorized access • Data interception

3)

The difference between computer security and network security are: In computer security, it specifically refers to the security of one computer but the overall security of each individual computer is required for network security. In network security, it refers to the security of the network in general such as password security, network sniffing, intrusion detection, firewalls, network structure and so forth.

4)

There are three security issues related to small and medium sized businesses are: • Worms and Viruses • Information thefts • Business availability

55


Check Your Progress 2 1)

The different kinds of tools to network security are:

Network Security and Authentication

• Antivirus software • Encryption • Security management • Identity services • Virtual Private Networks • Secure network infrastructure

2)

Firewall is defined as a software tool that provides separation between an organization's intranet and the Internet, firewalls have been employed. A firewall is simply a group of components which collectively form a barrier between two networks. Firewall systems protect and facilitate your network at a number of levels. They allow e­mail 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

3)

There are a variety of antivirus software packages which operate in many different ways, depending on how the vendor chose to implement their software. What they have in common, though, is that they all look for patterns in the files or memory of your computer which indicate the possible presence of a known virus. Antivirus packages know what to look for through the use of virus profiles (sometimes called "signatures") provided by the vendor. New viruses are discovered daily. The effectiveness of antivirus software is dependent on having the latest virus profiles installed on your computer so that it can look for recently discovered viruses. It is important to keep these profiles up to date.

4)

Good password procedures include the following: •

Do not use your login name in any form (as is, reversed, capitalized, doubled, etc.).

Do not use your first, middle, or last name in any form or use your spouse’s or children’s names.

Do not use other information easily obtained about you. This includes license plate numbers, telephone numbers, social security numbers, the make of your automobile, the name of the street you live on, etc.

Do not use a password of all digits or all the same letter.

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 mixed­case alphabetic.

Do use a password with non­alphabetic characters (digits or punctuation).

Do use a password that is easy to remember, so you don’t have to write it down.

Check Your Progress 3 1)

A crypto­capable routers have feature that is being built into some routers is the ability to use session encryption between specified routers.

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.

3.12 • • • •

• • • • •

REFERENCES/FURTHER READINGS Networks Security Essentials: Application & Standards by W. Stallings, Pearson Education, 2000 Self­Defending Networks: The Next Generation of Network Security by Duane DeCapite, Cisco Press, Sep. 8, 2006. Network Security: PRIVATE Communication in a PUBLIC World, by Charlie Kaufman , Radia Perlman , Mike Speciner, Prentice­Hall, 2002. ISBN Security Threat Mitigation and Response: Understanding CS­MARS, Dale Tesch/Greg Abelar, Cisco Press, Sep. 26, 2006.

http://netsecurity.about.com/ http://www.cert.org/ http://www.networknewz.com/ http://www.developers.net http://www.iec.org/

BLOCK GLOSSARY

57


Security: security in terms of data or information is the protection against accidental or intentional destruction or modification of data.

Network Security and Authentication

Privacy: right of an individual to decide what information he wants to share with others or what information him to accept from others. DNS: DNS stands for Domain Name System. DNS maps a name to an IP address and vice versa. IP addresses: IP address is a unique 32 bit internet address that is used for communication in Internet Protocol version 4. 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. MIS: MIS stands for Management Information System. 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. Authentication: the process of verifying a person or object. Authorization: the process of specifying access rights to resources. Symmetric encryption: Symmetric encryption systems, also known as secret or private key encryption systems/conventional encryption/single key encryption were the only type of encryption in use prior to the development of asymmetric key encryption systems. Asymmetric encryption: Asymmetric key encryption systems are also known as Public –key encryption systems. These systems use two keys, one key to encrypt the message and the other corresponding key to decrypt the message 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. Brain Virus: it is a first commercial application of viruses developed in 1985. ROM: ROM stands for Read Only Memory. 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 MS­Dos 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. Social Engineering: Social Engineering is a kind of security attacks in which someone manipulates others into revealing information that can be used to steal data access to systems, access to cellular phones , money or even your own identity. VPN: VPN stands for Virtual Private Network. Client: A client is an application or system that accesses a remote service on another computer system. Servers: A server is any combination of hardware or software designed to provide services to clients. Spyware: Spyware is software installed secretly on a personal computer to collect information about a user. FTP: FTP stands for File Transfer Protocol. 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 go­between for requests from clients seeking resources from other servers. Application Gateways: it referred to as application proxies. That is applications located between the end user and the Internet. Gateway: it is a communication device to interconnect LANs and WANs.

59


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.

Network Security and Authentication

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. DHCP: it is a network application protocol used by devices to obtain configuration information for operation in an Internet Protocol network.

60


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.