Network Layer: Computer Networking: A Top-Down Approach
Network Layer: Computer Networking: A Top-Down Approach
Network Layer
If you use these slides (e.g., in a class) that you mention their source
(after all, we’d like people to use our book!)
If you post any slides on a www site, that you note that they are
adapted from (or perhaps identical to) our slides, and note our
copyright of this material.
For a revision history, see the slide note for this page.
Computer Networking: A
A note on the use of these PowerPoint slides:
We’re making these slides freely available to all (faculty, students, Top-Down Approach
readers). They’re in PowerPoint form so you see the animations; and 8th edition
can add, modify, and delete slides (including this one) and slide content Jim Kurose, Keith Ross
to suit your needs. They obviously represent a lot of work on our part. Pearson, 2020
In return for use, we only ask the following:
Network-layer services and protocols
transport segment from sending to mobile network
forwarding
routing
Network Layer: 4-3
Network Layer: Internet
host, router network layer functions:
Path-selection
IP protocol
• datagram format
algorithms: • addressing
network implemented in • packet handling conventions
• routing protocols forwarding
layer (OSPF, BGP) table ICMP protocol
• error reporting
• router “signaling”
link layer
physical layer
223 1 1 1
Network Layer: 4-6
Subnets
223.1.1.1
subnet 223.1.1/24
223.1.1.1
where are the 223.1.1.4
subnets? 223.1.1.3
what are
223.1.9.2 223.1.7.0
the /24 subnet 223.1.9/24
subnet 223.1.7/24
subnet
addresses? 223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0
DHCP overview:
host broadcasts DHCP discover msg [optional]
DHCP server responds with DHCP offer msg [optional]
host requests IP address: DHCP request msg
DHCP server sends address: DHCP ack msg
Network Layer: 4-12
DHCP client-server scenario
Typically, DHCP server will be co-
DHCP server located in router, serving all subnets
223.1.1.1
223.1.2.1
to which router is attached
223.1.2.5
223.1.1.2
223.1.1.4 223.1.2.9
223.1.1.3
223.1.3.27 arriving DHCP client needs
223.1.2.2 address in this network
223.1.3.1 223.1.3.2
DHCP offer
src: 223.1.2.5, 67
Broadcast: I’m a DHCP
dest: 255.255.255.255, 68
server! Here’s an IP
yiaddr: 223.1.2.4
transaction ID: 654
address you can use
lifetime: 3600 secs
The two steps above can
DHCP request be skipped “if a client
src: 0.0.0.0, 68 remembers and wishes to
dest:: 255.255.255.255,
Broadcast: 67
OK. I would reuse a previously
yiaddr: 223.1.2.4 allocated network address”
like to transaction
use this ID:IP 655
address!
lifetime: 3600 secs
[RFC 2131]
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
Broadcast: OK. You’ve
yiaddr: 223.1.2.4
got that IPID:
transaction address!
655
lifetime: 3600 secs
Network Layer: 4-14
DHCP: more than IP addresses
DHCP can return more than just allocated IP address on
subnet:
address of first-hop router for client
name and IP address of DNS sever
network mask (indicating network versus host portion of address)
DHCP
IP
Eth
address of first-hop router for client,
Phy name & IP address of DNS server
10.0.0.1
138.76.29.7 10.0.0.4
10.0.0.2
10.0.0.3
all datagrams leaving local network have datagrams with source or destination in
same source NAT IP address: 138.76.29.7, this network have 10.0.0/24 address for
but different source port numbers source, destination (as usual)
Network Layer: 4-21
NAT: network address translation
all devices in local network have 32-bit addresses in a “private” IP
address space (10/8, 172.16/12, 192.168/16 prefixes) that can only
be used in local network
advantages:
just one IP address needed from provider ISP for all devices
can change addresses of host in local network without notifying
outside world
can change ISP without changing addresses of devices in local
network
security: devices inside local net not directly addressable, visible
by outside world
…
in: one large datagram
• different link types, different MTUs out: 3 smaller datagrams
…
• IP header bits used to identify, order
related fragments
Assume that no optional fields of the IP header are in use (i.e. IP header is 20 bytes)
The original datagram was 3000 bytes, subtracting 20 bytes for header, that leaves 2980 bytes of data.
Assume the ID of the original packet is 'x'
With an MTU of 500 bytes, 500 - 20 = 480 bytes of data may be transmitted in each packet
Therefore, ceiling(2980 / 480) = 7 packets are needed to carry the data.
The packets will have the following characteristics (NOTE: offset is measured in 8 byte blocks, you
don't need to specify Total_len)