Docsity

Routing - Network Technologies - Lecture Slides, Slides of Computer Science

Partial preview of the text

Download Routing - Network Technologies - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

What is routing?

• forwarding – moving packets

between ports

  • Look up destination address in forwarding table
  • Find out-port or 〈out-port, MAC addr〉 pair

• Routing is process of populat-

ing forwarding table

  • Routers exchange messages about nets they can reach
  • Goal: Find optimal route for ev- ery destination -... or maybe good route, or just any route (depending on scale)

Routing algorithm properties

• Static vs. dynamic

  • Static: routes change slowly over time
  • Dynamic: automatically adjust to quickly changing network conditions

• Global vs. decentralized

  • Global: All routers have complete topology
  • Decentralized: Only know neighbors & what they tell you

• Intra-domain vs. Inter-domain routing

  • Intra-: All routers under same administrative control
  • Intra-: Scale to ∼100 networks (e.g., campus like Stanford)
  • Inter-: Decentralized, scale to Internet

Distance Vector

• Local routing algorithm

• Each node maintains a set of triples

  • (Destination, Cost, NextHop)

• Exchange updates w. directly connected neighbors

  • periodically (on the order of several seconds to minutes)
  • whenever table changes (called triggered update)

• Each update is a list of pairs:

  • (Destination, Cost)

• Update local table if receive a “better” route

  • smaller cost
  • from newly connected/available neighbor

• Refresh existing routes; delete if they time out

DV Example

D

G

A

F

E

B C

• B’s routing table:

Destination Cost NextHop A 1 A C 1 C D 2 C E 2 A F 2 A G 3 A

Danger: Loops

D

G

A

F

E

B C

  • link from A to E fails
  • A advertises distance of infinity to E
  • B and C advertise a distance of 2 to E
  • B decides it can reach E in 3 hops; advertises this to A
  • A decides it can reach E in 4 hops; advertises this to C
  • C decides that it can reach E in 5 hops...

How to avoid loops

• Consider small value (e.g., 16) to be infinity

  • Will quickly decite node is unavailable

• Split horizon

  • When sending updates to node A, don’t include destinations you route to through A

• Split horizon with poison reverse

  • When sending updates to node A, explictly include very high cost (“poison”) for destinations you route to through A

• Note: Latter two only help between two nodes

  • Can still get loop with three nodes involved
  • Might need to delay advertising routes after changes, but will affect convergence time

Reliable flooding

• Store most recent LSP from each node

• Forward LSP to all nodes but one that sent it

• Generate new LSP periodically

  • Increment SEQNO

• Start SEQNO at 0 when reboot

  • If you hear your own packet w. SEQNO= n, set your next SEQNO to n + 1

• Decrement TTL of each stored LSP

  • discard when TTL= 0

Calculating best path

• Dijkstra’s shortest path algorithm

• Let:

  • N denote set of nodes in the graph
  • l (i, j ) denotes non-negative cost (weight) for edge (i, j )
  • s denotes yourself (node computing paths)

• Initialize variables

  • M ← {s} (set of nodes “incorporated” so far)
  • Cn ← l (s, n) (cost of the path from s to n)
  • Rn ← ⊥ (next hop on path to n)

Distance Vector vs. Link State

• # of messages

  • DV: convergence time varies, but Ω(d ) where d is # of neighbors of node
  • LS: O(n · d ) for n nodes in system

• Computation

  • DV: Could count all the way to ∞ if loop
  • LS: O(n^2 )

• Robustness – what happens with malfunctioning

router?

  • DV: Node can advertise incorrect path cost
  • DV: Costs used by others, errors propagate through net
  • LS: Node can advertise incorrect link cost

Metrics

• Original ARPANET metric

  • measures number of packets enqueued on each link
  • took neither latency nor bandwidth into consideration

• New ARPANET metric

  • stamp each incoming packet with its arrival time (AT)
  • record departure time (DT)
  • when link-level ACK arrives, compute Delay = (DT − AT ) + Transmit + Latency
  • if timeout, reset DT to departure time for retransmission
  • link cost = average delay over some time period

• Fine Tuning

  • compressed dynamic range
  • replaced Delay with link utilization

• Today: policy often trumps performance [more later]

OSPF areas

Scaling issues

• Every router must be able to forward based on any

destination IP address

  • Given address, it needs to know ”next hop” (table)
  • Na¨ıve: Have an entry for each address
  • There would be 108 entries!

• Solution: Entry covers range of addresses

  • Can’t do this if addresses are assigned randomly! (e.g., Ethernet addresses)
  • This is why address aggregation is important
  • Addresses allocation should be based on network structure

• What is structure of the Internet?

Address allocation, 1990

Network number Host number Class B address

Subnet mask (255.255.255.0)

Subnetted address

111111111111111111111111 00000000

Network number Subnet ID Host ID

• Hierarchical IP addresses

  • Class A (8-bit prefix), B (16-bit), C (24-bit)

• Subnetting adds another level within organizations

  • Subnet masks define variable partition of host part
  • Subnets visible only within site

Example

 - Subnet mask: 255.255.255. - Subnet number: 128.96.34. 
  • 128.96.34. - 128.96.34. - H1 R - 128.96.34.130 Subnet mask: 255.255.255. - Subnet number: 128.96.34. - 128.96.34.129 128.96.34. - R2 H - 128.96.33. - 128.96.33. - Subnet mask: 255.255.255. - Subnet number: 128.96.33.
    • H