Chapter 4 Network Layer Read the paper (IP Addressing)  http://www.3com.com/other/pdfs/infra/corpinfo/en_US/501302.pdf#sea...
Chapter 4: Network Layer <ul><li>Chapter goals:   </li></ul><ul><li>understand principles behind network layer services: <...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
Network layer:  Network layer functions <ul><li>Application-layer protocols </li></ul><ul><li>define when and how </li></u...
The Network Layer: Network layer functions (Packet switching) <ul><li>The network-layer provides four important functions:...
Interplay between  routing  and  forwarding Routing = ?  Forwarding = ? Act of updating routing table usually via talking ...
Connection setup <ul><li>Connection-oriented  network architectures: </li></ul><ul><ul><li>ATM, frame relay, X.25 </li></u...
Network service model <ul><li>What  service model  should be provided for transporting packets from sender to  receiver? I...
Network layer service models: Network Architecture Internet (IP) ATM ATM ATM ATM Service Model best effort CBR VBR ABR UBR...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
Connection-Oriented or Connectionless ? <ul><li>Datagram(DG)  network provides network-layer connectionless service--IP </...
Connection-oriented: Virtual Circuits <ul><li>call setup for each call  before  data can flow, and teardown when done </li...
VC implementation <ul><li>a VC consists of: </li></ul><ul><ul><li>path from source to destination </li></ul></ul><ul><ul><...
ATM cell format: Virtual Circuit identifier GFC--Generic flow control (000=uncontrolled access).  VPI--Virtual path identi...
Forwarding table Forwarding table in northwest router: Routers maintain connection state information for each  Virtual cir...
Virtual circuits: signaling protocols <ul><li>used to setup, maintain,  teardown VC using control packets </li></ul><ul><l...
Example ATM Backbone on Internet
Datagram networks--connectionless <ul><li>no call setup at network layer </li></ul><ul><li>routers: no state about hop-to-...
Forwarding table Destination Address Range   Link Interface 11001000 00010111 00010 000 00000000 through  0  11001000 0001...
Longest prefix matching: the idea used in Internet (glimpse of how routing works) Prefix Match   Link Interface 11001000 0...
Datagram or VC network: why? <ul><li>Internet (datagram) </li></ul><ul><li>data exchange among computers </li></ul><ul><ul...
Connection-oriented(VC)   vs   Conncectionless(DG) <ul><li>  </li></ul><ul><li>ISSUES                Connection-oriented  ...
ISSUES       Connection-oriented    Connectionless -----------------------------------------------------------------------...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
Router Architecture Overview <ul><li>Two key router functions:   </li></ul><ul><li>run  routing  algorithms/protocol (RIP,...
Input Port Functions:  Centralized switching <ul><li>Centralized switching :   </li></ul><ul><li>Input port forward to Rou...
Input Port Functions:  Decentralized switching <ul><li>Decentralized switching :   </li></ul><ul><li>given datagram’s dest...
Three types of switching fabrics 1: 2: 3:
Switching Via Memory <ul><li>First generation routers: </li></ul><ul><li>earlier routers (often just a computer) with swit...
Switching Via a Bus <ul><li>datagram from input port memory </li></ul><ul><li>to output port memory via a shared bus—one p...
Switching Via An Interconnection Network <ul><li>overcome  bus bandwidth limitations </li></ul><ul><li>Banyan networks &  ...
Cisco 12000 Crossbar switch
Output Ports <ul><li>Buffering  required when datagrams arrive from switching fabric faster than the transmission rate </l...
Output port queueing <ul><li>buffering when arrival rate via switch exceeds output line speed </li></ul><ul><li>queueing (...
Input Port Queuing <ul><li>Fabric slower than input ports combined -> queueing may occur at input queues  </li></ul><ul><l...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
TCP/IP Protocol Suite Defined in TCP/IP Protocol Suite Undefined
IP
The IP (Internet Protocol)  RFC 791   <ul><li>Network layer functions of hosts & routers : </li></ul>Transport layer: TCP,...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
IP datagram format:  RFC 791 ver length 32 bits data  (variable length, typically a TCP  or UDP segment) 16-bit identifier...
Table from  IANA : Assigned Numbers The Protocol numbers are Service Access Points on IP layer
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 ...
MTU (Maximum Transmission Unit) <ul><li>network links have MTU (Maximum Transmission Unit) - largest possible link-level f...
MTU (Maximum Transmission Unit) At least 576 Internet Path MTU 2272 802.11 48 ATM 1,492 PPPoE 576 Dial-up, X.25 1,500 Ethe...
IP Fragmentation & Reassembly <ul><li>large IP datagram divided (“fragmented”) within net </li></ul><ul><ul><li>By a route...
Fragmentation example: C:Documents and SettingsAdministrator> ping www.google.com -f -l 1400 Pinging www.l.google.com [66....
ver length 32 bits data  (variable length, typically a TCP  or UDP segment) 16-bit identifier header checksum time to live...
IP Fragmentation and Reassembly <ul><li>Example </li></ul><ul><li>4000 byte datagram </li></ul><ul><li>MTU = 1500 bytes </...
Internal modules of IP Layer:  for routers & hosts Header-composing  module Reassembly  module Routing module Processing  ...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
IP packet format—IPv4
IP packet format—IPv4—from  RFC791
IP Addressing: introduction <ul><li>IP address:  32-bit identifier for host, router  interface   </li></ul><ul><li>interfa...
IP Addressing Classful Addressing <ul><li>CIDR </li></ul><ul><li>VLSM </li></ul><ul><li>NAT </li></ul>1992 <ul><li>Ineffic...
IP Addressing: Classful or Classless <ul><li>Older IP addressing (and routing) called “Classful IP addressing” which fixes...
IP Addressing: Classful Addressing 7 16 14 24 21 8 Byte 1 Byte 2 Byte 3 Byte 4 Class A Class B Class C Class D Class E 0 1...
IP Addressing: Dotted Decimal Notation <ul><li>32 bit IP addresses are often represented in the human-friendly 4 groups of...
Private IP addresses <ul><li>The Internet Assigned Numbers Authority ( IANA ) under  ICANN  has reserved the following thr...
Address ranges NA NA 255.255.255.255 240.0.0.0 E NA NA 239.255.255.255 224.0.0.0 D /24 255.255.255.0 223.255.255.255 192.0...
Special Addresses <ul><li>Some parts of classes A, B, C are used for special addresses: </li></ul>------------------------...
The Needs for subnetting <ul><li>Given a chunk of addresses (e.g. a class B), an organization usually need to sub-divide t...
Without Subnetting? <ul><li>Analogous to: One person in mailroom delivering all mails of the organization </li></ul><ul><l...
Without Subnetting? To Internet This router should be very fast, should have a large number of ports. Also long cables nee...
Subnets <ul><li>IP address divided:   </li></ul><ul><ul><li>subnetid  part (high order bits) </li></ul></ul><ul><ul><li>ho...
Subnets <ul><li>Recipe </li></ul><ul><li>To determine the subnets, detach each interface from its host or router, creating...
Subnets <ul><li>Decisions to make: </li></ul><ul><li>How many subnets? </li></ul><ul><li>How big each subnet? </li></ul><u...
Subnetting <ul><li>After acquiring a block of network addresses, e.g. a Class B address, divide it according to needs </li...
Subnetting: Classful--example <ul><li>Given class B address of 132.241.0.0, we need to divide the networks into 255 equal-...
Subnetting: Classful--example 132  .  241  .  0  .  0 Fixed Can be subnetted .  .  . Where should we put the divider? # of...
Subnetting: Classful--example 132  .  241  .  0  .  0 Fixed Can be subnetted .  .  . Where should we put the divider? # of...
Subnetting: Classful Then the  subnet mask  should be 255 255 0 224 0 0 241 132 netid subnetid hostid <ul><li>To be precis...
Example for classful subnetting <ul><li>Given a class B address of  132.241.0.0/16 </li></ul><ul><li>Let’s say we decided ...
Example for classful subnetting, cont’d <ul><li>Restrictions: legacy routers following  rfc 950 , do not recognize all zer...
Example for classful subnetting, cont’d Let’s write down all the subnet addresses and host addresses 132.241.255.1 --  132...
Another example for classful subnetting: Let’s subnet a subnet—  Mini Lab <ul><li>A class B subnet 132.241.0.0 was divided...
Subnetting of 132.241.158.0 subnet Then the  subnet mask  should be ??? 0 158 241 132 255 255 255 ? . . . ? Choosing subne...
Problems with Classful addressing & subnetting <ul><li>Only 3 classes useable (A, B, C) </li></ul><ul><li>Only 3 sizes to ...
IP adddress assignment From:  http://bgp.potaroo.net/ipv4-stats/allocated-all.html
Routing table size of Internet backbone routers
Solutions for IPv4 address depletion <ul><li>Short term (interim) solutions: </li></ul><ul><ul><li>CIDR(Classless InterDom...
IP Addressing Classful Addressing <ul><li>CIDR </li></ul><ul><li>VLSM </li></ul><ul><li>NAT </li></ul>1992 <ul><li>Ineffic...
CIDR: Motivation <ul><li>Observation: Many organizations need larger address than one class C(254), but less than 1000 (<<...
IP addressing: CIDR <ul><li>CIDR:   C lassless  I nter D omain  R outing </li></ul><ul><ul><li>Around 1993, CIDR replaced ...
Commonly used CIDR prefixes 4096  /12  2048  /13  1024  /14  512  /15  256 = 1 class B  /16  128  /17  64  /18  32  /19  1...
IP addressing: CIDR <ul><li>CIDR is also called as “supernetting” since we aggregate classful addresses—mostly class B and...
IP addresses: how to get one? <ul><li>Q:  How does a  host  get IP address? </li></ul><ul><li>Static addressing:  hand-cod...
IP addresses: how to get one? Using CIDR <ul><li>Q:  How does a  network  get subnet part of IP addr? </li></ul><ul><li>A:...
Hierarchical addressing: route aggregation: using CIDR “ Send me anything with addresses  beginning  200.23.16.0/20” Fly-B...
route aggregation using CIDR: Reduces size of routing tables for Internet Backbone routers Growth of BGP table 1994 to pre...
Hierarchical addressing: more specific routes ISPs-R-Us has a more specific route to Organization 1: This may happen when ...
IP addressing: the last word... <ul><li>Q:  How does an ISP get a block of addresses? </li></ul><ul><li>A:   From   ICANN ...
Solutions to IP address depletion <ul><li>Short term (interim) solutions: </li></ul><ul><ul><li>CIDR </li></ul></ul><ul><u...
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...
NAT: Network Address Translation <ul><li>Motivation:  local network uses just one IP address as far as outside world is co...
NAT: Network Address Translation <ul><li>Implementation:  NAT router must: </li></ul><ul><ul><li>outgoing datagrams:   rep...
NAT: Network Address Translation 10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4 138.76.29.7 NAT translation table WAN side addr  LAN ...
NAT: Network Address Translation <ul><li>16-bit port-number field:  </li></ul><ul><ul><li>60,000 simultaneous connections ...
NAT: Another form <ul><li>The NAT described so far is also called as NAPT (Network Address Port Translation) </li></ul><ul...
NAT: Another form 10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4 138.76.29.7 NAT translation table WAN side addr  LAN side addr 138.7...
Solutions to IP address depletion <ul><li>Short term (interim) solutions: </li></ul><ul><ul><li>CIDR </li></ul></ul><ul><u...
VLSM(Variable Length Subnet Mask) :  rfc 1817 <ul><li>Classful subnetting divides a network into equal sizes at a given le...
VLSM: an example <ul><li>Uses all 0’s & all 1’s subnets to fully utilze address space </li></ul><ul><li>A company is assig...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
ICMP: Internet Control Message Protocol <ul><li>used by hosts & routers to communicate  network-level control  information...
ICMP ICMP uses the service of IP to send a control message
Traceroute and ICMP: an example usage of ICMP <ul><li>Source sends series of  UDP segments   (in Unix)   to dest </li></ul...
C:Documents and SettingsAdministrator> tracert www.csuchico.edu Tracing route to calypso.csuchico.edu [132.241.82.62] over...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
IPv6 (previously known as IPng (IP next generation)) RFC 2460 <ul><li>Initial motivation:   32-bit address space soon to b...
IPv6 Header (Cont) Priority:   identify priority among datagrams in flow Flow Label:  identify datagrams in same “flow.”  ...
Other Changes from IPv4 <ul><li>Checksum :   removed entirely to reduce processing time at each hop </li></ul><ul><li>Opti...
Differences Between IPv4 and IPv6   PTR records in IP6.INT domain  PTR records in IN-ADDR.ARPA domain  DNS record type and...
Transition From IPv4 To IPv6 <ul><li>Not all routers can be upgraded simultaneous </li></ul><ul><ul><li>no “flag days” fea...
Tunneling A B E F IPv6 IPv6 IPv6 IPv6 tunnel Logical view: Physical view: A B E F IPv6 IPv6 IPv6 IPv6 IPv4 IPv4
Tunneling IPv6 IPv6 IPv6 IPv6 tunnel Logical view: Physical view: IPv6 IPv6 IPv6 IPv6 IPv4 IPv4 A-to-B: IPv6 E-to-F: IPv6 ...
Tunneling: another view From  http://www.cisco.com/univercd/cc/td/doc/product/software/ios123/123cgcr/ipv6_c/sa_tunv6.htm
IPv6 Deployment? To see the current deployment, visit  http://bgp.potaroo.net/index-v6.html   Not likely to happen in the ...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
Interplay between  routing, forwarding Difference? 1 2 3 0111 value in arriving packet’s header routing algorithm local fo...
Graph abstraction—routing can be analyzed as a graph problem Graph: G = (N,E) N = set of routers = { u, v, w, x, y, z } E ...
Graph abstraction: costs <ul><li>c(x,x’) = cost of link (x,x’) </li></ul><ul><li>- e.g., c(w,z) = 5 </li></ul><ul><li>cost...
Routing algorithm design <ul><li>Assuming that we can decide the cost of the links </li></ul><ul><li>How would routers lea...
Routing Algorithm classification <ul><li>Global or decentralized information? </li></ul><ul><li>Global: </li></ul><ul><li>...
IGP(Intra AS) vs EGP(Inter AS) A group of networks and routers under the authority of a single administration  AS: Autonom...
AS numbers from   http://bgp.potaroo.net/cidr/autnums.html   AS3895  AMEDD-EUR - DoD Network Information Center  AS3896  A...
Popular Routing Algorithms Distance vector Link state Path vector
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
Routing Algorithms <ul><li>Interior Routing (within one  AS ) vs  Exterior Routing  (between AS's) </li></ul><ul><li>Curre...
A Link-State Routing Algorithm <ul><li>Dijkstra’s algorithm </li></ul><ul><li>net topology, link costs known to all nodes ...
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) ...
Dijkstra’s algorithm: example Step 0 1 2 3 4 5 N ' u ux uxy uxyv uxyvw uxyvwz D(v),p(v) 2,u 2,u 2,u D(w),p(w) 5,u 4,x 3,y ...
Dijkstra’s algorithm: example (2)  Resulting shortest-path tree from u: Resulting forwarding table in u: u y x w v z v x y...
Dijkstra’s algorithm, discussion <ul><li>Algorithm complexity:  n nodes </li></ul><ul><li>each iteration: need to check al...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
Link State <ul><li>Link State Routing--Example:  OSPF (Open Shortest Path First)      http:// www.cisco.com/univercd/cc/td...
OSPF Autonomous System: A group of networks and routers under the authority of a single administration
-Autonomous System(A group of networks and routers under the authority of a single administration) is divided into  Areas(...
-One of the areas into which all areas have a connection is called Backbone(all OSPF networks must contain at least   one ...
OSPF Cost--from  http://www.cisco.com/warp/public/104/2.html#1.0   &quot;The cost (also called metric) of an interface in ...
OSPF Cost calculation
Distance vector Link state Path vector
Distance Vector: RIP RIP(Rourting Information Protocol) - An IGP(Interior Gateway Protocol) developed by XEROX(XNS-Xerox N...
Operation - Each router  initializes  with a distance vector table containing zero(0) for itself, one(1) for directly atta...
RIP routing table
RIP Updating Algorithm Receive: A RIP message from a neighbor 1. Add one hop to the hop count for each advertised destinat...
Distance Vector Algorithm  <ul><li>Bellman-Ford Equation (dynamic programming) </li></ul><ul><li>Define </li></ul><ul><li>...
Bellman-Ford example  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...
Distance Vector Algorithm  <ul><li>D x (y)  = estimate of least cost from x to y </li></ul><ul><li>Node x knows cost to ea...
Distance vector algorithm (4) <ul><li>Basic idea:   </li></ul><ul><li>Each node periodically sends its own distance vector...
Distance Vector Algorithm (5) <ul><li>Iterative, asynchronous:  each local iteration caused by:  </li></ul><ul><li>local l...
from 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 ∞ ∞ ∞ 7 1 0 cost to ∞ 2  0  1 ∞ ∞  ∞ ...
from 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 ...
<ul><li>Advantages of RIP -----Simplicity=low overhead </li></ul><ul><li>Disadvantages of RIP: </li></ul><ul><li>The limit...
Distance Vector: link cost changes <ul><li>To solve the Slow Convergence problem, whe link cost changes notify neighbors A...
Instability problem for RIP(Also called as &quot;count to infinity problem&quot;)   Net1 goes down When B sends its table,...
Comparison of LS and DV algorithms <ul><li>Message complexity </li></ul><ul><li>LS:  with n nodes, E links, O(nE) msgs sen...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
Hierarchical Routing <ul><li>scale:  with 200 million destinations: </li></ul><ul><li>can’t store all dest’s in routing ta...
Hierarchical Routing <ul><li>aggregate routers into regions,  “autonomous systems” (AS) </li></ul><ul><li>routers in same ...
Interconnected ASes <ul><li>Forwarding table is configured by both intra- and inter-AS routing algorithm </li></ul><ul><ul...
AS numbers from  http://bgp.potaroo.net/cidr/autnums.html   AS3895  AMEDD-EUR - DoD Network Information Center  AS3896  AM...
Inter-AS tasks <ul><li>Suppose a router in AS1 receives datagram for which dest is outside of AS1 </li></ul><ul><ul><li>Ro...
Example: Setting forwarding table in router 1d <ul><li>Suppose AS1 learns (via inter-AS protocol) that subnet  x  is reach...
Example: Choosing among multiple ASes <ul><li>Now suppose AS1 learns from the inter-AS protocol that subnet  x  is reachab...
Example: Choosing among multiple ASes <ul><li>Now suppose AS1 learns from the inter-AS protocol that subnet  x  is reachab...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
Intra-AS Routing <ul><li>Also known as  Interior Gateway Protocols (IGP) </li></ul><ul><li>Most common Intra-AS routing pr...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
RIP ( Routing Information Protocol) <ul><li>Distance vector algorithm </li></ul><ul><li>Included in BSD-UNIX Distribution ...
RIP advertisements <ul><li>Distance vectors: exchanged among neighbors every 30 sec via Response Message (also called  adv...
RIP: Example   Destination Network   Next  Router  Num. of hops to dest. w A 2 y B 2 z B 7 x -- 1 … . …. .... w x y z A C ...
RIP: Example   Destination Network   Next  Router  Num. of hops to dest. w A 2 y B 2 z B A 7 5 x -- 1 … . …. .... Routing ...
RIP: Link Failure and Recovery   <ul><li>If no advertisement heard after 180 sec --> neighbor/link declared dead </li></ul...
RIP Table processing <ul><li>RIP routing tables managed by  application-level  process called route-d (daemon) </li></ul><...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
OSPF (Open Shortest Path First) <ul><li>“ open”: publicly available </li></ul><ul><li>Uses Link State algorithm  </li></ul...
OSPF “advanced” features (not in RIP) <ul><li>Security:  all OSPF messages authenticated (to prevent malicious intrusion) ...
Hierarchical OSPF
Hierarchical OSPF <ul><li>Two-level hierarchy:  local area, backbone. </li></ul><ul><ul><li>Link-state advertisements only...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
Internet inter-AS routing: BGP <ul><li>BGP (Border Gateway Protocol):  the  de facto  (Latin: “In practice) standard </li>...
BGP basics <ul><li>Pairs of routers (BGP peers) exchange routing info over semi-permanent TCP connections:  BGP sessions <...
Distributing reachability info <ul><li>With eBGP session between 3a and 1c, AS3 sends prefix reachability info to AS1. </l...
Path attributes & BGP routes <ul><li>When advertising a prefix, includes BGP attributes.  </li></ul><ul><ul><li>prefix + a...
BGP route selection <ul><li>Router may learn about more than 1 route to some prefix. Router must select route. </li></ul><...
BGP messages <ul><li>BGP messages exchanged using TCP. </li></ul><ul><li>BGP messages: </li></ul><ul><ul><li>OPEN:  opens ...
BGP routing policy <ul><li>A,B,C are  provider networks </li></ul><ul><li>X,W,Y are customer (of provider networks) </li><...
BGP routing policy (2) <ul><li>A advertises to B the path AW  </li></ul><ul><li>B advertises to X the path BAW  </li></ul>...
Why different Intra- and Inter-AS routing ?   <ul><li>Policy:   </li></ul><ul><li>Inter-AS: admin wants control over how i...
Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><...
Broadcast Routing <ul><li>Deliver packets from source to all other nodes </li></ul><ul><li>Source duplication is inefficie...
In-network duplication <ul><li>Flooding: when node receives brdcst pckt, sends copy to all neighbors </li></ul><ul><ul><li...
Spanning Tree <ul><li>First construct a spanning tree </li></ul><ul><li>Nodes forward copies only along spanning tree </li...
Spanning Tree: Creation—one of many algorithms <ul><li>Center node is  predefined—node E in this example </li></ul><ul><li...
Modes of message transfer anycast   broadcast   multicast   unicast   Added in IPv6
Multicasting on Internet <ul><li>IP Multicast   </li></ul><ul><li>Internet Relay Chat   </li></ul><ul><li>NNTP   Network N...
Two main problems in multicasting <ul><li>How to identify group members? </li></ul><ul><li>What address should be used? </...
mcast
Multicast Routing: sending to a Group <ul><li>Goal:  find a tree (or trees) connecting routers having local mcast group me...
Approaches for building mcast trees <ul><li>Approaches: </li></ul><ul><li>source-based tree:  one tree per source—same as ...
3rd Edition: Chapter 4
3rd Edition: Chapter 4
3rd Edition: Chapter 4
3rd Edition: Chapter 4
3rd Edition: Chapter 4
3rd Edition: Chapter 4
3rd Edition: Chapter 4
3rd Edition: Chapter 4
3rd Edition: Chapter 4
3rd Edition: Chapter 4
3rd Edition: Chapter 4
3rd Edition: Chapter 4
3rd Edition: Chapter 4
3rd Edition: Chapter 4
3rd Edition: Chapter 4
3rd Edition: Chapter 4
Upcoming SlideShare
Loading in...5
×

3rd Edition: Chapter 4

1,846

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,846
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
120
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Notes: 3.3 Network Layer: Multicast Routing Algorithms 3-9
  • Notes: 3.3 Network Layer: Multicast Routing Algorithms 3-11
  • Notes: 3.3 Network Layer: Multicast Routing Algorithms 3-12
  • Notes: 3.3 Network Layer: Multicast Routing Algorithms 3-13
  • Notes: 3.3 Network Layer: Multicast Routing Algorithms 3-14
  • Notes: 3.3 Network Layer: Multicast Routing Algorithms 3-15
  • Notes: 1. See L. Wei and D. Estrin, “A Comparison of multicast trees and algorithms,” TR USC-CD-93-560, Dept. Computer Science, University of California, Sept 1993 for a comparison of heuristic approaches. 3.3 Network Layer: Multicast Routing Algorithms 3-16
  • Notes: 1. It’s always nice to see a PhD dissertation with impact. The earliest discussion of center-based trees for multicast appears to be D. Wall, “Mechanisms for Broadcast and Selective Broadcast,” PhD dissertation, Stanford U., June 1980. 3.3 Network Layer: Multicast Routing Algorithms 3-17
  • Notes: 3.3 Network Layer: Multicast Routing Algorithms 3-18
  • Notes: D. Waitzman, S. Deering, C. Partridge, “Distance Vector Multicast Routing Protocol,” RFC 1075, Nov. 1988. The version of DVMRP in use today is considerably enhanced over the RFC1075 spec. A more up-to-date “work-in-progress” defines a version 3 of DVMRP: T. Pusateri, “Distance Vector Multicast Routing Protocol,” work-in-progress, draft-ietf-idmr-v3-05.ps 3.4 Network Layer: Internet Multicast Routing Algorithms 3-20
  • Notes: 1. See www.mbone.com/mbone/routers.html for a (slightly outdatet) list of multicast capable routers (supporting DVMPR as well as other protocols) from various vendors. 2. ftp://parcftp.xerox.com/pub/net-research/ipmulti for circa 1996 public copy “mrouted” v3.8 of DVMRP routing software for various workstation routing platforms. 3.4 Network Layer: Internet Multicast Routing Algorithms 3-21
  • Notes: For a general discussion of IP encapsulation, see C. Perkins, “IP Encapsulation within IP,” RFC 2003, Oct. 1996. The book S. Bradner, A Mankin, “Ipng: Internet protocol next generation,” Addison Wesley, 1995 has a very nice discussion of tunneling Tunneling can also be used to connect islands of IPv6 capable routers in a sea IPv4 capable routers. The long term hope is that the sea evaporates leaving only lands of IPv6! 3.4 Network Layer: Internet Multicast Routing Algorithms 3-22
  • Notes: a very readable discussion of the PIM architecture is S. Deering, D. Estrin, D. Faranacci, V. Jacobson, C. Liu, L. Wei, “The PIM Architecture for Wide Area Multicasting,” IEEE/ACM Transactions on Networking, Vol. 4, No. 2, April 1996. D. Estrin et al, PIM-SM: Protocol Specification, RFC 2117, June 1997 S. Deering et al, PIM Version 2, Dense Mode Specification, work in progress, draft-ietf-idmr-pim-dm-05.txt PIM is implemented in Cisco routers and has been deployed in UUnet as part of their streaming multimedia delivery effort. See S. LaPolla, “IP Multicast makes headway among ISPs,” PC Week On-Line, http://www.zdnet.com/pcweek/news/1006/06isp.html 3.4 Network Layer: Internet Multicast Routing Algorithms 3-25
  • Notes: 3.4 Network Layer: Internet Multicast Routing Algorithms 3-26
  • Notes: 3.4 Network Layer: Internet Multicast Routing Algorithms 3-27
  • Notes: 3.4 Network Layer: Internet Multicast Routing Algorithms 3-28
  • Notes: 3.4 Network Layer: Internet Multicast Routing Algorithms 3-29
  • 3rd Edition: Chapter 4

    1. 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%20addressing%20everything%22 A excellent source for IP addressing and subnetting & routing Also read Chapter 3 of http://www.redbooks.ibm.com/redbooks/pdfs/gg243376.pdf Computer Networking: A Top Down Approach , 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.
    2. 2. Chapter 4: Network Layer <ul><li>Chapter goals: </li></ul><ul><li>understand principles behind network layer services: </li></ul><ul><ul><li>network layer service models </li></ul></ul><ul><ul><li>forwarding versus routing </li></ul></ul><ul><ul><li>how a router works </li></ul></ul><ul><ul><li>routing (path selection) </li></ul></ul><ul><ul><li>dealing with scale </li></ul></ul><ul><ul><li>advanced topics: IPv6, mobility </li></ul></ul><ul><li>instantiation, implementation in the Internet </li></ul>
    3. 3. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    4. 4. Network layer: Network layer functions <ul><li>Application-layer protocols </li></ul><ul><li>define when and how </li></ul><ul><li>messages are sent </li></ul><ul><li>Transport-layer protocols </li></ul><ul><li>deliver data between processes on different end-systems </li></ul><ul><ul><li>Transport protocols execute only on end systems </li></ul></ul><ul><li>Network-layer protocols </li></ul><ul><li>deliver data from one end-system to another </li></ul><ul><ul><li>Hop-to-hop rather than end-to-end </li></ul></ul><ul><ul><li>Network layer protocols execute on every end-systems and routers </li></ul></ul>Virtual end-to-end transport 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
    5. 5. The Network Layer: Network layer functions (Packet switching) <ul><li>The network-layer provides four important functions: </li></ul><ul><li>Addressing : the means by which end systems identify each other </li></ul><ul><li>Path determination (routing) : the route taken by packets from source to destination </li></ul><ul><li>Switching (forwarding) : the movement of packets from an input interface to an appropriate output interface </li></ul><ul><li>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 </li></ul>
    6. 6. Interplay between routing and forwarding 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 1 2 3 0111 value in arriving packet’s header routing algorithm local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1 Routing algorithm updates the forwarding table
    7. 7. Connection setup <ul><li>Connection-oriented network architectures: </li></ul><ul><ul><li>ATM, frame relay, X.25 </li></ul></ul><ul><li>before datagrams flow, two end hosts and intervening routers establish virtual connection </li></ul><ul><ul><li>routers get involved in setting up the connection </li></ul></ul><ul><li>network vs transport layer connection service: </li></ul><ul><ul><li>network: between two hosts (may also involve intervening routers in case of VCs) </li></ul></ul><ul><ul><li>transport: between two processes </li></ul></ul>
    8. 8. Network service model <ul><li>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? </li></ul><ul><li>Some possible elements of a service model: </li></ul><ul><ul><li>Guaranteed bandwidth </li></ul></ul><ul><ul><li>Guaranteed delay </li></ul></ul><ul><ul><li>Preservation of inter-packet timing (guaranteed maximum jitter)—end-to-end—geared toward time-sensitive traffic </li></ul></ul><ul><ul><li>Loss-free delivery </li></ul></ul><ul><ul><li>In-order delivery </li></ul></ul><ul><ul><li>Congestion feedback to sender </li></ul></ul>Does IP protocol provide any of the above? NO !
    9. 9. Network layer service models: Network Architecture Internet (IP) ATM ATM ATM ATM Service Model best effort CBR VBR ABR UBR Bandwidth none constant rate guaranteed rate guaranteed minimum none Loss no yes yes no no Order no yes yes yes yes Timing no yes yes no 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. 10. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    11. 11. Connection-Oriented or Connectionless ? <ul><li>Datagram(DG) network provides network-layer connectionless service--IP </li></ul><ul><li>Virtual Circuit(VC) network provides network-layer connection-oriented service—Frame Relay, X.25 </li></ul><ul><li>analogous to the transport-layer services, but: </li></ul><ul><ul><li>service: should provide host-to-host—same with transport layer in this respect </li></ul></ul><ul><ul><li>no choice: network either provides or not—transport layer has choice between TCP or UDP </li></ul></ul><ul><ul><li>implementation: in network core </li></ul></ul>
    12. 12. Connection-oriented: Virtual Circuits <ul><li>call setup for each call before data can flow, and teardown when done </li></ul><ul><li>each packet carries VC identifier (not destination host address) </li></ul><ul><li>every router on source-dest path maintains “state” for each passing connection—connection management—flow control, windowing, etc. </li></ul><ul><li>link, router resources (bandwidth, buffers) may be allocated to VC (dedicated resources = predictable service)  QOS </li></ul><ul><li>“ source-to-dest path behaves much like telephone circuit” </li></ul><ul><ul><li>performance-wise </li></ul></ul><ul><ul><li>network actions along source-to-dest path </li></ul></ul>
    13. 13. VC implementation <ul><li>a VC consists of: </li></ul><ul><ul><li>path from source to destination </li></ul></ul><ul><ul><li>VC numbers, one number for each link along path—number changes hop-to-hop </li></ul></ul><ul><ul><li>entries in forwarding tables in routers along path—an entry fixed until VC teardown </li></ul></ul><ul><li>packet belonging to VC carries VC number (rather than full destination address) </li></ul><ul><li>VC number can be changed on each link. </li></ul><ul><ul><li>VC number changed according to the entry in forwarding table </li></ul></ul>
    14. 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 VCI VCI PTI(3 bits) CLP HEC 48 BYTES PAYLOAD VC identifier
    15. 15. Forwarding table Forwarding table in northwest router: Routers maintain connection state information for each Virtual circuit and also do windowing—large overhead! 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 … … … …
    16. 16. Virtual circuits: signaling protocols <ul><li>used to setup, maintain, teardown VC using control packets </li></ul><ul><li>used in ATM, frame-relay, X.25 </li></ul><ul><li>VC & signaling protocol are used only along parts of Internet </li></ul><ul><ul><li>Used primarily near the network core where a connection-oriented service (e.g. ATM) is used </li></ul></ul><ul><ul><li>The signaling protocols are not part of IP </li></ul></ul>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? application transport network data link physical application transport network data link physical
    17. 17. Example ATM Backbone on Internet
    18. 18. Datagram networks--connectionless <ul><li>no call setup at network layer </li></ul><ul><li>routers: no state about hop-to-hop or end-to-end connections </li></ul><ul><ul><li>no network-level concept of “connection” </li></ul></ul><ul><li>packets forwarded using destination host address </li></ul><ul><ul><li>Packets routed independently each other </li></ul></ul><ul><ul><li>packets between same source-dest pair may take different paths </li></ul></ul>1. Send data 2. Receive data Advantage: Much less overhead than VC Disadvantages? unreliable, no flow control, no error control application transport network data link physical application transport network data link physical
    19. 19. Forwarding table Destination Address Range Link Interface 11001000 00010111 00010 000 00000000 through 0 11001000 00010111 00010 111 11111111 11001000 00010111 00011000 00000000 through 1 11001000 00010111 00011000 11111111 11001000 00010111 00011 001 00000000 through 2 11001000 00010111 00011 111 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. 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? Which interface?
    21. 21. Datagram or VC network: why? <ul><li>Internet (datagram) </li></ul><ul><li>data exchange among computers </li></ul><ul><ul><li>“ elastic” service, no strict timing required </li></ul></ul><ul><li>“ smart” end systems (computers) </li></ul><ul><ul><li>can adapt, perform control, error recovery </li></ul></ul><ul><ul><li>simple inside network, complexity at “edge” </li></ul></ul><ul><li>many link types </li></ul><ul><ul><li>different characteristics </li></ul></ul><ul><ul><li>uniform service difficult </li></ul></ul><ul><li>ATM (VC) </li></ul><ul><li>evolved from telephony--BISDN </li></ul><ul><li>human conversation: </li></ul><ul><ul><li>strict timing, reliability requirements </li></ul></ul><ul><ul><li>need for guaranteed service </li></ul></ul><ul><li>“ dumb” end systems </li></ul><ul><ul><li>telephones </li></ul></ul><ul><ul><li>complexity inside network </li></ul></ul>
    22. 22. Connection-oriented(VC)   vs   Conncectionless(DG) <ul><li>  </li></ul><ul><li>ISSUES                Connection-oriented             Connectionless </li></ul><ul><li>------------------------------------------------------------------------------------------------------------------- </li></ul><ul><li>Initial setup Required                                  No </li></ul><ul><li>and termination </li></ul><ul><li>Routing Routing only done on Each packet routed </li></ul><ul><li>initial VC setup independently </li></ul><ul><li>Connection state Routers keep state info. Router do not hold state info. </li></ul><ul><li>for each connection </li></ul><ul><li>Need for Needed during initial setup  Full address needed </li></ul><ul><li>Full address Afterwards only VC# always </li></ul><ul><ul><ul><ul><ul><li>needed                                                                 </li></ul></ul></ul></ul></ul><ul><li>Packet                          Guaranteed                              Not guaranteed </li></ul><ul><li>Sequencing </li></ul><ul><li>                                                                                                           </li></ul><ul><li>Error recovery             Handles error conditions          Left to a higher layer </li></ul><ul><li>                             </li></ul>
    23. 23. ISSUES       Connection-oriented    Connectionless ------------------------------------------------------------------------------------------------------------- Congestion control Easy Difficult QOS Easy Difficult Flow Control         Handles          Not done Overhead             High                  Low Examples:           TCP                 UDP, IP, IPX, ISO-IP Connection-oriented(VC)   vs   Conncectionless(DG)—Cont’d
    24. 24. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    25. 25. Router Architecture Overview <ul><li>Two key router functions: </li></ul><ul><li>run routing algorithms/protocol (RIP, OSPF, BGP) </li></ul><ul><li>forwarding datagrams from incoming to outgoing link </li></ul>Explore this first
    26. 26. Input Port Functions: Centralized switching <ul><li>Centralized switching : </li></ul><ul><li>Input port forward to Routing processor </li></ul><ul><li>Routing processor perform forwarding table lookup </li></ul><ul><li>Forwards the packet to output port </li></ul><ul><li>This approach used for low end routers, workstations or servers acting as routers </li></ul>Physical layer: bit-level reception Data link layer: e.g., Ethernet see chapter 5 Routing processor Routing Table Output port
    27. 27. Input Port Functions: Decentralized switching <ul><li>Decentralized switching : </li></ul><ul><li>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 </li></ul><ul><li>goal: complete input port processing at ‘line speed’—needs parallel processors </li></ul><ul><li>queuing: if datagrams arrive faster than forwarding rate into switch fabric </li></ul>Physical layer: bit-level reception Data link layer: e.g., Ethernet see chapter 5
    28. 28. Three types of switching fabrics 1: 2: 3:
    29. 29. Switching Via Memory <ul><li>First generation routers: </li></ul><ul><li>earlier routers (often just a computer) with switching under direct control of CPU </li></ul><ul><li>packet copied to system’s memory </li></ul><ul><li>speed limited by memory bandwidth (2 system bus crossings per datagram) </li></ul><ul><li>many modern routers still use but in a shared memory multiprocessor mode—a processor for each input port </li></ul>Input Port Output Port Memory System Bus e.g. CISCO Catalyst 8500
    30. 30. Switching Via a Bus <ul><li>datagram from input port memory </li></ul><ul><li>to output port memory via a shared bus—one packet at a time to output port </li></ul><ul><li>bus contention: switching speed limited by bus bandwidth </li></ul><ul><li>1 Gbps bus, Cisco 1900: sufficient speed for access and enterprise routers (not fast enough for regional or backbone routers) </li></ul>
    31. 31. Switching Via An Interconnection Network <ul><li>overcome bus bandwidth limitations </li></ul><ul><li>Banyan networks & other interconnection nets initially developed to connect processors in multiprocessor </li></ul><ul><li>Advanced design: fragmenting datagram into fixed length cells, switch cells through the fabric and reassemble at receiving end </li></ul><ul><li>Fastest, most expensive </li></ul><ul><li>Cisco 12000 series: switches up to 1.28 tera bps through the interconnection network </li></ul>Horizontal bus—no contention Vertical bus—contention . . . . . . See this
    32. 32. Cisco 12000 Crossbar switch
    33. 33. Output Ports <ul><li>Buffering required when datagrams arrive from switching fabric faster than the transmission rate </li></ul><ul><li>Scheduling discipline chooses among queued datagrams for transmission—depends upon protocols; </li></ul><ul><li>If IP, then First-In-First-Out </li></ul><ul><li>If ATM, then depending on the QOS </li></ul><ul><li>Constant Bit Rate (CBR) </li></ul><ul><li>Variable Bit Rate (VBR) </li></ul><ul><li>Available Bit Rate (ABR) </li></ul><ul><li>Unspecified Bit Rate (UBR) </li></ul>
    34. 34. Output port queueing <ul><li>buffering when arrival rate via switch exceeds output line speed </li></ul><ul><li>queueing (delay) and loss due to output port buffer overflow!—Assuming Switch operates 3 times the speed of line speed </li></ul>
    35. 35. Input Port Queuing <ul><li>Fabric slower than input ports combined -> queueing may occur at input queues </li></ul><ul><li>Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward </li></ul><ul><li>queueing delay and loss due to input buffer overflow! </li></ul>
    36. 36. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    37. 37. TCP/IP Protocol Suite Defined in TCP/IP Protocol Suite Undefined
    38. 38. IP
    39. 39. The IP (Internet Protocol) RFC 791 <ul><li>Network layer functions of hosts & routers : </li></ul>Transport layer: TCP, UDP Link layer physical layer Network layer routing table <ul><li>Routing protocols </li></ul><ul><li>path selection </li></ul><ul><li>RIP, OSPF, BGP </li></ul><ul><li>IP protocol </li></ul><ul><li>addressing conventions </li></ul><ul><li>datagram format </li></ul><ul><li>packet handling conventions </li></ul><ul><li>ICMP protocol </li></ul><ul><li>error reporting </li></ul><ul><li>router “signaling” </li></ul>
    40. 40. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    41. 41. IP datagram format: RFC 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. <ul><li>how much overhead with TCP? </li></ul><ul><li>20 bytes of TCP </li></ul><ul><li>20 bytes of IP </li></ul><ul><li>= 40 bytes + app layer overhead </li></ul>4 4 8 16 13 8 8 16 For error checking
    42. 42. Table from IANA : Assigned Numbers The Protocol numbers are Service Access Points on IP layer
    43. 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. 44. MTU (Maximum Transmission Unit) <ul><li>network links have MTU (Maximum Transmission Unit) - largest possible link-level frame. </li></ul><ul><ul><li>different link types  different MTUs </li></ul></ul><ul><li>Given 1500 Byte MTU(Ethernet), what is MSS(Maximum Segment Size) for TCP? </li></ul><ul><ul><li>1500 – 20(TCP) -20(IP) = 1460 </li></ul></ul>Transport layer(TCP/UDP) has MSS—IP layer has MTU(determined by Link layer) headers IP datagram Maximum Transmission Unit Link layer header Link layer trailer 1500 bytes for Ethernet
    45. 45. MTU (Maximum Transmission Unit) At least 576 Internet Path MTU 2272 802.11 48 ATM 1,492 PPPoE 576 Dial-up, X.25 1,500 Ethernet 4,500 FDDI 17,914 Token ring(16Mbps) 65,535 Hyperchannel MTU (bytes) Link layer protocol
    46. 46. IP Fragmentation & Reassembly <ul><li>large IP datagram divided (“fragmented”) within net </li></ul><ul><ul><li>By a router </li></ul></ul><ul><ul><li>one datagram becomes several datagrams </li></ul></ul><ul><ul><li>“ reassembled” only at final destination host—why? </li></ul></ul><ul><ul><li>IP header bits used to identify, reorder related fragments </li></ul></ul>fragmentation: in: one large datagram out: 3 smaller datagrams reassembly
    47. 47. Fragmentation example: C:Documents and SettingsAdministrator> 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. Packet needs to be fragmented but DF set. Packet needs to be fragmented but DF set. 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. 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 Flags—3 bits R : Reserved—not used DF : Don’t Fragment MF : More Fragment Fragmentation MF DF R
    49. 49. IP Fragmentation and Reassembly <ul><li>Example </li></ul><ul><li>4000 byte datagram </li></ul><ul><li>MTU = 1500 bytes </li></ul>1480 bytes in data field + 20bytes of IP header offset = 1480/8 Fragments are counted in units of 8 octets(bytes). 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
    50. 50. Internal modules of IP Layer: for routers & hosts Header-composing module Reassembly module Routing module Processing module Fragmentation module 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 IP packet, next hop addr., interface IP packet IP packet IP From upper layer protocol Reassembly table Routing table
    51. 51. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    52. 52. IP packet format—IPv4
    53. 53. IP packet format—IPv4—from RFC791
    54. 54. IP Addressing: introduction <ul><li>IP address: 32-bit identifier for host, router interface </li></ul><ul><li>interface: connection between host/router and physical link </li></ul><ul><ul><li>router’s typically have multiple interfaces </li></ul></ul><ul><ul><li>host typically has one interface </li></ul></ul><ul><ul><li>IP addresses associated with each interface </li></ul></ul>223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.9 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1 223.1.1.2 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27
    55. 55. IP Addressing Classful Addressing <ul><li>CIDR </li></ul><ul><li>VLSM </li></ul><ul><li>NAT </li></ul>1992 <ul><li>Inefficient division into 5 classes— </li></ul><ul><li>A, B, C, D, E </li></ul><ul><li>Address space running out </li></ul>IPv6—128 bits IPv4—32bits Huge address space More streamlined for efficiency More Auto-configuration Accommodates QOS When? interim solutions
    56. 56. IP Addressing: Classful or Classless <ul><li>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) </li></ul><ul><li>Out of 5 classes, only 3 classes are assignable to computers as IP addresses—only 3 sizes to fit all organizations of the world? </li></ul><ul><li>More elastic (size-wise) scheme is called “CIDR(Classless Inter Domain Routing)”—IP address blocks can be any size using prefix subnet masks—later </li></ul><ul><li>Both used but Classless mostly used by ISP level or above </li></ul>
    57. 57. IP Addressing: Classful Addressing 7 16 14 24 21 8 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 1 1 Multicast address Reserved for future addressing modes netid netid netid hostid hostid hostid
    58. 58. IP Addressing: Dotted Decimal Notation <ul><li>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 ” </li></ul>132 241 158 35 . . . 0 0 1 0 0 0 0 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 0 0 1 1 2 4 8 16 32 64 128 1 2 4 8 16 32 64 128 1 2 4 8 16 32 64 128 1 2 4 8 16 32 64 128
    59. 59. Private IP addresses <ul><li>The Internet Assigned Numbers Authority ( IANA ) under ICANN has reserved the following three blocks of the IP address space for private networks: Read here </li></ul><ul><li>10.0.0.0 - 10.255.255.255 172.16.0.0 - 172.31.255.255 192.168.0.0 - 192.168.255.255 </li></ul><ul><li>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) . </li></ul><ul><li>Used for ad hoc or isolated networks </li></ul><ul><li>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 </li></ul>
    60. 60. Address ranges NA NA 255.255.255.255 240.0.0.0 E NA NA 239.255.255.255 224.0.0.0 D /24 255.255.255.0 223.255.255.255 192.0.0.0 C /16 255.255.0.0 191.255. 255.255 128.0.0.0 B /8 255.0.0.0 127. 255.255.255 1.0.0.0 A CIDR prefix notation Default Subnet Mask End Start Class
    61. 61. Special Addresses <ul><li>Some parts of classes A, B, C are used for special addresses: </li></ul>----------------------------------------------------------------------------------------------------------------- Special Addresses Netid Hostid Source or Destination ----------------------------------------------------------------------------------------------------------------- Network address Specific All 0s None (e.g. 132.241.0.0 is the network address for the CSU, Chico LAN) ----------------------------------------------------------------------------------------------------------------- Direct broadcast address Specific All 1s Destination (This is used by a router to send a packet to all hosts in a subnet, e.g. 132.241.255.255) ----------------------------------------------------------------------------------------------------------------- Limited broadcast address All 1s All 1s Destination (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 network All 0s All 0s Source (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 network All 0s Specific Destination (It is used by a host to send a message to another host on the same subnet-- Routers will not process this kind) ----------------------------------------------------------------------------------------------------------------- Loopback address 127 Any Destination (It is used to test the health of TCP/IP protocol on a host, e.g. ping 127.0.0.1)
    62. 62. The Needs for subnetting <ul><li>Given a chunk of addresses (e.g. a class B), an organization usually need to sub-divide the address space in a hierarchical fashion </li></ul><ul><li>Just as an organization is structured hierarchically, IP addresses are divided as needed </li></ul><ul><li>From http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/ip.htm </li></ul><ul><li>“ 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. “ </li></ul><ul><li>Also read http://www.support.psi.net/support/common/routers/files/SUBNET-Desc.html </li></ul>
    63. 63. Without Subnetting? <ul><li>Analogous to: One person in mailroom delivering all mails of the organization </li></ul><ul><li>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 </li></ul>
    64. 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. 65. Subnets <ul><li>IP address divided: </li></ul><ul><ul><li>subnetid part (high order bits) </li></ul></ul><ul><ul><li>hostid part (low order bits) </li></ul></ul><ul><li>What’s a subnet ? </li></ul><ul><ul><li>device interfaces with same subnet part of IP address </li></ul></ul><ul><ul><li>Hosts within a subnet can physically reach each other without intervening router </li></ul></ul>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. 66. Subnets <ul><li>Recipe </li></ul><ul><li>To determine the subnets, detach each interface from its host or router, creating islands of isolated networks. Each isolated network is called a subnet . </li></ul><ul><li>The host are usually connected to a hub or a switch </li></ul>Subnet mask: /24 223.1.1.0/24 223.1.2.0/24 223.1.3.0/24
    67. 67. Subnets <ul><li>Decisions to make: </li></ul><ul><li>How many subnets? </li></ul><ul><li>How big each subnet? </li></ul><ul><li>How many levels of subnetting? </li></ul><ul><li>All depends upon the organizational structure and requirements </li></ul>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.0 223.1.8.1 223.1.9.1 223.1.9.2
    68. 68. Subnetting <ul><li>After acquiring a block of network addresses, e.g. a Class B address, divide it according to needs </li></ul><ul><li>Let’s say, we need 6 large divisions first, then each division may be divided as needed </li></ul><ul><li>Each division must be equal sizes </li></ul>1 st division 2nd 3rd
    69. 69. Subnetting: Classful--example <ul><li>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) </li></ul><ul><li>With a class B address, we are given the last 16 bits to play with(divide) </li></ul>132 . 241 . 0 . 0 netid hostid Fixed Can be subnetted 0 0 1 0 0 0 0 1 1 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 4 8 16 32 64 128 1 2 4 8 16 32 64 128 1 2 4 8 16 32 64 128 1 2 4 8 16 32 64 128 132 241 0 0 . . .
    70. 70. Subnetting: Classful--example 132 . 241 . 0 . 0 Fixed Can be subnetted . . . Where should we put the divider? # of subnets? # of hosts in a subnet? <ul><li>The decision should be based upon: </li></ul><ul><ul><li># of subnets needed </li></ul></ul><ul><ul><li># of hosts on each subnets </li></ul></ul><ul><ul><li>Future needs </li></ul></ul><ul><ul><li>Routing protocol (RIPv1, RIPv2, or OSPF) </li></ul></ul>0 0 1 0 0 0 0 1 1 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 4 8 16 32 64 128 1 2 4 8 16 32 64 128 1 2 4 8 16 32 64 128 1 2 4 8 16 32 64 128
    71. 71. Subnetting: Classful--example 132 . 241 . 0 . 0 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 Then the subnet mask should be 255 255 ? 0 224 0 0 1 0 0 0 0 1 1 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 4 8 16 32 64 128 1 2 4 8 16 32 64 128 1 2 4 8 16 32 64 128 1 2 4 8 16 32 64 128 0 0 1 0 0 0 0 1 1 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1
    72. 72. Subnetting: Classful Then the subnet mask should be 255 255 0 224 0 0 241 132 netid subnetid hostid <ul><li>To be precise, we have netid , subnetid , hostid </li></ul><ul><li>But the ( netid + subnetid ) is often called as subnetid </li></ul><ul><li>Notation for subnet mask; 2 ways </li></ul><ul><li>Dotted decimal notation; e.g. 255.255.224.0 </li></ul><ul><li>Prefix notation; e.g. /19 –called slash notation also--19bits are subnet mask </li></ul>subnetid hostid subnet mask 0 0 1 0 0 0 0 1 1 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1
    73. 73. Example for classful subnetting <ul><li>Given a class B address of 132.241.0.0/16 </li></ul><ul><li>Let’s say we decided to divide using next 8 bits </li></ul>Then the subnet mask should be 0 0 241 132 subnetid hostid subnet mask 255 255 255 0 In prefix notation ? 132.241.0.0/24 0 0 1 0 0 0 0 1 1 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
    74. 74. Example for classful subnetting, cont’d <ul><li>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 space </li></ul><ul><li>In rfc 1878 , all zero’s and all one’s subnets are allowed by default </li></ul><ul><li>Can be turned off by no ip subnet-zero command for CISCO routers </li></ul><ul><li>Read http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080093f18.shtml </li></ul><ul><li>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.61 </li></ul>
    75. 75. Example for classful subnetting, cont’d Let’s write down all the subnet addresses and host addresses 132.241.255.1 -- 132.241.255.254 132.241.255.0/24 132.241.254.1 -- 132.241.254.254 132.241.254.0/24 . . . . . . 132.241.1.1 -- 132.241.1.254 132.241.1.0/24 132.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.0.0/24 Host addresses Subnet addresses
    76. 76. Another example for classful subnetting: Let’s subnet a subnet— Mini Lab <ul><li>A class B subnet 132.241.0.0 was divided using 8 bit(/24) division as previous example </li></ul><ul><li>Now, we are assigned one of the subnets; 132.241.158.0—we want to subnet this subnet </li></ul><ul><li>Requirements: We need at least 4 subnets and each subnet should accommodate at least 20 hosts </li></ul>
    77. 77. Subnetting of 132.241.158.0 subnet Then the subnet mask should be ??? 0 158 241 132 255 255 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 0 0 1 0 0 0 0 1 1 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ? ? ? ? ? ? ? ? 1 1 1 1 1 1 1 1
    78. 78. Problems with Classful addressing & subnetting <ul><li>Only 3 classes useable (A, B, C) </li></ul><ul><li>Only 3 sizes to satisfy all organizations </li></ul><ul><li>Address spaces are depleted—not much left—especially class B (most comfortable fit) </li></ul><ul><li>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 </li></ul><ul><li>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/ </li></ul>
    79. 79. IP adddress assignment From: http://bgp.potaroo.net/ipv4-stats/allocated-all.html
    80. 80. Routing table size of Internet backbone routers
    81. 81. Solutions for IPv4 address depletion <ul><li>Short term (interim) solutions: </li></ul><ul><ul><li>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 </li></ul></ul><ul><ul><li>NAT(Network Address Translation) —Small block of addresses can be timeshared by large number of connections </li></ul></ul><ul><ul><li>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) </li></ul></ul><ul><li>Long term solution: IPv6 (128 bit IP address) </li></ul>
    82. 82. IP Addressing Classful Addressing <ul><li>CIDR </li></ul><ul><li>VLSM </li></ul><ul><li>NAT </li></ul>1992 <ul><li>Inefficient division into 5 classes— </li></ul><ul><li>A, B, C, D, E </li></ul><ul><li>Address space running out </li></ul>IPv6—128 bits IPv4—32bits Huge address space More streamlined for efficiency More Auto-configuration Accommodates QOS When? interim solutions
    83. 83. CIDR: Motivation <ul><li>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) </li></ul><ul><li>Assigning multiple class C addresses as a block(aggregation) helps to reduce the effects of the explosion of Internet Backbone routers </li></ul><ul><li>Therefore, eliminate the restriction of classes! </li></ul><ul><li>RFC 1517 , 1518 , 1519 , 1817 </li></ul>
    84. 84. IP addressing: CIDR <ul><li>CIDR: C lassless I nter D omain R outing </li></ul><ul><ul><li>Around 1993, CIDR replaced Classful addressing </li></ul></ul><ul><ul><li>“ CIDR is principally a bitwise, prefix-based standard for the interpretation of IP addresses.”-- wikipedia </li></ul></ul><ul><ul><li>IP address space can have many different sizes—not only 3 sizes! </li></ul></ul><ul><ul><li>Uses address format: a.b.c.d/x , where x is # bits in subnet portion of address—prefix notation </li></ul></ul><ul><ul><li>Class has no meaning! </li></ul></ul>11001000 00010111 0001000 0 00000000 subnet part host part 200.23.16.0/23 subnet part host part 200.23.18.0/23 11001000 00010111 0001001 0 00000000 Is 200.23.17.0/23 possible?
    85. 85. Commonly used CIDR prefixes 4096 /12 2048 /13 1024 /14 512 /15 256 = 1 class B /16 128 /17 64 /18 32 /19 16 /20 8 /21 4 /22 2 /23 1 (class C) /24 1/2 /25 1/4 /26 1/8 /27 1/16 (of class C) /28 # of former class C nets CIDR Prefix
    86. 86. IP addressing: CIDR <ul><li>CIDR is also called as “supernetting” since we aggregate classful addresses—mostly class B and class C addresses </li></ul><ul><li>Example: </li></ul><ul><ul><li>Let’s say we have the following 4 class C addresses: </li></ul></ul><ul><ul><ul><li>200.168.4.0 11001000 10101000 00000100 00000000 </li></ul></ul></ul><ul><ul><ul><li>200.168.5.0 11001000 10101000 00000101 00000000 </li></ul></ul></ul><ul><ul><ul><li>200.168.6.0 11001000 10101000 00000110 00000000 </li></ul></ul></ul><ul><ul><ul><li>200.168.7.0 11001000 10101000 00000111 00000000 </li></ul></ul></ul><ul><ul><ul><li>With 255.255.255.0 as subnet mask = prefix ? </li></ul></ul></ul><ul><ul><li>Let’s compare with CIDR address of </li></ul></ul><ul><ul><ul><li>200.168.4.0/22 </li></ul></ul></ul><ul><ul><li>What is the difference? </li></ul></ul><ul><ul><li>List Class C address blocks given 200.168.8.0/21 </li></ul></ul>
    87. 87. IP addresses: how to get one? <ul><li>Q: How does a host get IP address? </li></ul><ul><li>Static addressing: hand-coded by system admin in a file </li></ul><ul><ul><li>Wintel: control-panel->network->configuration->tcp/ip->properties </li></ul></ul><ul><ul><li>UNIX: /etc/rc.config </li></ul></ul><ul><li>Dynamic addressing: DHCP: D ynamic H ost C onfiguration P rotocol: dynamically get address from as a DHCP server </li></ul><ul><ul><li>“plug-and-play” </li></ul></ul><ul><li>(more in next chapter) </li></ul>
    88. 88. IP addresses: how to get one? Using CIDR <ul><li>Q: How does a network get subnet part of IP addr? </li></ul><ul><li>A: gets allocated portion of its provider ISP’s address space </li></ul>ISP's block 11001000 00010111 0001 0000 00000000 200.23.16.0/20 Organization 0 11001000 00010111 0001000 0 00000000 200.23.16.0/23 Organization 1 11001000 00010111 0001001 0 00000000 200.23.18.0/23 Organization 2 11001000 00010111 0001010 0 00000000 200.23.20.0/23 ... ….. …. …. Organization 7 11001000 00010111 0001111 0 00000000 200.23.30.0/23
    89. 89. Hierarchical addressing: route aggregation: using CIDR “ Send me anything with addresses beginning 200.23.16.0/20” 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” Organization 2 Hierarchical addressing allows efficient advertisement of routing information: 200.23.16.0/23 200.23.18.0/23 200.23.30.0/23 200.23.20.0/23 . . . . . .
    90. 90. route aggregation using CIDR: Reduces size of routing tables for Internet Backbone routers Growth of BGP table 1994 to present
    91. 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” 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” Organization 2 199.31.0.0/16 200.23.16.0/23 200.23.18.0/23 200.23.30.0/23 200.23.20.0/23 . . . . . .
    92. 92. IP addressing: the last word... <ul><li>Q: How does an ISP get a block of addresses? </li></ul><ul><li>A: From ICANN : I nternet C orporation for A ssigned </li></ul><ul><li>N ames and N umbers </li></ul><ul><ul><li>allocates addresses </li></ul></ul><ul><ul><li>manages DNS </li></ul></ul><ul><ul><li>assigns domain names, resolves disputes </li></ul></ul>Also see http://www.pch.net/resources/data/WoN/itu-seminar-20040211-1.ppt#480,1,Internet Addressing and the RIR system
    93. 93. Solutions to IP address depletion <ul><li>Short term (interim) solutions: </li></ul><ul><ul><li>CIDR </li></ul></ul><ul><ul><li>NAT(Network Address Translation) </li></ul></ul><ul><ul><li>VLSM(Variable Length Subnet Mask) </li></ul></ul><ul><li>Long term solution: IPv6 (128 bits) </li></ul>
    94. 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. 95. NAT: Network Address Translation <ul><li>Motivation: local network uses just one IP address as far as outside world is concerned: </li></ul><ul><ul><li>range of addresses not needed from ISP: just one IP address for all devices </li></ul></ul><ul><ul><li>can change addresses of devices in local network without notifying outside world </li></ul></ul><ul><ul><li>can change ISP without changing addresses of devices in local network </li></ul></ul><ul><ul><li>devices inside local net not explicitly addressable/ visible by outside world (a security plus). </li></ul></ul><ul><ul><li>popularly used by home networks connections to Internet </li></ul></ul>
    96. 96. NAT: Network Address Translation <ul><li>Implementation: NAT router must: </li></ul><ul><ul><li>outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #) </li></ul></ul><ul><ul><ul><li>. . . remote clients/servers will respond using (NAT IP address, new port #) as destination addr. </li></ul></ul></ul><ul><ul><li>remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair </li></ul></ul><ul><ul><li>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 </li></ul></ul>
    97. 97. NAT: Network Address Translation 10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4 138.76.29.7 NAT translation table WAN side addr LAN side addr 138.76.29.7, 5001 10.0.0.1, 3345 …… …… 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 S: 10.0.0.1, 3345 D: 128.119.40.186, 80 1 1: host 10.0.0.1 sends datagram to 128.119.40.186, 80 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
    98. 98. NAT: Network Address Translation <ul><li>16-bit port-number field: </li></ul><ul><ul><li>60,000 simultaneous connections with a single LAN-side address! Plenty! </li></ul></ul><ul><li>NAT is controversial: </li></ul><ul><ul><li>routers should only process up to layer 3 </li></ul></ul><ul><ul><li>violates end-to-end argument </li></ul></ul><ul><ul><ul><li>NAT possibility must be taken into account by app designers, eg, P2P applications </li></ul></ul></ul><ul><ul><li>address shortage should instead be solved by IPv6 </li></ul></ul>
    99. 99. NAT: Another form <ul><li>The NAT described so far is also called as NAPT (Network Address Port Translation) </li></ul><ul><li>Another form is “Basic NAT” or “Static NAT”—involves only IP address translation--not ports </li></ul><ul><ul><li>Router is configured with a pool of IP addresses </li></ul></ul><ul><ul><li>When a computer having private IP address wants to connect to Internet, router assigns an IP address from the pool until disconnected </li></ul></ul><ul><ul><li>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 </li></ul></ul>
    100. 100. NAT: Another form 10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4 138.76.29.7 NAT translation table WAN side addr LAN side addr 138.76.29.7 10.0.0.1 …… …… 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 S: 10.0.0.1, 3345 D: 128.119.40.186, 80 1 1: host 10.0.0.1 sends datagram to 128.119.40.186, 80 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
    101. 101. Solutions to IP address depletion <ul><li>Short term (interim) solutions: </li></ul><ul><ul><li>CIDR </li></ul></ul><ul><ul><li>NAT(Network Address Translation) </li></ul></ul><ul><ul><li>VLSM(Variable Length Subnet Mask) </li></ul></ul><ul><li>Long term solution: IPv6 (128 bits) </li></ul>
    102. 102. VLSM(Variable Length Subnet Mask) : rfc 1817 <ul><li>Classful subnetting divides a network into equal sizes at a given level=“one size fits all” </li></ul><ul><li>With CIDR, the VLSM was introduced—we can divide a network into different sizes at a given level—more flexible & save addresses </li></ul>1 st division 2nd 3rd
    103. 103. VLSM: an example <ul><li>Uses all 0’s & all 1’s subnets to fully utilze address space </li></ul><ul><li>A company is assigned a class C address space and needs the following: </li></ul>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 PPP (for telecommuting) 2 hosts The rest For 2 branch offices & 2 server farms 10+ hosts 4 For 2 main offices 60+ hosts 2 purpose subnet size # of subnets
    104. 104. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    105. 105. ICMP: Internet Control Message Protocol <ul><li>used by hosts & routers to communicate network-level control information </li></ul><ul><ul><li>error reporting: unreachable host, network, port, protocol </li></ul></ul><ul><ul><li>echo request/reply (used by ping) </li></ul></ul><ul><li>network-layer but “above” IP: </li></ul><ul><ul><li>ICMP msgs carried in IP datagrams—”horizontal layering” </li></ul></ul><ul><li>ICMP message: type, code plus first 8 bytes of IP datagram causing error </li></ul>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. 106. ICMP ICMP uses the service of IP to send a control message
    107. 107. Traceroute and ICMP: an example usage of ICMP <ul><li>Source sends series of UDP segments (in Unix) to dest </li></ul><ul><ul><li>First has TTL =1 </li></ul></ul><ul><ul><li>Second has TTL=2, etc. </li></ul></ul><ul><ul><li>Unlikely port number(33434 and up) in unix implementations </li></ul></ul><ul><ul><li>Windows systems use ICMP Echo request not UDP </li></ul></ul><ul><li>When nth datagram arrives to nth router: </li></ul><ul><ul><li>Router discards datagram </li></ul></ul><ul><ul><li>And sends to source an ICMP message (type 11, code 0) </li></ul></ul><ul><ul><li>Message includes name of router & IP address </li></ul></ul><ul><li>When ICMP message arrives, source calculates RTT </li></ul><ul><li>Traceroute does this 3 times </li></ul><ul><li>Stopping criterion </li></ul><ul><li>UDP segment eventually arrives at destination host </li></ul><ul><li>Destination returns ICMP “host unreachable” packet (type 3, code 3) </li></ul><ul><li>When source gets this ICMP, stops. </li></ul>http://kb.pert.switch.ch/cgi-bin/twiki/view/PERTKB/VanJacobsonTraceroute
    108. 108. C:Documents and SettingsAdministrator> 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. 109. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    110. 110. IPv6 (previously known as IPng (IP next generation)) RFC 2460 <ul><li>Initial motivation: 32-bit address space soon to be completely allocated. </li></ul><ul><li>Additional motivation: </li></ul><ul><ul><li>header format helps speed processing/forwarding </li></ul></ul><ul><ul><li>header changes to facilitate QoS </li></ul></ul><ul><ul><li>IPv6 datagram format: </li></ul></ul><ul><ul><li>fixed-length 40 byte header </li></ul></ul><ul><ul><li>no fragmentation allowed </li></ul></ul>
    111. 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. 112. Other Changes from IPv4 <ul><li>Checksum : removed entirely to reduce processing time at each hop </li></ul><ul><li>Options: allowed, but outside of header, indicated by “Next Header” field </li></ul><ul><li>ICMPv6: new version of ICMP </li></ul><ul><ul><li>additional message types, e.g. “Packet Too Big” </li></ul></ul><ul><ul><li>multicast group management functions </li></ul></ul>
    113. 113. Differences Between IPv4 and IPv6 PTR records in IP6.INT domain PTR records in IN-ADDR.ARPA domain DNS record type and location for reverse name resolution AAAA record A record DNS record type for name resolution Automatic, DHCP, or manual DHCP or manual Host configuration No Yes Network layer broadcast addresses? Required Optional Router discovery support MLD IGMP Multicast group membership protocol ICMPv6 ICMP (for IPv4) Error reporting and diagnostic protocol Multicast Neighbor Solicitation messages Broadcast ARP frames Link-layer address resolution No Yes Does the header include options? No Yes Is a header checksum present? Done by hosts only Done by hosts and routers Fragmentation Better Limited QoS support Required Optional IPSec support 40 bytes—fixed size 20-60 bytes Header size 128 bits 32 bits Address length IPv6 IPv4 Category
    114. 114. Transition From IPv4 To IPv6 <ul><li>Not all routers can be upgraded simultaneous </li></ul><ul><ul><li>no “flag days” feasible </li></ul></ul><ul><ul><li>How will the network operate with mixed IPv4 and IPv6 routers? </li></ul></ul><ul><li>Two main approaches: </li></ul><ul><ul><li>Dual Stack: A host or router implements both IPv4 and IPv6. </li></ul></ul><ul><ul><li>Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers </li></ul></ul>
    115. 115. Tunneling A B E F IPv6 IPv6 IPv6 IPv6 tunnel Logical view: Physical view: A B E F IPv6 IPv6 IPv6 IPv6 IPv4 IPv4
    116. 116. Tunneling IPv6 IPv6 IPv6 IPv6 tunnel Logical view: Physical view: IPv6 IPv6 IPv6 IPv6 IPv4 IPv4 A-to-B: IPv6 E-to-F: IPv6 B-to-C: IPv6 inside IPv4 B-to-C: IPv6 inside IPv4 A B E F A B E F C D 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
    117. 117. Tunneling: another view From http://www.cisco.com/univercd/cc/td/doc/product/software/ios123/123cgcr/ipv6_c/sa_tunv6.htm
    118. 118. IPv6 Deployment? To see the current deployment, visit http://bgp.potaroo.net/index-v6.html Not likely to happen in the foreseeable future
    119. 119. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    120. 120. Interplay between routing, forwarding Difference? 1 2 3 0111 value in arriving packet’s header routing algorithm local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1
    121. 121. Graph abstraction—routing can be analyzed as a graph problem 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) } 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 u y x w v z 2 2 1 3 1 1 2 5 3 5
    122. 122. Graph abstraction: costs <ul><li>c(x,x’) = cost of link (x,x’) </li></ul><ul><li>- e.g., c(w,z) = 5 </li></ul><ul><li>cost could always be set to 1(all links has same cost—hop count), or </li></ul><ul><li>inversely related to bandwidth, </li></ul><ul><li>or inversely related to </li></ul><ul><li>Congestion, or … </li></ul>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 u y x w v z 2 2 1 3 1 1 2 5 3 5
    123. 123. Routing algorithm design <ul><li>Assuming that we can decide the cost of the links </li></ul><ul><li>How would routers learn about the weights of the links other than the directly connected links? </li></ul><ul><li>How often routers advertise the weights? </li></ul><ul><li>The scope of advertisement? </li></ul>u y x w v z 2 2 1 3 1 1 2 5 3 5
    124. 124. Routing Algorithm classification <ul><li>Global or decentralized information? </li></ul><ul><li>Global: </li></ul><ul><li>all routers have complete topology, link cost info </li></ul><ul><li>“ link state” algorithms </li></ul><ul><li>Decentralized: </li></ul><ul><li>router knows physically-connected neighbors, link costs to neighbors </li></ul><ul><li>iterative process of computation, exchange of info with neighbors </li></ul><ul><li>“ distance vector” algorithms </li></ul><ul><li>Static or dynamic? </li></ul><ul><li>Static: </li></ul><ul><li>routes change slowly over time </li></ul><ul><li>Dynamic: </li></ul><ul><li>routes change more quickly </li></ul><ul><ul><li>periodic update </li></ul></ul><ul><ul><li>in response to link cost changes </li></ul></ul>
    125. 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. 126. AS numbers from http://bgp.potaroo.net/cidr/autnums.html 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 AS3899 CHICO-NET - California State University, Chico AS3900 TEXASNET-ASN - Yokubaitis Holding Corporation AS3901 ARRAKIS - Higher Technology Services AS3902 GLAXOCA-1 - Glaxo Canada Inc. AS3903 NAG-AS - Network Ananlysis Group AS3904 ASTHOUGHTPRT - ThoughtPort inc.
    127. 127. Popular Routing Algorithms Distance vector Link state Path vector
    128. 128. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    129. 129. Routing Algorithms <ul><li>Interior Routing (within one AS ) vs Exterior Routing (between AS's) </li></ul><ul><li>Current Routing Algorithms Two common Routing Algorithms(Both are adaptive(dynamic) algorithms) </li></ul><ul><li>(a) &quot;Link State Routing&quot;-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*** </li></ul><ul><li>(b) &quot;Distance Vector Routing&quot;--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*** </li></ul>
    130. 130. A Link-State Routing Algorithm <ul><li>Dijkstra’s algorithm </li></ul><ul><li>net topology, link costs known to all nodes </li></ul><ul><ul><li>accomplished via “link state broadcast” </li></ul></ul><ul><ul><li>all nodes have same info </li></ul></ul><ul><li>computes least cost paths from one node (‘source”) to all other nodes </li></ul><ul><ul><li>gives forwarding table for that node </li></ul></ul><ul><li>iterative: after k iterations, know least cost path to k dest.’s </li></ul><ul><li>Notation: </li></ul><ul><li>c(x,y): link cost from node x to y; = ∞ if not direct neighbors </li></ul><ul><li>D(v): current value of cost of path from source to dest. v </li></ul><ul><li>p(v): predecessor node along path from source to v </li></ul><ul><li>N ' : set of nodes whose least cost path definitively known </li></ul>
    131. 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. 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 2,u 2,u D(w),p(w) 5,u 4,x 3,y 3,y D(x),p(x) 1,u D(y),p(y) ∞ 2,x D(z),p(z) ∞ ∞ 4,y 4,y 4,y u y x w v z 2 2 1 3 1 1 2 5 3 5
    133. 133. Dijkstra’s algorithm: example (2) Resulting shortest-path tree from u: Resulting forwarding table in u: u y x w v z v x y w z (u,v) (u,x) (u,x) (u,x) (u,x) destination link
    134. 134. Dijkstra’s algorithm, discussion <ul><li>Algorithm complexity: n nodes </li></ul><ul><li>each iteration: need to check all nodes, w, not in N </li></ul><ul><li>n(n+1)/2 comparisons: O(n 2 ) </li></ul><ul><li>more efficient implementations possible: O(nlogn) </li></ul><ul><li>Oscillations possible: </li></ul><ul><li>e.g., link cost = amount of carried traffic </li></ul>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 … recompute
    135. 135. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    136. 136. Link State <ul><li>Link State Routing--Example: OSPF (Open Shortest Path First)      http:// www.cisco.com/univercd/cc/td/doc/cisi twk/ito_doc/ospf.htm </li></ul><ul><li>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 </li></ul>
    137. 137. OSPF Autonomous System: A group of networks and routers under the authority of a single administration
    138. 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. 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 &quot;Link State Routing&quot; -OSPF protocol allows the administrator to assign a cost(metric) to each route: OSPF
    140. 140. OSPF Cost--from http://www.cisco.com/warp/public/104/2.html#1.0 &quot;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 <value> interface sub-command.&quot; -The cost can also be based on a type of service(minimum delay, maximum throughput, …) OSPF
    141. 141. OSPF Cost calculation
    142. 142. Distance vector Link state Path vector
    143. 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. 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 &quot;distance vector table&quot;) - Hop count is used as the metric--distance=how many hops RIP
    145. 145. RIP routing table
    146. 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. 147. Distance Vector Algorithm <ul><li>Bellman-Ford Equation (dynamic programming) </li></ul><ul><li>Define </li></ul><ul><li>d x (y) := cost of least-cost path from x to y </li></ul><ul><li>Then </li></ul><ul><li>d x (y) = min {c(x,v) + d v (y) } </li></ul><ul><li>where min is taken over all neighbors v of x </li></ul>v
    148. 148. Bellman-Ford example 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: u y x w v z 2 2 1 3 1 1 2 5 3 5
    149. 149. Distance Vector Algorithm <ul><li>D x (y) = estimate of least cost from x to y </li></ul><ul><li>Node x knows cost to each neighbor v: c(x,v) </li></ul><ul><li>Node x maintains distance vector D x = [D x (y): y є N ] </li></ul><ul><li>Node x also maintains its neighbors’ distance vectors </li></ul><ul><ul><li>For each neighbor v, x maintains D v = [D v (y): y є N ] </li></ul></ul>
    150. 150. Distance vector algorithm (4) <ul><li>Basic idea: </li></ul><ul><li>Each node periodically sends its own distance vector estimate to neighbors </li></ul><ul><li>When a node x receives new DV estimate from neighbor, it updates its own DV using B-F equation: </li></ul>D x (y) ← min v {c(x,v) + D v (y)} for each node y ∊ N <ul><li>Under minor, natural conditions, the estimate D x (y) converge to the actual least cost d x (y) </li></ul>
    151. 151. Distance Vector Algorithm (5) <ul><li>Iterative, asynchronous: each local iteration caused by: </li></ul><ul><li>local link cost change </li></ul><ul><li>DV update message from neighbor </li></ul><ul><li>Distributed: </li></ul><ul><li>each node notifies neighbors only when its DV changes </li></ul><ul><ul><li>neighbors then notify their neighbors if necessary </li></ul></ul>Each node: wait for (change in local link cost or msg from neighbor) recompute estimates if DV to any dest has changed, notify neighbors
    152. 152. from 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 ∞ ∞ ∞ 7 1 0 cost to ∞ 2 0 1 ∞ ∞ ∞ 2 0 1 7 1 0 time 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 3 2 x y z x y z 0 2 7 ∞ ∞ ∞ ∞ ∞ ∞ from cost to x z 1 2 7 y
    153. 153. from 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 ∞ ∞ ∞ 7 1 0 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 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 x y z x y z 0 2 7 ∞ ∞ ∞ ∞ ∞ ∞ from cost to x z 1 2 7 y
    154. 154. <ul><li>Advantages of RIP -----Simplicity=low overhead </li></ul><ul><li>Disadvantages of RIP: </li></ul><ul><li>The limit to the size of a network imposed by maximum hop count(15). </li></ul><ul><li>(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 </li></ul><ul><li>(c) Instability problem(Also called &quot;count to infinity problem&quot;) 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. </li></ul>
    155. 155. Distance Vector: link cost changes <ul><li>To solve the Slow Convergence problem, whe link cost changes notify neighbors ASAP: </li></ul><ul><li>node detects local link cost change </li></ul><ul><li>updates routing info, recalculates distance vector </li></ul><ul><li>if DV changes, notify neighbors immediately </li></ul>“ good news travels fast” 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 x z 1 4 50 y 1
    156. 156. Instability problem for RIP(Also called as &quot;count to infinity problem&quot;) 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. 157. Comparison of LS and DV algorithms <ul><li>Message complexity </li></ul><ul><li>LS: with n nodes, E links, O(nE) msgs sent </li></ul><ul><li>DV: exchange between neighbors only </li></ul><ul><ul><li>convergence time varies </li></ul></ul><ul><li>Speed of Convergence </li></ul><ul><li>LS: O(n 2 ) algorithm requires O(nE) msgs </li></ul><ul><ul><li>may have oscillations </li></ul></ul><ul><li>DV : convergence time varies </li></ul><ul><ul><li>may be routing loops </li></ul></ul><ul><ul><li>count-to-infinity problem </li></ul></ul><ul><li>Robustness: what happens if router malfunctions? </li></ul><ul><li>LS: </li></ul><ul><ul><li>node can advertise incorrect link cost </li></ul></ul><ul><ul><li>each node computes only its own table </li></ul></ul><ul><li>DV: </li></ul><ul><ul><li>DV node can advertise incorrect path cost </li></ul></ul><ul><ul><li>each node’s table used by others </li></ul></ul><ul><ul><ul><li>error propagate thru network </li></ul></ul></ul>
    158. 158. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    159. 159. Hierarchical Routing <ul><li>scale: with 200 million destinations: </li></ul><ul><li>can’t store all dest’s in routing tables! </li></ul><ul><li>routing table exchange would swamp links! </li></ul><ul><li>administrative autonomy </li></ul><ul><li>internet = network of networks </li></ul><ul><li>each network admin may want to control routing in its own network </li></ul><ul><li>Our routing study thus far - idealization </li></ul><ul><li>all routers identical </li></ul><ul><li>network “flat” </li></ul><ul><li>… not true in practice </li></ul>
    160. 160. Hierarchical Routing <ul><li>aggregate routers into regions, “autonomous systems” (AS) </li></ul><ul><li>routers in same AS run same routing protocol </li></ul><ul><ul><li>“ intra-AS” routing protocol </li></ul></ul><ul><ul><li>routers in different AS can run different intra-AS routing protocol </li></ul></ul><ul><li>Gateway router </li></ul><ul><li>Direct link to router in another AS </li></ul>
    161. 161. Interconnected ASes <ul><li>Forwarding table is configured by both intra- and inter-AS routing algorithm </li></ul><ul><ul><li>Intra-AS sets entries for internal dests </li></ul></ul><ul><ul><li>Inter-AS & Intra-AS sets entries for external dests </li></ul></ul>3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b Intra-AS Routing algorithm Inter-AS Routing algorithm Forwarding table 3c
    162. 162. AS numbers from http://bgp.potaroo.net/cidr/autnums.html 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 AS3899 CHICO-NET - California State University, Chico AS3900 TEXASNET-ASN - Yokubaitis Holding Corporation AS3901 ARRAKIS - Higher Technology Services AS3902 GLAXOCA-1 - Glaxo Canada Inc. AS3903 NAG-AS - Network Ananlysis Group AS3904 ASTHOUGHTPRT - ThoughtPort inc.
    163. 163. Inter-AS tasks <ul><li>Suppose a router in AS1 receives datagram for which dest is outside of AS1 </li></ul><ul><ul><li>Router should forward packet towards one of the gateway routers, but which one? </li></ul></ul><ul><li>AS1 needs: </li></ul><ul><li>to learn which dests are reachable through AS2 and which through AS3 </li></ul><ul><li>to propagate this reachability info to all routers in AS1 </li></ul><ul><li>Job of inter-AS routing! </li></ul>Gateway routers 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c
    164. 164. Example: Setting forwarding table in router 1d <ul><li>Suppose AS1 learns (via inter-AS protocol) that subnet x is reachable via AS3 (gateway 1c) but not via AS2. </li></ul><ul><li>Inter-AS protocol propagates reachability info to all internal routers. </li></ul><ul><li>Router 1d determines from intra-AS routing info that its interface I is on the least cost path to 1c. </li></ul><ul><li>Puts in forwarding table entry (x,I) . </li></ul>3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c
    165. 165. Example: Choosing among multiple ASes <ul><li>Now suppose AS1 learns from the inter-AS protocol that subnet x is reachable via AS3 and via AS2 . </li></ul><ul><li>To configure forwarding table, router 1d must determine towards which gateway it should forward packets for dest x . </li></ul><ul><li>This is also the job on inter-AS routing protocol! </li></ul>3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c
    166. 166. Example: Choosing among multiple ASes <ul><li>Now suppose AS1 learns from the inter-AS protocol that subnet x is reachable from AS3 and from AS2. </li></ul><ul><li>To configure forwarding table, router 1d must determine towards which gateway it should forward packets for dest x . </li></ul><ul><li>This is also the job on inter-AS routing protocol! </li></ul><ul><li>Hot potato routing: send packet towards closest of two routers. </li></ul>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
    167. 167. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    168. 168. Intra-AS Routing <ul><li>Also known as Interior Gateway Protocols (IGP) </li></ul><ul><li>Most common Intra-AS routing protocols: </li></ul><ul><ul><li>RIP: Routing Information Protocol </li></ul></ul><ul><ul><li>OSPF: Open Shortest Path First </li></ul></ul><ul><ul><li>IGRP: Interior Gateway Routing Protocol (Cisco proprietary—modified version of RIP) </li></ul></ul>
    169. 169. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    170. 170. RIP ( Routing Information Protocol) <ul><li>Distance vector algorithm </li></ul><ul><li>Included in BSD-UNIX Distribution in 1982 </li></ul><ul><li>Distance metric: # of hops (max = 15 hops) </li></ul>From router A to subsets: D C B A u v w x y z destination hops u 1 v 2 w 2 x 3 y 3 z 2
    171. 171. RIP advertisements <ul><li>Distance vectors: exchanged among neighbors every 30 sec via Response Message (also called advertisement ) </li></ul><ul><li>Each advertisement: list of up to 25 destination nets within AS </li></ul>
    172. 172. RIP: Example Destination Network Next Router Num. of hops to dest. w A 2 y B 2 z B 7 x -- 1 … . …. .... w x y z A C D B Routing table in D
    173. 173. RIP: Example Destination Network Next Router Num. of hops to dest. w A 2 y B 2 z B A 7 5 x -- 1 … . …. .... Routing table in D Dest Next hops w - 1 x - 1 z C 4 … . … ... Advertisement from A to D w x y z A C D B
    174. 174. RIP: Link Failure and Recovery <ul><li>If no advertisement heard after 180 sec --> neighbor/link declared dead </li></ul><ul><ul><li>routes via neighbor invalidated </li></ul></ul><ul><ul><li>new advertisements sent to neighbors </li></ul></ul><ul><ul><li>neighbors in turn send out new advertisements (if tables changed) </li></ul></ul><ul><ul><li>link failure info quickly (?) propagates to entire net </li></ul></ul><ul><ul><li>poison reverse used to prevent ping-pong loops (infinite distance = 16 hops) </li></ul></ul>
    175. 175. RIP Table processing <ul><li>RIP routing tables managed by application-level process called route-d (daemon) </li></ul><ul><li>advertisements sent in UDP packets, periodically repeated </li></ul>physical link network forwarding (IP) table Transprt (UDP) physical link network (IP) Transprt (UDP) forwarding table routed routed
    176. 176. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    177. 177. OSPF (Open Shortest Path First) <ul><li>“ open”: publicly available </li></ul><ul><li>Uses Link State algorithm </li></ul><ul><ul><li>LS packet dissemination </li></ul></ul><ul><ul><li>Topology map at each node </li></ul></ul><ul><ul><li>Route computation using Dijkstra’s algorithm </li></ul></ul><ul><li>OSPF advertisement carries one entry for each connection to neighbor router </li></ul><ul><li>Advertisements disseminated to entire AS (via flooding) </li></ul><ul><ul><li>Carried in OSPF messages directly over IP (rather than TCP or UDP) via IP protocol number 89. </li></ul></ul>
    178. 178. OSPF “advanced” features (not in RIP) <ul><li>Security: all OSPF messages authenticated (to prevent malicious intrusion) using MD5 ( Message-Digest algorithm 5 ) </li></ul><ul><li>Multi ple same-cost path s allowed (only one path in RIP) </li></ul><ul><li>For each link, multiple cost metrics for different TOS (e.g., satellite link cost set “low” for best effort; high for real time) </li></ul><ul><li>Integrated uni- and multicast support: </li></ul><ul><ul><li>Multicast OSPF (MOSPF) uses same topology data base as OSPF </li></ul></ul><ul><li>Hierarchical OSPF in large domains. </li></ul>
    179. 179. Hierarchical OSPF
    180. 180. Hierarchical OSPF <ul><li>Two-level hierarchy: local area, backbone. </li></ul><ul><ul><li>Link-state advertisements only in area </li></ul></ul><ul><ul><li>each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. </li></ul></ul><ul><li>Area border routers: “summarize” distances to nets in own area, advertise to other Area Border routers. </li></ul><ul><li>Backbone routers: run OSPF routing limited to backbone. </li></ul><ul><li>Boundary routers: connect to other AS’s. </li></ul>
    181. 181. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    182. 182. Internet inter-AS routing: BGP <ul><li>BGP (Border Gateway Protocol): the de facto (Latin: “In practice) standard </li></ul><ul><li>BGP provides each AS a means to: </li></ul><ul><ul><li>Obtain subnet reachability information from neighboring ASs. </li></ul></ul><ul><ul><li>Propagate reachability information to all AS-internal routers. </li></ul></ul><ul><ul><li>Determine “good” routes to subnets based on reachability information and policy. </li></ul></ul><ul><li>allows subnet to advertise its existence to rest of Internet: “I am here” </li></ul>
    183. 183. BGP basics <ul><li>Pairs of routers (BGP peers) exchange routing info over semi-permanent TCP connections: BGP sessions </li></ul><ul><ul><li>BGP sessions need not correspond to physical links. </li></ul></ul><ul><li>When AS2 advertises a prefix to AS1, AS2 is promising it will forward any datagrams destined to that prefix towards the prefix. </li></ul><ul><ul><li>AS2 can aggregate prefixes in its advertisement </li></ul></ul>3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c eBGP session iBGP session
    184. 184. Distributing reachability info <ul><li>With eBGP session between 3a and 1c, AS3 sends prefix reachability info to AS1. </li></ul><ul><li>1c can then use iBGP to distribute this new prefix reachability info to all routers in AS1 </li></ul><ul><li>1b can then re-advertise new reachability info to AS2 over 1b-to-2a eBGP session </li></ul><ul><li>When router learns of new prefix, creates entry for prefix in its forwarding table. </li></ul>3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c eBGP session iBGP session
    185. 185. Path attributes & BGP routes <ul><li>When advertising a prefix, includes BGP attributes. </li></ul><ul><ul><li>prefix + attributes = “route” </li></ul></ul><ul><li>Two important attributes: </li></ul><ul><ul><li>AS-PATH: contains ASs through which prefix advertisement has passed: AS 67 AS 17 –- “path vector” algorithm </li></ul></ul><ul><ul><li>NEXT-HOP: Indicates specific internal-AS router to next-hop AS. (There may be multiple links from current AS to next-hop-AS.) </li></ul></ul><ul><li>When gateway router receives route advertisement, uses import policy to accept/decline. </li></ul>
    186. 186. BGP route selection <ul><li>Router may learn about more than 1 route to some prefix. Router must select route. </li></ul><ul><li>Elimination rules: </li></ul><ul><ul><li>Local preference value attribute: policy decision </li></ul></ul><ul><ul><li>Shortest AS-PATH </li></ul></ul><ul><ul><li>Closest NEXT-HOP router: hot potato routing </li></ul></ul><ul><ul><li>Additional criteria </li></ul></ul>
    187. 187. BGP messages <ul><li>BGP messages exchanged using TCP. </li></ul><ul><li>BGP messages: </li></ul><ul><ul><li>OPEN: opens TCP connection to peer and authenticates sender </li></ul></ul><ul><ul><li>UPDATE: advertises new path (or withdraws old) </li></ul></ul><ul><ul><li>KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN request </li></ul></ul><ul><ul><li>NOTIFICATION: reports errors in previous msg; also used to close connection </li></ul></ul>
    188. 188. BGP routing policy <ul><li>A,B,C are provider networks </li></ul><ul><li>X,W,Y are customer (of provider networks) </li></ul><ul><li>X is dual-homed: attached to two networks </li></ul><ul><ul><li>X does not want to route from B via X to C </li></ul></ul><ul><ul><li>.. so X will not advertise to B a route to C </li></ul></ul>
    189. 189. BGP routing policy (2) <ul><li>A advertises to B the path AW </li></ul><ul><li>B advertises to X the path BAW </li></ul><ul><li>Should B advertise to C the path BAW? </li></ul><ul><ul><li>No way! B gets no “revenue” for routing CBAW since neither W nor C are B’s customers </li></ul></ul><ul><ul><li>B wants to force C to route to w via A </li></ul></ul><ul><ul><li>B wants to route only to/from its customers! </li></ul></ul>
    190. 190. Why different Intra- and Inter-AS routing ? <ul><li>Policy: </li></ul><ul><li>Inter-AS: admin wants control over how its traffic routed, who routes through its net. </li></ul><ul><li>Intra-AS: single admin, so no policy decisions needed </li></ul><ul><li>Scale: </li></ul><ul><li>hierarchical routing saves table size, reduced update traffic </li></ul><ul><li>Performance : </li></ul><ul><li>Intra-AS: can focus on performance </li></ul><ul><li>Inter-AS: policy may dominate over performance </li></ul>
    191. 191. Chapter 4: Network Layer <ul><li>4. 1 Introduction </li></ul><ul><li>4.2 Virtual circuit and datagram networks </li></ul><ul><li>4.3 What’s inside a router </li></ul><ul><li>4.4 IP: Internet Protocol </li></ul><ul><ul><li>Datagram format </li></ul></ul><ul><ul><li>IPv4 addressing </li></ul></ul><ul><ul><li>ICMP </li></ul></ul><ul><ul><li>IPv6 </li></ul></ul><ul><li>4.5 Routing algorithms </li></ul><ul><ul><li>Link state </li></ul></ul><ul><ul><li>Distance Vector </li></ul></ul><ul><ul><li>Hierarchical routing </li></ul></ul><ul><li>4.6 Routing in the Internet </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><li>4.7 Broadcast and multicast routing </li></ul>
    192. 192. Broadcast Routing <ul><li>Deliver packets from source to all other nodes </li></ul><ul><li>Source duplication is inefficient: </li></ul><ul><li>Source duplication: how does source determine recipient addresses? </li></ul>R1 R2 R3 R4 source duplication R1 R2 R3 R4 in-network duplication duplicate creation/transmission duplicate duplicate
    193. 193. In-network duplication <ul><li>Flooding: when node receives brdcst pckt, sends copy to all neighbors </li></ul><ul><ul><li>Problems: cycles & broadcast storm </li></ul></ul><ul><li>Controlled flooding: node only brdcsts pkt if it hasn’t brdcst same packet before </li></ul><ul><ul><li>Node keeps track of pckt ids already brdcsted </li></ul></ul><ul><ul><li>Or reverse path forwarding (RPF): only forward pckt if it arrived on shortest path between node and source </li></ul></ul><ul><li>Spanning tree </li></ul><ul><ul><li>No redundant packets received by any node </li></ul></ul>
    194. 194. Spanning Tree <ul><li>First construct a spanning tree </li></ul><ul><li>Nodes forward copies only along spanning tree </li></ul>A B G D E c F A B G D E c F (a) Broadcast initiated at A (b) Broadcast initiated at D
    195. 195. Spanning Tree: Creation—one of many algorithms <ul><li>Center node is predefined—node E in this example </li></ul><ul><li>Each node sends unicast join message to center node </li></ul><ul><ul><li>Message forwarded until it arrives at a node already belonging to spanning tree </li></ul></ul><ul><ul><li>Once the spanning tree is made, any node can broadcast </li></ul></ul>1 2 3 4 5 <ul><li>Stepwise construction of spanning tree </li></ul>(b) Constructed spanning tree A B G D E c F A B G D E c F
    196. 196. Modes of message transfer anycast broadcast multicast unicast Added in IPv6
    197. 197. Multicasting on Internet <ul><li>IP Multicast </li></ul><ul><li>Internet Relay Chat </li></ul><ul><li>NNTP Network News Transfer Protocol </li></ul><ul><li>PSYC Protocol for SYnchronous Conferencing </li></ul><ul><li>WWCP World Wide Conferencing Network </li></ul><ul><li>XCAST   Explicit Multi-Unicast </li></ul><ul><li>Streaming media </li></ul><ul><li>Interactive games </li></ul>Send to group members only
    198. 198. Two main problems in multicasting <ul><li>How to identify group members? </li></ul><ul><li>What address should be used? </li></ul>NA NA 255.255.255.255 240.0.0.0 E NA NA 239.255.255.255 224.0.0.0 D /24 255.255.255.0 223.255.255.255 192.0.0.0 C /16 255.255.0.0 191.255. 255.255 128.0.0.0 B /8 255.0.0.0 127. 255.255.255 1.0.0.0 A CIDR prefix notation Default Subnet Mask End Start Class
    199. 199. mcast
    200. 200. Multicast Routing: sending to a Group <ul><li>Goal: find a tree (or trees) connecting routers having local mcast group members </li></ul><ul><ul><li>(Tree is ideal for this: not all paths between routers used) </li></ul></ul><ul><ul><li>Two approaches: </li></ul></ul><ul><ul><li>source-based: different tree from each sender to rcvrs </li></ul></ul><ul><ul><li>shared-tree: same tree used by all group members </li></ul></ul>Shared tree Source-based trees
    201. 201. Approaches for building mcast trees <ul><li>Approaches: </li></ul><ul><li>source-based tree: one tree per source—same as spanning-tree algorithm </li></ul><ul><ul><li>shortest path trees </li></ul></ul><ul><ul><li>reverse path forwarding </li></ul></ul><ul><li>group-shared tree: group uses one tree </li></ul><ul><ul><li>minim
    1. ¿Le ha llamado la atención una diapositiva en particular?

      Recortar diapositivas es una manera útil de recopilar información importante para consultarla más tarde.

    ×