Switching and Routing Outline Routing overview Store-and-Forward switches Virtual circuits vs. Datagram switching Fall, 2001 CS 640 1 Internet Structure Large corporation “Consumer ” ISP Peering point Backbone service provider “ Consumer” ISP Large corporation Peering point “Consumer”ISP Small corporation Fall, 2001 CS 640 2 Routing Overview • Up to now we have considered applications and the transport layer and assumed the network knows how to get packets from host A to host B • We’re now moving down to the network layer of the protocol stack • Routing is the task of determining how to get packets from host A to host B through a series of hops • We will consider routing from two perspectives – Intra-domain • OSPF, RIP – Inter-domain • BGP Fall, 2001 CS 640 3 Scalable Networks • Switch – forwards packets from input port to output port – port selected based on address in packet header T3 T3 STS-1 Input ports Switch T3 T3 STS-1 Output ports • Advantages – cover large geographic area (tolerate latency) – support large numbers of hosts (scalable bandwidth) • How does the switch decide which port to place packets? Fall, 2001 CS 640 4 General Routing Methods • Datagram or connectionless – Make sure each packet has enough info to enable switching decision • Virtual circuit or connection-oriented – Circuit is constructed before packets are sent • Source routing – Less common but simple – All data about route is provided by source host • Assume all end nodes have addresses • Assume ports on switches are either have a number or name of switch to which it is attached Fall, 2001 CS 640 5 Source Routing 0 Sw itch 1 3 0 1 3 2 Sw itch 2 2 3 0 1 3 1 1 2 1 3 0 0 Host A 0 1 3 1 0 Sw itch 3 3 2 Fall, 2001 CS 640 Host B 6 Virtual Circuit Switching • Explicit connection setup (and tear-down) phase • Subsequence packets follow same circuit • Sometimes called connection-oriented model 0 Switch 1 1 3 2 3 5 • Analogy: phone call • Each switch maintains a VC table Fall, 2001 11 2 Switch 2 1 0 Host A 7 1 Virtual circuit identifier CS 640 0 Switch 3 3 4 2 Host B 7 Datagram Switching • No connection setup phase • Each packet forwarded independently • Sometimes called connectionless model Host D • Analogy: postal system • Each switch maintains a forwarding (routing) table Host E 0 Switch 1 3 Host C Host F 1 2 Switch 2 2 3 1 0 Host A Host G 1 0 Switch 3 Host B 3 2 Host H Fall, 2001 CS 640 8 Virtual Circuit Model • Typically wait full RTT for connection setup before sending first data packet. • While the connection request contains the full address for destination, each data packet contains only a small identifier, making the per-packet header overhead small. • If a switch or a link in a connection fails, the connection is broken and a new one needs to be established. • Connection setup provides an opportunity to reserve resources. Fall, 2001 CS 640 9 Datagram Model • There is no round trip time delay waitint for connection setup; a host can send data as soon as it is ready. • Source host has no way of knowing if the network is capable of delivering a packet or if the destination host is even up. • Since packets are treated independently , it is possible to route around link and node failures. • Since every packet must carry the full address of the destination, the overhead per packet is higher than for the connection-oriented model. Fall, 2001 CS 640 10 Scalable Routing • Forwarding vs Routing – forwarding: to select an output port based on destination address and routing table – routing: process by which routing table is built • Network as a Graph A 6 1 3 4 C 2 1 B 9 E F 1 D • Problem: Find lowest cost path between two nodes • Factors – static: topology – dynamic: load Fall, 2001 CS 640 11