Unit 3 DCN
Unit 3 DCN
Networking
Unit – III
Prof. Rupali A. Meshram
Network Layer
Network Layer
N1 N2
R1 R2
Network Layer
• Host to Host/Source to Destination/Machine
to Machine
• Logical Addressing(IP Address)
• Router (RIP,OSPF)
• Fragmentation
• Congestion Control
Network Layer
• Network layer must know about the topology of the
network (i.e., the set of all routers and links) and choose
appropriate paths through it, even for large networks.
32 bit
Block ID Host ID
First Address
• Solution
• The binary representation of the given address is
11001101 00010000 00100101 00100111
• If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000
or
205.16.37.32.
Last Address
• Solution
• The binary representation of the given address is
11001101 00010000 00100101 00100111
• If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111
or
205.16.37.47
Block Address
Solution
• The value of n is 28, which means that number
of addresses is 2 32−28 or 16.
Example
• Another way to find the first address, the last address, and the
number of addresses is to represent the mask as a 32-bit binary
(or 8-digit hexadecimal) number. This is particularly useful when
we are writing a program to find these pieces of information. In
Example 19.5 the /28 can be represented as
• 11111111 11111111 11111111 11110000
• (twenty-eight 1s and four 0s).
Find
a. The first address
b. The last address
c. The number of addresses.
Solution
• The first address can be found by ANDing the
given addresses with the mask. ANDing here is
done bit by bit. The result of ANDing 2 bits is 1
if both bits are 1s; the result is 0 otherwise.
Solution
• The last address can be found by ORing the
given addresses with the complement of the
mask. Oring here is done bit by bit. The result of
ORing 2 bits is 0 if both bits are 0s; the result is
1 otherwise. The complement of a number is
found by changing each 1 to 0 and each 0 to 1.
Solution
• The number of addresses can be found by
complementing the mask, interpreting it as a
decimal number, and adding 1 to it.
Solution
• A network configuration for the block
205.16.37.32/28
Important
• The first address in a block is
normally not assigned to any device;
it is used as the network address that
represents the organization
to the rest of the world.
Network Address Translation (NAT)
• To access the Internet, one public IP address is needed, but we can
use a private IP address in our private network.
• When a packet traverse outside the local (inside) network, then NAT
converts that local (private) IP address to a global (public) IP address.
• When a packet enters the local network, the global (public) IP address is
converted to a local (private) IP address.
• If NAT run out of addresses, i.e., no address is left in the pool configured
then the packets will be dropped and an Internet Control Message
Protocol (ICMP) host unreachable packet to the destination is sent.
Network Address Translation
Network Address Translation
Network Address Translation
Network Address Translation (NAT) Types
• Port numbers are used to distinguish the traffic i.e., which traffic
belongs to which IP address.
corresponding 180.70.65.128/25 - m0
forwarding 201.4.22.0/24 - m3
table for 201.4.16.0/22 - m1
router R1 Default 180.70.65.200 m2
Network Next hop Interface
• Eg. Address/ Mask
180.70.65.192/26 - m2
180.70.65.128/25 - m0
201.4.22.0/24 - m3
201.4.16.0/22 - m1
Default 180.70.65.200 m2