Week 10 Lec 1-BEE1C
Week 10 Lec 1-BEE1C
Week 10 Lec 1-BEE1C
Network Layer
Computer Networking: A
Top Down Approach
4th edition.
Jim Kurose, Keith Ross
Addison-Wesley, July
2007.
Last Lecture
Todays Lecture
IP
Addressing
Classful Addressing
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 routers
Router examines header fields in all IP datagrams
passing through it
application
transport
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
network
data
link
data link
physical
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
application
transport
network
data link
physical
Forwarding Table
o Router Forwards a
packet by examining the
destination address of the
packet
o Routing Algorithm
value in arriving
determines the values
packets header
that are inserted in the
routers forwarding tables
0100
0101
0111
1001
0111
3
2
2
1
1
3 2
Network Layer
Host, router network layer functions:
Transport layer: TCP, UDP
Network
layer
IP protocol
addressing conventions
datagram format
packet handling conventions
Routing protocols
path selection
RIP, OSPF, BGP
forwarding
table
ICMP protocol
error reporting
router signaling
Link layer
physical layer
type of
ver head.
len service
length
fragment
16-bit identifier flgs
offset
time to
header
protocol
live
checksum
total datagram
length (bytes)
for
fragmentation/
reassembly
data
(variable length,
a TCP
or UDP segment)
e.g. timestamp,
record route
taken etc
Find other use?
fragmentation:
in: one large datagram
out: 3 smaller datagrams
reassembly
header
Identification Number
o
o
Flag Bit
o
o
Offset Field
o
Flag
1st Fragment
1480 bytes
777
1 (there is more)
2nd Fragment
1480 bytes
777
185
1 (there is more)
3rd Fragment
1020 bytes
777
370
0 (Last )
IP Address
An IP address is a 32-bit address.
The IP addresses are unique.
The address space of IPv4 is
232 or 4,294,967,296.(more than 4 billion)
Represented in binary or decimal
CLASSFUL ADDRESSING
IP addressing when started used the concept of
classes.
This architecture is called classful addressing.
Organizations can be of different sizes
Require varying numbers of IP addresses on the Internet.
IP Address Classes
There are five classes in the classful system, which are
given letters A through E.
The first few bits in binary notation can immediately tell
us the class of the address
IP Address Classes
Class A
Class A is divided into 128 blocks (27)
Each block having different Netid
First block covers addresses from
0.0.0.0 to 0.255.255.255 (netid 0)
Second block covers addresses from
1.0.0.0 to 1.255.255.255 (netid 1)
The last block covers addresses from
127.0.0.0 to 127.255.255.255 (netid 127)
Each block in this class contains 16,777,216 addresses
Class A addresses were designed for large
organizations with large number of hosts attached to
their network
Class B
Class B is divided into 16384 blocks (214)
Each block having different netid
First block covers addresses from
128.0.0.0 to 128.0.255.255 (netid 128.0)
The last block covers addresses from
191.255.0.0 to 191.255.255.255 (netid 191.255)
Each block in this class contains 65,536 addresses
Class B addresses were designed for medium size
organizations with thousands of hosts attached to
their network
65,536 is also too large for medium size organizations, many
of class B addresses are wasted
Class C
Class C is divided into 2097152 blocks (221)
Each block having different netid
First block covers addresses from
192.0.0.0 to 192.0.0.255 (netid 192.0.0)
The last block covers addresses from
223.255.255.0 to 223.255.255.255 (netid
223.255.255)
Each block in this class contains 256 addresses
Class C addresses were designed for small
organizations
256 is small for most organizations
IP Address Classes
Given the network address 17.0.0.0, find the
class, the netid, and the range of the
addresses?.
IP Address Classes
Solution
The class is A because the first byte is between
0 and 127. The block has a netid of 17. The
addresses range from 17.0.0.0 to
17.255.255.255.
IP Address Classes
Given the network address 220.34.76.0, find
the class, the block/netid, and the range of the
addresses?.
IP Address Classes
Solution
The class is C because the first byte is between
192 and 223. The block has a netid of
220.34.76. The addresses range from
220.34.76.0 to 220.34.76.255
Example:
Hosts needed by organization are 5000
Hosts in B 65,536 and in C 256
Organization with 5,000 hosts is in a dilemma
It can only choose to either waste 90% of a Class B address
or use 20 different Class C networks.
Replacing with 20 C networks will increase entries in routers
Subnetting
To better meet the administrative and technical
requirements of larger organizations, the classful
IP addressing system was enhanced through a
technique known as subnet addressing or subnetting.
A three-level hierarchy is created: networks, which
contain subnets, each of which then has a number of
hosts.
Subnetting
Subnetting adds an additional level to the hierarchy
of structures used in IP addressing.
IP addresses must be broken into three elements
instead of two.
Network ID is unchanged
The host ID into a subnet ID and host ID.
These subnet ID bits are used to identify each
subnet within the network.
Splitting the host ID into subnet ID and host ID, we
reduce the size of the host ID portion of the address
Class A networks have 24 bits to split between the
subnet ID and host ID: class B networks have 16, and
class C networks only 8.
Subnetting
The more bits we use from the host ID for the subnet ID, the more
subnets we can have but the fewer hosts we can have for each subnet.
Subnet Mask
In classful addressing without subnetting
Routers use the first octet of the IP address to determine
what the class is of the address
From class they know which bits are the network ID and
which are the host ID.
Designing a Subnet
Example:
Network Address: 211.77.20.0
8 sub networks
32 hosts in each
Designing a Subnet
Designing a Subnet
211.77.20.0 in binary is
11010011 01001101 00010100 00000000
Subnet 0
substitute 000 for the subnet ID bits (211.77.20.0)
Subnet 1
substitute 001 for the subnet ID bits, to yield the following:
11010011 01001101 00010100 00100000 (211.77.20.32 )
Subnet 2
substitute 010 for the subnet ID bits to give:
11010011 01001101 00010100 01000000 (211.77.20.64)
Subnet 3
Substitute 01100000 (211.77.20.96)
Subnet 7 (last)
Substitute 11100000 (211.77.20.224)
Designing a Subnet
Subnet #0
First address: 11010011 01001101 00010100 00000000 (211.77.20.0)
Second address: 11010011 01001101 00010100 00000001
(211.77.20.1)
Third address: 11010011 01001101 00010100 00000010
(211.77.20.2)
Last address: 11010011 01001101 00010100 00011111
(211.77.20.31)
Subnet #6.
It has 110 for the subnet bits instead of 000.
First address: 11010011 01001101 00010100 11000000
(211.77.20.192)
Second address: 11010011 01001101 00010100 11000001
(211.77.20.193)
Third address: 11010011 01001101 00010100 11000010
(211.77.20.194)
Last address: 11010011 01001101 00010100 11011111
(211.77.20.223)
Similarly for other subnets
Designing a Subnet
Home Assignment
A company is granted the site address
172.16.0.0. The company needs 1000
subnets. Design the subnets?
Advantages of Subnetting?