Switching and Forwarding 3 1 Switching and Forwarding

  • Slides: 71
Download presentation
Switching and Forwarding 3. 1 Switching and Forwarding 3. 2 Bridges and LAN Switches

Switching and Forwarding 3. 1 Switching and Forwarding 3. 2 Bridges and LAN Switches 3. 3 Cell Switching (ATM) 3. 4 Implementation and Performance

o Two limitations on the directly connected networks n limit on how many hosts

o Two limitations on the directly connected networks n limit on how many hosts can be attached, examples o only two hosts can be attached to a point-to-point link o the Ethernet specification allows no more than 1, 024 hosts

n limit on how large of a geographic area a single network can serve,

n limit on how large of a geographic area a single network can serve, examples o an Ethernet can span only 2, 500 m o wireless networks are limited by the ranges of their radios o point-to-point links can be quite long

o Goal n build networks that can be global in scale o Problem n

o Goal n build networks that can be global in scale o Problem n how to enable communication between hosts that are not directly connected o Solution n computer networks use packet switches to enable packets to travel from one host to another, even when no direct connection exists between those hosts

o Packet switch n a device with several inputs and outputs leading to and

o Packet switch n a device with several inputs and outputs leading to and from the hosts that the switch interconnects o Core job of a switch n take packets that arrive on an input and forward (or switch) them to the right output so that they will reach their appropriate destination

o A key problem that a switch must deal with is the finite bandwidth

o A key problem that a switch must deal with is the finite bandwidth of its outputs n if packets destined for a certain output arrive at a switch and their arrival rate exceeds the capacity of that output, then we have a problem of contention n the switch queues (buffers) packets until the contention subsides, but if it lasts too long, the switch will run out of buffer space and be forced to discard packets n when packets are discarded too frequently, the switch is said to be congested

3. 1 Switching and Forwarding o Switch n a multi-input, multi-output device, which transfers

3. 1 Switching and Forwarding o Switch n a multi-input, multi-output device, which transfers packets from an input to one or more outputs n star topology n switched networks are more scalable (i. e. , growing to large numbers of nodes) than shared-media networks because of the ability to support many hosts at full speed

A switch provides a star topology

A switch provides a star topology

Scalable Networks o The figure shows the protocol graph that would run on a

Scalable Networks o The figure shows the protocol graph that would run on a switch that is connected to two T 3 links and one STS 1 SONET link Example protocol graph running on a switch

o A switch forwards packets from input port to output port o Port selected

o A switch forwards packets from input port to output port o Port selected based on address in packet header o Advantages n cover large geographic area (tolerate latency) n support large numbers of hosts (scalable bandwidth)

Example switch with three input and output ports

Example switch with three input and output ports

o How does the switch decide on which output port to place each packets?

o How does the switch decide on which output port to place each packets? n general answer o it looks at the header of the packet for an identifier that it uses to make the decision n three common approaches o datagram (or connectionless) approach o virtual circuit (or connection-oriented approach) o source routing

3. 1. 1 Datagram Switching o Sometimes called connectionless model o Analogy: postal system

3. 1. 1 Datagram Switching o Sometimes called connectionless model o Analogy: postal system o No connection setup phase n no round trip delay waiting for connection setup n a host can send data as soon as it is ready

o Each packet is forwarded independently of previous packets that might have been sent

o Each packet is forwarded independently of previous packets that might have been sent to the same destination n two successive packets from host A to host B may follow completely different paths (perhaps because of a change in the forwarding table at some switch in the network)

o A switch or link failure might not have any serious effect on communication

o A switch or link failure might not have any serious effect on communication if it is possible to find an alternate route around the failure and to update the forwarding table accordingly o Since every packet must carry the full address of the destination, the overhead per packet is higher than for the connection-oriented model

o Source host has no way of knowing if the network is capable of

o Source host has no way of knowing if the network is capable of delivering a packet or if the destination host is even up and running o Each switch maintains a forwarding (routing) table

o Example n the hosts have addresses A, B, C, and so on n

o Example n the hosts have addresses A, B, C, and so on n a switch consults a forwarding table (routing table) to decide how to forward a packet

Datagram forwarding: an example network

Datagram forwarding: an example network

o The table shows the forwarding information that switch 2 needs to forward datagrams

o The table shows the forwarding information that switch 2 needs to forward datagrams Destination Port A 3 B 0 C 3 D 3 E 2 F 1 G 0 H 0

3. 1. 2 Virtual Circuit Switching o Sometimes called connection-oriented model o Analogy: phone

3. 1. 2 Virtual Circuit Switching o Sometimes called connection-oriented model o Analogy: phone call o Explicit connection setup (and tear-down) phase n it requires that a virtual connection from the source host to the destination host is set up before any data is sent o Typically wait full RTT (Round Trip Time) for connection setup before sending first data packet

o If a switch or a link in a connection fails n the connection

o If a switch or a link in a connection fails n the connection is broken and a new one needs to be established o Subsequence packets follow same circuit o Each switch maintains a Virtual Circuit (VC) table

o Entry in the VC table on a single switch contains n a virtual

o Entry in the VC table on a single switch contains n a virtual circuit identifier (VCI) o uniquely identifies the connection at this switch o which will be carried inside the header of the packets that belong to this connection

n an incoming interface o on which packets for this VC arrive at the

n an incoming interface o on which packets for this VC arrive at the switch n an outgoing interface o in which packets for this VC leave the switch n a potentially different VCI that will be used for outgoing packets

o Two classes of approaches to establish connection state n Permanent Virtual Circuit (PVC)

o Two classes of approaches to establish connection state n Permanent Virtual Circuit (PVC) n Switched Virtual Circuit (SVC)

o Permanent Virtual Circuit (PVC) n administrator configures the state, in which case the

o Permanent Virtual Circuit (PVC) n administrator configures the state, in which case the virtual circuit is “permanent” n administrator can also delete the state, so a permanent virtual circuit (PVC) might be thought of as a long-lived, or administratively configured VC

o Switched Virtual Circuit (SVC) n a host may set up and delete a

o Switched Virtual Circuit (SVC) n a host may set up and delete a VC by sending messages without the involvement of a network administrator n this is referred to as signaling, and the resulting virtual circuits are said to be switched n an SVC should more accurately be called a “signaled” VC, since it uses signaling (not switching) to distinguish an SVC from a PVC

o Example n assume that a network administrator wants to manually create a new

o Example n assume that a network administrator wants to manually create a new virtual connection from host A to host B n two-stage process o connection setup o data transfer

(11) (5) (7) (4) An example of a virtual circuit network

(11) (5) (7) (4) An example of a virtual circuit network

n The administrator picks a VCI value that is currently unused on each link

n The administrator picks a VCI value that is currently unused on each link for the connection o suppose n VCI = 5, the link from host A to switch 1 n VCI = 11, the link from switch 1 to switch 2 n VCI = 7, the link from switch 2 to switch 3 n VCI = 4, the link from switch 3 to host B

Incoming Interface Incoming VCI Outgoing Interface Outgoing VCI 2 5 1 11 VC table

Incoming Interface Incoming VCI Outgoing Interface Outgoing VCI 2 5 1 11 VC table entry at switch 1 Incoming Interface Incoming VCI Outgoing Interface Outgoing VCI 3 11 2 7 VC table entry at switch 2 Incoming Interface Incoming VCI Outgoing Interface Outgoing VCI 0 7 1 4 VC table entry at switch 3

A packet is sent into a virtual circuit network

A packet is sent into a virtual circuit network

A packet makes its way through a virtual circuit network

A packet makes its way through a virtual circuit network

o Hop-by-hop flow control n each node is ensured of having the buffers it

o Hop-by-hop flow control n each node is ensured of having the buffers it needs to queue the packets that arrive on that circuit n example, an X. 25 network-a packet-switched network that uses the connection-oriented model

o X. 25 network employs the following three-part strategy 1. buffers are allocated to

o X. 25 network employs the following three-part strategy 1. buffers are allocated to each virtual circuit when the circuit is initialized 2. the sliding window protocol is run between each pair of nodes along the virtual circuit, and this protocol is augmented with flow control to keep the sending node from overrunning the buffers allocated at the receiving node

3. the circuit is rejected by a given node if not enough buffers are

3. the circuit is rejected by a given node if not enough buffers are available at that node when the connection request message is processed

o Examples of virtual circuit technologies n Asynchronous Transfer Mode (ATM) n Frame Relay,

o Examples of virtual circuit technologies n Asynchronous Transfer Mode (ATM) n Frame Relay, e. g. , Virtual Private Network (VPN) o Frame Relay operates only at the physical and data link layers

3. 1. 3 Source Routing o Neither virtual circuits nor conventional datagrams o All

3. 1. 3 Source Routing o Neither virtual circuits nor conventional datagrams o All the information about network topology that is required to switch a packet across the network is provided by the source host

o Various ways to implement source routing n method 1 o put an ordered

o Various ways to implement source routing n method 1 o put an ordered list of switch ports in the header and to rotate the list so that the next switch in the path is always at the front of the list o for each packet that arrives on an input, the switch would read the port number in the header and transmit the packet on that output

Source routing in a switched network (where the switch reads the rightmost number)

Source routing in a switched network (where the switch reads the rightmost number)

n method 2 o example, rather than rotate the header, each switch just strip

n method 2 o example, rather than rotate the header, each switch just strip the first element as it uses it n method 3 o have the header carry a pointer to the current “next port” entry, so that each switch just updates the pointer rather than rotating the header

Three ways to handle headers for source routing: (a) rotation, (b) stripping, and (c)

Three ways to handle headers for source routing: (a) rotation, (b) stripping, and (c) pointer. The labels are read right to left

3. 2 Bridges and LAN Switches o LANs have physical limitations (e. g. ,

3. 2 Bridges and LAN Switches o LANs have physical limitations (e. g. , 2500 m) o Bridge (LAN switch) n connect two or more LANs o Extended LAN n a collection of LANs connected by one or more bridges n accept and forward strategy (accept all frames transmitted on either of the Ethernets, so it could forward them to the other)

3. 2. 1 Learning Bridges o Do not forward when unnecessary n whenever a

3. 2. 1 Learning Bridges o Do not forward when unnecessary n whenever a frame from host A that is addressed to host B arrives on port 1, there is no need for the bridge to forward the frame out over port 2

Illustration of a learning bridge

Illustration of a learning bridge

Host Port A 1 B 1 C 1 X 2 Y 2 Z 2

Host Port A 1 B 1 C 1 X 2 Y 2 Z 2 o How does a bridge come to learn on which port the various hosts reside? n each bridge inspects the source address in all the frames it receives n when host A sends a frame to a host on either side of the bridge, the bridge receives this frame and records the fact that a frame from host A was just received on port 1 n in this way, the bridge can build a table just like the following table

Host Port A 1 B 1 C 1 X 2 Y 2 Z 2

Host Port A 1 B 1 C 1 X 2 Y 2 Z 2

3. 2. 2 Spanning Tree Algorithm o Problem: extended LAN has a loop in

3. 2. 2 Spanning Tree Algorithm o Problem: extended LAN has a loop in it n frames potentially loop through the extended LAN forever n example o bridges B 1, B 4, and B 6 form a loop

Extended LAN with loops

Extended LAN with loops

o Solution: bridges run a distributed spanning tree algorithm n spanning tree is a

o Solution: bridges run a distributed spanning tree algorithm n spanning tree is a subgraph of a graph that covers (spans) all the vertices, but contains no cycles

Example of (a) a cyclic graph; (b) a corresponding spanning tree

Example of (a) a cyclic graph; (b) a corresponding spanning tree

o Spanning tree algorithm (developed by Radia Perlman) n each bridge has a unique

o Spanning tree algorithm (developed by Radia Perlman) n each bridge has a unique identifier (e. g. , B 1, B 2, B 3) n the algorithm first elects the bridge with the smallest ID as the root of the spanning tree o the root bridge always forwards frames out over all of its ports

n each bridge computes the shortest path to the root and notes which of

n each bridge computes the shortest path to the root and notes which of its ports is on this path o this port is selected as the bridge’s preferred path to the root

n finally, all the bridges connected to a given LAN elect a single designated

n finally, all the bridges connected to a given LAN elect a single designated bridge that will be responsible forwarding frames toward the root bridge o each LAN’s designated bridge is the one that is closest to the root, and if two or more bridges are equally close to the root, then the bridges’ identifiers with the smallest ID wins

Spanning tree with some ports not selected

Spanning tree with some ports not selected

o Bridges have to exchange configuration messages with each other and then decide whether

o Bridges have to exchange configuration messages with each other and then decide whether or not they are the root or a designated bridge based on these messages n configuration messages contain o the ID for the bridge that is sending the message o the ID for what the sending bridge believes to be the root bridge o the distance, measured in hops, from the sending bridge to the root bridge

n each bridge records current best configuration message for each port n initially, each

n each bridge records current best configuration message for each port n initially, each bridge believes it is the root o when learn not root, stop generating config messages n in steady state, only root generates configuration messages o when learn not designated bridge, stop forwarding config messages n in steady state, only designated bridges forward config messages

n root continues to periodically send config messages o if any bridge does not

n root continues to periodically send config messages o if any bridge does not receive config message after a period of time, it starts generating config messages claiming to be the root o upon receiving a config message over a particular port n the bridge checks to see if that new message is better than the current best configuration message recorded for that

n the new configuration message is considered “better” than the currently recorded information if

n the new configuration message is considered “better” than the currently recorded information if o it identifies a root with a smaller ID or o it identifies a root with an equal ID but with a shorter distance or o the root ID and distance are equal, but the sending bridge has a smaller ID

o Sequence of events n assume all the bridges boot at about the same

o Sequence of events n assume all the bridges boot at about the same time and all the bridges would start off by claiming to be the root n (Y, d, X) denotes a configuration message from node X in which it claims to be distance d from root node Y

o Sequence of events on the activity at node B 3 1. B 3

o Sequence of events on the activity at node B 3 1. B 3 receives (B 2, 0, B 2) 2. since 2 < 3, B 3 accepts B 2 as root [(B 2, 1, B 3)] 3. B 3 adds one to the distance advertised by B 2 (0) and thus sends (B 2, 1, B 3) toward B 5 [(B 2, 1, B 3), (B 2, 2, B 5)] 4. meanwhile, B 2 accepts B 1 as root because it has the lower ID, and it sends (B 1, 1, B 2) toward B 3 [(B 1, 1, B 2), (B 1, 2, B 3)]

5. B 5 accepts B 1 as root and sends (B 1, 1, B

5. B 5 accepts B 1 as root and sends (B 1, 1, B 5) toward B 3 [(B 1, 1, B 5), (B 1, 2, B 3)] 6. B 3 accepts B 1 as root, and it notes that both B 2 and B 5 are closer to the root than it is [(B 1, 2, B 3), (B 1, 1, B 2), (B 1, 1, B 5)] 7. B 3 stops forwarding messages on both its interfaces (this leaves B 3 with both ports not selected) [(B 1, 1, B 2), (B 1, 1, B 5)]

(2) (7) (1) (3) (4 b) (6) (5 b) (5 a) (4 a) Spanning

(2) (7) (1) (3) (4 b) (6) (5 b) (5 a) (4 a) Spanning tree with some ports not selected

3. 2. 3 Broadcast and Multicast o Since most LANs support both broadcast and

3. 2. 3 Broadcast and Multicast o Since most LANs support both broadcast and multicast, then bridges must also support these two features o Broadcast n each bridge forwards a frame with a destination broadcast address out on each active (selected) port other than the on which the frame was received o Multicast n implemented in exactly the same way, with each host deciding itself whether or not to accept she message

3. 2. 4 Limitations of Bridges o Do not scale o Do not accommodate

3. 2. 4 Limitations of Bridges o Do not scale o Do not accommodate heterogeneity

Do not Scale o It is not realistic to connect more than a few

Do not Scale o It is not realistic to connect more than a few (tens of) LANs by means of bridges n the spanning tree algorithm scales linearly, i. e. , there is no provision for imposing a hierarchy on the extended LAN n bridges forward all broadcast frames and broadcast does not scale

o Virtual LAN (VLAN) n used to increase the scalability of extended LANs n

o Virtual LAN (VLAN) n used to increase the scalability of extended LANs n allows a single extended LAN to be partitioned into several seemingly separate LANs n each virtual LAN is assigned an identifier (sometimes called a color), and packets can only travel from one segment to another if both segments have the same identifier o this limits the number of segments in an extended LAN that will receive any given broadcast packet

o Example n four hosts (W, X, Y, Z) on four different LAN segments

o Example n four hosts (W, X, Y, Z) on four different LAN segments n in the absence of VLANs, any broadcast packet from any host will reach all the other hosts n suppose that we define the segments connected to hosts W and X as being in one LAN, VLAN 100 n also define the segments that connect to hosts Y and Z as being in VLAN 200 n to do his, we need to configure a VLAN ID on each port of bridges B 1 and B 2 n the link between B 1 and B 2 is considered to be in both VLANs

Two virtual LANs share a common backbone

Two virtual LANs share a common backbone

o When a packet sent by host X arrives at bridge B 2 n

o When a packet sent by host X arrives at bridge B 2 n the bridge observes that it came in a port that was configured as being in VLAN 100 n it inserts a VLAN header between the Ethernet header and its Ethernet VLAN payload Payload header n the bridge applies normal rules forwarding to the packet, with the extra restriction that the packet may not be sent out an interface that is not part of VLAN 100 n thus, even a broadcast packet can’t be sent out the interface to host Z, which is in VLAN 200

o An attractive feature of VLANs n it is possible to change the logical

o An attractive feature of VLANs n it is possible to change the logical topology without moving any wires or changing any addresses n example o if we want to make the segment that connects to host Z be part of VLAN 100, and thus enable X, W and Z be on the same virtual LAN, we would just need to change one piece of configuration on bridge B 2

Do not Accommodate Heterogeneity o Bridges are fairly limited in the kinds of networks

Do not Accommodate Heterogeneity o Bridges are fairly limited in the kinds of networks they can interconnect o Bridges make use of the networks frame header and so can support only networks that have exactly the same format for addresses o Bridges can be used to connect Ethernets to Ethernets, 802. 5 (Token Ring) to 802. 5, and Ethernets to 802. 5 rings, since both networks support the same 48 -bit address format o Bridges do not readily generalize to other kinds of networks, such as ATM