September 6, 2013

Hubs , Repeaters& Switch

Hubs & 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 to connect two or more computers together. Hubs are also known as Repeaters and work on the first layer of the OSI model. They are said to work on the first layer because of the function they perform. They don't read the data frames at all (like switches and routers do), they only make sure the frame is repeated out on each port and that's about it.


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







HOW HUB WORKS:


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 not for them.

This is accomplished by the node's network card reading the destination MAC address of the frame (data) it receives, it examines it and sees that it doesn't match with it's own and therefor discards the frame.
Most hubs these days also have a special port which can function as a normal port 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 a cheap solution when you need to get a few more computers networked and it works quite well up to a point.

SWITCH:

Switching
As we mentioned earlier, hubs work at the first layer of the OSI model and simply receive 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 and transmit it throughout every port, but it will read the data and find out the packet's destination by checking the MAC address.
The destination MAC address is located always at the beginning of the packet so once the switch reads it, it is forwarded to the appropriate port so no other node or computer connected to the switch will see the packet.

Layer-2 switches are alot faster than routers cause they dont look at the Network Layer (thats Layer-3) header or if you like, information. Instead all they look at is the frame's hardware address (MAC address) to determine where the frame needs to be forwarded or if it needs to be dropped. If we had to point a few features of switches we would say:
They provide hardware based bridging (MAC addresses)
They work at wire speed, therefor have low latency
They come in 3 different types: Store & Forward, Cut-Through and Fragment Free (Analysed later)




HOW SWITCH WORKS:
FIG. 1
FIG. 2When a switch is powered on (as shown in FIG.1), the MAC filtering table
FIG. 3

is empty. When a device transmits and an interface receives a frame, the switch places the source address in the 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 source address from that frame and place the MAC address in the database, associating this address with the interface that received the frame.

Since the switch has two MAC addresses in the filtering table, the devices can make a point-to-point connection and the frames will only be forwarded between the two devices. This makes layer-2 switches better than hubs. As we explained early on this page, in a hub network all frames are forwarded out to all ports every time. Most desktop switches these days can hold upto 8000 MAC addresses in their table, and once the table is filled, then starting with the very first MAC entry, the switch will start overwritting the entries. Even tho the number of entries might sound big .. it only takes a minute or two to fill it up, and if a workstation dosen't talk on the network for that amount of time, then chances are that its MAC address has been removed from the table and the switch will forward to all ports the packet which has as a destination this particular workstation.

No comments:

Post a Comment

Introduction to OSPF Part 2