Unit-3 CN Notes
Unit-3 CN Notes
Unit-3 CN Notes
5.20. ARP (ADDRESS RESOLUTION PROTOCOL)* (U.P. Tech. Sem. Exam, 2007-08)(05 marks)
An Internet consists of various types of networks and the
- - - - - - - - - .
connecting devices like routers. A packets
Explain how do ARP and RARP map IP addresses onto data link layer such as Ethernet ?
(ULP. Tech, Sem. Exam; 2007-08) (10 marks)
Network Layer 281
from the source host, passes
rts
At the network level, the through many
hosts and routersphysical networks and finally reaches the
1.1PAddress
are
recognised by their IP addresses. desU
An IP address is an
lnternetwork address. It is a
involved in
Internetworking requires IP addresses. universally unique address, Fvery pro col
2. MAC Address
The packets trom source to
destination hosts pass through
level, the 1P address is not usetul but the
hosts and routers are
physical networks. At the physical
AMAC address is a local address. It is unique recognized by their MAC addresses.
MAC address are two ditterent identifiers and both locally but it is not unique
universally. The IP and
of them are needed, because a
can have two ditterent protocols at the
network layer at the same time. physical network
through different physical networks. Similarly, packet may pass
a
A Sender Receiver
ARP request packet
Every host and router on the network receives and processes the ARP request packet. But only
the intended receiver (B) recognizes its IP address in the request packet and sends back an ARP
response packet. The ARP response packet contains the IP and physical addresses of the receiver
(B). This packet is delivered only to A (unicast) using A's physical address in the ARP request packet.
This has been shown in figure 5.39.
A
Sender B Receiver
ARP response packet
frame
cap ulated in a frame and the
284 Computer Networks
5.21. REVERSE ADDRESS RESOLUTION PROTOcOL (RARP)
Option+ Padding
Fig. 5.43 IP header structure
Sketch the IP header neatly and explain the function of each field. List major differences between lv4
and IPv6. (u.P. Tech, Sem. Exam; 2007-08) (05 marks)
Various fields in the IP header are as under:
1. VER (Version)
This field defines the version of IP. Current version of IP is IPv4 and the latest version of i 1s
four bit long field.
IPv6. It is a
4. Total length
The field defines the total length of the IP datagram. The total length includes the length ot
header as well as the data field. The field length of this fields is 16 bits so the total length of the IP
is restricted to (216 1) =
20 to 60 bytes are the header and the
65535 bytes of which
datagram such
remaining are data. This field allows the length of a datagram to be upto 65,535bebytes, although
long datagrams are impractical for most hosts and networks. All
hosts must prepared to accept
arrive whole or in fragments. It is
datagramn of upto 576 bytes, regardless of whether they the destination is prepared to
recommended that hosts and datagram larger than 576 bytes only if
accept larger datagram.
5. Identification, Flag and Offset
() Identification
from the source host. When a datagram is
offset of
the I ' packet (datagram) ontains 400 byt
im. It is the
figure 45. The original
5.4
ted into three tragnents.
consider
understand this let u s
is fragmenteo
3999. It from O to 1399 The
otos
numbered from 0 to
1400 bytes
numbered
fragment
contains * - 1 7 5 and 2800 - 350 respectively
ihe first 1
are
two f r a g m e n t s
offsets fortheother
imilarly, the
286 Computer Networks
of the offset
units of 8 bytes. Because the length
as shown in figure 5.45. The offset is measured in such that first byte number is divisible by 8.
ield is 13 bits. So, the fragments should be of size
Offset =0/8 0
1399
1400 2799
Byte 0 Byte
3999
Three fragments
Fig.5.45 Example of fragmentation
6. Time to Live
This is an 8 bit long field which controls the maximum number of routers visited by the datagram
7. Protocol
This field defines the higher-level protocol which uses the services of the IP Layer. An Pdatagram
can encapsulate data from various higher level protocols such as TCP, UDP, ICMP and IGMP. The
protocol field specifies the final destination protocol to which the IP datagram should be delivered.
Since IPmultiplexes and demultiplexes data from different higher level protocols, the value of protocol
field helps in demultiplexing at the final destination.
8. Header Checksum
A checksum in IP packet covers on the header only. Since some header fields change, this field is
recomputed and verified at each point that the internet header is processed.
9. Source Address
This field is used for defining the IP address of the source.
10. Destination Address
This field is used for defining the IP address of the destination.
11. Options
Options are not required for every datagram. They are used for network testing and debugging
IPprovides several optional features, allowinga packet's sender to set requirements on the path it
takes through the network (source routing), trace the route a packet takes (record route), and label
packets with security features.
1. Class A address
The network field is 7 bit long as shown in
figure 5.46 (a) and the host field is of 24 bit length. So
the network field can have numbers between1 to 126. But the host numbers will
range from 0.0.0.0
to 127.255.255.255. Thus, in class A, there can be 126 types of networks and 17 million hosts. The 0 in
the first field identifies that it is a class A network address.
2. Class B format
The class B address format is shown in figure 5.46 (b). The first two fields
identify the network,
and the number in the first field must be in the range 128-191
Class B networks are large. Host numbers 0.0 and 255.255 are reserved, so, there can be upto
5,534 (216 -2) hosts in a class B network. Most of the16,382 class B addresses have been allocated.
The first block covers address from 128.0.0.0 to 128.255.255.255 and the last block covers from
191.255.0.0 to 191.255.255.255.
128.89.0.26, for host 0.26 on net 128.89.
Example:
14 bits 16 bits 21 bits bits
Specific All Os
115.50.15.90 115.63.7.30
L ****
Note that 115 is common
in the address of all machines
in class A network
115.90.121.4
115.0.0.0
Network address
(a) Class A network address
151.15.0.0 151.15.67.63
Network address
(b) Class B network address
223.21.70.4 223.21.70.58
Network address
(c) Class C network address
Fig. 5.48.
5.22.7. Address Masks (Default Masks) (U.P. Tech, Sem. Exam; 2005-06)(05 marks)
An address mask determines which portion of an IP address identifies the network and which
portion identifies the host. Like the IPaddress, the mask is represented by four octets. (An octet is an
8-bit binary number equivalent to a decimal number in the range 0-255). If a given bit of the mask
is 1, the corresponding bit of the IP address is in the network portion of the address, and if a given
bit of the mask is 0, the corresponding bit of the IP address is in the Network Host
host portion. As an example, let us consider a class C address
192.15.28.16. This is shown in figure 5.53. Here, it may be noted that 192. 15.28 16
Network Host
Element
255 255 .255 0
Mask
11111111 11111111 00000000
11111111
.15 28 16
AddresS 192
11000000 00001111 00011100 000100000.
the network number, the corresponding
If afield of the network address is entirely used for
and if an address field is entirely used
field of the mask has the decimal value 255 (binary 11111111),
the mask has the decimal value 0.
for the host ID, the corresponding field of
Table 5.3.
in Fild Function
Decimal Value in BinaryoValue
f Mask T
Field of Mask
Identify network number
255 11111111
Identify host ID
O000000
0
291
Network Layer
shoWLn
Accordingly, the address masks for the three network classes described above are as
table 5.4. These masks are also called as default masks.
Table 5.4.
Address Class Address Mask
A 255.0.0.0
B 255.255.0.0
C 255.255.255.0
subnets is 21,
EXAMPLE 5.4. A number inside an
organization receives the same packet with a destination
address 190.240.34.95. If the subnet mask
is/19 (first 19 bits are 1s and following bits are 0s), find
the subnet address.
olution: To find the subnet address, AND the
in figure 5.56.
destination address with the subnet mask as shown
191 - 13 Os
190 240 32 0
Fig.5.56.
Therefore, the subnet address is 190.240.32.0.
5.22.11. Supernetting Network Layer 293
ne classA and class B
But, addresses are almost depleted.
the S1ze of class C address Important)
with maximunm But, class Caddresses are
still
requirement of an organization. More a
number of 256 addresses does not available.
Superneting. supernetting,
In addresses will be reauired. The
solution to this satisty theis
range or combines several class C blocks to problem
an
adaresses i.e. organization
several networks are
organization can apply for a set of combined to create a
supernetwork. By
create a large
Class C blocks instead of doing
this, he
Example of supernetting just one.
t an organization needs 1000
block addresses, thev can be obtained by
corresponds to 256 addresses).
supernetwork. The organization can then using four C blocks (one C
use these addresses in one
5.23. IPv6
(u.P. Tech., Sem. Exam; 2006-07)(05
Pv6 is the next marks)Expected)
generation Internet Protocol designed as a
designed to enable high-performance, scalable successor to the IP version 4. Pv6 was
the weaknesses of IPv4 Internet. This was achieved by
protocol and by adding several new features. overcoming many of
Advantages of IPv6
1. Larger address
space
IPv6 has 128-bit address
space, which is 4 times wider in bits in
space. So, there is huge increase in the compared to IPv4's 32-bit address
address space.
2. Buffer Header Format
IPv6 has a better header format. In its header
header. The options are inserted when needed, between
format, the options are separated from the base
helps in speeding up the routing process.
the base header and upper layer data. This
3. New Options
New options have been added in IPv6 to increase the functionality.
4. Possibility of Extension
Py6 has been designed in sucha way that there is a
pOssibility of extension of protocol if required.
5. More Security
IPv6 includes security in the basic specitication. It
includes encryption of
packets (ESP: Encapsulated
Security Payload) and authentitication of the sender of
packets (AH
Authentication Header).
6. Support to Resource Allocation
To implement better support for real time tratfic (such as video
label in the specification. With flow label mechanism, routers can
conference), IPv6 includes flow
flow the packets belongs.
recognize to which end-to-end
in figure 5.57. IPv6 uses 128-bit addresses. Only 5.57 IPv6 address
Fig.
about 15% of the address space is initially allocated, remainder may be used in the future for
theremaining 85% being reserved for future use. This for
expanding the address spaces of existing address types or totally new uses.
5.23.2. Abbreviation
The IPv6 address, even in hexadecimal format is very long. But in this address, there are many
of the zero digits in it. In such a case, we can leading zeros of a section
abbreviate the address. The
(four digits between two colons) can be omitted. Note that only the leading zeros can be dropped
in figure 5.58.
but the trailing zeros can not be dropped. This has been illustrated
Abbreviated FFFF
address AC81 9840 86:3210:A: BBFF:0:
Fig. 5.58 Abbreviated address
Further Abbreviation
Further abbreviation are possible if there are consecutive sections consisting of only zeros. We
5.59.
can remove the zeros completely and replace them with double semicolon as shown in figure
Abbreviated address AC81:0:0:0:0 BBFF :0:FFFF
Replace by double semicolons
are two runs of zero sections, then only one of them can be abbreviated.
Unicast Multicast
1. Unicast address address
Anycast
address
A
unicast address
that specific computer. defines a
single computer. A packet sent toa
unicast address is aenvereu
2. Anycast
ns a
same
s type of address which defines a group of
prefix. packet sent to an
A computers with addresses which have the
the anycast address
group which is the closest of the most must be delivered to exactly one of the member of
3. Multicast Addresses easily accessible.
A
multicast address defines a
and may or group of computers which may or may not share the same
may not be connected to the same
physical prefix
network. A packet sent to a multicast address
must be delivered to
each member of the set. There are no
multicast addresses can broadcast addresses in Pv6, because
perform the same function. The
bits. Multicast addresses all start with of
type address is determined by the leading
FF (1111 1111) and all other addresses
are unicast
Anycast addresses are assigned from the unicast address space and
they do not differ
addresses.
from unicast addresses. Anycast syntactically
addressing is a rather new concept and there is little experience
with the widespread use of
anycast addresses. Therefore, some restrictiorns apply to
addressing in IPv6 until
experience is gained. An
more anycast
Source Address of an IPv6 packet and anycast addresses analystbe
address may not be used as the
may not assigned to hosts but to routers
only.
5.23.5. IPv6 Packet Format
The IPy6 packet is shown in figure 5.61. Each packet consists of a base Important)
header which is mandatory
followed by the payload. The payload is made up of two parts.
(i) Optional extension headers and VER PRI
(i) Data from an upper layer. Flow label
The base header is 40 byte length Payload length Next header
Base Hop limit
whereas the extension header and the data header
from upper layer contain upto 65,535 bytes Source address
of information.
Destination address
5.23.5.1. Base Header
shows the base header. It Payload
Figure 5.61 Extension header
has eight fields. These fields are as follows: +
Data packet from the upper layer
1. Version (VER)
Fig. 5.61. Format of an IPv6
It is a 4 bit field which
defines the version datagram
of IP such as IPv4 or IPv6. For IPv6, the value of this field is 6.
2. Priority
Tt ic ad hit field which defines the priority of the packet which is important in connection with
the traffic congestion.
296 Computer Networks
3. Flow Label
It is a 24 bit (3 byte) field which is designed for providing special handling for a particular flow
of data.
4. Payload Length
This is a 2 byte length field which is used to define the total length of the IP datagram excluding
the base header.
5. Next Header
It is an 8 bit field which defines the header which follows the base header in the
datagram.
6. Hop Limit
This is arn 8 bit field which has the same purpose as TTL (time to live) in IPv4.
7. Source Address
It is a 16 byte (128 bit) Internet address which identifies the original source of datagram.
8. Destination Address
This is a 16 byte (128 bit) Internet address which identifies the final destination of datagram. But
this field will contain the address of the next router if source routing is being used.
The lengthof the base header is fixed at 40 bytes. But in IPv6, the base header can be followed
by upto
six extension headers. This is to give more functionality to the IP datagram. Many of the extension
headers are options in IPv4. The Pv4 header has space for some optional fields
requiring a particular
processing of packets. These optional fields are not used often, and they can deteriorate router
performance remarkably because their presence must be checked for each packet. IPv6 replaces
optional fields by extension headers. In IPv6, optional Internet-layer information is encoded in separate
headers that may be placed between the IPv6 header and the upper-layer header in a
packet (see
figure 5.62). There are a small number of such extension headers, each identified by a distinct Next
Header value. An IPv6 packet may carry zero, one or more extension headers, each identified by the
Next Header field of the preceding header. There are seven kinds of
extension header.
IPv6 Header
TCP
NH TCP
3. The basic length of the IPv4 header The IPv6 header is a static header of 40 bytes
comprises a minimum of 20 bytes (without in length, and has only 8 fields. Option
option fields). The maximum total length information is carried by the extension
of the IPv4 header is 60 bytes (with option header, which is placed after the IPv6
fields), and it uses 13 fields to identify header.
various control settings.
4 IPv4 header has a checksum, which must IPv6 has no header checksum because
be computed by each router. checksum are, for example, abovethe TCP/
IP protocol suite, and above the Token Ring,
Ethernet, etc.
298 Computer Networks
5. IPv4 contains an 8-bit field called Service The IPv6 header contains an 8-bit field
Type. The Service Type field is composed called the Traffic Class Field. This field
of a TOS (Type of Service) field and a allows the traffic source to identify the
desired delivery priority of its packets.
procedure field.
6. The IPv4 node has only Stateful auto- The IPv6 node has both a stateful and a
stateless address autoconfiguration
configuration. mechanism.
IPv6 has been designed to satisfy the growing
7. Security in IPv4 networks is limited to
and expanded need for network security.
tunneling between two networks. addresses are 128
32 Source and destination
8. Source and destination addresses are
bits (16 bytes) in length.
bits (4 bytes) in length.
P'sec support is required.
9. Psec support is optional.
for QoS handling
for Qos Packet flow identification
10. No identification of packetflow routers is included
in the IPv6 header
handling by routers is present within the by
Label field.
IPv4 header. using the Flow
are replaced
with
ARP Request frames
Address Resolution Protocol (ARP)
uses
11. Solicitation messages.
resolve multicast Neighbour
to
broadcast ARP Request framesaddress.
a n IPv4 address to a
link layer or
manua configuration
Does not require
12. Must be configured either manually or
DHCP
through DHCP.
with
ICMP Router Discovery is replaced
is used to deter- Solicitation and Router
13. ICMP Router Discovery ICMPv6 Router
mine the IPv4 address
of the best default is required.
Advertisement messages and
gateway and is optional. moved to IPv6 extension
All optional data is
14.
Header includes options. headers.
IP Address MASK
S. No.
255.255.128.0
(a) 120.14.22.16
(b) 140.11.36.22 255.255.255.0
|11111111.11111111.10000000.00000000 MASK
ANDing
120 14 0
0 1111000.00001110.00000000.00000000 Subnet address
Fig.5.68.
Therefore, the subnet address is 120.14.0.0. Similarly, we can find the other
subnet addresses.
Step 2:Hostid
Let us examine the first byte of the subnet address. 120 14 0
It is 120 which is between 0 and 127. Hence, this is a
class A netywork. So only the first byte corresponds to
the net id and the remaining three bytes Net id Host id
correspond
to
Fig. 5.69.
the hostíd as shown in figure 5.69.
Therefore, the host id is 140.0. Similarly, we can find the other host id
303
Network Layer
Four networks are
L2 extra 1s
Fig. 5.69. (a)
Thus, the required subnet mask is 255.255.255.192.
EXAMPLE 5.7. What will be the subnet address if the destination address is 200.45.34.56 and
subnet mask is 255.255.240.0.
Solution: To find the subnet address, we have to AND the IP address and the subnet mask as shown
in figure 5.70.
200.45.34.56
Destination 11001000. O0101101. 00100010. 00111000
adddress
255.255.240.0
Subnet 11111111 .11111111.11110000.00000000
mask
ANDING
200.45.32.0
Subnet
address
11001000.00101101.00100000.00000000
Fig. 5.70.
Thus, the required subnet address is
200.45.32.0.
EXAMPLE 5.8. A company is granted a site address 201.70.64.0. The company needs six subnets.
Design the subnets.
Solution: This is a class C network. Therefore, the default mask is
255.255.255.0
As we need 6 subnets, we need three extra 1s. Hence, the subnet mask is
255.255.255.200
In the binary form the subnet mask is as shown in figure 5.71
3 extra 1s
Fig.5.71.
I n order to have six subnets, wecan have 6 different combinations of the 3-extra 1s as shown in
Table 5.5.
Table 5.6.
Subnet number Addresses
201.70.64.0 to 201.70.64.31
2 201.70.64.32 to 201.70.64.63
3 201.70.64.64 to 201.70.64.95
201.70.64.96 to 201.70.64.127
201.70.64.128 to 201.70.64.1559
6 201.70.64.160 to 201.70.64.191
Class C Address
The format of class C is shown in figure 5.72 (c). Here 3 bytes are reserved for network ield and
only one byte for the host field. Out of 24 bits in the network field, 3 bits are again reserved. Hence,
actually only 21 bits are available.
3 bits
21 bits-
Host
110 Network
address
Fig. 5.72 (c) Class C
is 2,097, 152.
Hence, the number of networks in class C address
exist, show with
each IP address class
can
EXAMPLE 5.10. How many host per network in
example.
Solution: Number of Hosts in Different IP Addresses
Class A Class A address will be
number of hosts in
There are 3-bytes (24 bits) in the host field. Hence, the
214 16,7772,16.
Class B address will be
of hosts in Class B
There are 2-bytes (16 bits) in the host field. So, the number
65536 i.e. 20 per network.
Class C 2" 256
in Class C address will be
=
Decimal 194 79
21 22
Fig. 5.73.
dotted decimal notation will be as under
Therefore, the lP address in the Ans.
194.79.21.226
What will be
network on Internet has a subnet mask of 255.255.240.0.
EXAMPLE 5.12. A Class B (u.P. Tech, Sem. Exa; 2004-05) (05 marks)
the maximum number
of hosts per subnet ?
Class B address is as shown in figure 5.74 (a).
Solution: The structure of
255 255 240
-16 bits
|11111111 11111111 1111 0000 0000 0000|
14 bits
Net ID Host ID 4 bits for 12 bits for
10 subnet host ID