05 network

49
Network Layer 4-1 Network layer

Upload: rumoorthyit

Post on 23-Jun-2015

158 views

Category:

Education


0 download

TRANSCRIPT

Page 1: 05 network

Network Layer 4-1

Network layer

Page 2: 05 network

Network Layer 4-2

Network layerr transport segment from

sending to receiving host r on sending side puts

segments into datagramsr on rcving side, delivers

segments to transport layerr network layer protocols in

every host, router

applicationtransportnetworkdata linkphysical

applicationtransportnetworkdata linkphysical

networkdata linkphysical network

data linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysicalnetwork

data linkphysical

Page 3: 05 network

Network Layer 4-3

Network layer functionsr Connection setup

m datagramm connection-oriented, host-

to-host connectionr Delivery semantics:

m Unicast, broadcast, multicast, anycast

m In-order, any-orderr Security

m secrecy, integrity, authenticity

r Demux to upper layerm next protocolm Can be either transport or

network (tunneling)

r Quality-of-servicem provide predictable

performance r Fragmentation

m break-up packets based on data-link layer properties

r Routingm path selection and packet

forwarding r Addressing

m flat vs. hierarchicalm global vs. localm variable vs. fixed length

Page 4: 05 network

Network Layer 4-4

The Internet Network layer

forwardingtable

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

Networklayer

Page 5: 05 network

Network Layer 4-5

IP datagram format

ver length

32 bits

data (variable length,typically a TCP

or UDP segment)

16-bit identifierInternetchecksum

time tolive

32 bit source IP address

IP protocol versionnumber

header length(bytes)

max numberremaining hops

(decremented at each router)

forfragmentation/reassembly

total datagramlength (bytes)

upper layer protocolto deliver payload to

head.len

type ofservice

“type” of data flgs fragmentoffset

upperlayer

32 bit destination IP address

Options (if any) E.g. timestamp,record routetaken, specifylist of routers to visit.

how much overhead with TCP?

r 20 bytes of TCPr 20 bytes of IPr = 40 bytes + app

layer overhead

Page 6: 05 network

Network Layer 4-6

Recall network layer functions

rHow does IPv4 support..m Connection setupm Delivery semanticsm Securitym Demux to upper layer mQuality-of-servicem Fragmentationm Addressingm Routing

Page 7: 05 network

Network Layer 4-7

IP connection setup

rHourglass designrNo support for network layer connectionsm Unreliable datagram servicemOut-of-order delivery possiblem Connection semantics only at higher layerm Compare to ATM and phone network…

Page 8: 05 network

Network Layer 4-8

Connectionless network layersr Postal service abstraction (Internet)

m Model• no call setup or teardown at network layer• no service guarantees

m Network support• no state within network on end-to-end connections• packets forwarded based on destination host ID• packets between same source-dest pair may take different

paths

applicationtransportnetworkdata linkphysical

applicationtransportnetworkdata linkphysical

1. Send data 2. Receive data

Page 9: 05 network

Network Layer 4-9

Connection-oriented network layersr Circuit abstraction

m Examples: ATM, frame relay, X.25, phone networkm Model

• call setup and signaling for each call before data can flow• guaranteed performance during call• call teardown and signaling to remove call

m Network support• every router on source-dest path maintains “state” for each passing

circuit• link, router resources (bandwidth, buffers) allocated to VC to

guarantee circuit-like performance

applicationtransportnetworkdata linkphysical

applicationtransportnetworkdata linkphysical

1. Initiate call2. incoming call3. Accept call4. Call connected

5. Data flow begins 6. Receive data

Page 10: 05 network

Network Layer 4-10

IP delivery semantics

rNo reliability guaranteesm Loss

rNo ordering guaranteesmOut-of-order delivery possible

rUnicast mostlym IP broadcast (255.255.255.255) not forwardedm IP multicast supported, but not widely used

• 224.0.0.0 to 239.255.255.255

Page 11: 05 network

Network Layer 4-11

IP securityrWeak support for integritym IP checksum

• IP has a header checksum, leaves data integrity to TCP/UDP• http://www.rfc-editor.org/rfc/rfc1141.txt

mNo support for secrecy, authenticityr IPsecm Retrofit IP network layer with encryption and

authenticationm http://www.rfc-editor.org/rfc/rfc2411.txt

Page 12: 05 network

Network Layer 4-12

IP demux to upper layerr http://www.rfc-editor.org/rfc/rfc1700.txtm Protocol type field

• 1 = ICMP• 4 = IP in IP• 6 = TCP• 8 = EGP• 9 = IGP • 17 = UDP

Page 13: 05 network

Network Layer 4-13

IP quality of servicer IP originally had “type-of-service” (TOS) field to

eventually support qualitymNot used, ignored by most routers

rNeed to provide applications with performance guaranteesmMid 90s: Add circuits to the Internet!

• Integrated services (intserv) and RSVP signalling• Per-flow end-to-end QoS support• Per-flow signaling and network resource allocation

Page 14: 05 network

Network Layer 4-14

Network service model

Example services for individual datagrams:

r guaranteed deliveryr guaranteed delivery

with less than 40 msec delay

Example services for a flow of datagrams:

r in-order datagram delivery

r guaranteed minimum bandwidth to flow

r restrictions on changes in inter-packet spacing (jitter)

Page 15: 05 network

Network Layer 4-15

IP quality of servicer Protocols developed and standardized

m RSVP signalling protocolm Intserv service models

r Failed miserably…Why?m Complexity

• Scheduling• Routing (pinning routes)• Per-flow signalling overhead

m Lack of scalability• Per-flow state

m Economics• Providers with no incentive to deploy• SLA, end-to-end billing issues

m QoS a weak-link property• Requires every device on an end-to-end basis to support flow

Page 16: 05 network

Network Layer 4-16

IP quality of servicerNow it’s diffserv…mUse the “type-of-service” bits as a priority markingm http://www.rfc-editor.org/rfc/rfc2474.txtm http://www.rfc-editor.org/rfc/rfc2475.txtm http://www.rfc-editor.org/rfc/rfc2597.txtm http://www.rfc-editor.org/rfc/rfc2598.txt

Page 17: 05 network

Network Layer 4-17

IP Addressingr IP address:m 32-bit identifier for

host/router interface

m routers typically have multiple interfaces

m Addresses hierarchical (like post office)

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.2223.1.3.1

223.1.3.27

223.1.1.1 = 11011111 00000001 00000001 00000001

223 1 11

Page 18: 05 network

Network Layer 4-18

IP Addressingr IP address:

m network part (high order bits)

m host part (low order bits) r What’s a network ?

m all interfaces that can physically reach each other without intervening router

m each interface shares the same network part of IP address

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.2223.1.3.1

223.1.3.27

network consisting of 3 IP networks(for IP addresses starting with 223, first 24 bits are network address)

LAN

Page 19: 05 network

Network Layer 4-19

How did networks get IP addresses?

r Total IP address size: 4 billionr Initially one large class (8-bit network, 24-bit host)

m ISP given an 8-bit network number to managem Each router keeps track of each network (28=256 routes)m Each network has 16 million hostsm Problem: one size does not fit all

r Classful addressingm Accommodate smaller networks (LANs)m Class A: 128 networks, 16M hostsm Class B: 16K networks, 64K hostsm Class C: 2M networks, 256 hostsm Total routes potentially > 2,113,664 networks and network routes !

Page 20: 05 network

Network Layer 4-20

IP address classes

Network ID Host ID8 16

Class A32

0

Class B 10

Class C 110

Multicast AddressesClass D 1110

Reserved for experimentsClass E 1111

24

Network ID

Network ID

Host ID

Host ID

1.0.0.0 to 127.255.255.255

128.0.0.0 to 191.255.255.255

192.0.0.0 to 223.255.255.255

224.0.0.0 to 239.255.255.255

Page 21: 05 network

Network Layer 4-21

Special IP AddressesrPrivate addresses

– http://www.rfc-editor.org/rfc/rfc1918.txt– Class A: 10.0.0.0 - 10.255.255.255 (10.0.0.0/8 prefix)– Class B: 172.16.0.0 - 172.31.255.255 (172.16.0.0/12

prefix)– Class C: 192.168.0.0 - 192.168.255.255 (192.168.0.0/16

prefix)

r127.0.0.1: local host (a.k.a. the loopbackaddress)

Page 22: 05 network

Network Layer 4-22

IP Addressing problems

r Inefficient use of address spacem Class A (rarely given out, sparse usage)m Class B = 64k hosts (sparse usage)

• Very few LANs have close to 64K hosts

rAddress space depletionm Classes A and B take huge chunks of space but

not used muchmNot many class C addresses left to give out

r Explosion of routesm Increasing use of class C explodes # of routes

Page 23: 05 network

Network Layer 4-23

variablenetwork

part

IP addressing: CIDR

rOriginal classful addressingmUse class structure (A, B, C) to determine

network ID for route lookup

rCIDR: Classless InterDomain RoutingmArbitrarily aggregate and split up adjacent

network addresses

11001000 00010111 00010000 00000000

hostpart

200.23.16.0/23

Page 24: 05 network

Network Layer 4-24

CIDR

rAssign any range of addresses to networkmAllows one to split large network blocks into multiple

smaller ones (increase usage of Class A & B)mAllows one to combine small network blocks into a

single large one (reduce routes from Class C usage)

Page 25: 05 network

Network Layer 4-25

Getting IP addressesQ: How does network get IP addresses?A: organization gets allocated portion of its provider

ISP’s address spacem ISPs get it from ICANN: Internet Corporation for

Assigned Names and Numbers• Allocates addresses, manages DNS, resolves disputes

m Customers get sub-blocks from ISPs

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

Page 26: 05 network

Network Layer 4-26

IPv6r IPv4 running out of addressesrNeed to replace it with a new network protocolrWhat changes should be made in….

• IP addressing• IP delivery semantics• IP quality of service• IP security• IP routing• IP fragmentation• IP error detection

Page 27: 05 network

Network Layer 4-27

IPv6r Initial motivation: 32-bit address space soon

to be completely allocated rAdditional motivation:m Remove ancillary functionality

• Speed processing/forwardingm Add missing, but essential functionality

• header changes to facilitate QoS • new “anycast” address: route to “best” of several

replicated servers

Page 28: 05 network

Network Layer 4-28

IPv6 Header (Cont)Priority: identify priority among datagrams in flowFlow Label: identify datagrams in same “flow.”

(concept of“flow” not well defined).Next header: identify next protocol for data

Page 29: 05 network

Network Layer 4-29

IPv6 Changes

rScale – addresses are 128bitmHeader size?

rSimplificationm Removes infrequently used parts of headerm Removes checksumm 40 byte fixed header vs. 20+ byte variable

headerm Eliminates fragmentation

Page 30: 05 network

Network Layer 4-30

Transition From IPv4 To IPv6rNot all routers can be upgraded simultaneousm no “flag days”mHow will the network operate with mixed IPv4 and

IPv6 routers? m Tunneling: IPv6 carried as payload in an IPv4

datagram among IPv4 routers

Page 31: 05 network

Network Layer 4-31

TunnelingA B E F

IPv6 IPv6 IPv6 IPv6

tunnelLogical view:

Physical view:A B E F

IPv6 IPv6 IPv6 IPv6IPv4 IPv4

Page 32: 05 network

Network Layer 4-32

TunnelingA B E F

IPv6 IPv6 IPv6 IPv6

tunnelLogical view:

Physical view:A B E F

IPv6 IPv6 IPv6 IPv6

C D

IPv4 IPv4

Flow: XSrc: ADest: F

data

Flow: XSrc: ADest: F

data

Flow: XSrc: ADest: F

data

Src:BDest: E

Flow: XSrc: ADest: F

data

Src:BDest: E

A-to-B:IPv6

E-to-F:IPv6B-to-C:

IPv6 insideIPv4

B-to-C:IPv6 inside

IPv4

Page 33: 05 network

Network Layer 4-33

Routing

Page 34: 05 network

Network Layer 4-34

Two Key Network-Layer Functions

r forwarding: move packets from router’s input to appropriate router output

r routing: determine route taken by packets from source to dest.

m routing algorithms

Page 35: 05 network

Network Layer 4-35

Internet routing with IP addressesrHop-by-hop forwarding based on destination IP

carried by packetm Each packet has destination IP addressm Each router has forwarding table of..

• destination IP à next hop IP addressm IP route table calculated in network routers

rMost prevalent way to route on the InternetmDistributed routing algorithm for calculating

forwarding tables

Page 36: 05 network

Network Layer 4-36

Routing protocols

Graph abstraction for routing algorithms:

r Routing algorithms find minimum cost paths through graph

Goal: determine “good” path (sequence of routers) thru network from source to dest.

A

ED

CB

F2

21

3

1

1

2

53

5

Page 37: 05 network

Network Layer 4-37

Routing Algorithm classification

Global or decentralized information?Global:

m all routers have complete topology, link cost infom “link state” algorithms

Decentralized:m router knows physically-connected neighbors, link costs

to neighborsm iterative process of computation, exchange of info with

neighborsm “distance vector” algorithms

Page 38: 05 network

Network Layer 4-38

Hierarchical Routing

scale: with 200 million destinations:

r can’t store all dest’s in routing tables!

r routing table exchange would swamp links!

r Flat routing does not scale

administrative autonomyr internet = network of

networksr each network admin may

want to control routing in its own network

Page 39: 05 network

Network Layer 4-39

Routing Hierarchies

r Key observationmNeed less information with increasing distance to

destinationmHierarchical routing

• saves table size• reduces update traffic• allows routing to scale

Page 40: 05 network

Network Layer 4-40

AreasrDivide network into areasmWithin area, each node has routes to every other node mOutside area

• Each node has routes for other top-level areas only (not nodes within those areas)

• Inter-area packets are routed to nearest appropriate border router

Page 41: 05 network

Network Layer 4-41

Internet Routing Hierarchy

r Internet areas called “autonomous systems”(AS)m administrative

autonomyr routers in same AS run

same routing protocolm “intra-AS” routing

protocol (IGP)

Border routersm Special routers in AS

that directly link to another AS

• also run inter-ASrouting protocol or border gateway protocol (BGP) with other gateway routers in other AS’s

Page 42: 05 network

Network Layer 4-42

Internet Routing Hierarchy

a

b

b

aaC

A

Bd

A.aA.c

C.bB.a

cb

c

Page 43: 05 network

Network Layer 4-43

Inter-AS routing

r Done using BGP (Border Gateway Protocol)m Uses distance-vector style algorithms

r BGP messages exchanged using TCP.m Advantages:

• Simplifies BGP• No need for periodic refresh - routes are valid until

withdrawn, or the connection is lost• Incremental updates

m Disadvantages• BGP TCP spoofing attack• Congestion control on a routing protocol?• Poor interaction during high load (Code Red)• No authentication of route advertisements

– Pakistan Youtube incident

Page 44: 05 network

Network Layer 4-44

ICMP: Internet Control Message Protocol

r Essentially a network-layer protocol for passing control messages

r used by hosts & routers to communicate network-level informationm error reporting: unreachable

host, network, port, protocolm echo request/reply (used by

ping)r network-layer “above” IP:

m ICMP msgs carried in IP datagrams

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

r http://www.rfc-editor.org/rfc/rfc792.txt

Type Code description0 0 echo reply (ping)3 0 dest. network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion

control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header

Page 45: 05 network

Network Layer 4-45

ICMP and traceroute

r What do “real” Internet delay & loss look like? r Traceroute program: provides delay

measurement from source to router along end-end Internet path towards destination. For all i:m sends three packets that will reach router i on path

towards destinationm router i will return packets to senderm sender times interval between transmission and reply.

3 probes

3 probes

3 probes

Page 46: 05 network

Network Layer 4-46

ICMP and traceroute

r Source sends series of UDP segments to destm First has TTL =1m Second has TTL=2, etc.m Unlikely port number

r When nth datagram arrives to nth router:m Router discards datagramm And sends to source an

ICMP message (type 11, code 0)

m Message includes name of router& IP address

r When ICMP message arrives, source calculates RTT

r Traceroute does this 3 times

Stopping criterionr UDP segment eventually

arrives at destination hostr Destination returns ICMP

“host unreachable” packet (type 3, code 3)

r When source gets this ICMP, stops.

Page 47: 05 network

Network Layer 4-47

Examples

1 cs-gw (128.119.240.254) 1 ms 1 ms 2 ms2 border1-rt-fa5-1-0.gw.umass.edu (128.119.3.145) 1 ms 1 ms 2 ms3 cht-vbns.gw.umass.edu (128.119.3.130) 6 ms 5 ms 5 ms4 jn1-at1-0-0-19.wor.vbns.net (204.147.132.129) 16 ms 11 ms 13 ms 5 jn1-so7-0-0-0.wae.vbns.net (204.147.136.136) 21 ms 18 ms 18 ms 6 abilene-vbns.abilene.ucaid.edu (198.32.11.9) 22 ms 18 ms 22 ms7 nycm-wash.abilene.ucaid.edu (198.32.8.46) 22 ms 22 ms 22 ms8 62.40.103.253 (62.40.103.253) 104 ms 109 ms 106 ms9 de2-1.de1.de.geant.net (62.40.96.129) 109 ms 102 ms 104 ms10 de.fr1.fr.geant.net (62.40.96.50) 113 ms 121 ms 114 ms11 renater-gw.fr1.fr.geant.net (62.40.103.54) 112 ms 114 ms 112 ms12 nio-n2.cssi.renater.fr (193.51.206.13) 111 ms 114 ms 116 ms13 nice.cssi.renater.fr (195.220.98.102) 123 ms 125 ms 124 ms14 r3t2-nice.cssi.renater.fr (195.220.98.110) 126 ms 126 ms 124 ms15 eurecom-valbonne.r3t2.ft.net (193.48.50.54) 135 ms 128 ms 133 ms16 194.214.211.25 (194.214.211.25) 126 ms 128 ms 126 ms17 * * *18 * * *19 fantasia.eurecom.fr (193.55.113.142) 132 ms 128 ms 136 ms

traceroute: gaia.cs.umass.edu to www.eurecom.frThree delay measurements from gaia.cs.umass.edu to cs-gw.cs.umass.edu

* means no response (probe lost, router not replying)

trans-oceaniclink

Page 48: 05 network

Network Layer 4-48

Try it

rSome routers labeled with airport code of city they are located inm traceroute www.yahoo.com

• Packets go to SEA, back to PDX, SJCm traceroute www.oregonlive.com

• Packets go to SMF, SFO, SJC, NYC, EWR.m traceroute www.uoregon.edu

• Packets go to Pittock block to Eugenem traceroute www.lclark.edu

• Packets go to SEA and back to PDX

Page 49: 05 network

Network Layer 4-49

Internet overview complete

rTechnical background for the rest of the course