Download presentation
Presentation is loading. Please wait.
Published byBasil Baldwin Manning Modified over 6 years ago
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 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) IP datagrams ATM X25 CSS432: Switching and Bridging
4
CSS432: Switching and Bridging
Circuit Switching Dedicated connection between source and destination No one else can use the link Send streams Packet Switching No dedicated connection Efficient use of resources. E.g., link capacity Data sent as packets Link can be shared by others Virtual circuit Establishes a dedicated connection between source and destination Link can be shared 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 (Internet)
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 Switch can learn based on oncoming information but not sufficient to send data: use routing algorithms like shortest path to determine where to send the data and which path to follow Broadcasting is one option before the switch learns which port to use, but it will always not give the best/shortest route
7
Datagram Switching A sends ARP request about F
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 ARP request about F F sends MAC address to A E sends ARP request about H H sends MAC address to E C sends ARP request about B B sends MAC address 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
Ethernet (MAC) Address
Each host on an Ethernet has a unique Address. The (unicast) address belongs to the adaptor, not the host. MAC Address sequence of six numbers separated by colons each number corresponds to 1 byte of the 6 byte (48 bit) address and is given by a pair of hexadecimal digits, one for each of the 4-bit nibbles in the byte Leading 0s are dropped. E.g., 8:0:2b:e4:b1:2 = address consisting of all 1s a broadcast address. All adaptors pass frames addressed to the broadcast address up to the host. an address with first bit set to 1 but is not the broadcast address is called a multicast address. host can program its adaptor to accept multicast addresses. CSS 432 8
9
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
10
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
11
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 Subsequent 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
12
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
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 Switching (Cont’d)
VCI for each host/switch+port is unique Switch picks unused VCI for incoming connection request 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 Switch 1 VCI=6 VCI=12 VCI=8 VCI=4 Port (in) VCI Port (out) VCI 2 6 1 12 Switch 2 Port (in) VCI Port (out) VCI 3 12 8 Switch 3 Port (in) VCI Port (out) VCI 8 2 4
15
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
16
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
17
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
18
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
19
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 (33*32 = 1056 Mbps) I/O bus 1Gbps Memory bandwidth Lower Bandwidth 1 Gbps < 1056 Mbps; Bandwidth of host = 1Gbps Throughput = 1Gbps/ 2 = 500Mbps for a round trip between NIC and main memory If each NIC is 100Mbps, how many NICs can be supported by the host? 500/100 = 5 NICs 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
20
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
21
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
22
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
23
CSS432: Switching and Fowarding
Banyan Switch Self Routing switch Destination information in packet Input port decides what is the output port and attaches a header to the packet 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
24
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
25
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 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 repeater and Hub are layer 1 devices. Repeater address the issue of attenuation. Attenuation is the loss of signal over distance. Repeater rebuilt the electrical signal that comes in and send it out to other side. Hub is a multi-port repeater. Electrical signal came into any one hub port will be repeated on all other ports.The layer 1 devices are dumb, they have no decision making abilities. Hubs do not read any of the data passing through them, and they are not aware of the source or destination of the frame. All the devices attached to a hub are belong to one collision domain, which means if two hosts try to send data at the same time, a collision will occur. All the devices attached to a hub are also belong to one braoadcast domain, that is, broadcast frame sent by one host will be received by all other hosts in the network. Bridge and Switch are layer 2 devices. They can make decisions about to which port the frames will go, based on MAC Addresses. Bridges and switches help avoid frame collision by breaking down one collision domain to two or more smaller collision domains, then buffer and forward frames between them. Nowadays, a switch can be configured to allow each connected host to have its own individual collision domain. As a result, all the hosts can trasnmit data simultaneously without collision, because they no longer share the bandwidth with each other. It is important to notice hosts attached to bridge or switch still belong to the same broadcast domain. Router is layer 3 device. The purpose of router is to route packets from one broadcast domain to another. Router maintains a routing table. The routing table contains ip addresses associated with interfaces, out of which the packet will be forward to. Collision Domains – A collision domain is defined as a network segment that shares bandwidth with all other devices on the same network segment. Generally speaking, A Collision Domain includes all of the Ethernet segments between a pair of bridges or other layer 2 devices. When two hosts on the same network segment transmit at the same time, the resulting digital signals will fragment or collide, hence the term collision domain. Broadcast Domain – A broadcast domain is defined as all devices on a network segment that hear broadcasts sent on that segment. All devices plugged into a hub are in the same collision domain and the same broadcast domain. All devices plugged into a switch are in separate collision domains but the same broadcast domain. Although, you can buy special hardware to break up broadcast domains in a switch, or use a switch capable of creating VLANs. VLANs breakup broadcast domains. Hubs and Repeaters extend collision and broadcast domains. Switches, Bridges and Routers break up collision domains. Bridge: same as switch with less number of ports (2) CSS432: Switching and Bridging
26
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 Def 1: Bridge: same as switch with less number of ports (2) Def 2: Switch connects hosts, bridges connect LANs
27
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
28
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
29
Spanning Tree Protocol
How to avoid loops ? Block unnecessary ports Bridges select ports to forward frame using STP Some ports should not be used to avoid cycles Root bridge is selected Priority MAC address / ID Port number Root forwards frames on all ports Based on shortest distance from root, select bridge for Every LAN to forward frames to it Use Config Messages CSS432: Switching and Bridging
30
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
31
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
32
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
33
CSS432: Switching and Bridging
Reviews Datagram switching Virtual Circuit switching Bridges: STP and limitations Switches: workstation-based, shared bus/memory-based, crossbar, and banyan Exercises in Chapter 3 Ex. 1 (vc sw) Ex. 4 (datagram sw) Ex. 13 (STP) Ex. 26, 27 (Switch implementation) CSS432: Switching and Bridging
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.