Networking Part 1 =================================== by dOtS http://www.jaysee.cjb.net =================================== -Copy info- This tutorial may be redistributed as long as it remains completely unchanged and full credit is given to me, dOts. -Shouts- To Binary Universe ( BU ) , Ch4r, Rezel, MU, D31337, Riftor and everybody else, and the whole JaySee (JC) . -Introduction- This is the 1st part of my Networking tutorials, they'll be a couple, but this part ill start with some basics such as how a pc connects to the internet, NICs some TCP/IP and Base 2, 10, 16. And as i write more parts ill get into harders stuff. *Connecting to the Internet ----------------------------- To understand the role that computers play in networking system, consider the Internet. The internet can be tought of as a tree with computers as leaves. The internet is the largest data network in the world, and consists of millions of interconnected networks, both large and small. Connection to the Internet can be broken down into the following components: Physical connection: A physical connection to a network is made by inserting a specialized expansion card, such as a modem or a network interface card ( NIC ), in the computer. A cable will be used to connect from the PC to the network. The physical commection is used to transfer signals between PCs in the local network and remote devices on the Internet. Logical connection: A logical connection uses standards called protocols. A protocol is a formal description of a set of rules and conventions that govern how devices on a network communicate. Connections to the Internet may use multiple protocols. The transmission Control Protocol/Internet Protocol( TCP/IP ) suite is the primary protocol used on the Internet. TCP/IP is a suite of protocols that work together to send and recieve data. Applications: Applications work with protocols to send and receive data across the Internet. A web browser displays HTML as a web page. File Transfer Protocol ( FTP ) is used to download files and programs from the Internet. Web browser also use proprietary plug-in applications to display special data types such as videos, audio, and animation. *Network Interface Card (NIC) ------------------------------- A NIC is a printed circuit board that provides network communication capabilities to and from a PC. Also called a LAN adapter, a NIC plugs into a motherboard and provides a port for connecting to the network. The NIC connects the computer to the LAN. The NIC communicates with the network through a cable (or radio waves for wireless NICs) and with the computer via an expansion slot. When a NIC is installed in a computer, it requires an interrupt request (IRQ) for service from the CPU, as well as an input/output (I/O) adress, a memory space for the operating system (such as Linux or Windows), and drivers to perform its function. An IRQ is a signal that informs a CPU that an event needing its attention has occured. an IRQ is sent over a hardware line to the microprocessor. An example of an interrupt being issued is a key being pressed on the keyboard. The CPU must move the character from the keyboard to RAM. An I/) address is a location in nenory used toenter data into or retrieve data from a computer using an auxiliary device. When selecting a NIC card for a network, connsider the following: Type of network: Different types of networks use different types of NICs. For example, Ethernet NICs are designed for Ethernet LANs. Some other types of networks include Token Ring and Fiber Distributed Data Interface (FDDI). Ethernet is by far the most common. Type of medium: The type of port or connector used by the NIC for network connection is specific to the medium type, such as twisted-pair, coaxial, fiber-optic, or wireless. Coaxial is becoming increasingly rare. Type of system bus: There are different types of system buses, such as a PCI and ISA. Because PCI slots are faster than ISA slots ( and they plug and play better ), the latter are being phased out. *TCP/IP Description and Configuration ---------------------------------------- TCP/IP is a set of protocols or rules developed to allow cooperating computers to share resources across a network. Acomputer must be running the TCP/IP protocol suite to access the Internet. To enable TCP/IP on the workstation, it must be configured using the operating system tools. The PC requires an IP adress, subnet mask, default gateway , Domain Name System (DNS) informartion. These can be assigned manually or obtained from a Dynamic Host Configuration Protocol (DHCP) server. The information necessary to configure TCP/IP on a computer is typically obtained from a network administrator or an ISP. *Testing Connectivity with Ping --------------------------------- Ping is a program that is useful for verifying a successful TCP/IP installation. It is named after the sonar operation used to locate and determine the distance to an underwater object. Ping stands for Packet Internet Groper. The ping command works by sending Internet Control Message Protocol (ICMP) datagrams to request a reply. The output response for a ping contains the success ratio and round-trip time to destination. From this information, you can determine if there is connectivity to a destination. The following are some usages of the ping command: Ping 127.0.0.1 (internal loopback test): because no packets are transmitted, pinging the loopback interface tests basic TCP/IP network configuration. Ping IP address of a host computer: Verifies the TCP/IP address configuration for the local host. Ping default-gateway IP address: Verufies wheter the router that connects the local network to the other networks can be accessed. Ping remote destination IP address: verifies connectivity to a remote host. *Troubleshooting Internet Connection Problems -------------------------------------------------- These are steps for the PC/network troubleshooting process: Step 1 : Define the problem. Step 2 : Gather the facts. Step 3 : Consider the possibility. Step 4 : Create an action plan. Step 5 : Implement the plan. Step 6 : Observe the results. Step 7 : Document the results. Step 8 : Introduce problem and troubleshoot. *Binary Presentation of Data ------------------------------ Computers are electromechanical devices made up of electronic switches. At the lowest levels of computation, computes depend on these electronic switches to make decisions. As such, computers react only to electrical impulses. These impulses are understood by the computer as either on or off states (1s or 0s). Computers can only understand and use data that is in this two-state (binary) format. 1 represents an on state, and 0 represents an off state. These 1s and 0s represent the two possible states of an electronic component in a computer. These 1s and 0s are called binary digits or bits. The American Standard Code for Information Intercharge (ASCII), the most commonly used code for representing alphanumeric data in a computer, uses binary digits to represent the symbols typed on the keyboard. When computers send on/off states over a network, electricity, light, or radio waves represent 1s and 0s. Each character has a unique pattern of eight binary digits assigned to represent the character. *Bits and Bytes ----------------- Bits are binary digits. They are either 0s or 1s. In a computer they are represented by on/off switches or the presence or absence of electrical charges, light pulses, or radio waves. for example: A binary 0 might be represented by 0 volts of electricity (0=0 volts). A binary 1 might be represented by +5 volts of electricity (1=+5 volts). Computers are designed to used groupings of 8 bits. This grouping of 8 bits is called a Byte. In a computer, 1 byte represents a single addressable storage location. These storage locations represent a value or a single character of data, such as an ASCII code. The total number of combinations of the eight digit switches being turned on and off is 256. The value range of a byte is from 0 to 255. So, a byte is an important concept to understand when working with computers and networks. Most computer coding schemes use 8 bits to represent each number, letter, or symbol. A series of 8 bits is called a byte; 1 byte represents a single addressable storage location. *Base 10 Number System --------------------------- A number system consists of symbols and rules for using those symbols. Many number system exist. The number system used most frequently is the decimal, or Base 10, number system. It is called Base 10 because it uses 10 symbols. These 10 symbols are the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Combinations of these digits can represent all possible numeric values. The decimal number system is based on powers of 10. *Base 2 Number System -------------------------- Computers recognize and process data using the binary , or Base 2, number system. The binary number system uses only two symbols (0s and 1s) instead of the ten symbols used in the decimal, or Base 10, number sytem. Every binary number either 1 or 0 is a equal to one bit (1-bit). The position, or place, of each digit represents the number 2 ( the base number ) raised to a power ( exponent ) based on its position (128, 64, 32, 16, 8, 4, 2, 1). OBS: read more on base 2 and how to convert them into decimal, hexadecimal, because since this is a basic tutorial i wont get into that yet. *BASE 16 Number System ---------------------------- The base 16, or hexadecimal (hex), number system is another number system that is used frequently when working with computers because it can represent binary numbers in a more readable form. The computer performs computations in binary, but there are several instances in which a computer's binary output is expressed in hexadecimal form to make it easier to read. The hexadecimal number system uses 16 symbols. Combinations of these symbols can represent all possible numbers. Because only 10 symbols represent digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) and beacause Base16 requires six more symbols, the extra symbols are letters A, B, C, D, E, and F. The A represents the decimal number 10, B represents 11, C represents 12, D represents 13, E represents 14, and F represents 15. The most common way for computers and software to express a hexadecimal output is by using 0x in front of the hexadecimal number. Thus whenever you see 0x, you know that the number that folows is a hexadecimal number. For example, 0x1234 means 1234 in base 16. Network adapter or NIC addresses are expressed as a string of 12 hexadecimal characters. And also Media Access Control ( MAC ) addresses are typically written in hex. *Four-Octet Dotted-Decimal Representation of a 32-Bit Binary Number --------------------------------------------------------------------------------------------------------------------------------------------------- Currently, addresses assigned to computers on networks that use TCP/IP have ip addresses that are 32-bit binary numbers. Any device that wants to communicate using the Internet must have an IP address. To make it easier to work with these addresses, the 32-bit binary number is broken down into a series of deciaml numbers. To do this, split the binary number into four groups of eight binary digits. Then, convert each group of 8-bits (an octet ) into its decimal equivalent. IP addresses are discussed in detail on my next tutorials. The information here demonstrates only the conversion between the dotted-deciaml notation and its binary representation. When written, the complete decimal number is represented as four groups of decimal digits separated by periods, such as 10.15.129.201. This is called dotted-decimal notation and provides a compact, easy-to-remember way of refering to 32-bit addresses. When converting to binary from dotted decimal, remember that each group of one to 3 decimal digits represent a group of 8 binary digits. if the decimal you are converting is less than 128, you need to add 0s to the left of the equivalent binary number, until you have a total of 8 bits. For example, to convert the dotted-decimal vale 10.15.129.201 to its binary equivalent, you should write the number as 00001010.00001111.00000001.11001001 : 10 = 00001010 15 = 00001111 129 = 10000001 201=11001001 -------------------------------------------------------------------------------------------------------------