1 / 37

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

Télécharger la présentation

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 TDM FDM virtual Connectionless Connection Oriented (Virtual Circuit) Dynamic Static DTM SONET ATM IP datagrams X25 Dynamically reallocate bandwidth Frame sent over optics in synchronization with atomic/satellite clock CSS432: Switching and Bridging

  4. Switching • 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. 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 • 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 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 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. 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: 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

  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 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. 0 Switch 1 3 1 2 Switch 2 2 3 1 5 11 0 VCI = 11 Host A VCI = 5 7 VCI = 7 0 Switch 3 1 3 VCI = 4 4 Host B 2 Virtual Circuit Switching 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. 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. 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

  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. CSS432: Switching and Bridging

  16. 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. 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. 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. destination destination destination R B R R B R R B R R R B 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

  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

  21. 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. 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

  23. 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. 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. 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. 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 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

  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 • 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

  31. 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. 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. 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

  35. Batcher Network + Banyan Switch 001 000 000 000 001 001 • 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 ∞ 110 110 ∞ 111 111 111 ∞ 110 ∞ CSS432: Switching and Bridging

  36. Batcher Network + Banyan Switch 0 0 0 0 1 0 000 0 1 1 0 1 001 ∞ ∞ 7 • 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 ∞ ∞ 6 110 1 1 7 1 ∞ ∞ ∞ 6 ∞ 6 7 111 7 ∞ ∞ ∞ ∞ 7 ∞ ∞ 7 ∞ ∞ ∞ ∞ ∞ 6 ∞ ∞ 7 ∞ ∞ ∞ 6 6 6 CSS432: Switching and Bridging

  37. 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

More Related