cs 164: computer networks slide set 10 -- internetworking (continued) routing

34
CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Post on 19-Dec-2015

224 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

CS 164: Computer NetworksSlide Set 10 -- Internetworking

(Continued)Routing

Page 2: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

In this set ....

• How are link-state algorithms implemented in practice ?

• OSPF• Mobile IP ---------------------------------• Section 4.3 - Global Internet --

Subnetting, Classless Inter-domain routing and BGP

Page 3: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Implementing link state routing

• Each node maintains two lists – The tentative list and the confirmed list.

• Each list contains entries of the type {Destination, Cost, Next Hop}.

• The two lists are continuously updated as new nodes are added to the shortest path tree (as in the Dijkstra’s algorithm).

Page 4: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

The Algorithm• Step 1: Initialize confirmed list with myself --> cost =

0;• Step 2: For the node just added to the confirmed list

in the previous step, call it node Next, select its LSP.• Step 3: For each neighbor of Next (Neighbor),

calculate cost to reach this neighbor– Cost = Cost from me to Next + Cost of Next to Neighbor.

• (a) If Neighbor is currently on neither the Tentative or the Confirmed list, add {Neighbor, Cost NextHop} to Tentative list. Note -- here NextHop is the one that is used to reach Next.

• (b) If Neighbor is on the Tentative list and the cost seen is < the cost currently listed for Neighbor, replace the entry with {Neighbor, Cost, NextHop}. Else, do nothing.

• Step 4: If Tentative list is empty, stop. Else, pick entry from the Tentative list with lowest cost and move it to Confirmed list. Return to Step 2.

Page 5: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Our Example

D

A

B

C

5 3

211

10

Step Confirmed

Tentative

1 (D, 0, -)

2 (D,0,-) (C, 2, C)(B, 11, B)

3 (D,0,-)(C,2,C)

(B,11,B)

4 (D,0,-)(C,2,C)

(B,5,C)(A,12,C)

We look at D.

Step Confirmed Tentative

5 (D,0,-)(C,2,C)(B,5, C)

(A,12,C)

6 (D,0,-)(C,2,C)(B,5, C)

(A, 10, C)

7 (D,0,-)(C,2,C)(B,5,C)(A,10,C)

Page 6: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Computational Complexity

• There are n nodes.• 1st iteration, search through n nodes to

determine “w”, the one with the minimum cost.

• 2nd iteration, search through (n-1) nodes and so on.

• Total = n(n+1)/2 ≈ O(n2)• One could use sorting methods (heapsort

etc.) -could reduce complexity to O(nlogn).

Page 7: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Comparing Distance Vector and Link State

• Message complexity in link state is O(nE) since each node sends an update -- possibly needed for each link.

• With distance vector it depends on the rate of change of link costs etc.

• Convergence time in link state = O(nlogn); In distance vector depends on relative path costs -- count to infinity problem.

• However, link state suffers from oscillations.• Link state is stable since computation done at

each node -- distance vector could lead to problems if there are malfunctioning routers.

Page 8: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Open Shortest Path First (OSPF)

• Open standard -- non-proprietary• Essentially the link-state approach --however

features are added.• Authentication of routing messages -- prevent

misconfigurations-- only sys admin can configure.• Add a hierarchy -- OSPF runs within a domain or

administrative region. The region is sub-divided into areas.

• Router does not need to know how to get to every network within the domain -- enough to know how to get to right area.

• Load balancing - if two paths have same cost, subdivide traffic among paths.

Page 9: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

OSPF Header

Authentication

Version Type Message length

Checksum Authentication type

SourceAddr

AreaId

0 8 16 31• Nuggets:

• Checksum -- same as IP (does not include authentication part).

Authentication can be none, password based or crypto checksum (hash).

Types -- HELLO packet, Request, Send, ACK receipt of link state messages.

Header is common for all OSPF messages.

Page 10: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Link State Advertisements

• Router uses this to advertise directly connected nets and costs of links to other routers.

• Link state age -- similar to TTL (not included in checksum).

• Unique IP address for router -- if it has more than one, pick lowest.

• TOS -- different routes for different IP packets -- not widely used.

LS Age Options Type=1

0 Flags 0 Number of links

Link type Num_TOS Metric

Link-state ID

Advertising router

LS sequence number

Link ID

Link data

Optional TOS information

More links

LS checksum Length

Other info on LSA, look up the book.

Page 11: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Metrics• How does one assign link costs ?

– Costs distinguish between different physical links.

– dynamically, one may consider the load -- difficult.

• Versions of ARPANET tried to address this.• One way -- count the number of queued

packets --does not take bandwidth or latency into consideration.

• Another way -- latency on the link.– Each incoming packet time-stamped. There is an

associated transmission time and propagation latency -- static for the link.

• Delay = (Depart time - Arrival time) + transmission time + prop. latency.

Page 12: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Instability

• Due to improper choice of metrics, instability and oscillations could occur.

• Many of links remain idle while others are heavily loaded.

Page 13: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Oscillations in link state

A

D

C

B

1 1 +

0

A

D

C

B

2 +

A

D

C

B

0

1

2 +

1) 2)

3)

Page 14: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Avoiding oscillations

Smoothing variations of the metric in time.

• Choose weights that do not change often -- averages.

• Impose hard limit on how much metric could change from one measurement to next.

• Do not change paths with high frequencies even if link weights do change often.

Page 15: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Mobility• So far, with IP, implicit assumption that there is no

mobility.• Addresses -- network part, host part -- so routers

determine how to get to correct network.• If nodes move network may change• How do we cope with this ? • Should there be a change in IP addresses with

mobility ? If so how ?• Should we use DHCP to assign new addresses ?

May be adequate in some cases.• Within the same network no problems -- no need

to change IP addresses -- link layer delivery.

Page 16: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Mobile IP• Problem occurs when user switches

between networks.• Applications may keep running and so

the remote end needs to know how to deliver packets to the mobile host.

• Mobile IP – Need for transparency for the user– No need to change software of majority of

routers on the Internet.– Background compatible

Page 17: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

The Home Agent

• However, it doesn’t come for free!• Some routers need new functionalities.• Home Agent: Permanent IP address

somewhere that the mobile calls home.– A router located on the home network of the

mobile.– When a node needs to reach the mobile,

sends the messages to the home address.

Page 18: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

The Foreign Agent• The Foreign Agent: Router located in

new network to which the mobile attaches itself when it is away from the home network.

• Mobile registers with foreign agent and provides the address of its home agent.

• Foreign agent contacts the home agent and provides a “care-of-address” --> IP address of the foreign agent.

Page 19: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Note ....

• The home and foreign agents have to announce their presence -- they are specialized routers.

• The attaching mobile may solicit an advertisement by sending a request.

Page 20: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Proxy ARP

• When the mobile is away, the home agent has to pick up packets meant for the mobile.

• With Proxy ARP, the home agent (HA) inserts IP address of mobile node instead of its own!– It provides its own hardware address though !

• To invalidate old ARP entries in possible caches, as soon as mobile is known to have registered with a FA (foreign agent), HA issues an ARP.– Note that this is not in response to an ARP query

and hence is called “the gratuitous ARP”.

Page 21: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Tunnelling• Once home agent gets the IP datagram, it

tunnels the packet to the mobile.• To recollect, by tunneling, it encapsulates

the IP packet within another IP packet destined for the foreign agent.

• The FA strips the IP wrapper, recognizes that the packet was meant for a registered mobile nad uses its own ARP entry to send the frame to the hardware address of the mobile.

Page 22: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Other details

• Mobile has to dynamically acquire an IP address in the foreign network.

• Packets in the other direction are simple, use the source’s IP address (a fixed location).

• If the source was a mobile, similar procedures could be used.

Page 23: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Route optimization

• Previous approach sub-optimal. Fixed --> home --> foreign --> mobile. This is called the triangle routing problem.

• HA will let the sending node know the care-of-address of mobile node.

• Sending node creates tunnel to mobile.

HA

S

FA

Page 24: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Implementation and Other issues

• HA sends a “binding update” to the source in addition to forwarding initial packet.

• Source creates an entry in a “binding cache” which includes mappings of mobile node addresses to care-of addresses.

• Entries could become stale -- mobile chooses a new FA -- old FA would issue a binding warning.

• Issue : Can lead to security problems.• Mobile IP not widely deployed -- still being

researched -- Mobile networking in general an upcoming research area.

Page 25: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Routing so far...

• Somewhat scalable.• Routers need not know of all the

hosts that are connected to the Internet.

• Enough to know of networks.• However, in reality, millions of

nodes -- distance vector takes for ever to converge, link state too expensive -- both don’t scale that much!

Page 26: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Revisiting the Internet

NSFNET backboneStanford

BARRNETregional

BerkeleyPARC

NCAR

UA

UNM

Westnetregional

UNL KU

ISU

MidNetregional■ ■ ■

• Called the customer provider view -- we have end-user sites, regional service provider networks etc.

•Each unit is independent as far as administration goes -- what routing to use, how to assign metrics etc. Each unit is called an Autonomous System or AS.

Page 27: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Intra-AS routing

• The routing schemes that we have seen so far are used for routing within ASes.

• There are gateway routers that deliver packets to outside the AS.– Internal nodes know which ASes

they can reach, but not the intricacies.

Page 28: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Scalability and Addressing

• IP address space is limited -- too many networks.

• In addition, the more the networks, the more would be the entries in each routing table.

• We need to take care so that address space is not used up.

• Note -- 221 Class C addresses but only 214 Class B.– A Class C network can have at most 255

hosts, what if we had 257 ? Should we allocate one of the fewer Class B addresses?

Page 29: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Address Efficiency• In our example, we had 256 hosts. For this,

Class C is insufficient.• Class B can accommodate 65535 hosts

(approximately 64 K).• If we assign a Class B address to this 256

node network, we are wasting the address space -- the address efficiency would be 256/65535 = 0.39 %.

• If we construct a separate Class C network with 2 hosts, we don’t do much better -- efficiency becomes 2/255 = 0.78 %.

Page 30: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Sub-Netting• The solution is to assign a single IP

network number to a set of “several” physical networks.

• Each physical network is called a subnetwork or subnet for short.

• The requirement is that the subnets have to be close to each other --> they need to look like a single network when considered together.

• Each router can have an entry to this “aggregation” of networks.

• Example -- a campus network can be divided into sub-networks.

Page 31: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

The Subnet Mask and Subnet Number

• The mechanism by which a single network number can be shared among multiple networks involves configuring all the nodes on each subnet with a “subnet mask”.

• This enables us to introduce what we call a subnet number -- all hosts on the same subnet will have the same subnet number.

Page 32: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Representation

Network number Host number

Class B address

Subnet mask (255.255.255.0)

Subnetted address

11111111111111111111111100000000

Network number Host IDSubnet ID

• In this example, we subdivide the network part into two sub-parts.

•The first is the network number and the second a Subnet ID.

Note: With this, the Class B can be divided into several sub-networks.

Page 33: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

An Example• We have the Class B

network subdivided into three subnets.

• Each subnet has a sub-net mask.– The mask determines how

many bits belong to the subnet ID.

• Notice that each subnet can have any number of bits in its subnet mask.

• Bitwise ANDing of Host IP address and Subnet Mask gives the Subnet No.

Subnet mask: 255.255.255.128Subnet number: 128.96.34.0

128.96.34.15128.96.34.1

H1 R1

128.96.34.130 Subnet mask: 255.255.255.128Subnet number: 128.96.34.128

128.96.34.129128.96.34.139

R2H2

128.96.33.1128.96.33.14

Subnet mask: 255.255.255.0Subnet number: 128.96.33.0

H3

2828

Page 34: CS 164: Computer Networks Slide Set 10 -- Internetworking (Continued) Routing

Next....

• Given subnets how does one now make the forwarding tables ?– More about Subnets

• Classless Inter Domain Routing.

• BGP