EE 122: Switching and Forwarding
description
Transcript of EE 122: Switching and Forwarding
![Page 1: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/1.jpg)
EE 122: Switching and Forwarding
Kevin Lai
September 23, 2002
![Page 2: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/2.jpg)
Direct Link Network Review
Data link layer presents a single media (e.g., single wire) network model
Problem and solutions- Framing
• character stuffing, byte counting, bit stuffing, clocked framing
- Error detection
• parity, checksum, CRC
- Reliability
• stop and go, sliding window
- solutions also apply to similar problems in higher layers
• problems can not be completely solved at data link layer
• only implemented in data link layer as optimization
![Page 3: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/3.jpg)
Limitations of Direct Link Networks
distance- distance increases propagation delay- large propagation delay causes large coordination delay- e.g., Ethernet collision detection requires 2*prop_delay
number of hosts- More hosts increases the probability of collisions- collisions decrease efficiency of link
bandwidth- bandwidth of link is shared among all connected nodes
single media type- different media (e.g., fiber, Ethernet, wireless) have
different tradeoffs for performance, cost, etc.
![Page 4: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/4.jpg)
Direct Link Networks v.s. Switching
Direct Link Network Switched Network
Single link
n links
Switch Emulatesclique
![Page 5: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/5.jpg)
Definitions
switch (aka bridge)- does switching- operates at data link layer- router also does switching, but at network layer
switching consists of- forwarding
• read data from input links,• decide which output link to forward on, and
examine packet header or incoming circuit, and look up in forwarding table
• transmit it on one of the output links (unicast)- routing
• how the switch/router builds up its forwarding table
![Page 6: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/6.jpg)
Properties
spans larger physical area than direct link network (DLN)
- can connect multiple switches together
supports more hosts than DLN- hosts on separate links can transmit at same time
higher aggregate bandwidth than DLN- approaches (n/2)*b instead of b, n = number of
switched links, b = bandwidth of one link
supports more than one media type- more expensive for bridge than router
![Page 7: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/7.jpg)
Bridge/Router Comparison
Router interconnects different link layer protocols more easily
Ethernet
802.11b
ATM
SONET
Ethernet
802.11b
ATM
SONET
E-to-8
E-to-AE-to-S
O(n2) convertersn = different link types
Ethernet
802.11b
ATM
SONET
Ethernet
802.11b
ATM
SONET
Switch Router
O(n) converters
E-to-IP IP-to-E
8-to-IP
S-to-IP
A-to-IP
IP-to-8
IP-to-S
IP-to-A
E-to-E
![Page 8: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/8.jpg)
Forwarding Techniques
packet switching- aka [packet|datagram|connectionless] [switching|
forwarding]
source routing virtual circuit switching
- aka virtual circuit forwarding
circuit switching despite names, all ways for switch to decide
which output port to forward data
![Page 9: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/9.jpg)
Packet Switching
Data is separated into packets Each packet is forwarded independently of
previous packets- packets between two hosts can follow different paths
On link failure, adjoining switches select new route and continue forwarding packets
Statistical multiplexing- any one host may use 100% of a link’s bandwidth
![Page 10: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/10.jpg)
Statistical Multiplexing v.s. Resource Reservations
Reserve explicit amount of resources (e.g., bandwidth)- get exactly that amount
Statistical multiplexing: get whatever is available
.
.
. S
H9
H010Mb/s / 10Mb/s
...
...Sta
tistic
al
Mu
ltip
lexi
ng
Re
sou
rce
Re
serv
atio
n s
Advantage Problem
10Mb/s... S
H9
H0
congestion,packet loss
...
...
10Mb/s
10Mb/s
10Mb/s 10Mb/s
10Mb/s
.
.
. S
H9
H0 ...
...
1Mb/s
1Mb/s
10Mb/s
1Mb/s
.
.
. S
H9
H0 ...
...
1Mb/s
1Mb/s
10Mb/s
0Mb/s
10Mb/s / 10Mb/s
10Mb/s / 10Mb/s
1Mb/s / 10Mb/s
low utilization
![Page 11: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/11.jpg)
Packet Switching Operation
Each switch maintains a forwarding table- forwarding entry: (address, output port)
Upon packet arrival - input port forwards the packet to the output port
whose address matches packet’s destination address
• exact match
longest prefix match- forwarding entry: (address prefix, output port)
- forward packet to the output port whose address matches packet’s destination address in the longest number of bits
2
12.xxx.xxx.xxx 1
12.82.xxx.xxx
1128.16.120.111
1
2128.16.120.111
12.82.100.101
![Page 12: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/12.jpg)
Packet Switching Properties
Expensive forwarding- forwarding table size depends on number of different
destinations
- must lookup in forwarding table for every packet
Robust- link and router failure may be transparent for end-hosts
High bandwidth utilization- statistical multiplexing
No service guarantees- Network allows hosts to send more packets than
available bandwidth congestion dropped packets
![Page 13: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/13.jpg)
Source Routing
Each packet specifies the sequence of routers, or alternatively the sequence of output ports, from source to destination
1234
1234
1234
1234
1234
1234
4
source
3 4
4 3 44 3 4
![Page 14: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/14.jpg)
Source Routing (cont’d)
Gives the source control of the path Not scalable
- Packet overhead proportional to the number of routers
- Typically, require variable header length which is harder to implement
Hard for source to have complete information Loose source routing sender specifies only a
subset of routers along the path
![Page 15: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/15.jpg)
Virtual Circuit (VC) Switching
Packets not switched independently- establish virtual circuit before sending data
Forwarding table entry- (input port, input VCI, output port, output VCI)
- VCI – Virtual Circuit Identifier
Each packet carries a VCI in its header Upon a packet arrival at interface i
- Input port uses i and the packet’s VCI v to find the routing entry (i, v, i’, v’)
- Replaces v with v’ in the packet header
- Forwards packet to output port i’
![Page 16: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/16.jpg)
VC Forwarding: Example
1234
1234
1234
1234
1234
1234
5
……114
……
…3
…
in outin-VCI
11
out-VCI
…
…
5
…… 73
……
…2
…
in outin-VCI out-VCI
…
…
11
7
……14
……
…1
…
in outin-VCI out-VCI
…
…
7
1
sourcedestination
![Page 17: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/17.jpg)
VC Forwarding (cont’d)
A signaling protocol is required to set up the state for each VC in the routing table
- A source needs to wait for one RTT (round trip time) before sending the first data packet
Can provide per-VC QoS- When we set the VC, we can also reserve bandwidth
and buffer resources along the path
![Page 18: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/18.jpg)
Virtual Circuit Switching Properties
Less expensive forwarding- forwarding table size depends on number of different
circuits
- must lookup in forwarding table for every packet
Much higher delay for short flows- 1 RTT delay for connection setup
Less Robust- end host must spend 1 RTT to establish new
connection after link and router failure
Flexible service guarantees- either statistical multiplexing or resource reservations
![Page 19: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/19.jpg)
Circuit Switching
Packets not switched independently- establish circuit before sending data
Circuit is a dedicated path from source to destination
- e.g., old style telephone switchboard, where establishing circuit means connecting wires in all the switches along path
- e.g., modern dense wave division multiplexing (DWDM) form of optical networking, where establishing circuit means reserving an optical wavelength in all switches along path
No forwarding table
![Page 20: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/20.jpg)
Circuit Switching Properties
Cheap forwarding- no table lookup
Much higher delay for short flows- 1 RTT delay for connection setup
Less robust- end host must spend 1 RTT to establish new
connection after link and router failure
Must use resource reservations
![Page 21: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/21.jpg)
Forwarding Comparison
pure packet switching
virtual circuit switching
circuit switching
forwarding cost
high low none
bandwidth utilization
high flexible low
resource reservations
none flexible yes
robustness high low low
![Page 22: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/22.jpg)
Routing
Update forwarding/routing tables Manual configuration
- simple, error prone, work for administrator
Learning bridges- all that is needed for single bridge
Spanning Tree- necessary for multiple bridges
Described in internetworking section- Distance Vector
- Link State
![Page 24: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/24.jpg)
Learning Bridge Problem
B0
B1
B2
B3
H0H1
Host Port
Host Port
Host Port
Host Port
0 1
2
1
0
2
0
1
0
1
H1 H0
H1 H0
H1 H0
Host Port
H1 0
Host Port
H1 1
Host Port
H1 2
H1 H0H1 H0
Host Port
H1 0
Host Port
H1 1
H1 H0
H1 H0
![Page 25: EE 122: Switching and Forwarding](https://reader035.fdocuments.net/reader035/viewer/2022062323/5681582e550346895dc5943a/html5/thumbnails/25.jpg)
Summary
Switching- overcome limitations of direct link networks
Forwarding techniques- packet switching
- source routing
- virtual circuit switching
- circuit switching
Routing techniques