Presentation is loading. Please wait.

Presentation is loading. Please wait.

Switching and Bridging Textbook Ch3.1 and 3.4

Similar presentations


Presentation on theme: "Switching and Bridging Textbook Ch3.1 and 3.4"— Presentation transcript:

1 Switching and Bridging Textbook Ch3.1 and 3.4
Prof. Athirai Irissappane CSS432: Switching and Bridging

2 CSS432: Switching and Bridging
Scalable Networks Switch A mechanism that allows us to interconnect links to form a large network A multi-input, multi-output device which transfers packets from an input to one or more outputs Adds the star topology to the point-to-point link, bus (Ethernet), and ring (802.5 and FDDI) topologies Connect switches (packet and circuit switched n/w) A switch’s primary job is to receive incoming packets on one of its links and to transmit them on some other link This function is referred as switching and forwarding CSS432: Switching and Bridging

3 CSS432: Switching and Bridging
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 Circuit Switch (1. Circuit Establishment: allocates certain bandwidth and establish a path 2. Data Transfer 3. Circuit Termination If circuit not available: “Busy signal” Ex: Telephone networks) Circui Virtua Circuit similar to Packet Switch + Circuit Switch; data sent as packets Connectionless Connection Oriented (Virtual Circuit) Dynamic Static IP datagrams ATM X25 DTM SONET Dynamically reallocate bandwidth Frame sent over optics in synchronization with atomic/satellite clock CSS432: Switching and Bridging

4 CSS432: Switching and Bridging
Circuit Switching Circuit Establishment: allocates certain bandwidth and establish a path Data Transfer (Sends a stream of bits) Circuit Termination E.g., Telephone system Packet Switching Connection Oriented (Virtual Circuit) / Connection less (Datagram) Send packets instead of streams Store and forward (each node in the link, receives the packet, stores it and forwards it) CSS432: Switching and Bridging

5 CSS432: Switching and Bridging
Packet Switching How does the switch decide which output port to place each packet on? It looks at the header of the packet for an identifier that it uses to make the decision 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

6 Datagram Switching Every packet contains enough information (destination address) for switch to decide how to get it to destination To decide how to forward a packet, a switch consults a forwarding/routing table (every switch maintains a table) Port (out) Destination B, G, H 1 F 2 E 3 A, C, D 1 3 2 Switch 3 Host B Switch 2 Host A Switch 1 Host C Host D Host E Host F Host G Host H Table at Switch 2

7 Datagram Switching A sends data to F F sends acknowledgement to A
1 3 2 Switch 3 Host B Switch 2 Host A Switch 1 Host C Host D Host E Host F Host G Host H A sends data to F F sends acknowledgement to A E sends data to H H sends acknowledgement to E C sends data to B B sends acknowledgement to C Switch 1 Switch 2 Switch 3 Port Destin Port Destin Port Destin ation ation ation H, B H A A, E, C A, E 1 F, E F F,E, B 1 F 1 2 A 2 E 2 H 3 C 3 A A, C 3 B

8 Datagram Switching A host can send a packet anywhere at any time
No connection setup phase. When a host sends a packet, it has no way of knowing if the network is capable of delivering it or if the destination host is even up and running Each packet forwarded independently of previous packets sent to the same destination successive packets from host A to host B may follow completely different paths 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 update the forwarding table accordingly

9 Datagram Switching (Cont’d)
No connection setup Pros 1: A source can send data as soon as it is ready. No way of knowing if a packet is delivered. 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

10 Virtual Circuit Switching
Widely used technique for packet switching Uses the concept of virtual circuit (VC) connection-oriented model: set up a virtual connection from the source host to the destination host and then send the data Explicit connection setup (and tear-down) phase Subsequence packets follow same circuit Each switch maintains a VC table is a means of transporting data over a packet switched computer network in such a way that it appears as though there is a dedicated physical layer link between the source and destination end systems of this data CSS432: Switching and Bridging

11 Virtual Circuit Switching
Connection setup Establish connection state (entry in the “VC table”) in each of the switches between the source and destination hosts One entry in the VC table on a single switch contains A virtual circuit identifier (VCI) that uniquely identifies the connection at this switch and that will be carried inside the header of the packets that belong to this connection An incoming interface on which packets arrive at the switch An outgoing interface in which packets leave the switch A potentially different VCI that will be used for outgoing packets Entry? If a packet arrives on the incoming interface and that packet contains the designated VCI value in its header, then the packet should be sent out the specified outgoing interface with the specified outgoing VCI value first having been placed in its header CSS432: Switching and Bridging

12 Virtual Circuit Switching
1 3 2 5 11 4 7 Switch 3 Host B Switch 2 Host A Switch 1 VCI = 5 VCI = 11 VCI = 7 VCI = 4 Port (in) VCI Port (out) 2 5 1 11 3 7 4 Switch 1 Switch 2 Question: It seems like the left table needs only incoming and outgoing port pairs…. Why do we need VCI? Switch 3 CSS432: Switching and Bridging

13 Virtual Circuit Switching (Cont’d)
Global address information (host) is replaced with local VCI (specific to switch). Each switch has local but not global information. To set up connection: switch needs a global view of network configuration to forward a connection request message to destination VCI + interface unique identifier for a virtual connection 1 3 2 Switch 3 Host B Switch 2 Host A Switch 1 Host C Host D Host E Host F Host G Host H VCI=5 VCI=11 VCI=7 VCI=4 VCI=6 VCI=12 VCI=8 VCI=4 Switch 1 Port (in) VCI Port (out) 2 5 1 11 6 12 3 7 8 4 Switch 2 Switch 3

14 Virtual Circuit Model (Cont’d)
Establishing connection state Network Administrator will configure the state The virtual circuit is permanent (PVC), administrator can delete this A host can send messages to the network for the state to be established This is referred as signaling and called switched virtual circuit (SVC) A host may set up and delete such a VC dynamically without administrator In real n/ws, signaling is always used (PVC, signal initiated by admin) Signaling: (Host A source, Host B destination) Host A sends a setup message (with destination address) to appropriate switch At switch, entry is created and send the request to next switch To complete the connection, an acknowledgement is sent by the downstream neighbor with its VCI starting with Host B When a host (A) no longer wants to send data to host (B), it tears down the connection by sending a teardown message to the relevant switch. Switch removes corresponding entry and forwards the tear down message to the other switches in the path In real networks, the burden of configuring VC tables correctly in a large number of switches would quickly become excessive

15 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. Switches set aside the resources they need to meet this guarantee For example, a percentage of each outgoing link’s bandwidth Delay tolerance on each switch; Each circuit can have different QOS, e..g, switches packets belonging to a particular circuit not delayed for more than a amount of time Switches Flow control: Buffers are allocated to each virtual circuit when the circuit is initialized The sliding window protocol is run between each pair of nodes along the virtual circuit, and this protocol is augmented with the flow control to keep the sending node from overrunning the buffers allocated at the receiving node The circuit is rejected by a given node if not enough buffers are available at that node when the connection request message is processed CSS432: Switching and Bridging

16 CSS432: Switching and Bridging
Cell Switching (ATM) Cell Switching - fixed packet length; Packet Switching- variable packet length ATM (Asynchronous Transfer Mode) Connection-oriented packet-switched network Packets are called cells (fixed length) 5 byte header + 48 byte payload Fixed length packets easier to switch in hardware Hardware switch simple to design (know length) Enables parallelism (parallel switches performing the same job taking the same time) (scalability) CSS432: Switching and Bridging

17 CSS432: Switching and Bridging
Source Routing All the information about network topology that is required to switch a packet across the network is provided by the source host Each packet has a complete switching information from source to destination Three ways to maintain switching information: Rotation Striping Use of a pointer Useful to send a connection setup request in VC CSS432: Switching and Bridging

18 CSS432: Switching and Bridging
Source Routing Rotation (a): Packet header contains information about the output port of each switch Output port information for each switch in the header At switch, the packet header is read and packet is transmitted on that output The output list in rotated before transmission, other switch can determine output port Striping (b) Remove the port information for the current switch instead of rotating Use Pointer (c) Use a pointer to point to the current output port in the list of ports Update the pointer before transmitting to the next switch CSS432: Switching and Bridging

19 Bridges and Extended LANs
Connecting two or more LANs Repeater / Hub L1: Physical Layer Limitations: <= 2500m To detect collision transmit atleast 512 bits/ limit the time to detect collision to maximum of 5.12us, hence limit length as 2500 m Bridge (LAN switch) L2: Datalink Layer Fowarding frames using MAC address Connect accessible networks Static configuration + partial dynamic configuration (Spanning Tree Protocol) Router L3 – Network Layer Routing IP packets using IP address Dynamic configuration Connect hosts of any networks R destination B destination Start from repeater/bridge/router of LAN on the left hand side; Need to transmit packets to destination Repeater: forwards bits Bridge: forwards frames Router: forwards packets; contain routing table, stop when destination is reached R destination CSS432: Switching and Bridging

20 Bridges and Extended LANs
Bridges: Accept frames on their input and forwards to output Learning Bridges: no need to forward all the frames that a bridge receives When 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. Maintain forwarding table Determine if destination is on same side or opposite side of bridge Host Port A 1 B C X 2 Y Z

21 CSS432: Switching and Bridging
Learning Bridges Learn table entries based on source address (full network not known) 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 If no entry, forward to all ports When a bridge first boots, this table is empty Entries are added over time A timeout is associated with each entry The bridge discards the entry after a specified period of time Linux brctl command: makes a logical bridge with max age = 4sec The above learning does not work when loops are present Spanning Tree Algorithm to learn forwarding table when loops are present CSS432: Switching and Bridging

22 STP: Spanning Tree Protocol
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. Spanning Tree Algorithm Inactivate bridge ports so that no cycle exists in extended LAN IEEE Specification B3 A C E D B2 B5 B B7 K F H B4 J B1 B6 G I Y X CSS432: Switching and Bridging

23 CSS432: Switching and Bridging
STP Details Bridges select ports to forward frame using STP Some ports should not be used to avoid cycles Root bridge is selected Root forwards frames on all ports Use Config Messages to select root Use Config messages to select ports to forward messages CSS432: Switching and Bridging

24 CSS432: Switching and Bridging
STP Details Bridges exchange configuration messages (Y, d, X) Y: the id of root to be d: #hops from X to Y X: the sending bridge id Initially each bridge thinks it is the root, so it sends a configuration message on each of its ports identifying itself as the root and giving a distance to the root of 0 Upon receiving a configuration message over a particular port, the bridge checks to see if the new message is better than the current best configuration message recorded for that port. The new configuration is better than the currently recorded information if It identifies a root with a smaller id or It identifies a root with an equal id but with a shorter distance or The root id and distance are equal, but the sending bridge has a smaller id CSS432: Switching and Bridging

25 CSS432: Switching and Bridging
STP Details If the new message is better than the currently recorded one, The bridge discards the old information and saves the new information It first adds 1 to the distance-to-root field When a bridge receives a configuration message indicating that it is not the root bridge (that is, a message from a bridge with smaller id) The bridge stops generating configuration messages on its own Only forwards configuration messages from other bridges after 1 adding to the distance field When bridge receives a configuration message that indicates it is not the designated bridge for that port (a message from a bridge that is closer to the root or equally far from the root but with a smaller id) The bridge stops sending/forwarding configuration messages over that port When the system stabilizes, Only the root bridge is still generating configuration messages. Other bridges are forwarding these messages only over ports for which they are the designated bridge CSS432: Switching and Bridging

26 CSS432: Switching and Fowarding
STP Details B3 receives (B2, 0, B2) (Y -root, d, X -sender) Since 2 < 3, B3 accepts B2 as root B3 adds 1 to the distance advertised by B2 and sends (B2, 1, B3) to B5 Meanwhile B2 accepts B1 as root because it has the lower id and it sends (B1, 1, B2) toward B3 B5 accepts B1 as root and sends (B1, 1, B5) to B3 B3 accepts B1 as root and it notes that both B2 and B5 are closer to the root than it is. Thus B3 stops forwarding messages on both its interfaces This leaves B3 with both ports not selected B1, 1, B5 B2, 1, B3 B1, 1, B2 B2, 0, B2 B1, 0, B1 B1, 0, B1 CSS432: Switching and Fowarding

27 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

28 Workstation Used as a Switch
CPU LAN A NIC 1 LAN B I/O ctlr NIC 2 LAN C NIC 3 I/O Bus Main memory Workstation (with CPU), 3 Network Interfaces Packet travels from NIC 1 to NIC 2 NIC1 to Memory: Direct Memory Access: allows I/O device to send receive data directly to memory bypassing CPU (Faster) CPU examines packet header determines packet to be sent to NIC 2 Memory to NIC 2 (DMA) CSS432: Switching and Bridging

29 Workstation Used as a Switch
Advantage: flexible because a workstation has a CPU Disadvantage: Each packet crosses I/O bus twice and read and written onto memory once (upper bound on throughput is half main memory bandwidth or half I/O bus bandwidth, whichever is smaller) Processing small packets reduces throughput Example 33MHz 32bit (1056 Mbps) I/O bus 1Gbps Memory bandwidth 500Mbps for a round trip between NIC and main memory Enough to support five 100Mbps Ethernet ports What if a packet is very small like 64bytes The workstation has to process 500,000 packets per second (pps). Throughput: 500,000 x 64 x 8 = 256Mbps If it is a 5-port switch then this bandwidth should be shared, i.e., 256/5 ~ 5Mbps data rate on each port (below average range that the users demand) Better design for switch to avoid the above drawbacks CSS432: Switching and Bridging

30 Shared Bus/Memory-Based Switch
Control processor DMA from port to port Input Port Output Port Input Port Fabric Output Port Input Port Output Port Shared memory Control processor in charge of whole switch, communicates to the ports via bus or directly Ports communicate with outside world Fabric: when presented with a packet deliver it to the right output port CSS432: Switching and Bridging

31 CSS432: Switching and Bridging
Switch Fabric Types Switch Fabric Transfer packet from input to output with minimal delay and meeting the throughput of switch Types Shared Bus switch Shared across the input and output port Bandwidth of bus determines switch throughput Shared Memory switch Packets are written into memory by input port and read by output port Memory bandwidth determines switch throughput Uses high speed memory bus instead of I/O bus (as in shared Bus) Crossbar switch Matrix of pathways which connect any input port to any output port Collision: Each output port needs to accept packets from all input port at once Banyan Switch Self routing CSS432: Switching and Bridging

32 Crossbar Switch (4 * 4 matrix)
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. Use Knockout Switch CSS432: Switching and Bridging

33 CSS432: Switching and Fowarding
Banyan Switch Self Routing switch 2 x 2 switching elements interconnected in regular patterns (2 inputs and 2 outputs) Collision avoidance by proper arrangement of switching elements First column switches deal with the most significant bit. If 0 route packets to the top, if 1 route packets to bottom Second column deal with the middle bit Third column deals with least significant bit Packets should be present in ascending order CSS432: Switching and Fowarding

34 CSS432: Switching and Bridging
Banyan Switch 001 001 000 011 1 000 001 001 110 111 1 1 011 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

35 Batcher Network + Banyan Switch
001 000 000 000 001 001 110 110 111 111 111 110 Batcher network: Performs merge sort A network of 2x2 switches Two types of switches Up switch - sends higher number to top output (0) Down switch-sends higher number to bottom output (1) How merge sort works here? Merger is presented with a pair of sorted lists, one in ascending order, one in descending order … First stage of merger sends packets to the correct half of the network … Second stage sends them to the correct quarter Sort packets in ascending order through Batcher network Up switch - sends higher number to top output Down switch-sends higher number to bottom output Then switch them through Banyan switch CSS432: Switching and Bridging

36 Batcher Network + Banyan Switch
1 000 1 1 1 001 7 1 1 7 6 110 1 6 6 7 111 7 7 7 6 7 Batcher network: Performs merge sort A network of 2x2 switches Two types of switches Up switch - sends higher number to top output (0) Down switch-sends higher number to bottom output (1) How merge sort works here? Merger is presented with a pair of sorted lists, one in ascending order, one in descending order … First stage of merger sends packets to the correct half of the network … Second stage sends them to the correct quarter 6 6 6 Sort packets in ascending order through Batcher network Up switch - sends higher number to top output Down switch-sends higher number to bottom output Then switch them through Banyan switch CSS432: Switching and Bridging

37 CSS432: Switching and Bridging
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, 27, 32 (Switch implementation) CSS432: Switching and Bridging


Download ppt "Switching and Bridging Textbook Ch3.1 and 3.4"

Similar presentations


Ads by Google