Network Layer Goals: Overview: last time understand principles - - PDF document

network layer
SMART_READER_LITE
LIVE PREVIEW

Network Layer Goals: Overview: last time understand principles - - PDF document

Network Layer Goals: Overview: last time understand principles network layer services behind network layer o IP addressing services: o routing principle: path o o routing (path selection selection) today o dealing with scale IP


slide-1
SLIDE 1

1

3/10 Network 2 1 Datakommunikation & Internet, Anders Broberg, UmU

Network Layer

Goals:

¸ understand principles

behind network layer services:

  • routing (path

selection)

  • dealing with scale
  • how a router works
  • advanced topics: IPv6,

multicast ¸ instantiation and

implementation in the Internet Overview:

¸ last time

  • network layer services
  • IP addressing
  • routing principle: path

selection ¸ today

  • IP
  • hierarchical routing
  • Internet routing protocols

reliable transfer

ß intra-domain ß inter-domain

  • what’s inside a router?
  • IPv6
  • multicast routing
  • Mobility

3/10 Network 2 2 Datakommunikation & Internet, Anders Broberg, UmU

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

3/10 Network 2 3 Datakommunikation & Internet, Anders Broberg, UmU

Distance Vector - Link State

¸ Link State

  • Alla pratar med alla
  • Berättar bara om sina egna länkar

¸ Distance Vector

  • Varje nod pratar endast med närmsta granne
  • Berättar allt den vet
slide-2
SLIDE 2

2

3/10 Network 2 4 Datakommunikation & Internet, Anders Broberg, UmU

Distance Vector Routing: overview

Iterative, asynchronous:

each local iteration caused by:

¸ local link cost change ¸ message from neighbor: its

least cost path change from neighbor Distributed:

¸ each node notifies

neighbors only when its least cost path to any destination changes

  • neighbors then notify

their neighbors if necessary

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

Each node:

3/10 Network 2 5 Datakommunikation & Internet, Anders Broberg, UmU

Distance Vector Algorithm:

1 Initialization: 2 for all adjacent nodes v: 3 D (*,v) = infty /* 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

At all nodes, X:

3/10 Network 2 6 Datakommunikation & Internet, Anders Broberg, UmU

Distance Vector Algorithm (cont.):

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 "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

w X X X X X w w

slide-3
SLIDE 3

3

3/10 Network 2 7 Datakommunikation & Internet, Anders Broberg, UmU

Distance Vector: link cost changes

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) X Z

1 4 50

Y

1

algorithm terminates

“good news travels fast”

3/10 Network 2 8 Datakommunikation & Internet, Anders Broberg, UmU

Distance Vector: link cost changes

Link cost changes:

¸

good news travels fast

¸

bad news travels slow - “count to infinity” problem!

¸

Line 21 (D (Y,V) = c(X,V) + newval )

X Z

1 4 50

Y

60

algorithm continues

  • n!

3/10 Network 2 9 Datakommunikation & Internet, Anders Broberg, UmU

Distance Vector: 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) X Z

1 4 50

Y

60

algorithm terminates

slide-4
SLIDE 4

4

3/10 Network 2 10 Datakommunikation & Internet, Anders Broberg, UmU

Comparison of LS and DV algorithms

Message complexity

¸ LS: with n nodes, E links,

O(nE) msgs sent each

¸ DV: exchange between

neighbors only

  • convergence time varies

Speed of Convergence

¸ LS: O(n**2) algorithm

requires O(nE) msgs

  • may have oscillations

¸ DV: convergence time varies

  • may be routing loops
  • count-to-infinity problem

Robustness: what happens if router malfunctions? LS:

  • node can advertise incorrect

link cost

  • each node computes only its
  • wn table

DV:

  • DV node can advertise

incorrect path cost

  • each node’s table used by
  • thers

ß error propagate thru network

3/10 Network 2 11 Datakommunikation & Internet, Anders Broberg, UmU

Hierarchical Routing

scale: with 200 million destinations:

¸ can’t store all dest’s in

routing tables!

¸ routing table exchange

would swamp links!

administrative autonomy

¸ internet = network of

networks

¸ each network admin may

want to control routing in its own network Our routing study thus far - idealization

¸ all routers identical ¸ network “flat”

… not true in practice

3/10 Network 2 12 Datakommunikation & Internet, Anders Broberg, UmU

Hierarchical Routing

¸ aggregate routers into

regions, “autonomous systems” (AS)

¸ routers in same AS

run same routing protocol

  • “intra-AS” routing

protocol

  • routers in different AS

can run different intra- AS routing protocol

¸ special routers in AS ¸ run intra-AS routing

protocol with all other routers in AS

¸ also responsible for

routing to destinations

  • utside AS
  • run inter-AS routing

protocol with other gateway routers

gateway routers

slide-5
SLIDE 5

5

3/10 Network 2 13 Datakommunikation & Internet, Anders Broberg, UmU

Intra-AS and Inter-AS routing

Gateways:

  • perform inter-AS

routing amongst themselves

  • perform intra-AS

routers with other routers in their AS

inter-AS, intra-AS routing in gateway A.c network layer link layer physical layer

a b b a a C A B d A.a A.c C.b B.a c b c

3/10 Network 2 14 Datakommunikation & Internet, Anders Broberg, UmU

Intra-AS and Inter-AS routing

Host h2 a b b a a C A B d c A.a A.c C.b B.a c b Host h1 Intra-AS routing within AS A Inter-AS routing between A and B Intra-AS routing within AS B

3/10 Network 2 15 Datakommunikation & Internet, Anders Broberg, UmU

Routing in the Internet

¸ The Global Internet consists of Autonomous Systems

(AS) interconnected with each other:

  • Stub AS: small corporation
  • Multihomed AS: large corporation (no transit)
  • Transit AS: provider

¸ Two-level routing:

  • Intra-AS: administrator is responsible for choice
  • Inter-AS: unique standard
slide-6
SLIDE 6

6

3/10 Network 2 16 Datakommunikation & Internet, Anders Broberg, UmU

Intra-AS Routing

¸ Also known as Interior Gateway Protocols (IGP) ¸ Most common IGPs:

  • RIP: Routing Information Protocol
  • OSPF: Open Shortest Path First
  • IGRP: Interior Gateway Routing Protocol (Cisco

propr.)

3/10 Network 2 17 Datakommunikation & Internet, Anders Broberg, UmU

RIP ( Routing Information Protocol)

¸ Distance vector algorithm ¸ Included in BSD-UNIX Distribution in 1982 ¸ Distance metric: # of hops (max = 15 hops)

  • Can you guess why?

¸ Distance vectors: exchanged every 30 sec via

Response Message (also called advertisement)

¸ Each advertisement: route to up to 25

destination nets

¸ RIP v1 RFC 1058 ¸ RIP v2 RFC 1723

3/10 Network 2 18 Datakommunikation & Internet, Anders Broberg, UmU

RIP: Link Failure and Recovery

If no advertisement heard after 180 sec --> neighbor/link declared dead

  • routes via neighbor invalidated
  • new advertisements sent to neighbors
  • neighbors in turn send out new advertisements (if

tables changed)

  • link failure info quickly propagates to entire net
  • poison reverse used to prevent ping-pong loops

(infinite distance = 16 hops)

slide-7
SLIDE 7

7

3/10 Network 2 19 Datakommunikation & Internet, Anders Broberg, UmU

RIP Table processing

¸ RIP routing tables managed by application-level

process called route-d (daemon)

¸ advertisements sent in UDP packets, periodically

repeated (port 520)

3/10 Network 2 20 Datakommunikation & Internet, Anders Broberg, UmU

RIP Table example (continued) Router: giroflee.eurocom.fr

¸ Three attached class C networks (LANs) ¸ Router only knows routes to attached LANs ¸ Default router used to “go up” ¸ Route multicast address: 224.0.0.0 ¸ Loopback interface (for debugging)

Destination Gateway Flags Ref Use Interface

  • ------------------- -------------------- ----- ----- ------ ---------

127.0.0.1 127.0.0.1 UH 0 26492 lo0 192.168.2. 192.168.2.5 U 2 13 fa0 193.55.114. 193.55.114.6 U 3 58503 le0 192.168.3. 192.168.3.5 U 2 25 qaa0 224.0.0.0 193.55.114.6 U 3 0 le0 default 193.55.114.129 UG 0 143454 3/10 Network 2 21 Datakommunikation & Internet, Anders Broberg, UmU

OSPF (Open Shortest Path First)

¸ “open”: publicly available, v2 RFC 2178 ¸ Uses Link State algorithm

  • LS packet dissemination
  • Topology map at each node
  • Route computation using Dijkstra’s algorithm

¸ OSPF advertisement carries one entry per neighbor

router

¸ Advertisements disseminated to entire AS (via

flooding)

slide-8
SLIDE 8

8

3/10 Network 2 22 Datakommunikation & Internet, Anders Broberg, UmU

OSPF “advanced” features (not in RIP)

¸ Security: all OSPF messages authenticated

(to prevent malicious intrusion); TCP connections used

¸ Multiple same-cost paths allowed (only one

path in RIP)

¸ Integrated uni- and multicast support:

  • Multicast OSPF (MOSPF) uses same topology data

base as OSPF ¸ Hierarchical OSPF in large domains.

3/10 Network 2 23 Datakommunikation & Internet, Anders Broberg, UmU

Hierarchical OSPF

¸ Two-level hierarchy:

local area, backbone

  • Link-state

advertisements only in area

  • each nodes has

detailed area topology; only know direction (shortest path) to nets in other areas.

r

Area border routers: “summarize” distances to nets in

  • wn area, advertise to other Area

Border routers.

r

Backbone routers: run OSPF routing limited to backbone.

r

Boundary routers: connect to

  • ther ASs.

3/10 Network 2 24 Datakommunikation & Internet, Anders Broberg, UmU

IGRP (Interior Gateway Routing Protocol)

¸ CISCO proprietary; successor of RIP (mid 80s) ¸ Distance Vector, like RIP ¸ several cost metrics (delay, bandwidth, reliability,

load etc)

¸ uses TCP to exchange routing updates ¸ Loop-free routing via Distributed Updating Alg.

(DUAL) based on diffused computation

slide-9
SLIDE 9

9

3/10 Network 2 25 Datakommunikation & Internet, Anders Broberg, UmU

Internet AS Hierarchy

Intra-AS border (exterior gateway) routers Inter-AS interior (gateway) routers

3/10 Network 2 26 Datakommunikation & Internet, Anders Broberg, UmU

Internet inter-AS routing: BGP

¸ BGP (Border Gateway Protocol): the de facto

standard

¸ Path Vector protocol:

  • similar to Distance Vector protocol
  • each Border Gateway broadcast to neighbors

(peers) entire path (I.e, sequence of ASs) to destination

  • E.g., Gateway X may send its path to dest. Z:

Path (X,Z) = X,Y1,Y2,Y3,…,Z

3/10 Network 2 27 Datakommunikation & Internet, Anders Broberg, UmU

Internet inter-AS routing: BGP

¸ BGP messages exchanged using TCP. ¸ BGP messages:

  • OPEN: opens TCP connection to peer and

authenticates sender

  • UPDATE: advertises new path (or withdraws old)
  • KEEPALIVE keeps connection alive in absence of

UPDATES; also ACKs OPEN request

  • NOTIFICATION: reports errors in previous msg;

also used to close connection

slide-10
SLIDE 10

10

3/10 Network 2 28 Datakommunikation & Internet, Anders Broberg, UmU

Why different Intra- and Inter-AS routing ? Policy:

¸ Intra-AS: single admin, so no policy decisions needed ¸ Inter-AS: admin wants control over how its traffic

routed, who routes through its net.

Scale:

¸ hierarchical routing saves table size, reduced update

traffic Performance:

¸ Intra-AS: can focus on performance ¸ Inter-AS: policy may dominate over performance

3/10 Network 2 29 Datakommunikation & Internet, Anders Broberg, UmU

Forwarding algortim

¸ Om direkt kopplad till destinationens

nätverk - skicka direkt till destination

¸ annars om destinationen finns i forwarding

tabellen - skicka till NextHop routern

¸ annars -skicka till default routern

R2 R1 H4 H5 H3 H2 H1 Network 2 (Ethernet) Network 1 (Ethernet) H6 Network 3 (FDDI) Network 4 (point-to-point) H7 R3 H8

NetworkNum NextHop 1 2 3 4 R3 R1 interface 1 interface 0 Forwarding tabell R2 3/10 Network 2 30 Datakommunikation & Internet, Anders Broberg, UmU

The Internet Network layer

routing table

Host, router network layer functions:

Routing protocols

  • path selection
  • RIP, OSPF, BGP

IP protocol

  • addressing conventions
  • datagram format
  • packet handling conventions

ICMP protocol

  • error reporting
  • router “signaling”

Transport layer: TCP, UDP Link layer physical layer

Network layer

slide-11
SLIDE 11

11

3/10 Network 2 31 Datakommunikation & Internet, Anders Broberg, UmU

IP datagram format

ver length 32 bits

data (variable length, typically a TCP

  • r UDP segment)

16-bit identifier Internet checksum time to live 32 bit source IP address IP protocol version number header length (bytes) max number remaining hops (decremented at each router) for fragmentation/ reassembly total datagram length (bytes) upper layer protocol to deliver payload to head. len type of service “type” of data flgs fragment

  • ffset

upper layer 32 bit destination IP address Options (if any) E.g. timestamp, record route taken, specify list of routers to visit.

how much overhead with TCP?

¸ 20 bytes of TCP ¸ 20 bytes of IP ¸ = 40 bytes + app

layer overhead

3/10 Network 2 32 Datakommunikation & Internet, Anders Broberg, UmU

IP Fragmentation & Reassembly

¸

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

  • different link types, different

MTUs ¸

Two Approaches

  • “Small enough”
  • large IP datagram divided

(“fragmented”) within net ß

  • ne datagram becomes several

datagrams ß “reassembled” only at final destination ß IP header bits used to identify,

  • rder related fragments

ß Same ID for all fragments ß All fragments are cancelled if one fragment is lost ß Each fragment is complete IP- datagram ß Designed for “multi- fragmentation”

fragmentation: in: one large datagram

  • ut: 3 smaller datagrams

reassembly

3/10 Network 2 33 Datakommunikation & Internet, Anders Broberg, UmU

IP Fragmentation and Reassembly

ID =x

  • ffset

=0 fragflag =0 length =4000 ID =x

  • ffset

=0 fragflag =1 length =1500 ID =x

  • ffset

=1480 fragflag =1 length =1500 ID =x

  • ffset

=2960 fragflag =0 length =1040 One large datagram becomes several smaller datagrams

Example

¸ 4000 byte

datagram

¸ MTU = 1500 bytes

slide-12
SLIDE 12

12

3/10 Network 2 34 Datakommunikation & Internet, Anders Broberg, UmU

ICMP: Internet Control Message Protocol

¸ used by hosts, routers,

gateways to communicate 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

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

3/10 Network 2 35 Datakommunikation & Internet, Anders Broberg, UmU

Hur får man routing att skala mer?

¸ Adressanvändning

  • Adresser får inte ta slut
  • Klass C med 2 hosts (2/255 = 0.78%)
  • Klass B med 256 hosts (256/65535 = 0.39%)

¸ Skalabilitet för routing

  • Routingtabeller skalar ej
  • IGP skalar ej

3/10 Network 2 36 Datakommunikation & Internet, Anders Broberg, UmU

Subnetting

¸ Subnät ny nivå till adress/routing hierarkin ¸ Subnätmasken definierar variabel del av

hostdelen => subnät nummer

¸ Subnät syns bara i aktuellt nätverk

Network number Host number Class B address Subnet mask (255.255.255.0) Subnetted address 111111111111111111111111 00000000 Network number Host ID Subnet ID

slide-13
SLIDE 13

13

3/10 Network 2 37 Datakommunikation & Internet, Anders Broberg, UmU

Subnät exempel

Forwarding table at router R1 Subnet Number Subnet Mask Next Hop 128.96.34.0 255.255.255.128 interface 0 128.96.34.128 255.255.255.128 interface 1 128.96.33.0 255.255.255.0 R2 Subnet mask: 255.255.255.128 Subnet number: 128.96.34.0 128.96.34.15 128.96.34.1 H1 R1 128.96.34.130 Subnet mask: 255.255.255.128 Subnet number: 128.96.34.128 128.96.34.129 128.96.34.139 R2 H2 128.96.33.1 128.96.33.14 Subnet mask: 255.255.255.0 Subnet number: 128.96.33.0 H3 3/10 Network 2 38 Datakommunikation & Internet, Anders Broberg, UmU

Forwarding algoritm

D = destination IP address for each entry (SubnetNum, SubnetMask, NextHop) D1 = SubnetMask & D if D1 = SubnetNum if NextHop is an interface deliver datagram directly to D else deliver datagram to NextHop ¸ Använd default router om inget matchar ¸ Möjligt att ha flera subnät på ett fysiskt nätverk ¸ Subnät syns ej ifrån resten av Internet

3/10 Network 2 39 Datakommunikation & Internet, Anders Broberg, UmU

Supernetting

¸ Om alla som vill ha klass B adresser får det blir

det dåligt utnyttjande

¸ Om alla istället får klass C adresser ökar

routingtabellernas storlek

¸ Lösning: Supernetting - CIDR

  • Classless InterDomain Routing

Adressanvändning

  • Adresser får inte ta slut
  • Klass C med 2 hosts (2/255 = 0.78%)
  • Klass B med 256 hosts (256/65535 = 0.39%)
slide-14
SLIDE 14

14

3/10 Network 2 40 Datakommunikation & Internet, Anders Broberg, UmU

Classless InterDomain Routing

¸ Dela ut block av kontinuerliga

nätverksnummer till närliggande nätverk

¸ Representera block med

  • (first_network_address, count), 130.239.40/21

¸ Begränsa storlekar till potens av 2 ¸ Alla routrar måste förstå CIDR ¸ Möjligt att slå ihop adresser rekursivet ¸ Längsta möjliga match i router

3/10 Network 2 41 Datakommunikation & Internet, Anders Broberg, UmU

Hierarchical addressing: more specific routes

ISPs-R-Us has a more specific route to Organization 1

“Send me anything with addresses beginning 200.23.16.0/20”

200.23.16.0/23 200.23.18.0/23 200.23.30.0/23

Fly-By-Night-ISP Organization 0 Organization 7 Internet Organization 1 ISPs-R-Us “Send me anything with addresses beginning 199.31.0.0/16

  • r 200.23.18.0/23”

200.23.20.0/23

Organization 2

. . . . . .

3/10 Network 2 42 Datakommunikation & Internet, Anders Broberg, UmU

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 Static or dynamic IP-address 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
slide-15
SLIDE 15

15

3/10 Network 2 43 Datakommunikation & Internet, Anders Broberg, UmU

DHCP client-server scenario

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

A B E

DHCP server arriving DHCP client needs address in this network

3/10 Network 2 44 Datakommunikation & Internet, Anders Broberg, UmU

DHCP client-server scenario

DHCP server: 223.1.2.5 arriving client

time DHCP discover src : 0.0.0.0, 68 dest.: 255.255.255.255,67 yiaddr: 0.0.0.0 transaction ID: 654 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 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

3/10 Network 2 45 Datakommunikation & Internet, Anders Broberg, UmU

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 rest of Internet

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

slide-16
SLIDE 16

16

3/10 Network 2 46 Datakommunikation & Internet, Anders Broberg, UmU

NAT: Network Address Translation

¸ Motivation: local network uses just one IP address as

far as outside word is concerned:

  • no need to be allocated range of addresses from ISP:
  • just one IP address is used for all devices
  • can change addresses of devices in local network

without notifying outside world

  • can change ISP without changing addresses of

devices in local network

  • devices inside local net not explicitly addressable,

visible by outside world (a security plus).

3/10 Network 2 47 Datakommunikation & Internet, Anders Broberg, UmU

NAT: Network Address Translation

Implementation: NAT router:

  • 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

  • Static or Dynamic NAT - possible redirect based on IP and

port to a local host

  • Port mapping - possible redirect based on IP and port to a local

host

3/10 Network 2 48 Datakommunikation & Internet, Anders Broberg, UmU

NAT: Network Address Translation

10.0.0.1 10.0.0.2 10.0.0.3

S: 10.0.0.1, 3345 D: 128.119.40.186, 80

1

10.0.0.4 138.76.29.7

1: host 10.0.0.1 sends datagram to 128.119.40, 80 NAT translation table WAN side addr LAN side addr 138.76.29.7, 5001 10.0.0.1, 3345 …… ……

S: 128.119.40.186, 80 D: 10.0.0.1, 3345

4

S: 138.76.29.7, 5001 D: 128.119.40.186, 80

2 2: NAT router changes datagram source addr from 10.0.0.1, 3345 to 138.76.29.7, 5001, updates table

S: 128.119.40.186, 80 D: 138.76.29.7, 5001

3 3: Reply arrives

  • dest. address:

138.76.29.7, 5001 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345

slide-17
SLIDE 17

17

3/10 Network 2 49 Datakommunikation & Internet, Anders Broberg, UmU

NAT: Network Address Translation

¸ 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, eg, P2P applications

  • address shortage should instead be solved by

IPv6

3/10 Network 2 50 Datakommunikation & Internet, Anders Broberg, UmU

Skalbara nätverk

¸ Interdomän routing för att hitta rätt AS

  • Färre AS än nätverk

¸ Intradomän routing för att hitta rätt nätverk i AS

  • Färre nätverk i en domän än i hela Internet

¸ CIDR -supernetting

  • Kortare routingtabellen
  • Spar adresser

ß Dela ut block av kontinuerliga nätverksnummer istället för adresser för större nätverksklass ¸ Subnetting -

  • Nya fysiska nätverk kan läggas till utan att använda nya Klass B

eller C nätverksadresser

  • Subnät syns ej utåt

¸ NAT

  • Privata ip-nummer I lokala nät (SOHO)

¸ DHCP ¸ Skalabilitet viktigare än optimal väg

3/10 Network 2 51 Datakommunikation & Internet, Anders Broberg, UmU

Router Architecture Overview

Two key router functions:

¸ run routing algorithms/protocol (RIP, OSPF, BGP) ¸ switching datagrams from incoming to outgoing link

slide-18
SLIDE 18

18

3/10 Network 2 52 Datakommunikation & Internet, Anders Broberg, UmU

IPv6

¸ Initial motivation: 32-bit address space

completely allocated by 2008 or 2018 or …

¸ Additional motivation:

  • header format helps speed processing/forwarding
  • header changes to facilitate QoS
  • new “anycast” address: route to “best” of several

replicated servers ¸ IPv6 datagram format:

  • 128-bit address space
  • fixed-length 40 byte header
  • no fragmentation allowed

3/10 Network 2 53 Datakommunikation & Internet, Anders Broberg, UmU

Transition From IPv4 To IPv6

¸ Not all routers can be upgraded

simultaneous

  • no “flag days”
  • How will the network operate with mixed IPv4

and IPv6 routers? ¸ Two proposed approaches:

  • Dual Stack: some routers with dual stack (v6,

v4) can “translate” between formats

  • Tunneling: IPv6 carried as payload in IPv4

datagram among IPv4 routers

3/10 Network 2 54 Datakommunikation & Internet, Anders Broberg, UmU

Dual Stack Approach

slide-19
SLIDE 19

19

3/10 Network 2 55 Datakommunikation & Internet, Anders Broberg, UmU

Tunneling

IPv6 inside IPv4 where needed

3/10 Network 2 56 Datakommunikation & Internet, Anders Broberg, UmU

Multicast routing

¸ Unicast

  • Enkelt, men

bandbreddskrävande ¸ Multicast

  • Mindre antal paket,

men kräver support från nätverkslagret

3/10 Network 2 57 Datakommunikation & Internet, Anders Broberg, UmU

Multicast: one sender to many receivers

¸ Multicast: act of sending datagram to multiple

receivers with single “transmit” operation

  • analogy: one teacher to many students

¸ Question: how to achieve multicast

Multicast via unicast

¸ source sends N

unicast datagrams,

  • ne addressed to

each of N receivers

multicast receiver (red) not a multicast receiver (red) routers forward unicast datagrams

slide-20
SLIDE 20

20

3/10 Network 2 58 Datakommunikation & Internet, Anders Broberg, UmU

Multicast: one sender to many receivers

¸ Multicast: act of sending datagram to multiple

receivers with single “transmit” operation

  • analogy: one teacher to many students

¸ Question: how to achieve multicast

Network multicast

¸ Router actively

participate in multicast, making copies of packets as needed and forwarding towards multicast receivers

Multicast routers (red) duplicate and forward multicast datagrams

3/10 Network 2 59 Datakommunikation & Internet, Anders Broberg, UmU

Multicast: one sender to many receivers

¸ Multicast: act of sending datagram to multiple

receivers with single “transmit” operation

  • analogy: one teacher to many students

¸ Question: how to achieve multicast

Application-layer multicast

¸ end systems involved in

multicast copy and forward unicast datagrams among themselves

3/10 Network 2 60 Datakommunikation & Internet, Anders Broberg, UmU

Internet Multicast Service Model

multicast group concept: use of indirection

  • hosts addresses IP datagram to multicast group
  • routers forward multicast datagrams to hosts that

have “joined” that multicast group

128.119.40.186 128.59.16.12 128.34.108.63 128.34.108.60

multicast group 226.17.30.197

slide-21
SLIDE 21

21

3/10 Network 2 61 Datakommunikation & Internet, Anders Broberg, UmU

Multicast groups

q class D Internet addresses reserved for multicast: q host group semantics:

  • anyone can “join” (receive) multicast group
  • anyone can send to multicast group
  • no network-layer identification to hosts of members

q needed: infrastructure to deliver mcast-addressed datagrams to all hosts that have joined that multicast group

3/10 Network 2 62 Datakommunikation & Internet, Anders Broberg, UmU

Joining a mcast group: two-step process

¸ local: host informs local mcast router of desire to join group:

IGMP (Internet Group Management Protocol)

¸ wide area: local router interacts with other routers to receive

mcast datagram flow

  • many protocols (e.g., DVMRP, MOSPF, PIM)

IGMP IGMP IGMP wide-area multicast routing

3/10 Network 2 63 Datakommunikation & Internet, Anders Broberg, UmU

Multicast Routing: Problem Statement

¸ Goal: find a tree (or trees) connecting routers having

local mcast group members

  • tree: not all paths between routers used
  • source-based: different tree from each sender to rcvrs
  • shared-tree: same tree used by all group members

Shared tree Source-based trees

slide-22
SLIDE 22

22

3/10 Network 2 64 Datakommunikation & Internet, Anders Broberg, UmU

Approaches for building mcast trees

Approaches:

¸ source-based tree: one tree per source

  • shortest path trees
  • reverse path forwarding

¸ group-shared tree: group uses one tree

  • minimal spanning (Steiner)
  • center-based trees

…we first look at basic approaches, then specific protocols adopting these approaches

3/10 Network 2 65 Datakommunikation & Internet, Anders Broberg, UmU

Shortest Path Tree

¸ mcast forwarding tree: tree of shortest

path routes from source to all receivers

  • Dijkstra’s algorithm

R1 R2 R3 R4 R5 R6 R7 2 1 6 3 4 5 i router with attached group member router with no attached group member link used for forwarding, i indicates order link added by algorithm LEGEND S: source

3/10 Network 2 66 Datakommunikation & Internet, Anders Broberg, UmU

Reverse Path Forwarding

if (mcast datagram received on incoming link on shortest path back to sender) then flood datagram onto all outgoing links else ignore datagram

q rely on router’s knowledge of unicast

shortest path from it to sender

q each router has simple forwarding behavior:

slide-23
SLIDE 23

23

3/10 Network 2 67 Datakommunikation & Internet, Anders Broberg, UmU

Reverse Path Forwarding: example

  • result is a source-specific reverse SPT

– may be a bad choice with asymmetric links

R1 R2 R3 R4 R5 R6 R7 router with attached group member router with no attached group member datagram will be forwarded LEGEND S: source datagram will not be forwarded

3/10 Network 2 68 Datakommunikation & Internet, Anders Broberg, UmU

Reverse Path Forwarding: pruning

¸ forwarding tree contains subtrees with no mcast

group members

  • no need to forward datagrams down subtree
  • “prune” msgs sent upstream by router with no

downstream group members

R1 R2 R3 R4 R5 R6 R7 router with attached group member router with no attached group member prune message LEGEND S: source links with multicast forwarding P P P

3/10 Network 2 69 Datakommunikation & Internet, Anders Broberg, UmU

Shared-Tree: Steiner Tree

¸ Steiner Tree: minimum cost tree

connecting all routers with attached group members

¸ problem is NP-complete ¸ excellent heuristics exists ¸ not used in practice:

  • computational complexity
  • information about entire network needed
  • monolithic: rerun whenever a router needs to

join/leave

slide-24
SLIDE 24

24

3/10 Network 2 70 Datakommunikation & Internet, Anders Broberg, UmU

Center-based trees

¸ single delivery tree shared by all ¸ one router identified as “center” of tree ¸ to join:

  • edge router sends unicast join-msg addressed

to center router

  • join-msg “processed” by intermediate routers

and forwarded towards center

  • join-msg either hits existing tree branch for

this center, or arrives at center

  • path taken by join-msg becomes new branch of

tree for this router

3/10 Network 2 71 Datakommunikation & Internet, Anders Broberg, UmU

Center-based trees: an example

Suppose R6 chosen as center:

R1 R2 R3 R4 R5 R6 R7 router with attached group member router with no attached group member path order in which join messages generated LEGEND 2 1 3 1

3/10 Network 2 72 Datakommunikation & Internet, Anders Broberg, UmU

Multicast routing – i Internet

¸ DVMRP

  • Distance Vector Multicast Routing Protocol
  • Source-based

¸ MOSPF – Multicast OSPF

  • Source-based

¸ CBT – Core Based Trees

  • Group-shared

¸ PIM – Protocol Independent Multicast

  • Dense mode – liknar DVMRP
  • Sparse mode – group-shared
slide-25
SLIDE 25

25

3/10 Network 2 73 Datakommunikation & Internet, Anders Broberg, UmU

What is mobility?

¸ spectrum of mobility, from the network perspective: no mobility high mobility

mobile user, using same access point mobile user, passing through multiple access point while maintaining ongoing connections (like cell

phone)

mobile user, connecting/ disconnecting from network using DHCP.

3/10 Network 2 74 Datakommunikation & Internet, Anders Broberg, UmU

Mobility and the Network Layer

¸ More dimensions of mobility

  • How important is the mobile node’s address

ß Mobile IP or not?

  • What supporting wired infrastructure is

available?

ß AD hoc networking

3/10 Network 2 75 Datakommunikation & Internet, Anders Broberg, UmU

Mobility: Vocabulary

home network: permanent “home” of mobile

(e.g., 128.119.40/24)

Permanent address: address in home network, can always be used to reach mobile

e.g., 128.119.40.186

home agent: entity that will perform mobility functions on behalf of mobile, when mobile is remote

wide area network

correspondent

slide-26
SLIDE 26

26

3/10 Network 2 76 Datakommunikation & Internet, Anders Broberg, UmU

Mobility: more vocabulary

Care-of-address: address in visited network.

(e.g., 79,129.13.2) wide area network

visited network: network in which mobile currently resides (e.g., 79.129.13/24) Permanent address: remains constant (e.g., 128.119.40.186) home agent: entity in visited network that performs mobility functions on behalf

  • f mobile.

correspondent: wants to communicate with mobile

3/10 Network 2 77 Datakommunikation & Internet, Anders Broberg, UmU

How do you contact a mobile friend:

¸ search all phone

books?

¸ call her parents? ¸ expect her to let you

know where he/she is? I wonder where Alice moved to? Consider friend frequently changing addresses, how do you find her?

3/10 Network 2 78 Datakommunikation & Internet, Anders Broberg, UmU

Mobility: approaches

¸ Let routing handle it: routers advertise permanent

address of mobile-nodes-in-residence via usual routing table exchange.

  • routing tables indicate where each mobile located
  • no changes to end-systems

¸ Let end-systems handle it:

  • indirect routing: communication from

correspondent to mobile goes through home agent, then forwarded to remote

  • direct routing: correspondent gets foreign

address of mobile, sends directly to mobile

slide-27
SLIDE 27

27

3/10 Network 2 79 Datakommunikation & Internet, Anders Broberg, UmU

Mobility: approaches

¸ Let routing handle it: routers advertise permanent

address of mobile-nodes-in-residence via usual routing table exchange.

  • routing tables indicate where each mobile located
  • no changes to end-systems

¸ let end-systems handle it:

  • indirect routing: communication from

correspondent to mobile goes through home agent, then forwarded to remote

  • direct routing: correspondent gets foreign

address of mobile, sends directly to mobile

not scalable to millions of mobiles

3/10 Network 2 80 Datakommunikation & Internet, Anders Broberg, UmU

Mobility: registration

End result:

¸ Foreign agent knows about mobile ¸ Home agent knows location of mobile

wide area network

home network visited network

1

mobile contacts foreign agent on entering visited network

2

foreign agent contacts home agent home: “this mobile is resident in my network”

3/10 Network 2 81 Datakommunikation & Internet, Anders Broberg, UmU

Mobility via Indirect Routing

wide area network

home network visited network

3 2 4 1 correspondent addresses packets using home address

  • f mobile

home agent intercepts packets, forwards to foreign agent foreign agent receives packets, forwards to mobile mobile replies directly to correspondent

slide-28
SLIDE 28

28

3/10 Network 2 82 Datakommunikation & Internet, Anders Broberg, UmU

Indirect Routing: comments

¸ Mobile uses two addresses:

  • permanent address: used by correspondent (hence

mobile location is transparent to correspondent)

  • care-of-address: used by home agent to forward

datagrams to mobile

¸ foreign agent functions may be done by mobile itself ¸ triangle routing: correspondent-home-network-

mobile

  • inefficient when

correspondent, mobile are in same network

3/10 Network 2 83 Datakommunikation & Internet, Anders Broberg, UmU

Indirect Routing: moving between networks

¸ suppose mobile user moves to another

network

  • registers with new foreign agent
  • new foreign agent registers with home agent
  • home agent update care-of-address for mobile
  • packets continue to be forwarded to mobile (but

with new care-of-address) ¸ Mobility, changing foreign networks

transparent: on going connections can be maintained!

3/10 Network 2 84 Datakommunikation & Internet, Anders Broberg, UmU

Mobility via Direct Routing

wide area network

home network visited network

4 2 5 1 correspondent requests, receives foreign address of mobile correspondent forwards to foreign agent foreign agent receives packets, forwards to mobile mobile replies directly to correspondent 3

slide-29
SLIDE 29

29

3/10 Network 2 85 Datakommunikation & Internet, Anders Broberg, UmU

Mobility via Direct Routing: comments

¸ overcome triangle routing problem ¸ non-transparent to correspondent:

correspondent must get care-of-address from home agent

  • What happens if mobile changes networks?

3/10 Network 2 86 Datakommunikation & Internet, Anders Broberg, UmU

Mobile IP

¸ RFC 3220 ¸ has many features we’ve seen:

  • home agents, foreign agents, foreign-agent

registration, care-of-addresses, encapsulation (packet-within-a-packet) ¸ three components to standard:

  • agent discovery
  • registration with home agent
  • indirect routing of datagrams

3/10 Network 2 87 Datakommunikation & Internet, Anders Broberg, UmU

Mobile IP: agent discovery

¸ agent advertisement: foreign/home agents advertise

service by broadcasting ICMP messages (typefield = 9)

RBHFMGV bits reserved type = 16 type = 9 code = 0 = 9 checksum = 9 router address standard ICMP fields mobility agent advertisement extension length sequence # registration lifetime

0 or more care-of- addresses

8 16 24

R bit: registration required H,F bits: home and/or foreign agent

slide-30
SLIDE 30

30

3/10 Network 2 88 Datakommunikation & Internet, Anders Broberg, UmU

Mobile IP: registration example

visited network: 79.129.13/24 home agent HA: 128.119.40.7 foreign agent COA: 79.129.13.2 COA: 79.129.13.2 …. ICMP agent adv. Mobile agent MA: 128.119.40.186 registration req. COA: 79.129.13.2 HA: 128.119.40.7 MA: 128.119.40.186 Lifetime: 9999 identification:714 …. registration req. COA: 79.129.13.2 HA: 128.119.40.7 MA: 128.119.40.186 Lifetime: 9999 identification: 714 encapsulation format …. registration reply HA: 128.119.40.7 MA: 128.119.40.186 Lifetime: 4999 Identification: 714 encapsulation format …. registration reply HA: 128.119.40.7 MA: 128.119.40.186 Lifetime: 4999 Identification: 714 …. time

3/10 Network 2 89 Datakommunikation & Internet, Anders Broberg, UmU

Network Layer: Summary

Goals:

¸ understand principles

behind network layer services:

  • routing (path

selection)

  • dealing with scale
  • how a router works
  • advanced topics: IPv6,

multicast ¸ instantiation and

implementation in the Internet Overview:

¸ network layer services ¸ IP addressing ¸ routing principle: path

selection

¸ IP ¸ hierarchical routing ¸ Internet routing protocols

reliable transfer

  • intra-domain
  • inter-domain

¸ what’s inside a router? ¸ IPv6 ¸ multicast routing