You are on page 1of 19

CS 305 Computer Network 1

Lecture 4: Network Devices

NUB, 2020
Credits to Prof. Jennifer Rexford, Department of Computer Science,
Princeton University, and Carlos Vicente
University of Oregon 1
Network Devices
• There are Three main devices are used in computer
networks; each works in a layer and deals with
different data.
Packets Router Layer 3: Network

Frames Switch Layer 2: Link

Electrical signals Hub Layer 1: Physical

• Hub and Switch → Build and expand LAN networks.


• Router → Connect LAN networks.

2
Hubs
• Hubs are multiport devices (e.g. 4 to 24 ports).
• Each port can be connected to a single host (e.g. a
computer) or another hub or switch.
• A frame sent at one interface is sent to all other interface.
• Hub is Half-Duplex.
• Distance of any node to hub must be < 100m.

Hub

3
Hub Limitations
• Hub has one collision domain
— collision domain is part of the network where
a frame from a host can collide with another.
• Channel capacity is shared
— For example, three departments each get 10
Mbps independently but when connected via
a hub they share 10 Mbps)
• Cannot support multiple LAN speeds
— because they do not buffer frames.

4
Switch
• It is a smart hub; it forwards messages to a
specific host by looking in its forwarding table.
• The table maps destination MAC address to
outgoing interface.

Switch
Forwarding Table
Address Port
AAAAAAAAAAAA 1

BBBBBBBBBBBB 5

A C D B
5
Advantages of Switch
1. Full duplex: at each port, host can both send and
receive from the switch at the same time.
2. Support concurrent communication
— Host A can talk to C, while B talks to D
3. Reduces collisions; each port is a separate collision
domain.
4. Utilize full bandwidth.
5. Can connect LANs with different speeds (e.g., 10
and 100 Mbps).
6. Improves privacy by limiting scope of frames.
6
Example
• In the following network, there are 4 collision
domains.
• Each switch interface has its own capacity
(bandwidth) which is not shared with other
channels.
Hub 3.3Mbps
10Mbps
Switch 3.3Mbps
3.3Mbps
10Mbps
10Mbps

10Mbps 7
Switching Techniques
• Store and Forward:
— When a switch receives a frame, it stores the whole
frame before deciding where to forward it. This
introduces some delay.
• Cut-through:
— A frame is forwarded from input to output port as
soon as the frame header is inspected and the
destination address is extracted without awaiting for
assembly of entire frame.
— Cannot detect corrupted frames.
— Best suited for small workgroups.
8
Self Learning
• A switch must be able to construct its forwarding table
automatically → Self Learning:
—When a frame arrives, inspect the source MAC address
—Associate the address with the incoming interface
—Store the mapping in the switch table

A C

Switch learns
how to reach A. D 9
Self Learning: Handling Misses
• If destination MAC is not in the MAC table, it floods
the network (send the frame to all ports except for the
one where the frame arrived) looking for a response
• Only the host with the correct MAC address will
respond
—Hopefully, this case won’t happen very often
B

A C
When in
doubt,
shout!
D 10
Switches and Broadcast
• A switch broadcasts frames:

—When the destination address is not found in


the table

—When the frame is destined to the broadcast


address (FF:FF:FF:FF:FF:FF)

11
Virtual LANs
• In any company, changes are frequent

— faculty office becomes a grad-student office

— graduate student becomes a faculty member

• Physical rewiring is a major pain; it is more


preferable to “rewire” the building in software.

• Virtual local area network (VLAN) group users


based on organizational structure, rather than
the physical layout of the building.
12
Virtual LANs
• Switches can logically group together some
ports to form a VLAN.
• Only members of a VLAN can see that VLAN’s
traffic. This improves security.
Switch
VLAN X VLAN Y

VLAN X nodes VLAN Y nodes


A switch using VLAN software 13
VLANs across switches
• VLANs can be configured across switches. In order for
two switches to exchange traffic from one or more
VLANs, the inter-switch links must be configured as
trunks, carrying frames from all VLANs.
• Each frame carries a tag that identifies which VLAN it
belongs to (The 802.1Q IEEE standard).
Tagged Frames

Trunk Port Trunk


VLAN X VLAN Y VLAN X VLAN Y
Edge Ports

14
Router
• Router is used to connect different LANs
together and connect your LAN to the Internet.
• It directs packets based on the destination IP
address.
• Routers build routing tables; switches build MAC
tables

15
Traffic Domains
• Routers do not forward Ethernet broadcasts.
Router

Switch Switch

Hub Hub Hub Hub

Collision Domain
Broadcast Domain
16
Traffic Domains
• Switches reduce the collision domain size
—Try to eliminate collision domains by getting rid of
hubs!
• Routers reduce the broadcast domain size
—Segment your network using routers
—Try to keep your broadcast domain limited to no more
than 250 simultaneously connected hosts

Hub Switch Router

Traffic isolation No Yes Yes


Plug and Play Yes Yes No
17
Network Design Guidelines
• Always connect hierarchically
—Locate edge switches close to users (e.g. one per floor)
• Max length for Cat 5 is 100 meters
—If there are multiple switches in a building, use an
aggregation switch
—Locate the aggregation switch close to the building
entry point (e.g. fiber panel)
• Document where your switches are located
—Name switch after building name,
• Document your edge port connections,
—Room number, jack number, server name

18
Example
• The following figure shows an institutional network
using a combination of hubs, Ethernet switches and a
router. Note the hierarchy!

Web Server

Mail server

19
https://www.net.t-labs.tu-berlin.de/teaching/computer_networking/05.06.htm

You might also like