Transcript
Page 1: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

CPS 356: Introduction to Computer Networks

Lecture 7: Switching technologies

Ch 2.8.2, 3.1, 3.4

Xiaowei Yang

[email protected]

Page 2: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Review: link layer functions• Encoding

– NRZ, NRZI, Manchester, 4B/5B

• Framing: bit, byte, time-synchronization

• Error detection– Parity bits, Internet checksum, CRC

• Reliable transmission– Stop-and-wait

– Sliding window

– Concurrent logical channels

• Media Access Control– Ethernet, Token Ring, Wifi (today)

Page 3: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Ethernet: Physical propertiesSensing the line; if idle, sends signals

10Base5

CSMA/CD: Carrier Sense Multiple access with CollisionDetection

Page 4: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Collision Domain

• Any host hears any other host– A single segment

– Multiple segments connected by repeaters

– Multiple segments connected by a hub

Page 5: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Transmitter Algorithm

Begin: Wait until the line is idle and has data to send, the adaptor sends it, and listens to collision

– If no, go back to Begin– else exponentially backoff

• randomly selects a k between [0,2n-1], waits for k x 51.2 μs to try Begin again

• Gives up after n reaches 16

Page 6: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Collision detection

• An adaptor senses the signals on the line and compares it with its own– If same, no collision; otherwise, collision

– Sends 32-bit jamming sequence after collision

• In the worst case, a sender needs to send 512 bits (46+14+4 = 64B) to detection collision– Why?

Page 7: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

• One way delay is d• A needs to send for 2d duration to detect collision• 2d = 512 μs. On a 10Mps Ethernet, corresponds to 512 bits

Page 8: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

• The IEEE 802.3 Baseband 5-4-3 – Five physical segments between any two nodes

– Four repeaters between the nodes.

– Three of these physical segments can have connected node

• Each segment < 500m Total < 2500m

Page 9: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

• Propagation delay for this maximum-extent Ethernet network is 25.6us

• 2*d = 512us (tolerating errors)

• Minimum Ethernet packet size is 512 bits (64B)– Header 14B, payload 46B, CRC 4B

Page 10: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Today• Types of switching

– Datagram

– Virtual circuit

– Source routing

• Switching hardware design

Page 11: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Packet switching• Problem: single link networks have limited scale

• Ethernet < 1024 hosts, 2500 meters• Wireless limited by radio ranges• Point-to-point links connect only two nodes

• Packet switches enable packets to travel from one host to another without being directly connected

• A packet switch is a device with several inputs and outputs leading to and from the nodes that the switch interconnects

Page 12: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

A star topology• A switch has a limited number

of inputs and outputs ports

• Switches can be connected to each other to build larger networks

• Adding a new host may not reduce the performance for other hosts– Not true for shared media

networks– Why?

Page 13: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Switching• A switch connects links

• Each link can be of different types

• A switch runs an appropriate link layer protocol

• Switching (or forwarding): receive incoming packets and send to different outgoing links

Page 14: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Switching technologies• Problem: how does a switch decide on which

output port to place each packet?

• Solution: look at the packet header and makes a decision– Connectionless: datagram

– Connection oriented: virtual circuit

– Source routing

Page 15: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Challenges

• Contention– Input rate exceeds output rate

• Multiple input ports may send to the same output port

– Switches queue packets until contention disappears

• Congestion– When a switch runs out of buffer, it discards packets.

– Too frequent packet loss is said to be congested

Page 16: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Datagram

• Every packet contains the destination address– A global unique identifier

– Ethernet has 48-bit addresses

• A switch maintains a forwarding table that maps a packet to an output port

Page 17: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Switch 2’s forwarding table

A 3

B 0

C 3

D

E

F

G

HQ: how does a switch compute the table?

Page 18: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Features of datagram switching

• Connectionless: hosts can send anytime. No need to wait for connection to set up

• Unknown network state: not sure whether a packet can reach the destination

• Independent forwarding: packets may take different paths

• Robust to failures: a failure of a switch may not disrupt communications– Switches can re-compute forwarding tables

Page 19: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Virtual circuit switching

• Connection oriented– Set up a virtual circuit

– Data transfer

• Connection setup phase– Set up connection state

– A virtual circuit identifier, an incoming interface, an outgoing interface, and an outgoing virtual circuit identifier

Page 20: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Virtual circuit table (switch1)

Incoming

interface

Incoming

VCI

Outgoing

interface

Outgoing

VCI

2 5 1 11

5

11

Page 21: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Virtual circuit switching

• Algorithm:– If a packet arrives on the matching incoming port with the

matching incoming VCI, it will be sent to the corresponding outgoing port with the corresponding VCI

• VCIs are link-local

Page 22: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

How to setup connection state

• Administrator configured– Permanent virtual circuit (PVC)

– Admin manually sets up VC tables

– Does not suit large networks

• Signaling– A host sends messages to dynamically setup or

tear down a VC

Page 23: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

VC setup• A host A sends a setup message to first hop switch, including

the final destination address– Similar to a datagram packet

• The switch picks an unused VCI to identify the incoming connection, and fills part of the VC table– Why not let the host pick it?

• Every switch repeats the process until the packet reaches the destination B

• The destination B sends an ack to inform its upstream switch the VCI for the connection

Page 24: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Setup B

IF VCI OF VCI2 5 1

Setup B

IF VCI OF VCI3 11 2

Setup B

IF VCI OF VCI0 7 1

Setup B

IF VCI OF VCI0 7 1

VCI

4

Page 25: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

IF VCI OF VCI2 5 1

IF VCI OF VCI3 11 2

IF VCI OF VCI0 7 1

VCI

4

ACK, 4

4

ACK,

Page 26: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Characteristics of VC switching

• Connection setup wait

• Data packets contain a small VCI, rather than the full destination addresses

• One switch failure tears down the entire connection

• Connection sets up require routing algorithms– Setup packet is forwarded using a datagram algorithm

Page 27: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

VC allows resource reservation

• Buffers can be allocated during the setup phase to avoid congestion

• An example (X.25)– Buffers allocated during connection setup

– Sliding window is run between pairs of nodes (hop-by-hop flow control)

– Circuit is rejected if no more buffer

Page 28: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Quality of service (QoS)

• Connectionless network is difficult to allocate resources– Switches send packets independently

– How to associate one packet with other packets?

• Virtual circuit can be used to provide different QoS– Allocate a fraction of link bandwidth to each circuit

Page 29: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Switching technologies

• Connectionless: datagram

• Connection oriented: virtual circuit

• Source routing

Page 30: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Source routing

• Source host provides all the information for packets to travel across the network– Packets carry output port numbers– Packets carry switch addresses– Variable header length

Page 31: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Handling source routing headers

• Rotation

• Stripping– No return path!

• Pointer

Page 32: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Loose or strict source routing

• Strict– Must visit every node on the path

• Loose– Waypoints rather than the complete route

Page 33: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Overview

• Types of switching– Datagram

– Virtual circuit

– Source routing

• Switching hardware design– How to build switches?

Page 34: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Software switch

• Packets cross the bus twice– Half of the memory bus speed

• 133Mhz, 64-bit wide I/O bus 4Gpbs

• Short packets reduce throughput– 1Mpps, 64 bytes packet– Throughput = 512 Mbps– Shared by 10 ports: 51.2Mbps

Page 35: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Hardware switches

• Ports communicate with the outside world– Eg, maintains VC tables

• Switching fabric is simple and fast

Page 36: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Performance bottlenecks

• Input port– Line speed: 2.48 Gbps

• 2.48x109/(64x8) = 4.83 Mpps

• Buffering– Head of line blocking– May limit throughput to only 59%– Use output buffers or sophisticated buffer

management algorithms to improve performance

Page 37: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Fabrics

• Shared bus– The workstation switch

• Shared memory– Input ports read packets to shared memory

– Output ports read them out to links

Page 38: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Fabrics

• Cross bar– Each output ports need to accept from all input

ports

Page 39: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Fabrics

• Self routing– a self-routing header

added by the input port

– Most scalable

– Often built from 2x2 switching units

Page 40: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

An example of self-routing

• 3-bit numbers are self-routing headers• Multiple 2x2 switching elements

– 0: upper output; 1: lower output

Page 41: CPS 356: Introduction to Computer Networks Lecture 7: Switching technologies Ch 2.8.2, 3.1, 3.4 Xiaowei Yang xwy@cs.duke.edu

Summary• Types of switching

– Datagram• Forwarding table• Simple, difficult to have QoS

– Virtual circuit• Datagram for connection setup• Smaller VC identifiers

– Source routing• Packets carry forwarding information• Variable header length

• Switching hardware design– Shared bus, shared memory, cross-bar, self-routing

• Next lecture– How is forwarding table computed?– ATM network


Top Related