BEEC 2383 Chapter 5 - Part 1 (Introduction Network Layer)
BEEC 2383 Chapter 5 - Part 1 (Introduction Network Layer)
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 1
Chapter 5 : Introduction to Network Layer
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 2
Chapter 18 : Introduction to Network Layer
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 3
5.1 Network Layer Services
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 4
Introduction to Network Layer
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 6
Introduction to Network Layer
5.1.2 Packetizing
▪ The first duty of the network layer is definitely packetizing:
✓ The source host receives the payload from an upper-layer protocol, adds a
header that contains the source and destination addresses and some other
information that is required by the network-layer protocol (Encapsulating) and
delivers the packet to the data-link layer.
✓ The destination host receives the network-layer packet from its data-link
layer, decapsulates the packet, and delivers the payload to the corresponding
upper-layer protocol. If the packet is fragmented at the source or at routers
along the path, the network layer is responsible for waiting until all fragments
arrive, reassembling them, and delivering them to the upper-layer protocol.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 8
Introduction to Network Layer
5.1.2 Routing and Forwarding
Forwarding
▪ Forwarding can be defined as the action applied by each router
when a packet arrives at one of its interfaces.
▪ The decision-making table a router normally uses for applying this
action is sometimes called the forwarding table and sometimes the
routing table.
▪ To make this decision, the router uses a piece of information in the
packet header, which can be the destination address or a label, to
find the corresponding output interface number in the forwarding
table.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 9
Introduction to Network Layer
5.1.3 Other Services
Error Control
▪ Although error control also can be implemented in the network
layer, the designers of the network layer in the Internet ignored this
issue for the data being carried by the network layer.
▪ One reason for this decision is the fact that the packet in the
network layer may be fragmented at each router, which makes
error checking at this layer inefficient.
▪ The designers of the network layer, however, have added a
checksum field to the datagram to control any corruption in the
header, but not in the whole datagram.
▪ Internet uses an auxiliary protocol, ICMP, that provides some kind
of error control if the datagram is discarded or has some unknown
information in the header.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 10
Introduction to Network Layer
5.1.3 Other Services
Flow Control
▪ The network layer in the Internet, does not directly provide any flow
control.
▪ The datagrams are sent by the sender when they are ready,
without any attention to the readiness of the receiver.
▪ A few reasons for the lack of flow control.
✓ since there is no error control in this layer, the job of the network layer at the receiver
is so simple that it may rarely be overwhelmed
✓ the upper layers that use the service of the network layer can implement buffers to
receive data from the network layer as they are ready and do not have to consume the
data as fast as it is received.
✓ flow control is provided for most of the upper-layer protocols that use the services of
the network layer, so another level of flow control makes the network layer more
complicated and the whole system less efficient
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 11
Introduction to Network Layer
5.1.3 Other Services
Congestion Control
▪ Congestion may occur if the number of datagrams sent by source
computers is beyond the capacity of the network or routers.
▪ In this situation, some routers may drop some of the datagrams.
However, as more datagrams are dropped, the situation may
become worse because, due to the error control mechanism at the
upper layers, the sender may send duplicates of the lost packets.
▪ If the congestion continues, sometimes a situation may reach a
point where the system collapses and no datagrams are delivered.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 12
Introduction to Network Layer
5.1.3 Other Services
Quality of Service
▪ As the Internet has allowed new applications such as multimedia
communication (in particular real-time communication of audio and
video), the quality of service (QoS) of the communication has
become more and more important.
▪ The Internet has thrived by providing better quality of service to
support these applications.
▪ However, to keep the network layer untouched, these provisions
are mostly implemented in the upper layer.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 13
5.2 Packet Switching
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 14
Introduction to Network Layer
5.2.1 Datagram Approach: Connectionless
▪ When the network layer provides a connectionless service, each
packet traveling in the Internet is an independent entity; there is no
relationship between packets belonging to the same message.
▪ A packet belonging to a message may be followed by a packet
belonging to the same message or to a different message.
▪ A packet may be followed by a packet coming from the same or
from a different source.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 15
Introduction to Network Layer
5.2.1 Datagram Approach: Connectionless
▪ The switches in this type of network are called routers.
▪ Each packet is routed based on the information contained in its
header: source and destination addresses.
▪ The router in this case routes the packet based only on the
destination address. The source address may be used to send an
error message to the source if the packet is discarded.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 16
Introduction to Network Layer
5.2.2 Virtual-Circuit Approach: Connection-Oriented
▪ In a connection-oriented service (also called virtual-circuit
approach), there is a relationship between all packets belonging to
a message.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 17
Introduction to Network Layer
5.2.2 Virtual-Circuit Approach: Connection-Oriented
▪ Before all datagrams in a message can be sent, a virtual
connection should be set up to define the path for the datagrams.
▪ After connection setup, the datagrams can all follow the same
path.
▪ The packet not must only contain the source and destination
addresses, it must also contain a flow label, a virtual circuit
identifier that defines the virtual path the packet should follow.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 18
5.3 Network Layer Performance
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 19
Introduction to Network Layer
5.3.1 Delay
Transmission Delay
▪ A sender needs to put the bits in a packet on the line one by one.
▪ If the first bit of the packet is put on the line at time t1 and the last
bit is put on the line at time t2, transmission delay of the packet is
(t2 − t1).
▪ Definitely, the transmission delay is longer for a longer packet and
shorter if the sender can transmit faster.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 20
Introduction to Network Layer
5.3.1 Delay
Propagation Delay
▪ Propagation delay is the time it takes for a bit to travel from point A
to point B in the transmission media.
▪ The propagation delay for a packet-switched network depends on
the propagation delay of each network (LAN or WAN).
▪ The propagation delay depends on the propagation speed of the
media and distance of the link.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 21
Introduction to Network Layer
5.3.1 Delay
Processing Delay
▪ The processing delay is the time required for a router or a
destination host to
✓ receive a packet from its input port,
✓ remove the header,
✓ perform an error detection procedure,
✓ and deliver the packet to the output port (in the case of a router) or
deliver the packet to the upper-layer protocol (in the case of the
destination host).
▪ The processing delay may be different for each packet, but
normally is calculated as an average.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 22
Introduction to Network Layer
5.3.1 Delay
Queuing Delay
▪ Queuing delay can normally happen in a router.
▪ A router has an input queue connected to each of its input ports to
store packets waiting to be processed.
▪ the router also has an output queue connected to each of its output
ports to store packets waiting to be transmitted.
▪ The queuing delay for a packet in a router is measured as the time
a packet waits in the input queue and output queue of a router.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 23
Introduction to Network Layer
5.3.1 Delay
Total Delay
▪ Assuming equal delays for the sender, routers, and receiver, the
total delay (source-to-destination delay) a packet encounters can
be calculated if we know the number of routers, n, in the whole
path.
▪ Note that if we have n routers, we have (n + 1) links.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 24
Introduction to Network Layer
5.3.2 Throughput
▪ Throughput at any point in a network is defined as the number of
bits passing through the point in a second, which is actually the
transmission rate of data at that point.
▪ In a path from source to destination, a packet may pass through
several links (networks), each with a different transmission rate.
▪ The average throughput is determined by the bottleneck (the pipe
with the smallest diameter).
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 25
Introduction to Network Layer
5.3.2 Throughput
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 26
Introduction to Network Layer
5.3.3 Packet Loss
▪ Another issue that severely affects the performance of
communication is the number of packets lost during transmission.
▪ When a router receives a packet while processing another packet,
the received packet needs to be stored in the input buffer waiting
for its turn.
▪ A router, however, has an input buffer with a limited size. A time
may come when the buffer is full and the next packet needs to be
dropped.
▪ The effect of packet loss on the Internet network layer is that the
packet needs to be resent, which in turn may create overflow and
cause more packet loss.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 27
5.4 IPV4 Addresses
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 28
Introduction to Network Layer
5.4.1 Address Space
▪ The identifier used in the IP layer of the TCP/IP protocol suite to
identify the connection of each device to the Internet is called the
Internet address or IP address.
▪ An IPv4 address is a 32-bit address that uniquely and universally
defines the connection of a host or a router to the Internet.
▪ The IP address is the address of the connection, not the host or
the router, because if the device is moved to another network, the
IP address may be changed.
▪ IPv4 addresses are unique in the sense that each address defines
one, and only one, connection to the Internet.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 29
Introduction to Network Layer
5.4.1 Address Space
Notation
▪ An address space is the total number of addresses used by the
protocol. IPv4 uses 32-bit addresses, which means that the
address space is 232 or 4,294,967,296. If there were no
restrictions, more than 4 billion devices could be connected to the
Internet.
▪ There are three common notations to show an IPv4 address:
✓ binary notation (base 2)
IPv4 address is displayed as 32 bits. To make the address more readable,
one or more spaces are usually inserted between each octet (8 bits). Each
octet is often referred to as a byte
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 31
Introduction to Network Layer
5.4.1 Address Space
Hierarchy in Addressing
▪ A 32-bit IPv4 address divided into two parts.
✓ Prefix
defines the network.
n bits length.
✓ suffix
defines the node (connection of a device to the Internet).
(32-n) bits length.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 32
Introduction to Network Layer
5.4.2 Classful Address
▪ When the Internet started, an IPv4 address was designed with a
fixed-length prefix, but to accommodate both small and large
networks
▪ 3 fixed-length prefixes were designed instead of one (n = 8, n = 16,
and n = 24).
▪ The whole address space was divided into five classes (class A, B,
C, D, and E)
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 33
Introduction to Network Layer
5.4.2 Classful Address
▪ Classful addressing
✓ Class A
Network length is 8 bits, but since the first bit, which is 0, defines the class,
we can have only seven bits as the network identifier.
27 = 128 networks in the world that can have a class A address. (16, 777,216 nodes)
✓ Class B
Network length is 16 bits, but since the first two bits, which are (10)2, define
the class, we can have only 14 bits as the network identifier.
214 = 16,384 networks in the world that can have a class B address.
✓ Class C
Network length is 24 bits, but since three bits, (110)2 define the class, we
can have only 21 bits as the network identifier.
221 = 2,097,152 networks in the world that can have a class C address.
✓ Class D, E
Class D, starting with (1110)2 is not divided into prefix and suffix. It is used
for multicast addresses.
Class E, starting with (1111)2 is not divided into prefix and suffix. It is used
as reserve.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 34
Introduction to Network Layer
5.4.3 Classless Address
▪ In classless addressing, variable-length blocks are used that
belong to no classes.
▪ The prefix in an address defines the block (network); the suffix
defines the node (device).
▪ Theoretically, we can have a block of 20, 21, 22, . . . , 232
addresses. One of the restrictions is that the number of addresses
in a block needs to be a power of 2.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 35
Introduction to Network Layer
5.4.3 Classless Address VLSM (Variable Length Subnet Mask)
Prefix Length: Slash Notation
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 36
Introduction to Network Layer
5.4.3 Classless Address
Prefix Length: Slash Notation
▪ Given any address in the block, we normally like to know three
pieces of information about the block to which the address
belongs:
1. The number of addresses:
N = 2(32- n)
2. The first address in the block:
we keep the n leftmost bits and set the (32 − n) rightmost bits all to 0s
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 37
Introduction to Network Layer
5.4.3 Classless Address
Example
A classless address is given as 167.199.170.82/27. We can find the above
three pieces of information as follows.
The number of addresses in the network is 232 - n = 25 = 32 addresses.
Address : 167.199.170.82/27 10100111 11000111 10101010 01010010
First address : 167.199.170.64/27 10100111 11000111 10101010 01000000
last address : 167.199.170.95/27 10100111 11000111 10101010 01011111
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 38
Introduction to Network Layer
5.4.3 Classless Address
Network Address
▪ The first address, the network address, is particularly important
because it is used in routing a packet to its destination network.
▪ let us assume that an internet is made of m networks and a router
with m interfaces. When a packet arrives at the router from any
source host,
✓ the router needs to know to which network the packet should be sent
✓ from which interface the packet should be sent out.
▪ After the network address has been found, the router consults its
forwarding table to find the corresponding interface from which the
packet should be sent out.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 39
Introduction to Network Layer
5.4.3 Classless Address
Network Address
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 40
Introduction to Network Layer
5.4.3 Classless Address
Block Allocation
▪ For the proper operation of the CIDR, two restrictions need to be
applied to the allocated block.,
1. The number of requested addresses, N, needs to be a power of 2.
The reason is that N = 2(32 – n) or n = 32 − log2 N.
If N is not a power of 2, we cannot have an integer value for n.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 41
Introduction to Network Layer
5.4.3 Classless Address
Example
An ISP has requested a block of 1000 addresses.
Since 1000 is not a power of 2, 1024 addresses are granted.
The prefix length is calculated as n = 32 − log21024 = 22.
An available block, 18.14.12.0/22, is granted to the ISP.
It can be seen that the first address in decimal is 302,910,464, which is
divisible by 1024
*** 2h = 1000
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 42
Introduction to Network Layer
5.4.3 Classless Address
Subnetting
▪ An organization that is granted a range of addresses may divide
the range into several subranges and assign each subrange to a
subnetwork (or subnet).
▪ A subnetwork can be divided into several sub-subnetworks. A sub-
subnetwork can be divided into several sub-sub-subnetworks, and
so on.
▪ The subnetworks in a network should be carefully designed to
enable the routing of packets.
▪ We assume the total number of addresses granted to the
organization is N, the prefix length is n, the assigned number of
addresses to each subnetwork is Nsub, and the prefix length for
each subnetwork is nsub.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 43
Introduction to Network Layer
5.4.3 Classless Address
Subnetting
▪ the following steps need to be carefully followed to guarantee the
proper operation of the subnetworks.
1. The number of addresses in each subnetwork should be a power of 2.
2. The prefix length for each subnetwork should be found using the following
formula: nsub = 32 − log2 Nsub
3. The starting address in each subnetwork should be divisible by the number
of addresses in that subnetwork. This can be achieved if we first assign
addresses to larger subnetworks
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 44
Introduction to Network Layer
5.4.3 Classless Address
Example
An organization is granted a block of addresses with the beginning address 14.24.74.0/24. The
organization needs to have 3 subblocks of addresses to use in its three subnets: one subblock
of 10 addresses, one subblock of 60 addresses, and one subblock of 120 addresses.
Design the subblocks.
** 1st address and last address of granted block?
The number of addresses in the largest subblock, which requires 120 addresses, is not a
power of 2. We allocate 128 addresses.
The prefix length for this subnet can be found as n1 = 32 − log2128 = 25.
The first address in this block is 14.24.74.0/25
the last address is 14.24.74.127/25.
The number of addresses in the second largest subblock, which requires 60 addresses, is not
a power of 2 either. We allocate 64 addresses.
The subnet mask for this subnet can be found as n2 = 32 − log2 64 = 26.
The first address in this block is 14.24.74.128/26
the last address is 14.24.74.191/26
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 45
Introduction to Network Layer
5.4.3 Classless Address
Example (cont)
The number of addresses in the smallest subblock, which requires 10 addresses, is not a
power of 2 either. We allocate 16 addresses.
The subnet mask for this subnet can be found as n3 = 32 − log2 16 = 28.
The first address in this block is 14.24.74.192/28
the last address is 14.24.74.207/28.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 46
Introduction to Network Layer
5.4.3 Classless Address
Address Aggregation
▪ One of the advantages of the CIDR strategy is address
aggregation (address summarization or route summarization).
▪ When blocks of addresses are combined to create a larger block,
routing can be done based on the prefix of the larger block.
▪ ICANN assigns a large block of addresses to an ISP.
▪ Each ISP in turn divides its assigned block into smaller subblocks
and grants the subblocks to its customers.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 47
Introduction to Network Layer
5.4.3 Classless Address
Address Aggregation
Example of how four small blocks of addresses are assigned to four organizations
by an ISP. The ISP combines these four blocks into one single block and advertises
the larger block to the rest of the world. Any packet destined for this larger block
should be sent to this ISP. It is the responsibility of the ISP to forward the packet to
the appropriate organization. This is similar to routing we can find in a postal
network. All packages coming from outside a country are sent first to the capital and
then distributed to the corresponding destination.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 48
Introduction to Network Layer
5.4.3 Classless Address
Special Addresses
▪ 5 special addresses that are used for special purposes:
1. This-host address
The only address in the block 0.0.0.0/32
It is used whenever a host needs to send an IP datagram but it does not
know its own address to use as the source address
2. Limited-broadcast address
The only address in the block 255.255.255.255/32
It is used whenever a router or a host needs to send a datagram to all
devices in a network.
The routers in the network, however, block the packet having this address
as the destination; the packet cannot travel outside the network.
3. Loopback address
The block 127.0.0.0/8 0100 0000 0000 0000 0000 0000 0000 0000
A packet with one of the addresses in this block as the destination address
never leaves the host; it will remain in the host.
Any address in the block is used to test a piece of software in the machine.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 49
Introduction to Network Layer
5.4.3 Classless Address
Special Addresses
▪ 5 special addresses that are used for special purposes:
4. Private address
Four blocks are assigned as private addresses:
10.0.0.0/8, 0000 1010 0000 0000 0000 0000 0000 0000
172.16.0.0/12, 1010 1100 0001 0000 0000 0000 0000 0000
192.168.0.0/16, 1100 0000 1010 1000 0000 0000 0000 0000
169.254.0.0/16 1010 1001 1111 1110 0000 0000 0000 0000
5. Multicast address
The block 224.0.0.0/4 is reserved for multicast addresses.
1110 0000 0000 0000 0000 0000 0000 0000
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 50
Introduction to Network Layer ******(Stop Here!!)
5.4.4 Dynamic Host Configuration Protocol (DHCP)
▪ Address assignment in an organization can be done automatically
using the Dynamic Host Configuration Protocol (DHCP).
▪ DHCP is an application-layer program, using the client-server
paradigm, that actually helps TCP/IP at the network layer.
▪ DHCP has found such widespread use in the Internet that it is
often called a plug-and-play protocol.
▪ A network manager can configure DHCP to
✓ Assign permanent IP addresses to the host and routers.
✓ Provide temporary, on demand, IP addresses to hosts.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 51
Dynamic Host Configuration Protocol (DHCP)
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 52
Dynamic Host Configuration Protocol (DHCP)
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 53
DHCP Operation
▪ Address Allocation Methods:
Manual:
The IP address for the client is pre-allocated by the administrator
and DHCP conveys the address to the client.
Automatic:
DHCP automatically assigns a permanent IP address to a client
with no lease period.
Dynamic:
DHCP assigns, or leases, an IP address to the client for a limited
period of time.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 54
DHCP Operation
▪ Dynamic Allocation:
DHCP works in a client/server mode.
When the client connects, the server assigns or leases an IP
address to the device.
The device connects to the network with that leased IP address until
the lease period expires.
The host must contact the DHCP server periodically to extend the
lease.
The leasing of addresses assures that addresses that are no longer
used are returned to the address pool for use by other devices.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 55
Introduction to Network Layer
5.4.4 Dynamic Host Configuration Protocol (DHCP)
▪ DHCP can be used to provide to the host,
✓ computer address
✓ the prefix,
✓ the address of a default router,
✓ and the IP address of a name server.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 56
Introduction to Network Layer
5.4.4 Dynamic Host Configuration Protocol (DHCP)
▪ The 64-byte option field has a dual purpose. It can carry either
additional information or some specific vendor information.
▪ An option is composed of three fields: a 1-byte tag field, a 1-byte
length field, and a variable-length value field.
✓ 1-byte tag field
✓ 1-byte length field,
✓ variable-length value field
▪ If the tag field is 53, the value field defines one of the 8 message
types.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 57
Introduction to Network Layer
5.4.4 Dynamic Host Configuration Protocol (DHCP)
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 58
Introduction to Network Layer
5.4.3 Classless Address
DHCPDISCOVER
The joining host creates a DHCPDISCOVER message in which only the transaction-ID field is
set to a random number. No other field can be set because the host has no knowledge with
which to do so.
This message is encapsulated in a UDP user datagram with the source port set to 68 and the
destination port set to 67.
The user datagram is encapsulated in an IP datagram with the source address set to 0.0.0.0
(“this host”) and the destination address set to 255.255.255.255 (broadcast address). The
reason is that the joining host knows neither its own address nor the server address.
DHCPOFFER
The DHCP server or servers (if more than one) responds with a DHCPOFFER message in
which the your address field defines the offered IP address for the joining host and the server
address field includes the IP address of the server. The message also includes the lease time
for which the host can keep the IP address.
This message is encapsulated in a user datagram with the same port numbers, but in the
reverse order.
The user datagram in turn is encapsulated in a datagram with the server address as the source
IP address, but the destination address is a broadcast address, in which the server allows
other DHCP servers to receive the offer and give a better offer if they can.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 59
Introduction to Network Layer
5.4.3 Classless Address
DHCPREQUEST
The joining host receives one or more offers and selects the best of them. The joining host then
sends a DHCPREQUEST message to the server that has given the best offer. The fields with
known value are set.
The message is encapsulated in a user datagram with port numbers as the first message.
The user datagram is encapsulated in an IP datagram with the source address set to the new
client address, but the destination address still is set to the broadcast address to let the other
servers know that their offer was not accepted.
DHCPACK
Finally, the selected server responds with a DHCPACK message to the client if the offered IP
address is valid. If the server cannot keep its offer (for example, if the address is offered to
another host in between), the server sends a DHCPNACK message and the client needs to
repeat the process.
This message is also broadcast to let other servers know that the request is accepted or
rejected.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 60
Introduction to Network Layer
5.4.5 Network Address Translation (NAT)
Assume that an ISP has granted a small range of addresses to a small business or a
household. If the business grows or the household needs a larger range, the ISP may not be
able to grant the demand because the addresses before and after the range may have already
been allocated to other networks.
▪ The technology allows a site to use a set of private addresses for internal
communication and a set of global Internet addresses (at least one) for
communication with the rest of the world.
▪ The site must have only one connection to the global Internet through a NAT-
capable router that runs NAT software.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 61
What is NAT?
▪ The DHCP server assigns IP dynamic addresses to devices
inside the network.
▪ NAT-enabled routers retain one or many valid Internet IP
addresses outside of the network.
▪ When the client sends packets out of the network, NAT
translates the internal IP address of the client to an external
address.
▪ To outside users, all traffic coming to and going from the
network has the same IP address or is from the same pool of
addresses.
NAT
Private Address Public Address
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 62
Introduction to Network Layer
5.4.5 Network Address Translation (NAT)
The private network is invisible to the rest of the Internet; the rest of the Internet sees only
the NAT router with the address 200.24.5.8
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 63
Introduction to Network Layer
5.4.5 Network Address Translation (NAT)
Address Translation
▪ All of the outgoing packets go through the NAT router, which replaces the source
address in the packet with the global NAT address.
▪ All incoming packets also pass through the NAT router, which replaces the
destination address in the packet (the NAT router global address) with the
appropriate private address.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 64
Introduction to Network Layer
5.4.5 Network Address Translation (NAT)
Translation Table: Using One IP Address
▪ In its simplest form, a translation table has only two columns: the private address
and the external address (destination address of the packet).
▪ When the router translates the source address of the outgoing packet, it also
makes note of the destination address.
▪ When the response comes back from the destination, the router uses the source
address of the packet (as the external address) to find the private address of the
packet.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 65
Introduction to Network Layer
5.4.5 Network Address Translation (NAT)
Translation Table: Using a Pool of IP Addresses
▪ The use of only one global address by the NAT router allows only one private-
network host to access a given external host.
▪ To remove this restriction, the NAT router can use a pool of global addresses
(eg: 200.24.5.8, 200.24.5.9, 200.24.5.10, and 200.24.5.11).
▪ In this case, no more than 4 private-network hosts can communicate with the
same external host at the same time because each pair of addresses defines a
separate connection.
▪ However, there are still some drawbacks;
✓ No more than four connections can be made to the same destination.
✓ No private-network host can access two external server programs (e.g.,
HTTP and TELNET) at the same time.
✓ Likewise, two private-network hosts cannot access the same external
server program (e.g., HTTP or TELNET) at the same time.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 66
Introduction to Network Layer
5.4.5 Network Address Translation (NAT)
Translation Table: Using Both IP Addresses and Port Addresses
▪ To allow a many-to-many relationship between private-network hosts and external
server programs, translation table has five columns, include the source and
destination port addresses and the transport-layer protocol.
Suppose two hosts inside a private network with addresses 172.18.3.1 and 172.18.3.2 need to
access the HTTP server on external host 25.8.3.2.
Note that when the response from HTTP comes back, the combination of source address
(25.8.3.2) and destination port address (1401) defines the private network host to which the
response should be directed.
Note also that for this translation to work, the ephemeral port addresses (1400 and 1401)
must be unique.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 67
Dynamic Mapping and Static Mapping
NAT Table
▪ Static Mapping: Inside Local Inside Global
One to one mapping of local 10.0.0.1 179.9.8.81
and global addresses. 10.0.0.2 179.9.8.82
The hosts able to use NAT is 10.0.0.3 179.9.8.83
limited by the static
assignment in the table. 10.0.0.4 179.9.8.84
10.0.0.5 179.9.8.85
10.0.0.6 179.9.8.86
If you have allocated 6 public addresses for NAT, only these 6 users can
use NAT.
No other network users will have access unless you allocate
another global address and add it to the table.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 68
Dynamic Mapping and Static Mapping
NAT Table
▪ Dynamic Mapping: Inside Local Inside Global
Mapping of local addresses 10.0.0.1 179.9.8.81
dynamically to a pool of
global addresses. 10.0.0.2
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 69
IPv6 Addressing
• The main reason for migration from IPv4 to IPv6 is the small
size of the address space in IPv4.
• In this section, we show how the huge address space of IPv6
prevents address depletion in the future.
• We also discuss how the new addressing responds to some
problems in the IPv4 addressing mechanism.
• An IPv6 address is 128 bits or 16 bytes (octets) long, four
times the address length in IPv4.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 70
70
22.1.1 Representation
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 71
71
22.1.2 Address Space
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 72
72
22.1.3 Address Space Allocation
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 73
73
Table: Prefixes for assigned IPv6 addresses
• Table shows only the assigned blocks. In this table, the last
column shows the fraction each block occupies in the whole
address space.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 74
Figure shows Global unicast address
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 75
75
Autoconfiguration
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 76
76
IPv4 versus IPv6
▪ IP version 6 (IPv6) has been defined and developed.
▪ IPv6 uses 128 bits rather than the 32 bits currently used in IPv4.
▪ IPv6 uses hexadecimal numbers to represent the 128 bits.
IPv4
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 77
77
Long Term Solution: IPv6 (coming)
▪ IPv6, or IPng (IP – the Next Generation) uses a 128-bit address
space, yielding
340,282,366,920,938,463,463,374,607,431,768,211,456
possible addresses.
▪ IPv6 has been slow to arrive
▪ IPv4 revitalized by new features, making IPv6 a luxury, and not
a desperately needed fix
▪ IPv6 requires new software; IT staffs must be retrained
▪ IPv6 will most likely coexist with IPv4 for years to come.
▪ Some experts believe IPv4 will remain for more than 10 years.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 78
78