* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Introduction
Piggybacking (Internet access) wikipedia , lookup
Point-to-Point Protocol over Ethernet wikipedia , lookup
Distributed firewall wikipedia , lookup
Backpressure routing wikipedia , lookup
Network tap wikipedia , lookup
Computer network wikipedia , lookup
Serial digital interface wikipedia , lookup
List of wireless community networks by region wikipedia , lookup
Airborne Networking wikipedia , lookup
Internet protocol suite wikipedia , lookup
Asynchronous Transfer Mode wikipedia , lookup
Cracking of wireless networks wikipedia , lookup
Multiprotocol Label Switching wikipedia , lookup
Wake-on-LAN wikipedia , lookup
IEEE 802.1aq wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
Deep packet inspection wikipedia , lookup
Introduction Vahid Tabatabaee Fall 2007 ENTS689L: Packet Processing and Switching Introduction 1 References Communication Networks: Fundmantal Concepts and Key Architectures Author: A. Leon-Garcia, I. Widjaja Publisher: McGraw-Hill Internetworking with TCP/IP vol. I Principles, Protocols, and Architecture Author: Douglas E. Comer Publisher: Prentice-Hall Title: Network Processors Architectures, Protocols, and Platforms Author: Panos C. Lekkas Publisher: McGraw-Hill ENTS689L: Packet Processing and Switching Introduction 2 User view of the internet It is a big network that every computer is attached to it Internet hosts ENTS689L: Packet Processing and Switching Introduction 3 Internet view in a networking course: routers Physical net hosts ENTS689L: Packet Processing and Switching Introduction 4 Physical Network (Ethernet) ENTS689L: Packet Processing and Switching Introduction Source: http://www.fiber-optics.info/articles/telecom-nets.htm 5 Physical Network (ISP WAN) Source: http://www.cisco.com/univercd/cc/td/doc/product/aggr/10000/swconfig/swref/tech-edg/ch1ovw.htm ENTS689L: Packet Processing and Switching Introduction 6 Router In this course we talk about how packets are processed and forwarded in routers Line and Switch Cards SD Power CISCO SYSTEMS Cisco AS5800 SERIES Source: http://www.cisco.com/en/US/products/hw/routers/ps167/products_tech_note09186a00801e1dc2.shtml ENTS689L: Packet Processing and Switching Introduction 7 In this course We discuss: Basic components in a router The basic processes in a router The basic requirements of router Some network protocols Some example architectures We do NOT discuss: Hardware design Software design Router programming All other good stuff ! ENTS689L: Packet Processing and Switching Introduction 8 Review of Networking ENTS689L: Packet Processing and Switching Introduction 9 Layering in a Network Layering simplifies design, implementation, and testing Protocol in each layer can be designed separately ENTS689L: Packet Processing and Switching Introduction 10 7-Layer OSI Reference Model Application Application End-to-End Protocols Application Layer Application Layer Presentation Layer Presentation Layer Session Layer Session Layer Transport Layer Transport Layer Network Layer Network Layer Network Layer Network Layer Data Link Layer Data Link Layer Data Link Layer Data Link Layer Physical Layer Physical Layer Physical Layer Physical Layer ENTS689L: Packet Processing and Switching Communicating Introduction End Systems One or More Network Nodes 11 Physical Layer Transfers bits across link Definition & specification of the physical aspects of a communications link Mechanical: cable, plugs, pins... Electrical/optical: modulation, signal strength, voltage levels, bit times, … functional/procedural: how to activate, maintain, and deactivate physical links… Ethernet, DSL, cable modem, telephone modems… Twisted-pair cable, coaxial cable optical fiber, radio, infrared, … ENTS689L: Packet Processing and Switching Introduction 12 Data Link Layer Transfers frames across direct connections Groups bits into frames Detection of bit errors; Retransmission of frames Activation, maintenance, & deactivation of data link connections Medium access control for local area networks Flow control Data Link Layer Physical Layer ENTS689L: Packet Processing and Switching Introduction frames bits Data Link Layer Physical Layer 13 Network Layer Transfers packets across multiple links and/or multiple networks Addressing must scale to large networks Nodes jointly execute routing algorithm to determine paths across the network Forwarding transfers packet across a node Congestion control to deal with traffic surges Congestion vs. Flow control Connection setup, maintenance, and teardown when connection-based ENTS689L: Packet Processing and Switching Introduction 14 Internetworking Ethernet LAN Internetworking is part of network layer and provides transfer of packets possibly dissimilar networks across multiple Gateways (routers) direct packets across networks ATM ATM Network Switch ATM HSwitch ATM Switch H G Net Net 11 H Net Net 33 G G G Net 2 G = gateway H = host ENTS689L: Packet Processing and Switching Introduction ATM Switch Net55 Net G Net 4 G H 15 Transport Layer Transfers data (not just packet) end-to-end from process in a machine to process in another machine Reliable stream transfer or quick-and-simple single-block transfer Port numbers enable multiplexing Message segmentation and reassembly Connection setup, maintenance, and release Transport Layer Network Layer Transport Layer Network Layer ENTS689L: Packet Processing and Switching Introduction Communication Network Layer Network Layer 16 Network Headers and trailers Each protocol uses a header that carries addresses, sequence numbers, flag bits, length indicators, etc… CRC check bits may be appended for error detection Application Application APP DATA Application Layer AH APP DATA Application Layer Transport Layer TH AH APP DATA Transport Layer Network Layer NH TH AH APP DATA Network Layer Data Link Layer DH NH TH AH APP DATA CRC Physical Layer ENTS689L: Packet Processing and Switching Introduction bits Data Link Layer Physical Layer 17 Why Internetworking To build a “network of networks” or internet operating over multiple, coexisting, different network technologies providing ubiquitous connectivity through IP packet transfer achieving huge economies of scale H H Net51 Net G Net53 Net G G G H Net52 Net Net55 Net G Net54 Net G H ENTS689L: Packet Processing and Switching Introduction 18 Why Internetworking To provide universal communication services independent of underlying network technologies providing common interface to user applications H H Net51 Net G Net53 Net G G G H Net52 Net Net55 Net G Net54 Net G H ENTS689L: Packet Processing and Switching Introduction 19 Internet Protocol Approach IP packets transfer information across Internet Host A IP → router→ router…→ router→ Host B IP IP layer in each router determines next hop (router) Network interfaces transfer IP packets across networks Host A Router Transport Layer Internet Layer Internet Layer Network Interface Router Internet Layer Net51 Net Router Network Interface Network Interface Internet Layer Net54 Net Net52 Net ENTS689L: Packet Processing and Switching Introduction Network Interface Host B Transport Layer Internet Layer Network Interface Net53 Net 20 How to create the routing tables Need information on state of links Link up/down; congested; delay or other metrics Need to distribute link state information using a routing protocol What information is exchanged? How often? Exchange with neighbors; Broadcast or flood Need to compute routes based on information Single metric; multiple metrics Single route; alternate routes ENTS689L: Packet Processing and Switching Introduction 21 Routing algorithm requirements Responsiveness to changes Topology or bandwidth changes, congestion Rapid convergence of routers to consistent set of routes Freedom from persistent loops Optimality Resource utilization, path length Robustness Continues working under high load, congestion, faults, equipment failures, incorrect implementations Simplicity Efficient software implementation, reasonable processing load ENTS689L: Packet Processing and Switching Introduction 22 Distributed Routing Routes determined by routers using distributed algorithm State information exchanged by routers Adapts to topology and other changes Better scalability ENTS689L: Packet Processing and Switching Introduction 23 Routing Table in Hop-by-Hop routing Every router decides where to send the packet next by looking at the packet header (dest. address, source address, CoS, …) Node 3 Node 1 Destination Next node 2 2 3 3 4 4 5 2 6 2 Destination 1 3 4 5 6 Node 2 Next node 1 1 4 5 5 Destination 1 2 4 5 6 Next node 1 4 4 6 6 Destination 1 2 3 5 6 Node 4 Next node 1 2 3 5 3 ENTS689L: Packet Processing and Switching Introduction Node 6 Destination Next node 1 3 2 5 3 3 4 3 5 5 Node 5 Destination Next node 1 4 2 2 3 4 4 4 6 6 24 Non-Hierarchical Addresses and Routing No relationship between addresses & routing proximity Routing tables require 16 entries each 0000 0111 1010 1101 1 0001 0100 1011 1110 4 3 R2 R1 5 2 0011 0110 1001 1100 ENTS689L: Packet Processing and Switching Introduction 0000 0111 1010 … 1 1 1 … 0001 0100 1011 … 4 4 4 … 0011 0101 1000 1111 25 Hierarchical Addresses and Routing Prefix indicates network where host is attached Routing tables require 4 entries each Can we do better than this? 0000 0001 0010 0011 1 0100 0101 0110 0111 4 3 R2 R1 5 2 1000 1001 1010 1011 ENTS689L: Packet Processing and Switching Introduction 00 01 10 11 1 3 2 3 00 01 10 11 3 4 3 5 1100 1101 1110 1111 26 Shortest Path Routing Many possible paths connect any given source to any given destination Routing involves the selection of the path to be used to accomplish a given transfer Typically it is possible to attach a cost or distance to a link connecting two nodes Routing can then be posed as a shortest path problem ENTS689L: Packet Processing and Switching Introduction 27 Routing Metrics Means for measuring desirability of a path Path Length = sum of costs or distances Possible metrics Hop count: rough measure of resources used Reliability: link availability; BER Delay: sum of delays along path; complex & dynamic Bandwidth: “available capacity” in a path Load: Link & router utilization along path Cost: $$$ ENTS689L: Packet Processing and Switching Introduction 28 Shortest Path Approaches Distance Vector Protocols Neighbors exchange list of distances to destinations Best next-hop determined for each destination Ford-Fulkerson (distributed) shortest path algorithm Link State Protocols Link state information flooded to all routers Routers have complete topology information Shortest path (& hence next hop) calculated Dijkstra (centralized) shortest path algorithm ENTS689L: Packet Processing and Switching Introduction 29 Distance Vector Routing i only has local info from neighbors Dj' San Jose j' Cij' i Di j Cij Cij” j" ENTS689L: Packet Processing and Switching Introduction Dj Dj" Pick current shortest path 30 Why Distance Vector Works SJ sends accurate info 3 Hops From SJ 2 Hops From SJ ENTS689L: Packet Processing and Switching Introduction 1 Hop From SJ San Jose Hop-1 nodes Accurate info about SJ calculate current ripples across network, (next hop, dist), & Shortest Path Converges send to neighbors 31 Bellman-Ford Algorithm Consider computations for one destination d Initialization Each node table has 1 row for destination d Distance of node d to itself is zero: Dd=0 Distance of other node j to d is infinite: Dj=, for j d Next hop node nj = -1 to indicate not yet defined for j d Send Step Send new distance vector to immediate neighbors across local link Receive Step At node j, find the next hop that gives the minimum distance to d, Minj { Cij + Dj } Replace old (nj, Dj(d)) by new (nj*, Dj*(d)) if new next node or distance Go to send step ENTS689L: Packet Processing and Switching Introduction 32 Iteration Node 1 Node 2 Node 3 Node 4 Node 5 Initial (-1, ) (-1, ) (-1, ) (-1, ) (-1, ) 1 2 3 Table entry @ node 1 for dest SJ Table entry @ node 3 for dest SJ 2 3 1 5 San Jose 1 2 4 3 1 2 ENTS689L: Packet Processing and Switching Introduction 6 3 4 5 2 33 Iteration Node 1 Node 2 Node 3 Node 4 Node 5 Initial (-1, ) (-1, ) (-1, ) (-1, ) (-1, ) 1 (-1, ) (-1, ) (6,1) (-1, ) (6,2) 2 3 D3=D6+1 n3=6 D6=0 3 1 2 1 5 1 2 0 4 3 1 2 D5=D64+2 ENTS689L: Packet Processing and Switching n =6 5 Introduction 6 3 San Jose 2 5 2 D6=0 34 Iteration Node 1 Node 2 Node 3 Node 4 Node 5 Initial (-1, ) (-1, ) (-1, ) (-1, ) (-1, ) 1 (-1, ) (-1, ) (6, 1) (-1, ) (6,2) 2 (3,3) (5,6) (6, 1) (3,3) (6,2) 3 3 1 2 3 1 5 3 1 2 0 4 3 1 2 6 ENTS689L: Packet Processing and Switching Introduction 6 3 4 5 San Jose 2 2 35 Iteration Node 1 Node 2 Node 3 Node 4 Node 5 Initial (-1, ) (-1, ) (-1, ) (-1, ) (-1, ) 1 (-1, ) (-1, ) (6, 1) (-1, ) (6,2) 2 (3,3) (5,6) (6, 1) (3,3) (6,2) 3 (3,3) (4,4) (6, 1) (3,3) (6,2) 1 3 2 3 1 5 3 1 2 0 4 3 1 2 6 4 ENTS689L: Packet Processing and Switching Introduction 6 3 4 5 San Jose 2 2 36 Counting to Infinity Problem (a) 1 (b) 1 1 1 2 1 2 1 3 3 4 1 4 X Nodes believe best path is through each other (Destination is node 4) Update Node 1 Node 2 Node 3 Before break (2,3) (3,2) (4, 1) After break (2,3) (3,2) (2,3) 1 (2,3) (3,4) (2,3) 2 (2,5) (3,4) (2,5) 3 (2,5) (3,6) (2,5) 4 (2,7) (3,6) (2,7) 5 (2,7) (3,8) (2,7) … … … … ENTS689L: Packet Processing and Switching Introduction 37 Problem: Bad News Travels Slowly Remedies Split Horizon Do not report route to a destination to the neighbor from which route was learned Poisoned Reverse Report route to a destination to the neighbor from which route was learned, but with infinite distance Breaks erroneous direct loops immediately Does not work on some indirect loops ENTS689L: Packet Processing and Switching Introduction 38 Split Horizon with Poison Reverse (a) (b) 1 1 1 1 2 2 1 1 3 3 1 X 4 4 Nodes believe best path is through each other Update Node 1 Node 2 Node 3 Before break (2, 3) (3, 2) (4, 1) After break (2, 3) (3, 2) (-1, ) Node 2 advertizes its route to 4 to node 3 as having distance infinity; node 3 finds there is no route to 4 1 (2, 3) (-1, ) (-1, ) Node 1 advertizes its route to 4 to node 2 as having distance infinity; node 2 finds there is no route to 4 2 (-1, ) (-1, ) (-1, ) Node 1 finds there is no route to 4 ENTS689L: Packet Processing and Switching Introduction 39 Link-State Algorithm Basic idea: two step procedure Each source node gets a map of all nodes and link metrics (link state) of the entire network Find the shortest path on the map from the source node to all destination nodes Broadcast of link-state information Every node i in the network broadcasts to every other node in the network: ID’s of its neighbors: Ni=set of neighbors of i Distances to its neighbors: {Cij | j Ni} Flooding is a popular method of broadcasting packets ENTS689L: Packet Processing and Switching Introduction 40 Dijkstra Algorithm: Finding shortest paths in order Closest node to s is 1 hop away 2nd closest node to s is 1 hop away from s or w” 3rd closest node to s is 1 hop away from s, w”, or x Find shortest paths from source s to all other destinations w' z w s x w" ENTS689L: Packet Processing and Switching Introduction z' x' 41 Dijkstra’s algorithm N: set of nodes for which shortest path already found Initialization: (Start with source node s) N = {s}, Ds = 0, “s is distance zero from itself” Dj=Csj for all j s, distances of directly-connected neighbors Step A: (Find next closest node i) Find i N such that Di = min Dj for j N Add i to N If N contains all the nodes, stop Step B: (update minimum costs) For each node j N Minimum distance from Dj = min (Dj, Di+Cij) j through node i in N Go to Step A ENTS689L: Packet Processing and Switching Introduction s to 42 Execution of Dijkstra’s algorithm 2 1 5 1 6 5 2 3 3 2 4 4 3 1 2 2 5 N D2 D3 Initial {1} 3 2 1 {1,3} 3 2 2 {1,2,3} 3 3 {1,2,3,6} 4 5 6 2 5 4 Iteration 1 3 2 3 4 1 1 3 2 D4 D5 D6 5 4 3 2 4 7 3 3 2 4 5 3 {1,2,3,4,6} 3 2 4 5 3 {1,2,3,4,5,6} 3 2 4 5 3 ENTS689L: Packet Processing and Switching Introduction 43 Shortest Paths in Dijkstra’s Algorithm 2 1 2 3 3 2 2 2 3 6 2 4 1 5 4 1 1 2 2 6 2 3 3 ENTS689L: 2Packet Processing and Switching Introduction 5 4 1 3 5 4 1 2 2 3 2 6 4 1 3 5 5 5 1 1 2 3 2 5 3 4 4 3 1 2 2 2 3 4 6 5 1 4 1 2 3 1 2 5 4 3 6 5 2 1 3 3 4 1 2 1 6 5 1 1 3 2 3 2 4 44 5 Reaction to Failure If a link fails, Router sets link distance to infinity & floods the network with an update packet All routers immediately update their link database & recalculate their shortest paths Recovery very quick But watch out for old update messages Add time stamp or sequence # to each update message Check whether each received update message is new If new, add it to database and broadcast If older, send update message on arriving link ENTS689L: Packet Processing and Switching Introduction 45 Why is Link State Better? Fast, loopless convergence Support for precise metrics, and multiple metrics if necessary (throughput, delay, cost, reliability) Support for multiple paths to a destination algorithm can be modified to find best two paths ENTS689L: Packet Processing and Switching Introduction 46 Open Shortest Path First OSPF is a well known routing protocol for IP (RFC 2328 (v2)) OSPF is a link state routing protocol Enables each router to learn complete network topology Each router monitors the link state to each neighbor and floods the linkstate information to other routers Each router builds an identical link-state database Allows router to build shortest path tree with router as root OSPF typically converges faster than RIP when there is a failure in the network ENTS689L: Packet Processing and Switching Introduction 47 Flooding Used in OSPF to distribute link state (LS) information Forward incoming packet to all ports except where packet came in Packet eventually reaches destination as long as there is a path between the source and destination Generates exponential number of packet transmissions Approaches to limit # of transmissions: Use a TTL at each packet; won’t flood if TTL is reached Each router adds its identifier to header of packet before it floods the packet; won’t flood if its identifier is detected Each packet from a given source is identified with a unique sequence number; won’t flood if sequence number is same ENTS689L: Packet Processing and Switching Introduction 48 Example OSPF Topology 10.5.1.2 10.5.1.4 10.5.1.1 10.5.1.6 10.5.1.3 10.5.1.5 At steady state: All routers have same LS database Know how many routers in network Interfaces & links between routers Cost of each link Occasional Hello messages (10 sec) & LS updates sent (30 min) ENTS689L: Packet Processing and Switching Introduction 49 Exterior Gateway Protocols Within each AS, there is a consistent set of routes connecting the constituent networks The Internet is woven into a coherent whole by Exterior Gateway Protocols (EGPs) that operate between AS’s EGP enables two AS’s to exchange routing information about: The networks that are contained within each AS The AS’s that can be reached through each AS EGP path selection guided by policy rather than path optimality Trust, peering arrangements, etc ENTS689L: Packet Processing and Switching Introduction 50 BGP Example Only BGP routers are shown R2 R3 AS2 N1 reachable through AS3 R1 AS1 R4 N1 AS3 • R4 advertises that network N1 can be reached through AS3 • R3 examines announcement & applies policy to decide whether it will forward packets to N1 through R4 • If yes, routing table updated in R3 to indicate R4 as next hop to N1 • BGP propagates N1 reachability information through AS2 ENTS689L: Packet Processing and Switching Introduction 51 BGP Example R2 N1 reachable through AS2 R3 AS2 R1 R4 N1 AS1 • BGP routers within an AS, e.g. R3 and R2, are kept consistent • Suppose AS2 willing to handle transit packets from AS1 to N1 • R2 advertises to AS1 the reachability of N1 through AS2 • R1 applies its policy to decide whether to send to N1 via AS2 ENTS689L: Packet Processing and Switching Introduction AS3 52 Peering and Inter-AS connectivity Peering Centre Tier 1 ISP (Transit AS) Tier 1 ISP (Transit AS) AS Tier 2 (transit AS) Tier 2 (transit AS) AS AS AS Content or Application Service Provider (Non-transit) AS Tier 2 (transit AS) AS AS • Non-transit AS’s (stub & multihomed) do not carry transit traffic • Tier 1 ISPs peer with each other, privately & peering centers • Tier 2 ISPs peer with each other & obtain transit services from Tier 1s; Tier 1’s carry transit traffic between their Tier 2 customers • Client AS’s obtain service from Tier 2 ISPs ENTS689L: Packet Processing and Switching Introduction 53 EGP Requirements Scalability to global Internet Provide connectivity at global scale Link-state does not scale Should promote address aggregation Fully distributed EGP path selection guided by policy rather than path optimality Trust, peering arrangements, etc EGP should allow flexibility in choice of paths ENTS689L: Packet Processing and Switching Introduction 54 BGP Features BGP is path vector protocol: advertises sequence of AS numbers to the destination network Path vector info used to prevent routing loops BGP enforces policy through selection of different paths to a destination and by control of redistribution of routing information Uses CIDR to support aggregation & reduction of routing information ENTS689L: Packet Processing and Switching Introduction 55 iBGP & eBGP R eBGP R R R R R iBGP iBGP eBGP iBGP eBGP iBGP iBGP iBGP R eBGP R eBGP to exchange reachability information in different AS’s eBGP peers directly connected iBGP to ensure net reachability info is consistent among the BGP speakers in the same AS usually not directly connected iBGP speakers exchange info learned from other iBGP speakers, and thus fully meshed ENTS689L: Packet Processing and Switching Introduction 56 Path Selection Each BGP speaker Evaluates paths to a destination from an AS border router Selects the best that complies with policies Advertises that route to all BGP neighbors BGP assigns a preference order to each path & selects path with highest value; BGP does not keep a cost metric to any path When multiple paths to a destination exist, BGP maintains all of the paths, but only advertises the one with highest preference value ENTS689L: Packet Processing and Switching Introduction 57 BGP Policy Examples of policy: Never use AS X Never use AS X to get to a destination in AS Y Never use AS X and AS Y in the same path ENTS689L: Packet Processing and Switching Introduction 58