Basics of Networking - Part 1 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Briefly, we will explain what the various layers are responsible
for, and how your software adheres to these standards: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Basics of Networking - Part 2 -12-17 19:01:13 - kan
Making Your Own Network Cables No matter whether you're putting together a small home network, or maintaining a major network in your office, you'll need network cables. The most commonly used type is Category 5 (short: Cat5), which supports speeds up to 100 Mb/s (Megabits per second). You can either go buy Cat 5 cable in the store, or you can make it yourself. If you decide to buy it in the store, you'll pay a premium price for the convenience, but if you only need 2 or three cables and don't foresee the need for more in the near future, or need a lot of cables right away and don't have the time to make them yourself, then this is probably the way to go. If you decide to make your own Cat 5 cable, you'll save a lot of money in the long run, as buying rolls of cable, a baggie of RJ-45 connectors, and the necessary tools will be a lot cheaper and pay for itself in a short period of time if you have an ongoing need. What you need
What type of cable do you want to make? There are two types of network cables commonly used in PC networks - Straight-through and cross-over. Cross-over: A cross-over cable is used to connect two computers via their NICs, without using a hub or switch. (Note: You can only connect two computers at one time, connecting three or more will require a hub or switch of some sort). Straight-through: A straight-through network cable is just what the name implies, a cable that passes data straight through from one end to another. Straight-through cables are used for a variety of connections. (e.g. connecting a computer to a hub or switch, connecting a computer to a cable/ISDN/DSL modem, and linking switches and hubs together.) Let's start with a straight-through cable and then we'll get fancy with a cross-over cable. Cutting, Stripping, And Sorting The Wires Cut a piece of Cat 5 as long as you need. When you cut, remember the old saying: Measure twice, cut once. Make sure the cut on each end is clean and straight.
Strip about an inch of the insulation off the cable. Cut it back nice and square.
Untwist the wires. You'll notice that there are 4 pairs of multi-colored wires inside. Sort the pairs by color. You should end up with wires color coded as follows: blue/blue-white, orange/orange-white, green/green-white, brown/brown-white. Note: Some Cat 5 cable skimps on the color-coding and you will have to keep the track of which wire was wrapped around which. If at all possible, check the cable before you buy and make sure the color-coding is easy to recognize. If not, you'll be cursing up a storm later and wish you would have spent the extra 5 bucks on the better cable.
Now align the wires in the following order from left to right:
Get the wires lined up and nice and straight. Then clip off the top milimeter so that they are all the same length and stick out about half an inch from the insulated part.
Attaching the RJ-45 Connector Hold an RJ-45 connector so that the plastic release clip is facing away from you, and the opening for the wires is pointing down. Insert the sorted and aligned wires carefully into the RJ-45 connector. Getting all of the wires lined up can be a little tricky, so take your time. This gets easier as you get the feel of it. Inside the RJ-45 are actually grooves that help guide the wires into the proper position. Once you have the end in place make sure that all eight wires are pushed in all the way to the end, and that they are still in the right order. If everything went well, it should look like this: Right:
See how the end of the insulation sits snug inside the RJ-45, and how the wires go all the way to the end? Below are two examples how it should NOT look. In the example on the left the wires were left too long, which leaves wires unprotected between the RJ-45 and the insulation. In the example on the right, the wires were cut too short and now don't reach far enough to make contact. Wrong!
Double-check one last time that the wires are aligned correctly and all the way in. Then insert the RJ-45 connector into the appropriate opening of the crimping tool. Give the handle a nice, tight squeeze without crushing the RJ-45. If you have purchased a pair of ratchet type crimpers you will know that you are done when they release. If you bought a cheapo pair, check to make sure that all of the little metal contacts are even and at the same height below the plastic of the plug.
Now repeat this entire procedure to put an RJ-45 plug on the other end of the cable. Use the exact same wiring scheme as on the first end, which will make it a straight-through cable. Note: If you decided to spend a couple extra bucks on the strain relief sleeves, be sure to put them on and facing the correct direction before you crimp the second end. A cross-over cable The cross-over cable can be made using the same steps as the straight-through cable. The only difference is the order in which the wires are put into the second connector. On the straight-through cable you use the exact same order of wires. On a cross-over cable you use a different order on each end. The first end uses the same color scheme as a straight-through cable:
The second end uses the following color scheme:
If you take a close look and compare the two ends, you'll notice how the green and the orange pair trade places, which makes it a cross-over cable. Note: When you make a cross-over cable, mark it to distinguish it from your straight-through cables. You can put colored tape on it, use a marker, use a different color cable, whatever works for you. If you don't, eventually you'll get it mixed in with your other cables and lose your mind trying to figure out why your connection to the network is hosed. Test It Once your cable is finished, you should test it to make sure it works. For $20-30 you can purchase a cable tester. Insert the two ends of the cable into the jacks on the tester and watch the lights. If they all light up, you have a good connection for each wire and the cable checks out.
I think it's funny how numbers are used to influence our buying decisions. For some reason 99 cents looks better than $1.00 and 10 Mb (Mega bits) looks better than 1.22 MB (Mega Bytes) even though the two are exactly the same. In this article I'm going to cover bandwidth, both theoretical and effective, and explain some of the things that impact your performance on a network The Numbers Game For a long time I thought that the speed of networking equipment was reported in bits because all networks are serial devices - data is transmitted one bit at a time. So from an engineering standpoint it makes sense. Now, however, I think it's just marketing. 10 Mb just sounds better. After all, when I think of data and the ability to transmit it I want to know how many Kilo Bytes (a Byte is eight bits) that I can move per second, minute, or hour because that's how the data is reported to me when I look at the size of a file. The marketing for network equipment won't change - if you see two Network Interface Cards (NICs) on a shelf and one could transmit 10 Mb per second (Mb/s) and the other 1.22 MB/s the choice would be simple. You would pick up the 10 Mb card, even though the two are rated at the same speed same. So, let's take a look at what you are actually getting for your money... Theoretical Bandwidth All of the transmit rates for networking equipment are listed in the maximum possible speed for the technology used. A 10BaseT NIC card is capable at transmitting data at a 10 Mb rate. Cat 5 cable can handle a 100 MHz signal without distortion. But the ratings are just the theoretical maximum that the equipment can handle - it has nothing to do with the actual performance that you'll see when you try to move data from one PC to another on a network. Effective Bandwidth Now we are going to get into the numbers that the marketing spin doctors don't want you to hear - the actual (effective) bandwidth of networking equipment. Let's start by taking a 10 Mb/s Ethernet LAN and convert bits to bytes: 10,000,000 / 8 / 1024 (the number or bytes in a kilo byte) = 1.22 MB per second. So far so good. Now let's try to move a 1 MB file across our 10 Mb/s LAN. Do you think it will take just a little more than a second? Hardly - it will take longer! I'm going to assume that the NICs on our LAN are set to transmit data using the Ethernet Maximum Transmittable Unit (MTU) of 1500 bytes. Unfortunately some of that data gets consumed by the "packaging" necessary to get an Ethernet packet between two points. The transport layer adds source and destination port numbers as well as status bits and sequence numbers to our data. The IP layer adds a source and destination IP address. All totaled 40 Bytes are used to get our packet of data to the destination and to identify where the data came from. So for every 1500 Bytes of data that we want to transfer we have to subtract 40 as being used by the packaging. The number of packets needed to transmit our 1 MB file would be: The amount of bandwidth we lost due to TCP/IP packaging: 702 x 40 = 28,080 Bytes! Ouch! - and that's just for a 1 MB file. It gets worse, I haven't included the source and destination Medium Access Control (MAC) addresses - that would be another 12 bytes per packet. Plus 4 bytes for the Frequency Check Sequence (error detection) that is attached to every packet - but I think you get the picture. You're not going to see the rated speed of your network because of the overhead in getting your data from point A to B. But TCP/IP packaging isn't the only consideration. Propagation Delay If your transferring data from one PC to another over a network the sending machine needs time to read the data from its hard drive, break the data into packets, and add the packaging needed to get the data to the receiving computer. The receiving computer will collect packets until its receive window (RWin) is full and then it will send an acknowledgment to the sender asking for the next "block" of packets. All of those functions takes time - and during that time your network is sitting idle, unused. The amount of time it takes for data to propagate through a piece of equipment is called propagation delay - and it's yet one more limiting factor in sending data across a net. Just because your network is rated at 10 Mb/s that doesn't mean that you will be able to supply data fast enough to keep it busy. It really depends on the speed of the computers on your network - the speed of every component in them. If your data has to go through a hub, switch, and/or router to reach its destination then the propagation delay induced by every piece of equipment on the network will lower your effective bandwidth. When connecting to a site on a network like the Internet you are competing with everyone else for effective bandwidth and resources on the server that you are trying to reach - more delay... Wrappin' it up One last term to cover that is used heavily by marketing: Full Duplex. Full duplex means that a node can transmit at the same time that it is receiving a packet - and it's a good thing. But from time to time someone will attempt to list the bandwidth of a 100 Mb/s full duplex node as 200 Mb/s - not a chance! Just because I can receive while transmitting that doesn't mean I can accept data twice as fast - a 100 Mb full duplex node can only transmit or receive at a rate of 100 Mb/s - theoretically, of course... Data Transfer Over A Network It's time to explain how data flows across a network - any network, including the Internet. Also time to explain certain key TCP/IP terminology in more detail. So sit back, prop your feet up, and get comfortable - this might be a long one ... Normally, the different layers in the TCP/IP stack don't care about each other. For the most part each layer dumps data to the layer below it, or passes data to the layer above. There are special situations when the layers do interact - establishing a connection is one of them. When you type www.dalantech.com into your browser's Universal Resource Locator (URL) window and hit Return, the browser signals the Transport Layer (TL) that it wants to establish a connection and passes the URL down. The first packet to go down the stack is a User Datagram Protocol (UDP) packet with a destination port of 53 to the Internet Protocol (IP) address of your Domain Name Service (DNS) server to request the IP address of www.dalantech.com Connection Oriented Transfer (TCP) As soon as the IP address for the web site is returned, the transport layer initiates a Transfer Control Protocol (TCP) connection to the server that stores the web site by sending a Synchronization (SYN) packet. In that SYN packet the following values are proposed: Maximum Transmittable Unit (MTU): The maximum size of all the future packets that will be sent while the connection being negotiated is active. The MTU equals the combined data generated by the Application, Transport, and Internet Layers. Maximum Segment Size (MSS): The maximum segment size that will be transmitted from sender to receiver. The segment is the data portion of a TCP/IP packet (MSS = MTU minus the 40 bytes that make up the TCP and IP headers). Receive Window (RWIN): The number of segments transmitted before an acknowledgement is sent by the receiver to the sender. The RWIN value is always a whole number multiple of the MSS (no fractions). The server that provides the web page will either accept or reject your PCs SYN packet by transmitting a Synchronization Acknowledgement (SYN-ACK). If accepted, your PC will send one more SYN packet and the web page will start loading into your browser window. If rejected, the SYN-ACK your PC receives will have the corrected values listed. If your PC accepts the changes it will send another SYN packet and the transfer will start. If your PC cannot accept the new values another SYN packet will be transmitted by your PC to the web server with more changes - and the process continues until both sides agree, or the connection times out or is cancelled. This system of SYN and SYN-ACK is why the transport protocol is referred to as connection oriented - a connection has to be established before the transfer of data can begin. The process of establishing a connection is also sometimes called "hand shaking." Now you have a connection to the web site and data is flowing. Packets are being sent from the web server to your web browser and the page is loading on your PC. Sounds simple ... well, let's talk about what's really going on ... Data from the web page is being "packaged" by the different layers of the TCP/IP stack (Note: all TCP/IP data is packaged). Think of it as a box inside a box like this:
As the data from the Application Layer (AL) on your computer moves
down the TCP/IP stack each layer "wraps" the data in its own package.
The Transport Layer (TL) adds a TCP or UDP header (depending on the type of
data transfer requested by the What?! It's not transmitted directly to www.dalantech.com you ask? Nope, it's sent to the default route that you have configured in your TCP/IP settings, or the default route supplied by your Internet Service Provider (ISP) when you logged in. You see, MAC addresses are used to communicate with devices that are on the same logical and physical network. IP addresses are used to communicate with devices on different logical networks (Note: You could have two logical IP networks on the same physical cable, but if you don't have a router or a bridge connecting them the nodes on one IP network will not be able to send data to nodes on the other IP network). So, the source and destination MAC address is constantly changing as a packet is routed across a network (or the Internet). The source and destination IP address remains the same. As the packet is moving up the TCP/IP stack on the receiving computer, each layer "unwraps" the package. The Network layer "unwraps" the Network Layer "packaging" by removing the source and destination MAC, the Frequency Check Sequence (used for error detection, the Network layer calculates a new FCS value and compares it with the FCS that was transmitted with the packet. If the two FCSs don't match the packet is ignored ) and then passes the packet to the Internet Layer. The Internet Layer "unwraps" the Internet Layer packaging by removing the IP header (source and destination IP for example) and then passes the packet to the Transport Layer. The Transport layer removes the Transport Layer header and passes the data to the correct application (determined by the destination port number). Now let's back up a little. Earlier I told you that the Transport Layer on your PC negotiates a connection with the remote computer that you want to connect to - and that is true. But what about all of the routers, bridges, and other pieces of routing hardware that your data has to pass through to reach the destination IP address? What if one of them had a lower MTU than what you negotiated? Would you still get a connection and be able to transfer data? Sure, but not without a few penalties ... keep reading. For the purpose of explanation I'm gonna keep it simple and use a small network. But, what I'm about to tell you applies to all networks - regardless of their size. Take a look at the network below:
Router one (R1) and Router three (R3) both have an MTU of 1500 bytes (the TCP/IP maximum) but Router two (R2) has an MTU of 1000 bytes. Your PC can sense the MTU of R1 because both of them are on the same network. Likewise for the web server and R3. So your PC is going to negotiate an MTU of 1500 bytes, and the web server is going to accept. As data is being sent from the web server to your PC, R3 will receive the packets first. R3 can sense the MTU of R2 because they each have a connection on a common network. R3 will then fragment every packet it gets from the web server into two packets at the IP layer (one with an MTU of 1000 bytes and the other with an MTU of 500 bytes, for example) before they are transmitted to R2. R2 will send the packets to R3 and R3 will reassemble the fragments before they reach you. Works great huh? Keep reading ... Let's say that we wanted to transmit 14,600 bytes of data. If the MTU remained a constant across all of the equipment between sender and receiver only 10 packets would have been transferred (MTU - 40 = MSS or 1500 - 40 = 1460 bytes). But since the packets had to be fragmented between R3 and R2 we had to send 20 packets across the R3 to R2 link. Each packet had to have a MAC and an IP address - bits that don't count toward transferring application data. In fact, the extra packaging decreases the Effective Bandwidth (EB) of the data transfer (EB is the actual amount of data that is transferred between two points). But wait! It gets worse ... let's say that during the course of the data transfer one of the fragments gets corrupted or lost. The IP layer (where fragmentation occurs) is connectionless - it can detect corrupt packets and fragments, but it cannot request the retransmission of missing or corrupt data. If the IP layer detects a corrupt packet (or fragment) the entire packet is just "dropped" - the IP layers clears out the offending data. The Transport layer has to request that the entire packet be retransmitted. Since the number of packets needed to transmit a given amount of data increases when the packets are fragmented, the chances that a packet will be lost goes up ... Think it can't get any worse? Bzzzzzt! Wrong! There is a term that impacts effective bandwidth and it's called propagation delay. Propagation delay is defined as the amount of time it takes a signal (data) to flow through a device. The greater the fragmentation and reassembly of packets, the longer it takes those packets to get from point A (a web server) to point B (you) - as propagation delay increases effective bandwidth decreases (ouch!). Fragmentation was incorporated into the Internet Layer to allow for possible differences in MTU - but it's not a good thing. If at all possible you do not want to fragment your data. It is faster to use a lower MTU - one that every piece of gear between the sender and receiver can handle - than it is to send the TCP maximum and force fragmentation. But, if the transport layer on the sender and receiver negotiates the MTU, how can we figure out what the best MTU is between the two points? Hmmm ... The way to figure out the best MTU between two points is to use Path Maximum Transmittable Unit Discovery (PMTUD). Here is how it works: Before a connection is negotiated your PC sends out a packet with an MTU of 1500 bytes - but with one minor difference from before. Every Ethernet packet has a special "flag" (a packet control bit) called the "Don't fragment" flag, and in this packet the bit is set (or active). As the packet moves from router to router it may reach a router that can't send the packet - the MTU of the next device in the path is lower than the MTU of the packet, and since the "Don't fragment" bit is set, the transfer fails. The router that could not forward the data sends an Internet Control Message Protocol (ICMP) error message (trivia: ICMP type three code 4E) back to your PC letting you know that the transfer failed because the MTU was too high. Your PC then sets a lower MTU (how much lower varies depending on who coded the PMTUD function of the TCP/IP stack on your computer) and the process starts all over. Eventually, your PC will get a packet all the way to the server you where trying to reach. Your PC then initiates a TCP session with the correct MTU. Sounds time consuming? Well, it is - but it works and you get faster data transfers. You have now established a connection and the data is transferred. What happens next? Well, for a TCP connection the process that kicked it off (SYNs and SYN-ACKs) is very similar to the process that ends it. Only now your PC is going to send a Finish (FIN) packet and the server you are ending the connection with will send a Finish Acknowledgement (FIN-ACK). Your PC will send a final FIN packet and the connection is gone. Connectionless Transfer (UDP) Not all applications use TCP. Some use a connectionless protocol called User Datagram Protocol (UDP). With UDP no connection is made to the remote computer that you are sending data to - the packets just go. If a packet gets lost or corrupt your PC will never know because there is no mechanism built into UDP to recover data. An application can be written to perform segmentation and error recovery, but why bother when the same application could be written to use TCP. UDP is useful for DNS requests, audio, and video data - if you lose a packet in an audio or video stream do you really want to wait for it to be retransmitted? Nope, just drop the packet and move on. UDP also has a smaller header size than TCP, so you use less bandwidth on packaging and have more bandwidth for the actual data that is being sent. Port Numbers UDP, like TCP, uses port numbers (source and destination) so the Transport Layer can keep track of the data - you could have multiple applications sending and receiving data across the network. But each application receives a unique port number from the Transport Layer. Every time an application sends data to the Transport Layer, the Transport Layer "tags" the data with the application's unique port number. When a reply to an application's request comes back, the Transport Layer knows which application to give the data to because the reply will contain the application's port number. Port numbers range from 1 to 65,553. The numbers below 1024 are reserved for services (like Hyper Text Transfer Protocol - HTTP is always port 80). Numbers above 1023 are available for client applications, like the web browser you are using to read this page. Every browser window that you have running was assigned a unique port number when you opened the window. That's how you can have multiple windows open, all surfing to different pages, and the correct web site loads into the window that requested the data. Data Flow We have covered how data flows through the TCP/IP stack from a physical standpoint. But there is also a logical aspect to cover. You see, the different layers in the TCP/IP stack are independent for the most part. The Application Layer at the sender sends data down to its own Transport Layer, but for all practical purposes the sender's Application Layer is logically communicating directly with the application layer on the receiver. The same holds true at the sender's Transport Layer. The Transport Layer on the sender sends data down to its own Internet Layer, but the sender's Transport Layer is logically communicating directly with the transport layer on the receiver. The sender's Internet layer sends data down to its own Network layer, but the Internet Layer on the sender is logically communicating directly with the Internet layer on the receiving side of the connection. The Network layer communicates with other network layers on the Local Area Network (LAN) that it is physically connected to - there is no logical connection to the destination computer's network layer.
What is a Hub? A hub is really nothing more than a wire directly connected to each and every port. What goes in one port is sent out all ports at the time of transmission. If two or more nodes (a node is anything capable of sending data on the network) transmit at the same time a collision occurs -the data collides on the wire, becomes scrambled, and has to be retransmitted later. The entire hub is called a collision domain* because any computer on any port can collide with any other computer on any other port. Think of this a party line or conference call. Everyone else can hear your conversation and must wait for you to stop talking before they can speak. If two or more people talk at the same time (a collision) the conversation has to be repeated. *Note: A collision domain is any wire that can have 2 or more devices trying to transmit at the same time, rendering all transmissions useless. After detecting the collision, all units must reset and attempt to re-transmit the data. The more traffic on a wire, the more likely collisions are to occur. The more collisions, the more retransmits which means more traffic on the wire. (See the problem?) Ultimately, the network gets REAL sluggish. What is a Switch Switches are a vast improvement over hubs because they limit Collision Domains. Switches move packets across the wire from port to port. They handle this task in different ways depending on how the switch is configured. One way, called "store and forward", will wait for an entire valid Ethernet frame before moving the packet to the destination port. This was is very safe since you reduce the passing of bad frames nearly completely. However, "store and forward" is also the slowest switching method. "Cut through" switching will look at the packet coming in. It will look only at the beginning of the packet where the source and destination Media Access Control (MAC) address is kept. After that, it "cuts the packet through as it comes in", straight to it's destination port. This form of switching is extremely fast since the switch never has to wait and examine each Ethernet frame as it comes in. However, because the switch DOES NOT do this, there is a chance it may pass a bad frame. So there are higher bad frame rates on switches configured for "cut through" switching. Most common switches will allow both of these formats to be assigned, and some even allow hybrids of these two methods. One such hybrid is "Fragment Free" switching mode. The smallest legal Ethernet frame is 58 bytes. Fragment free switching gets the first 58 bytes and then cuts the packet through to the appropriate port. Performance is increased by not requiring a switch receive the entire packet before forwarding it, and yet still cut down on the amount of network errors that pass from one collision domain to another. Switches store and forward or cut through packets on a per port basis. If the computers on port one and two are transferring data, those packets are not replicated on every port -freeing up the computers on all other ports to pass data without waiting for useless traffic to get off the line. Now, if there is just one computer on each port, it cannot collide with any traffic. This actually opens up the possibility of full duplex operation. If the computer and the switch are the only things that will ever talk on the wire, then they never have to listen for collisions because their transmit signals are hardwired to each others receive signal. If they never have to listen for collisions, then they can send and receive data at the same time which will increase performance. Rappin' it up In summary, switches can dramatically increase network performance for a number of reasons. With the combination of quick forwarding of packets, the possibility of full duplex operation, the reduction of collisions, and the allowance of multiple simultaneous conversations, switches are the only way to go for high priority network design. As the price of switches continues to drop, all LANs should move from hubs to switches as quickly as possible. The Ethernet world may never be the same. What are IP Addresses? IP addresses are an essential item in the world of networking, no matter whether it is a small home network, a local area network in a company, or a global network such as the Internet. A network is a number of computers that are physically connected to be able to communicate with each other and exchange data. But in order for them to be able to communicate, they need to speak a common language in order to bridge the gap between different operating systems etc. It enables a web server running UNIX to send data to your PC running Windows in a format that Windows can understand and use. This common language ensures that the data sent by one computer, and the form it was sent in, can be understood and used by the receiving computer. The common language used is called a protocol. There are several protocols available, but one of the most important and most common ones is TCP/IP, which stands for Transmission Control Protocol/Internet Protocol. But speaking a common language is not enough. In addition, each computer on a network has to be uniquely identifiable for the single reason that the computer who sends data knows where to send it to and vice versa the computer who requests data, needs to know where it is coming from so it knows where to request data from. For that purpose, every computer on a network is assigned a unique number, which is called an IP address. Think of it as your phone number. In order to talk to your friend on the phone, you both have to have a physical connection, the phone company's network. But to be able to connect to your friend on the phone, you need to identify to the network who you want to talk to. This is done by a unique number, your friend's phone number that is unique to his phone. Same thing with IP addresses and computers. An IP address is a 32-bit number, divided by periods into 4 groups. Each group is called either an octet because it consists of 8 bits, or a byte because one byte equals 8 bits. An IP address could look like this: An IP address actually contains two pieces of information. The first part of the IP address contains the network ID. It uniquely identifies a network within a group of different networks. The second part of the IP address contains the host ID. It uniquely identifies a computer within a group of computers on the same network. An easy way to find out your current IP address is to go to Start/Run, type winipcfg and click OK. In the resulting window you'll see your IP address listed. If you have more than one adapter installed on your system, e.g. a network card and a modem, then you can select from the drop-down menu to see the different IPs. Who assigns IP addresses? In order for IP addresses to remain unique, somebody has to assign them and keep track of them. For the Internet, this is the Internet Assigned Numbers Authority (IANA) that assigns blocks of IP addresses to organizations such as ISPs. For your company network, it would be your network administrator who has a block of IP addresses that he assigns to every computer in the company. For your Internet access, it would be your ISP that has a pool of IP's that they assign to their customers. For your home network, if you set up a small home network, you would assign an IP address to your computers. For the specific purpose of home networking, IANA has reserved several blocks of numbers as private IP numbers that can be used in private networks only but not on the Internet. These blocks are: There is a reason that there are three blocks of numbers, and not just one big block. IP addresses are separated into 3 classes, simply called Class A, B, and C. Class A addresses are used for systems with a small number of networks, but a large number of computers (hosts). They use only the first byte/octet of the IP as network ID, and the remaining 3 bytes as host ID. Class B addresses are used for systems with a roughly equal number of hosts and networks, They use the first two bytes/octets of the IP as network ID, and the remaining two bytes as host ID. Class C addresses are used for systems with a large number of networks, but a small number of computers (hosts) on each network. They use the first 3 bytes/octets as network ID, and the remaining byte as host ID. In order to identify which class is used, something called a subnet mask is used. If a byte is used for network ID, that byte of the subnet mask will be 255. If a byte is not used for the network ID but for the host ID instead, that byte of the subnet mask will be 0. The following table should make this a little clearer:
How are IP Addresses assigned? As we mentioned earlier, IP addresses are assigned by the IANA, network administrators, ISPs, or yourself. What we didn't mention is that there are different ways of assigning IP addresses. Static IP addresses A static IP address is a number that is permanently assigned to a certain computer and does not change. Once a computer has been assigned its IP address, it will keep it indefinitely. The advantage of a static IP is that the computer will always have the same IP address on the network and will be easy to identify in the future once its IP address is known. The disadvantage is that the party that assigns the IP has to do this manually and keep good track of them to make sure that it does not get assigned to another computer as well by accident. You will find static IP addresses used by some cable modem providers, in small company networks, and of course on the Internet where every site has its own unique permanent IP address until it is removed or moved to another web server and assigned a new IP. Dynamic IP addresses A dynamic IP address is a number that is assigned to different computers at different times. This means that every time a computer is connected to a network, it is assigned a random IP address from a pool of IP addresses depending on whatever IP is available and is not currently in use. For example if your company network uses dynamic IP addresses, it means that when you start your computer and it wants to log into the network, it will get a new IP address. Or every time you connect to the Internet using a dial-up connection through your modem to your ISP, the ISP will assign an available IP address to your computer for the time of your online session. When you disconnect your computer from your ISP and connect again the next time, you'll be assigned a different IP address depending on what IP's are available at that time. This is done with a technology called Dynamic Host Configuration (DHCP). The server for the network has a number of IP's available to assign to hosts on the network and distributes them to computers as needed as they connect to the network. The advantage of dynamic IP's is that the server automatically keeps track of them and makes sure that each computer has a unique address. There is no need to keep track of them manually. Another advantage is that it allows computers to move between subnets and always have a valid IP without manual reconfiguration. A lease time can be assigned to a dynamic IP for automatic expiration to disconnect a computer from the network after a certain time. To find out whether your computer has a dynamic or static IP, go to Start/Settings/Control Panel and double-click the Network icon. In the resulting window, make sure the Configuration tab is selected and double-click the TCP/IP protocol entry to see the TCP/IP Properties. Select the IP address tab. If "Obtain an IP address automatically" is selected, you're set up with a dynamic IP. If "Specify an IP address is selected" then you'll see your IP address displayed in the field below and it means you have a static IP address. IP addresses on the Internet IP addresses are essential on the Internet as the TCP/IP protocol is the main protocol used to connect to the Internet. To connect to the Internet and for your computer to be seen on the Internet you need an IP address. If you use a modem and a dial-up connection to get online, your ISP assigns you a dynamic IP address for the time you're online. If you have a DSL connection or cable modem, you most likely have a static IP address (though there are exceptions depending on the provider). In addition, every web site on the Internet has its own IP address. This IP is static so that the site is always found on the same spot on the web. Otherwise it would be difficult to find the site. Imagine your friend randomly changing phone numbers. It would make it hard for you to call if you didn't know the number and had to look it up every time. This IP address is assigned to the site by the web host or the web administrator since web sites are hosted on computers that are connected to the network of the Internet. You can assign multiple IP addresses to one computer which allows web hosts to host multiple sites on one and the same computer. For example, Yahoo's site has the IP address 204.71.200.74 which identifies it uniquely on the Internet. If you open your browser and type in the IP and hit Enter, Yahoo will show up. Wait a second, you are probably saying right now, I never use that number to go to Yahoo. That's true, you most likely just type in www.yahoo.com and your browser brings up the correct site. Yahoo is a lot easier to remember than 204.71.200.74. This is where domain names come into play. Think about our example with phone numbers again. In order to call your friend, you have to dial a phone number which can be hard to remember. To make this easier, you keep address books that have your friend's names and phone numbers listed. Same reason phone books exist. You look up the name, find the right number, then dial it. In a simplified manner, this is exactly like your browser works. When you type in www.yahoo.com, your browser has no clue what to do. So it first talks to another computer called a Domain Name System server, or DNS server for short. This DNS server is maintained by your ISP and updated on a frequent basis. Your browser asks now the DNS server what www.yahoo.com means. The DNS server will look it up in its list of web sites and, if it finds a listing that matches, pull up the correct IP address for that site, in our example 204.71.200.74, so that now your computer knows what computer to connect to and request retrieval of the desired web page. You can easily find out what IP address a site has by using one of several commands. You can either do a WhoIs lookup at one of many sites that offer this service for free, such as WhoIs.Net, or you can open a DOS window and type ping www.yahoo.com. This actually sends a small packet of data to the site and measures in milliseconds how fast the reply comes back, but it also displays the IP address of the site at the top. On NT and UNIX machines you can use the NSLOOKUP command to get this information. How does a new web site get an IP address? When you set up a web site, the first thing you usually do is register a domain name with a registrar. These organizations keep track of domain names in a database. When you register your new domain name, they will ask you where your site is hosted and what DNS server your site is listed on. If you use a web host for example, you would tell them the name and IP address of your web host's DNS server (usually web hosts do this for you). Your web host will make an entry in its DNS server with your site's domain name and the IP address they assigned to it which then points to whatever computer the site resides on. As soon as your ISP has added the name and IP address for your site to its DNS server's database, it will know where to go to retrieve the web page you asked for when you typed in the domain name. Another thing that could happen is that a site changes its IP address, either because the web administrator moves it to a different computer, or maybe because the site was moved to a different web host. This requires the domain name being removed from the old DNS server and added to the new DNS server as well as informing the registrar's database about the change. In addition, every ISP has to update their DNS server to know what the new IP for that site is. But in contrast to phone books that get updated only once a year, DNS servers are being updated from every few hours (major ISPs update their DNS servers constantly) up to every week or two (usually only small ISPs are that slow). In the short time period it takes to update DNS servers around the world, it can happen that your ISP still directs you to the old web server. If you know the new IP address for the site, you can beat the system by typing in the IP in your browser instead of the domain name. This will save your ISP the trouble of looking it up, it will assume that you want to go to that computer and take you there directly, bypassing the DNS server lookup procedure. Stale Information Some ISPs are trying to limit the amount of work they have to do in order to relieve the load on their systems and work more efficiently. For that reason, they cache DNS information. This means that they keep information that is requested frequently in a temporary storage location that is easier and faster to access than looking up the same information over and over again. This means that when you request to go to www.yahoo.com, the ISP might look in the cache first, see that somebody else requested earlier to go to www.yahoo.com and that they already looked up that IP address, so they will just give you the IP address that they have stored in their cache instead of looking it up again, assuming that the information is still the same. This works most of the time and can be more efficient, but if the IP address has changed, you of course have a problem since you will be directed to the wrong web server. Your ISP will empty the cache on a regular basis and eventually look up the information again so that you then get directed to the correct web server. Another thing that can happen is that an ISP keeps a file called HOSTS on your computer. In this small text file they will store a list of domain names for sites you go to frequently with the corresponding IP addresses. When you type in the web site address, the browser actually checks first if such a HOSTS file exists before it talks to your ISP's domain name server. If it finds the information it needs in there, it will take the IP address from this file and use it to go to the site. This eliminates again the need to check with the ISP's DNS server first and shaves off valuable milliseconds of your browsing time. Again, this works most of the time and can be more efficient, but if the IP address for the site has changed, you of course have a problem since you will be directed to the wrong web server. The only way to remedy this problem is by editing the HOSTS file and replacing the old IP with the new one, or removing the entry for that site completely, or by renaming or removing the HOSTS file so that the browser now is forced to inquire with the DNS server to find out the correct IP address. Some of these explanations here are simplified for the purpose of keeping this article to a manageable size. The purpose of this article is to make you a little more familiar with IP addresses, what they're good for and what goes on behind the scenes. If you are interested in knowing a lot more about IP addresses, check out 3com's excellent article on the topic at https://www.3com.com/nsc/501302.html With computers getting cheaper and cheaper these days, it is not uncommon for a household to have more than one PC. If that describes you, then you have probably found yourself in the situation where you wished you could access the other PC to retrieve a file, use the printer attached to the other PC, share the modem on the other PC, or play multi-player computer games. The easy solution to these problems are a home network where you connect two or more PCs to accomplish above mentioned tasks. If you think this requires a third computer that acts as a server, complicated installation, etc. think again. Regular home/desktop PCs running Windows 95 or 98 can be easily networked using what is called a peer-to-peer network. You can get the necessary parts for around $ the installation takes around an hour or more depending how much cable you have to put in your house. Configuring each PC should take around 10 minutes. What you need:
Hardware Installation First, install a network card in each one of the PCs following the instructions that came with the NIC. When you turn on the PC after installing the card, Windows should recognize the card and prompt you for the correct driver. Once it is installed, you should see a Network Neighborhood icon on your desktop. We need that icon to configure the network in a while. Now you need to think about where the PCs are located in your house and what's the best way to run the cable. It involves a little more work if the PCs are not in the same or adjacent rooms. With adjacent rooms, you can probably just drill a hole in the wall to feed the cable through. In order to avoid serious injury inflicted by your spouse or landlord, please do not drill the hole in eye-height in the middle of the wall. Find an inconspicuous spot right over the base board, in a corner or in a closet. You might even be able to run the cable underneath the house or through the attic. Again, make sure that you have enough Cat 5 cable. Designate a central spot where to put the hub. Then run the cable from each PC to the hub. Make sure that all the cables are securely plugged into a network card in a PC on one end and into the hub on the other end. The hub should also be plugged into an outlet as it needs power. Note for Cable modem/DSL users To access your cable modem after setting up your home network, plug your cable/DSL modem into the uplink port of your hub to make it available on your local network. To be able to access the cable/DSL modem from all PCs, you either need to install and configure proxy software, or get an individual IP address for each PC on the network from your ISP. More information about Internet connection sharing can be found in our tutorial at https://www.pcnineoneone.com/howto/ics1.html That should be all the physical work involved. Now you need to configure each PC. Software Configuration The last step is to configure each PC to see and be seen on the network. You should now see a Network Neighborhood icon on the desktop of each PC. Right-click that icon, select Properties. This will bring up the Network Properties dialog box with the Configuration tab selected. Here you need to install network protocols which enable the PCs to exchange data using a "common language." Click the Add button, select Protocol, click Add, select Microsoft, highlight TCP/IP and click OK until you're back to the Network Properties dialog box. Don't close this box until after the very last step. Now click the Add button again, select service, click Add, select File and Printer sharing for Microsoft Networks and click OK until you're back to the Network Properties box. To be able for the PCs to identify each other on the network, each one needs an IP address. This is the PCs unique ID number that makes it positively identifiable. For your home network, you should use a specific range of IP addresses that are reserved for exactly this purpose, setting up local area networks. The number is 192.168.0.x with X being a number unique to each PC. Highlight the TCP/IP entry and click Properties. If you see multiple TCP/IP entries, be sure to select the one for the network card, not the one for your Dial-up adapter. Go to the IP Address tab, select Specify an IP Address and enter 192.168.0.1 for the first PC, 192.168.0.2 for the second PC etc. Be sure not to use 192.168.0.0 because it is the network number, and not to use 192.168.0.255 because that address is reserved for broadcast traffic. The subnet number should be 255.255.255.0 on all PCs. Now you can close the TCP/IP Properties window since that's all we have to do here. If you were creating a bigger network with more PCs and access to the Internet etc., more things need to be set up here but to keep it simple and in the home network range we won't worry about that part. Note for cable/DSL modem users If you have a cable/DSL modem, the instructions above might not make quite as much sense as you will discover that on your main PC, you already have a network card and a TCP/IP protocol installed which is configured as instructed by your ISP. Don't change those settings. Instead, read on. To be able to use your cable/DSL modem from all machines on the network, you have two alternatives: Get additional IP addresses from your ISP for each PC on the network, so that each machine can access the Internet individually. This solution might cost a few extra dollars per month for each additional IP, but is very easy to set up and configure. If you do this, don't use the IP addresses and subnet mask mentioned in the previous paragraph, use the ones provided by your ISP instead. Or Use proxy software to share one IP address from your main PC with the other machines on the network. This is cheaper, but a little trickier to set up because you need to install and configure the proxy program and tell all applications to use this proxy. In this case, you would actually install a second network card into the main PC that already has one network card for the cable/DSL modem. The first network card remains configured the way it is, the second network card would connect the main PC to your hub and therefore your local network with the other PCs. This second network card needs to be configured with a local IP address as described above. More information about Internet connection sharing can be found in our tutorial at https://www.pcnineoneone.com/howto/ics1.html Now go to the Identification tab. Here you want to enter a unique name for each PC, the choice of name is up to you. Name them after the 3 stooges, the seven dwarfs, your favorite baseball players, whatever. Then enter a workgroup name. This one needs to be the same on each PC. If you can't think of one, use the word Network, or Workgroup, or Home. Now you can close the Network Properties box. But first insert your Windows CD into the CD drive because Windows needs to copy several files. As soon as that's done, Window will prompt you to reboot the PC which you need to do for the new settings to take effect. In order to see other PCs on the network and access the drives on the other PCs, you first need to enable File Sharing, which is simple. In the Explorer, right-click on the drives you want to share on the network, select Sharing, click Shared As, and specify the access type: Read-only, Full (read and write), or Depends on password. If you have a closed network meaning that this network is not connected to the outside world, and you have no sensitive data on your drives that not all user should be able to access, you can just set the access to full without a password. But if this network is somehow connected to the outside world via dial-up, cable, or DSL modem, you need to use password protection for sharing, as well as use a hardware or software based firewall solution. To share printers, you need to enable sharing as well. Go to Start/Settings/Printers, right-click the printer(s) to be shared and select Sharing After configuring each PC and performing the necessary reboot, you should reboot each PC again after each one has been configured. Then launch the Windows Explorer on each PC and check out the Network Neighborhood icon at the bottom. If everything went right, you should now see underneath Network Neighborhood an icon for the Entire Network and then the name of each PC on your network. If you open the Entire Network, you should see the name of your workgroup which contains again all PCs on the network. That's it. You're done. Now you can share files and printers over your new home network. Bonus Options There are several other things you can use your home network for. One popular use is multi-player gaming. A lot of games nowadays come with the option to create and play network games, such as Quake, Need for Speed, etc. To set this up, you need to install the game on one of your PCs. Usually you want to do the full install on your fastest PC to host the game. Then you install the game with the Remote Player option or whatever it is called in that particular game setup on the other PCS. Start the game on the host PC and create a network game. As soon as you have that set up, the other players on the network can join the game you created. Very cool and lots of fun. This takes PC gaming to the next level. Another common use for home networks is to share a modem/internet access if not all PCs on the network have a modem. To do this, you need to download a proxy server program such as WinGate or Sygate first and install it on the PC with the modem. After configuring the program, all PCs on the network can share internet access through one modem. If you are one of the lucky people like me that have a cable modem, this setup gets even more interesting. If you want to share a cable modem between multiple PCs, check first with the cable modem service provider and ask if they can provide you with multiple IP addresses. If so, you configure each PC not as mentioned on the previous configuration page but as the cable modem provider tells you. That allows each PC to connect directly through the cable modem to the internet and saves you the hassle of setting up a proxy server program. If the provider does not give you more than one IP, it is still possible, though. All you need is a second network card in one of your PCs. Conect and configure one card to connect to the cable modem, the other card to your network. Install a proxy server program on that PC and all PCs can now share the cable modem. For more detailed information on sharing Internet access, check out our tutorial on Internet Connection Sharing. Document InfoAccesari: 2589 Apreciat: Comenteaza documentul:Nu esti inregistratTrebuie sa fii utilizator inregistrat pentru a putea comenta Creaza cont nou A fost util?Daca documentul a fost util si crezi ca meritasa adaugi un link catre el la tine in site in pagina web a site-ului tau.
Copyright © Contact (SCRIGROUP Int. 2024 ) |