Professional Documents
Culture Documents
Network Layer
Network Layer
Network Layer
Layer
IPV4,
CIDR
NAT,
IPV6,
ARP, RARP,
ICMP, IGMP,
DHCP,
OSPF, BGP
IPv4 ADDRESSING SCHEME
3
According to its use IP address is of two types
Private IP address:
Given to nodes in the local area network, private for the
organization.
These are not to be known by the outside world.
Some range of IP address in Class A, B, C are reserved for
private use:
Class A - 10.0.0.0, Class B- 173.16.0.0 to 173.31.0.0 Class C-
192.168.0.0 to 192.168.255.255
4
IP address contains three parts
Class Type Netid Host id
6
21 bits for Netid 2 million different networks.
8 bits for Hostid- 254 hosts/network
The address starts from 192.0.0.0-223.255.255.255
7
A Host ID with all 1s means packet has to broadcast to
all host of the network.
8
IP addresses are represented by dotted decimal
notation.
10
Both of these problems were attacked by adding another
level of hierarchy to the IP addressing structure.
12
If a network has a subnet it extracts Subnet address else
Network address.
13
The extended-network-prefix is composed of the classful
network-prefix and the subnet-number.
14
For Subnetted Network :
15
Masking is of two types
1) Boundary Level masking :
Masking numbers are 255 and 0
And the mask address with the IP address
to get the subnetted address.
e.g.
45. 33. 41. 9
AND 255. 255. 0. 0
45. 33. 0. 0
Non Boundary Level Masking
Masking numbers are 255,0 and any other
numbers.
e.g.
45. 123. 41. 9
AND 255. 192. 0. 0
45. 64. 0. 0
16
from 64 to 127 it will give 64 which is the
starting address of this network
18
Subnet Design Considerations :
The deployment of an addressing plan requires careful
thought on the part of the network administrator.
There are four key questions that must be answered
before any design should be undertaken:
1) How many total subnets does the organization need
today?
2) How many total subnets will the organization need in the
future?
3) How many hosts are there on the organization's largest
subnet today?
4) How many hosts will there be on the organization's
largest subnet in the future?
19
The All-0s Subnet and The All-1s Subnet
When subnetting was first defined in RFC 950, it
prohibited the use of the all-0s and the all-1s subnet.
The reason for this restriction was to eliminate situations
that could potentially confuse a classful & classless
router at the same time.
20
Regarding the all-1s subnet,
A router requires that each routing table entry include the
prefix-length so that it can determine if a broadcast
(directed or all-subnets) should be sent only to the all-1s
subnet or to the entire network.
For example, confusion can occur because the same
broadcast address (193.1.1.255) is used for both for the
entire network 193.1.1.0/24 and the all-1s subnet
193.1.1.224/27. This is illustrated in Figure
23
VLSM (Variable Length Subnet Mask)
192.203.17.0
Default subnet mask = 255.255.255.0
But a subnet mask of 255.255.255.X can be used
to divide it into more subnets.
Options of X can be:
But this is X X in binary No. of No. of
subnets hosts.
not satisfying
128 10000000 2 128
our
192 11000000 4 64
requirement of 224 11100000 8 32
110, 45, 50 240 11110000 16 16
248 11111000 32 8
252 11111100 64 4
24
VLSM (Variable Length Subnet Mask)
Solution
First using X=128 (255.255.255.128) we get two
subnets of 0-127 (and 128-255). 256
Thus our specification of
110 addresses can be taken 128 128
128 128
64 25 64
VLSM (Variable Length Subnet Mask)
192.203.17.0
256
128 128
64 64
192.203.17.128 to .191
192.203.17.192 to .255
26
Still Running out of address:
Severe strain on classfull model due to wastage of
address.
Solution
CIDR.
IP version 6
Private IP address and NAT.
27
Classless Inter-Domain Routing (CIDR)
No concept of Class A,B,C network.
Reduce load on routers.
Every IP address is represented by
Prefix-Actual IP address.
Followed by a slash (/) and a number M.
M: No. of left most contiguous bits used to
define the network mask.
Example: 144.16.192.57/18
Thumb rule that should be taken care of:
Each block should be a multiple of 2.
Beginning address of each block must be divisible
by number of address in the block.
28
Classless Inter-Domain Routing (CIDR)
Example:
Consider an organization is given a block
144.16.192.24/29
So how many address in the block?
Starting address
144.16.192.24- 10010000.00010000.11000000.00011000
/29 - 11111111.11111111.11111111.11111000
End address- 10010000.00010000.11000000.00011111
144.16.192.31
It means there are 8 address in the block.
Existing classfull networks can be represented as
Class A: x.y.z.w/8 Class B: x.y.z.w/16 Class C: x.y.z.w/24
29
NAT-Network Address Translation
NAT is a way to conserve IP addresses
Hide a number of hosts behind a single IP address
Expand IP address space by deploying private address
and translating them into publicly registered addresses
First described in RFC 1631.
H1 H2 H3 H4
10.0.1.1 10.0.1.1
Private network 1 Private network 1
Internet
R1 128.195.4.119 128.143.71.21 R2
213.168.112.3
H5
NAT-Network Address Translation
NAT is a router function where IP addresses (and
possibly port numbers) of IP datagrams are
replaced at the boundary of a private network
34
Pooling of IP addresses
Private Internet
network
Private Public
Address Address
10.0.1.2
35
Supporting migration between network service
providers
Scenario: In CIDR, the IP addresses in a corporate network are obtained
from the service provider. Changing the service provider requires changing
all IP addresses in the network.
NAT solution:
Assign private addresses to the hosts of the corporate network
NAT device has static address translation entries which bind the
private address of a host to the public address.
Migration to a new network service provider merely requires an
update of the NAT device. The migration is not noticeable to the hosts
on the network.
Note:
The difference to the use of NAT with IP address pooling is that the
mapping of public and private IP addresses is static.
36
Supporting migration between network service
providers
37
IP masquerading
Also called: Network address and port
translation (NAPT), port address translation
(PAT).
Scenario: Single public IP address is mapped to
multiple hosts in a private network.
NAT solution:
Assign private addresses to the hosts of the corporate
network
NAT device modifies the port numbers for outgoing
traffic
38
IP masquerading
Private Public
Address Address
10.0.1.2/2001 128.143.71.21/2100
10.0.1.3/3020 128.143.71.21/4444
39
Load balancing of servers
Scenario: Balance the load on a set of identical servers,
which are accessible from a single IP address
NAT solution:
Here, the servers are assigned private addresses
NAT device acts as a proxy for requests to the server from
the public network
The NAT device changes the destination IP address of
arriving packets to one of the private addresses for a
server
A sensible strategy for balancing the load of the servers is
to assign the addresses of the servers in a round-robin
fashion.
40
Load balancing of servers
41
Concerns about NAT
Performance:
Modifying the IP header by changing the IP address
requires that NAT boxes recalculate the IP header
checksum
Modifying port number requires that NAT boxes
recalculate TCP checksum
Fragmentation
Care must be taken that a datagram that is
fragmented before it reaches the NAT device, is not
assigned a different IP address or different port
numbers for each of the fragments.
42
Concerns about NAT
End-to-end connectivity:
NAT destroys universal end-to-end reachability of
hosts on the Internet.
A host in the public Internet often cannot initiate
communication to a host in a private network.
The problem is worse, when two hosts that are in
a private network need to communicate with each
other.
43
Concerns about NAT
IP address in application data:
Applications that carry IP addresses in the payload
of the application data generally do not work
across a private-public network boundary.
Some NAT devices inspect the payload of widely
used application layer protocols and, if an IP
address is detected in the application-layer header
or the application payload, translate the address
according to the address translation table.
44
IPv6
Why IPv6?
IPv6 Address
Source Address
Destination Address
Options Padding Source Address
Destination Address
IPv6
IPv6 Header Format
Type of Traffic
Version IHL Total Length Version Flow Label
Service Class
Fragment
Identification Flags Next
Offset Payload Length Hop Limit
Header
Time to Live Protocol Header Checksum
Source Address
Source Address
Destination Address
Options Padding
Destination Address
Source Address
Source Address
Destination Address
Options Padding
Destination Address
Flow: Given one particular source and another destination then for
this particular source and destination pair there is a flow level.
Means these two are likely to send large number of packets and
all of them would belong to the same flow.
For example, there may be class of service or all kinds of quality
of service requirements for one particular flow that may require
bandwidth reservation in between.
IPv6
IPv6 Header Format
Type of Traffic
Version IHL Total Length Version Flow Label
Service Class
Fragment
Identification Flags Next
Offset Payload Length Hop Limit
Header
Time to Live Protocol Header Checksum
Source Address
Source Address
Destination Address
Options Padding
Destination Address
Payload Length: Only include the payload and not the 20-byte Header.
This is of 16-bits for that so packets are once again less than or equal to 64 k.
Next Header: This gives rise to the possibility that there may be more
than one header.
If there are not any more IPv6 Headers then, at least the higher layer headers
like TCP or UDP Headers.
IPv6
IPv6 Header Format
Type of Traffic
Version IHL Total Length Version Flow Label
Service Class
Fragment
Identification Flags Next
Offset Payload Length Hop Limit
Header
Time to Live Protocol Header Checksum
Source Address
Source Address
Destination Address
Options Padding
Destination Address
Hop Limit. This is really the TTL (Time to Live) which was present
earlier in IPv4 but was used to just keep the count of the Hop and
this is just renamed as Hop Limit.
Source Address
Destination Address
IPv6
IPv6 Address Types
Unicast
Address for a single interface.
A packet sent to a unicast address is delivered to the interface
identified by that address.
Anycast
Multiple devices share the same address.
A packet sent to an anycast address is delivered to one of the
interfaces identified by that address (the "nearest" one,
according to the routing protocols' measure of distance).
Multicast
One-to-many
Enables more efficient use of the network
Uses a larger address range
IPv6
IPv6 Address Types
Multicast
An identifier for a set of interfaces (typically belonging to
different nodes).
A packet sent to a multicast address is delivered to all
interfaces identified by that address.
Examples:
2031:0000:130F:0000:0000:09C0:876A:130B
2031:0:130f::9c0:876a:130b
FF01:0:0:0:0:0:0:1 >>> FF01::1
0:0:0:0:0:0:0:1 >>> ::1
0:0:0:0:0:0:0:0 >>> ::
IPv6
Examples:
1080:0000:0000:0000:0008:08A0:200C:417A
Leading zeros can be omitted, but one zero remains if all 4
hexadecimal digits are zero.
1080:0:0:0:8:8A0:200C:417A
One string of single colon separated zeros can be abbreviated
to a :: (Not more than one)
1080::0008:08A0:200C:417A
IPv6
H1 H2 H3 H4
H1 knows physical address wants to know its IP address -> broadcasts an RARP request
H1 H2 S H4
Unused
Data
BGP-4 runs over a reliable transport (TCP) and uses the well-
known port 179.