computer network_lab manual

Upload: patel-sahil

Post on 06-Apr-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 Computer Network_Lab Manual

    1/13

    Lab Manual

    DCN

    1. Introduction to Networking

    Introduction

    A network is simply a group of two or more Personal Computers linked together. Manytypes of networks exist, but the most common types of networks are Local-AreaNetworks (LANs), and Wide-Area Networks (WANs).

    In a LAN, computers are connected together within a "local" area (for example, anoffice or home). In a WAN, computers are further apart and are connected viatelephone/communication lines, radio waves or other means of connection.

    How are Networks Categorized?

    Networks are usually classified using three properties: Topology, Protocol andArchitecture.

    Topology specifies the geometric arrangement of the network. Common topologiesare a bus, ring and star. You can check out a figure showing the three common typesof network topologies here.

    Protocol specifies a common set of rules and signals the computers on the networkuse to communicate. Most networks use Ethernet, but some networks may use IBM's

    Token Ring protocol.

    Architecture refers to one of the two major types of network architecture: Peer-to-peer or client/server. In a Peer-to-Peer networking configuration, there is no server, andcomputers simply connect with each other in a workgroup to share files, printers andInternet access. This is most commonly found in home configurations and is onlypractical for workgroups of a dozen or less computers. In a client/server network thereis usually an NT Domain Controller, to which all of the computers log on. This servercan provide various services, including centrally routed Internet Access, mail (includinge-mail), file sharing and printer access, as well as ensuring security across the network.

    This is most commonly found in corporate configurations, where network security isessential.

    Network Topologies

    Introduction

    Network topologies can take a bit of time to understand when you're all new to thiskind of cool stuff, but it's very important to fully understand them as they are keyelements to understanding and troubleshooting networks and will help you decide

    what actions to take when you're faced with network problems.

    I will try to be as simple as possible and give some examples you can relate to, so let'sget stuck right into this stuff!

    The Stuff:

    There are two types of topologies: Physical and Logical. The physical topology of anetwork refers to the layout of cables, computers and other peripherals. Try to imagineyourself in a room with a small network, you can see network cables coming out of

    KIRC,KALOL 1

  • 8/2/2019 Computer Network_Lab Manual

    2/13

    Lab Manual

    DCN

    every computer that is part of the network, then those cables plug into a hub or switch.What you're looking at is the physical topology of that network!

    Logical topology is the method used to pass the information between the computers. Inother words, looking at that same room, if you were to try to see how the networkworks with all the computers talking (think of the computers generating traffic andpackets of data going everywhere on the network) you would be looking at the logicalpart of the network. The way the computers will be talking to each other and the

    direction of the traffic is controlled by the various protocols (like Ethernet) or, if youlike, rules.

    If we used token ring, then the physical topology would have to change to meet therequirements of the way the token ring protocol works (logically).

    If it's all still confusing, consider this: The physical topology describes the layout of thenetwork, just like a map shows the layout of various roads, and the logical topologydescribes how the data is sent across the network or how the cars are able to travel(the direction and speed) at every road on the map.

    The most common types of physical topologies, which we are going to analyze, are:Bus, Hub/Star and Ring.

    The Physical Bus Topology

    Bus topology is fairly old news and you probably won't be seeing much of these aroundin any modern office or home.

    With the Bus topology, all workstations are connecting directly to the main backbonethat carries the data. Traffic generated by any computer will travel across thebackbone and be received by all workstations. This works well in a small network of 2-5computers, but as the numbers of computers increases so will the network traffic andthis can greatly decrease the performance and available bandwidth of your network.

    As you can see in the above example, all computers are attached to a continuous cablewhich connects them in a straight line.

    The arrows clearly indicate that the packet generated by Node 1 is transmitted to allcomputers on the network, regardless the destination of this packet.

    Also, because of the way the electrical signals are transmitted over this cable, its endsmust be terminated by special terminators that work as "shock absorbers", absorbing

    KIRC,KALOL 2

  • 8/2/2019 Computer Network_Lab Manual

    3/13

    Lab Manual

    DCN

    the signal so it won't reflect back to where it came from. The value of 50 Ohms hasbeen selected after carefully taking in consideration all the electrical characteristics ofthe cable used, the voltage that the signal which runs through the cables, themaximum and minimum length of the bus and a few more.

    If the bus (the long yellow cable) is damaged anywhere in its path, then it will mostcertainly cause the network to stop working or, at the very least, cause bigcommunication problems between the workstations.

    Thin net - 10 Base2, also known as coax cable (Black in color) and Thick net - 10 Base5(Yellow in color) is used in these type of topologies.

    The Physical HUB or STAR Topology

    The Star or Hub topology is one of the most common network topologies found in mostoffices and home networks. It has become very popular in contrast to the bus type(which we just spoke about), because of the cost and the ease of troubleshooting.

    The advantage of the star topology is that if one computer on the star topology fails,then only the failed computer is unable to send or receive data. The remainder of thenetwork functions normally.

    The disadvantage of using this topology is that because each computer is connected toa central hub or switch, if this device fails, the entire network fails!

    A classic example of this type of topology is the UTP (10 base T), which normally has ablue color.

    The Physical Ring Topology

    In the ring topology, computers are connected on a single circle of cable. Unlike thebus topology, there are no terminated ends. The signals travel around the loop in onedirection and pass through each computer, which acts as a repeater to boost the signaland send it to the next computer. On a larger scale, multiple LANs can be connected toeach other in a ring topology by using Thicknet coaxial or fiber-optic cable.

    KIRC,KALOL 3

  • 8/2/2019 Computer Network_Lab Manual

    4/13

    Lab Manual

    DCN

    The method by which the data is transmitted around the ring is called token passing.IBM's token ring uses this method. A token is a special series of bits that containscontrol information. Possession of the token allows a network device to transmit datato the network. Each network has only one token.

    The Physical Mesh Topology

    In a mesh topology, each computer is connected to every other computer by aseparate cable. This configuration provides redundant paths through the new work, soif one computer blows up, you don't lose the network :) On a large scale, you canconnect multiple LANs using mesh topology with leased telephone lines, Thicknetcoaxial cable or fiber optic cable. Again, the big advantage of this topology is itsbackup capabilities by providing multiple paths through the network.

    The Physical Hybrid Topology

    With the hybrid topology, two or more topologies are combined to form a completenetwork. For example, a hybrid topology could be the combination of a star and bustopology. These are also the most common in use.

    Star-Bus

    KIRC,KALOL 4

  • 8/2/2019 Computer Network_Lab Manual

    5/13

    Lab Manual

    DCN

    In a star-bus topology, several star topology networks are linked to a bus connection.In this topology, if a computer fails, it will not affect the rest of the network. However, ifthe central component, or hub, that attaches all computers in a star, fails, then youhave big problems since no computer will be able to communicate.

    Star-Ring

    In the Star-Ring topology, the computers are connected to a central component as in astar network. These components, however, are wired to form a ring network.

    Like the star-bus topology, if a single computer fails, it will not affect the rest of thenetwork. By using token passing, each computer in a star-ring topology has an equal

    chance of communicating. This allows for greater network traffic between segmentsthan in a star-bus topology.

    2. Introduction of Network CommunicationDevices

    KIRC,KALOL 5

  • 8/2/2019 Computer Network_Lab Manual

    6/13

    Lab Manual

    DCN

    Introduction

    Here we will talk about hubs and explain how they work. In the next section we willmove to switches and how they differ from hubs, how they work and the types ofswitching methods that are available; we will also compare them.

    Before we start there are a few definitions which I need to speak about so you canunderstand the terminology we will be using.

    Domain: Defined as a geographical area or logical area (in our imagination) whereanything in it becomes part of the domain. In computer land, this means that whensomething happens in this domain (area) every computer that's part of it will see orhear everything that happens in it.

    Collision Domain: Putting it simple, whenever a collision between two computersoccurs, every other computer within the domain will hear and know about the collision.

    These computers are said to be in the same collision domain. As you're going to seelater on, when computers connect together using a hub they become part of the samecollision domain. This doesnt happen with switches.

    Broadcast Domain: A domain where every broadcast (a broadcast is a frame or datawhich is sent to every computer) is seen by all computers within the domain. Hubs andswitches do not break up broadcast domains. You need a router to achieve this.

    There are different devices which can break-up collision domains and broadcastdomains and make the network a lot faster and efficient. Switches create separatecollision domains but not broadcast domains. Routers create separate broadcast andcollision domains. Hubs are too simple to do either, can't create separate collision orbroadcast domain.

    Hubs and Repeaters

    Hubs and repeaters are basically the same, so we will be using the term "Hub" to keep

    things simple. Hubs are common today in every network. They are the cheapest way toconnect two or more computers together. Hubs are also known as Repeaters and workon the first layer of the OSI model. They are said to work on the first layer because ofthe function they perform. They don't read the data frames at all (like switches androuters do), they only make sure the frame is repeated out on each port and that'sabout it.

    The Nodes that share an Ethernet or Fast Ethernet LAN using the CSMA/CD rules aresaid to be in the same collision domain. In plain English, this means that all nodesconnected to a hub are part of the same collision domain. In a Collision domain, whena collision occurs everyone in that domain/area will hear it and will be affected. TheEthernet section talks about CSMA/CD and collision domains since they are part of therules under which Ethernet functions.

    The picture below shows a few hubs : 8 port Netgear and a D-link hub.

    KIRC,KALOL 6

    http://www.firewall.cx/osi-intro.phphttp://www.firewall.cx/ethernet-intro.phphttp://www.firewall.cx/ethernet-intro.phphttp://www.firewall.cx/osi-intro.php
  • 8/2/2019 Computer Network_Lab Manual

    7/13

    Lab Manual

    DCN

    The computers (nodes) connect to the hub using Unshielded Twisted Pair cable(UTP). Only one node can be connected to each port of the hub. The pictured hub has atotal of 8 ports, which means up to 8 computers can be networked.When hubs were not that common and also expensive, most offices and homenetworks use to install coax cable.

    The way hubs work is quite simple and straightforward: When a computer on anyone of the eight ports transmits data, this is replicated and sent out to the other sevenports. Check out the below picture which shows it clearly.

    EXPLANATION:Node 1 is transmitting some data to Node 6 but all nodes are receiving the data

    as well. This data will be rejected by the rest of the nodes once they figure out it's notfor them.

    This is accomplished by the node's network card reading the destination MACaddress of the frame (data) it receives, it examines it and sees that it doesn't matchwith it's own and therefore discards the frame. Please see the Data link layer in the OSIsection for more information on MAC addresses.

    Most hubs these days also have a special port which can function as a normalport or as an "uplink" port. An uplink port allows you to connect another hub to the

    existing one, increasing the amount of ports which will be available to you. This is acheap solution when you need to get few more computers networked and it worksquite well up to a point.

    This is how 2 eight port hubs would look when connected via the uplink port andhow the data is replicated to all 16 ports:

    In the above picture you can see that Node 1 is again transmitting data to Node6 and that every other node connected to the hub is receiving the information. As wesaid, this is a pretty good and cheap solution, but as the network gets busier, you can

    KIRC,KALOL 7

    http://www.firewall.cx/osi-intro.phphttp://www.firewall.cx/osi-intro.phphttp://www.firewall.cx/osi-intro.phphttp://www.firewall.cx/osi-intro.php
  • 8/2/2019 Computer Network_Lab Manual

    8/13

    Lab Manual

    DCN

    clearly understand that there is going to be a lot of unnecessary data flowing all overthe network. All Nodes here are in the same broadcast and collision domain since theywill hear every broadcast and collision that occurs.

    Switches and Bridges

    Introduction

    By now you can see the limitations of a simple hub and when you also read aboutEthernet, you start to understand that there are even more limitations. The companieswho manufacture hubs saw the big picture quickly and came out with something moreefficient, bridges, and then the switches came along! Bridges are analyzed later on inthis section.

    Switching Technology

    As we mentioned earlier, hubs work at the first layer of the OSI model and simplyreceive and transmit information without examining any of it.

    Switches (Layer-2 Switching) are a lot smarter than hubs and operate on the second

    layer of the OSI model. What this means is that a switch won't simply receive data andtransmit it throughout every port, but it will read the data and find out the packet'sdestination by checking the MAC address. The destination MAC address is locatedalways at the beginning of the packet so once the switch reads it, it is forwarded to theappropriate port so no other node or computer connected to the switch will see thepacket.

    Switches use Application Specific Integrated Circuits (ASIC's) to build and maintainfilter tables. Layer-2 switches are a lot faster than routers cause they dont look at theNetwork Layer (thats Layer-3) header or if you like, information. Instead all they look atis the frame's hardware address (MAC address) to determine where the frame needs tobe forwarded or if it needs to be dropped. If we had to point a few features of switcheswe would say:

    They provide hardware based bridging (MAC addresses)

    They work at wire speed, therefore have low latency

    They come in 3 different types: Store & Forward, Cut-Through andFragment Free (Analyzed later)

    Below is a picture of two typical switches. Notice how they looks similar to a hubs, butthey aren't. It's just that the difference is on the inside!

    KIRC,KALOL 8

    http://www.firewall.cx/osi-intro.phphttp://www.firewall.cx/osi-intro.php
  • 8/2/2019 Computer Network_Lab Manual

    9/13

    Lab Manual

    DCN

    The Three Stages

    All switches regardless of the brand and various enhancements they carry, havesomething in common, it's the three stages (sometimes 2 stages) they go throughwhen powered up and during operation. These are as follows:

    Address Learning

    Forward/Filter decisions

    Loop Avoidance (Optional)

    Let's have a look at them to get a better understanding!

    Address Learning

    When a switch is powered on, the MAC filtering table is empty. When a devicetransmits and an interface receives a frame, the switch places the source address inthe MAC filtering table remembering the interface the device on which it is located.

    The switch has no choice but to flood the network with this frame because it has no

    idea where the destination device is located.

    If a device answers and sends a frame back, then the switch will take the sourceaddress from that frame and place the MAC address in the database, associating thisaddress with the interface that received the frame.

    Since the switch has two MAC addresses in the filtering table, the devices can make apoint-to-point connection and the frames will only be forwarded between the twodevices. This makes layer-2 switches better than hubs. As we explained early on thispage, in a hub network all frames are forwarded out to all ports every time. Mostdesktop switches these days can hold up to 8000 MAC addresses in their table, andonce the table is filled, then starting with the very first MAC entry, the switch will startoverwriting the entries. Even though the number of entries might sound big, It onlytakes a minute or two to fill it up, and if a workstation doesn't talk on the network forthat amount of time, then chances are that its MAC address has been removed fromthe table and the switch will forward to all ports the packet which has as a destinationthis particular workstation.

    And after the first frame has been successfully received by Node 2, Node 2 sends areply to Node 1, check out what happens:

    KIRC,KALOL 9

  • 8/2/2019 Computer Network_Lab Manual

    10/13

    Lab Manual

    DCN

    Notice how the frame is not transmitted to every node on the switch. The switch bynow has already learned that Node 1 is on the first port, so it send it straight therewithout delay. From now on, any communication between the two will be a point-to-point connection:

    Forward/Filter DecisionWhen a frame arrives at the switch, the first step is to check the destination

    hardware address, which is compared to the forward/filter MAC database. If thedestination hardware address is known, then it will transmit it out the correct port, but

    if the destination hardware address is not known, then it will broadcast the frame outof all ports, except the one which it received it from. If a device (computer) answers tothe broadcast, then the MAC address of that device is added to the MAC database ofthe switch.

    Loop Avoidance (Optional)It's always a good idea to have a redundant link between your switches, in

    case one decides to go for a holiday. When you setup redundant switches in yournetwork to stop failures, you can create problems. Have a look at the picture belowand I'll explain:

    KIRC,KALOL 10

  • 8/2/2019 Computer Network_Lab Manual

    11/13

    Lab Manual

    DCN

    The above picture shows an example of two switches which have been placed in thenetwork to provide redundancy in case one fails. Both switches have their first portconnected to the upper section of the network, while their port 2 is connected to thelower section of the same network. This way, if Switch A fails, then Switch B takes over,or vice versa.

    Things will work fine until a broadcast come along and causes alot of trouble. For thesimplicity of this example, I am not going to show any workstations, but only the serverwhich is going to send a broadcast over the network, and keep in mind that this is whathappens in real life if your switch does not support Spanning-Tree Protocol (STP), this iswhy I stuck the "Optional" near the "Loop Avoidance" at the start of this section:

    It might look a bit messy and crazy at a first glance but let me explain what is going onhere.

    The Server for one reason or another decides to do a broadcast. This First Round

    (check arrow) broadcast is sent down to the network cable and firstly reaches Port 1 onSwitch A. As a result, since Switch A has Port 2 connected to the other side of the LAN,it sends the broadcast out to the lower section of the network, this then is sent downthe wire and reaches Port 2 on Switch B which will send it out Port 1 and back onto theupper part of the network. At this point, as the arrows indicate (orange color) theSecond Round of this broadcast starts. So again... the broadcast reaches Port 1 ofSwitch A and goes out Port 2 back down to the lower section of the network and backup via Port 2 of Switch B. After it comes out of Port 1 of Switch B, we get the ThirdRound, and then the Fourth Round, Fifth Round and keeps on going withoutstopping.....! This is what we call a Broadcast Storm.

    KIRC,KALOL 11

  • 8/2/2019 Computer Network_Lab Manual

    12/13

    Lab Manual

    DCN

    A Broadcast Storm will repeat constantly, chewing up the valuable bandwidth on thenetwork. This is a major problem, so they had to solve it one way or another, and theydid... with the Spanning-Tree Protocol or STP in short. What STP does, is to find theredundant links, which this case would be Port 2 of Switch B and shut it down, thuseliminating the possibility of looping to occur.

    Bridges

    Bridges are really just like switches, but there are a few differences which we willmention, but not expand upon. These are the following:

    Bridges are software based, while switches are hardware based because theyuse a ASICs chip to help them make filtering decisions.

    Bridges can only have one spanning-tree instance per bridge, while switchescan have many.

    Bridges can only have up to 16 ports, while a switch can have hundreds!

    That's pretty much as far as we will go with the bridges since they are pretty much old

    technology and you probably won't see many around.

    KIRC,KALOL 12

  • 8/2/2019 Computer Network_Lab Manual

    13/13

    Lab Manual

    DCN

    KIRC,KALOL 13