Network Layer
Download
Report
Transcript Network Layer
IP Addressing: introduction
IP address: 32-bit
identifier for host,
router interface
interface: connection
between host/router
and physical link
router’s typically have
multiple interfaces
host typically has one
interface
IP addresses
associated with each
interface
223.1.1.1
223.1.2.1
223.1.1.2
223.1.1.4
223.1.1.3
223.1.2.9
223.1.3.27
223.1.2.2
223.1.3.2
223.1.3.1
223.1.1.1 = 11011111 00000001 00000001 00000001
223
1
1
Network Layer
1
4-1
IP datagram format
IP protocol version
number
header length
(bytes)
“type” of data
max number
remaining hops
(decremented at
each router)
upper layer protocol
to deliver payload to
32 bits
head. type of
length
ver
len service
fragment
16-bit identifier flgs
offset
upper
time to
header
layer
live
checksum
total datagram
length (bytes)
for
fragmentation/
reassembly
32 bit source IP address
32 bit destination IP address
Options (if any)
data
(variable length,
typically a TCP
or UDP segment)
E.g. timestamp,
record route
taken, specify
list of routers
to visit.
Network Layer
4-2
Class Handouts…
(provided in class)
Network Layer
4-3
Solve…
A software company has 100 employees.
What would be the ideal class from which the company would choose
its network IP to prevent wastage of IP addresses?
How many bits would be assigned for network part and how many bits
would be assigned for host part?
Note a network chosen by a company can not be chosen by
any other company.
The company suddenly goes through increase in number of
employees from 100 to 2000.
How many network addresses should the company choose and from
which class to avoid wastage of IP addresses?
Network Layer
4-4
What is the solution?
A company starts out
with one class C LAN…
As it requires more
than 254 machines,
one class C LAN is not
sufficient
Choose one class B
Is it efficient?
Choose multiple
class C
Choices?
Network Layer
4-5
What is the impact of this solution?
Advantages
Certainly able to
minimize the IP
address wastage
Disadvantages
Increased number of
distinct local networks
inside the same company
Managing is tough
Moving machines across
the local networks
Network Layer
4-6
What can be a potential solution?
Network Layer
4-7
IP addressing: CIDR
CIDR: Classless InterDomain Routing
network portion of address of arbitrary length
address format: a.b.c.d/x, where x is # bits in
network portion of address
network
part
host
part
11001000 00010111 00010000 00000000
200.23.16.0/23
Network Layer
4-8
Solve…
Now the company decided to go with the CIDR mechanism
for 2000 employees.
What would be the ideal network address to minimize wastage of IP
addresses?
How many bits in network part and how many bits in host part are
there?
Network Layer
4-9
DHCP: 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 [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-10
DHCP client-server scenario
A
B
223.1.2.1
DHCP
server
223.1.1.1
223.1.1.2
223.1.1.4
223.1.2.9
223.1.2.2
223.1.1.3
223.1.3.1
223.1.3.27
223.1.3.2
E
arriving DHCP
client needs
address in this
network
Network Layer
4-11
DHCP client-server scenario
DHCP server: 223.1.2.5
DHCP discover
arriving
client
src : 0.0.0.0, 68
dest.: 255.255.255.255,67
yiaddr: 0.0.0.0
transaction ID: 654
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
time
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs
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
Network Layer 4-12