4: Network Layer 4a-1 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: network layer services routing principle: path selection hierarchical routing IP Internet routing protocols reliable transfer intra-domain inter-domain what’s inside a router? IPv6 multicast routing
36
Embed
4: Network Layer4a-1 Network Layer Goals: r understand principles behind network layer services: m routing (path selection) m dealing with scale m how.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
4: Network Layer 4a-1
Network LayerGoals: understand principles
behind network layer services: routing (path
selection) dealing with scale how a router works advanced topics: IPv6,
selection hierarchical routing IP Internet routing protocols
reliable transfer intra-domain inter-domain
what’s inside a router? IPv6 multicast routing
4: Network Layer 4a-2
Network layer functions
transport packet from sending to receiving hosts
network layer protocols in every host, router (Recall transport layer is end-to-end)
three important functions: path determination: route
taken by packets from source to dest. Routing algorithms
switching: move packets from router’s input to appropriate router output
call setup: some network architectures (e.g. telephone, ATM) require router call setup along path before data flow
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
4: Network Layer 4a-3
Protocol stack:packet forwarding
HTTP
TCP
IP
ethernet
Host A
IP
ethernet
Router R
link
HTTP
TCP
IP
ethernet
Router W
Host B
IP
ethernetlink
4: Network Layer 4a-4
Network service model
Q: What service model for “channel” transporting packets from sender to receiver?
guaranteed bandwidth? preservation of inter-
packet timing (no jitter)? loss-free delivery? in-order delivery? congestion feedback to
sender?
? ??virtual circuit
or datagram?
The most important abstraction provided
by network layer:
serv
ice a
bst
ract
ion
Which things can be “faked” at the transport layer?
4: Network Layer 4a-5
Virtual circuits
call setup, teardown for each call before data can flow; associates VC identifier with the path
each packet carries VC identifier (not destination host OD) every router on source-dest path s maintain “state” for each
passing connection transport-layer connection only involved two end systems
link, router resources (bandwidth, buffers) may be allocated to VC to get circuit-like performance
“source-to-dest path behaves much like telephone circuit” performance-wise network actions along source-to-dest path
4: Network Layer 4a-6
Virtual circuits: signaling protocols used to setup, maintain teardown VC setup gives opportunity to reserve resources used in ATM, frame-relay, X.25 not used in today’s Internet
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
1. Initiate call 2. incoming call
3. Accept call4. Call connected5. Data flow begins 6. Receive data
4: Network Layer 4a-7
Datagram networks: the Internet model no call setup at network layer routers: no state about end-to-end connections
no network-level concept of “connection” packets typically routed using destination host ID
packets between same source-dest pair may take different paths
Best effort
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
1. Send data 2. Receive data
4: Network Layer 4a-8
Best Effort
What can happen to datagrams?
Corrupted at the physical level Datagrams dropped because of full
buffers Destination unreachable Routing loops
4: Network Layer 4a-9
Datagram or VC network: why?
Datagram (Internet) data exchange among
computers “elastic” service, no strict
timing req. “smart” end systems
(computers) can adapt, perform
control, error recovery simple inside network
core, complexity at “edge” many link types
different characteristics uniform service difficult
Virtual Circuit (ATM) evolved from telephony human conversation:
strict timing, reliability requirements
need for guaranteed service
“dumb” end systems telephones complexity inside
network
4: Network Layer 4a-10
The Internet Network layer
routingtable
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
4: Network Layer 4a-11
Internet Protocol
The Internet is a network of heterogeneous networks: using different technologies (ex. different maximum packet
sizes)
belonging to different administrative authorities (ex. Willing to accept packets from different addresses)
Goal of IP: interconnect all these networks so can send end to end without any knowledge of the intermediate networks
Routers, switches, bridges: machines to forward packets between heterogeneous networks
4: Network Layer 4a-12
IP Addressing: introduction IP address: 32-bit
identifier for host, router interface
interface: connection between host and physical link router’s must have
multiple interfaces host may have
multiple interfaces IP addresses (unicast
addresses) associated with interface, not host, router
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
4: Network Layer 4a-13
IP Addressing IP address:
32 bits network part (high
order bits) host part (low order
bits) Defined by class of IP
address? Defined by subnet mask
What’s a network ? (from IP address perspective) device interfaces with
same network part of IP address
can physically reach each other without intervening router
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(223.1.1, 223.1.2, 223.1.3)
LAN
4: Network Layer 4a-14
IP AddressingHow to find the
networks? Detach each
interface from router, host
create “islands of isolated networks
223.1.1.1
223.1.1.3
223.1.1.4
223.1.2.2223.1.2.1
223.1.2.6
223.1.3.2223.1.3.1
223.1.3.27
223.1.1.2
223.1.7.0
223.1.7.1223.1.8.0223.1.8.1
223.1.9.1
223.1.9.2
Interconnected system consisting
of six networks
4: Network Layer 4a-15
IP Addresses (Classes)
0network host
10 network host
110 network host
1110 multicast address
A
B
C
D
class1.0.0.0 to127.255.255.255
128.0.0.0 to191.255.255.255
192.0.0.0 to223.255.255.255
224.0.0.0 to239.255.255.255
32 bits
given notion of “network”, let’s re-examine IP addresses:
“Send me anythingwith 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 7Internet
Organization 1
ISPs-R-Us“Send me anythingwith addresses beginning 199.31.0.0/16”
200.23.20.0/23Organization 2
...
...
Hierarchical addressing allows efficient advertisement of routing information:
4: Network Layer 4a-27
Hierarchical addressing: more specific routes
ISPs-R-Us has a more specific route to Organization 1
“Send me anythingwith 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 7Internet
Organization 1
ISPs-R-Us“Send me anythingwith addresses beginning 199.31.0.0/16or 200.23.18.0/23”
200.23.20.0/23Organization 2
...
...
4: Network Layer 4a-28
IP Address Allocation
CIDR is great but must work around existing allocations of IP address space
Company 1 has a /20 allocation and has given out sub portions of it to other companies
University has a full class B address Company 2 has a /23 allocation from some other class B ALL use the same upstream ISP – that ISP must advertise routes to all
these blocks that cannot be described with a simple CIDR network ID and mask!
Estimated reduction in routing table size with CIDR
If IP addresses reallocated, CIDR applied to all, IP addresses reallocated based on geographic and service provider divisions that current routing tables with 10000+ entries could be reduced to 200 entries [Ford, Rekhter and Brown 1993]
How stable would that be though? Leases for all?
4: Network Layer 4a-29
Current Allocation
Interesting to exam current IP address space allocation (who has class A’s ? Etc) Who has A’s? Computer companies around during initial
allocation (IBM, Apple) Universities (Stanford, MIT) CAIDA has info on complete allocation
4: Network Layer 4a-30
IP datagram format
ver length
32 bits
data (variable length,typically a TCP
or UDP segment)
16-bit identifier
Internet checksum
time tolive
32 bit source IP address
IP protocol versionNumber
header length
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 flgsfragment
offsetupper layer
32 bit destination IP address
Options (if any) E.g. timestamp,record routetaken, pecifylist of routers to visit.
4: Network Layer 4a-31
IP Header: Version and Header Length Version number (4-bit )
4 for IPv4, 6 for IPv6 Fields that follow can vary based on this
number Header length (4-bit )
Number of 32 bit words (24-1 32 bits = 60 bytes)
Includes length of options (40 bytes max)
4: Network Layer 4a-32
IP Header: TOS
Type-of-service (TOS) field 3 Bit precedence field 4 TOS bits (only one may be turned on)