Hubs switches-routers

31
Hubs, Routers, and Switches B538 / Spring 2003

description

 

Transcript of Hubs switches-routers

Page 1: Hubs switches-routers

Hubs, Routers, and Switches

B538 / Spring 2003

Page 2: Hubs switches-routers

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

Page 3: Hubs switches-routers

A Hub in Action

Page 4: Hubs switches-routers

A Hub in Action

Page 5: Hubs switches-routers

A Hub in Action

Page 6: Hubs switches-routers

Advantages of Hubs

• Easy to Understand

• Easy to Implement

• …so they’re cheap

Page 7: Hubs switches-routers

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

Page 8: Hubs switches-routers

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

Page 9: Hubs switches-routers

Basic Switching Algorithm

• Maintain data structure called the switch forwarding table

• The forwarding table is indexed by MAC address and contains port numbers

Page 10: Hubs switches-routers

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

Page 11: Hubs switches-routers

A Switch in Action

Page 12: Hubs switches-routers

A Switch in Action

Page 13: Hubs switches-routers

A Switch in Action

Page 14: Hubs switches-routers

A Switch in Action

Page 15: Hubs switches-routers

A Switch in Action

Page 16: Hubs switches-routers

A Switch in Action

Page 17: Hubs switches-routers

A Switch in Action

Page 18: Hubs switches-routers

A Switch in Action

Page 19: Hubs switches-routers

A Switch in Action

Page 20: Hubs switches-routers

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

Page 21: Hubs switches-routers

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

Page 22: Hubs switches-routers

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)

Page 23: Hubs switches-routers

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!

Page 24: Hubs switches-routers

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

Page 25: Hubs switches-routers

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

Page 26: Hubs switches-routers

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

Page 27: Hubs switches-routers

Longest-Prefix Match

Page 28: Hubs switches-routers

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…

Page 29: Hubs switches-routers

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

Page 30: Hubs switches-routers

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

Page 31: Hubs switches-routers

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