* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download 3rd Edition: Chapter 4
Asynchronous Transfer Mode wikipedia , lookup
Distributed firewall wikipedia , lookup
Deep packet inspection wikipedia , lookup
IEEE 802.1aq wikipedia , lookup
Piggybacking (Internet access) wikipedia , lookup
Multiprotocol Label Switching wikipedia , lookup
Wake-on-LAN wikipedia , lookup
Network tap wikipedia , lookup
Zero-configuration networking wikipedia , lookup
Computer network wikipedia , lookup
Cracking of wireless networks wikipedia , lookup
Internet protocol suite wikipedia , lookup
Airborne Networking wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
Network Layer CS 381 3/29/2017 2-1 Chapter 4: outline 4.1 Introduction 4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP IPv6 4.5 routing algorithms link state distance vector hierarchical routing 4.6 routing in the Internet RIP OSPF BGP 4.7 broadcast and multicast routing Network Layer 4-2 Hierarchical routing Our routing study thus far - idealization All routers identical • • Execute same routing algorithms Same hardware specifications Network “flat” No tiers No packet priority … not true in practice Network Layer 4-3 Hierarchical routing Scale: with billions of destinations: 128 items are added to the Internet every second! • Calculated by CISCO • 5,529,600 new devices connected by the end of today. Can’t store all destinations in routing tables! Space requirements too high Routing table exchange would swamp links! No bandwidth left for sending data Network Layer 4-4 Hierarchical routing Administrative autonomy: Internet: Network of networks • Think of how WKU controls its LAN (campus network) – Policies, bandwidth restrictions, authentication, security, etc. Organizations desire to run specific routing protocols and hide aspects of it’s network Routing protocols must be universal, or at least adhere to a set of defined functions Ideally, an organization should be able to: Run and administer its network as it wishes Able to connect its network to other networks Network Layer 4-5 Hierarchical routing “Autonomous Systems” (AS) Group of routers under the same admin control • Same ISP, company, organization Routers in same AS run same routing protocol Intra-Autonomous System routing protocol • Ex: LS or DV Routers in different AS can run different intra-AS routing protocol Multiple AS need to connect to each other in some way Gateway Router: At “edge” of its own AS Has links to gateway routers in other ASs Network Layer 4-6 Interconnected ASes Forwarding table configured by both intra- and inter-AS routing algorithm intra-AS sets entries for internal destinations inter-AS & intra-AS sets entries for external destinations 3c 3a 3b 2c 2a AS3 1c 1a 2b AS2 1b 1d Intra-AS Routing algorithm AS1 Inter-AS Routing algorithm Forwarding table Network Layer 4-7 Inter-AS tasks Suppose router in AS1 AS1 must: receives datagram 1. Learn which destinations are destined outside of reachable through AS2, AS1: which through AS3 Router should forward 2. Propagate this reachability packet to gateway info to all routers in AS1 router, but which one? Job of inter-AS routing! 3c 3b other networks 3a AS3 2c 1c 1a AS1 1d 2a 1b 2b other networks AS2 Network Layer 4-8 Inter-AS tasks AS learns about a destination from a neighboring AS The AS can advertise this information to other routers Steps for adding an outside destination: 1. Learn from inter-AS communication that destination is reachable by multiple gateways 2. Use routing info to determine least-cost paths to each gateway 3. Choose gateway that has the least cost 4. Determine interface that leads to least cost gateway 5. Update forwarding table with this information Network Layer 4-9 Chapter 4: outline 4.1 Introduction 4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP IPv6 4.5 routing algorithms link state distance vector hierarchical routing 4.6 routing in the Internet RIP OSPF BGP 4.7 broadcast and multicast routing Network Layer 4-10 Intra-AS Routing Also known as Interior Gateway protocols (IGP) Protocols used to determine how routing is performed within an AS. Most common intra-AS routing protocols: RIP: Routing Information Protocol OSPF: Open Shortest Path First IGRP: Interior Gateway Routing Protocol Cisco proprietary Network Layer 4-11 RIP (Routing Information Protocol) Included in BSD-UNIX distribution in 1982 Distance vector algorithm Distance metric: # hops (max = 15 hops), each link has cost 1 DVs exchanged with neighbors every 30 sec in response message (aka advertisement) Each advertisement: list of up to 25 destination subnets (in IP addressing sense) v u A B w x z C D y from router A to destination subnets: subnet hops u 1 v 2 w 2 x 3 y 3 z 2 Network Layer 4-12 RIP: example z w A x y B D C routing table in router D destination subnet next router # hops to dest w y z x A B B -- 2 2 7 1 …. …. .... Network Layer 4-13 RIP: example dest w x z …. w A A-to-D advertisement next hops 1 1 C 4 … ... x z y B D C routing table in router D destination subnet next router # hops to dest w y z x A B A B -- 2 2 5 7 1 …. …. .... Network Layer 4-14 RIP: link failure, recovery If no advertisement heard after 180 sec neighbor/link declared dead Routes via neighbor invalidated New advertisements sent to neighbors based on timeout Neighbors in turn send out new advertisements (if tables changed) Link failure info quickly (?) propagates to entire net Network Layer 4-15 OSPF (Open Shortest Path First) Another Intra-AS routing protocol “Open” Publicly available (RFC 2328) Uses link state algorithm Topology map at each node Route computation uses Dijkstra’s algorithm OSPF advertisement: Shortest-path tree to all destinations in AS Advertisements flooded to entire AS Carried in OSPF messages directly over IP (rather than TCP or UDP Typically deployed in upper-tier ISPs RIP deployed in lower-tier ISPs Conceived as the successor to RIP Network Layer 4-16 OSPF “advanced” features (not in RIP) Security: All OSPF messages authenticated (to prevent malicious intrusion) Multiple same-cost paths allowed: Single path to destination not needed when multiple equal-cost paths exist • Only one path in RIP Integrated uni- and multicast support: hierarchical OSPF in large domains: Ability to structure ASs Network Layer 4-17 Internet inter-AS routing: BGP BGP (Border Gateway Protocol): “Glue that holds the Internet together” Most widely used inter-domain routing protocol BGP provides each AS a means to: External Border Gateway Protocol (eBGP): • Obtain subnet reachability information from neighboring ASs. Internal Border Gateway Protocol (iBGP): • Propagate reachability information to all AS-internal routers. Allows subnet to advertise its existence to rest of Internet: “I am here” Network Layer 4-18 BGP basics BGP session: two BGP routers (“peers”) exchange BGP messages: Advertising paths to different destination networks Exchanged over semi-permanent TCP connections • When AS3 advertises a destination network to AS1: • AS3 promises it will forward datagrams towards that network • AS3 can aggregate destinations in its advertisement 3c 3b other networks 3a BGP message AS3 2c 1c 1a AS1 1d 2a 1b 2b other networks AS2 Network Layer 4-19 How does entry get in forwarding table? Summary 1. Router becomes aware of IP subnet prefix via BGP route advertisements from other routers 2. Determine router output port for prefix Use OSPF to find best intra-AS route leading to best inter-AS route Use BGP route selection to find best inter-AS route Router identifies port/link for that best route 3. Enter prefix-port entry in forwarding table Network Layer 4-23 Why different Intra-, Inter-AS routing ? Policy: inter-AS: admin wants control over how its traffic routed, who routes through its net. intra-AS: single admin, so no policy decisions needed Scale: hierarchical routing saves table size, reduced update traffic Performance: intra-AS: can focus on performance inter-AS: policy may dominate over performance Network Layer 4-21 Chapter 4: outline 4.1 Introduction 4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP IPv6 4.5 routing algorithms link state distance vector hierarchical routing 4.6 routing in the Internet RIP OSPF BGP 4.7 broadcast and multicast routing Network Layer 4-22 Broadcast routing Deliver packets from source to all other nodes Source duplication is inefficient: duplicate duplicate creation/transmission R1 R1 duplicate R2 R2 R3 R4 source duplication R3 R4 in-network duplication Source duplication: how does source determine all recipient addresses? Network Layer 4-23 In-network duplication Flooding: when node receives broadcast packet, sends copy to all neighbors Problems: • Cycles, broadcast storms Controlled flooding: node only broadcasts packet if it hasn’t broadcast same packet before Router keeps track of packet IDs already broadcasted Or reverse path forwarding (RPF): Router forwards on all links except the link which received the broadcast packet Spanning tree: No redundant packets received by any node Complexity associated with building and maintaining the spanning tree instead of source duplication Network Layer 4-24 Can be accomplished using Dijkstra’s Algorithm Multicast routing: problem statement Multicast service: Packets from one or more senders delivered to only a subset of network nodes Goal: Find a tree (or trees) connecting routers that have local multicast group members Isolated Tree: Not all paths between routers used Some multicast members not connected Shared Tree: Same tree used by all group members Network Layer 4-25 Tunneling of Mcast Data Q: How to connect “islands” of multicast routers in a “sea” of unicast routers? physical topology logical topology Mcast datagram encapsulated inside “normal” (non-multicast-addressed) datagram Normal IP datagram sent through “tunnel” via regular IP unicast to receiving Mcast router Recall IPv6 inside IPv4 tunneling Receiving Mcast router unencapsulates to get Mcast datagram Network Layer 4-26 Network Layer Summary Network Layer 4-27 Two key network-layer functions Forwarding: Move packets from router’s input to appropriate router output Analogy: Routing: Determine route taken by packets from source to destination. Forwarding: process of getting through single router Routing: process of planning trip from source to destination Network Layer 4-28 Interplay between routing and forwarding routing algorithm routing algorithm determines end-end-path through network local forwarding table header value output link forwarding table determines local forwarding at this router 0100 0101 0111 1001 3 2 2 1 value in arriving packet’s header 0111 1 3 2 Network Layer 4-29 Connection, connection-less service datagram network provides network-layer connectionless service virtual-circuit network provides network-layer connection service Analogous to TCP/UDP connection-oriented / connectionless transport-layer services, but: service: host-to-host no choice: network provides one or the other implementation: in network core Network Layer 4-30 Datagram networks no call setup at network layer routers: no state about end-to-end connections no network-level concept of “connection” packets forwarded using destination host address application transport network 1. send datagrams data link physical application transport 2. receive datagrams network data link physical Network Layer 4-31 Router architecture overview Two key router functions: Run routing algorithms/protocol (RIP, OSPF, BGP) Forwarding datagrams from incoming to outgoing link forwarding tables computed, pushed to input ports routing processor routing, management control plane (software) forwarding data plane (hardware) high-seed switching fabric router input ports router output ports Network Layer 4-32 The Internet network layer host, router network layer functions: transport layer: TCP, UDP IP protocol routing protocols network layer • addressing conventions • datagram format • packet handling conventions • path selection • RIP, OSPF, BGP forwarding table ICMP protocol • error reporting • router “signaling” link layer physical layer Network Layer 4-33 IP datagram format IP protocol version number header length (bytes) “type” of data max number remaining hops (decremented at each router) upper layer protocol to deliver payload to how much overhead? 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead 32 bits total datagram length (bytes) ver head. type of len service length 16-bit identifier upper time to layer live fragment flgs offset header checksum for fragmentation/ reassembly 32 bit source IP address 32 bit destination IP address options (if any) data (variable length, typically a TCP or UDP segment) e.g. timestamp, record route taken, specify list of routers to visit. Network Layer 4-34 DHCP: Dynamic Host Configuration Protocol Goal: allow host to dynamically obtain its IP address from network server when it joins network can renew its lease on address in use allows reuse of addresses (only hold address while connected/“on”) support for mobile users who want to join network (more shortly) DHCP overview: host broadcasts “DHCP discover” msg [optional] DHCP server responds with “DHCP offer” msg [optional] host requests IP address: “DHCP request” msg DHCP server sends address: “DHCP ACK” msg Network Layer 4-35 NAT: network address translation rest of Internet local network (e.g., home network) 10.0.0/24 10.0.0.1 10.0.0.4 10.0.0.2 138.76.29.7 10.0.0.3 all datagrams leaving local network have same single source NAT IP address: 138.76.29.7,different source port numbers datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual) Network Layer 4-36 A Link-State Routing Algorithm Dijkstra’s algorithm: network topology, link costs known to all nodes accomplished via “link state broadcast” all nodes have same info computes least cost paths from one node (‘source”) to all other nodes gives forwarding table for that node Creates minimum spanning tree notation: c(x,y): link cost from node x to y; = ∞ if not direct neighbors D(v): current value of cost of path from source to dest. v p(v): predecessor node along path from source to v N': set of nodes whose least cost path definitively known iterative: after k iterations, know least cost path to k destinations Network Layer 4-37 Distance vector algorithm Bellman-Ford equation (dynamic programming) let dx(y) := cost of least-cost path from x to y then dx(y) = min {c(x,v) + d (y) } v v cost from neighbor v to destination y cost to neighbor v min taken over all neighbors v of x Network Layer 4-38 Hierarchical routing our routing study thus far - idealization all routers identical network “flat” … not true in practice scale: with billions of destinations: can’t store all destinations in routing tables! routing table exchange would swamp links! administrative autonomy Internet = network of networks each network admin may want to control routing in its own network Network Layer 4-39 Chapter 4: done! 4.1 Introduction 4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol Understand principles behind datagram format network layer services: IPv4 addressing ICMP Network layer service models, IPv6 forwarding versus routing 4.5 routing algorithms how a router works, link state routing (path selection), distance vector broadcast, multicast hierarchical routing Implementation in the Internet 4.6 routing in the Internet RIP OSPF BGP 4.7 broadcast and multicast routing Network Layer 4-40