Chapter 4 Network Layer
-
Upload
karen-flowers -
Category
Documents
-
view
21 -
download
1
description
Transcript of Chapter 4 Network Layer
Transport Layer 3-1
Chapter 4Network Layer
Computer Networking: A
Top Down Approach
6th edition Jim Kurose, Keith
RossAddison-Wesley
March 2012
CPSC 335 Data Communication SystemsReadings: 4.1, 4.4.1,
David Nguyen
Adapted from Kurose Ross
Network Layer 4-2
Chapter 4: network layer
chapter goals: understand principles behind
network layer services: network layer service models forwarding versus routing routing (path selection) broadcast, multicast
instantiation, implementation in the Internet
Network Layer 4-3
4.1 introduction4.2 virtual circuit and
datagram networks4.3 what’s inside a
router4.4 IP: Internet Protocol
datagram format IPv4 addressing ICMP IPv6
4.5 routing algorithms link state distance vector hierarchical routing
4.6 routing in the Internet RIP OSPF BGP
4.7 broadcast and multicast routing
Chapter 4: outline
Network Layer 4-4
Network layer transport segment from
sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side, delivers segments to transport layer
network layer protocols in every host, router
router examines header fields in all IP datagrams passing through it
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
Network Layer 4-5
Two key network-layer functions
forwarding: move packets from router’s input to appropriate router output
routing: determine route taken by packets from source to dest.
routing algorithms
analogy:
routing: process of planning trip from
source to dest
forwarding: process of getting through single interchange
Network Layer 4-6
1
23
0111
value in arrivingpacket’s header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
Network Layer 4-7
Connection setup
3rd important function in some network architectures:
before datagrams flow, two end hosts and intervening routers establish virtual connection routers get involved
network vs transport layer connection service: network: between two hosts (may also
involve intervening routers in case of VCs) transport: between two processes
Network Layer 4-8
4.1 introduction4.2 virtual circuit and
datagram networks4.3 what’s inside a
router4.4 IP: Internet Protocol
datagram format IPv4 addressing ICMP IPv6
4.5 routing algorithms link state distance vector hierarchical routing
4.6 routing in the Internet RIP OSPF BGP
4.7 broadcast and multicast routing
Chapter 4: outline
Network Layer 4-9
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
Network Layer 4-10
ver length
32 bits
data (variable length,typically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
head.len
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
number
header length (bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
“type” of data for
fragmentation/reassembly
max numberremaining hops
(decremented at each router)
e.g. timestamp,record route
taken, specifylist of routers
to visit.
how much overhead? 20 bytes of TCP
20 bytes of IP = 40 bytes + app
layer overhead
Network Layer 4-11
IP fragmentation, reassembly
network links have MTU (max.transfer size) - largest possible link-level frame different link types,
different MTUs large IP datagram
divided (“fragmented”) within net one datagram
becomes several datagrams
“reassembled” only at final destination
IP header bits used to identify, order related fragments
fragmentation: in: one large datagramout: 3 smaller datagrams
reassembly
…
…
Network Layer 4-12
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example: 4000 byte
datagram MTU = 1500
bytes1480 bytes in
data field
offset =1480/8
IP fragmentation, reassembly