Sie sind auf Seite 1von 17

Switching and Forwarding

7/26/2013

BEE8B Computer Networks

COTS Ethernet
Ethernet has a bus topology

Host
Host

NIC NIC

Host NIC

Hub: An out-of-the box bus


BEE8B Computer Networks 2

7/26/2013

Switched LANs
Use a device that can interconnect pairs of hosts, which can communicate concurrently.

Host
Host

NIC NIC

Host NIC

Switch: no shared medium; allows for more than one pair to talk at the same time.

7/26/2013

BEE8B Computer Networks

Switches
Connected to a set of links: each one runs a data-link (layer 2) protocol. Primary job: receive incoming packets from one link and output them to the appropriate link. Each input or output is a port (bidirectional). Question: How does a switch decide what output port to use? Alternatives: Datagrams, Virtual circuit, Source routing.
7/26/2013 BEE8B Computer Networks 4

Datagrams
Host D

Destination

Port

0 3 Host C 2

A B C D E F G H

3 0 3 3 2 1 0 0

Switch 1 1 3

Host E Host F 2 Switch 2 1 0

Host A

Host G 1

0 Switch 3 3 2

Host B

Host H

Connectionless: Each datagram is forwarded on its own.


BEE8B Computer Networks 5

forwarding table for switch 2


7/26/2013

Connectionless Networks
A host can send a packet anywhere, anytime. When a packet is sent, it is not known whether the network can deliver it. Each packet is forwarded independently of other packets that may have gone to the same destination. A switch or link failure is no big deal: an alternate route can be found and the forwarding table updated.
7/26/2013 BEE8B Computer Networks 6

Virtual Circuit Switching


0

Establish a connection between source and destination before any data is communicated.

3 0 3 2 1 Switch 1 3 2 0 1 Switch 2 2

0 3 2 Switch 3 1 Host B

Host A

Two part process: (1) Connection setup

Virtual Circuit Table: virtual circuit identifier incoming interface outgoing interface [a different VCI for outgoing packets]

(2) Data transfer

7/26/2013

BEE8B Computer Networks

Source Routing
The sender of a packet knows the precise route that will take data across the network, all the way to the destination host.
3 0 Switch 1 1 2 3 0 1 1 3 0 0 3 2 Switch 2 1 0 3 2 1

Host A

Each packet carries with it the entire route from source to destination with port numbers.

0 1 3 1 0 Switch 3 3 Host B 2

7/26/2013

BEE8B Computer Networks

Implementation Approaches for Source Routing


Header entering D C B A switch D C B A Ptr D C B A

Header leav ing switch

A D C B (a)

D C B (b)

Ptr D C B A (c)

(a) Rotate ids on the packet header so that the next hop is always at the head.
(b) Strip ids from the packet header after the corresponding links have been traversed. (c) Keep the route always in the same order and indicate the next hop with a pointer that serves as index in the route.
7/26/2013 BEE8B Computer Networks 9

Bridges and LAN Switches

7/26/2013

BEE8B Computer Networks

10

Bridges
You want to interconnect two Ethernets. You could use repeaters as we discussed previously:

LAN 1
Port 1 Bridge Port 2

LAN 2

Question: Is this solution always going to work? Why not?


7/26/2013

You could also use bridges, i. e. special multiport nodes or switches that can forward packets from one LAN to the other.
11

BEE8B Computer Networks

Learning Bridges
A B C

LAN 1
Port 1 Bridge Port 2

Host A LAN 2 B C X

Port 1 1 1 2 2 2

Y Z

Question: Does a bridge need to forward all the packets it receives? Question: Do you need human intervention to configure the bridge? How could it be automated?

Questions: What should the bridge do if it receives a packet to a destination it doesnt know?
7/26/2013

A bridge can inspect all the packets it receives; looking at the source addresses it receives, it can map hosts to ports building a table like the one above.
Questions: How many entries should the bridge have? Should it keep entries forever after created?
12

BEE8B Computer Networks

Spanning Tree
A B B3 C D B5 B2 E B7 F K

B1 G H

Extended LANs can have cycles because either they were built without global knowledge or for the sake of having redundant paths between LANs.

B6 I

B4 J

A B B3 C D B5 B2 E B7 F K

B1 G H

In order to populate routing tables so that packets dont end up looping forever, first we have to remove cycles from the network graph and find a spanning tree.
13

B6 I

B4 J

7/26/2013

BEE8B Computer Networks

Spanning Tree Algorithm


A B B3 C D B5 B2 E B7 F K

Question: How can you find a spanning tree of a graph if you dont know the full graph?
Bridges have ids, just as nodes do. When a bridge is started up, it exchanges configuration messages with others and elects one bridge to be the root of the spanning tree. Initially every bridge thinks its the root and sends out configuration messages on all its ports. When it starts receiving messages from other bridges, it checks to see if the new message improves the configuration recorded for that port.
BEE8B Computer Networks 14

B1 G H

B6 I

B4 J

configuration message (1) id of sender bridge (2) id of believed root (3) distance in hops to root
7/26/2013

Spanning Tree Algorithm


A B B3 C D B5 B2 E B7 F K

A message is considered better than the recorded info if: it ids a root with smaller id or it ids a root with equal id but shorter distance or

B1 G H

B6 I

B4 J

the root id and distance are equal, but the sending bridge has smaller id.

Before updating the info with the received message, the bridge adds 1 to the hop count.
When a bridge discovers it is not the root, it stops sending out messages of its own (only forwards those from other bridges after adding 1 to the hop count).

7/26/2013

BEE8B Computer Networks

15

Spanning Tree Algorithm


A B B3 C D B5 B2 E B7 F K

When a bridge discovers its not the designated bridge for that port, it stops sending configuration messages over that port. Eventually, the system stabilizes: only the root sends out configuration messages and the other bridges only forward them around.

B1 G H

B6 I

B4 J

7/26/2013

BEE8B Computer Networks

16

Broadcast and Multicast


Broadcast messages should still reach all the nodes in the extended LAN. Multicast messages should reach all the nodes in a multicast group independently of the LAN to which the nodes belong.

Question: How can one implement these kinds of messages on the extended LAN?
7/26/2013 BEE8B Computer Networks 17

Das könnte Ihnen auch gefallen