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

network layer
SMART_READER_LITE
LIVE PREVIEW

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

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


slide-1
SLIDE 1

1

2 October 2001 Network 2 1 Data Communications, Jonny Pettersson, 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 2 October 2001 Network 2 2 Data Communications, Jonny Pettersson, 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

2 October 2001 Network 2 3 Data Communications, Jonny Pettersson, 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 (32-bit words) 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.

slide-2
SLIDE 2

2

2 October 2001 Network 2 4 Data Communications, Jonny Pettersson, UmU

Fragmentering och hopsättning

❒ MTU varierar i olika nät, två val

❍ Alla paket tillräckligt små ❍ Fragmentering och hopsättning

❒ Alla fragment har samma Ident ❒ Tappas ett fragment slängs alla ❒ Varje fragment fullständigt IP-datagram ❒ Hopsättning hos mottagaren ❒ Designat för ytterligare fragmentering

Ident Flags Offset 2 October 2001 Network 2 5 Data Communications, Jonny Pettersson, 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

2 October 2001 Network 2 6 Data Communications, Jonny Pettersson, 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

slide-3
SLIDE 3

3

2 October 2001 Network 2 7 Data Communications, Jonny Pettersson, UmU

Skalbarhet

❒ 27 + 214 + 221 olika nätverksadresser i IP ❒ Det blir stora tabeller om varje router ska

hitta alla nätverk

❒ Hur får man routing att skala?

2 October 2001 Network 2 8 Data Communications, Jonny Pettersson, 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 2 October 2001 Network 2 9 Data Communications, Jonny Pettersson, UmU

DHCP

A new node needs an IP-address:

❒ hard-coded by system admin in a file ❒ DHCP: Dynamic Host Configuration Protocol: dynamically get address: “plug-and-play”

❍ 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

❒ An example on scaling of network

administration

slide-4
SLIDE 4

4

2 October 2001 Network 2 10 Data Communications, Jonny Pettersson, UmU

Hierarchical Routing

scale: with 50 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

  • wn network

Our routing study thus far - idealization

❒ all routers identical ❒ network “flat”

… not true in practice

2 October 2001 Network 2 11 Data Communications, Jonny Pettersson, 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

2 October 2001 Network 2 12 Data Communications, Jonny Pettersson, 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

slide-5
SLIDE 5

5

2 October 2001 Network 2 13 Data Communications, Jonny Pettersson, 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

2 October 2001 Network 2 14 Data Communications, Jonny Pettersson, 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 2 October 2001 Network 2 15 Data Communications, Jonny Pettersson, 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.)

slide-6
SLIDE 6

6

2 October 2001 Network 2 16 Data Communications, Jonny Pettersson, 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

2 October 2001 Network 2 17 Data Communications, Jonny Pettersson, 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)

2 October 2001 Network 2 18 Data Communications, Jonny Pettersson, UmU

RIP Table processing

❒ RIP routing tables managed by application-level

process called route-d (daemon)

❒ advertisements sent in UDP packets, periodically

repeated

slide-7
SLIDE 7

7

2 October 2001 Network 2 19 Data Communications, Jonny Pettersson, 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 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 le0 default 193.55.114.129 UG 0 143454 2 October 2001 Network 2 20 Data Communications, Jonny Pettersson, 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)

2 October 2001 Network 2 21 Data Communications, Jonny Pettersson, 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)

❒ For each link, multiple cost metrics for different

TOS (eg, satellite link cost set “low” for best effort; high for real time)

❒ Integrated uni- and multicast support:

❍ Multicast OSPF (MOSPF) uses same topology data base as

OSPF ❒ Hierarchical OSPF in large domains.

slide-8
SLIDE 8

8

2 October 2001 Network 2 22 Data Communications, Jonny Pettersson, 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.

❒ Area border routers:

“summarize” distances to nets in

  • wn area, advertise to other Area

Border routers.

❒ Backbone routers: run OSPF

routing limited to backbone.

❒ Boundary routers: connect to

  • ther ASs.

2 October 2001 Network 2 23 Data Communications, Jonny Pettersson, 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

2 October 2001 Network 2 24 Data Communications, Jonny Pettersson, UmU

Internet AS Hierarchy

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

slide-9
SLIDE 9

9

2 October 2001 Network 2 25 Data Communications, Jonny Pettersson, 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

2 October 2001 Network 2 26 Data Communications, Jonny Pettersson, UmU

Internet inter-AS routing: BGP

Suppose: gateway X send its path to peer gateway W

❒ W may or may not select path offered by X

❍ cost, policy (don’t route via competitors AS), loop

prevention reasons.

❒ If W selects path advertised by X, then:

Path (W,Z) = w, Path (X,Z)

❒ Note: X can control incoming traffic by controlling its

route advertisements to peers:

❍ e.g., don’t want to route traffic to Z -> don’t

advertise any routes to Z

2 October 2001 Network 2 27 Data Communications, Jonny Pettersson, 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

2 October 2001 Network 2 28 Data Communications, Jonny Pettersson, 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

2 October 2001 Network 2 29 Data Communications, Jonny Pettersson, 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

2 October 2001 Network 2 30 Data Communications, Jonny Pettersson, 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-11
SLIDE 11

11

2 October 2001 Network 2 31 Data Communications, Jonny Pettersson, 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 2 October 2001 Network 2 32 Data Communications, Jonny Pettersson, 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 ❒ Inte nödvändigt med sammanhängande 1’or ❒ Möjligt att ha flera subnät på ett fysiskt nätverk ❒ Subnät syns ej ifrån resten av Internet

2 October 2001 Network 2 33 Data Communications, Jonny Pettersson, 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

slide-12
SLIDE 12

12

2 October 2001 Network 2 34 Data Communications, Jonny Pettersson, 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

2 October 2001 Network 2 35 Data Communications, Jonny Pettersson, 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

. . . . . .

2 October 2001 Network 2 36 Data Communications, Jonny Pettersson, UmU

Subnetting och CIDR: skalabiliteten

❒ Subnetting

❍ Hjälper till att lösa skalabilitetsproblemet

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

nya Klass B eller C nätverksadresser

  • Samlar ihop information

❒ CIDR

❍ Kortare routingtabeller

  • Slår ihop routinginformation

❍ Spar adresser

  • Dela ut block av kontinuerliga nätverksnummer istället

för adresser för större nätverksklass

slide-13
SLIDE 13

13

2 October 2001 Network 2 37 Data Communications, Jonny Pettersson, 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

❍ Slår ihop routing information

❒ Subnetting

❍ Subnät syns ej utåt

❒ ARP (nästa lager)

❍ Hitta rätt host i ett nätverk (subnät)

❒ Skalabilitet viktigare än optimal väg

2 October 2001 Network 2 38 Data Communications, Jonny Pettersson, UmU

Router Architecture Overview

Two key router functions:

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

2 October 2001 Network 2 39 Data Communications, Jonny Pettersson, UmU

Input Port Functions

Decentralized switching:

❒ given datagram dest., lookup output port

using routing table in input port memory

❒ goal: complete input port processing at

‘line speed’

❒ queuing: if datagrams arrive faster than

forwarding rate into switch fabric Physical layer: bit-level reception Data link layer: e.g., Ethernet see chapter 5

slide-14
SLIDE 14

14

2 October 2001 Network 2 40 Data Communications, Jonny Pettersson, UmU

Input Port Queuing

❒ Fabric slower that input ports combined -> queueing

may occur at input queues

❒ Head-of-the-Line (HOL) blocking: queued datagram

at front of queue prevents others in queue from moving forward

❒ queueing delay and loss due to input buffer overflow!

2 October 2001 Network 2 41 Data Communications, Jonny Pettersson, UmU

Three types of switching fabrics

Via memory First generation routers:

❒packet copied

by system’s (single) CPU

❒ speed limited

by memory bandwidth (2 bus crossings per datagram) Modern routers:

❒ input port

processor performs lookup, copy into memory Via bus

❒ datagram

from input port memory to output port memory via a shared bus

❒ bus

contention: switching speed limited by bus bandwidth Via an interconection network

❒ overcome bus bandwidth

limitations

❒ Advanced design:

fragmenting datagram into fixed length cells, switch cells through the fabric.

2 October 2001 Network 2 42 Data Communications, Jonny Pettersson, UmU

Output Ports

❒ Buffering required when datagrams arrive from

fabric faster than the transmission rate

❒ Scheduling discipline chooses among queued

datagrams for transmission

slide-15
SLIDE 15

15

2 October 2001 Network 2 43 Data Communications, Jonny Pettersson, UmU

Output port queueing

❒ buffering when arrival rate via switch exceeeds

  • uput line speed

❒ queueing (delay) and loss due to output port

buffer overflow!

2 October 2001 Network 2 44 Data Communications, Jonny Pettersson, 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:

❍ fixed-length 40 byte header ❍ no fragmentation allowed

2 October 2001 Network 2 45 Data Communications, Jonny Pettersson, 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

slide-16
SLIDE 16

16

2 October 2001 Network 2 46 Data Communications, Jonny Pettersson, UmU

Dual Stack Approach

2 October 2001 Network 2 47 Data Communications, Jonny Pettersson, UmU

Tunneling

IPv6 inside IPv4 where needed

2 October 2001 Network 2 48 Data Communications, Jonny Pettersson, UmU

Multicast routing

❒ Unicast

❍ Enkelt, men

bandbreddskrävande ❒ Multicast

❍ Mindre antal paket,

men kräver support från nätverkslagret

slide-17
SLIDE 17

17

2 October 2001 Network 2 49 Data Communications, Jonny Pettersson, UmU

Multicast routing (forts)

❒ Problem

❍ Hur identifieras mottagarna av multicast-meddelanden? ❍ Hur adresseras ett datagram till dem?

❒ Lösning

❍ ”address indirection”, en identifierare för hel multicast

grupp

❍ Class D multicast-adresser 2 October 2001 Network 2 50 Data Communications, Jonny Pettersson, UmU

Multicast routing - frågor

❒ Hur startar och slutar en grupp? ❒ Hur väljs gruppadress? ❒ Hur ansluter man till befintlig grupp? ❒ Kan vem som helst ansluta sig? ❒ Känner man till vilka övriga som är

anslutna?

❒ Hur samarbetar routrarna? ❒ Involverar IGMP

2 October 2001 Network 2 51 Data Communications, Jonny Pettersson, UmU

IGMP

❒ Internet Group Management Protocol ❒ Mellan host och första router ❒ Kan ej identifiera andra i gruppen ❒ Tre typer av meddelanden

❍ Membership query, membership report, leave

group ❒ Körs över IP ❒ Receiver-driven

slide-18
SLIDE 18

18

2 October 2001 Network 2 52 Data Communications, Jonny Pettersson, UmU

Multicast routing - generellt

❒ Mål: Hitta ett träd med alla routrar ❒ Ibland måste andra routrar involveras ❒ Två varianter:

❍ Group-shared tree, endast ett träd ❍ Source-based trees, ett träd för varje sändare

2 October 2001 Network 2 53 Data Communications, Jonny Pettersson, 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

❒ Mellan AS – DVMRP

❍ Men inte helt lyckat 2 October 2001 Network 2 54 Data Communications, Jonny Pettersson, 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