Title: 3rd Edition: Chapter 4
1Chapter 4Network LayerPart A
The majority of these slides are adapted from Jim
Kurose, Keith Ross, Addison-Wesley, July
2007.Slides from other sources (CISCO CCNA) and
from Vasos Vassiliou are also included in this
presentation.
2Chapter 4 Network Layer
- Chapter goals
- understand principles behind network layer
services - routing (path selection)
- dealing with scale
- how a router works
- advanced topics IPv6, mobility
3Chapter 4 Network Layer
- 4. 1 Introduction
- 4.2 Virtual circuit and datagram networks
- 4.3 Whats inside a router
- 4.4 IP Internet Protocol
- Datagram format
- IPv4 addressing
- Subnetting
- DHCP
- 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
4Network 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
5The Internet Network layer
- Host, router network layer functions
Transport layer TCP, UDP
Network layer
Link layer
physical layer
6Key Network-Layer Functions
- analogy
- routing process of planning trip from source to
dest - forwarding process of getting through single
interchange
- forwarding move packets from routers input to
appropriate router output - routing determine route taken by packets from
source to dest. - Routing algorithms
7Path Determination
8Routing and Forwarding Tables
9Network layer connection and connection-less
service
- Datagram network provides network-layer
connectionless service - VC network provides network-layer connection
service - Analogous to the transport-layer services, but
- Service host-to-host
- No choice network provides one or the other
- Implementation in the core
10Datagram networks
- no call setup at network layer
- routers no state about end-to-end connections
- no network-level concept of connection
- packets forwarded using destination host address
- packets between same source-dest pair may take
different paths
1. Send data
2. Receive data
11IP Header Format
12IP Addressing introduction
223.1.1.1
- IP address 32-bit identifier for host, router
interface - They uniquely identify each device on an IP
network. - Every host (computer, networking device,
peripheral) must have a unique address. - interface connection between host/router and
physical link
223.1.2.9
223.1.1.4
223.1.1.3
223.1.1.1 11011111 00000001 00000001 00000001
223
1
1
1
13IP Address Format Dotted Decimal Notation
The binary-to-decimal and decimal-to-binary
conversion will be detailed later in this course.
14IP Address Classes The First Octet
15IP Address Ranges
127 (01111111) is a Class A address reserved
for loopback testing and cannot be assigned to a
network.
16Reserved Address
17Public IP Addresses
18Private IP Addresses
19IP addressing CIDR
- CIDR Classless InterDomain Routing
- subnet portion of address of arbitrary length
- address format a.b.c.d/x, where x is bits in
subnet portion of address
20Subnets
- IP address
- subnet part (high order bits)
- host part (low order bits)
- Whats a subnet ?
- device interfaces with same subnet part of IP
address - can physically reach each other without
intervening router - Why subnet ?
- Smaller networks are easier to manage.
- Overall traffic is reduced.
- You can more easily apply network security
policies.
223.1.1.1
223.1.2.1
223.1.1.2
223.1.2.9
223.1.1.4
223.1.2.2
223.1.1.3
223.1.3.27
LAN
223.1.3.2
223.1.3.1
network consisting of 3 subnets
21Subnets
- Recipe
- To determine the subnets, detach each interface
from its host or router, creating islands of
isolated networks. Each isolated network is
called a subnet.
Subnet mask /24
22Subnets
223.1.1.2
223.1.1.1
223.1.1.4
223.1.1.3
223.1.7.0
223.1.9.2
223.1.9.1
223.1.7.1
223.1.8.0
223.1.8.1
223.1.2.6
223.1.3.27
223.1.2.1
223.1.2.2
223.1.3.2
223.1.3.1
23What a Subnet Mask Does
- Tells the router the number of bits to look at
when routing - Defines the number of bits that are significant
- Used as a measuring tool, not to hide anything
24Possible Subnets and Hosts for a Class C Network
25Possible Subnets and Hosts for a Class B Network
26Possible Subnets and Hosts for a Class A Network
27End System Subnet Mask Operation
28Octet Values of a Subnet Mask
Subnet masks, like IP addresses, are represented
in the dotted decimal format like 255.255.255.0
29Default Subnet Masks
Example Class A address (decimal) 10.0.0.0 Exampl
e Class A address (binary) 00001010.00000000.0000
0000.00000000 Default Class A mask
(binary) 11111111.00000000.00000000.00000000 Defa
ult Class A mask (decimal) 255.0.0.0 Default
classful prefix length /8
Example Class B address (decimal) 172.16.0.0 Exam
ple Class B address (binary) 10010001.10101000.00
000000.00000000 Default Class B mask
(binary) 11111111.11111111.00000000.00000000 Defa
ult Class B mask (decimal) 255.255.0.0 Default
classful prefix length /16
Example Class C address (decimal) 192.168.42.0 Ex
ample Class C address (binary) 11000000.10101000.
00101010.00000000 Default Class C mask
(binary) 11111111.11111111.11111111.00000000 Defa
ult Class C mask (decimal) 255.255.255.0 Default
classful prefix length /24
30Procedure for Implementing Subnets
- Determine the IP address assigned by the registry
authority. - Based on the organizational and administrative
structure, determine the number of subnets
required. - Based on the address class and required number of
subnets, determine the number of bits you need to
borrow from the host ID. - Determine the binary and decimal value of the
subnet mask. - Apply the subnet mask to the network IP address
to determine the subnet and host addresses. - Assign subnet addresses to specific interfaces.
31Eight Easy Steps for Determining Subnet Addresses
32Eight Easy Steps for Determining Subnet Addresses
(Cont.)
33Example Applying a Subnet Mask for a Class C
Address
34Hierarchical addressing route aggregation
Hierarchical addressing allows efficient
advertisement of routing information
Organization 0
Organization 1
Send me anything with addresses beginning
200.23.16.0/20
Organization 2
Fly-By-Night-ISP
Internet
Organization 7
Send me anything with addresses beginning
199.31.0.0/16
ISPs-R-Us
35Hierarchical addressing more specific routes
ISPs-R-Us has a more specific route to
Organization 1
Organization 0
Send me anything with addresses beginning
200.23.16.0/20
Organization 2
Fly-By-Night-ISP
Internet
Organization 7
Send me anything with addresses beginning
199.31.0.0/16 or 200.23.18.0/23
ISPs-R-Us
Organization 1
36IP addresses how to get one?
- Q How does a host get IP address?
- hard-coded by system admin in a file
- Windows control-panel-gtnetwork-gtconfiguration-gttc
p/ip-gtproperties - UNIX /etc/rc.config
- DHCP Dynamic Host Configuration Protocol
dynamically get address from as server - plug-and-play
37Network Connection
38DHCP Dynamic Host Configuration Protocol
- Goal allow host to dynamically obtain its IP
address from network server when it joins network - Can renew its lease on address in use
- Allows reuse of addresses (only hold address
while connected an on) - Support for mobile users who want to join network
(more shortly) - DHCP overview
- host broadcasts DHCP discover msg
- DHCP server responds with DHCP offer msg
- host requests IP address DHCP request msg
- DHCP server sends address DHCP ack msg
39DHCP client-server scenario
223.1.2.1
DHCP
223.1.1.1
server
223.1.1.2
223.1.2.9
223.1.1.4
223.1.2.2
arriving DHCP client needs address in
this network
223.1.1.3
223.1.3.27
223.1.3.2
223.1.3.1
40DHCP client-server scenario
arriving client
DHCP server 223.1.2.5
DHCP offer
src 223.1.2.5, 67 dest 255.255.255.255,
68 yiaddrr 223.1.2.4 transaction ID
654 Lifetime 3600 secs
DHCP request
src 0.0.0.0, 68 dest 255.255.255.255,
67 yiaddrr 223.1.2.4 transaction ID
655 Lifetime 3600 secs
time
DHCP ACK
src 223.1.2.5, 67 dest 255.255.255.255,
68 yiaddrr 223.1.2.4 transaction ID
655 Lifetime 3600 secs
41IP addressing the last word...
- Q How does an ISP get block of addresses?
- A ICANN Internet Corporation for Assigned
- Names and Numbers
- allocates addresses
- manages DNS
- assigns domain names, resolves disputes
42Getting a datagram from source to dest.
forwarding table in A
- datagram remains unchanged, as it travels source
to destination - addr fields of interest here
-
43Getting a datagram from source to dest.
forwarding table in A
misc fields
data
223.1.1.1
223.1.1.3
- Starting at A, send IP datagram addressed to B
- look up net. address of B in forwarding table
- find B is on same net. as A
- link layer will send datagram directly to B
inside link-layer frame - B and A are directly connected
-
44Getting a datagram from source to dest.
forwarding table in A
misc fields
data
223.1.1.1
223.1.2.3
- Starting at A, dest. E
- look up network address of E in forwarding table
- E on different network
- A, E not directly attached
- routing table next hop router to E is 223.1.1.4
- link layer sends datagram to router 223.1.1.4
inside link-layer frame - datagram arrives at 223.1.1.4
- continued..
45Getting a datagram from source to dest.
forwarding table in router
misc fields
data
223.1.1.1
223.1.2.3
- Arriving at 223.1.4, destined for 223.1.2.2
- look up network address of E in routers
forwarding table - E on same network as routers interface 223.1.2.9
- router, E directly attached
- link layer sends datagram to 223.1.2.2 inside
link-layer frame via interface 223.1.2.9 - datagram arrives at 223.1.2.2!!! (hooray!)
46ARP
47Host-to-Host Packet Delivery (1 of 22)
48Host-to-Host Packet Delivery (2 of 22)
49Host-to-Host Packet Delivery (3 of 22)
50Host-to-Host Packet Delivery (4 of 22)
51Host-to-Host Packet Delivery (5 of 22)
52Host-to-Host Packet Delivery (6 of 22)
53Host-to-Host Packet Delivery (7 of 22)
54Host-to-Host Packet Delivery (8 of 22)
55Host-to-Host Packet Delivery (9 of 22)
56Host-to-Host Packet Delivery (10 of 22)
57Host-to-Host Packet Delivery (11 of 22)
58Host-to-Host Packet Delivery (12 of 22)
59Host-to-Host Packet Delivery (13 of 22)
60Host-to-Host Packet Delivery (14 of 22)
61Host-to-Host Packet Delivery (15 of 22)
62Host-to-Host Packet Delivery (16 of 22)
63Host-to-Host Packet Delivery (17 of 22)
64Host-to-Host Packet Delivery (18 of 22)
65Host-to-Host Packet Delivery (19 of 22)
66Host-to-Host Packet Delivery (20 of 22)
67Host-to-Host Packet Delivery (21 of 22)
68Host-to-Host Packet Delivery (22 of 22)
69Default Gateway