PDA

View Full Version : Spock's Guide to Hubs and Switches



MisterSpock
12-06-2002, 08:33 PM
There always seems to be discussion on these boards related to hubs and switches. Hopefully, this post will be useful to those having problems.

BACKGROUND

In order to effectively discuss the topic of hubs and switches, a little background is required. Let's start with some of the basics of Ethernet.

ETHERNET

Ethernet is often referred to as a CSMA/CD-based networking protocol. Essentially this is correct. Ethernet, at its roots, is designed to use "contention-based" media access. CSMA/CD is one of several methods used to accomplish "contention-based: media access. CSMA/CD stands for "Carrier Sense, Multiple Access with Collision Detection."

All the stations on the network SHARE (either logically or physically) the same media for networking. Additionally, there is no special mechanism to prioritize or determine which station gets the use of that media. (Remember - even though the media is shared, only one station can transmit on it at one time. If more than one attempt to use it, both stations' messages will be ruined.) Stations must CONTEND for access, and will have a statistical chance to gain sole use of the bandwidth, based on the laws of probability and the number of machines present on the media.

In a CSMA/CD implementation, stations are smart enough to detect if the media open (available) before transmitting. Additionally, if stations collide, they are smart enough to wait a bit before trying again (through a mechanism known as binary exponential back-off). Thus, once a station "gets" the media (i.e. wins the war of contention), it can send a set of data (known as a frame) with little worry of collisions. Once that frame is complete, the chaos of contention begins again; another winner is determined and another frame is sent. (Note: for the technically inclined: a collision that occurs after a station has won the contention battle can occur. This is called a "late collision" and typically indicates either a defective network card or a network cable that is too long.)

As intuition should indicate, the more stations that fight during the periods of contention (called contention slots), the more of them will collide and have to wait. Also, the lower the relative throughput of the network. This is true. The more stations one adds to an Ethernet-based network, the poorer the performance. While collisions are a natural and inevitable part of an Ethernet network's existence, they do decrease performance. If they become too frequent, action must be taken to reduce their numbers.

Another common question is: "How do machines know if a frame is being sent to them?" They know this because every machine on the network looks that the beginning of every frame sent. They can see every frame on the network because they SHARE the media. This is fundamental to our discussion. They see EVERY frame because all the machines are sharing the same piece of media (either logically or physically). They examine the initial portion of the frame and look to see if the address in the "destination" portion of this frame matches their address. The address used for this determination is called the Media Access Control address - also known as the MAC address. The MAC address is a 48-bit address that is unique (hopefully!) for every station on the network. Every Ethernet card has a MAC address that has been permanently assigned to it by its manufacturer. Fundamentally, stations communicate by sending frames to one another using MAC addresses.

---------------------------------------

NETWORK DEVICES

In a discussion of hubs and switches, it is important to reduce them to their fundamental form. For purposes of this discussion, there are only two fundamental types that are relevant: a REPEATER and a BRIDGE.

REPEATERS

Repeaters are devices with very little brains, so to speak. They are not gifted with the ability to make any decisions whatsoever.
The repeater does not re-time an Ethernet signal. Its purpose in life is to, in effect, "boost" the existing signal so that the overall
length of the network can be increased. Whatever frames come in on one port of a repeater are simply blasted out the other port of the repeater, and so forth. The presense of a repeater creates a new network "segment." Both segments see everything that happens on the other segment. The media is still completely shared. The repeater doesn't restrict any traffic whatsoever. Of course, there are limits to how many repeaters I can add, and how long the overall network length can become, but that is beyond the scope of this message).

If I have two 10-station segments separated by a repeater, I essentially have a 20-station network. Thus, the overall probability of collisions has increased (20 stations contending vs. only 10 stations contending). As I add repeaters and stations, the probability of collisions goes up, and my throughput goes down.


BRIDGES

Bridges have a brain! Bridges were introduced to help alleviate the problems that come in to play when a network is extended and stations are added.

Unlike repeaters which blindly rebroadcast every packet they see, bridges take a look at the packets themselves. Bridges make forwarding decisions based on the source and destination MAC address of the frames. Because of this, they are often called "Layer 2" devices (the MAC sublayer is defined within layer 2 of the OSI network model).

Bridges connect two segments together. They listen for, and remember (called "learning"), the MAC addresses of the machines on each side.

As they learn more addresses, they make better forwarding decisions. A bridge will NOT forward a frame that has a source and destination address that it knows are both on the same "side" of the bridge. There is no need for the stations on the other side of the bridge to see these frames.

Bridges also "regenerate" and "re-time" the signals on both their ports. Because they don't blindly forward, there is no need to the two segments to be sharing the same timing. This has another cool side effect. Collisions on one side of the bridge do not affect machines on the other! So, not only are un-needed frames not forwarded, but collisions are limited to the segment on which they occur (called a collision domain). These factors improve throughput dramatically!

The only frames that are forwarded by a bridge are:
* Frames with a destination MAC address known to be on the other side of the bridge
* Frames with a destination MAC address that the bridge doesn't know about yet
* Broadcasts

So, when a bridge is introduced, machines no longer see every frame from every machine on the network.

AND HERE IS THE BIG, BAD SECRET:

** Hubs are multiport repeaters **
Every port (physical port) on the hub sees everything sent to and from every other port. Hubs are considered "shared media" devices.

** Switches are multiport bridges **
Each port on the switch has a bridge between it and every other port. Thus, a given port sees a limited amount of traffic. Switches are considered "switched media" devices.

Switches have many benefits over hubs. Obviously, they reduce unnecessary network traffic. They also limit the effects of collisions on other stations. Another neat benefit is that an end-node, when connected directly to a switch, can operate in FULL DUPLEX mode. This means that the device can transmit and receive simultaneously, thus creating an effective doubling of the maximum theoretical throughput. Hubs cannot due this due to collisions, and end devices must operate in half-duplex.
In short -- switches are very cool devices.

-----------------------------------------------------------------

HOW DOES THIS RELATE TO ShowEQ?

ShowEQ uses a technique known as "packet sniffing." Packet sniffing allows the station performing the sniffing to see the contents of every packet that appears on its network interface. (for you purists, technically it should be called "frame sniffing") Normally, the network card itself will look at the destination MAC address of every frame. It will only copy the remaining contents of the frame to its buffer if the destination MAC address matches its own MAC address. However, it is possible to enable a special mode of operation on the network card that forces it to copy, entirely, every frame it sees. This mode of operation is called "Promiscuous Mode" (!).

However, for ShowEQ and its promiscuous network card to see the information for which it is looking (ie the frames that contain the packets to and from the EQ box and the EQ server), those frames must be present on the network seqment to which it is connected. That is to say -- the SEQ box has to be able to see the frames to and from the EQ machine.

In order to see these frames, guess what? The two machines cannot be separated by a bridge! Why? Bridges make those nifty forwarding decisions. Essentially, the bridge determines that the SEQ box doesn't need to see those frames. After all, it is on the other side of the bridge, and neither the source nor destination MAC address is the SEQ box.

This is why we are always saying you need a HUB not a SWITCH!

(There are a few exceptions to this rule, which will be discussed later)

-------------------------------------------------------------------------

What to buy, what to buy....?

Unless you are using your SEQ machine as a firewall/router, you must have your EQ machine and you SEQ machine plugged in to the same hub.

Not too long ago, switches were the playthings of the well-to-do (corporations). Just about all SOHO-sized networking equipment was hub based. When 100Mbps (Fast Ethernet) became more common, companies were faced with a problem: how to handle the co-existence of 10Mb devices and 100Mb devices on the same network. Even though the protocols were designed to co-exist, the were not made to be co-operational. That is to say -- both of them can exist on the same piece of media, but a given interface operates at one speed OR the other -- not both. If one wants to plug a 10Mb device and a 100 Mb device into the same segment and have them communicate, additional circuitry is needed beyond a simple hub. This usually comes in the form of a 2-port switch (aka bridge). One port is connected to the network at 10Mb only, the other at 100Mb only. This trick essentially creates two logical "segments" on one network -- one at 10Mb, one at 100. The switch handles forwarding of frames between the two segments. To the outside world, the two devices can communicate with each other, even though one is at 10 Mb, and the other at 100.

All this is really important to understand in the world of hub-based networks. Hubs are too "stupid" (by design) to handle dual speed.

Switches do not have this problem. Because they re-time, make forwarding decisions, respond to flow control requests, and generally have brainpower, their ports can operate at either speed.

Companies produced a variety of devices to handle the dual speed problem. In so doing, they created a few problems as well. This is especially true in the SOHO networking arena. Low-cost switching has been made possible with the creation of some low cost switching ASICs (Integrated Circuits). They don't perform all that well, but they're cheap and for small networks work fairly well. These low-cost switches are becoming very common and show up where you least expect them.

I'll cover the major ones, and comment on how they work with ShowEQ. I'll also cover some alternatives to SOHO gear that are worth consideration.

"DUAL SPEED HUBS"

There are several different ways that dual speed hubs are designed.

The first and most simple method could be called a "two-in-one" combination. Internally, the device contains effectively two separate hubs. One operates at 10Mb, the other at 100Mb, with NO logic between the two. With this style of design, all devices at 10Mb can talk together, and all 100Mb devices can talk together, but without external help (switch), devices of two different speeds cannot talk together. For SEQ these will work just fine if the SEQ box and the EQ box operate at the same speed.

The second method to create a dual speed hub is to start with the same "two-in-one" combination, but to internally add a bridge between the 100Mb hub and the 10Mb hub. This will allow full communication between mixed speed devices. The presence of the switch, however, implies forwarding decisions, so we have to be careful with these where ShowEQ is concerned. With this type of device, if the SEQ and the EQ box are running at the same speed, everything will work properly.

"SINGLE SPEED HUBS"

There are a handful of devices out there that operate at only one speed (typically 10Mb, although there are some 100Mb-only devices out there). As long as they are true hubs, these will work. NOTE -- there are some newer devices out there that are marketed as hubs, but actually use the low-cost switching circuits internally.

"SWITCHING HUBS, SWITCHES, SWITCHPORTS"

These are generall danger signs for ShowEQ operation. There is only ONE way that a switch will work for ShowEQ, and this method is generally available only in commercial-grade switches. If a switch has an option to configure a "monitor port" (or similar name, depending on manufacturer. Nortel calls it "Port Mirroring"), SEQ can work. This option allows the switch to intentionally forward all (or selected) traffic to a given port. If you plug SEQ into the monitor port and direct all traffic from the port to which your SEQ box is connected to the monitor port, SEQ will work.

----------------------------------------

Some alternatives

If you run down to CompUSA, there is an ever growing likelihood that you'll end up with a switch unless you are very careful. Virtually every "Cable/DSL Router" out there comes with a 2, 4, or 8 port switch... Nice for General networking, but bad news for SEQ sniffing. However, there is a plethora of used commercial equipment out there that can be purchased. Commercial equipment has several advantages. It is designed to be durable, it is typically very well documented so you know exactly what you're getting, typically performs better than SOHO gear, and it typically has more than 2, 4, or 8 ports. With some careful shopping, you can get some nice equipment for a song.

If you stick with companies like Nortel (aka Bay Networks), Cisco, Intel, and 3-Com, you can almost certainly find precise documentation on the web so you'll be sure of what you're getting.


Some examples include:


Commercial Class:


* Nortel/Bay 200 and 250-series hubs -- Dual Speed ("two-in-one design") Hub. Will work is SEQ and EQ box are running at the same speed.

* Intel 10/100 Stackable Hub (EE110-series) ("two in one design") dual speed hub. (Available cheap on E-bay all the time)


SOHO-class:

* LinkSys StackPro Workgroup Hub (SPHUB05W) 5-port Dual Speed hub ("two-in-one plus internal bridge design") Will work if the SEQ and EQ

boxes run at the same speed.

* Cisco 1538 (Same technology as LinkSys) -- these are going for pocket change on E-Bay.


Switches that would work if you're adverturesome:

* Nortel (Bay) 310,350,410,450-series switches -- Port mirroring option would allow SEQ machine to see packets.

Most Nortel and Cisco switches have this option. I listed ones that sell inexpensively on E-Bay.


------------------------------------------

high_jeeves
12-06-2002, 09:38 PM
Excellent Post MisterSpock!

--Jeeves

Mag@@
12-07-2002, 07:51 AM
/cheer - very good AND accurate post Spock! Thank you!!

cruc
12-07-2002, 08:31 PM
i really enjoyed reading it! also, thanks for that lcc sniffer code too.

/bows

rmckinle
12-09-2002, 11:00 AM
I guess if I was a Vulcan I would believe hubs were better. But since I am a meagerly Earthling I would just say, buy a real switch i.e. some Cisco gear and set-up port monitoring.

high_jeeves
12-09-2002, 11:12 AM
Woot! Does that mean that rmckinle is sending everyone on these boards the $500 or so needed to purchase a switch that supports port monitoring? Sweet!

Hubs are $10, manageable switches are not... any questions?

--Jeeves

rmckinle
12-09-2002, 11:21 AM
Yeah one question high_jeeves,you suck your dad's dick with that mouth? One word dumb-ass EBay!!! 30 bucks spend a little you cheap bastard. Hubs for retards that can't telnet or ping munch like the ass-clowns that need Spock's class on Ethernet..

I guess that was you...

high_jeeves
12-09-2002, 11:51 AM
Oooh.. nice respone... you talk about my mouth? Show me a $30 100Mbit manageable switch on ebay that somebody who doesnt understand basic networking can use. (DONT show me one that currently is bid at $30, but hasnt met reserve, and is still 2 weeks away from closing.. that isnt the price it will sell for..) Dont forget about shipping costs...

Next, show me ANY home use scenario where this switch is going to be better than a $10 hub.

Next, learn to have a normal discussion on a message board.. I didnt insult you. I didnt make fun of you. You come here and basically call everyone not as l33t as you a moron. I'm dying to know a single common home application where your l33t 100Mbit manageable switch outperforms my $10 100Mbit hub.. So, while you might feel like a big man now, for coming here, and making your post, showing us all how cool you are, please go away. We dont need, or want you here.

--Jeeves

rmckinle
12-09-2002, 12:33 PM
Listen my intellectual word warrior, I¡¦m sorry. I¡¦ll help you put back on your ¡§Mean people suck endorsement mark. ƒ¼¡¨ The point is ¡§high_jeeves¡¨ I can tell that you are equipped with a verbal arsenal that enables you to understand complex issues and communicate on a particularly high level. (lol) So I won¡¦t go there with you. However I came to play mental tennis with Mr. Spock, not you! I have seen your previous posts to others and you yourself are no patron of the saints. IF you read Mr. Spock¡¦s post ALL THE WAY you would see that he is offering advice on a higher level that your average ¡§end user¡¨ would not understand; notes the ¡§SOHO-class¡¨ remarks. Hence my sarcastic to the entire post, if you¡¦re going to pass along information make sure it¡¦s accurate in its entirety. Hubs by design are much more in-efficient than a layer two switch. And if you are going to take the time of your busy ¡§no-life-day¡¨ to cut and paste text information off the web and massage it into your own format. Then you should at least share with the ¡§preconceived by the author¡¨ ¡§simple end user¡¨ all the information.
I am tired of reading endless verbose ramblings by want-to-be intellectuals in an attempt for 2nd rate fame.

Quote ¡V ¡§sarcasm, one more service I offer..¡¨ ¡V rmckinle

2nd Quote ¡V ¡§please go away. We don¡¦t need, or want you here.¡¨waaaaaa - high_jeeves

high_jeeves
12-09-2002, 12:50 PM
Ok.. I couldnt even read that last post... Is your keyboard broken? Mr Spock also agrees that switches are more efficient (he even says that in his post).

As for SOHO.. that is a VERY common term, not just in networking.. That is a very common business term, whether you are discussing technology or office supplies.

He is recommending that the average ShowEQ user buys a hub. Anyone on this forum with more than 2 posts will tell you the same thing. For the average ShowEQ user, hubs are the only way to go. They are cheaper, easier to use, and 99.9% as effective.

Perhaps I missed something in your last post between all your l33t symbology, and random keys.. but I fail to understand what your gripe is. Are switches technically more advanced? yes. Are they the best solution for ShowEQ? no. All the l33t symbols in the world wont change that.

--Jeeves

rmckinle
12-09-2002, 01:20 PM
Ahhh another QABALISTIC INTERPRETATION OF Unlocking the (imaginary?) hidden meanings within nonsense. This can be done with any seemingly nonsensical text such as your comments back to me. The source is unimportant however, the method is difficult without the aid of the Holy Qabalah.
For example, let's take the seemingly innocuous modern children's book, Spock's Guide to Hubs and Switches. By deciphering the meaning between the lines, the roots of words, the correspondence on the Tree of networking, and connections to myths, we can invoke the truth that lies hidden.
Next time begin your post with the innocent sentence,
Sam-I-Am!" It might be more enlightening
I do! I like them, Sam-I-am! And I would eat them in a boat. And I would eat them with a goat, or a MORON etc. etc."

"I do so like green eggs and ham!
Thank you!
Thank you!
Sam-I-Am!"


My original post:
Listen my intellectual word warrior, I¡¦m sorry. I¡¦ll help you put back on your ¡§Mean people suck endorsement mark. ƒ¼¡¨ The point is ¡§high_jeeves¡¨ I can tell that you are equipped with a verbal arsenal that enables you to understand complex issues and communicate on a particularly high level. (lol) So I won¡¦t go there with you. However I came to play mental tennis with Mr. Spock, not you! I have seen your previous posts to others and you yourself are no patron of the saints. IF you read Mr. Spock¡¦s post ALL THE WAY you would see that he is offering advice on a higher level that your average ¡§end user¡¨ would not understand; notes the ¡§SOHO-class¡¨ remarks. Hence my sarcastic to the entire post, if you¡¦re going to pass along information make sure it¡¦s accurate in its entirety. Hubs by design are much more in-efficient than a layer two switch. And if you are going to take the time of your busy ¡§no-life-day¡¨ to cut and paste text information off the web and massage it into your own format. Then you should at least share with the ¡§preconceived by the author¡¨ ¡§simple end user¡¨ all the information.
I am tired of reading endless verbose ramblings by want-to-be intellectuals in an attempt for 2nd rate fame.

Quote ¡V ¡§sarcasm, one more service I offer..¡¨ ¡V rmckinle

2nd Quote ¡V ¡§please go away. We don¡¦t need, or want you here.¡¨waaaaaa - high_jeeves

high_jeeves
12-09-2002, 01:40 PM
You have some serious emotional problems that should be looked into.

--Jeeves

rmckinle
12-09-2002, 02:05 PM
Unable to control the Id, Ego, and Superego???

Your choice of words is equally impressive (lol) and serves as a splendid counterpart to my bold symbolism. Maybe the dynamics of your human psyche or maybe Vulcan psyche will easily understand this warm gesture:

/¯/)
/¯ /
/ /
/´¯`/' '/´¯¯`•¸
/'/ / / /¨ /¯\
('( ´ ´ ¯-/' ')
\ ' /
'\' \ _.•'
\ (
From all of me to all of you, Happy holidays!

MisterSpock
12-09-2002, 02:42 PM
Heh...

rmckinle:

I wrote the post to help the dozens of people who don't know very much about networking and want to learn something.

We get a couple of "My SEQ box isn't seeing any packets" help requests every week. Rather than just telling them to "go get a hub," I wanted to explain a little bit about WHY.

Also -- I certainly hope you didn't get the impression that I was saying that hubs are better than switches! In fact, I spent a lot of time explaining why switches are technically superior. Of course, a switch with the proper features properly set up is a better solution. However, not everyone on here can configure a switch for this, and many cannot afford one (even on E-bay). Had I truly wanted to leave folks in the dark, I would not have mentioned anything about port mirroring (a feature most "small, home class" switches lack). I specifically *included* some lower-cost switches that can perform the task.

So -- I must ask -- what, beyond trolling, is your point? If you disagree with the technical information or the conclusions in the post, please feel free to write a well-constructed counter opinion.
Did you find that the post was too simplistic? If so, perhaps you can suggest, or even author, a tutorial on a more advanced subject. I will be glad to respond to anything that you feel needs additional attention.

rmckinle
12-10-2002, 11:40 AM
Nope thanks, that's just what I wanted to hear.
Thanks...

lane
12-10-2002, 04:12 PM
Great guild MisterSpock. I've spent the better part of the last 12 year explaning to people these differences. I was VERY sceptical that you would get it right and be cohearent but you did a great job.

Another shocker for your list: Layer 3 switchs are multiport routers

Good job again MisterSpock. I'm impressed and that doesn't happen much in the networking world with me. :)

-Lane

MisterSpock
12-10-2002, 06:59 PM
Thanks, lane! I'm glad you enjoyed the post.

And you're absolutely correct -- a L3 switch takes the functionality of a traditional (aka, L2, Layer 2) switch, but adds a layer 3 (network layer) component that allows it to route between VLANs.

The VLANs (virtual LANs) are nothing more than logical groupings of ports. In the case of an L3 switch, unlike a traditional L2 switch, the VLAN can be associated with a Layer 3 network number & address. Within a VLAN, the L3 switch provides switching functionality. From one VLAN to another, the L3 switch routes (in effect, a multi-port router) -- all in one nifty box.

Nifty, yes... Inexpensive, ummm... not usually. :)

MisterSpock
12-11-2002, 03:19 PM
-- a minor clarification to my post about L3 switches and multiport routers.

A router can have multiple ports and not be an L3 switch. It is only considered a L3 switch if it has the capability to switch AND route.

Cryonic
12-11-2002, 04:18 PM
Interesting read. You might want to think about editing the original post to include your follow-up comments. Keeps all the information in this thread in the main posting. :)