1 / 33

Switching and Bridging Textbook Ch3.1 and 3.4

Switching and Bridging Textbook Ch3.1 and 3.4. Prof. Athirai Irissappane http://courses.washington.edu/css432/athirai/ athirai@uw.edu. Scalable Networks. Switch A mechanism that allows us to interconnect links to form a large network

razo
Download Presentation

Switching and Bridging Textbook Ch3.1 and 3.4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Switching and BridgingTextbook Ch3.1 and 3.4 Prof. Athirai Irissappane http://courses.washington.edu/css432/athirai/ athirai@uw.edu CSS432: Switching and Bridging

  2. 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. 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 Connectionless Connection Oriented (Virtual Circuit) ATM IP datagrams X25 CSS432: Switching and Bridging

  4. Switching • 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. 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. Host D Host E 0 Switch 1 Host F 3 1 Switch 2 2 Host C 2 3 1 0 Host A 0 Switch 3 Host B Host G 1 3 2 Host H 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) Table at Switch 2

  7. Host D Host E 0 Switch 1 Host F 3 1 Switch 2 2 Host C 2 3 1 0 Host A 0 Switch 3 Host B Host G 1 3 2 Host H Datagram Switching • 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 A, E A, E, C A 0 0 H 0 H, B F,E, B 1 F, E F 1 F 1 2 A 2 E 2 H A, C 3 C 3 A 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 = 00001000 00000000 00101011 11100100 10110001 00000010 • 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: Asource 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 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. Host D Host E 0 Switch 1 Host F 3 1 VCI=6 Switch 2 2 VCI=12 Host C 2 3 1 0 Host A VCI=8 VCI=11 VCI=5 0 Switch 3 Host B Host G 1 3 VCI=4 VCI=7 2 Host H VCI=4 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 Switch 1 Switch 2 Switch 3

  14. Host D Host E 0 Switch 1 Host F 3 1 VCI=6 Switch 2 2 VCI=12 Host C 2 3 1 0 Host A VCI=8 0 Switch 3 Host B Host G 1 3 VCI=4 2 Host H Virtual Circuit Switching (Cont’d) • VCI for each host/switch+port is unique • Switch picks unused VCI for incoming connection request Switch 1 Port (in) VCI Port (out) VCI 2 6 1 12 Switch 2 Port (in) VCI Port (out) VCI 3 12 0 8 Port (in) VCI Port (out) VCI Switch 3 0 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

  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. 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 Workstation CPU LAN A NIC 1 • 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) LAN B I/O ctlr NIC 2 LAN C NIC 3 I/O Bus Main memory 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 • 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 Input Port Output Port Input Port Output Port Fabric Input Port Output Port Shared memory CSS432: Switching and Bridging

  21. 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. 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. Banyan Switch 0 0 001 001 000 011 000 001 1 001 • 2 x 2 switching elements interconnected in regular patterns. • Collisions occur if packets are not presented in ascending order 0 110 1 1 111 011 111 110 110 110 111 111 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 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

  27. 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. A B B3 C B5 D B7 K B2 E F B1 G H B6 B4 I J STP: Spanning Tree Protocol Y • 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 802.1 Specification 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. 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. 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. 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. 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

More Related