EA C 451 Internetworking Technologies Network Layer BITS
EA C 451 (Internetworking Technologies) Network Layer BITS Pilani|Dubai|Goa|Hyderabad Vishal Gupta Department of Computer Science and Information Systems Birla Institute of Technology and Science, Pilani
Ethernet Technology • Ethernet has: – – Addressing 48 bit MAC address. Maximum frame size of 1522 bytes. max frame size capacity Best effort delivery. Reliability different Frame Structure Following frame structure Other Aspects For internet, this is TCP/IP protocol suite Different Networks can differ on This requires an overlay protocol suite on top of these different networks BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
128. 143. 71. 21 is not on my local network. Sending a packet from Argon to Neon Therefore, I need to send the packet to my 128. 143. 71. 21 on my local network. default gateway withisaddress 128. 143. 137. 1 DNS: The is IPisthe address of Therefore, I can send the packet directly. ARP: What the. IPMAC of“neon. tcpip-lab. edu”? is address 128. 143. 137. 1? ARP: Theof. MAC address of 128. 143. 71. 21 128. 143. 137. 1 is 00: e 0: f 9: 23: a 8: 20 ARP: What is the MAC ARP: Theof. MAC address of address 128. 143. 71. 21? 128. 143. 137. 1 is 00: 20: af: 03: 98: 28 frame BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Network Layer • 4. 1 Introduction • 4. 3 What’s inside a router • 4. 4 IP: Internet Protocol – – Datagram format IPv 4 addressing ICMP IPv 6 • 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
Network layer • transport segment from sending to receiving host • on sending side encapsulates segments into datagrams • on rcving side, delivers segments to transport layer • network layer protocols in every host, router • Router examines header fields in all IP datagrams passing through it application transport network data link physical Network Layer network data link physical network data link physical application transport network data link physical
Key Network-Layer Functions • forwarding: move packets from router’s input to appropriate router output • routing: determine route taken by packets from source to dest. analogy: r routing: process of planning trip from source to dest r forwarding: process of getting through single interchange – Routing algorithms Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Interplay between routing and forwarding routing algorithm local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1 value in arriving packet’s header 0111 1 3 2 Network Layer
Chapter 4: Network Layer • 4. 1 Introduction • 4. 3 What’s inside a router • 4. 4 IP: Internet Protocol – – Datagram format IPv 4 addressing ICMP IPv 6 • 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
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 – packets between same source-dest pair may take different paths application transport network data link physical application transport network 2. Receive data link physical 1. Send data Network Layer
Chapter 4: Network Layer • 4. 1 Introduction • 4. 2 Virtual circuit and datagram networks • 4. 3 What’s inside a router • 4. 4 IP: Internet Protocol – – Datagram format IPv 4 addressing ICMP IPv 6 • 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
Router Architecture Overview Two key router functions: • • run routing algorithms/protocol (RIP, OSPF, BGP) forwarding datagrams from incoming to outgoing link Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Input Port Functions Physical layer: bit-level reception Data link layer: e. g. , Ethernet see chapter 5 Decentralized switching: • given datagram dest. , lookup output port using forwarding table in input port memory • goal: complete input port processing at ‘line speed’ • queuing: if datagrams arrive faster than forwarding rate into switch fabric Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Output Ports • • Buffering required when datagrams arrive from fabric faster than the transmission rate Scheduling discipline chooses among queued datagrams for transmission Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Output port queueing • buffering when arrival rate via switch exceeds output line speed • queueing (delay) and loss due to output port buffer overflow! Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Input Port Queuing • Fabric slower than input ports combined -> queueing may occur at input queues • Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward • queueing delay and loss due to input buffer overflow! Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Network Layer • 4. 1 Introduction • 4. 2 Virtual circuit and datagram networks • 4. 3 What’s inside a router • 4. 4 IP: Internet Protocol – – Datagram format IPv 4 addressing ICMP IPv 6 • 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
The Internet Network layer Host, router network layer functions: Transport layer: TCP, UDP Network layer IP protocol • addressing conventions • datagram format • packet handling conventions Routing protocols • path selection • RIP, OSPF, BGP forwarding table ICMP protocol • error reporting • router “signaling” Link layer physical layer Network Layer
Network Layer • 4. 1 Introduction • 4. 2 Virtual circuit and datagram networks • 4. 3 What’s inside a router • 4. 4 IP: Internet Protocol – – Datagram format IPv 4 addressing ICMP IPv 6 • 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
Datagram Header Format Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
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 with TCP? r 20 bytes of TCP r 20 bytes of IP r = 40 bytes + app layer overhead 32 bits ver head. type of len service 16 -bit identifier upper time to layer live length fragment flgs offset Internet checksum total datagram length (bytes) 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 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Datagram Header Format: various Fields VERS: • contains the version of the IP protocol that was used to create the datagram. • It is used to verify that the sender, receiver, and any routers in between them agree on the format of the datagram. • All IP software is required to check the version field before processing a datagram to ensure it matches the format the software expects. • If standards change, machines will reject datagrams with protocol versions that differ from theirs, preventing them from misinterpreting datagram contents according to an outdated format. Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Datagram Header Format: various Fields HLEN • The header length field, also 4 bits, gives the datagram header length measured in 32 -bit words. • It thus points to the beginning of the data. • Note that the minimum value for a correct header is 5. Total Length • The TOTAL LENGTH field gives the length of the IP datagram measured in octets, including octets in the header and data. • Because the TOTAL LENGTH field is 16 bits long, the maximum possible size of an IP datagram is 216 or 65, 535 octets. Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Datagram Header Format: various Fields Service Type • the 8 -bit SERVICE TYPE field specifies how the datagram should be handled. • provides an indication of the abstract parameters of the quality of service desired. These parameters are to be used to guide the selection of the actual service parameters when transmitting a datagram through a particular network. • The major choice is a three way tradeoff between low-delay, highreliability, and high-throughput. • The field was originally divided into five subfields as shown: Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Datagram Header Format: various Fields Service Type • • • Bits 0 -2: Bit 3: Bit 4: Bit 5: Bit 6 -7: Precedence. 0 = Normal Delay, 1 = Low Delay. 0 = Normal Throughput, 1 = High Throughput. 0 = Normal Relibility, 1 = High Relibility. Reserved for Future Use. • We regard the service type specification as a hint to the routing algorithm that helps it choose among various paths to a destination based on local policies and its knowledge of the hardware technologies available on those paths. An internet does not guarantee to provide any particular type of service. Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Datagram Header Format: various Fields Time to Live : 8 bits • This field indicates the maximum time the datagram is allowed to remain in the internet system. • If this field contains the value zero, then the datagram must be destroyed. • This field is modified in internet header processing. The time is measured in units of seconds, but since every module that processes a datagram must decrease the TTL by at least one even if it process the datagram in less than a second, the TTL must be thought of only as an upper bound on the time a datagram may exist. • The intention is to cause undeliverable datagrams to be discarded, and to bound the maximum datagram lifetime. Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Datagram Header Format: various Fields Protocol: 8 bits • The value specifies which high-level protocol was used to create the message carried in the DATA area of the datagram. • In essence, the value of PROTOCOL specifies the format of the DATA area. • Administered by a central authority Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Datagram Header Format: various Fields Header Checksum: 16 bits • A checksum on the header only. Source and Destination Address: 32 bits • Specifies source and destination address. • Although the datagram may be routed through many intermediate routers, the source and destination fields never change; Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IP Fragmentation & Reassembly • • network links have MTU (max. transfer size) - largest possible link-level frame. – different link types, different MTUs large IP datagram divided (“fragmented”) within net – one datagram becomes several datagrams – “reassembled” only at final destination – IP header bits used to identify, order related fragments fragmentation: in: one large datagram out: 3 smaller datagrams reassembly Network Layer
Datagram Header Format: various Fields Datagram Encapsulation • Unlike physical network frames that must be recognized by hardware, datagrams are handled by software. They can be of any length (in general, and not IPv 4) the protocol designers choose. • As datagrams move from one machine to another, they must always be transported by the underlying physical network. • To make internet transportation efficient, we would like to guarantee that each datagram travels in a distinct physical frame. This is encapsulation. • For encapsulation, what is the size of Frame ? ? ? • Different networks differ in Maximum transfer unit size (or MTU) Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Datagram Header Format: various Fields • So, Fragmentation is required. • The IP protocol does not limit datagrams size, the source can choose any datagram size it thinks appropriate; fragmentation and reassembly occur automatically, without the source taking special action. • The IP specification states that routers must accept datagrarns up to the maximum of the MTUs of networks to which they attach. Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Datagram Header Format: various Fields IDENTIFICATION • An identifying value assigned by the sender to aid in assembling the fragments of a datagram. • The receiver of the fragments uses the identification field to ensure that fragments of different datagrams are not mixed. • To assemble the fragments of an internet datagram, an internet protocol module (for example at a destination host) combines internet datagrams that all have the same value for the four fields: identification, source, destination, and protocol. Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Datagram Header Format: various Fields FLAGS : 3 bits • • • Bit 0: reserved, must be zero Bit 1: (DF) 0 = May Fragment, 1 = Don't Fragment. Bit 2: (MF) 0 = Last Fragment, 1 = More Fragments. Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Datagram Header Format: various Fields Fragment Offset: 13 bits • This field indicates where in the datagram this fragment belongs. • The fragment offset is measured in units of 8 octets (64 bits). The first fragment has offset zero. Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Datagram Header Format: various Fields Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IP Fragmentation and Reassembly Example r 4000 byte datagram r MTU = 1500 bytes 1480 bytes in data field offset = 1480/8 length ID =4000 =x fragflag =0 offset =0 One large datagram becomes several smaller datagrams length ID =1500 =x fragflag =1 offset =0 length ID =1500 =x fragflag =1 offset =185 length ID =1040 =x fragflag =0 offset =370 Network Layer
Chapter 4: Network Layer • 4. 1 Introduction • 4. 2 Virtual circuit and datagram networks • 4. 3 What’s inside a router • 4. 4 IP: Internet Protocol – – Datagram format IPv 4 addressing ICMP IPv 6 • 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
IP Addressing: introduction • IP address: 32 -bit identifier for host, router interface • interface: connection between host/router and physical link – router’s typically have multiple interfaces – host may have multiple interfaces – IP addresses associated with each interface 223. 1. 1. 1 223. 1. 1. 2 223. 1. 1. 4 223. 1. 1. 3 223. 1. 2. 1 223. 1. 2. 9 223. 1. 3. 27 223. 1. 2. 2 223. 1. 1. 1 = 11011111 00000001 223 Network Layer 1 1 1
Subnets 223. 1. 1. 1 • IP address: – subnet part (high order bits) – host part (low order bits) • What’s a subnet ? – device interfaces with same subnet part of IP address – can physically reach other without intervening router 223. 1. 1. 2 223. 1. 1. 4 223. 1. 1. 3 223. 1. 2. 1 223. 1. 2. 9 223. 1. 2. 2 223. 1. 3. 27 LAN 223. 1. 3. 2 network consisting of 3 subnets Network Layer
Subnets How many? 223. 1. 1. 2 223. 1. 1. 1 223. 1. 1. 4 223. 1. 1. 3 223. 1. 9. 2 223. 1. 7. 0 223. 1. 9. 1 223. 1. 7. 1 223. 1. 8. 0 223. 1. 2. 6 223. 1. 2. 1 223. 1. 3. 27 223. 1. 2. 2 Network Layer 223. 1. 3. 2
IP addressing: CIDR: Classless Inter. Domain Routing – subnet portion of address of arbitrary length – address format: a. b. c. d/x, where x is # bits in subnet portion of address host part subnet part 11001000 00010111 00010000 200. 23. 16. 0/23 Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IP addresses: how to get one? Q: How does host get IP address? • hard-coded by system admin in a file – Wintel: control-panel->network->configuration->tcp/ip>properties – UNIX: /etc/rc. config • DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server – “plug-and-play” Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IP addresses: how to get one? Q: How does network get subnet part of IP addr? A: gets allocated portion of its provider ISP’s address space ISP's block 11001000 00010111 00010000 200. 23. 16. 0/20 Organization 1 Organization 2. . . 11001000 00010111 00010000 11001000 00010111 00010010 0000 11001000 00010111 00010100 0000 …. 200. 23. 16. 0/23 200. 23. 18. 0/23 200. 23. 20. 0/23 …. Organization 7 11001000 00010111 00011110 0000 200. 23. 30. 0/23 Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Hierarchical addressing: route aggregation Hierarchical addressing allows efficient advertisement of routing information: Organization 0 200. 23. 16. 0/23 Organization 1 200. 23. 18. 0/23 Organization 2 200. 23. 20. 0/23 Organization 7 . . . Fly-By-Night-ISP “Send me anything with addresses beginning 200. 23. 16. 0/20” Internet 200. 23. 30. 0/23 “Send me anything with addresses beginning 199. 31. 0. 0/16” ISPs-R-Us Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Hierarchical addressing: more specific routes ISPs-R-Us has a more specific route to Organization 1 Organization 0 200. 23. 16. 0/23 Organization 2 200. 23. 20. 0/23 Organization 7 . . . Fly-By-Night-ISP “Send me anything with addresses beginning 200. 23. 16. 0/20” Internet 200. 23. 30. 0/23 “Send me anything with addresses beginning 199. 31. 0. 0/16 or 200. 23. 18. 0/23” ISPs-R-Us Organization 1 200. 23. 18. 0/23 Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IP addressing: the last word. . . Q: How does an ISP get block of addresses? A: ICANN: Internet Corporation for Assigned Names and Numbers – allocates addresses – manages DNS – assigns domain names, resolves disputes Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Network Layer • 4. 1 Introduction • 4. 2 Virtual circuit and datagram networks • 4. 3 What’s inside a router • 4. 4 IP: Internet Protocol – – Datagram format IPv 4 addressing ICMP IPv 6 • 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
IPv 6 • Initial motivation: 32 -bit address space soon to be completely allocated. • Additional motivation: – header format helps speed processing/forwarding – header changes to facilitate Qo. S IPv 6 datagram format: – fixed-length 40 byte header – In addition to unicast and multicast address, IPv 6 has introduced a new type of address, called an anycast address. Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IPv 6 Header (Cont) Priority: identify priority among datagrams in flow Flow Label: identify datagrams in same “flow. ” (concept of“flow” not well defined). Next header: identify upper layer protocol for data Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Other Changes from IPv 4 • Checksum: removed entirely to reduce processing time at each hop • Fragmentation: only source and dest can do • Options: allowed, but outside of header, indicated by “Next Header” field • ICMPv 6: new version of ICMP – additional message types, e. g. “Packet Too Big” – multicast group management functions Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Transition From IPv 4 To IPv 6 • Not all routers can be upgraded simultaneous – no “flag days” – How will the network operate with mixed IPv 4 and IPv 6 routers? • Dual Stack Approach: IPv 6 nodes have complete IPv 4 implementation as well. • Tunneling: IPv 6 carried as payload in IPv 4 datagram among IPv 4 routers Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Tunneling Logical view: Physical view: A B IPv 6 A B C IPv 6 IPv 4 Flow: X Src: A Dest: F data A-to-B: IPv 6 E F IPv 6 D E F IPv 4 IPv 6 tunnel Src: B Dest: E Flow: X Src: A Dest: F data B-to-C: IPv 6 inside IPv 4 Network Layer B-to-C: IPv 6 inside IPv 4 Flow: X Src: A Dest: F data E-to-F: IPv 6 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IPv 4 To IPv 6: HOW • 3 GPP has specified IPv 6 as the standard addressing scheme for mobile multimedia. • In fact, it is easy to deploy new application layer protocols, but enormously difficult to change network layer protocols. Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Network Layer • 4. 1 Introduction • 4. 2 Virtual circuit and datagram networks • 4. 3 What’s inside a router • 4. 4 IP: Internet Protocol – – Datagram format IPv 4 addressing ICMP IPv 6 • 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
Interplay between routing and forwarding routing algorithm local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1 value in arriving packet’s header 0111 1 3 2 Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Graph abstraction 5 2 u 2 1 Graph: G = (N, E) 3 v w 3 x 1 5 z 1 y 2 N = set of routers = { u, v, w, x, y, z } E = set of links ={ (u, v), (u, x), (v, w), (x, y), (w, z), (y, z) } Remark: Graph abstraction is useful in other network contexts Example: P 2 P, where N is set of peers and E is set of TCP connections Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Graph abstraction: costs 5 2 u v 2 1 x • c(x, x’) = cost of link (x, x’) 3 w 3 1 5 z 1 y - e. g. , c(w, z) = 5 • cost could always be 1, or inversely related to bandwidth, or inversely related to congestion 2 Cost of path (x 1, x 2, x 3, …, xp) = c(x 1, x 2) + c(x 2, x 3) + … + c(xp-1, xp) Question: What’s the least-cost path between u and z ? Routing algorithm: algorithm that finds least-cost path Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Routing Algorithm classification Global or decentralized information? Static or dynamic? Global: • all routers have complete topology, link cost info • “link state” algorithms Decentralized: • router knows physicallyconnected neighbors, link costs to neighbors • iterative process of computation, exchange of info with neighbors • “distance vector” algorithms Static: • routes change slowly over time Dynamic: • routes change more quickly – periodic update – in response to link cost changes Network Layer
Network Layer • 4. 1 Introduction • 4. 2 Virtual circuit and datagram networks • 4. 3 What’s inside a router • 4. 4 IP: Internet Protocol – – Datagram format IPv 4 addressing ICMP IPv 6 • 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
A Link-State Routing Algorithm Dijkstra’s algorithm • net 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 • iterative: after k iterations, know least cost path to k dest. ’s Network Layer
Distance Vector Algorithm (1) Bellman-Ford Equation (dynamic programming) Define dx(y) : = cost of least-cost path from x to y Then dx(y) = minv {c(x, v) + dv(y) } where min is taken over all neighbors of x Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Bellman-Ford example (2) 5 2 u v 2 1 x 3 w 3 1 Clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3 5 z 1 y 2 B-F equation says: du(z) = min { c(u, v) + dv(z), c(u, x) + dx(z), c(u, w) + dw(z) } = min {2 + 5, 1 + 3, 5 + 3} = 4 Node that achieves minimum is next hop in shortest path ➜ forwarding table Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Comparison of LS and DV algorithms Message complexity • LS: with n nodes, E links, O(n. E) msgs sent • DV: exchange between neighbors only – convergence time varies Speed of Convergence • LS: O(n 2) algorithm requires O(n. E) msgs – may have oscillations • DV: convergence time varies – may be routing loops – count-to-infinity problem Robustness: what happens if router malfunctions? LS: – node can advertise incorrect link cost – each node computes only its own table DV: Network Layer – DV node can advertise incorrect path cost – each node’s table used by others • error propagate thru network
Network Layer • 4. 1 Introduction • 4. 2 Virtual circuit and datagram networks • 4. 3 What’s inside a router • 4. 4 IP: Internet Protocol – – Datagram format IPv 4 addressing ICMP IPv 6 • 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
Hierarchical Routing Our routing study thus far - idealization r all routers identical r network “flat” … not true in practice scale: with 200 million destinations: • can’t store all dest’s 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
Hierarchical Routing • aggregate routers into regions, “autonomous systems” (AS) • routers in same AS run same routing protocol Gateway router • Direct link to router in another AS – “intra-AS” routing protocol – routers in different AS can run different intra-AS routing protocol Network Layer
Interconnected ASes 3 c 3 b 3 a AS 3 2 a 1 c 1 a 1 d 2 c AS 2 1 b Intra-AS Routing algorithm AS 1 Inter-AS Routing algorithm Forwarding table Network Layer 2 b • Forwarding table is configured by both intraand inter-AS routing algorithm – Intra-AS sets entries for internal dests – Inter-AS & Intra-As sets entries for external dests
Inter-AS tasks AS 1 needs: • Suppose router in AS 1 receives datagram for which dest is outside of AS 1 1. to learn which dests are reachable through AS 2 and which through AS 3 2. to propagate this reachability info to all routers in AS 1 Job of inter-AS routing! – Router should forward packet towards on of the gateway routers, but which one? 3 c 3 a 3 b AS 3 2 a 1 c 1 a 1 d 2 c AS 2 1 b AS 1 Network Layer 2 b
Example: Setting forwarding table in router 1 d • Suppose AS 1 learns from the inter-AS protocol that subnet x is reachable from AS 3 (gateway 1 c) but not from AS 2. • Inter-AS protocol propagates reachability info to all internal routers. • Router 1 d determines from intra-AS routing info that its interface I is on the least cost path to 1 c. • Puts in forwarding table entry (x, I). Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Example: Choosing among multiple ASes • Now suppose AS 1 learns from the inter-AS protocol that subnet x is reachable from AS 3 and from AS 2. • To configure forwarding table, router 1 d must determine towards which gateway it should forward packets for dest x. • This is also the job on inter-AS routing protocol! • Hot potato routing: send packet towards closest of two routers. Learn from inter-AS protocol that subnet x is reachable via multiple gateways Use routing info from intra-AS protocol to determine costs of least-cost paths to each of the gateways Hot potato routing: Choose the gateway that has the smallest least cost Determine from forwarding table the interface I that leads to least-cost gateway. Enter (x, I) in forwarding table Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Internet structure: network of networks • roughly hierarchical • at center: “tier-1” ISPs (e. g. , UUNet, BBN/Genuity, Sprint, AT&T), national/international coverage – treat each other as equals Tier-1 providers interconnect (peer) privately Tier 1 ISP NAP Tier 1 ISP Network Layer Tier-1 providers also interconnect at public network access points (NAPs)
Tier-1 ISP: e. g. , Sprint US backbone network Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Internet structure: network of networks • “Tier-2” ISPs: smaller (often regional) ISPs – Connect to one or more tier-1 ISPs, possibly other tier-2 ISPs Tier-2 ISP pays tier 1 ISP for connectivity to rest of Internet q tier-2 ISP is customer of tier-1 provider Tier-2 ISP Tier 1 ISP NAP Tier 1 ISP Tier-2 ISP Network Layer Tier-2 ISPs also peer privately with each other, interconnect at NAP Tier-2 ISP
Internet structure: network of networks • “Tier-3” ISPs and local ISPs – last hop (“access”) network (closest to end systems) local ISP Local and tier- 3 ISPs are customers of higher tier ISPs connecting them to rest of Internet Tier 3 ISP Tier-2 ISP local ISP Tier-2 ISP Tier 1 ISP NAP Tier 1 ISP Tier-2 ISP local ISP Network Layer Tier-2 ISP local ISP
Internet structure: network of networks • a packet passes through many networks! local ISP Tier 3 ISP Tier-2 ISP local ISP Tier-2 ISP Tier 1 ISP NAP Tier 1 ISP Tier-2 ISP local ISP Network Layer Tier-2 ISP local ISP
Chapter 4: Network Layer • 4. 1 Introduction • 4. 2 Virtual circuit and datagram networks • 4. 3 What’s inside a router • 4. 4 IP: Internet Protocol – – Datagram format IPv 4 addressing ICMP IPv 6 • 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
Intra-AS Routing • Also known as Interior Gateway Protocols (IGP) • Most common Intra-AS routing protocols: – RIP: Routing Information Protocol – OSPF: Open Shortest Path First – IGRP: Interior Gateway Routing Protocol (Cisco proprietary) Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Chapter 4: Network Layer • 4. 1 Introduction • 4. 2 Virtual circuit and datagram networks • 4. 3 What’s inside a router • 4. 4 IP: Internet Protocol – – Datagram format IPv 4 addressing ICMP IPv 6 • 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
RIP ( Routing Information Protocol) • • Distance vector algorithm Included in BSD-UNIX Distribution in 1982 In RIP (and also in OSPF), costs are actually from source router to a destination subnet. RIP uses the term hop, which is the number of subnets traversed along the shortest path from source router to destination subnet, including the destination subnet. u A z destination u v w x y z v C B D w x y hops 1 2 2 3 3 2 Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
RIP advertisements • Distance vectors: exchanged among neighbors every 30 sec via Response Message (also called advertisement) • Each advertisement: list of up to 25 destination nets within AS Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
RIP: Example z w A x y D B C Destination Network w y z x …. Next Router A B B -- Num. of hops to dest. …. 2 2 7 1 . . Routing table in D Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
RIP: Example Dest w x z …. Next hops - - C 4 …. . . w A Destination Network w y z x …. Advertisement from A to D z x y D B C Next Router A B BA -- Num. of hops to dest. …. 2 2 75 1. . Routing. Network table. Layer in D BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
RIP: Link Failure and Recovery If no advertisement heard after 180 sec --> neighbor/link declared dead – routes via neighbor invalidated – new advertisements sent to neighbors – neighbors in turn send out new advertisements (if tables changed) – link failure info quickly propagates to entire net – poison reverse used to prevent ping-pong loops (infinite distance = 16 hops) Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Chapter 4: Network Layer • 4. 1 Introduction • 4. 2 Virtual circuit and datagram networks • 4. 3 What’s inside a router • 4. 4 IP: Internet Protocol – – Datagram format IPv 4 addressing ICMP IPv 6 • 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
OSPF (Open Shortest Path First) • “open”: publicly available • Typically deployed in upper-tier ISPs whereas RIP is deployed in lower-tier ISPs. • Uses Link State algorithm – LS packet dissemination – Topology map at each node – Route computation using Dijkstra’s algorithm • OSPF advertisement carries one entry per neighbor router • Advertisements disseminated to entire AS (via flooding) – Carried in OSPF messages directly over IP (rather than TCP or UDP Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
OSPF “advanced” features (not in RIP) • Security: all OSPF messages authenticated (to prevent malicious intrusion) • Multiple same-cost paths allowed (only one path in RIP) • For each link, multiple cost metrics for different TOS (e. g. , satellite link cost set “low” for best effort; high for real time) • Integrated uni- and multicast support: – Multicast OSPF (MOSPF) uses same topology data base as OSPF • Hierarchical OSPF in large domains. Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Hierarchical OSPF Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Hierarchical OSPF • Two-level hierarchy: local area, backbone. – Link-state advertisements only in area – each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. • Area border routers: “summarize” distances to nets in own area, advertise to other Area Border routers. • Backbone routers: run OSPF routing limited to backbone. • Boundary routers: connect to other AS’s. Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Chapter 4: Network Layer • 4. 1 Introduction • 4. 2 Virtual circuit and datagram networks • 4. 3 What’s inside a router • 4. 4 IP: Internet Protocol – – Datagram format IPv 4 addressing ICMP IPv 6 • 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
Internet inter-AS routing: BGP • BGP (Border Gateway Protocol): the de facto standard • BGP provides each AS a means to: 1. Obtain subnet reachability information from neighboring ASs. 2. Propagate the reachability information to all routers internal to the AS. 3. Determine “good” routes to subnets based on reachability information and policy. • Allows a subnet to advertise its existence to rest of the Internet: “I am here” Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
BGP basics • Pairs of routers (BGP peers) exchange routing info over semipermanent TCP conctns: BGP sessions • Note that BGP sessions do not correspond to physical links. • When AS 2 advertises a prefix to AS 1, AS 2 is promising it will forward any datagrams destined to that prefix towards the prefix. – AS 2 can aggregate prefixes in its advertisement 3 c 3 a 3 b AS 3 1 a AS 1 2 a 1 c 1 d 2 c AS 2 2 b 1 b e. BGP session i. BGP session Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Distributing reachability info • With e. BGP session between 3 a and 1 c, AS 3 sends prefix reachability info to AS 1. • 1 c can then use i. BGP do distribute this new prefix reach info to all routers in AS 1 • 1 b can then re-advertise the new reach info to AS 2 over the 1 b-to-2 a e. BGP session • When router learns about a new prefix, it creates an entry for the prefix in its forwarding table. 3 c 3 a 3 b AS 3 1 a AS 1 2 a 1 c 1 d 2 c AS 2 2 b 1 b e. BGP session i. BGP session Network Layer BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Why different Intra- and 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 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Network Layer: summary What we’ve covered: • network layer services • routing principles: link state and distance vector • hierarchical routing • IP • Internet routing protocols RIP, OSPF, BGP • what’s inside a router? • IPv 6 Network Layer Next stop: the Data link layer!
BITS Pilani|Dubai|Goa|Hyderabad
- Slides: 94