Sie sind auf Seite 1von 49

Network Layer 4-1

Network layer
Network Layer 4-2
Network layer
r transport segment from
sending to receiving host
r on sending side puts
segments into datagrams
r on rcving side, delivers
segments to transport layer
r network layer protocols in
every host, router
application
transport
network
data link
physical
application
transport
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
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
Network Layer 4-3
Network layer functions
r Connection setup
m datagram
m connection-oriented, host-
to-host connection
r Delivery semantics:
m Unicast, broadcast,
multicast, anycast
m In-order, any-order
r Security
m secrecy, integrity,
authenticity
r Demux to upper layer
m next protocol
m Can be either transport or
network (tunneling)
r Quality-of-service
m provide predictable
performance
r Fragmentation
m break-up packets based on
data-link layer properties
r Routing
m path selection and packet
forwarding
r Addressing
m flat vs. hierarchical
m global vs. local
m variable vs. fixed length
Network Layer 4-4
The Internet Network layer
forwarding
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
Network Layer 4-5
IP datagram format
ver
length
32 bits
data
(variable length,
typically a TCP
or 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
offset
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?
r 20 bytes of TCP
r 20 bytes of IP
r = 40 bytes + app
layer overhead
Network Layer 4-6
Recall network layer functions
rHow does IPv4 support..
m Connection setup
m Delivery semantics
m Security
m Demux to upper layer
m Quality-of-service
m Fragmentation
m Addressing
m Routing
Network Layer 4-7
IP connection setup
rHourglass design
rNo support for network layer connections
m Unreliable datagram service
m Out-of-order delivery possible
m Connection semantics only at higher layer
m Compare to ATM and phone network
Network Layer 4-8
Connectionless network layers
r 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
application
transport
network
data link
physical
application
transport
network
data link
physical
1. Send data
2. Receive data
Network Layer 4-9
Connection-oriented network layers
r Circuit abstraction
m Examples: ATM, frame relay, X.25, phone network
m 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
application
transport
network
data link
physical
application
transport
network
data link
physical
1. Initiate call
2. incoming call
3. Accept call
4. Call connected
5. Data flow begins
6. Receive data
Network Layer 4-10
IP delivery semantics
rNo reliability guarantees
m Loss
rNo ordering guarantees
m Out-of-order delivery possible
rUnicast mostly
m IP broadcast (255.255.255.255) not forwarded
m IP multicast supported, but not widely used
224.0.0.0 to 239.255.255.255
Network Layer 4-11
IP security
rWeak support for integrity
m IP checksum
IP has a header checksum, leaves data integrity to TCP/UDP
http://www.rfc-editor.org/rfc/rfc1141.txt
m No support for secrecy, authenticity
rIPsec
m Retrofit IP network layer with encryption and
authentication
m http://www.rfc-editor.org/rfc/rfc2411.txt
Network Layer 4-12
IP demux to upper layer
rhttp://www.rfc-editor.org/rfc/rfc1700.txt
m Protocol type field
1 = ICMP
4 = IP in IP
6 = TCP
8 = EGP
9 = IGP
17 = UDP
Network Layer 4-13
IP quality of service
rIP originally had type-of-service (TOS) field to
eventually support quality
m Not used, ignored by most routers
rNeed to provide applications with performance
guarantees
m Mid 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
Network Layer 4-14
Network service model
Example services for
individual datagrams:
r guaranteed delivery
r 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)
Network Layer 4-15
IP quality of service
r Protocols developed and standardized
m RSVP signalling protocol
m Intserv service models
r Failed miserablyWhy?
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
Network Layer 4-16
IP quality of service
rNow its diffserv
m Use the type-of-service bits as a priority marking
m http://www.rfc-editor.org/rfc/rfc2474.txt
m http://www.rfc-editor.org/rfc/rfc2475.txt
m http://www.rfc-editor.org/rfc/rfc2597.txt
m http://www.rfc-editor.org/rfc/rfc2598.txt
Network Layer 4-17
IP Addressing
rIP 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.2
223.1.3.1
223.1.3.27
223.1.1.1 = 11011111 00000001 00000001 00000001
223 1 1 1
Network Layer 4-18
IP Addressing
r IP address:
m network part (high order
bits)
m host part (low order bits)
r Whats 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.2
223.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
Network Layer 4-19
How did networks get IP addresses?
r Total IP address size: 4 billion
r Initially one large class (8-bit network, 24-bit host)
m ISP given an 8-bit network number to manage
m Each router keeps track of each network (2
8
=256 routes)
m Each network has 16 million hosts
m Problem: one size does not fit all
r Classful addressing
m Accommodate smaller networks (LANs)
m Class A: 128 networks, 16M hosts
m Class B: 16K networks, 64K hosts
m Class C: 2M networks, 256 hosts
m Total routes potentially > 2,113,664 networks and network routes !
Network Layer 4-20
IP address classes
Network ID Host ID
8 16
Class A
32
0
Class B
10
Class C
110
Multicast Addresses
Class D
1110
Reserved for experiments
Class 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
Network Layer 4-21
Special IP Addresses
rPrivate 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 loopback
address)
Network Layer 4-22
IP Addressing problems
rInefficient use of address space
m Class A (rarely given out, sparse usage)
m Class B = 64k hosts (sparse usage)
Very few LANs have close to 64K hosts
rAddress space depletion
m Classes A and B take huge chunks of space but
not used much
m Not many class C addresses left to give out
rExplosion of routes
m Increasing use of class C explodes # of routes
Network Layer 4-23
variable
network
part
IP addressing: CIDR
rOriginal classful addressing
m Use class structure (A, B, C) to determine
network ID for route lookup
rCIDR: Classless InterDomain Routing
m Arbitrarily aggregate and split up adjacent
network addresses
11001000 00010111 00010000 00000000
host
part
200.23.16.0/23
Network Layer 4-24
CIDR
rAssign any range of addresses to network
m Allows one to split large network blocks into multiple
smaller ones (increase usage of Class A & B)
m Allows one to combine small network blocks into a
single large one (reduce routes from Class C usage)
Network Layer 4-25
Getting IP addresses
Q: How does network get IP addresses?
A: organization gets allocated portion of its provider
ISPs address space
m 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
Network Layer 4-26
IPv6
rIPv4 running out of addresses
rNeed to replace it with a new network protocol
rWhat changes should be made in.
IP addressing
IP delivery semantics
IP quality of service
IP security
IP routing
IP fragmentation
IP error detection
Network Layer 4-27
IPv6
rInitial motivation: 32-bit address space soon
to be completely allocated
rAdditional motivation:
m Remove ancillary functionality
Speed processing/forwarding
m Add missing, but essential functionality
header changes to facilitate QoS
new anycast address: route to best of several
replicated servers
Network Layer 4-28
IPv6 Header (Cont)
Priority: identify priority among datagrams in flow
Flow Label: identify datagrams in same flow.
(concept offlow not well defined).
Next header: identify next protocol for data
Network Layer 4-29
IPv6 Changes
rScale addresses are 128bit
m Header size?
rSimplification
m Removes infrequently used parts of header
m Removes checksum
m 40 byte fixed header vs. 20+ byte variable
header
m Eliminates fragmentation
Network Layer 4-30
Transition From IPv4 To IPv6
rNot all routers can be upgraded simultaneous
m no flag days
m How will the network operate with mixed IPv4 and
IPv6 routers?
m Tunneling: IPv6 carried as payload in an IPv4
datagram among IPv4 routers
Network Layer 4-31
Tunneling
A B E F
IPv6 IPv6 IPv6 IPv6
tunnel
Logical view:
Physical view:
A B E F
IPv6 IPv6 IPv6 IPv6 IPv4 IPv4
Network Layer 4-32
Tunneling
A B E F
IPv6 IPv6 IPv6 IPv6
tunnel
Logical view:
Physical view:
A B E F
IPv6 IPv6 IPv6 IPv6
C D
IPv4 IPv4
Flow: X
Src: A
Dest: F
data
Flow: X
Src: A
Dest: F
data
Flow: X
Src: A
Dest: F
data
Src:B
Dest: E
Flow: X
Src: A
Dest: F
data
Src:B
Dest: E
A-to-B:
IPv6
E-to-F:
IPv6
B-to-C:
IPv6 inside
IPv4
B-to-C:
IPv6 inside
IPv4
Network Layer 4-33
Routing
Network Layer 4-34
Two Key Network-Layer Functions
rforwarding: move packets from routers
input to appropriate router output
rrouting: determine route taken by
packets from source to dest.
m routing algorithms
Network Layer 4-35
Internet routing with IP addresses
rHop-by-hop forwarding based on destination IP
carried by packet
m Each packet has destination IP address
m Each router has forwarding table of..
destination IP next hop IP address
m IP route table calculated in network routers
rMost prevalent way to route on the Internet
m Distributed routing algorithm for calculating
forwarding tables
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
E D
C B
F
2
2
1
3
1
1
2
5
3
5
Network Layer 4-37
Routing Algorithm classification
Global or decentralized information?
Global:
m all routers have complete topology, link cost info
m link state algorithms
Decentralized:
m router knows physically-connected neighbors, link costs
to neighbors
m iterative process of computation, exchange of info with
neighbors
m distance vector algorithms
Network Layer 4-38
Hierarchical Routing
scale: with 200 million
destinations:
r cant store all dests in
routing tables!
r routing table exchange
would swamp links!
r Flat routing does not scale
administrative autonomy
r internet = network of
networks
r each network admin may
want to control routing in its
own network
Network Layer 4-39
Routing Hierarchies
rKey observation
m Need less information with increasing distance to
destination
m Hierarchical routing
saves table size
reduces update traffic
allows routing to scale
Network Layer 4-40
Areas
rDivide network into areas
m Within area, each node has routes to every other node
m Outside 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
Network Layer 4-41
Internet Routing Hierarchy
r Internet areas called
autonomous systems
(AS)
m administrative
autonomy
r routers in same AS run
same routing protocol
m intra-AS routing
protocol (IGP)
Border routers
m Special routers in AS
that directly link to
another AS
also run inter-AS
routing protocol or
border gateway
protocol (BGP) with
other gateway routers
in other ASs
Network Layer 4-42
Internet Routing Hierarchy
a
b
b
a
a
C
A
B
d
A.a
A.c
C.b
B.a
c
b
c
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
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
information
m error reporting: unreachable
host, network, port, protocol
m 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 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
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 destination
m router i will return packets to sender
m sender times interval between transmission and reply.
3 probes
3 probes
3 probes
Network Layer 4-46
ICMP and traceroute
r Source sends series of
UDP segments to dest
m First has TTL =1
m Second has TTL=2, etc.
m Unlikely port number
r When nth datagram arrives
to nth router:
m Router discards datagram
m 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 criterion
r UDP segment eventually
arrives at destination host
r Destination returns ICMP
host unreachable packet
(type 3, code 3)
r When source gets this
ICMP, stops.
Network Layer 4-47
Examples
1 cs-gw (128.119.240.254) 1 ms 1 ms 2 ms
2 border1-rt-fa5-1-0.gw.umass.edu (128.119.3.145) 1 ms 1 ms 2 ms
3 cht-vbns.gw.umass.edu (128.119.3.130) 6 ms 5 ms 5 ms
4 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 ms
7 nycm-wash.abilene.ucaid.edu (198.32.8.46) 22 ms 22 ms 22 ms
8 62.40.103.253 (62.40.103.253) 104 ms 109 ms 106 ms
9 de2-1.de1.de.geant.net (62.40.96.129) 109 ms 102 ms 104 ms
10 de.fr1.fr.geant.net (62.40.96.50) 113 ms 121 ms 114 ms
11 renater-gw.fr1.fr.geant.net (62.40.103.54) 112 ms 114 ms 112 ms
12 nio-n2.cssi.renater.fr (193.51.206.13) 111 ms 114 ms 116 ms
13 nice.cssi.renater.fr (195.220.98.102) 123 ms 125 ms 124 ms
14 r3t2-nice.cssi.renater.fr (195.220.98.110) 126 ms 126 ms 124 ms
15 eurecom-valbonne.r3t2.ft.net (193.48.50.54) 135 ms 128 ms 133 ms
16 194.214.211.25 (194.214.211.25) 126 ms 128 ms 126 ms
17 * * *
18 * * *
19 fantasia.eurecom.fr (193.55.113.142) 132 ms 128 ms 136 ms
traceroute: gaia.cs.umass.edu to www.eurecom.fr
Three delay measurements from
gaia.cs.umass.edu to cs-gw.cs.umass.edu
* means no response (probe lost, router not replying)
trans-oceanic
link
Network Layer 4-48
Try it
rSome routers labeled with airport code of
city they are located in
m traceroute www.yahoo.com
Packets go to SEA, back to PDX, SJC
m traceroute www.oregonlive.com
Packets go to SMF, SFO, SJC, NYC, EWR.
m traceroute www.uoregon.edu
Packets go to Pittock block to Eugene
m traceroute www.lclark.edu
Packets go to SEA and back to PDX
Network Layer 4-49
Internet overview complete
rTechnical background for the rest of the
course

Das könnte Ihnen auch gefallen