network layer routing ip n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Network Layer, Routing, IP PowerPoint Presentation
Download Presentation
Network Layer, Routing, IP

Loading in 2 Seconds...

play fullscreen
1 / 54

Network Layer, Routing, IP - PowerPoint PPT Presentation


  • 150 Views
  • Uploaded on

Network Layer, Routing, IP. October 28-30, 2003. Assignments. Homework 4 Project 2 Read Chapter 4 sections 4.1-4.4 for this week. network data link physical. network data link physical. network data link physical. network data link physical. network data link physical. network

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Network Layer, Routing, IP' - snow


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
network layer routing ip

Network Layer, Routing, IP

October 28-30, 2003

assignments
Assignments
  • Homework 4
  • Project 2
  • Read Chapter 4 sections 4.1-4.4 for this week
network layer

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

Network Layer
  • Move packet from sender to receiver
  • Network layer protocols in every host, router
  • Three Functions:
    • path determination: route taken by packets from source to dest. Routing algorithms
    • forwarding: move packets from router’s input to appropriate router output
    • call setup: some network architectures require router call setup along path before data flows
service model
Service Model
  • End-to-end transport of data between sending and receiving systems
    • How is this different than the transport layer services?
  • Datagram versus Virtual Circuit
virtual circuit
Virtual Circuit
  • Call setup, teardown for each call
  • Each packet carries VC identifier (not destination host ID)
  • Every router on source-dest path maintains “state” for each passing connection
    • transport-layer connection only involved two end systems
  • Link, router resources (bandwidth, buffers) may be allocatedto VC
    • to get circuit-like performance
datagram networks

application

transport

network

data link

physical

application

transport

network

data link

physical

Datagram Networks
  • Routers: no state about end-to-end connections
  • Packets forwarded using destination host address
  • Best-effort service
    • No guarantees with respect to delay, in-order delivery

1. Send data

2. Receive data

datagram and the internet
Datagram and the Internet
  • Why is datagram service okay for the Internet?
routing

A

D

E

B

F

C

Routing
  • Routing Protocol
    • Find route from default/first hop/source router to destination router
  • Job of the algorithm –find a “good path”
    • Use graph abstraction to represent the network
    • Where do the numbers come from?

5

3

5

2

2

1

3

1

2

1

routing algorithm classification
Global or decentralized information?

Global:

all routers have complete topology, link cost info

“link state” algorithms

Decentralized:

router knows physically-connected neighbors, link costs to neighbors

iterative process of computation, exchange of info with neighbors

“distance vector” algorithms

Static or dynamic?

Static:

routes change slowly over time

Dynamic:

routes change more quickly

periodic update

in response to link cost changes

Load sensitive/insensitive

Routing Algorithm Classification
a link state routing algorithm
A Link-State Routing Algorithm
  • Global – every router knows about all others
  • How does a node find out about all other nodes?
  • Once a node has the complete topology, it runs Dijkstra’s algorithm to generate the routing table
notation
Notation
  • c(i,j): link cost from node i to j. cost infinite if not direct neighbors
  • D(v): current value of cost of path from source to dest. v
  • p(v): predecessor node along path from source to v, that is next v
  • N: set of nodes whose least cost path definitively known
dijsktra s algorithm
Dijsktra’s Algorithm

1 Initialization:

2 N = {A}

3 for all nodes v

4 if v adjacent to A

5 then D(v) = c(A,v)

6 else D(v) = infinity

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

dijkstra s algorithm example

A

D

B

E

F

C

Dijkstra’s algorithm: example

D(B),p(B)

2,A

2,A

2,A

D(D),p(D)

1,A

D(C),p(C)

5,A

4,D

3,E

3,E

D(E),p(E)

infinity

2,D

Step

0

1

2

3

4

5

start N

A

AD

ADE

ADEB

ADEBC

ADEBCF

D(F),p(F)

infinity

infinity

4,E

4,E

4,E

5

3

5

2

2

1

3

1

2

1

discussion

A

A

A

A

D

D

D

D

B

B

B

B

C

C

C

C

Discussion
  • Algorithm complexity
    • n nodes
    • each iteration: need to check all nodes, w, not in N
    • n*(n+1)/2 comparisons: O(n**2)
    • more efficient implementations possible: O(nlogn)
  • Oscillations possible:
    • e.g., link cost = amount of carried traffic
    • Solution?

1

1+e

2+e

0

2+e

0

2+e

0

0

0

1

1+e

0

0

1

1+e

e

0

0

0

e

1

1+e

0

1

1

e

… recompute

… recompute

routing

… recompute

initially

distance vector routing algorithm

distance from X to

Y, via Z as next hop

X

=

D (Y,Z)

Z

c(X,Z) + min {D (Y,w)}

=

w

Distance Vector Routing Algorithm
  • Iterative, asynchronous, and distributed
  • Distance table
    • all nodes have one
    • row for all destinations and a column for neighbors
distance table example

cost to destination via

E

D ()

A

B

C

D

A

1

7

6

4

B

14

8

9

11

D

5

5

4

2

destination

A

D

B

E

C

E

E

E

D (C,D)

D (A,D)

D (A,B)

D

D

B

c(E,D) + min {D (C,w)}

c(E,B) + min {D (A,w)}

c(E,D) + min {D (A,w)}

=

=

=

w

w

w

=

=

=

2+2 = 4

2+3 = 5

8+6 = 14

Distance Table: Example

1

7

2

8

1

2

loop!

loop!

routing table

cost to destination via

E

D ()

A

B

C

D

A

1

7

6

4

B

14

8

9

11

D

5

5

4

2

destination

Routing Table

Outgoing link

to use, cost

A

B

C

D

A,1

D,5

D,4

D,4

destination

Routing table

Distance table

dv overview

wait for (change in local link cost of msg from neighbor)

recompute distance table

if least cost path to any dest has changed, notify neighbors

DV Overview

Each node:

distance vector algorithm
Distance Vector Algorithm

At all nodes, X:

1 Initialization:

2 for all adjacent nodes v:

3 D (*,v) = infinity /* the * operator means "for all rows" */

4 D (v,v) = c(X,v)

5 for all destinations, y

6 send min D (y,w) to each neighbor /* w over all X's neighbors */

X

X

X

w

distance vector algorithm1
Distance Vector Algorithm

8 loop

9 wait (until I see a link cost change to neighbor V

10 or until I receive update from neighbor V)

11

12 if (c(X,V) changes by d)

13 /* change cost to all dest's via neighbor v by d */

14 /* note: d could be positive or negative */

15 for all destinations y: D (y,V) = D (y,V) + d

16

17 else if (update received from V wrt destination Y)

18 /* shortest path from V to some Y has changed */

19 /* V has sent a new value for its min DV(Y,w) */

20 /* call this received new value is "newval" */

21 for the single destination y: D (Y,V) = c(X,V) + newval

22

23 if we have a new min D (Y,w)for any destination Y

24 send new value of min D (Y,w) to all neighbors

25

26 forever

X

X

w

X

X

w

X

w

example

2

1

7

Y

Z

X

X

c(X,Y) + min {D (Z,w)}

c(X,Z) + min {D (Y,w)}

D (Y,Z)

D (Z,Y)

=

=

w

w

=

=

7+1 = 8

2+1 = 3

X

Z

Y

Example
link cost changes

X

Z

Y

Link Cost Changes
  • node detects local link cost change
  • updates distance table (line 15)
  • if cost change in least cost path, notify neighbors (lines 23,24)

1

4

1

50

algorithm

terminates

“good

news

travels

fast”

link cost changes1

X

Z

Y

Link Cost Changes
  • good news travels fast
  • bad news travels slow - “count to infinity” problem!

60

4

1

50

algorithm

continues

on!

poisoned reverse

X

Z

Y

Poisoned Reverse

If Z routes through Y to get to X

  • Z tells Y its (Z’s) distance to X is infinite (so Y won’t route to X via Z)
  • will this completely solve count to infinity problem?

60

4

1

50

algorithm

terminates

comparison of ls and dv
Comparison of LS and DV
  • Message Complexity
  • Speed of Convergence
  • Robustness
hierarchical routing
Hierarchical Routing
  • So far – all routers are equal, network is flat
    • Why is this view a problem?
hierarchical routing1
Hierarchical Routing
  • Aggregate routers into autonomous systems ASs
  • Intra-AS routing
  • Each AS has a gateway
    • responsible for inter-AS routing
intra as and inter as routing

c

b

b

c

a

A.c

A.a

C.b

B.a

Intra-AS and Inter-AS routing
  • Gateways:
    • perform inter-AS routing amongst themselves
    • perform intra-AS routers with other routers in their AS

b

a

a

C

B

d

A

network layer

inter-AS, intra-AS routing in

gateway A.c

link layer

physical layer

intra as and inter as routing1

Inter-AS

routing

between

A and B

b

c

a

a

C

b

B

b

c

a

d

Host

h1

A

A.a

A.c

C.b

B.a

Intra-AS and Inter-AS routing

Host

h2

Intra-AS routing

within AS B

Intra-AS routing

within AS A

  • We’ll examine specific inter-AS and intra-AS Internet routing protocols shortly
assignments1
Assignments
  • Continue work on Project 2
  • Finish reading chapter 4 for next week – we will not talk about 4.6 in class
network layer1

ICMP protocol

  • error reporting
  • router “signaling”
  • IP protocol
  • addressing conventions
  • datagram format
  • packet handling conventions
  • Routing protocols
  • path selection
  • RIP, OSPF, BGP

forwarding

table

Network Layer

Transport layer: TCP, UDP

Network

layer

Link layer

physical layer

ip addressing
IP address

32-bit identifier for host, router interface

interface – connection between host/router and physical link

router’s typically have multiple interfaces

host may have multiple interfaces

IP addresses associated with each interface

223.1.1.2

223.1.2.1

223.1.3.27

223.1.3.1

223.1.3.2

223.1.2.2

IP Addressing

223.1.1.1

223.1.2.9

223.1.1.4

223.1.1.3

223.1.1.1 = 11011111 00000001 00000001 00000001

223

1

1

1

ip addressing1
IP address:

network part (high order bits)

host part (low order bits)

What’s a network ? (from IP address perspective)

device interfaces with same network part of IP address

can physically reach each other without intervening router

IP Addressing

223.1.1.1

223.1.2.1

223.1.1.2

223.1.2.9

223.1.1.4

223.1.2.2

223.1.1.3

223.1.3.27

LAN

223.1.3.2

223.1.3.1

network consisting of 3 IP networks

(for IP addresses starting with 223,

first 24 bits are network address)

classful addressing

multicast address

1110

network

host

110

network

10

host

Classful Addressing

class

1.0.0.0 to

127.255.255.255

A

network

0

host

128.0.0.0 to

191.255.255.255

B

192.0.0.0 to

223.255.255.255

C

224.0.0.0 to

239.255.255.255

D

32 bits

slide36

host

part

network

part

11001000 0001011100010000 00000000

200.23.16.0/23

CIDR
  • Classful addressing
    • inefficient use of address space, address space exhaustion
    • example?
  • CIDR: Classless InterDomain Routing
    • network portion of address of arbitrary length
    • address format: a.b.c.d/x, where x is # bits in network portion of address
how do i get an ip address
How do I get an IP address?
  • Two options – what are they?
  • Which is used when and why?
what about the network part
What about the network part?

ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20

Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23

Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23

Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23

... ….. …. ….

Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

route aggregation

200.23.16.0/23

200.23.18.0/23

200.23.30.0/23

200.23.20.0/23

.

.

.

.

.

.

Route Aggregation

Hierarchical addressing allows efficient advertisement of routing

information:

Organization 0

Organization 1

“Send me anything

with addresses

beginning

200.23.16.0/20”

Organization 2

Fly-By-Night-ISP

Internet

Organization 7

“Send me anything

with addresses

beginning

199.31.0.0/16”

ISPs-R-Us

constructing a packet

source

IP addr

misc

fields

dest

IP addr

data

Constructing a Packet
determining the next hop

E

A

B

223.1.1.1

223.1.2.1

223.1.1.2

223.1.2.9

223.1.1.4

223.1.2.2

223.1.1.3

223.1.3.27

Dest. Net. next router Nhops

223.1.1 1

223.1.3.2

223.1.3.1

223.1.2 223.1.1.4 2

223.1.3 223.1.1.4 2

Determining the Next Hop

misc

fields

data

223.1.1.1

223.1.1.3

determining the next hop1

E

A

B

223.1.1.1

223.1.2.1

223.1.1.2

223.1.2.9

223.1.1.4

223.1.2.2

223.1.1.3

223.1.3.27

Dest. Net. next router Nhops

223.1.1 1

223.1.3.2

223.1.3.1

223.1.2 223.1.1.4 2

223.1.3 223.1.1.4 2

Determining the Next Hop

misc

fields

data

223.1.1.1

223.1.2.3

router forwarding table

Dest. Net router Nhops interface

E

A

B

223.1.1 - 1 223.1.1.4

223.1.2 - 1 223.1.2.9

223.1.3 - 1 223.1.3.27

223.1.1.1

223.1.2.1

223.1.1.2

223.1.2.9

223.1.1.4

223.1.2.2

223.1.1.3

223.1.3.27

223.1.3.2

223.1.3.1

Router Forwarding Table

misc

fields

data

223.1.1.1

223.1.2.3

datagram format
Datagram Format

32 bits

type of

service

head.

len

ver

length

fragment

offset

flgs

16-bit identifier

upper

layer

time to

live

Internet

checksum

32 bit source IP address

32 bit destination IP address

Options (if any)

data

(variable length,

typically a TCP

or UDP segment)

ip fragmentation reassembly
network links have MTU (max.transfer size) - largest possible link-level frame

different link types, different MTUs

large IP datagram divided (“fragmented”) within net

one datagram becomes several datagrams

“reassembled” only at final destination

IP header bits used to identify, order related fragments

IP Fragmentation & Reassembly

fragmentation:

in: one large datagram

out: 3 smaller datagrams

reassembly

ip fragmentation and reassembly

length

=1500

length

=1500

length

=4000

length

=1040

ID

=x

ID

=x

ID

=x

ID

=x

fragflag

=0

fragflag

=1

fragflag

=0

fragflag

=1

offset

=0

offset

=0

offset

=1480

offset

=2960

One large datagram becomes

several smaller datagrams

IP Fragmentation and Reassembly

Example

  • 4000 byte datagram
  • MTU = 1500 bytes
icmp internet control message protocol
used by hosts, routers, gateways to communication network-level information

error reporting: unreachable host, network, port, protocol

echo request/reply (used by ping)

network-layer “above” IP:

ICMP msgs carried in IP datagrams

ICMP message: type, code plus first 8 bytes of IP datagram causing error

ICMP: Internet Control Message Protocol

TypeCodedescription

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

dhcp dynamic host configuration protocol
DHCP: Dynamic Host Configuration Protocol
  • Goal: allow host to dynamically obtain its IP address from network server when it joins network
    • Can renew its lease on address in use
    • Allows reuse of addresses (only hold address while connected an “on”
    • Support for mobile users who want to join network (more shortly)
  • DHCP overview:
    • host broadcasts “DHCP discover” msg
    • DHCP server responds with “DHCP offer” msg
    • host requests IP address: “DHCP request” msg
    • DHCP server sends address: “DHCP ack” msg
dhcp client server scenario

E

B

A

DHCP client-server scenario

223.1.2.1

DHCP

223.1.1.1

server

223.1.1.2

223.1.2.9

223.1.1.4

223.1.2.2

arriving DHCP

client needs

address in this

network

223.1.1.3

223.1.3.27

223.1.3.2

223.1.3.1

dhcp client server scenario1

DHCP discover

src : 0.0.0.0, 68

dest.: 255.255.255.255,67

yiaddr: 0.0.0.0

transaction ID: 654

DHCP client-server scenario

arriving

client

DHCP server: 223.1.2.5

DHCP offer

src: 223.1.2.5, 67

dest: 255.255.255.255, 68

yiaddrr: 223.1.2.4

transaction ID: 654

Lifetime: 3600 secs

DHCP request

src: 0.0.0.0, 68

dest:: 255.255.255.255, 67

yiaddrr: 223.1.2.4

transaction ID: 655

Lifetime: 3600 secs

time

DHCP ACK

src: 223.1.2.5, 67

dest: 255.255.255.255, 68

yiaddrr: 223.1.2.4

transaction ID: 655

Lifetime: 3600 secs

nat network address translation
NAT: Network Address Translation

rest of

Internet

local network

(e.g., home network)

10.0.0/24

10.0.0.1

10.0.0.4

10.0.0.2

138.76.29.7

10.0.0.3

Datagrams with source or

destination in this network

have 10.0.0/24 address for

source, destination (as usual)

All datagrams leaving local

network have same single source NAT IP address: 138.76.29.7,

different source port numbers

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

3

1

2

4

S: 10.0.0.1, 3345

D: 128.119.40.186, 80

S: 138.76.29.7, 5001

D: 128.119.40.186, 80

1: host 10.0.0.1

sends datagram to

128.119.40, 80

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: 10.0.0.1, 3345

S: 128.119.40.186, 80

D: 138.76.29.7, 5001

NAT

NAT translation table

WAN side addr LAN side addr

138.76.29.7, 5001 10.0.0.1, 3345

…… ……

10.0.0.1

10.0.0.4

10.0.0.2

138.76.29.7

10.0.0.3

4: NAT router

changes datagram

dest addr from

138.76.29.7, 5001 to 10.0.0.1, 3345

3: Reply arrives

dest. address:

138.76.29.7, 5001

slide54
NAT
  • 16-bit port-number field:
    • 60,000 simultaneous connections with a single LAN-side address!
  • NAT is controversial:
    • routers should only process up to layer 3
    • violates end-to-end argument
      • NAT possibility must be taken into account by app designers, e.g., P2P applications
    • address shortage should instead be solved by IPv6