Local Area Network (LAN) Devices

January 4th, 2010

LANs consist of the following components:

* Computers
* Network interface cards
* Peripheral devices
* Networking media
* Network devices

LANs make it possible for businesses that use computer technology to locally share files and printers efficiently, and make internal communications possible. A good example of this technology is e-mail. They tie data, local communications, and computing equipment together.

LAN devices, router, hub, ethernet switch, bridge, repeater

Some common LAN technologies are:

* Ethernet
* Token Ring
* FDDI

Networking Devices

January 4th, 2010

Networking Devices
Equipment that connects directly to a network segment is referred to as a device. These devices are broken up into two classifications. The first classification is end-user devices. End-user devices include computers, printers, scanners, and other devices that provide services directly to the user. The second classification is network devices. Network devices include all the devices that connect the end-user devices together to allow them to communicate.

End-user devices that provide users with a connection to the network are also referred to as hosts. These devices allow users to share, create, and obtain information. The host devices can exist without a network, but without the network the host capabilities are greatly reduced. Host devices are physically connected to the network media using a network interface card (NIC). They use this connection to perform the tasks of sending e-mails, printing reports, scanning pictures, or accessing databases. A NIC is a printed circuit board that fits into the expansion slot of a bus on a computer motherboard, or it can be a peripheral device. It is also called a network adapter. Laptop or notebook computer NICs are usually the size of a PCMCIA card. Each individual NIC carries a unique code, called a Media Access Control (MAC) address. This address is used to control data communication for the host on the network. More about the MAC address will be covered later. As the name implies, the NIC controls host access to the medium.

There are no standardized symbols for end-user devices in the networking industry. They appear similar to the real devices to allow for quick recognition.

Network devices provide transport for the data that needs to be transferred between end-user devices. Network devices provide extension of cable connections, concentration of connections, conversion of data formats, and management of data transfers. Examples of devices that perform these functions are repeaters, hubs, bridges, switches, and routers. All of the network devices mentioned here are covered in depth later in the course. For now, a brief overview of networking devices will be provided.

A repeater is a network device used to regenerate a signal. Repeaters regenerate analog or digital signals distorted by transmission loss due to attenuation. A repeater does not perform intelligent routing like a bridge or router.

Hubs concentrate connections. In other words, they take a group of hosts and allow the network to see them as a single unit. This is done passively, without any other effect on the data transmission. Active hubs not only concentrate hosts, but they also regenerate signals.

Bridges convert network transmission data formats as well as perform basic data transmission management. Bridges, as the name implies, provide connections between LANs. Not only do bridges connect LANs, but they also perform a check on the data to determine whether it should cross the bridge or not. This makes each part of the network more efficient.

Workgroup switches add more intelligence to data transfer management. Not only can they determine whether data should remain on a LAN or not, but they can transfer the data only to the connection that needs that data. Another difference between a bridge and switch is that a switch does not convert data transmission formats.

Routers have all the capabilities listed above. Routers can regenerate signals, concentrate multiple connections, convert data transmission formats, and manage data transfers. They can also connect to a WAN, which allows them to connect LANs that are separated by great distances. None of the other devices can provide this type of connection.

History of Computer Networking

January 4th, 2010

The history of computer networking is complex. It has involved many people from all over the world over the past 35 years..

The history of computer networking is complex. It has involved many people from all over the world over the past 35 years. Presented here is a simplified view of how the Internet evolved. The processes of invention and commercialization are far more complicated, but it is helpful to look at the fundamental development.
Internet Timeline
Pre – 1900 Long distance communications via messenger, rider, smoke signals, carrier pigeon, optical telegraph, electrical telegraph
1890s Bell invents the telephone; telephone expands rapidly
1901 Marconi’s first tansatlantic wireless transmission
1920s AM Radio
1939 FM Radio

In the 1940s computers were large electromechanical devices that were prone to failure. In 1947 the invention of a semiconductor transistor opened up many possibilities for making smaller, more reliable computers. In the 1950s mainframe computers, which were run by punched card programs, began to be used by large institutions. In the late 1950s the integrated circuit that combined several, then many, and now millions, of transistors on one small piece of semiconductor was invented. Through the 1960s mainframes with terminals were commonplace, and integrated circuits were widely used.

In the late 1960s and 1970s, smaller computers, called minicomputers came into existence. However, these minicomputers were still very large by modern standards. In 1977 the Apple Computer Company introduced the microcomputer, also known as the personal computer. In 1981 IBM introduced its first personal computer. The user-friendly Mac, the open-architecture IBM PC, and the further micro-miniaturization of integrated circuits led to widespread use of personal computers in homes and businesses.

In the mid-1980s users with stand-alone computers started to share files using modems to connect to other computers. This was referred to as point-to-point, or dial-up communication. This concept was expanded by the use of computers that were the central point of communication in a dial-up connection. These computers were called bulletin boards. Users would connect to the bulletin boards, leave and pick up messages, as well as upload and download files. The drawback to this type of system was that there was very little direct communication and then only with those who knew about the bulletin board. Another limitation was that the bulletin board computer required one modem per connection. If five people connected simultaneously it would require five modems connected to five separate phone lines. As the number of people who wanted to use the system grew, the system was not able to handle the demand. For example, imagine if 500 people wanted to connect at the same time. Starting in the 1960s and continuing through the 70s, 80s, and 90s, the Department of Defense (DoD) developed large, reliable, wide-area networks (WANs) for military and scientific reasons. This technology was different from the point-to-point communication used in bulletin boards. It allowed multiple computers to be connected together using many different paths. The network itself would determine how to move data from one computer to another. Instead of only being able to communicate with one other computer at a time, many computers could be reached using the same connection. The DoDs WAN eventually became the Internet.

Computer Networking

January 4th, 2010

Networking Terminology.

Data Network .

Data networks developed as a result of business applications that were written for microcomputers. 1 At that time microcomputers were not connected as mainframe computer terminals were, so there was no efficient way of sharing data among multiple microcomputers. 2 It became apparent that sharing data through the use of floppy disks was not an efficient or cost-effective manner in which to operate businesses. Sneakernet created multiple copies of the data. Each time a file was modified it would have to be shared again with all other people who needed that file. If two people modified the file and then tried to share it, one of the sets of changes would be lost. Businesses needed a solution that would successfully address the following three problems:

* How to avoid duplication of equipment and resources

* How to communicate efficiently

* How to set up and manage a network

Businesses realized that networking technology could increase productivity while saving money. Networks were added and expanded almost as rapidly as new network technologies and products were introduced. In the early 1980s networking saw a tremendous expansion, even though the early development of networking was disorganized.

In the mid-1980s, the network technologies that had emerged had been created with a variety of different hardware and software implementations. Each company that created network hardware and software used its own company standards. These individual standards were developed because of competition with other companies. Consequently, many of the new network technologies were incompatible with each other. It became increasingly difficult for networks that used different specifications to communicate with each other. This often required the old network equipment to be removed to implement the new equipment.

One early solution was the creation of local-area network (LAN) standards. 3 Because LAN standards provided an open set of guidelines for creating network hardware and software, the equipment from different companies could then become compatible. This allowed for stability in LAN implementation.

In a LAN system, each department of the company is a kind of electronic island. As the use of computers in businesses grew, it soon became obvious that even LANs were not sufficient. 4

What was needed was a way for information to move efficiently and quickly, not only within a company, but also from one business to another. 5 The solution was the creation of metropolitan-area networks (MANs) and wide-area networks (WANs). Because WANs could connect user networks over large geographic areas, it was possible for businesses to communicate with each other across great distances. Figure 6 summarizes the relative sizes of LANs and WANs.

PHP example : Execution Operator

January 4th, 2010
   Contoh PHP : Operator Eksekusi

Operator eksekusi yang didukung oleh PHP adalah backticks (``), tanda apostrophe terbalik. Feature dari operator eksekusi ini hanya bisa diterapkan apabila kita membangun aplikasi yang menggunakan sistem operasi *nix (Unix dan Linux) dengan server web adalah Apache.

Berikut adalah contoh penggunaan :

   <html>

   <head>
   <title>Contoh Operator Eksekusi</title>
   </head>
   <body>
   <h1>Contoh Penggunaan Operator Eksekusi</h1>

   <h2>Menampilkan daftar file<h2>
   <?php
   $output=`ls -l`;
   echo "<pre>$output</pre>";
   ?>
   </body>
   </html>   

PHP example : Increment/ Decrement Operator

January 4th, 2010


                Contoh PHP : Operator Increment/ Decrement 

    Berikut adalah contoh script untuk penerapan
           operator increment/ decrement
         <?php echo " <h3>   Postincrement</h3>";
$a = 5; echo " \$a = $a "."<br>";
echo " Dengan \$a++ tetap 5: ". $a++ . "<br>\n"; echo " Kemudian menjadi 6: " . $a . "<br>\n"; echo "<h3> Preincrement</h3>"; $a = 5; echo " \$a = $a "."<br>"; echo " Dengan ++\$a menjadi 6: ". ++$a. "<br>\n"; echo " Tetap 6: ".$a. "<br>\n"; echo " <h3> Postdecrement</h3>"; $a = 5; echo " \$a = $a "."<br>"; echo " Dengan \$a-- tetap 5: ". $a-- . "<br>\n"; echo " Kemudian menjadi 4: " . $a . "<br>\n"; echo "<h3> Predecrement</h3>"; $a = 5; echo " \$a = $a "."<br>"; echo " Dengan --\$a menjadi 4: ". --$a. "<br>\n"; echo " Tetap 4: ".$a. "<br>\n"; ?> Dan berikut tampilan hasil dari script di atas:

Postincrement

$a = 5 Dengan $a++ tetap 5: 5 Kemudian menjadi 6: 6

Preincrement

$a = 5 Dengan ++$a menjadi 6: 6 Tetap 6: 6

Postdecrement

$a = 5 Dengan $a-- tetap 5: 5 Kemudian menjadi 4: 4

Predecrement

$a = 5 Dengan --$a menjadi 4: 4 Tetap 4: 4

PHP example : Ternary Operator

January 4th, 2010

Contoh PHP : Operator ternary
< html >
<body>
Script ini mendemonstrasikan operator ternary untuk menghitung selisih 2 bilangan <br>
$a = 5; <br>
$b = 7;
<hr>
<? $a = 5; $b = 7;
echo “\$a = $a <br>”;
echo “\$b = $b <br>”;
$selisih = ($a>$b) ? ($a – $b) : ($b – $a);
echo “Selisihnya : $selisih”; ?>
</body>
</html>
Berikut adalah contoh tampilan dari hasil eksekusi script di atas: Script ini mendemonstrasikan ….
$a = 5
$b = 7
Selisihnya : 2

PHP example : Variable

January 4th, 2010

Variables are used for storing values, such as numbers, strings or function results, so that they can be used many times in a script.
Variables in PHP

Variables are used for storing a values, like text strings, numbers or arrays.

When a variable is set it can be used over and over again in your script

All variables in PHP start with a $ sign symbol.

The correct way of setting a variable in PHP:

$var_name = value;

New PHP programmers often forget the $ sign at the beginning of the variable. In that case it will not work.

Let’s try creating a variable with a string, and a variable with a number:

<?php
$txt = "Hello World!";
$number = 16;
?>

PHP is a Loosely Typed Language

In PHP a variable does not need to be declared before being set.

In the example above, you see that you do not have to tell PHP which data type the variable is.

PHP automatically converts the variable to the correct data type, depending on how they are set.

In a strongly typed programming language, you have to declare (define) the type and name of the variable before using it.

In PHP the variable is declared automatically when you use it.
Variable Naming Rules

* A variable name must start with a letter or an underscore “_”
* A variable name can only contain alpha-numeric characters and underscores (a-Z, 0-9, and _ )
* A variable name should not contain spaces. If a variable name is more than one word, it should be separated with underscore ($my_string), or with capitalization ($myString)

PHP example : Tutorial

January 4th, 2010

PHP Tutorial

PHP is a powerful server-side scripting language for creating dynamic and interactive websites.

PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft’s ASP. PHP is perfectly suited for Web development and can be embedded directly into the HTML code.

The PHP syntax is very similar to Perl and C. PHP is often used together with Apache (web server) on various operating systems. It also supports ISAPI and can be used with Microsoft’s IIS on Windows.

Stored program architectur

December 31st, 2009

The Jacquard loom was one of the first programmable devices.

Punch Card

A 1970s punched card containing one line from a FORTRAN program. The card reads: “Z(1) = Y + W(1)” and is labelled “PROJ039″ for identification purposes.

The defining feature of modern computers which distinguishes them from all other machines is that they can be programmed. That is to say that a list of instructions (the program) can be given to the computer and it will store them and carry them out at some time in the future.

In most cases, computer instructions are simple: add one number to another, move some data from one location to another, send a message to some external device, etc. These instructions are read from the computer’s memory and are generally carried out (executed) in the order they were given. However, there are usually specialized instructions to tell the computer to jump ahead or backwards to some other place in the program and to carry on executing from there. These are called “jump” instructions (or branches). Furthermore, jump instructions may be made to happen conditionally so that different sequences of instructions may be used depending on the result of some previous calculation or some external event. Many computers directly support subroutines by providing a type of jump that “remembers” the location it jumped from and another instruction to return to the instruction following that jump instruction.

Program execution might be likened to reading a book. While a person will normally read each word and line in sequence, they may at times jump back to an earlier place in the text or skip sections that are not of interest. Similarly, a computer may sometimes go back and repeat the instructions in some section of the program over and over again until some internal condition is met. This is called the flow of control within the program and it is what allows the computer to perform tasks repeatedly without human intervention.

Comparatively, a person using a pocket calculator can perform a basic arithmetic operation sch as adding two numbers with just a few button presses. But to add together all of the numbers from 1 to 1,000 would take thousands of button presses and a lot of time—with a near certainty of making a mistake. On the other hand, a computer may be programmed to do this with just a few simple instructions. For example:

        mov      #0,sum     ; set sum to 0
        mov      #1,num     ; set num to 1
loop:   add      num,sum    ; add num to sum
        add      #1,num     ; add 1 to num
        cmp      num,#1000  ; compare num to 1000
        ble      loop       ; if num <= 1000, go back to 'loop'
        halt   u             ; end of program. stop running

Once told to run this program, the computer will perform the repetitive addition task without further human intervention. It will almost never make a mistake and a modern PC can complete the task in about a millionth of a second.[6]

However, computers cannot “think” for themselves in the sense that they only solve problems in exactly the way they are programmed to. An intelligent human faced with the above addition task might soon realize that instead of actually adding up all the numbers one can simply use the equation

1+2+3+...+n = {{n(n+1)} \over 2}

and arrive at the correct answer (500,500) with little work.[7] In other words, a computer programmed to add up the numbers one by one as in the example above would do exactly that without regard to efficiency or alternative solutions.

Programs

In practical terms, a computer program may run from just a few instructions to many millions of instructions, as in a program for a word processor or a web browser. A typical modern computer can execute billions of instructions per second (gigahertz or GHz) and rarely make a mistake over many years of operation. Large computer programs comprising several million instructions may take teams of programmers years to write, thus the probability of the entire program having been written without error is highly unlikely.

Errors in computer programs are called “bugs“. Bugs may be benign and not affect the usefulness of the program, or have only subtle effects. But in some cases they may cause the program to “hang” – become unresponsive to input such as mouse clicks or keystrokes, or to completely fail or “crash“. Otherwise benign bugs may sometimes may be harnessed for malicious intent by an unscrupulous user writing an “exploit” – code designed to take advantage of a bug and disrupt a program’s proper execution. Bugs are usually not the fault of the computer. Since computers merely execute the instructions they are given, bugs are nearly always the result of programmer error or an oversight made in the program’s design.[8]

In most computers, individual instructions are stored as machine code with each instruction being given a unique number (its operation code or opcode for short). The command to add two numbers together would have one opcode, the command to multiply them would have a different opcode and so on. The simplest computers are able to perform any of a handful of different instructions; the more complex computers have several hundred to choose from—each with a unique numerical code. Since the computer’s memory is able to store numbers, it can also store the instruction codes. This leads to the important fact that entire programs (which are just lists of instructions) can be represented as lists of numbers and can themselves be manipulated inside the computer just as if they were numeric data. The fundamental concept of storing programs in the computer’s memory alongside the data they operate on is the crux of the von Neumann, or stored program, architecture. In some cases, a computer might store some or all of its program in memory that is kept separate from the data it operates on. This is called the Harvard architecture after the Harvard Mark I computer. Modern von Neumann computers display some traits of the Harvard architecture in their designs, such as in CPU caches.

While it is possible to write computer programs as long lists of numbers (machine language) and this technique was used with many early computers,[9] it is extremely tedious to do so in practice, especially for complicated programs. Instead, each basic instruction can be given a short name that is indicative of its function and easy to remember—a mnemonic such as ADD, SUB, MULT or JUMP. These mnemonics are collectively known as a computer’s assembly language. Converting programs written in assembly language into something the computer can actually understand (machine language) is usually done by a computer program called an assembler. Machine languages and the assembly languages that represent them (collectively termed low-level programming languages) tend to be unique to a particular type of computer. For instance, an ARM architecture computer (such as may be found in a PDA or a hand-held videogame) cannot understand the machine language of an Intel Pentium or the AMD Athlon 64 computer that might be in a PC.[10]

Though considerably easier than in machine language, writing long programs in assembly language is often difficult and error prone. Therefore, most complicated programs are written in more abstract high-level programming languages that are able to express the needs of the computer programmer more conveniently (and thereby help reduce programmer error). High level languages are usually “compiled” into machine language (or sometimes into assembly language and then into machine language) using another computer program called a compiler.[11] Since high level languages are more abstract than assembly language, it is possible to use different compilers to translate the same high level language program into the machine language of many different types of computer. This is part of the means by which software like video games may be made available for different computer architectures such as personal computers and various video game consoles.

The task of developing large software systems is an immense intellectual effort. Producing software with an acceptably high reliability on a predictable schedule and budget has proved historically to be a great challenge; the academic and professional discipline of software engineering concentrates specifically on this problem.

Example

A traffic light showing red.

magnify

A traffic light showing red.

Suppose a computer is being employed to drive a traffic light. A simple stored program might say:

  1. Turn off all of the lights
  2. Turn on the red light
  3. Wait for sixty seconds
  4. Turn off the red light
  5. Turn on the green light
  6. Wait for sixty seconds
  7. Turn off the green light
  8. Turn on the yellow light
  9. Wait for two seconds
  10. Turn off the yellow light
  11. Jump to instruction number (2)

With this set of instructions, the computer would cycle the light continually through red, green, yellow and back to red again until told to stop running the program.

However, suppose there is a simple on/off switch connected to the computer that is intended to be used to make the light flash red while some maintenance operation is being performed. The program might then instruct the computer to:

  1. Turn off all of the lights
  2. Turn on the red light
  3. Wait for sixty seconds
  4. Turn off the red light
  5. Turn on the green light
  6. Wait for sixty seconds
  7. Turn off the green light
  8. Turn on the yellow light
  9. Wait for two seconds
  10. Turn off the yellow light
  11. If the maintenance switch is NOT turned on then jump to instruction number 2
  12. Turn on the red light
  13. Wait for one second
  14. Turn off the red light
  15. Wait for one second
  16. Jump to instruction number 11

In this manner, the computer is either running the instructions from number (2) to (11) over and over or its running the instructions from (11) down to (16) over and over, depending on the position of the switch.[12]