Computer Application in Pharmacy

download Computer Application in Pharmacy

of 49

Transcript of Computer Application in Pharmacy

  • 8/7/2019 Computer Application in Pharmacy

    1/49

    University College of Pharmacy

    University of the Punjab, Lahore

    Computer Applications in Pharmacy

    Compiled from Different Books and Websites

    No Citation is given due to lack of time.

    Its not my work, 100% copied and compiled from Books and website.

  • 8/7/2019 Computer Application in Pharmacy

    2/49

    Computer Application in Pharmacy Fundamentals

    1

    Computer Types According to Capability

    SupercomputersA supercomputer is a computer that performs at or near the currently highest operational rate forcomputers. A supercomputer is typically used for scientific and engineering applications that must

    handle very large databases or do a great amount of computation (or both). At any given time, there areusually a few well-publicized supercomputers that operate at the very latest and always incrediblespeeds.Perhaps the best-known builder of supercomputers has been Cray Research, now a part of SiliconGraphics. Some supercomputers are at "supercomputer center," usually university research centers,some of which, in the United States, are interconnected on an Internet backbone (A backbone is alarger transmission line that carries data gathered from smaller lines that interconnect with it) known asvBNS or NSFNet.At the high end of supercomputing are computers like IBM's "Blue Pacific," announced on October 29,1998. Built in partnership with Lawrence Livermore National Laboratory in California, Blue Pacific isreported to operated at 3.9 teraflop (trillion floating point operations per second), 15,000 times fastethan the average personal computer. It consists of 5,800 processors containing a total of 2.6 trillion

    bytes of memory and interconnected with five miles of cable.

    Mainframe ComputersA very large and expensive computer capable of supporting hundreds, or even thousands, of userssimultaneously. In the hierarchy that starts with a simple microprocessor (in watches, for example) atthe bottom and moves to supercomputers at the top, mainframes are just below supercomputers. Insome ways, mainframes are more powerful than supercomputers because they support moresimultaneous programs. But supercomputers can execute a single program faster than a mainframe.The distinction between small mainframes and minicomputers is vague (not clearly expressed),depending really on how the manufacturer wants to market its machines.

    Servers / Minicomputers

    A midsized computer. In size and power, minicomputers lie between workstations and mainframes. Inthe past decade, the distinction between large minicomputers and small mainframes has blurred,however, as has the distinction between small minicomputers and workstations. But in general,minicomputer is a multiprocessing system capable of supporting from 4 to about 200 userssimultaneously.

    DesktopsThese are also called microcomputers. Low-end desktops are called PCs and high-end onesWorkstations. These are generally consisting of a single processor only, sometimes 2, along withMBs of memory, and GBs of storage. PCs are used for running productivity applications, Websurfing, messaging. Workstations are used for more demanding tasks like low-end 3-D simulations andother engineering & scientific apps. These are not as reliable and fault-tolerant as servers. Workstations

    cost a few thousand dollars; PC around a $1000.

    PortablesPortable computer is a personal computer that is designed to be easily transported and relocated, but islarger and less convenient to transport than a notebook computer. The earliest PCs designed for easytransport were called portables. As the size and weight of most portables decreased, they becameknown as laptop computer and later as notebook computer. Today, larger transportable computerscontinue to be called portable computers. Most of these are special-purpose computers - for example,those for use in industrial environments where they need to be moved about frequently.

  • 8/7/2019 Computer Application in Pharmacy

    3/49

    Computer Application in Pharmacy Fundamentals

    2

    PDA (personal digital assistant) is a term for any small mobile hand-held device that providescomputing and information storage and retrieval capabilities for personal or business use, often forkeeping schedule calendars and address book information handy. The term handheld is a synonym.Many people use the name of one of the popular PDA products as a generic term. These includeHewlett-Packard's Palmtop and 3Com's PalmPilot.Most PDAs have a small keyboard. Some PDAshave an electronically sensitive pad on which

    handwriting can be received. Apple's Newton,which has been withdrawn from the market, wasthe first widely-sold PDA that acceptedhandwriting. Typical uses include schedule andaddress book storage and retrieval and note-entering. However, many applications have beenwritten for PDAs. Increasingly, PDAs arecombined with telephones and paging systems.Some PDAs offer a variation of the MicrosoftWindows operating system called Windows CE.Other products have their own or anotheroperating system.

    At the highest level, two things are required for computing

    HardwareComputer equipment such as a CPU, disk drives, CRT, or printer

    SoftwareA computer program, which provides the instructions which enable the computer hardware to work

    Components of ComputerAll computers have the following essential Hardware Components

    InputThe devices used to give the computer data or commands are called Input devices. Includes

    keyboard, mouse, scanner, etcMouseA mouse is a small device that a computer user pushes across a desk surface in order to point to a placeon a display screen and to select one or more actions to take from that position. The mouse firstbecame a widely-used computer tool when Apple Computer made it a standard part of the AppleMacintosh. Today, the mouse is an integral part of the graphical user interface (GUI) of any personalcomputer. The mouse apparently got its name by being about the same size and color as a toy mouse.

    KeyboardOn most computers, a keyboard is the primary text input device. A keyboard on a computer is almostidentical to a keyboard on a typewriter. Computer keyboards will typically have extra keys, however.Some of these keys (common examples include Control, Alt, and Meta) are meant to be used inconjunction with other keys just like shift on a regular typewriter. Other keys (common examples

    include Insert, Delete, Home, End, Help, function keys, etc.) are meant to be used independently andoften perform editing tasks.

    JoystickIn computers, a joystick is a cursor control device used in computer games. The joystick, which got itsname from the control stick used by a pilot to control the ailerons and elevators of an airplane, is ahandheld lever that pivots on one end and transmits its coordinates to a computer. It often has one ormore push-buttons, called switches, whose position can also be read by the computer.

    Digital Camera

  • 8/7/2019 Computer Application in Pharmacy

    4/49

    Computer Application in Pharmacy Fundamentals

    3

    A digital camera records and stores photographic images in digital form that can be fed to a computeras the impressions are recorded or stored in the camera for later loading into a computer or printer.Currently, Kodak, Canon, and several other companies make digital cameras.

    MicrophoneA device that converts sound waves into audio signals is called Microphone. This could be used forsound recording as well as voice chatting through internet.

    ScannerA scanner is a device that captures images from photographic prints, posters, magazine pages, andsimilar sources for computer editing and display. Scanners come in hand-held, feed-in, and flatbedtypes and for scanning black-and-white only, or color. Very high resolution scanners are used forscanning for high-resolution printing, but lower resolution scanners are adequate for capturing imagesfor computer display. Scanners usually come with software, such as Adobe's Photoshop product, thatlets you resize and otherwise modify a captured image

    ProcessorA processor is the logic circuitry that responds to and processes the basic instructions that drive acomputer.The term processor has generally replaced the term central processing unit (CPU). The processor in apersonal computer or embedded in small devices is often called a microprocessor.

    Short for microprocessor, the central processing unit in a computer. The processor is the logic of acomputer and functions comparably to a human central nervous system, directing signals from oncomponent to another and enabling everything to happen

    MemoryMemory is the electronic holding place for instructions and data that your computer's microprocessorcan reach quickly. When your computer is in normal operation, its memory usually contains the mainparts of the operating system and some or all of the application programs and related data that arebeing used. Memory is often used as a shorter synonym for random access memory (RAM). This kindof memory is located on one or more microchips that are physically close to the microprocessor in yourcomputer. Most desktop and notebook computers sold today include at least 16 megabytes of RAM,and are upgradeable to include more. The more RAM you have, the less frequently the computer has to

    access instructions and data from the more slowly accessed hard disk form of storage.Memory is also called primary or main memory.

    RAMRAM (random access memory) is the place in a computer where the operating system, applicationprograms, and data in current use are kept so that they can be quickly reached by the computer'sprocessor. RAM is much faster to read from and write to than the other kinds of storage in a computer,the hard disk, floppy disk, and CD-ROM. However, the data in RAM stays there only as long as yourcomputer is running. When you turn the computer off, RAM loses its data. When you turn yourcomputer on again, your operating system and other files are once again loaded into RAM, usuallyfrom your hard disk.

    ROMROM is "built-in" computer memory containing data that normally can only be read, not written to.

    ROM contains the programming that allows your computer to be "booted up" or regenerated each timeyou turn it on. Unlike a computer's random access memory (RAM), the data in ROM is not lost whenthe computer power is turned off.The ROM is sustained by a small long-life battery in your computer.

    StorageComputer storage is the holding of data in an electromagnetic form for access by a computer processor.It is also called secondary storage. In secondary storage data resides on hard disks, tapes, and otherexternal devices.

  • 8/7/2019 Computer Application in Pharmacy

    5/49

    Computer Application in Pharmacy Fundamentals

    4

    Primary storage is much faster to access than secondary storage because of the proximity of the storageto the processor or because of the nature of the storage devices. On the other hand, secondary storagecan hold much more data than primary storage.

    Hard diskHard disk is a computer storage device which saves and retrieves the data when required. Its capacity ismuch greater than the computer memory (RAM, ROM). Data on hard disk is stored and retrieved fromelectromagnetically charged surface.

    Today we can save huge amount of data on a single hard disk. Now hard disks can contain severalbillion bytes.

    Floppy diskA diskette is a random access, removable data storage medium that can be used with personalcomputers. The term usually refers to the magnetic medium housed in a rigid plastic cartridgemeasuring 3.5 inches square and about 2 millimeters thick. Also called a "3.5-inch diskette," it canstore up to 1.44 megabytes (MB) of data.

    TapeIn computers, tape is an external storage medium, usually both readable and writable, can store data inthe form of electromagnetic charges that can be read and also erased. A tape drive is the device thatpositions, writes from, and reads to the tape.

    CDA compact disc [sometimes spelled disk] (CD) is a small, portable, round medium for electronicallyrecording, storing, and playing back audio, video, text, and other information in digital form.

    DVDDVD (digital versatile disc) is an optical disc technology that is expected to rapidly replace theCDROM disc (as well as the audio compact disc) over the next few years. The digital versatile disc(DVD) holds 4.7 gigabyte of information on one of its two sides, or enough for a 133-minute movie.

    Classifying Memory/StorageElectronic (RAM, ROM), Magnetic (HD, FD, Tape), Optical (CD, DVD)Volatile (RAM), Non-Volatile (HD)Random Access (RAM, HD), Serial Access (Tape)

    Read/Write (HD, RAM), Read-Only (CD)

    OutputThe devices to which the computer writes data are called Output devices. Often converts the data into ahuman readable form. Monitor and printer are output devices.PrinterPlotterSpeakersMonitor

    PortsOn computer and telecommunication devices, a portis generally a specific place for being physicallyconnected to some other device, usually with a socket and plug of some kind. Typically, a personal

    computer is provided with one or more serial ports and usually one parallel port.

    Types of Ports:

    ParallelAn interface on a computer that supports transmission of multiple bits at the same time; almostexclusively used for connecting a printer, On IBM or compatible computers, the parallel port uses a 25-pin connector.

    Serial

  • 8/7/2019 Computer Application in Pharmacy

    6/49

  • 8/7/2019 Computer Application in Pharmacy

    7/49

  • 8/7/2019 Computer Application in Pharmacy

    8/49

    Computer Application in Pharmacy Fundamentals

    7

    programs that perform a particular function related to computer system management and maintenance.Examples includes Anti-virus Software, Data compression Software, Disk optimization Software, Diskbackup Software

    Application SoftwarePrograms that generally interact with the user to perform work that is useful to the user. Theseprograms generally talk to the Hardware through the assistance of system Software.

    Application Software are programs that interact directly with the user for the performance of a certaintype of workScientific/Engineering/Graphics Software, Mathematica; AutoCad; Corel Draw;Business Software; The billing system for the mobile phone companyProductivity Software; Word processors; SpreadsheetsEntertainment Software; GamesEducational Software; Electronic encyclopedias

  • 8/7/2019 Computer Application in Pharmacy

    9/49

    Computer Application in Pharmacy Operating System

    1

    Operating SystemAn operating system is a program that manages the computer hardware. It also provides a basis forapplication programs and acts as an intermediary between a user of a computer and the computerhardware.

    Why an Operating System?An operating system is an important part of almost every computer system. A computer system can bedivided roughly into four components:

    The hardware The operating system The application programs And the usersThe hardware the central processing unit (CPU), the memory, and the input/output devices provides the basic computing resources. The application programs such as word processors,spreadsheets, compilers, and web browsers, define the ways in which these resources are used to solvethe computing problems of the users. The operating system controls and coordinates the use of thehardware among various application programs for the various users.

    The components of a computer system are its hardware, software, and data. The operating systemprovides the means for the proper use of these resources in the operation of the computer system. Anoperating system is similar to a government. Like a government, it performs no useful function byitself. It simply provides an environmentwithin which other programs can do useful work. Operatingsystems can be explored from two viewpoints: the user and the system.

    Operating System Definition

    User View

    The user view of the computer varies by the interface being used. Most computer users sit in front of aPC, consisting of monitor, keyboard, mouse, and system unit. Such a system is designed for one user tomonopolize its resources, to maximize the work (or play) that the user is performing. In this case, the

    operating system is designed mostly forease of use, with some attention paid to performance, andnone paid to resource utilization. Performance is important to the user, it does not matter if most of thesystem is sitting idle, waiting for the slow I/O speed of the user.Some users sit at a terminal connected to a mainframe orminicomputer. Other users are accessingthe same computer through other terminals. These users share resources and may exchangeinformation. The operating system is designed to maximize resource utilization to assure that allavailable CPU time, memory, and I/O are used efficiently, and that no individual user takes more thanher fair share.Other users sit at workstations, connected to networks of other workstations and servers. These usershave dedicated resources at their disposal, but they also share resources such as networking and servers file, compute and print servers. Therefore, their operating system is designed to compromise betweenindividual usability and resource utilization.

    System ViewFrom the computers point of view, the operating system is the program that is most intimate with thehardware. We can view an operating system as a resource allocator. A computer system has manyresources hardware and software that maybe required to solve a problem: CPU time, memoryspace, file-storage space, I/O devices, and so on. The operating system acts as the manager of theseresources. Facing numerous and possibly conflicting requests for resources, the operating system mustdecide how to allocate them to specify programs and users so that it can operate the computer systemefficiently and fairly.

  • 8/7/2019 Computer Application in Pharmacy

    10/49

    Computer Application in Pharmacy Operating System

    2

    Mainframe SystemsMainframe Computer Systems were the first computers used to tackle many commercial andscientific applications. In this section, we trace the growth of mainframe systems from simple BatchSystems, where the computer runs one and only one application, to Time-Shared Systems, whichallow for user interaction with the computer system.

    Batch SystemsEarly computers were physically enormous machines run from a console. The common input deviceswere card readers and tape drives. The common output devices were line printers, tape drives and cardpunches. The user did not interact directly with the computer systems. Rather, the user prepared a job which consisted of the program, the data, and some control information about the nature of the job(control cards) and submitted it to the computer operator. The job was usually in the form of punchcards. At some later time (after minutes, hours, or days), the output appeared. The output consisted ofthe result of the program, as well as a dump of the final memory and register contents for debugging.

    The operating system in these early computers was fairly simple. Its major task was to transfer controlautomatically from one job to the next. The operating system was always resident in memory.

    To speed up processing, operators batched together jobs with similar needs and ran them through thecomputer as a group.

    Multiprogrammed SystemsThe most important aspect of job scheduling is the ability to multiprogram. A single user cannot, ingeneral, keep either the CPU or the I/O devices busy at all times. Multiprogramming increases CPUutilization by organizing jobs so that the CPU always has one to execute.

    The idea is as follows: The operating system keeps several jobs in memory simultaneously. This set ofjobs is a subset of the jobs kept in the job pool since the number of jobs that can be keptsimultaneously in memory is usually much smaller than the number of jobs that can be in the pool job.The operating system picks and begins to execute one of the jobs in the memory. Eventually, the jobmay have to wait for some task, such as an I/O operations, to complete. In a non-multiprogrammedsystem, the CPU would sit idle. In a multiprogramming system, the operating system simply switches

    to, and executes, anotherjob, and so on. Eventually, the first job finishes waiting and gets the CPUback. As long as at least one job needs to execute, the CPU is never idle.

    This idea is common in other life situations. A lawyer does not work for only one client at a time.While one case is waiting to go to trial or have papers typed, the lawyer can work on another case. Ifshe has enough clients, the lawyer will never be idle for lack of work. (Idle lawyers tend to becomepoliticians, so there is a certain social value in keeping lawyers busy.)

    Time-Sharing SystemsMultiprogrammed, batched systems provided an environment where the various system resources ( forexample, CPU, memory, peripheral devices ) were utilized effectively, but it did not provide for userinteraction with the computer system. Time sharing (or multitasking) is a logical extension ofmultiprogramming. The CPU executes multiple jobs by switching among them, but the switches occur

    so frequently that the users can interact with each program while it is running.

    An interactive (or hands-on) computer system provides direct communication between the user and thesystem. The user gives instructions to the operating system or to a program directly, using a keyboardor a mouse, and wait for immediate results. Accordingly, the response time should be short typicallywithin 1 second or so.

    A time-shared operating system allows many users to share the computer simultaneously. Since eachaction or command in a time-shared system tends to be short, only a little CPU time is needed for eachuser. As the system switches rapidly from one user to the next, each user is given the impression thatthe entire computer system is dedicated to her use, even though it is being shared among many users.

  • 8/7/2019 Computer Application in Pharmacy

    11/49

    Computer Application in Pharmacy Operating System

    3

    A time-shared operating system uses CPU scheduling and multiprogramming to provide each user witha small portion of a time-shared computer. Each user has at least one separate program in memory. Aprogram loaded into memory and executing is commonly referred to as a process. When a processexecutes, it typically executes for only short time before it either finishes or needs to perform I/O. I/Omaybe interactive; that is, output is to a display for the user and input is from a user keyboard, mouse,or other device. Since interactive I/O typically runs at people speeds, it may take a long time tocomplete. Input, for example, maybe bounded by the users typing speed; seven characters per second

    is fast for people, but incredibly slow for computers. Rather than let the CPU sit idle when thisinteractive input takes place, the operating system will rapidly switch the CPU to the program of someother user.

    Time-sharing operating systems are even more complex than multiprogrammed operating systems. Inboth, several jobs must be kept simultaneously in memory, so the system must have memorymanagement and protection. To obtain a reasonable response time, jobs may have to be swapped in andout of main memory to the disk that now serves as a backing store for main memory. A commonmethod for achieving this goal is virtual memory, which is a technique that allows the execution of ajob that may not be completely in memory.

    Multiprocessor SystemsMost systems to date are single-processor systems; that is, they have only one main CPU. However,

    multiprocessor systems (also known as parallel systems ortightly coupled systems) are growing inimportance. Such systems have more than one processor in close communication, sharing the computerbus, the clock, and sometimes memory and peripheral devices.Multiprocessor systems have three main advantages:

    Increased ThroughputBy increasing the number of processors, we hope to get more work done in less time. The speed-upratio with Nprocessors is not N; rather, it is less than N. when multiple processors cooperate on a task,a certain amount of overhead is incurred in keeping all the parts working correctly. This overhead, pluscontention for shared resources, lowers the expected gain from additional processors. Similarly, agroup ofNprogrammers working closely together does not result in Ntimes the amount of work beingaccomplished.

    Economy of ScaleMultiprocessor systems can save more money than multiple single-processor systems, because theycan share peripherals, mass storage, and power supplies. If several programs operate on the same set ofdata, it is cheaper to store those data on one disk and to have all the processors share them, than to havemany computers with local disks and many copies of the data.

    Increased Reliability

    If functions can be distributed properly among several processors, then the failure of one processor willnot halt the system, only slow it down. If we have ten processors and one fails, then each of theremaining nine processors must pick up a share of the work of the failed processor. Thus, the entiresystem runs only 10 percent slower, rather than failing altogether. This ability to continue providing

    service proportional to the level of surviving hardware is called graceful degradation. Systemsdesigned for graceful degradation are also called fault tolerant.The most common multiple-processor systems now use symmetric multiprocessing (SMP), in whicheach processor runs an identical copy of the operating system, and these copies communicate with oneanother as needed. Some systems use asymmetric multiprocessing, in which each processor is assigneda specific task. A master processor controls the system; the other processors either look to the masterfor instruction or have predefined tasks. This scheme defines a master-slave relationship. The masterprocessor schedules and allocates work to the slave processors.

    Distributed Systems

  • 8/7/2019 Computer Application in Pharmacy

    12/49

    Computer Application in Pharmacy Operating System

    4

    A network, in the simplest terms, is a communication path between two or more systems. Distributedsystems depend on networking for their functionality. By being able to communicate, distributedsystems are able to share computational tasks, and provide a rich set of features to users.Networks are typecast based on the distances between their nodes. A local-area network (LAN),exists within a room, a floor, or a building. A wide-area network (WAN), usually exists betweenbuildings, cities, or countries. A global company may have a WAN to connect its offices, worldwide.These networks could run one protocol or several protocols. The continuing advent of new

    technologies brings about new forms of networks. For example, a metropolitan-area network(MAN), could link buildings within a city. Bluetooth devices communicate over a short distance ofseveral feet, in essence creating a small-area network.

    Client-Server SystemsAs PCs have become faster, more powerful, and cheaper, designers have shifted away from thecentralized system architecture. Terminals connected to centralized systems are now being supplantedby PCs. Correspondingly; user-interface functionality that used to be handled directly by thecentralized systems is increasingly being handled by the PCs. As a result, centralized systems today actas server systems to satisfy requests generated by client systems.Server systems can be broadly categorized as compute servers and file servers.

    Compute-server systems provide an interface to which clients can send requests to perform anaction, in response to which they execute the action and send back results to the client. File-server systems provide a file-system interface where clients can create, update, read, and

    delete files.

    Peer-to-Peer SystemsThe growth of computer networks especially the internet and World Wide Web (WWW) has had aprofound influence on the recent development of operating systems. When PCs were introduced in the1970s, they were designed for personal use and were generally considered standalone computers.With the beginning of widespread public use of the internet in the 1980s for electronic mail, ftp, andgopher, many PCs became connected to computer networks. With the introduction of the Web in themid-1990s, network connectivity became an essential component of a computer system.

    REAL-TIME SYSTEMSAnother form of a special-purpose operating system is the real-time system. A real-time system isused when rigid time requirements have been placed on the operation of a processor or the flow ofdata; thus, it is often used as a control device in a dedicated application. Sensors bring data to thecomputer. The computer must analyze the data and possibly adjust controls to modify the sensorinputs. Systems that control scientific experiments, medical imaging systems, industrial controlsystems, and certain display systems are real-time systems. Some automobile-engine fuel-injectionsystems, home-appliance controllers, and weapon systems are also real-time systems.

    A real-time system has well-defined, fixed time constraints. Processing mustbe done within thedefined constraints, or the system will fail. For instance, it would not do for a robot arm to beinstructed to halt afterit had smashed into the car it was building. A real-time system functions

    correctly only if it returns the correct result within its time constraints. Contrast this requirement to atime-sharing system, where it is desirable (but not mandatory) to respond quickly, or to a batch system,which may have no time constraints at all.

    Real-time systems come in two flavors: hard and soft. A hard real-time system guarantees that criticaltasks be completed on time. This goal requires that all delays in the system be bounded, from theretrieval of stored data to the time that it takes the operating system to finish any request made of it.Such time constraints dictate the facilitates that are available in hard real-time systems. Secondarystorage of any sort is usually limited or missing, with data instead being stored in short-term memoryor in read-only memory (ROM).

  • 8/7/2019 Computer Application in Pharmacy

    13/49

    Computer Application in Pharmacy Operating System

    5

    A less restrictive type of real-time system is a soft real-time system, where a critical real-time taskgets priority over other tasks, and retains that priority until it completes. As in hard real-time systems,the operating-system kernel delays need to be bounded. A real-time task cannot be kept waitingindefinitely for the kernel to run it. Soft real-time is an achievable goal that can be mixed with othertypes of systems. Soft real-time systems, however, have more limited utility than hard real-timesystems. Given their lack of deadline support, they are risky to use for industrial control and robotics.They are useful, however in several areas, including multimedia, virtual reality, and advanced scientific

    projects such as undersea exploration and planetary rovers.

    Operating System StructureAn operating system provides the environment within which programs are executed. Internally,operation systems vary greatly in their makeup, being organized along many different lines. The designof new operating system is major task. The goals of system must be well defined before the designbegins. The type of system desired is the basis for choices among various algorithms and strategies.

    An operating system may be viewed from several vantage points. One is by

    examining the services that it provides. Another is by looking at the interface thatit makes available to users and programmers. A third is by disassembling the

    system into its components and their interconnections.

    In this chapter, we explore all three aspects of operating systems, showing the viewpoints of users,programmers, and operating system designers. We consider what services an operating systemprovides, how they are provided, and what the various methodologies are for designing such systems.

    System ComponentsWe can create a system as large and complex as an operating system only by partitioning it into smallerpieces. Each piece should be a well delineated portion of the system, with carefully defined inputs,outputs, and functions. Obviously, not all systems have the same structure. However, many modernsystems share the goal of supporting the system components like Process Management, MemoryManagement, Secondary Storage Management, File System Management, IO-System Management.

    Process Management

    A program does nothing unless its instructions are executed by a CPU. A process can be thought of asa program in execution, but its definition will broaden as we explore it further. A time-shared userprogram such as a compiler is a process. A word processing program being run by an individual useron a PC is a process. A system task, such as sending output to a printer, is also a process. For now, youcan consider a process to be a job or a time shared program, but alter you will learn that the concept ismore general.

    A process needs certain resources-including CPU time, memory, files, and, I/O devices-to accomplishits task. These resources are either given to the process when it is created, or allocated to it while it isrunning. In addition to the various physical and logical resources that a process obtains when it iscreated, various initialization data (or input) may be passed along. For example, consider a processwhose function is to display the status of a file on the screen of a terminal. The process will be given asan input the name of the file, and will execute the appropriate instructions and system calls to obtain

    and display on the terminal the desired information. When the process terminates, the operating systemwill reclaim any reusable resources.

    We emphasize that program by itself is not a process; a program is a passive entity, such as thecontents of a file stored on a disk, whereas a process is an active entity, with a program counterspecifying the next instruction to execute. The execution of a process must be sequential. The CPUexecutes one instruction of the process after one another, until the process completes. Further, at anytime, at most one instruction is executed on behalf of the process. Thus, although two processes maybe associated with the same program, they are nevertheless considered two separate executionsequences. It is common to have a program that spawns many processes as it runs.

  • 8/7/2019 Computer Application in Pharmacy

    14/49

    Computer Application in Pharmacy Operating System

    6

    A process is a unit of work in a system. Such a system consists of a collection of processes, some ofwhich are operating system process (those that execute system code) and the rest of which are userprocesses (those that execute user code). All these processes can potentially execute concurrently, bymultiplexing the CPU among them.

    The operating system is responsible for the following activities in connection with processmanagement:

    Creating and Deleting both user and system processes Suspending and Resuming Processes Providing mechanisms for Processes Synchronization Providing mechanisms for Process Communication Providing mechanisms for Deadlock HandlingMain Memory ManagementThe main memory is central to the operation of a modern computer system. Main memory is largearray of words or bytes, ranging in size from hundreds of thousands to billions. Each word or byte hasits own address. Main memory is a repository of quickly accessible data shared by the CPU and I/Odevices. The central processor reads instructions from main memory during the instruction-fetch cycle.The I/O operations implemented via DMA also read and write data in main memory. The mainmemory is generally the only large storage device that the CPU is able address and access directly. Forexample, for the CPU to process data from disk, those data must first be transferred to main memoryby CPU generated I/O calls. Equivalently, instructions must be in memory space is declared variable,and the next program can be loaded and executed.

    To improve both the utilization of the CPU and the speed of the computers response to its users, wemust keep several programs in memory. Many different memory management schemes are available,and the effectiveness of the different algorithms depends on the particular situation. Selection of amemory management scheme for a specific system depends on many factors, especially on thehardware design of the system. Each algorithm requires its own hardware support.

    The operating system is responsible for the following activities in connection with memorymanagement:

    Keep track of which parts of memory are currently being used and by whom. Deciding which processes are to be loaded into memory when memory space becomes available. Allocating and de-allocating memory space as needed.File Management

    File management is one of the most visible components of an operating system. Computers can storeinformation on several different types of physical media. Magnetic tape, magnetic disk, and opticaldisk are the most common media. Each of these media has its own characteristics and physicalorganization. Each medium is controlled by a device, such as a disk drive or tape drive, that also hasunique characteristics. These properties include access speed, capacity, data transfer rate, and accessmethod (sequential or random).

    For convenient use of the computer system provides a uniform logical view of information storage.The operating system abstracts from the physical properties of its storage devices to define a logical

    storage unit, the file. The operating system maps files onto physical media, and accesses these files viathe storage devices.

    A file is a collection of related information defined by its creator. Commonly, files represent program(both source and object forms) and data. Data files may be numeric, alphabetic, or alphanumeric. Filesmay be free-form (for example, text files), or may be formatted rigidly (for example, fixed fields). Afile consists of a sequence of bits, bytes, lines, or records whose meanings are defined by their creators.The concept of a file is an extremely general one.

    The operating system implements the abstract concept of a file by managing mass storage media, suchas disks and tapes, and the devices that control them. Also, files are normally organized into directories

  • 8/7/2019 Computer Application in Pharmacy

    15/49

    Computer Application in Pharmacy Operating System

    7

    to ease their use. Finally, when multiple users have access to files, we may want to control by whomand in what ways (for example, read, write, append) files may be accessed.

    The operating system is responsible for the following activities in connection with file management:

    Creating and deleting files Creating and deleting directories Supporting primitives for manipulating files and directories. Mapping files onto secondary storage Backing up files on stable (nonvolatile) storage mediaI/O System ManagementOne of the purposes of an operating system is to hide the peculiarities of specific hardware devicesfrom the user. For example, in UNIX, the peculiarities of I/O devices are hidden from the bulk of theoperating system itself by the I/O subsystem. The I/O subsystem consists of

    A memory management component that includes buffering, caching, and spooling A general device driver interface Drivers for specific hardware devicesOnly the device driver knows the peculiarities of the specific device to which it is assigned.

    Secondary Storage ManagementThe main purpose of a computer system is to execute programs. These programs, with the data theyaccess, must be in main memory, or primary storage, during execution. Because main memory is toosmall to accommodate all data and programs, and because the data that it holds are lost when power islost, the computer system must provide secondary storage to back up main memory. Most moderncomputer systems use disks as the principal online storage medium, for both programs and data. Mostprograms including compilers, assemblers, sort routines, editors, and formatters are stored on a diskuntil loaded into memory, and then use the disk as both the source and destination of their processing.Hence, the proper management of disk storage is of central importance to a computer system.

    The operating system is responsible for the following activities in connection with disk management:

    Free space management Storage allocation Disk schedulingBecause secondary storage is used frequently, it must be used efficiently. The entire speed of operationof a computer may hinge on the speeds of the disk subsystem and of the algorithms that manipulatethat subsystem.

  • 8/7/2019 Computer Application in Pharmacy

    16/49

    Computer Application in Pharmacy Computer Networks

    1

    Computer NetworksHeterogeneous electronic components connected together for the purpose of data communication arecalled a computer network.

    A network is a set of device connected by communication links. A node can be a computer, printer, orany other device capable of sending and or receiving data generated by other nodes on network.

    Distributed Processing

    Most networks use distributed processing, in which a task is divided among multiple computers.Instead of a single large machine being responsible for all aspects of process, separate computershandle a subset.

    Network CriteriaA network must be able to meet a certain number of criteria. The most important of these areperformance, reliability and security.

    Performance

    Performance can be measured in many ways, including transit time and response time. Transit time isthe amount of time required for a message to a travel from one device to another. Response time is theelapsed time between an inquiry and a response. The performance of a network depends upon thenumber of factors, including the numbers of users, the type of transmission medium, the capabilities ofthe connected hardware, and the efficiency of the software.

    ReliabilityIn addition to accuracy of delivery, network reliability is measured by the frequency of failure, the timeit takes a link to recover from a failure, and the network s robustness in a catastrophe.

    Security

    Network security issue includes protecting data from unauthorized access.

    Physical StructureBefore discussing networks we need to define some attributes.

    Types of connectionA network is two or more devices connected together through links. A link is a communicationpathway that transfers data from one devices to another. Foe visualization purposes, it is simplest toimagine any link as a line drawn between to the same link at the same time. There are two possibletypes of connections: point to point and multipoint.

    Point-to-PointA point- to- point connection provides a dedicated link between two devices. The entire capacity of thelink is reserved for transmission between those two devices. most point- to- point connections us anactual length of wire or cable to connect the two ends, but other options, such as microwave or satellite

    links, are also possible. when you change television channels by infrared remote control, you areestablishing a point -to- point connection between the remote control and the televisions controlsystem.

    MultipointA Multipoint connection is one in which more than two specific devices share a single link.In a multipoint environment, the capacity of the channel is shared either spatially or temporally. Ifseveral devices can use the link simultaneously, it is a spatially shared connection. If users must taketurns it is a timeshare connection.

  • 8/7/2019 Computer Application in Pharmacy

    17/49

    Computer Application in Pharmacy Computer Networks

    2

    Physical TopologyThe term physical topology refers to the way in which a network is laid out physically. Two or moredevices connect to a link two or more links from a topology. The topology of a network is a geometricrepresentation of the relationship of all the links and linking devices to one another. There are fourbasic topologies possible: mesh, star, bus, and ring.

    StarIn a star topology, each device has a dedicated point-to-point link only to a central controller usuallycalled a hub. The devices are not directly linked to one another. Unlike a mesh topology a star topologydoes not allow direct traffic between devices. The controller which then relays the data to otherconnected devices.

    A star topology is less expensive than a mesh topology. In a star each devices needs only one link andone I/O port to connect it to any number of others. This factor also makes it easy to install andreconfigure. Far less cabling needs to be housed, and additions moves and deletions involve only oneconnection between that device and the hub.

    Other advantages include robustness. If one link fails, only that link is affected. All other links remainactive. This factor also lends itself to easy fault identification and fault isolations. As long as the hub isworking it can be used to monitor link problems and bypass defective links.

    However although a star techniques far less cable then a mesh, each node must be linked to a centralhub. For this reason often more cabling is required in a star than in some other topologies.

    Bus

    The preceding examples all describe point-to-point connections. A bus topology on the other hand ismultipoint. One long cable acts as a back bone to link all the devices in a network.

    Nodes are connected to the bus cables by drop lines and taps. A drop line is a connection runningbetween the devices and the main cable. A tap is a connector that either splices into the main cable orpunctures the sheathing of a cable to create a contact with the metallic core. As a single travels alongthe backbones some of its energy is transformed into heat. Therefore it becomes weaker and weaker asit has to travel farther and farther.

    Advantages of a bus topology include ease of installations. Backbone cable can be laid along the most

    efficient path then connected to the nodes by drop lines of various lengths. In this way a bus uses lesscabling then mash or star topologies. In a star for example four network devices in the same roomrequire four same lengths of cable reaching all the way to the hub. In a bus this redundancy iseliminated. Only the backbone cable stretches entire facility. Each drop line has to reach only as far asthe nearest point on the backbone.

    Disadvantages include difficult reconnection and fault isolation. It can therefore be difficult to add newdevices. Single reflection at the taps can cause degradation in quality. This degradation can becontrolled by limiting the number and spacing of devices connected to a given length of a cable.Adding new device may therefore require modification or replacement of the backbone.

    In addition a fault or break in the bus cable stops all transmission even between devices on either thesame sides of the problem. The damaged area reflects signals back in the direction of origin creating

    noise in both directions.Ring

    In a ring topology each device has a dedicated point-to-point connection only with the two devices oneither side of it. A signal is passed along the ring in one direction from device to device, until it reachesits destination. Each device in the ring incorporates a repeater. When a device receives a signalintended for another device, its repeater regenerates the bits and passes them.

    A ring is relatively easy to install and reconfigure. Each device is linked only to its immediateneighbors. To add or delete a device requires changing only two connections. The only constraints are

  • 8/7/2019 Computer Application in Pharmacy

    18/49

    Computer Application in Pharmacy Computer Networks

    3

    media and traffic consideration. In addition fault isolation is simplified. Generally in a ring a signal iscirculating at all times.

    However unidirectional traffic can be a disadvantage. In a simple ring a break in the ring can disablethe entire network. This weakness can be solved by using a dual ring or a switch capable of a closingoff the break.

    Mesh

    In a mesh topology, every device has a dedicated point-to-point link to every other device. The termdedicated means that the link carries traffic only between the two devices it connects. a fully connectedmesh network therefore has physical channel to link n devices. To accommodate that they link, everydevice on the network must have n input/output (I/O) ports.

    A mesh offers several advantages over other network topologies. First the use of dedicated linksguarantees that each connection can carry its own data load, thus eliminating the traffic problems thatcan occur when links must be shared by multiple devices. Second a mesh topology is robust. If one linkbecomes unusable, it does not incapacitate the entire system. Another advantage is privacy or security.When every message travels along a dedicated line, only the intended recipient sees it. Physicalboundaries prevent other users from gaining access to messages. Finally, point-to-point links makefault identification and fault isolation easy. Traffic can be routed to avoid links with suspectedproblems. This facility enables the network manager to discover the precise locations of the fault and

    aids in finding its cause and solution.

    The main disadvantages of a mesh are related to the amount of cabling and the number of I/O portsrequired. First, because every device must be connected to every other device, installation andreconnection are difficult. Second, the sheer bulk of the wiring can be greater than the available spacecan accommodate. Finally the hardware required to connect each link can be prohibitively expensive.For these reasons a mash topology is usually implemented in a a limited fashion for example as abackbone connecting the main computers of a hybrid network that can include several other topologies.

    Categories of the NetworksToday when we speak of networks we are generally referring to three primary categories: local areanetworks, metropolitan area networks and wide area networks. Into which category a network falls is

    determined by its size, its ownership, the distance it covers and its physical architecture.Local Area Networks

    A local area network is usually privately owned and links the devices in a single office building orcampus. Depending on the needs of an organization and the type of technology used a LAN can be assimple as two PCs and a printer in someones home office or it can extend throughout the company andinclude audio and video peripherals. Currently LAN size is limited to a few kilometers.

    LANs are designed to allow resources to be shared between personals computers or workstations. Therecourses to be shared can include hardware software or data. A common example of a LANs found inmany business environments links a workgroup of a task related computers for example engineeringworkstations or accounting PCs. One of the computers may be given a large capacity disk drive andmay become a server to the other clients. Software can be stored on this central sever and used as

    needed by the whole group. In this example the size of the LAN may be determined by licensingrestrictions on the number of users per copy of software or by restriction on the number of userslicensed to access the operating system.

    In Addition to the size LAN are distinguished from other types of networks by their transmissionmedia and topology. In general a given LAN will use only one type of transmission medium. The mostcommon LAN topologies are bus ring and star.

    Traditionally LANs have data rates in the 4 to 16 megabits par second range. Today, however speedsare increasing and can reach 100 Mbps with gigabit system in development.

    Metropolitan Area Network

  • 8/7/2019 Computer Application in Pharmacy

    19/49

    Computer Application in Pharmacy Computer Networks

    4

    A metropolitan area network is designed to extend over an entire city. It may be a single network suchas a cable television network or it may be a means of connecting a number of LANs into a largeamount network so that resources may be shared LAN-to-LAN as well as devices. For example acompany can use a MAN to connect the LANs in all its offices throughout a city.A MAN may be wholly owned and operated by a private company or it may be a service provided by apublic company such as a local telephone company. Many telephones companies provide a popularMAN service called Switched Multi-megabit Data Service (SMDS).

    Wide Area NetworkA wide area network provides long distance transmission of data voice image and video informationover large geographic areas that may comprise a country or even the whole world.In contrast to LANs WANs may utilize public leased or private communication equipment usually incombinations and can therefore span an unlimited number of miles.A WAN that is wholly owned and used by a single company is often referred to as an enterprisenetwork.

    InternetworksWhen two or more networks are connected they become an internet network or internet.

    OSI ModelThe standard model for networking protocols and distributed applications is the InternationalStandard Organization's Open System Interconnect (ISO/OSI) model. It defines seven networklayers.Short forOpen System Interconnection, an ISO standard for worldwide communications thatdefines a networking framework for implementing protocols in seven layers. Control is passedfrom one layer to the next, starting at the application layer in one station, and proceeding tothe bottom layer, over the channel to the next station and back up the hierarchy.At one time, most vendors agreed to support OSI in one form or another, but OSI was tooloosely defined and proprietary standards were too entrenched. Except for the OSI-compliantX.400 and X.500 e-mail and directory standards, which are widely used, what was oncethought to become the universal communications standard now serves as the teaching modelfor all other protocols.

    The Structure of a LayerOne of ways that the OSI Reference Model has been beneficial is its definition of concepts andstructure for the layers. The elements of the layer structure (using the Transport Layer as an example)are illustrated in Figure 3.6.Some readers will observe that this layer structure does not seem .to applyat the top, where there is no service user, and at the bottom, where there is no service provider. Theseboundary conditions will be discussed in Part II.

    The EntityThe focal point of a layer is the entity, which is the representation in the OSI Reference Model of the

    things at the end of a protocol. Entities exist within each open system. A single entity cannot bespread across more. Than one open system or layer, thus layer and system independence are preserved.

  • 8/7/2019 Computer Application in Pharmacy

    20/49

    Computer Application in Pharmacy Computer Networks

    5

    An entity has two important aspects: types and invocations. An entity-type is a class of entitiesdescribed in terms of set of capabilities defined for the layer. A layer can be defined as the set of

    entities of a certain type (e.g., entity-type=transport).An entity-invocation is a specific utilization of allor part of the capabilities of given entity.

    As an example of this concept, the telephone is a device type, while the red telephone on your desk isan invocation of that type.OSI entities correspond in an undefined, implementation-dependent fashionto software in a real system that generates and responds to the protocol interactions of the layer.

    An (N)-function is part of the activity of an (N)-entity. An (N)-directory and (N)-address-mapping areexamples of such functions.

    Independence of layers is achieved by constraining protocol interactions to be strictly between entities(called peer-entities) in the same layer. Formally defined interfaces to the layer directly above anddirectly below ensure that changes in one layer do not affect adjacent layers.

    The Service PrimitiveAn (N)-service is capability of the (N)-layer that is provided to the (N+1)-layer. The (N)-layer createsthese services using the services of the layer below if necessary. An entity in a layer above (in the sameopen system) and may use the services of one or more entities located in the layer below.

    A service consists of a number of elements of service called service primitives. Services can be of twotypes (confirmed or unconfirmed), depending upon whether or not the destination provides a reply tothe senders message. Four types of service primitive have been defined request, indicate, response,confirm. These are illustrated in Figure 3.7.

    The Service-Access-Point(N)-services are made available at an (N)-service-access-point, usually abbreviated as (N)-SAP(transport-service-access-point, or TSAP, in the case of the Transport Layer).A SAP is the conceptualpoint of interaction between two layers within an open system. Relationships between entities in

    adjacent layers can be one-to-one or one-to-many (Figure 3.8).The SAP is an abstract modelingconcept and is not meant to be a real physical location.

    A SAP is affixed reference point in the OSIE; its main purpose is to be an addressable point to whichentities can be associated or attached. Although the concepts of identifiers were included in the basicOSI Reference Model, the whole area of naming and addressing is now the subject of more detailedtreatment in a refinement to the basic model. This topic will be reviewed in detail in chapter 4.

    Figure 3.8 illustrates how the SAP acts as the point of attachment for entities in two layers. The basicrule for a SAP is that it can be attached to only one entity in the layer above and one entity in the layer

  • 8/7/2019 Computer Application in Pharmacy

    21/49

    Computer Application in Pharmacy Computer Networks

    6

    below at any given point in time. A SAP may be detached from its entities and reattached to the sameor different entities.

    The ProtocolIn OSI terminology an (N)-protocol is defined as a set of rules and formats (semantic and syntactic)which determines the communication behavior of (N)-entities in the performance of (N)-functions.More than one protocol may be defined for a layer and used by an entity. Meaningfulcommunication, however, requires that peer-entities agree on a single protocol to use for a particularinstance of communication.

    The characteristics of protocol are determined by the functions it supports. In general, however, allprotocols are used to transfer user-data on behalf of the entities in the layer above (the serviceusers).OSI protocols typically operate between two entities. It is possible, however, to have protocolsthat operate within more than two entities.

    Layers in DetailControl is passed from one layer to the next, starting at the application layer in one station, proceedingto the bottom layer, over the channel to the next station and back up the hierarchy.

    Layer 1 - PhysicalPhysical layer defines the cable or physical medium itself, e.g., thinnet, thicknet, unshielded twistedpairs (UTP). All media are functionally equivalent. The main difference is in convenience and cost ofinstallation and maintenance. Converters from one media to another operate at this level.

    Layer 2 - Data LinkData Link layer defines the format of data on the network. A network data frame, aka packet, includeschecksum, source and destination address, and data. The largest packet that can be sent through a datalink layer defines the Maximum Transmission Unit (MTU). The data link layer handles the physicaland logical connections to the packet's destination, using a network interface. A host connected to an

  • 8/7/2019 Computer Application in Pharmacy

    22/49

    Computer Application in Pharmacy Computer Networks

    7

    Ethernet would have an Ethernet interface to handle connections to the outside world, and a loopbackinterface to send packets to itself.Ethernet addresses a host using a unique, 48-bit address called its Ethernet address or Media AccessControl (MAC) address. MAC addresses are usually represented as six colon-separated pairs of hexdigits, e.g., 8:0:20:11:ac:85. This number is unique and is associated with a particular Ethernet device.Hosts with multiple network interfaces should use the same MAC address on each. The data linklayer's protocol-specific header specifies the MAC address of the packet's source and destination.

    When a packet is sent to all hosts (broadcast), a special MAC address (ff:ff:ff:ff:ff:ff) is used.

    Layer 3 - NetworkNFS uses Internetwork Protocol (IP) as its network layer interface. IP is responsible for routing,directing datagrams from one network to another. The network layer may have to break largedatagrams, larger than MTU, into smaller packets and host receiving the packet will have to reassemblethe fragmented datagram. The Internetwork Protocol identifies each host with a 32-bit IP address. IPaddresses are written as four dot-separated decimal numbers between 0 and 255, e.g., 129.79.16.40.The leading 1-3 bytes of the IP identify the network and the remaining bytes identifies the host on thatnetwork. The network portion of the IP is assigned by InterNIC Registration Services, under thecontract to the National Science Foundation, and the host portion of the IP is assigned by the localnetwork administrators. For large sites, the first two bytes represents the network portion of the IP, and

    the third and fourth bytes identify the subnet and host respectively.Even though IP packets are addressed using IP addresses, hardware addresses must be used to actuallytransport data from one host to another. The Address Resolution Protocol (ARP) is used to map the IPaddress to it hardware address.

    Layer 4 - TransportTransport layer subdivides user-buffer into network-buffer sized datagrams and enforces desiredtransmission control. Two transport protocols, Transmission Control Protocol (TCP) and UserDatagram Protocol (UDP), sits at the transport layer. Reliability and speed are the primary differencebetween these two protocols. TCP establishes connections between two hosts on the network through'sockets' which are determined by the IP address and port number. TCP keeps track of the packetdelivery order and the packets that must be resent. Maintaining this information for each connectionmakes TCP a stateful protocol. UDP on the other hand provides a low overhead transmission service,

    but with less error checking. NFS is built on top of UDP because of its speed and statelessness.Statelessness simplifies the crash recovery.

    Layer 5 - SessionThe session protocol defines the format of the data sent over the connections. The NFS uses theRemote Procedure Call (RPC) for its session protocol. RPC may be built on either TCP or UDP. Loginsessions uses TCP whereas NFS and broadcast use UDP.

    Layer 6 - PresentationExternal Data Representation (XDR) sits at the presentation level. It converts local representation ofdata to its canonical form and vice versa. The canonical uses a standard byte ordering and structurepacking convention, independent of the host.

    Layer 7 - ApplicationProvides network services to the end-users. Mail, ftp, telnet, DNS, NIS, NFS are examples of networkapplications.

    Internet Model (TCP/IP Protocol Suit)The layered protocol stack that dominates data communications and networking today is the five-layerInternet model, sometimes called the TCP/IP protocol suite. The model is composed of five orderedlayers: physical (layer 1), data link (layer 2), network (layer 3), transport (layer 4), and application(layer 5). Figure shows the layers involved when a message is sent from device A to device B. As the

  • 8/7/2019 Computer Application in Pharmacy

    23/49

    Computer Application in Pharmacy Computer Networks

    8

    message travels from A to B, it may pass through many intermediate nodes. These intermediate nodesusually involve only the first three layers of the model.

    In developing the model, the designers distilled the process of transmitting data to its most fundamentalelements. They identified which networking functions had related use and collected those functionsinto discrete groups that became the layers. By defining and localizing functionality in this fashion, thedesigners created an architecture that is both comprehensive and flexible.

    Within a single machine, each layer calls upon the services of the layer just below it. Layer 3, forexample, uses the services provided by layer 2 and provides services for layer 4. Between machines,layer x on one machine communicates with layer x on another machine. This communication isgoverned by an agreed-upon series of rules and conventions called protocols. The processes on eachmachine that communicate at a given layer are called peer-to-peer processes. Communication betweenmachines is therefore a peer-to-peer process using the protocols appropriate to a given layer.

    Peer-to-Peer ProcessesAt the physical layer, communication is direct: In Figure, device A sends a stream of bits to device B.At the higher layers, however, communication must move down through the layers on device A, overto device B, and then back up through the layers. Each layer in the sending device adds its owninformation to the message it receives from the layer just above it and passes the whole package to thelayer just below it.At layer 1 the entire package is converted to a form that can be transferred to the receiving device. Atthe receiving machine, the message is unwrapped layer by layer, with each process receiving andremoving the data meant for it. For example, layer 2 removes the data meant for it, then passes the restto layer 3. Layer 3 then removes the data meant for it and passes the rest to layer 4, and so on.

    Interfaces between LayersThe passing of the data and network information down through the layers of the sending device andback up through the layers of the receiving device is made possible by an interface between each pairof adjacent layers. Each interface defines what information and services a layer must provide for thelayer above it. Well-defined interfaces and layer functions provide modularity to a network. As long asa layer provides the expected services to the layer above it, the specific implementation of its functionscan be modified or replaced without requiring changes to the surrounding layers.

    Organization of the LayersThe five layers can be thought of as belonging to three subgroups. Layers 1, 2, and 3 physical, datalink, and network-are the network support layers; they deal with the physical aspects of moving datafrom one device to another (such as electrical specifications, physical connections, physical addressing,and transport timing and reliability). Layer 5- application can be thought of as the user support layer;it allows interoperability among unrelated software systems. Layer 4, the transport layer, links the twosubgroups and ensures that what the lower layers have transmitted is in a form that the upper layers canuse.In figure, which gives an overall view of the layers, L5 data means the data unit at layer 5, L4 datameans the data unit at layer 4, and so on. The process starts at layer 5 (the application layer), thenmoves from layer to layer in descending, sequential order. At each layer, a header can be added to thedata unit. At layer 2, a trailer is added as well. When then formatted data unit passes through thephysical layer (layer 1), it is changed into an electromagnetic signal and transported along a physicallink.Upon reaching its destination, the signal passes into layer 1 and is transformed back into digital form.The data units then move back up through the layers. As each block of data reaches the next-higherlayer, the headers and trailers attached to it at the corresponding sending layer are removed, and actionsappropriate to that layer are taken. By the time it reaches layer5, the message is again in a formappropriate to the application and is made available to the recipient.

    Framing

  • 8/7/2019 Computer Application in Pharmacy

    24/49

    Computer Application in Pharmacy Computer Networks

    9

    The data link layer divides the stream of bits received from the network layer into manageable dataunits called frames.

    Physical addressingIf frames are to be distributed to different systems on the network, the data link layer adds a header tothe frame to define the sender and /or receiver of the frame. If the frame is intended for a systemoutside the senders network, the receiver address is the address of the connecting device that connectsthe network to the next one.

    Flow controlIf the rate at which the data are absorbed by the receiver is less than he rate produced in the sender, thedata link layer imposes a flow control mechanism to prevent overwhelming the receiver.

    Error controlThe data link layer adds reliability to the physical layer by adding mechanism to detect and transmitdamaged or lost frames. It also uses a mechanism to prevent duplication of frames. Error control isnormally achieved through a trailer added to the end of frame.

    Access controlWhen two or more devices are connected to the same link, data link layer protocols are necessary todetermine which device has control over the link at any given time.

    Network layerThe network layer is responsible for the source-to-destination delivery of a packet possibly acrossmultiple networks. Whereas the data link layer oversees the delivery of the packet between twosystems on the same work, the network layer ensures that each packet gets from its point of origin to itsfinal destination.If two systems are connected to the same link, there is usually no need for a network layer. However, ifthe two systems are attached to different networks with connecting devices between the networks, thereis often a need for the network layer to accomplish source-to-destination delivery

    Logical AddressingThe physical addressing implemented by the data link layer handles the addressing problem locally. Ifa packet passes the network boundary, we need another addressing system to help distinguish thesource and destination systems. The network layer adds a header to the packet coming from upper layer

    that, among other things, includes the logical addresses of the sender and receiver.RoutingWhen independent networks or links are connected to create an interwork (network of networks) or alarge network, the connecting devices (called routers or switches) route or switch the packets to theirfinal destination. One of the functions of the network layer is to provide this mechanism.

    Transport LayerThe transport layer is responsible for process- to process delivery of the entire message. Whereas thenetwork layer oversees host-to-destination delivery of the individual packets, it does not recognize anyrelationship between those packets. It treats each one independently, as though each piece belong to aseparate message, whether or not it does. The transport layer, on the other hand, ensures that the wholemessage arrives intact and in order, overseeing both error control and flow control at the process-to-

    process level.The major duties of the transport layer are as follows:

    Post AddressingComputer often run several processes (running programs) at the same time. For this reason, process-to-process delivery means delivery not only from one computer to the next but also from a specificprocess on one computer to a specific process on the other. The transport layer header must thereforeinclude a type of address called a post address the network layer gets each packet to the correctcomputer: the transport layer gets the entire message to the correct process on that computer.

    Segmentation and Reassembly

  • 8/7/2019 Computer Application in Pharmacy

    25/49

  • 8/7/2019 Computer Application in Pharmacy

    26/49

    Computer Application in Pharmacy Computer Networks

    11

    If two wires are parallel, the effect of those unwanted signals is not the same in both wires becausethey are at different locations relative to the noise or crosstalk sources (e.g., one closer and one farther).This results in a difference at the receiver. By twisting the pairs, a balance is maintained. For example,suppose in one twist, one wire is closer to the noise source and the other farther: in the next twist, thereverse is true (noise or crosstalk). This means that the recovery, which calculates the differencesbetween the two, receives no unwanted signals.

    Unshielded versus Shielded Twisted- Pair cableThe most common twisted-pair cable used in communications referred to as unshielded twisted-pair(UTP).IBM has also produced a version of twisted-pair cable for its use called shielded twisted-pair(STO). STP cable has a metal foil or braided-mesh covering that encases each pair of insulatedconductors. Although metal casing improves the quality of cable by preventing the penetration of noiseor crosstalk, it is bulkier and more expensive,

    CategoriesThe electronic Industries Association (EIA) has developed standards to classify unshielded twisted-paircable into seven categories. Categories are determinate by cable quality, with 1 as the lowest and 7 as

    the highest. Each EIA category is suitable for specific uses.

    ConnectorsThe most common UTP connector is RJ45 (RJ stands for Registered Jack). The RJ45 is a keyed

    connector, meaning the connector can be interested in only one way.PerformanceOne way to measure the performance of twisted-pair is to compare attenuation versus frequency anddistance. A twisted-pair able can pas a wide range of frequencies. However, shows that with increasingfrequency, the attenuation, measured in describe per mile(dB/mi), sharply increase with frequenciesabove 100KHz.Guage is the measure of the thickness of the wire.

    ApplicationsTwisted pair cables are used in telephone lines to provide voice and data channels. The local loop -----the line that connects subscribers to the central telephone office--- is most commonly unshieldedtwisted pair cables.The DSL lines that are used by the telephone companies to provide high data rate connections also usethe high- bandwidth capability of unshielded twisted-pair cables.Local area networks, such as 10Base-T and 100Base, also use twisted pair cables.Coaxial CablesCoaxial cables carry signals of higher frequency ranges than twisted-pair cable, in part because the twomedia are constructed quite differently. Instead of having two wires, coax has a central core conductorof solid or stranded wire( usually copper) enclosed in an insulting sheath, which is, in turn, encased inn outer conductor of metal foil, braid or a combination of the two. The outer metallic wrapping serveboth as shield against noise and as second conductor, which complete the circuit. This outer conductoris also enclosed in an insulating sheath, and the whole cable is protected by a plastic cover.

    Coaxial Cable StandardsCoaxial cables are categorized by their radio government (RG) ratings. Each RG number denotes aunique set of physical specifications, including the wire gauge of the inner conductor, the thickness and

    the construction of shield, and the size and the type of the outer casing.Coaxial Cable ConnectorsTo connect coaxial cable to devices, we need coaxial connectors. The most common type of connectorused today is the Bayone-Neill-Concelman, or BNC, connectors.The BNC connector is used to connect the end of the cable to a device, such as a TV set. The BNC Tconnector is used in Ethernet networks to branch out a cable for connection to a computer or otherdevices. The BNC terminator is used at the end of the cable to prevent the reflection of the signal.

    Performance

  • 8/7/2019 Computer Application in Pharmacy

    27/49

    Computer Application in Pharmacy Computer Networks

    12

    As we did with twisted-pair cables, we can measure the performance of a coaxial cable. We notice thatattenuation is much higher in coaxial cables than in twisted-pair cable. In other words, although coaxialcable has a much higher bandwidth, the signals weaken rapidly and needs the frequent use of repeaters.

    ApplicationsThe use of coaxial cable started in analog telephone networks where a single coaxial network couldcarry 10, 000 voices signals. Later it was used in digital telephone networks where a single coaxialcable carries digital data up to 600 Mbps. However, coaxial cable in telephone networks has largely

    been replaced today with fiber-optic cable.Cable TV networks also used coaxial cables. In the traditional TV network, the entire network usedcoaxial cables later, however, cable TV providers replaced most of the network with fiber-optic cable:hybrid network use coaxial cable only at the network boundaries, near the consumer premises. CableTV uses RG-59 coaxial cable.Another common application of coaxial cable is in traditional Ethernet LANs. Because of its highbandwidth, and consequently high data rate, coaxial cable was chosen for digital transmission in earlyEthernet LANs. 10Base-2, or Thin Ethernet, uses RG-58 coaxial cable with BNC connectors totransmit data at 10 Mbps with a range of 185 m. 10Base5, or thick Ethernet, uses RG-11 to transmit 10Mbps with a range of 5000 m. Thick Ethernet has specialized connectors.

    Fiber-Optic Cable

    A fiber-optic cable is made of glass or plastic and transmits in the form of light. To understand opticalfiber, we first need to explore several aspects of the nature of light.Light travels in a straight line as long as it is moving through a single uniform substance. If a ray oflight, travelling through one substance enters into another (more or less dense), the direction of raychanges.If the angle of incidence (the angle the ray makes with the line perpendicular to the interface betweenthe two substances) is less than the critical angle, the ray refracts and moves closer to the surface. If theangle of incidence is equal to the critical angle, the light bends along the interface. If the angle isgreater than the critical angle, the ray reflects (make a turn) and travels again in the denser substance.Note that the critical angle is a properly of the substance, and its value is different from one substanceto another.Optical fibers use reflection to guide light through channel. A glass or plastic core is surrounded by

    cladding or less dense glass or plastic. The differences in the density of the two materials must be suchthat a beam of light moving through the core is reflected off the cladding instead of being refracted intoit.

    Propagation ModesCurrent technology supports two modes (multimode and single mode) for propagating light alongoptical channels, each requiring fiber with different physical characteristics. Multimode can beimplemented in two forms: step-index or graded-index.

    MultimodeMultimode is so named because multiple beams from a light source move through the core in differentpaths. How these beams move within the cable depends on the structure of the coreIn the multimode step-index fiber, the density of the core remains constant from the center to the edges.A beam of light moves through this constant density in a straight line it reaches the interface of thecore and the cladding. At the interface, there is an abrupt change to a lower density that alters the angleof the beams motion. The term step index refers to the suddenness of this change.A second type of fiber, called multimode graded-index fiber, decrease this distortion of the signalthrough the cable. The word index here refers to the index of refraction. The index of refraction isrelated to destiny. A graded-index fiber, therefore, is one with varying densities. Density is the highestat the center of the core and decreases gradually to its lowest at the edge.

    Single ModeSingle-mode uses step-index fiber and a highly focused source of light that limits beams to a smallrange of angels, all close to the horizontal. The single-mode fiber itself is manufactured with a much

  • 8/7/2019 Computer Application in Pharmacy

    28/49

    Computer Application in Pharmacy Computer Networks

    13

    smaller diameter than that of multi mode fiber, and with substantially lower density(index ofrefraction). The decrease in density results in a critical angle that is close enough to 90 to make thepropagation of beams almost horizontal. In this case, propagation of different beams is almost identicaland delays are negligible. All the beams arrive at the destination together and can be recombinedwith little distortion to the signals.

    Fiber SizesOptical fibers are defined by the ratio of the diameter of their core to the diameter of their cladding,

    both expressed in micrometers.

    Cable CompositionThe outer jacket is made of either PYC or Teflon. Inside the jacket are Kevlar strands to strengthen thecable. Kevlar is a strong material used in the fabrication of bulletproof vests.The subscriber channel (SC) connector is used for cable TV. It uses a push/pull locking system. Thestraight-tip (ST) connector is used for connecting cable to networking devices. It uses a bayonetlocking system and is more reliable than SC. MTRJ is a connector that is the same size as RJ45.

    PerformanceThe plot of attenuation versus wavelength in Figure 7.16 shows a very interesting phenomenon infiber-optic cable. Attenuation is flatter than in the case of twisted-pair cable and coaxial cable. Theperformance is such that we need fewer (actually 10 times less) repeaters when we use fiber-optic

    cable.ApplicationsFiber-optic cable is often found in backbone networks because its wide bandwidth is cost- effective.Today, with wavelength-division multiplexing (WDM), we can transfer data at a rate of 1600 Gbps.The SONET network that we discuss in Chapter 9 provides such a backbone.Some cable TV companies use a combination of optical fiber and coaxial cable, thus creating a hybridnetwork. Optical fiber provides the backbone structure while coaxial cable provides the connection tothe user premises. This is a cost-effective con- figuration since the narrow bandwidth requirement atthe user end does not justify the use of optical fiber.Local-area networks such as 100Base-FX network (Fast Ethernet) and l000BaseX also use fiber-opticcable.

    Advantages and Disadvantages 0f Optical FiberAdvantagesFiber-optic cable has several advantages over metallic cable (twisted- pair or coaxial).

    Higher BandwidthFiber optic cable can support dramatically higher bandwidths (and hence data rates) than eithertwisted-pair or coaxial cable. Currently, data rates and bandwidth utilization over fiber-optic cable arelimited not by the medium but by the signal generation and reception technology available.

    Less Signal AttenuationFiber-optic transmission distance is significantly greater than that of other guided media. A signal canrun for 50 km without requiring regeneration. We need repeaters every 5 km for coaxial or twisted-paircable.

    Immunity to Electromagnetic InterferenceElectromagnetic noise cannot affect fiber-optic cables.

    Resistance to Corrosive MaterialsGlass is more resistant to corrosive materials than copper.

    Light WeightFiber-optic cables are much lighter than copper cables.

    More Immune to TappingFiber-optic cables are more immune to tapping than copper cables. Copper cables create antennaeffects that can easily be tapped.

  • 8/7/2019 Computer Application in Pharmacy

    29/49

    Computer Application in Pharmacy Computer Networks

    14

    DisadvantagesThere are some disadvantages in the use of optical fiber.

    Installation/ maintenanceFiberoptic cable is a relatively new technology. Its installation and maintenance require expertisethat is not yet available everywhere.

    Unidirectional

    Propagation of light is unidirectional. If we need bidirectional communication, two fibers are needed.CostThe cable and the interfaces are relatively more expensive than those of other guided media. lf thedemand for bandwidth is not high; often the use of optical fiber cannot be justified.

    Unguided Media: WirelessUnguided media transport electromagnetic waves without using a physical conductor. This type ofcommunication is often referred to as wireless communication. Signals are normally broadcast throughfree space and thus are available to anyone who has a device capable of receiving them.

    Radio WavesAlthough there is no clear-cut demarcation between radio waves and micro waves, electromagneticwaves ranging in frequencies between 3 KHz and 1 GHz are normally called radio waves; wavesranging in frequencies between 1 and 300 GHz are called microwaves. However the behavior of thewaves rather than frequencies is a better criterion for classification.Radio waves for the most part are omnidirectional. When an antenna transmits radio waves they arepropagated in all directions. This means that the sending and the receiving antennas do not have toaligned. A sending antenna can send waves that can send waves that can be received by the receivingantenna. The omnidirectional property has the disadvantage, too. The radio waves transmitted by theone antenna are susceptible to interference by another antenna that may send signals using the samefrequency or band.Radio waves, particularly those waves that propagate in the sky mode, can travel long distances. Thismakes radio waves a good candidate for long- distance broadcasting such as AM radio.Radio waves, particularly those of low and medium frequencies, can penetrate walls. Thischaracteristic can be both an advantage and a disadvantage. It is an advantage because, for example, anAM radio can receive signals inside a building. It is a disadvantage because we cannot isolate acommunication to just inside or outside a building. The radio wave band is relatively narrow, justunder 1 GHz, compared to the microwave band. When this band is divided into subbands, the subbandsare also narrow, leading to a low data rate for digital communications.Almost the entire band is regulated by authorities (e.g., the FCC in the United States). Using any partof the band requires permission from the authorities.

    MicrowavesElectromagnetic waves having frequencies between 1 and 300 GHz are called micro- waves.Microwaves are unidirectional. When an antenna transmits microwave waves, they can be narrowlyfocused. This means that the sending and receiving antennas need to be aligned. The unidirectional

    property has an obvious advantage. A pair of antennas can be aligned without interfering with anotherpair of aligned antennas.Microwave propagation is line-of-sight. Since the towers with the mounted antennas need to be indirect sight of each other, towers that are far apart need to be very tall. The curvature of the earth aswell as other blocking obstacles does not allow two short towers to communicate by using microwaves.Repeaters are often needed for long- distance communication.Very high-frequency microwaves cannot penetrate walls. This characteristic can be a disadvantage ifreceivers are inside buildings.The microwave band is relatively wide, almost 299 GHz. Therefore wider subbands can be assigned,and a high data rate is possible

  • 8/7/2019 Computer Application in Pharmacy

    30/49

  • 8/7/2019 Computer Application in Pharmacy

    31/49

    Computer Application in Pharmacy Computer Network & Security

    16

    Security AttacksA useful means of classifying security attacks is in terms of passive attacks and active attacks. Apassive attack attempts to learn or make use of information from the system but does not affect systemresources. An active attack attempts to alter system resources or affect their operation.

    Passive AttacksPassive attacks are in the nature of eavesdropping on, or monitoring of, transmissions. The goal of theopponent is to