Download Switching and Forwarding

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Deep packet inspection wikipedia , lookup

Network tap wikipedia , lookup

CAN bus wikipedia , lookup

Zero-configuration networking wikipedia , lookup

IEEE 802.1aq wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

Multiprotocol Label Switching wikipedia , lookup

RapidIO wikipedia , lookup

IEEE 1355 wikipedia , lookup

Parallel port wikipedia , lookup

Asynchronous Transfer Mode wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

Spanning Tree Protocol wikipedia , lookup

Telephone exchange wikipedia , lookup

Packet switching wikipedia , lookup

Transcript
Switching and Bridging
Textbook Ch3.1 and 3.4
Professor: Munehiro Fukuda
CSS432: Switching and Bridging
1
Scalable Networks

Why switches



Connects two or more network segments (>2500m in Ethernet)
Support large numbers of hosts (>1024 hosts in Ethernet)
Maintain performance (>two packets through a switch)
Network Switches
Packet Switch
Circuit Switch
TDM
FDM
virtual
Connectionless
IP datagrams
Connection Oriented
ATM
X25
Dynamic
DTM
Dynamically reallocate bandwidth
CSS432: Switching and Bridging
Static
SONET
Frame sent over optics in synchronization
with atomic/satellite clock
2
Three Approaches

Datagram/connectionless switching
 IP

Virtual circuit/connection-oriented switching
 X.25
 ATM

(Asynchronous Transfer Mode)
Source routing
 Connection
requests in virtual circuit
CSS432: Switching and Bridging
3
Datagram Switching




No connection setup phase
Each packet forwarded independently
Analogy: postal system
Host D
Each switch maintains a
forwarding (routing) table
0 Switch 1
3
Table at Switch 2
Dest
Port
A
3
B
0
C
3
D
3
E
2
F
1
G
0
H
0
Host C
Host E
Host F
1
2 Switch 2
2
3
1
0
Host A
Host G
1
0 Switch 3 Host B
3
2
Host H
CSS432: Switching and Bridging
4
Datagram Switching (Cont’d)

No connection setup


No way of knowing if a packet is delivered.


Pros 1: A source can send data as soon as it is ready.
Cons 1: A source must estimate network congestion or
disconnection.
Each packet may take a different route.


Pros 2: No signle point of failure happens.
Cons 2: The order of packets at destination is different from
that at source.
CSS432: Switching and Bridging
5
Virtual Circuit Switching




Explicit connection setup (and tear-down) phase
Subsequence packets follow same circuit
Analogy: phone call
Each switch maintains
a VC table
0 Switch 1
1
3
VCI = 11
2
5
3
VCI = 5
11
Switch 1
Switch 2
Switch 3
VCI
Port (out)
VCI
2
5
1
11
Port (in)
VCI
Port (out)
VCI
3
11
0
7
Port (in)
VCI
Port (out)
VCI
0
7
3
4
0
VCI = 7
Host A
Port (in)
2 Switch 2
1
7
1
0 Switch 3
VCI = 4
3
4
Host B
2
Question:
It seems like the left table needs
only incoming and outgoing port
pairs….
Why do we need VCI?
CSS432: Switching and Bridging
6
Virtual Circuit Switching (Cont’d)

Global address information is
replaced with local VCI.

Host D
Host E
0 Switch 1
Each switch has local but not global
information.
3
2 Switch 2
Host C

VCI=5 2
VCI=6
To set up connection:

Each switch still needs a global view
of network configuration to forward a
connection request message to
destination
Port (in)
VCI
Host F
VCI=11
1
3
1
VCI=12
0
Host A
VCI=7
VCI=8
Port (out)
VCI
Host G
Switch 1
Switch 2
Switch 3
2
5
1
11
2
6
1
12
Port (in)
VCI
Port (out)
VCI
3
11
0
7
3
12
0
8
Port (in)
VCI
Port (out)
VCI
0
7
3
4
0
8
2
4
CSS432: Switching and Bridging
1
0 Switch 3 Host B
VCI=4
3
2VCI=4
Host H
7
Virtual Circuit Model (Cont’d)

Connection setup required




Pros 1: An opportunity to reserve resources (QoS)
Cons 1: Wait for a full RTT before sending first data packet.
Cons 2: Full address for destination still required for connection.
Packets sent along the same route



Pros 2: Each data packet contains only a VCI.
Pros 3: Flow control possible along the entire connection
Cons 3: If the connection is broken, a new one needs to be
established.
CSS432: Switching and Bridging
8
Source Routing

Each packet has a complete switching information from
source to destination

Three ways to maintain
switching information:
 Rotation
 Striping
 Use of a pointer
3
Useful to send a
connection setup request
in VC

0 Sw itch 1
3
0
1
3
2 Sw itch 2
2
0 1
3
1
1
2
1 3 0
0
Host A
0 1 3
1
0 Sw itch 3
3
2
CSS432: Switching and Bridging
Host B
9
X.25
Source Routing and Virtual Circuit Switching
Call request/Idle mode/call clearing
0 0 0 1
group
0 0 modulo
Call request
channel
type
Data packet
group
channel
receive sequence send sequence
1
control
caller address length callee address length
caller address (up to 14bits)
callee address (up to 14bits)
Higher Layer Protocol
3 bits: country code
1 bit: network code
10 bits: address
4K channels
Why sequence#?
1.
Sliding window
2.
Error recovery
Data
Source VCI Call request
Call accept
Destination VCI
DTE/DCE
CSS432: Switching and Bridging
10
Bridges and Extended LANs

Connecting two or more LANs
 Repeater / Hub


L1: Physical Layer
Limitations: <= 2500m and <= 1024 nodes
destination
R
R
R
R
QuickTi meý Dz
T I FFÅ i î Òà•
è kÅ j êLí £É vÉ çÉ OÉ âÉ Ä
ǙDZÇÃ É sÉ NÉ `É É Ç¾ å©ÇÈ ÇžÇ½ Ç…ÇÕï K óvÇ­Ç •
ÅB


Bridge (or LAN switch)




destination
L2: Datalink Layer
Fowarding frames using MAC address
Static configuration + partial dynamic
configuration (Spanning Tree Protocol)
B
B
B
B
QuickTi meý Dz
T I FFÅ i î Òà•
è kÅ j êLí £É vÉ çÉ OÉ âÉ Ä
ǙDZÇÃ É sÉ NÉ `É É Ç¾ å©ÇÈ ÇžÇ½ Ç…ÇÕï K óvÇ­Ç •
ÅB
Router



destination
L3 – Network Layer
Routing IP packets using IP address
Dynamic configuration
CSS432: Switching and Bridging
R
R
R
R
QuickTi meý Dz
T I FFÅ i î Òà•
è kÅ j êLí £É vÉ çÉ OÉ âÉ Ä
ǙDZÇÃ É sÉ NÉ `É É Ç¾ å©ÇÈ ÇžÇ½ Ç…ÇÕï K óvÇ­Ç •
ÅB
11
Learning Bridges

Do not forward when unnecessary


Ex. A frame sent from A to B
Maintain forwarding table
A
B
Based on datagram switching
C
Port 1
Bridge
Port 2
X



Z
Port
1
1
1
2
2
2
Learn table entries based on source address


Y
Host
A
B
C
X
Y
Z
E.g. An entry for A is registered upon receiving a frame from A
E.g. When receiving a frame from B, don’t forward to Port 2
Table is an optimization; need not be complete
Entries are expired after a specific period of time

Linux brctl command: makes a logical bridge with max age = 4sec
CSS432: Switching and Bridging
12
STP: Spanning Tree Protocol

A
Loops

Example:
 B1 receives a frame from Node X on
LAN H to Node Y on LAN C.
 B1 registers an entry for Node X but not
yet Node Y.
 B1 forward this frame to all ports except
to LAN H.
 B7 receives the frame and forwards it to
LAN B.
 B5 forwards it to LAN A and D.
 B1 receives again this frame and
registers an entry for X.
 B1 forwards it to all ports except to LAN
H and D.
 Problem:
 Node Y eventually receives a frame.
 Duplicated frames are forwarded along
loops.

B
B3
C
Y
B5
D
B7
B2
E
K
F
B1
X
G
B6
H
B4
I
J
Spanning Tree Algorithm

Inactivate bridge ports so that no cycle exists
in extended LAN
 IEEE 802.1 Specification
CSS432: Switching and Bridging
13
STP Details





Bridges exchange configuration messages (Y, d, X)
 Y: the id of root to be
 d: #hops from X to Y
A
 X: the sending bridge id
Initially, each bridge believes it is the root
2 hops B3
When learn not the root, stop generating
C
configuration messages
(1, 1, 2)
 in steady state, only the root
B2
1 hop
generates messages
E
When learn not a designated bridge, stop
forwarding configuration messages
 in steady state, only designated
G
bridges forward configuration
messages
B6
1 hop
If any bridge does not receive
I
configuration message after a period of
time, it starts generating configuration
messages claiming to be the root.
CSS432: Switching and Bridging
B
(1, 1, 5)
B5
D
1 hop
B5 < B7
1 hop
B7
K
(1, 0, 1)
F
(1, 0, 1)
B1
(1, 0, 1)
root
H
1 hop
B4 < B6
B4
J
14
Cell Switching (ATM)






Connection-oriented packet-switched network
Used in both WAN and LAN settings
Packets are called cells
 5-byte header + 48-byte payload (easier to switch, high
frame utilization fro small data)
Commonly transmitted over SONET
Error collection
 End-to-end but not at each switch (i.e., at data link layer)
Congestion control
 Admission control
 Leaky packet transfer
CSS432: Switching and Bridging
15
Switch Implementation

Using a workstation
 Flexible
control
 Performance problem

Using a custom hardware
 Shared/share
memory-based switch
 Crossbar switch
 Self-routing switch (Batch Banyan switch)
CSS432: Switching and Bridging
16
Workstation Used as a Switch
Workstation
CPU
I/O
ctlr
Main memory


NIC
LAN A
NIC
LAN B
NIC
LAN C
I/O Bus
Advantage: flexible because a workstation has a CPU.
Example

33MHz 32bit I/O bus




1Gbps for one way from NIC to main memory
500Mbps for a round trip between NIC and main memory
Enough to support five 100Mbps Ethenet
What if a packet is very small like 64byes


The workstation has 500,000 packets per second (pps).
Throughput: 500,000 x 64 x 8 = 256Mbps
CSS432: Switching and Bridging
17
Shared Bus/Memory-Based Switch
Control
processor
Input Port
Input Port
Input Port
Shared bus
DMA from port to port
Output Port
Output Port
Output Port
Shared memory


A simple design
Shared bus or memory becomes a bottleneck. (Max. 16 bus masters)
CSS432: Switching and Bridging
18
Crossbar Switch


Without a collision, all inputs delivered to each output
All inputs may go to the same output which causes a
collision in the output buffer.
CSS432: Switching and Bridging
19
Crossbar + Knockout Switch
L=3
Round-robin
N=4
Knockout Switch


Knockout switch: buffers only L out of N packets, where L < N. Ex. L =8 is
sufficient. 1 packet loss per million for a large N. (logarithmically in the loss rate)
Detailed explanation:
http://www.laynetworks.com/Knockout%20Switch.htm
CSS432: Switching and Bridging
20
Banyan Switch
001
0
0
011
110
111
1
001
1
011
001
000
000
001
0
1
111
110
110
110
111
111


2 x 2 switching elements interconnected in regular patterns.
Collisions occur if packets are not presented in ascending order
CSS432: Switching and Bridging
21
Batcher Network + Banyan Switch
001
000
000
000
001
001
∞
∞
110
110
111
111
111
∞
110
∞


Sort packets in ascending order through Batcher
network
Then switch them through Banyan switch
CSS432: Switching and Bridging
22

Reviews
 Datagram
switching
 Virtual Circuit switching
 Source routing
 Bridges: STP and limitations
 Switches: workstation-based, shared bus/memory-based,
crossbar + (knockout), and (batcher network) + banyan

Exercises in Chapter 3
 Ex.
1 (vc sw)
 Ex. 4 (datagram sw)
 Ex. 13 (STP)
 Ex. 26,32 (Switch implementation)
CSS432: Switching and Bridging
23