Hubs switches-routers
-
Upload
mohammed-faris-majeed -
Category
Technology
-
view
140 -
download
0
description
Transcript of Hubs switches-routers
Hubs, Routers, and Switches
B538 / Spring 2003
Hubs
• Operate at layer 2 of the network– Data link layer– Ethernet
• Main purposes– Repeat traffic out all ports– Media conversion inside a LAN
• Two-port version often called a repeater
A Hub in Action
A Hub in Action
A Hub in Action
Advantages of Hubs
• Easy to Understand
• Easy to Implement
• …so they’re cheap
Disadvantages of Hubs
• Wasteful of bandwidth– Why should host B have to share its link with
a conversation between A and D?
• Poor security– Why should host B get to share its link with a
conversation between A and D?– “Packet sniffer” on one port can monitor the
traffic of all of the ports
• Can’t have redundancy
Switches
• Also operate at layer 2 of the network– Data link layer– Ethernet
• Main purposes– Repeat traffic out some ports– Media conversion within a LAN
• Often called a bridge
Basic Switching Algorithm
• Maintain data structure called the switch forwarding table
• The forwarding table is indexed by MAC address and contains port numbers
Basic Switching Algorithm
• Packet arrives on port P with source S and destination D
• Set Fwd(S)=P
• If we have an entry Fwd(D) and Fwd(D)<>P, then send packet out Fwd(D)
• Otherwise, flood packet out all ports
A Switch in Action
A Switch in Action
A Switch in Action
A Switch in Action
A Switch in Action
A Switch in Action
A Switch in Action
A Switch in Action
A Switch in Action
Advantages of Switches
• Better use of bandwidth– A lot of traffic is internal to a LAN– We can reduce congestion by quite a bit
• Better for security– Most traffic is delivered on a “need to see”
basis– This is not solid security– Switches can be hijacked
Advantages of Switches
• Allow for redundant connections– If all ports are active, redundant connections
cause a loop and destroy life as we know it– So switches run Spanning Tree Protocol
(STP) to superimpose a tree of active switch connections onto the graph of actual connections
– Redundant connections are put in “standby” status
A Common Switch Problem
• The memory for switch forwarding tables is expensive
• Most of the entries are on the port that faces the rest of the network
• Why not save memory by making a network uplink port that doesn’t learn any entries?
• This is a bad idea… (but it’s been done)
A Common Switch Problem
• Host A is on the local LAN
• Host B is somewhere on the Internet
• Host A hasn’t transmitted in a long time, so it’s not in the switch forwarding table
• Host B sends traffic to host A
• Because of the network uplink port, this packet is simply dropped
• Host A is invisible to the outside world!
Routers
• Operate at layer 3 of the network– Network layer– IP, IPX, Appletalk, etc.
• Main purposes– To connect multiple networks together– To enforce security policies
Internal Operation of Routers
• Basic job is to do longest-prefix matching against the routing table
• This is usually done in specialized hardware on the line cards themselves– ASICs (Application-Specific Integrated
Circuits)– Only complex decisions (bad packets, TTL
expired, etc.) are sent to the CPU
Longest-Prefix Match
• Most common method of doing longest-prefix match is a radix tree– Consider the network 156.56.103.0 with a
netmask of 255.255.255.0– Today, we write this as 156.56.103.0/24– Expressing this in binary, we get:
10011100 00111000 01100111 xxxxxxxx
– Use these bits to represent branches in a tree structure
Longest-Prefix Match
Longest-Prefix Match
• For speed, we usually use a higher radix (base) than 2
• Other algorithms are a matter of current research– Most of these trade space for efficiency
• This is one area where you could earn a lot of money very quickly…
VLANs
• VLANs are “virtual networks”
• Traffic internal to one VLAN isn’t visible to traffic on other VLANs even if it’s on the same switch
• Reduces the distribution of broadcast packets
• Enhances security within an enterprise
VLANs
• Defined by IEEE standard 802.1q
• Simply adds a new field to Ethernet frames containing a VLAN ID– Range is 1 to 4,094 (12 bits)– Range chosen to allow identified of “tagged”
packets– Older devices can have problems with tagged
traffic
VLANs
• All VLANs give you is “virtual hardware”
• There’s nothing that a VLAN does that you can’t do with more switches and routers
• This is really a way of more efficiently using resources, not a new technology