Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI 547 Network Layer4-1 Chapter 4 Network Layer Read the paper (IP Addressing) US/501302.pdf#search=%22understanding%20ip%20a.

Similar presentations


Presentation on theme: "CSCI 547 Network Layer4-1 Chapter 4 Network Layer Read the paper (IP Addressing) US/501302.pdf#search=%22understanding%20ip%20a."— Presentation transcript:

1 CSCI 547 Network Layer4-1 Chapter 4 Network Layer Read the paper (IP Addressing) http://www.3com.com/other/pdfs/infra/corpinfo/en_ US/501302.pdf#search=%22understanding%20ip%20a ddressing%20everything%22 http://www.3com.com/other/pdfs/infra/corpinfo/en_ US/501302.pdf#search=%22understanding%20ip%20a ddressing%20everything%22 A excellent source for IP addressing and subnetting & routing Also read Chapter 3 of http://www.redbooks.ibm.com/redbooks/pdfs/gg 243376.pdf http://www.redbooks.ibm.com/redbooks/pdfs/gg 243376.pdf Computer Networking: A Top Down Approach, 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.

2 CSCI 547 Network Layer4-2 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services:  network layer service models  forwarding versus routing  how a router works  routing (path selection)  dealing with scale  advanced topics: IPv6, mobility r instantiation, implementation in the Internet

3 CSCI 547 Network Layer4-3 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

4 CSCI 547 Network Layer4-4 Network layer: Network layer functions network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical application transport network data link physical  Application-layer protocols define when and how messages are sent  Transport-layer protocols deliver data between processes on different end- systems o Transport protocols execute only on end systems  Network-layer protocols deliver data from one end- system to another oHop-to-hop rather than end-to-end oNetwork layer protocols execute on every end- systems and routers Virtual end- to-end transport

5 CSCI 547 Network Layer4-5 The Network Layer: Network layer functions (Packet switching) The network-layer provides four important functions:  Addressing : the means by which end systems identify each other  Path determination (routing) : the route taken by packets from source to destination  Switching (forwarding) : the movement of packets from an input interface to an appropriate output interface  Call setup & termination : The establishment of a virtual circuit from sender to receiver in case of a connection-oriented service-- ATM, frame relay, X.25

6 CSCI 547 Network Layer4-6 Interplay between routing and forwarding 1 2 3 0111 value in arriving packet’s header routing algorithm local forwarding table header value output link 0100 0101 0111 1001 32213221 Routing algorithm updates the forwarding table Routing = ? Forwarding = ? Act of updating routing table usually via talking to other routers Act of looking up routing table and sending(forwarding) to another router

7 CSCI 547 Network Layer4-7 Connection setup r Connection-oriented network architectures:  ATM, frame relay, X.25 r before datagrams flow, two end hosts and intervening routers establish virtual connection  routers get involved in setting up the connection r network vs transport layer connection service:  network: between two hosts (may also involve intervening routers in case of VCs)  transport: between two processes

8 CSCI 547 Network Layer4-8 Network service model What service model should be provided for transporting packets from sender to receiver? In other words, what aspects should we consider in designing network layer?  Some possible elements of a service model:  Guaranteed bandwidth  Guaranteed delay  Preservation of inter-packet timing (guaranteed maximum jitter)—end-to-end— geared toward time-sensitive traffic  Loss-free delivery  In-order delivery  Congestion feedback to sender Does IP protocol provide any of the above? NO !

9 CSCI 547 Network Layer4-9 Network layer service models: Network Architecture Internet (IP) ATM Service Model best effort CBR VBR ABR UBR Bandwidth none constant rate guaranteed rate guaranteed minimum none Loss no yes no Order no yes Timing no yes no Congestion feedback no (inferred via loss) no congestion no congestion yes no Guarantees ? Connection-oriented protocols can do all of these! Constant Bit Rate (CBR) Variable Bit Rate (VBR) Available Bit Rate (ABR) Unspecified Bit Rate (UBR)

10 CSCI 547 Network Layer4-10 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

11 CSCI 547 Network Layer4-11 Connection-Oriented or Connectionless ? r Datagram(DG) network provides network- layer connectionless service--IP r Virtual Circuit(VC) network provides network-layer connection-oriented service— Frame Relay, X.25 r analogous to the transport-layer services, but:  service: should provide host-to-host—same with transport layer in this respect  no choice: network either provides or not— transport layer has choice between TCP or UDP  implementation: in network core

12 CSCI 547 Network Layer4-12 Connection-oriented: Virtual Circuits r call setup for each call before data can flow, and teardown when done r each packet carries VC identifier (not destination host address) r every router on source-dest path maintains “state” for each passing connection—connection management—flow control, windowing, etc. r link, router resources (bandwidth, buffers) may be allocated to VC (dedicated resources = predictable service)  QOS “ source-to-dest path behaves much like telephone circuit”  performance-wise  network actions along source-to-dest path

13 CSCI 547 Network Layer4-13 VC implementation a VC consists of: 1. path from source to destination 2. VC numbers, one number for each link along path—number changes hop-to-hop 3. entries in forwarding tables in routers along path—an entry fixed until VC teardown r packet belonging to VC carries VC number (rather than full destination address) r VC number can be changed on each link.  VC number changed according to the entry in forwarding table

14 CSCI 547 Network Layer4-14 ATM cell format: Virtual Circuit identifier GFC--Generic flow control (000=uncontrolled access). VPI--Virtual path identifier. VCI--Virtual channel identifier. Together, the VPI and VCI comprise the VPCI. These fields represent the routing information within the ATM cell. PTI--Payload Type Indication. CLP--Cell Loss Priority. HEC--Header Error Control. GFC VPI 8 bits VPI VCI PTI(3 bits) CLP HEC 48 BYTES PAYLOAD VC identifier

15 CSCI 547 Network Layer4-15 Forwarding table 12 22 32 1 2 3 VC number interface number Incoming interface Incoming VC # Outgoing interface Outgoing VC # 1 12 3 22 2 63 1 18 3 7 2 17 1 97 3 87 … … Forwarding table in northwest router: Routers maintain connection state information for each Virtual circuit and also do windowing—large overhead!

16 CSCI 547 Network Layer4-16 Virtual circuits: signaling protocols r used to setup, maintain, teardown VC using control packets r used in ATM, frame-relay, X.25 r VC & signaling protocol are used only along parts of Internet  Used primarily near the network core where a connection-oriented service (e.g. ATM) is used  The signaling protocols are not part of IP application transport network data link physical application transport network data link physical 1. Initiate call 2. incoming call 3. Accept call 4. Call connected 5. Data flow begins 6. Receive data 7. Discconnect request 8. Discconnect confirm What happens when a packet is hit by noise on a link?

17 CSCI 547 Network Layer4-17 Example ATM Backbone on Internet

18 CSCI 547 Network Layer4-18 Datagram networks--connectionless r no call setup at network layer r routers: no state about hop-to-hop or end-to-end connections  no network-level concept of “connection” r packets forwarded using destination host address  Packets routed independently each other  packets between same source-dest pair may take different paths application transport network data link physical application transport network data link physical 1. Send data 2. Receive data Advantage: Much less overhead than VC Disadvantages? unreliable, no flow control, no error control

19 CSCI 547 Network Layer4-19 Forwarding table Destination Address Range Link Interface 11001000 00010111 00010000 00000000 through 0 11001000 00010111 00010111 11111111 11001000 00010111 00011000 00000000 through 1 11001000 00010111 00011000 11111111 11001000 00010111 00011001 00000000 through 2 11001000 00010111 00011111 11111111 otherwise 3 For 32 bit addresses, 4 billion possible entries to have an entry for every address for every router, so better way is Above will have the same effect as

20 CSCI 547 Network Layer4-20 Longest prefix matching: the idea used in Internet (glimpse of how routing works) Prefix Match Link Interface 11001000 00010111 00010 0 11001000 00010111 00011000 1 11001000 00010111 00011 2 otherwise 3 DA: 11001000 00010111 00011000 10101010 Examples DA: 11001000 00010111 00010110 10100001 Which interface?

21 CSCI 547 Network Layer4-21 Datagram or VC network: why? Internet (datagram) r data exchange among computers  “elastic” service, no strict timing required r “smart” end systems (computers)  can adapt, perform control, error recovery  simple inside network, complexity at “edge” r many link types  different characteristics  uniform service difficult ATM (VC) r evolved from telephony-- BISDN r human conversation:  strict timing, reliability requirements  need for guaranteed service r “dumb” end systems  telephones  complexity inside network

22 CSCI 547 Network Layer4-22 Connection-oriented(VC) vs Conncectionless(DG) ISSUES Connection-oriented Connectionless ------------------------------------------------------------------------------------------------------------------- Initial setupRequired No and termination RoutingRouting only done on Each packet routed initial VC setupindependently Connection stateRouters keep state info. Router do not hold state info. for each connection Need forNeeded during initial setup Full address needed Full addressAfterwards only VC#always needed Packet Guaranteed Not guaranteed Sequencing Error recovery Handles error conditions Left to a higher layer

23 CSCI 547 Network Layer4-23 ISSUES Connection-oriented Connectionless ------------------------------------------------------------------------------------------------------------- Congestion controlEasyDifficult QOSEasyDifficult Flow Control Handles Not done Overhead High Low Examples: TCP UDP, IP, IPX, ISO-IP Connection-oriented(VC) vs Conncectionless(DG)— Cont’d

24 CSCI 547 Network Layer4-24 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

25 CSCI 547 Network Layer4-25 Router Architecture Overview Two key router functions: r run routing algorithms/protocol (RIP, OSPF, BGP) r forwarding datagrams from incoming to outgoing link Explore this first

26 CSCI 547 Network Layer4-26 Input Port Functions: Centralized switching Centralized switching: r Input port forward to Routing processor r Routing processor perform forwarding table lookup r Forwards the packet to output port r This approach used for low end routers, workstations or servers acting as routers Physical layer: bit-level reception Data link layer: e.g., Ethernet see chapter 5 Routing processor Routing Table Output port

27 CSCI 547 Network Layer4-27 Input Port Functions: Decentralized switching Decentralized switching: r given datagram’s dest., input port processor lookup output port using forwarding table(a shadow copy in each input port) in input port memory—some routers use Content Addressable Memory for faster lookups—e.g. Cisco 8500 has 64K CAM for each input port r goal: complete input port processing at ‘line speed’—needs parallel processors r queuing: if datagrams arrive faster than forwarding rate into switch fabric Physical layer: bit-level reception Data link layer: e.g., Ethernet see chapter 5

28 CSCI 547 Network Layer4-28 Three types of switching fabrics 1: 2: 3:

29 CSCI 547 Network Layer4-29 Switching Via Memory First generation routers: r earlier routers (often just a computer) with switching under direct control of CPU r packet copied to system’s memory r speed limited by memory bandwidth (2 system bus crossings per datagram) r many modern routers still use but in a shared memory multiprocessor mode—a processor for each input port Input Port Output Port Memory System Bus e.g. CISCO Catalyst 8500

30 CSCI 547 Network Layer4-30 Switching Via a Bus r datagram from input port memory to output port memory via a shared bus—one packet at a time to output port r bus contention: switching speed limited by bus bandwidth r 1 Gbps bus, Cisco 1900: sufficient speed for access and enterprise routers (not fast enough for regional or backbone routers)

31 CSCI 547 Network Layer4-31 Switching Via An Interconnection Network r overcome bus bandwidth limitations r Banyan networks & other interconnection nets initially developed to connect processors in multiprocessor r Advanced design: fragmenting datagram into fixed length cells, switch cells through the fabric and reassemble at receiving end r Fastest, most expensive r Cisco 12000 series: switches up to 1.28 tera bps through the interconnection network Horizontal bus—no contention Vertical bus— contention...... See this

32 CSCI 547 Network Layer4-32 Cisco 12000 Crossbar switch

33 CSCI 547 Network Layer4-33 Output Ports r Buffering required when datagrams arrive from switching fabric faster than the transmission rate r Scheduling discipline chooses among queued datagrams for transmission—depends upon protocols; If IP, then First-In-First-Out If ATM, then depending on the QOS Constant Bit Rate (CBR) Variable Bit Rate (VBR) Available Bit Rate (ABR) Unspecified Bit Rate (UBR)

34 CSCI 547 Network Layer4-34 Output port queueing r buffering when arrival rate via switch exceeds output line speed r queueing (delay) and loss due to output port buffer overflow!—Assuming Switch operates 3 times the speed of line speed

35 CSCI 547 Network Layer4-35 Input Port Queuing r Fabric slower than input ports combined -> queueing may occur at input queues r Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward r queueing delay and loss due to input buffer overflow!

36 CSCI 547 Network Layer4-36 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

37 CSCI 547 Network Layer4-37 TCP/IP Protocol Suite Defined in TCP/IP Protocol Suite Undefined

38 CSCI 547 Network Layer4-38 IP

39 CSCI 547 Network Layer4-39 The IP (Internet Protocol) RFC 791 RFC 791 routing table Network layer functions of hosts & routers : Routing protocols path selection RIP, OSPF, BGP IP protocol addressing conventions datagram format packet handling conventions ICMP protocol error reporting router “signaling” Transport layer: TCP, UDP Link layer physical layer Network layer

40 CSCI 547 Network Layer4-40 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

41 CSCI 547 Network Layer4-41 IP datagram format: RFC 791RFC 791 ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier header checksum time to live 32 bit source IP address IP protocol version Number: IPv4 header length (32 bit words) max number remaining hops (decremented at each router) Used for fragmentation/ reassembly total datagram length (bytes) upper layer protocol to deliver payload to head. len type of service “type” of data flgs fragment offset Proto- col 32 bit destination IP address Options (if any) E.g. timestamp, record route taken, specify list of routers to visit. how much overhead with TCP? r 20 bytes of TCP r 20 bytes of IP r = 40 bytes + app layer overhead 4 4 8 16 13 8 8 16 For error checking

42 CSCI 547 Network Layer4-42 Table from IANA: Assigned NumbersIANA The Protocol numbers are Service Access Points on IP layer

43 CSCI 547 Network Layer4-43 Service Access Points ICMP 1 TCP 6 UDP 17 IGMP 2 IP Protocol numbers x0800 ARP x0806 Ether Types 23 Telnet 80 http 53 DNS Port numbers Ethernet

44 CSCI 547 Network Layer4-44 MTU (Maximum Transmission Unit) r network links have MTU (Maximum Transmission Unit) - largest possible link-level frame.  different link types  different MTUs  Given 1500 Byte MTU(Ethernet), what is MSS(Maximum Segment Size) for TCP?  1500 – 20(TCP) -20(IP) = 1460 IP datagram Maximum Transmission Unit Link layer header Link layer trailer 1500 bytes for Ethernet Transport layer(TCP/UDP) has MSS—IP layer has MTU(determined by Link layer) headers

45 CSCI 547 Network Layer4-45 Link layer protocolMTU (bytes) Internet Path MTUAt least 576 Hyperchannel65,535 Token ring(16Mbps)17,914 FDDI4,500 Ethernet1,500 Dial-up, X.25576 PPPoE1,492 ATM48 802.112272 MTU (Maximum Transmission Unit)

46 CSCI 547 Network Layer4-46 IP Fragmentation & Reassembly r large IP datagram divided (“fragmented”) within net  By a router  one datagram becomes several datagrams  “reassembled” only at final destination host— why?  IP header bits used to identify, reorder related fragments fragmentation: in: one large datagram out: 3 smaller datagrams reassembly

47 CSCI 547 Network Layer4-47 Fragmentation example: C:\Documents and Settings\Administrator>ping www.google.com -f -l 1400 Pinging www.l.google.com [66.102.7.104] with 1400 bytes of data: Packet needs to be fragmented but DF set. Ping statistics for 66.102.7.104: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss), Ping from a Windows workstation -f == Set Don't Fragment flag -l == Send buffer size. Screen captured on a Windows system

48 CSCI 547 Network Layer4-48 ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier header checksum time to live 32 bit source IP address head. len type of service flgs fragment offset Proto- col 32 bit destination IP address Options (if any) Fields needed for fragmentation RDFMF Flags—3 bits R: Reserved—not used DF: Don’t Fragment MF: More Fragment Fragmentation

49 CSCI 547 Network Layer4-49 IP Fragmentation and Reassembly ID =x offset =0 moreflag =0 length =4000 ID =x offset =0 moreflag =1 length =1500 ID =x offset =185 moreflag =1 length =1500 ID =x offset =370 moreflag =0 length =1040 One large datagram becomes several smaller datagrams Example r 4000 byte datagram r MTU = 1500 bytes 1480 bytes in data field + 20bytes of IP header offset = 1480/8 Fragments are counted in units of 8 octets(bytes).

50 CSCI 547 Network Layer4-50 Internal modules of IP Layer: for routers & hosts Header-composing module Reassembly module Routing module Processing module Fragmentation module Reassembly table Routing table MTU table To upper layer protocol Data Data & dest. addr. To data link layer IP packet, next hop addr. From data link layer IP packet IP packet, next hop addr., interface IP packet IP From upper layer protocol

51 CSCI 547 Network Layer4-51 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

52 CSCI 547 Network Layer4-52 IP packet format—IPv4

53 CSCI 547 Network Layer4-53 IP packet format—IPv4—from RFC791RFC791

54 CSCI 547 Network Layer4-54 IP Addressing: introduction r IP address: 32-bit identifier for host, router interface r interface: connection between host/router and physical link  router’s typically have multiple interfaces  host typically has one interface  IP addresses associated with each interface 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 223.1.1.1 = 11011111 00000001 00000001 00000001 223 111

55 CSCI 547 Network Layer4-55 IP Addressing Classful Addressing  CIDR  VLSM  NAT 1992 Inefficient division into 5 classes— A, B, C, D, E Address space running out IPv6—128 bits IPv4—32bits Huge address space More streamlined for efficiency More Auto- configuration Accommodates QOS When? interim solutions

56 CSCI 547 Network Layer4-56 IP Addressing: Classful or Classless r Older IP addressing (and routing) called “Classful IP addressing” which fixes the size of a block to one of classes (A, B, C, D, E) r Out of 5 classes, only 3 classes are assignable to computers as IP addresses—only 3 sizes to fit all organizations of the world? r More elastic (size-wise) scheme is called “CIDR(Classless Inter Domain Routing)”—IP address blocks can be any size using prefix subnet masks—later r Both used but Classless mostly used by ISP level or above

57 CSCI 547 Network Layer4-57 IP Addressing: Classful Addressing Byte 1 Byte 2 Byte 3 Byte 4 Class A Class B Class C Class D Class E 0 1 0 1 1 0 1 1 1 0 1 1 Multicast address Reserved for future addressing modes netid hostid 7 1614 24 21 8

58 CSCI 547 Network Layer4-58 IP Addressing: Dotted Decimal Notation r 32 bit IP addresses are often represented in the human-friendly 4 groups of 8 bits and written in decimal number with dots separating them  “dotted decimal notation” 10000100 11110001 00100011 10011110 128128 6464 3232 1616 8421 128128 6464 3232 1616 8421 128128 6464 3232 1616 8421 128128 6464 3232 1616 8421 132 241 158 35...

59 CSCI 547 Network Layer4-59 Private IP addresses r The Internet Assigned Numbers Authority (IANA) under ICANN has reserved the following three blocks of the IP address space for private networks: Read hereIANA ICANNRead here r 10.0.0.0 - 10.255.255.255 172.16.0.0 - 172.31.255.255 192.168.0.0 - 192.168.255.255 r Also, IP addresses in the range of 169.254.0.0 - 169.254.255.255 are reserved for Automatic Private IP Addressing (Zero Configuration Networking).Automatic Private IP Addressing (Zero Configuration Networking). Used for ad hoc or isolated networks r The above IP addresses should not be used on the Internet. Internet routers will not route packets with those addresses—only usable for private networks or Intranets

60 CSCI 547 Network Layer4-60 Address ranges ClassStartEndDefault Subnet Mask CIDR prefix notation A1.0.0.0127. 255.255.255255.0.0.0/8 B128.0.0.0191.255. 255.255255.255.0.0/16 C192.0.0.0223.255.255.255255.255.255.0/24 D224.0.0.0239.255.255.255NA E240.0.0.0255.255.255.255NA

61 CSCI 547 Network Layer4-61 Special Addresses Some parts of classes A, B, C are used for special addresses: ----------------------------------------------------------------------------------------------------------------- Special AddressesNetidHostid Source or Destination ----------------------------------------------------------------------------------------------------------------- Network addressSpecificAll 0sNone (e.g. 132.241.0.0 is the network address for the CSU, Chico LAN) ----------------------------------------------------------------------------------------------------------------- Direct broadcast addressSpecificAll 1sDestination (This is used by a router to send a packet to all hosts in a subnet, e.g. 132.241.255.255) ----------------------------------------------------------------------------------------------------------------- Limited broadcast addressAll 1sAll 1sDestination (A broadcast address for a subnet--It is used when a host wants to send a message to all the hosts in the local subnet--routers will not pass this to other subnets) ----------------------------------------------------------------------------------------------------------------- This host on this networkAll 0sAll 0sSource (All 0s designate “this host on this network”--used by a host when it does not know it’s own IP address) ----------------------------------------------------------------------------------------------------------------- Specific host on this networkAll 0sSpecificDestination (It is used by a host to send a message to another host on the same subnet-- Routers will not process this kind) ----------------------------------------------------------------------------------------------------------------- Loopback address127AnyDestination (It is used to test the health of TCP/IP protocol on a host, e.g. ping 127.0.0.1)

62 CSCI 547 Network Layer4-62 The Needs for subnetting r Given a chunk of addresses (e.g. a class B), an organization usually need to sub-divide the address space in a hierarchical fashion r Just as an organization is structured hierarchically, IP addresses are divided as needed r From http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/ip.htm http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/ip.htm “Subnetting provides the network administrator with several benefits, including extra flexibility, more efficient use of network addresses, and the capability to contain broadcast traffic (a broadcast will not cross a router). Subnets are under control of local administration. As such, the outside world sees an organization as a single network and has no detailed knowledge of the organization's internal structure. “ Also read http://www.support.psi.net/support/common/routers/files/SUBNE T-Desc.html http://www.support.psi.net/support/common/routers/files/SUBNE T-Desc.html

63 CSCI 547 Network Layer4-63 Without Subnetting? r Analogous to: One person in mailroom delivering all mails of the organization r Without subnetting, The entire network (e.g. 132.241.0.0) is connected as one LAN--All workstations should be connected directly to the router—either directly to the router ports or the LAN is connected only through hubs and switches—this is not feasible except for a very small network—less than 100 computers

64 CSCI 547 Network Layer4-64 Without Subnetting?...... To Internet This router should be very fast, should have a large number of ports. Also long cables needed-- Not feasible except for very small network—less than 100 computers?!

65 CSCI 547 Network Layer4-65 Subnets r IP address divided:  subnetid part (high order bits)  hostid part (low order bits) r What’s a subnet ?  device interfaces with same subnet part of IP address  Hosts within a subnet can physically reach each other without intervening router 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 network consisting of 3 subnets subnet subnetid hostid

66 CSCI 547 Network Layer4-66 Subnets 223.1.1.0/24 223.1.2.0/24 223.1.3.0/24 Recipe r To determine the subnets, detach each interface from its host or router, creating islands of isolated networks. Each isolated network is called a subnet. r The host are usually connected to a hub or a switch Subnet mask: /24

67 CSCI 547 Network Layer4-67 Subnets Decisions to make: How many subnets? How big each subnet? How many levels of subnetting? All depends upon the organizational structure and requirements 223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.2 223.1.2.1 223.1.2.6 223.1.3.2 223.1.3.1 223.1.3.27 223.1.1.2 223.1.7.0 223.1.7.1 223.1.8.0223.1.8.1 223.1.9.1 223.1.9.2

68 CSCI 547 Network Layer4-68 Subnetting r After acquiring a block of network addresses, e.g. a Class B address, divide it according to needs r Let’s say, we need 6 large divisions first, then each division may be divided as needed r Each division must be equal sizes 1 st division 2nd 3rd

69 CSCI 547 Network Layer4-69 Subnetting: Classful--example r Given class B address of 132.241.0.0, we need to divide the networks into 255 equal-sized subnets— variable sizing covered later (VLSM) r With a class B address, we are given the last 16 bits to play with(divide) 132. 241. 0. 0 10000100 11110001 00000000 00000000 128128 6464 3232 1616 8421 128128 6464 3232 1616 8421 128128 6464 3232 1616 8421 128128 6464 3232 1616 8421 132 241 0 0... netid hostid Fixed Can be subnetted

70 CSCI 547 Network Layer4-70 Subnetting: Classful--example 132. 241. 0. 0 10000100 11110001 00000000 00000000 128128 6464 3232 1616 8421 128128 6464 3232 1616 8421 128128 6464 3232 1616 8421 128128 6464 3232 1616 8421 Fixed Can be subnetted... Where should we put the divider? # of subnets? # of hosts in a subnet?  The decision should be based upon:  # of subnets needed  # of hosts on each subnets  Future needs  Routing protocol (RIPv1, RIPv2, or OSPF)

71 CSCI 547 Network Layer4-71 Subnetting: Classful--example 132. 241. 0. 0 10000100 11110001 00000000 00000000 128128 6464 3232 1616 8421 128128 6464 3232 1616 8421 128128 6464 3232 1616 8421 128128 6464 3232 1616 8421 Fixed Can be subnetted... Where should we put the divider? # of subnets? # of hosts in a subnet? The division is indicated by “subnet mask”—done by putting 1’s until the division point For example: Let’s put it after 19th bit 10000100 11110001 00000000 00000000 11111111 11111111 00000000 11100000 Then the subnet mask should be 255 ? 0 224

72 CSCI 547 Network Layer4-72 Subnetting: Classful 10000100 11110001 00000000 00000000 11111111 11111111 00000000 11100000 Then the subnet mask should be 255 0 224 0 0 241 132 netid subnetid hostid To be precise, we have netid, subnetid, hostid But the (netid + subnetid) is often called as subnetid Notation for subnet mask; 2 ways 1)Dotted decimal notation; e.g. 255.255.224.0 2)Prefix notation; e.g. /19 –called slash notation also--19bits are subnet mask subnetid hostid subnet mask

73 CSCI 547 Network Layer4-73 Example for classful subnetting r Given a class B address of 132.241.0.0/16 r Let’s say we decided to divide using next 8 bits 10000100 11110001 00000000 00000000 11111111 11111111 00000000 11111111 Then the subnet mask should be 0 0 241 132 subnetid hostid subnet mask 255 0 In prefix notation ? 132.241.0.0/24

74 CSCI 547 Network Layer4-74 Example for classful subnetting, cont’d r Restrictions: legacy routers following rfc 950, do not recognize all zero’s and all one’s subnet  132.241.0.0/24 & 132.241.255.0/24 --wasted spacerfc 950 r In rfc 1878, all zero’s and all one’s subnets are allowed by defaultrfc 1878 Can be turned off by no ip subnet-zero command for CISCO routers Read http://www.cisco.com/en/US/tech/tk648/tk361/techn ologies_tech_note09186a0080093f18.shtml http://www.cisco.com/en/US/tech/tk648/tk361/techn ologies_tech_note09186a0080093f18.shtml r In hostid portion, all zero’s and all one’s are not allowed—they are reserved for special purpose—all zero’s represent the subnetid & all one’s represent subnet broadcast address; e.g. 132.241.0.0 is the subnetid for subnet 132.241.0.0 and 132.241.0.255 is the broadcast address for the 132.241.0.0 subnet—also see slide 4.614.61

75 CSCI 547 Network Layer4-75 Example for classful subnetting, cont’d Let’s write down all the subnet addresses and host addresses Subnet addressesHost addresses 132.241.0.0/24132.241.0.1 -- 132.241.0.254 (note that 132.241.0.0 is subnet’s address and 132.241.0.255 is subnet broadcast address) 132.241.1.0/24132.241.1.1 -- 132.241.1.254... 132.241.254.0/24132.241.254.1 -- 132.241.254.254 132.241.255.0/24132.241.255.1 -- 132.241.255.254

76 CSCI 547 Network Layer4-76 Another example for classful subnetting: Let’s subnet a subnet— Mini Lab r A class B subnet 132.241.0.0 was divided using 8 bit(/24) division as previous example r Now, we are assigned one of the subnets; 132.241.158.0—we want to subnet this subnet r Requirements: We need at least 4 subnets and each subnet should accommodate at least 20 hosts

77 CSCI 547 Network Layer4-77 Subnetting of 132.241.158.0 subnet 10000100 11110001 00000000 10011110 11111111 11111111 ???????? 11111111 Then the subnet mask should be ??? 0 158 241 132 255 ?... ? Choosing subnet mask Using 1 bit: ( 2 ) subnets; 132.241.158.0/25 & 132.241.158.1/25 Size of each subnets is 128 – 2 = (126) max Using 2 bits: (4 ) subnets with max size (62) Using 3 bits: ( ? ) subnets with max size ( ? ) Using 4 bits: ( ? ) subnets with max size ( ? ) Using 5 bits: ( ? ) subnets with max size ( ? ) Using 6 bits: ( ? ) subnets with max size ( ? ) Using 7 bits: ( ? ) subnets with max size ( ? )... At least 4 subnets & at least 20 hosts on each subnet  The choice is ? 3 bits

78 CSCI 547 Network Layer4-78 Problems with Classful addressing & subnetting r Only 3 classes useable (A, B, C) r Only 3 sizes to satisfy all organizations r Address spaces are depleted—not much left— especially class B (most comfortable fit) r Some predictions say the address space will be exhausted—one predicts in 2008 and the other in 2018—to see current assignments, see http://bgp.potaroo.net/index-ale.html http://bgp.potaroo.net/index-ale.html r In classful addressing, the assignment of class C addresses result in a large number of entries in routing table for Internet backbone routers- -- http://bgp.potaroo.net/http://bgp.potaroo.net/

79 CSCI 547 Network Layer4-79 IP adddress assignment From: http://bgp.potaroo.net/ipv4-stats/allocated-all.htmlhttp://bgp.potaroo.net/ipv4-stats/allocated-all.html

80 CSCI 547 Network Layer4-80 Routing table size of Internet backbone routers

81 CSCI 547 Network Layer4-81 Solutions for IPv4 address depletion r Short term (interim) solutions:  CIDR(Classless InterDomain Routing)—by not sticking to 3 classes (A,B,C) and their fixed sizes, we can accommodate better fittings to different size organizations – a.b.c.d/x  NAT(Network Address Translation) —Small block of addresses can be timeshared by large number of connections  VLSM(Variable Length Subnet Mask) —Allows intranets use variable sizes for distributing address spaces(rather than the fixed size divisions we saw in the classful subnetting examples) r Long term solution: IPv6 (128 bit IP address)

82 CSCI 547 Network Layer4-82 IP Addressing Classful Addressing  CIDR  VLSM  NAT 1992 Inefficient division into 5 classes— A, B, C, D, E Address space running out IPv6—128 bits IPv4—32bits Huge address space More streamlined for efficiency More Auto- configuration Accommodates QOS When? interim solutions

83 CSCI 547 Network Layer4-83 CIDR: Motivation r Observation: Many organizations need larger address than one class C(254), but less than 1000 (<< class B)—they need multiple class C addresses but not class B(remember class B space is depleted) r Assigning multiple class C addresses as a block(aggregation) helps to reduce the effects of the explosion of Internet Backbone routers r Therefore, eliminate the restriction of classes! r RFC 1517, 1518, 1519, 18171517151815191817

84 CSCI 547 Network Layer4-84 IP addressing: CIDR CIDR: Classless InterDomain Routing  Around 1993, CIDR replaced Classful addressing  “CIDR is principally a bitwise, prefix-based standard for the interpretation of IP addresses.”--wikipediawikipedia  IP address space can have many different sizes—not only 3 sizes!  Uses address format: a.b.c.d/x, where x is # bits in subnet portion of address—prefix notation  Class has no meaning! 11001000 00010111 00010000 00000000 subnet part host part 200.23.16.0/23 subnet part host part 200.23.18.0/23 11001000 00010111 00010010 00000000 Is 200.23.17.0/23 possible?

85 CSCI 547 Network Layer4-85 Commonly used CIDR prefixes CIDR Prefix# of former class C nets /281/16 (of class C) /271/8 /261/4 /251/2 /241 (class C) /232 /224 /218 /2016 /1932 /1864 /17128 /16256 = 1 class B /15512 /141024 /132048 /124096

86 CSCI 547 Network Layer4-86 IP addressing: CIDR r CIDR is also called as “supernetting” since we aggregate classful addresses—mostly class B and class C addresses r Example:  Let’s say we have the following 4 class C addresses: 200.168.4.0 11001000 10101000 00000100 00000000 200.168.5.0 11001000 10101000 00000101 00000000 200.168.6.0 11001000 10101000 00000110 00000000 200.168.7.0 11001000 10101000 00000111 00000000 With 255.255.255.0 as subnet mask = prefix ?  Let’s compare with CIDR address of 200.168.4.0/22  What is the difference?  List Class C address blocks given 200.168.8.0/21

87 CSCI 547 Network Layer4-87 IP addresses: how to get one? Q: How does a host get IP address? r Static addressing: hand-coded by system admin in a file  Wintel: control-panel->network->configuration- >tcp/ip->properties  UNIX: /etc/rc.config r Dynamic addressing: DHCP: Dynamic Host Configuration Protocol: dynamically get address from as a DHCP server  “plug-and-play” (more in next chapter)

88 CSCI 547 Network Layer4-88 IP addresses: how to get one? Using CIDR Q: How does a network get subnet part of IP addr? A: gets allocated portion of its provider ISP’s address space ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20 Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23 Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23 Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23... ….. …. …. Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

89 CSCI 547 Network Layer4-89 Hierarchical addressing: route aggregation: using CIDR “Send me anything with addresses beginning 200.23.16.0/20” 200.23.16.0/23200.23.18.0/23200.23.30.0/23 Fly-By-Night-ISP Organization 0 Organization 7 Internet Organization 1 ISPs-R-Us “Send me anything with addresses beginning 199.31.0.0/16” 200.23.20.0/23 Organization 2...... Hierarchical addressing allows efficient advertisement of routing information:

90 CSCI 547 Network Layer4-90 route aggregation using CIDR: Reduces size of routing tables for Internet Backbone routers Growth of BGP table 1994 to present

91 CSCI 547 Network Layer4-91 Hierarchical addressing: more specific routes ISPs-R-Us has a more specific route to Organization 1: This may happen when Organization 1 used to subscribe to Fly-By-Night- ISP but now moved to ISPs-R-Us. Organization 1 wants to keep 200.23.18.0/23! – this is one possible scenario In our text, you see another possible scenario—page 337 “Send me anything with addresses beginning 200.23.16.0/20” 200.23.16.0/23200.23.18.0/23200.23.30.0/23 Fly-By-Night-ISP Organization 0 Organization 7 Internet Organization 1 ISPs-R-Us “Send me anything with addresses beginning 199.31.0.0/16 or 200.23.18.0/23” 200.23.20.0/23 Organization 2...... 199.31.0.0/16

92 CSCI 547 Network Layer4-92 IP addressing: the last word... Q: How does an ISP get a block of addresses? A: From ICANN: Internet Corporation for AssignedICANN Names and Numbers  allocates addresses  manages DNS  assigns domain names, resolves disputes Also see http://www.pch.net/resources/data/WoN/itu-seminar-20040211- 1.ppt#480,1,Internet Addressing and the RIR systemhttp://www.pch.net/resources/data/WoN/itu-seminar-20040211- 1.ppt#480,1,Internet Addressing and the RIR system

93 CSCI 547 Network Layer4-93 Solutions to IP address depletion r Short term (interim) solutions:  CIDR  NAT(Network Address Translation)  VLSM(Variable Length Subnet Mask) r Long term solution: IPv6 (128 bits)

94 CSCI 547 Network Layer4-94 NAT: Network Address Translation 10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4 138.76.29.7 local network (e.g., home network) 10.0.0/24 Intranet Datagrams use 10.0.0/24 address Internet Datagrams are sent to the router ( 10.0.0.4 ) All datagrams leaving local network have same single source NAT IP address: 138.76.29.7, But different source port numbers Internet NAT table here

95 CSCI 547 Network Layer4-95 NAT: Network Address Translation r Motivation: local network uses just one IP address as far as outside world is concerned:  range of addresses not needed from ISP: just one IP address for all devices  can change addresses of devices in local network without notifying outside world  can change ISP without changing addresses of devices in local network  devices inside local net not explicitly addressable/ visible by outside world (a security plus).  popularly used by home networks connections to Internet

96 CSCI 547 Network Layer4-96 NAT: Network Address Translation Implementation: NAT router must:  outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #)... remote clients/servers will respond using (NAT IP address, new port #) as destination addr.  remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair  incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table

97 CSCI 547 Network Layer4-97 NAT: Network Address Translation 10.0.0.1 10.0.0.2 10.0.0.3 S: 10.0.0.1, 3345 D: 128.119.40.186, 80 1 10.0.0.4 138.76.29.7 1: host 10.0.0.1 sends datagram to 128.119.40.186, 80 NAT translation table WAN side addr LAN side addr 138.76.29.7, 5001 10.0.0.1, 3345 …… S: 128.119.40.186, 80 D: 10.0.0.1, 3345 4 S: 138.76.29.7, 5001 D: 128.119.40.186, 80 2 2: NAT router changes datagram source addr from 10.0.0.1, 3345 to 138.76.29.7, 5001, updates table S: 128.119.40.186, 80 D: 138.76.29.7, 5001 3 3: Reply arrives dest. address: 138.76.29.7, 5001 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345

98 CSCI 547 Network Layer4-98 NAT: Network Address Translation r 16-bit port-number field:  60,000 simultaneous connections with a single LAN- side address! Plenty! r NAT is controversial:  routers should only process up to layer 3  violates end-to-end argument NAT possibility must be taken into account by app designers, eg, P2P applications  address shortage should instead be solved by IPv6

99 CSCI 547 Network Layer4-99 NAT: Another form r The NAT described so far is also called as NAPT (Network Address Port Translation) r Another form is “Basic NAT” or “Static NAT”— involves only IP address translation--not ports  Router is configured with a pool of IP addresses  When a computer having private IP address wants to connect to Internet, router assigns an IP address from the pool until disconnected  Example usage: An ISP with 1000 users and only maximum 20% are on-line at a time. ISP uses NAT with a class C address(254 IP addresses) to serve all users

100 CSCI 547 Network Layer4-100 NAT: Another form 10.0.0.1 10.0.0.2 10.0.0.3 S: 10.0.0.1, 3345 D: 128.119.40.186, 80 1 10.0.0.4 138.76.29.7 1: host 10.0.0.1 sends datagram to 128.119.40.186, 80 NAT translation table WAN side addr LAN side addr 138.76.29.7 10.0.0.1 …… S: 128.119.40.186, 80 D: 10.0.0.1, 3345 4 S: 138.76.29.7, 3345 D: 128.119.40.186, 80 2 2: NAT router changes datagram source addr from 10.0.0.1 to 138.76.29.7, updates table S: 128.119.40.186, 80 D: 138.76.29.7, 3345 3 3: Reply arrives dest. address: 138.76.29.7, 5001 4: NAT router changes datagram dest addr from 138.76.29.7 to 10.0.0.1 Only IP addresses are changed! Notice that only IP addresses are changed by router

101 CSCI 547 Network Layer4-101 Solutions to IP address depletion r Short term (interim) solutions:  CIDR  NAT(Network Address Translation)  VLSM(Variable Length Subnet Mask) r Long term solution: IPv6 (128 bits)

102 CSCI 547 Network Layer4-102 VLSM(Variable Length Subnet Mask) : rfc 1817rfc 1817 r Classful subnetting divides a network into equal sizes at a given level=“one size fits all” r With CIDR, the VLSM was introduced—we can divide a network into different sizes at a given level—more flexible & save addresses 1 st division 2nd 3rd

103 CSCI 547 Network Layer4-103 VLSM: an example  Uses all 0’s & all 1’s subnets to fully utilze address space  A company is assigned a class C address space and needs the following: # of subnetssubnet sizepurpose 260+ hostsFor 2 main offices 410+ hostsFor 2 branch offices & 2 server farms The rest2 hostsPPP (for telecommuting) 1 st subnet mask 255.255.255.192 /26 X.Y.Z.0/26 62 hosts X.Y.Z.64/26 62 hosts 2 nd subnet mask 255.255.255.240 /28 X.Y.Z.128/28 14 hosts X.Y.Z.144/28 14 hosts... 3 rd subnet mask 255.255.255.252 /30 X.Y.Z.192/30 2 hosts X.Y.Z.196/30 2 hosts X.Y.Z.252/30 2 hosts... X.Y.Z.176/28 14 hosts For another example, visit here here

104 CSCI 547 Network Layer4-104 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

105 CSCI 547 Network Layer4-105 ICMP: Internet Control Message Protocol r used by hosts & routers to communicate network-level control information  error reporting: unreachable host, network, port, protocol  echo request/reply (used by ping) r network-layer but “above” IP:  ICMP msgs carried in IP datagrams—”horizontal layering” r ICMP message: type, code plus first 8 bytes of IP datagram causing error Type Code description 0 0 echo reply (ping) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 3 6 dest network unknown 3 7 dest host unknown 4 0 source quench (congestion control - not used) 8 0 echo request (ping) 9 0 route advertisement 10 0 router discovery 11 0 TTL expired 12 0 bad IP header

106 CSCI 547 Network Layer4-106 ICMP ICMP uses the service of IP to send a control message

107 CSCI 547 Network Layer4-107 Traceroute and ICMP: an example usage of ICMP r Source sends series of UDP segments (in Unix) to dest  First has TTL =1  Second has TTL=2, etc.  Unlikely port number(33434 and up) in unix implementations  Windows systems use ICMP Echo request not UDP r When nth datagram arrives to nth router:  Router discards datagram  And sends to source an ICMP message (type 11, code 0)  Message includes name of router & IP address r When ICMP message arrives, source calculates RTT r Traceroute does this 3 times Stopping criterion r UDP segment eventually arrives at destination host r Destination returns ICMP “host unreachable” packet (type 3, code 3) r When source gets this ICMP, stops. http://kb.pert.switch.ch/cgi-bin/twiki/view/PERTKB/VanJacobsonTraceroute

108 CSCI 547 Network Layer4-108 C:\Documents and Settings\Administrator> tracert www.csuchico.edu Tracing route to calypso.csuchico.edu [132.241.82.62] over a maximum of 30 hops: 1 6 ms 5 ms 11 ms 208-53-80-5.chico.ca.digitalpath.net [208.53.80.5] 2 7 ms 4 ms 4 ms 198-69-248-1.chico.ca.digitalpath.net [198.69.248.1] 3 9 ms 8 ms 8 ms sl-gw26-stk-5-0-TS9.sprintlink.net [144.232.195.169] 4 8 ms 10 ms 10 ms sl-bb20-stk-8-0.sprintlink.net [144.232.4.114] 5 13 ms 10 ms 9 ms sl-bb20-sj-9-0.sprintlink.net [144.232.20.99] 6 11 ms 9 ms 10 ms sl-bb21-sj-15-0.sprintlink.net [144.232.3.158] 7 10 ms 12 ms 10 ms sl-st20-sj-13-0.sprintlink.net [144.232.9.58] 8 118 ms 11 ms 14 ms so-7-1.car4.SanJose1.Level3.net [209.245.146.245] 9 13 ms 10 ms 12 ms ge-11-0.ipcolo3.SanJose1.Level3.net [4.68.123.43] 10 12 ms 14 ms 10 ms 4.79.44.6 11 14 ms 18 ms 14 ms dc-svl-dc1--isp-1-ge.cenic.net [137.164.22.58] 12 21 ms 22 ms 14 ms dc-oak-dc1--svl-dc1-10ge.cenic.net [137.164.22.31] 13 23 ms 22 ms 24 ms dc-csac-dc1--oak-dc1-ge.cenic.net [137.164.22.111] 14 26 ms 24 ms 24 ms dc-cor-dc1--sac-dc1-ge.cenic.net [137.164.22.153] 15 31 ms 26 ms 25 ms dc-cor-dc2--cor-dc1-df-iconn-1.cenic.net [137.164.22.199] 16 29 ms 27 ms 26 ms dc-csuchico-egm--cor-dc2.cenic.net [137.164.41.26] 17 32 ms 29 ms 35 ms chi-mocha-ge0-0-132.net.CSUChico.EDU [132.241.95.74] 18 40 ms 46 ms 46 ms calypso.CSUChico.EDU [132.241.82.62] Trace complete. Result of “tracert www.csuchico.edu” on a Windows host Round trip time of 3 probes

109 CSCI 547 Network Layer4-109 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

110 CSCI 547 Network Layer4-110 IPv6 (previously known as IPng (IP next generation)) RFC 2460 RFC 2460 r Initial motivation: 32-bit address space soon to be completely allocated. r Additional motivation:  header format helps speed processing/forwarding  header changes to facilitate QoS IPv6 datagram format:  fixed-length 40 byte header  no fragmentation allowed

111 CSCI 547 Network Layer4-111 IPv6 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 With 128 bits, you can assign over 3.7x10**21 addresses per square inch of the earth's surface.

112 CSCI 547 Network Layer4-112 Other Changes from IPv4 r Checksum: removed entirely to reduce processing time at each hop r Options: allowed, but outside of header, indicated by “Next Header” field r ICMPv6: new version of ICMP  additional message types, e.g. “Packet Too Big”  multicast group management functions

113 CSCI 547 Network Layer4-113 Differences Between IPv4 and IPv6 CategoryIPv4IPv6 Address length32 bits128 bits Header size20-60 bytes40 bytes—fixed size IPSecIPSec supportOptionalRequired QoSQoS supportLimitedBetter FragmentationDone by hosts and routersDone by hosts only Is a header checksum present?YesNo Does the header include options?YesNo Link-layer address resolutionBroadcast ARP frames Multicast Neighbor Solicitation messages Error reporting and diagnostic protocolICMP (for IPv4)ICMPv6 Multicast group membership protocolIGMPMLD Router discovery supportOptionalRequired Network layer broadcast addresses?YesNo Host configurationDHCP or manualAutomatic, DHCP, or manual DNS record type for name resolutionA recordAAAA record DNS record type and location for reverse name resolution PTR records in IN- ADDR.ARPA domain PTR records in IP6.INT domain

114 CSCI 547 Network Layer4-114 Transition From IPv4 To IPv6 r Not all routers can be upgraded simultaneous  no “flag days” feasible  How will the network operate with mixed IPv4 and IPv6 routers? r Two main approaches:  Dual Stack: A host or router implements both IPv4 and IPv6.  Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers

115 CSCI 547 Network Layer4-115 Tunneling A B E F IPv6 tunnel Logical view: Physical view: A B E F IPv6 IPv4

116 CSCI 547 Network Layer4-116 Tunneling A B E F IPv6 tunnel Logical view: Physical view: A B E F IPv6 C D IPv4 Flow: X Src: A Dest: F data Flow: X Src: A Dest: F data Flow: X Src: A Dest: F data Src:B Dest: E Flow: X Src: A Dest: F data Src:B Dest: E A-to-B: IPv6 E-to-F: IPv6 B-to-C: IPv6 inside IPv4 B-to-C: IPv6 inside IPv4

117 CSCI 547 Network Layer4-117 Tunneling: another view From http://www.cisco.com/univercd/cc/td/doc/product/soft ware/ios123/123cgcr/ipv6_c/sa_tunv6.htm http://www.cisco.com/univercd/cc/td/doc/product/soft ware/ios123/123cgcr/ipv6_c/sa_tunv6.htm

118 CSCI 547 Network Layer4-118 IPv6 Deployment? To see the current deployment, visit http://bgp.potaroo.net/index-v6.html http://bgp.potaroo.net/index-v6.html Not likely to happen in the foreseeable future

119 CSCI 547 Network Layer4-119 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

120 CSCI 547 Network Layer4-120 1 2 3 0111 value in arriving packet’s header routing algorithm local forwarding table header value output link 0100 0101 0111 1001 32213221 Interplay between routing, forwarding Difference?

121 CSCI 547 Network Layer4-121 u y x wv z 2 2 1 3 1 1 2 5 3 5 Graph: G = (N,E) N = set of routers = { u, v, w, x, y, z } E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) } Graph abstraction—routing can be analyzed as a graph problem Remark: Graph abstraction is useful in other network contexts Example: P2P, where N is set of peers and E is set of TCP connections nodes edges

122 CSCI 547 Network Layer4-122 Graph abstraction: costs u y x wv z 2 2 1 3 1 1 2 5 3 5 c(x,x’) = cost of link (x,x’) - e.g., c(w,z) = 5 cost could always be set to 1(all links has same cost—hop count), or inversely related to bandwidth, or inversely related to Congestion, or … Cost of path (x 1, x 2, x 3,…, x p ) = c(x 1,x 2 ) + c(x 2,x 3 ) + … + c(x p-1,x p ) Question: What’s the least-cost path between u and z ? Routing algorithm: algorithm that finds least-cost path

123 CSCI 547 Network Layer4-123 Routing algorithm design u y x wv z 2 2 1 3 1 1 2 5 3 5 Assuming that we can decide the cost of the links  How would routers learn about the weights of the links other than the directly connected links?  How often routers advertise the weights?  The scope of advertisement?

124 CSCI 547 Network Layer4-124 Routing Algorithm classification Global or decentralized information? Global: r all routers have complete topology, link cost info r “link state” algorithms Decentralized: r router knows physically- connected neighbors, link costs to neighbors r iterative process of computation, exchange of info with neighbors r “distance vector” algorithms Static or dynamic? Static: r routes change slowly over time Dynamic: r routes change more quickly  periodic update  in response to link cost changes

125 CSCI 547 Network Layer4-125 IGP(Intra AS) vs EGP(Inter AS) A group of networks and routers under the authority of a single administration AS: Autonomous System To see AS numbers, visit here

126 CSCI 547 Network Layer4-126 AS numbers from http://bgp.potaroo.net/cidr/autnums.html http://bgp.potaroo.net/cidr/autnums.html AS3895 AS3895 AMEDD-EUR - DoD Network Information Center AS3896 AMEDD-EUR - DoD Network Information Center AS3897 AMEDD-EUR - DoD Network Information Center AS3898 UCSF-HISD - University of Calif. S.F. - Hospital Info Sys AS3896 AS3897 AS3898 AS3899 AS3899 CHICO-NET - California State University, Chico AS3900 TEXASNET-ASN - Yokubaitis Holding Corporation AS3901 ARRAKIS - Higher Technology Services AS3900 AS3901 AS3902 AS3902 GLAXOCA-1 - Glaxo Canada Inc. AS3903 AS3903 NAG-AS - Network Ananlysis Group AS3904 AS3904 ASTHOUGHTPRT - ThoughtPort inc.

127 CSCI 547 Network Layer4-127 Popular Routing Algorithms Distance vector Link state Path vector

128 CSCI 547 Network Layer4-128 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

129 CSCI 547 Network Layer4-129 Routing Algorithms r Interior Routing(within one AS) vs Exterior Routing (between AS's) r Current Routing Algorithms Two common Routing Algorithms(Both are adaptive(dynamic) algorithms) (a) "Link State Routing"-Each router shares its knowledge about its links to the neighbors(link state) with every routers in the area.-Example: OSPF ***LINK STATES to EVERYBODY*** (b) "Distance Vector Routing"--Each router shares its knowledge(distance to destination networks) about the entire network(in an AS) with its neighbors-Example: RIPv2 ***EVERYTHING to NEIGHBORS ONLY***

130 CSCI 547 Network Layer4-130 A Link-State Routing Algorithm Dijkstra’s algorithm r net topology, link costs known to all nodes  accomplished via “link state broadcast”  all nodes have same info r computes least cost paths from one node (‘source”) to all other nodes  gives forwarding table for that node r iterative: after k iterations, know least cost path to k dest.’s 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

131 CSCI 547 Network Layer4-131 Dijsktra’s Algorithm 1 Initialization: 2 N' = {u} 3 for all nodes v 4 if v adjacent to u 5 then D(v) = c(u,v) 6 else D(v) = ∞ 7 8 Loop 9 find w not in N' such that D(w) is a minimum 10 add w to N' 11 update D(v) for all v adjacent to w and not in N' : 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N'

132 CSCI 547 Network Layer4-132 Dijkstra’s algorithm: example Step 0 1 2 3 4 5 N' u ux uxy uxyv uxyvw uxyvwz D(v),p(v) 2,u D(w),p(w) 5,u 4,x 3,y D(x),p(x) 1,u D(y),p(y) ∞ 2,x D(z),p(z) ∞ 4,y u y x wv z 2 2 1 3 1 1 2 5 3 5

133 CSCI 547 Network Layer4-133 Dijkstra’s algorithm: example (2) u y x wv z Resulting shortest-path tree from u: v x y w z (u,v) (u,x) destination link Resulting forwarding table in u:

134 CSCI 547 Network Layer4-134 Dijkstra’s algorithm, discussion Algorithm complexity: n nodes r each iteration: need to check all nodes, w, not in N r n(n+1)/2 comparisons: O(n 2 ) r more efficient implementations possible: O(nlogn) Oscillations possible: r e.g., link cost = amount of carried traffic A D C B 1 1+e e 0 e 1 1 0 0 A D C B 2+e 0 0 0 1+e 1 A D C B 0 2+e 1+e 1 0 0 A D C B 2+e 0 e 0 1+e 1 initially … recompute routing … recompute

135 CSCI 547 Network Layer4-135 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

136 CSCI 547 Network Layer4-136 Link State r Link State Routing--Example: OSPF(Open Shortest Path First) http://www.cisco.com/univercd/cc/td/d oc/cisi twk/ito_doc/ospf.htmhttp://www.cisco.com/univercd/cc/td/d oc/cisi twk/ito_doc/ospf.htm r OSPF is an IGP(Interior Gateway Protocol) developed by IETF Currently Version 2-- RFC 1583 --also has a version for IPv6— RFC 2740 Open(spec. on public domain) OSPF has features not in RIP and is suitable for a large network Based on Dijkstra's algorithm OSPF is an intra-AS protocol RFC 1583RFC 2740

137 CSCI 547 Network Layer4-137 OSPF Autonomous System: A group of networks and routers under the authority of a single administration

138 CSCI 547 Network Layer4-138 -Autonomous System(A group of networks and routers under the authority of a single administration) is divided into Areas(A collection of networks, hosts, and routers all contained within an autonomous system). An AS is made up of several Areas. -3 kinds of routers in OSPF--(1) Intra-Area routers (2) Area Border routers (3) AS Boundary routers -Routers inside an Area flood the Area with routing information--information is exchanged to all routers in an Area by Flooding(actually multicasting)--all routers in an area maintain the same topology database -This area concept limits the size of the topology database that must be held by all routers in the area -At the border of an area, special routers called Area border routers collect and summarize the information about each area it is attached to and send the summary to other areas. OSPF

139 CSCI 547 Network Layer4-139 -One of the areas into which all areas have a connection is called Backbone(all OSPF networks must contain at least one area, the Backbone) which is assigned an area identifier of 0.0.0.0(meaning Area 0--not an IP address) -Routers inside a backbone are called Backbone routers-- Backbone routers operate identically to other Intra- Area routers and maintain full topology databases for the backbone area -Autonomous Systems are connected via AS Boundary Routers--they exchange reachability information with routers in other ASs using an Exterior Gateway Protocol. -OSPF is "Link State Routing" -OSPF protocol allows the administrator to assign a cost(metric) to each route: OSPF

140 CSCI 547 Network Layer4-140 OSPF Cost--from http://www.cisco.com/warp/public/104/2.html#1.0 "The cost (also called metric) of an interface in OSPF is an indication of the overhead required to send packets across a certain interface. The cost of an interface is inversely proportional to the bandwidth of that interface. A higher bandwidth indicates a lower cost. There is more overhead (higher cost) and time delays involved in crossing a 56k serial line than crossing a 10M ethernet line. The formula used to calculate the cost is: cost= 10000 0000/bandwith in bps For example, it will cost 10 EXP8/10 EXP7 = 10 to cross a 10Mbps Ethernet line and will cost 10 EXP8/1544000 = 64 to cross a T1 line. By default, the cost of an interface is calculated based on the bandwidth; you can force the cost of an interface by using the ip ospf cost interface sub-command." -The cost can also be based on a type of service(minimum delay, maximum throughput, …) http://www.cisco.com/warp/public/104/2.html#1.0 OSPF

141 CSCI 547 Network Layer4-141 OSPF Cost calculation

142 CSCI 547 Network Layer4-142 Distance vector Link state Path vector

143 CSCI 547 Network Layer4-143 Distance Vector: RIP RIP(Rourting Information Protocol) - An IGP(Interior Gateway Protocol) developed by XEROX(XNS-Xerox Network Systems) - RIP widely adopted in Internet with 1982 4BSD UNIX even before the standard  RFC 1058(1988)-later revised with RFC1388(RIP V.2) - Popular in small networks - Also popular for PC networking - AppleTalk's routing = version of RIP - Novell, 3COM, Banyan - RIP is a Distance Vector Routing---Hop Count is used as the metric--How many hops(each router is a hop) to the destination network?

144 CSCI 547 Network Layer4-144 Operation - Each router initializes with a distance vector table containing zero(0) for itself, one(1) for directly attached networks, and infinity for every other destination. - Each router periodically (typically every 30 seconds) transmits its distance vector table to each of its neighbors. A router sends it's knowledge about the entire Autonomous system(=it's entire routing table(Netid, Hop Count entries)) to its neighboring routers( only to its neighbors). It can also transmit the table when a link first comes up or when the table changes. - Each router saves the most recent table it receives from each neighbor and uses the information to calculate its own distance vector table. (=Each router maintains the distance from itself to every known destination network in a "distance vector table") - Hop count is used as the metric--distance=how many hops RIP

145 CSCI 547 Network Layer4-145 RIP routing table

146 CSCI 547 Network Layer4-146 RIP Updating Algorithm Receive: A RIP message from a neighbor 1. Add one hop to the hop count for each advertised destination 2. Repeat the following steps for each advertised destination: 1. If(destination not in the routing table), then Add the advertised information to the table 2. Else 1. If(next-hop field is the same as the sender's address), then Replace entry in the table with the advertised one 2. Else 1. If(advertised hop count smaller than one in the table), then Add it to the routing table 2. Else do nothing 3. Return C F B A E

147 CSCI 547 Network Layer4-147 Distance Vector Algorithm Bellman-Ford Equation (dynamic programming) Define d x (y) := cost of least-cost path from x to y Then d x (y) = min {c(x,v) + d v (y) } where min is taken over all neighbors v of x v

148 CSCI 547 Network Layer4-148 Bellman-Ford example u y x wv z 2 2 1 3 1 1 2 5 3 5 Clearly, d v (z) = 5, d x (z) = 3, d w (z) = 3 d u (z) = min { c(u,v) + d v (z), c(u,x) + d x (z), c(u,w) + d w (z) } = min {2 + 5, 1 + 3, 5 + 3} = 4 Node that achieves minimum is next hop in shortest path ➜ forwarding table B-F equation says:

149 CSCI 547 Network Layer4-149 Distance Vector Algorithm r D x (y) = estimate of least cost from x to y r Node x knows cost to each neighbor v: c(x,v) r Node x maintains distance vector D x = [D x (y): y є N ] r Node x also maintains its neighbors’ distance vectors  For each neighbor v, x maintains D v = [D v (y): y є N ]

150 CSCI 547 Network Layer4-150 Distance vector algorithm (4) Basic idea: r Each node periodically sends its own distance vector estimate to neighbors r When a node x receives new DV estimate from neighbor, it updates its own DV using B-F equation: D x (y) ← min v {c(x,v) + D v (y)} for each node y ∊ N  Under minor, natural conditions, the estimate D x (y) converge to the actual least cost d x (y)

151 CSCI 547 Network Layer4-151 Distance Vector Algorithm (5) Iterative, asynchronous: each local iteration caused by: r local link cost change r DV update message from neighbor Distributed: r each node notifies neighbors only when its DV changes  neighbors then notify their neighbors if necessary wait for (change in local link cost or msg from neighbor) recompute estimates if DV to any dest has changed, notify neighbors Each node:

152 CSCI 547 Network Layer4-152 x y z x y z 0 2 7 ∞∞∞ ∞∞∞ from cost to from x y z x y z 0 from cost to x y z x y z ∞∞ ∞∞∞ cost to x y z x y z ∞∞∞ 710 cost to ∞ 2 0 1 ∞ ∞ ∞ 2 0 1 7 1 0 time x z 1 2 7 y node x table node y table node z table D x (y) = min{c(x,y) + D y (y), c(x,z) + D z (y)} = min{2+0, 7+1} = 2 D x (z) = min{c(x,y) + D y (z), c(x,z) + D z (z)} = min{2+1, 7+0} = 3 32

153 CSCI 547 Network Layer4-153 x y z x y z 0 2 7 ∞∞∞ ∞∞∞ from cost to from x y z x y z 0 2 3 from cost to x y z x y z 0 2 3 from cost to x y z x y z ∞∞ ∞∞∞ cost to x y z x y z 0 2 7 from cost to x y z x y z 0 2 3 from cost to x y z x y z 0 2 3 from cost to x y z x y z 0 2 7 from cost to x y z x y z ∞∞∞ 710 cost to ∞ 2 0 1 ∞ ∞ ∞ 2 0 1 7 1 0 2 0 1 7 1 0 2 0 1 3 1 0 2 0 1 3 1 0 2 0 1 3 1 0 2 0 1 3 1 0 time x z 1 2 7 y node x table node y table node z table D x (y) = min{c(x,y) + D y (y), c(x,z) + D z (y)} = min{2+0, 7+1} = 2 D x (z) = min{c(x,y) + D y (z), c(x,z) + D z (z)} = min{2+1, 7+0} = 3

154 CSCI 547 Network Layer4-154 Advantages of RIP-----Simplicity=low overhead Disadvantages of RIP: (a)The limit to the size of a network imposed by maximum hop count(15). (b) Slow Convergence problem Changes in routes propagates slowly. For example, suppose there is a change in local LAN to which a router is connected. The router updates itself immediately. Then it will advertise the change in 30 seconds, so the next neighboring routers will know, then they will advertise within 30 seconds, …… Assuming a remote router is n hops away, then it could take 30*n seconds. This is why RIP limits the maximum hop count to 15. RIP is designed for small networks (c) Instability problem(Also called "count to infinity problem") Counting to infinity occurs when a network becomes unreachable, but erroneous routes to that network persist because of the time for the distance vector tables to converge.

155 CSCI 547 Network Layer4-155 Distance Vector: link cost changes To solve the Slow Convergence problem, whe link cost changes notify neighbors ASAP: r node detects local link cost change r updates routing info, recalculates distance vector r if DV changes, notify neighbors immediately “good news travels fast” x z 1 4 50 y 1 At time t 0, y detects the link-cost change, updates its DV, and informs its neighbors. At time t 1, z receives the update from y and updates its table. It computes a new least cost to x and sends its neighbors its DV. At time t 2, y receives z’s update and updates its distance table. y’s least costs do not change and hence y does not send any message to z. But this does not solve Instability problem

156 CSCI 547 Network Layer4-156 Instability problem for RIP(Also called as "count to infinity problem") Net1 goes down When B sends its table, A thinks that B can deliver to Net1 When A sends its table, B updates the hop count( thru A ! ) 1 2 3 B finally learns that Net1 is down  hop count 16 means the net is down

157 CSCI 547 Network Layer4-157 Comparison of LS and DV algorithms Message complexity r LS: with n nodes, E links, O(nE) msgs sent r DV: exchange between neighbors only  convergence time varies Speed of Convergence r LS: O(n 2 ) algorithm requires O(nE) msgs  may have oscillations r 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:  DV node can advertise incorrect path cost  each node’s table used by others error propagate thru network

158 CSCI 547 Network Layer4-158 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

159 CSCI 547 Network Layer4-159 Hierarchical Routing scale: with 200 million destinations: r can’t store all dest’s in routing tables! r routing table exchange would swamp links! administrative autonomy r internet = network of networks r each network admin may want to control routing in its own network Our routing study thus far - idealization r all routers identical r network “flat” … not true in practice

160 CSCI 547 Network Layer4-160 Hierarchical Routing r aggregate routers into regions, “autonomous systems” (AS) r routers in same AS run same routing protocol  “intra-AS” routing protocol  routers in different AS can run different intra- AS routing protocol Gateway router r Direct link to router in another AS

161 CSCI 547 Network Layer4-161 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b Intra-AS Routing algorithm Inter-AS Routing algorithm Forwarding table 3c Interconnected ASes r Forwarding table is configured by both intra- and inter-AS routing algorithm  Intra-AS sets entries for internal dests  Inter-AS & Intra-AS sets entries for external dests

162 CSCI 547 Network Layer4-162 AS numbers from http://bgp.potaroo.net/cidr/autnums.html http://bgp.potaroo.net/cidr/autnums.html AS3895 AS3895 AMEDD-EUR - DoD Network Information Center AS3896 AMEDD-EUR - DoD Network Information Center AS3897 AMEDD-EUR - DoD Network Information Center AS3898 UCSF-HISD - University of Calif. S.F. - Hospital Info Sys AS3896 AS3897 AS3898 AS3899 AS3899 CHICO-NET - California State University, Chico AS3900 TEXASNET-ASN - Yokubaitis Holding Corporation AS3901 ARRAKIS - Higher Technology Services AS3900 AS3901 AS3902 AS3902 GLAXOCA-1 - Glaxo Canada Inc. AS3903 AS3903 NAG-AS - Network Ananlysis Group AS3904 AS3904 ASTHOUGHTPRT - ThoughtPort inc.

163 CSCI 547 Network Layer4-163 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c Inter-AS tasks r Suppose a router in AS1 receives datagram for which dest is outside of AS1  Router should forward packet towards one of the gateway routers, but which one? AS1 needs: 1. to learn which dests are reachable through AS2 and which through AS3 2. to propagate this reachability info to all routers in AS1 Job of inter-AS routing! Gateway routers

164 CSCI 547 Network Layer4-164 Example: Setting forwarding table in router 1d r Suppose AS1 learns (via inter-AS protocol) that subnet x is reachable via AS3 (gateway 1c) but not via AS2. r Inter-AS protocol propagates reachability info to all internal routers. r Router 1d determines from intra-AS routing info that its interface I is on the least cost path to 1c. r Puts in forwarding table entry (x,I). 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c

165 CSCI 547 Network Layer4-165 Example: Choosing among multiple ASes r Now suppose AS1 learns from the inter-AS protocol that subnet x is reachable via AS3 and via AS2. r To configure forwarding table, router 1d must determine towards which gateway it should forward packets for dest x. r This is also the job on inter-AS routing protocol! 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c

166 CSCI 547 Network Layer4-166 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 Example: Choosing among multiple ASes r Now suppose AS1 learns from the inter-AS protocol that subnet x is reachable from AS3 and from AS2. r To configure forwarding table, router 1d must determine towards which gateway it should forward packets for dest x. r This is also the job on inter-AS routing protocol! r Hot potato routing: send packet towards closest of two routers.

167 CSCI 547 Network Layer4-167 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

168 CSCI 547 Network Layer4-168 Intra-AS Routing r Also known as Interior Gateway Protocols (IGP) r Most common Intra-AS routing protocols:  RIP: Routing Information Protocol  OSPF: Open Shortest Path First  IGRP: Interior Gateway Routing Protocol (Cisco proprietary—modified version of RIP)

169 CSCI 547 Network Layer4-169 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

170 CSCI 547 Network Layer4-170 RIP ( Routing Information Protocol) r Distance vector algorithm r Included in BSD-UNIX Distribution in 1982 r Distance metric: # of hops (max = 15 hops) D C BA u v w x y z destination hops u 1 v 2 w 2 x 3 y 3 z 2 From router A to subsets:

171 CSCI 547 Network Layer4-171 RIP advertisements r Distance vectors: exchanged among neighbors every 30 sec via Response Message (also called advertisement) r Each advertisement: list of up to 25 destination nets within AS

172 CSCI 547 Network Layer4-172 RIP: Example Destination Network Next Router Num. of hops to dest. wA2 yB2 zB7 x--1 ….…..... w xy z A C D B Routing table in D

173 CSCI 547 Network Layer4-173 RIP: Example Destination Network Next Router Num. of hops to dest. wA2 yB2 zB A7 5 x--1 ….…..... Routing table in D w xy z A C D B Dest Next hops w - 1 x - 1 z C 4 …. …... Advertisement from A to D

174 CSCI 547 Network Layer4-174 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)

175 CSCI 547 Network Layer4-175 RIP Table processing r RIP routing tables managed by application-level process called route-d (daemon) r advertisements sent in UDP packets, periodically repeated physical link network forwarding (IP) table Transprt (UDP) routed physical link network (IP) Transprt (UDP) routed forwarding table

176 CSCI 547 Network Layer4-176 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

177 CSCI 547 Network Layer4-177 OSPF (Open Shortest Path First) r “open”: publicly available r Uses Link State algorithm  LS packet dissemination  Topology map at each node  Route computation using Dijkstra’s algorithm r OSPF advertisement carries one entry for each connection to neighbor router r Advertisements disseminated to entire AS (via flooding)  Carried in OSPF messages directly over IP (rather than TCP or UDP) via IP protocol number 89.

178 CSCI 547 Network Layer4-178 OSPF “advanced” features (not in RIP) r Security: all OSPF messages authenticated (to prevent malicious intrusion) using MD5 (Message-Digest algorithm 5)MD5 r Multiple same-cost paths allowed (only one path in RIP) r For each link, multiple cost metrics for different TOS (e.g., satellite link cost set “low” for best effort; high for real time) r Integrated uni- and multicast support:  Multicast OSPF (MOSPF) uses same topology data base as OSPF r Hierarchical OSPF in large domains.

179 CSCI 547 Network Layer4-179 Hierarchical OSPF

180 CSCI 547 Network Layer4-180 Hierarchical OSPF r 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. r Area border routers: “summarize” distances to nets in own area, advertise to other Area Border routers. r Backbone routers: run OSPF routing limited to backbone. r Boundary routers: connect to other AS’s.

181 CSCI 547 Network Layer4-181 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

182 CSCI 547 Network Layer4-182 Internet inter-AS routing: BGP r BGP (Border Gateway Protocol): the de facto (Latin: “In practice) standard r BGP provides each AS a means to: 1. Obtain subnet reachability information from neighboring ASs. 2. Propagate reachability information to all AS-internal routers. 3. Determine “good” routes to subnets based on reachability information and policy. r allows subnet to advertise its existence to rest of Internet: “I am here”

183 CSCI 547 Network Layer4-183 BGP basics r Pairs of routers (BGP peers) exchange routing info over semi-permanent TCP connections: BGP sessions  BGP sessions need not correspond to physical links. r When AS2 advertises a prefix to AS1, AS2 is promising it will forward any datagrams destined to that prefix towards the prefix.  AS2 can aggregate prefixes in its advertisement 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c eBGP session iBGP session

184 CSCI 547 Network Layer4-184 Distributing reachability info r With eBGP session between 3a and 1c, AS3 sends prefix reachability info to AS1. r 1c can then use iBGP to distribute this new prefix reachability info to all routers in AS1 r 1b can then re-advertise new reachability info to AS2 over 1b- to-2a eBGP session r When router learns of new prefix, creates entry for prefix in its forwarding table. 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c eBGP session iBGP session

185 CSCI 547 Network Layer4-185 Path attributes & BGP routes r When advertising a prefix, includes BGP attributes.  prefix + attributes = “route” r Two important attributes:  AS-PATH: contains ASs through which prefix advertisement has passed: AS 67 AS 17 –- “path vector” algorithm  NEXT-HOP: Indicates specific internal-AS router to next- hop AS. (There may be multiple links from current AS to next-hop-AS.) r When gateway router receives route advertisement, uses import policy to accept/decline.

186 CSCI 547 Network Layer4-186 BGP route selection r Router may learn about more than 1 route to some prefix. Router must select route. r Elimination rules: 1. Local preference value attribute: policy decision 2. Shortest AS-PATH 3. Closest NEXT-HOP router: hot potato routing 4. Additional criteria

187 CSCI 547 Network Layer4-187 BGP messages r BGP messages exchanged using TCP. r BGP messages:  OPEN: opens TCP connection to peer and authenticates sender  UPDATE: advertises new path (or withdraws old)  KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN request  NOTIFICATION: reports errors in previous msg; also used to close connection

188 CSCI 547 Network Layer4-188 BGP routing policy r A,B,C are provider networks r X,W,Y are customer (of provider networks) r X is dual-homed: attached to two networks  X does not want to route from B via X to C .. so X will not advertise to B a route to C

189 CSCI 547 Network Layer4-189 BGP routing policy (2) r A advertises to B the path AW r B advertises to X the path BAW r Should B advertise to C the path BAW?  No way! B gets no “revenue” for routing CBAW since neither W nor C are B’s customers  B wants to force C to route to w via A  B wants to route only to/from its customers!

190 CSCI 547 Network Layer4-190 Why different Intra- and Inter-AS routing ? Policy: r Inter-AS: admin wants control over how its traffic routed, who routes through its net. r Intra-AS: single admin, so no policy decisions needed Scale: r hierarchical routing saves table size, reduced update traffic Performance: r Intra-AS: can focus on performance r Inter-AS: policy may dominate over performance

191 CSCI 547 Network Layer4-191 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing

192 CSCI 547 Network Layer4-192 R1 R2 R3R4 source duplication R1 R2 R3R4 in-network duplication duplicate creation/transmission duplicate Broadcast Routing r Deliver packets from source to all other nodes r Source duplication is inefficient: r Source duplication: how does source determine recipient addresses?

193 CSCI 547 Network Layer4-193 In-network duplication r Flooding: when node receives brdcst pckt, sends copy to all neighbors  Problems: cycles & broadcast storm r Controlled flooding: node only brdcsts pkt if it hasn’t brdcst same packet before  Node keeps track of pckt ids already brdcsted  Or reverse path forwarding (RPF): only forward pckt if it arrived on shortest path between node and source r Spanning tree  No redundant packets received by any node

194 CSCI 547 Network Layer4-194 A B G D E c F A B G D E c F (a) Broadcast initiated at A (b) Broadcast initiated at D Spanning Tree r First construct a spanning tree r Nodes forward copies only along spanning tree

195 CSCI 547 Network Layer4-195 A B G D E c F 1 2 3 4 5 (a)Stepwise construction of spanning tree A B G D E c F (b) Constructed spanning tree Spanning Tree: Creation—one of many algorithms r Center node is predefined—node E in this example r Each node sends unicast join message to center node  Message forwarded until it arrives at a node already belonging to spanning tree  Once the spanning tree is made, any node can broadcast

196 CSCI 547 Network Layer4-196 Modes of message transfer anycast broadcast multicast unicast Added in IPv6

197 CSCI 547 Network Layer4-197 Multicasting on Internet  IP Multicast IP Multicast  Internet Relay Chat Internet Relay Chat  NNTP Network News Transfer Protocol NNTP  PSYC Protocol for SYnchronous Conferencing PSYC  WWCP World Wide Conferencing Network WWCP  XCAST Explicit Multi-Unicast XCAST  Streaming media Streaming media  Interactive games Send to group members only

198 CSCI 547 Network Layer4-198 Two main problems in multicasting r How to identify group members? r What address should be used? ClassStartEndDefault Subnet Mask CIDR prefix notation A1.0.0.0127. 255.255.255255.0.0.0/8 B128.0.0.0191.255. 255.255255.255.0.0/16 C192.0.0.0223.255.255.255255.255.255.0/24 D224.0.0.0239.255.255.255NA E240.0.0.0255.255.255.255NA

199 CSCI 547 Network Layer4-199 mcast

200 CSCI 547 Network Layer4- 200 Multicast Routing: sending to a Group r Goal: find a tree (or trees) connecting routers having local mcast group members (Tree is ideal for this: not all paths between routers used) Two approaches:  source-based: different tree from each sender to rcvrs  shared-tree: same tree used by all group members Shared tree Source-based trees

201 CSCI 547 Network Layer4-201 Approaches for building mcast trees Approaches: r source-based tree: one tree per source—same as spanning-tree algorithm  shortest path trees  reverse path forwarding r group-shared tree: group uses one tree  minimal spanning (Steiner)  center-based trees …we first look at basic approaches, then specific protocols adopting these approaches

202 CSCI 547 Network Layer4- 202 Shortest Path Tree r mcast forwarding tree: tree of shortest path routes from source to all receivers  Dijkstra’s algorithm R1 R2 R3 R4 R5 R6 R7 2 1 6 3 4 5 i router with attached group member router with no attached group member link used for forwarding, i indicates order link added by algorithm LEGEND S: source

203 CSCI 547 Network Layer4- 203 Reverse Path Forwarding if (mcast datagram received on incoming link on shortest path back to center) then flood datagram onto all outgoing links else ignore datagram  rely on router’s knowledge of unicast shortest path from it to sender  each router has simple forwarding behavior:

204 CSCI 547 Network Layer4- 204 Reverse Path Forwarding: example result is a source-specific reverse SPT –may be a bad choice with asymmetric links R1 R2 R3 R4 R5 R6 R7 router with attached group member router with no attached group member datagram will be forwarded LEGEND S: source datagram will not be forwarded

205 CSCI 547 Network Layer4- 205 Reverse Path Forwarding: pruning r forwarding tree contains subtrees with no mcast group members  no need to forward datagrams down subtree  “prune” msgs sent upstream by router with no downstream group members R1 R2 R3 R4 R5 R6 R7 router with attached group member router with no attached group member prune message LEGEND S: source links with multicast forwarding P P P

206 CSCI 547 Network Layer4- 206 Shared-Tree: Steiner Tree r Steiner Tree: minimum cost tree connecting all routers with attached group members r problem is NP-complete ("non-deterministic polynomial time")NP-completepolynomial time r excellent heuristics existsheuristics r not used in practice:  computational complexity  information about entire network needed  monolithic: rerun whenever a router needs to join/leave

207 CSCI 547 Network Layer4- 207 Center-based trees r single delivery tree shared by all r one router identified as “center” of tree r to join:  edge router sends unicast join-msg addressed to center router  join-msg “processed” by intermediate routers and forwarded towards center  join-msg either hits existing tree branch for this center, or arrives at center  path taken by join-msg becomes new branch of tree for this router

208 CSCI 547 Network Layer4- 208 Center-based trees: an example Suppose R6 chosen as center: R1 R2 R3 R4 R5 R6 R7 router with attached group member router with no attached group member path order in which join messages generated LEGEND 2 1 3 1

209 CSCI 547 Network Layer4- 209 Internet Multicasting Routing: DVMRP r DVMRP: Distance Vector Multicast Routing Protocol, RFC1075RFC1075 r flood and prune: reverse path forwarding, source-based tree  RPF tree based on DVMRP’s own routing tables constructed by communicating DVMRP routers  no assumptions about underlying unicast  initial datagram to mcast group flooded everywhere via RPF  routers not wanting group: send upstream prune msgs

210 CSCI 547 Network Layer4-210 DVMRP: continued… r soft state: DVMRP router periodically (1 min.) “forgets” branches are pruned:  mcast data again flows down unpruned branch  downstream router: reprune or else continue to receive data r routers can quickly regraft to tree  following IGMP join at leaf r odds and ends  commonly implemented in commercial routers  Mbone routing done using DVMRP

211 CSCI 547 Network Layer4-211 Tunneling Q: How to connect “islands” of multicast routers in a “sea” of unicast routers?  mcast datagram encapsulated inside “normal” (non-multicast- addressed) datagram  normal IP datagram sent thru “tunnel” via regular IP unicast to receiving mcast router  receiving mcast router unencapsulates to get mcast datagram physical topology logical topology

212 CSCI 547 Network Layer4-212 PIM: Protocol Independent Multicast r PIM is a family of multicast routing protocol r not dependent on any specific underlying unicast routing algorithm (works with all) r two different multicast distribution scenarios : Dense:  group members densely packed, in “close” proximity.  bandwidth more plentiful Sparse:  # networks with group members small wrt # interconnected networks  group members “widely dispersed”  bandwidth not plentiful

213 CSCI 547 Network Layer4-213 Consequences of Sparse-Dense Dichotomy: Dense r group membership by routers assumed until routers explicitly prune r data-driven construction on mcast tree (e.g., RPF) r bandwidth and non-group- router processing profligate Sparse : r no membership until routers explicitly join r receiver- driven construction of mcast tree (e.g., center-based) r bandwidth and non-group- router processing conservative

214 CSCI 547 Network Layer4-214 PIM- Dense Mode flood-and-prune RPF, similar to DVMRP but  underlying unicast protocol provides RPF info for incoming datagram  less complicated (less efficient) downstream flood than DVMRP reduces reliance on underlying routing algorithm  has protocol mechanism for router to detect it is a leaf-node router

215 CSCI 547 Network Layer4-215 PIM - Sparse Mode r center-based approach r router sends join msg to rendezvous point (RP)  intermediate routers update state and forward join r after joining via RP, router can switch to source-specific tree  increased performance: less concentration, shorter paths R1 R2 R3 R4 R5 R6 R7 join all data multicast from rendezvous point rendezvous point

216 CSCI 547 Network Layer4-216 PIM - Sparse Mode sender(s): r unicast data to RP, which distributes down RP- rooted tree r RP can extend mcast tree upstream to source r RP can send stop msg if no attached receivers  “no one is listening!” R1 R2 R3 R4 R5 R6 R7 join all data multicast from rendezvous point rendezvous point

217 CSCI 547 Network Layer4-217 Chapter 4: summary r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol  Datagram format  IPv4 addressing  ICMP  IPv6 r 4.5 Routing algorithms  Link state  Distance Vector  Hierarchical routing r 4.6 Routing in the Internet  RIP  OSPF  BGP r 4.7 Broadcast and multicast routing For more info. for routing, visit herehere


Download ppt "CSCI 547 Network Layer4-1 Chapter 4 Network Layer Read the paper (IP Addressing) US/501302.pdf#search=%22understanding%20ip%20a."

Similar presentations


Ads by Google