CH4 Hellow
CH4 Hellow
Part-ii
Prof. Mohammed Juned
Example 1
Change the following IP addresses from binary notation to dotted-
decimal notation.
a. 10000001 00001011 00001011 11101111
b. 11111001 10011011 11111011 00001111
Solution
We replace each group of 8 bits with its equivalent decimal
number (see Appendix B) and add dots for separation:
a. 129.11.11.239
b. 249.155.251.15
Example 2
Change the following IP addresses from dotted-decimal notation to
binary notation.
a. 111.56.45.78
b. 75.45.34.78
Solution
We replace each decimal number with its binary equivalent
(see Appendix B):
Solution
a. The first byte is 227 (between 224 and 239); the class is D.
b. The first byte is 252 (between 240 and 255); the class is E.
c. The first byte is 134 (between 128 and 191); the class is B.
Example
• Types of Subnetting-
• Subnetting of a network may be carried out in the following
two ways-
• Types of Subnetting-
• Subnetting of a network may be carried out in the following two ways-
19.27
Solution
Figure shows the situation.
Group 1
For this group, each customer needs 256 addresses. This means
that 8 (2^8) bits are needed to define each host. The prefix
length is then 32 − 8 = 24. The addresses are
19.28
Group 3
For this group, each customer needs 64 addresses. This
means that 6 (2^6) bits are needed to each host. The prefix
length is then 32 − 6 = 26. The addresses are
19.30
An ISP is granted a block of addresses starting with
188.50.0.0/16. The ISP wants to distribute these blocks to 100
customers as follows.
1.The first group has 30 medium-size businesses; each needs
128 addresses.
2.The second group has 50 small businesses; each needs 64
addresses.
3.The third group has 20 households; each needs 32 addresses
Design the subblocks and give the slash notation for each
subblock. Find out how many addresses are still available after
these allocations.
Note
20.37
Example
Solution
There is an error in this packet. The 4 leftmost bits (0100)
show the version, which is correct. The next 4 bits (0010) show
an invalid header length (2 × 4 = 8). The minimum number of
bytes in the header must be 20. The packet has been corrupted
in transmission.
20.38
Figure : Maximum transfer unit (MTU)
Table :
MTUs for
some
networks
20.40
Fields Related to Fragmentation
Identification: identifies a datagram originating from the source host. A combination of the
identification and source address must uniquely define a datagram as it leaves the source
node.
• Fragmentation offset is the offset of the data in the original datagram measured in units
of 8 bytes.
• It is use to identify the sequence of fragments in the frame. It generally indicates a
number of data bytes preceding or ahead of the fragment.
Maximum fragment offset possible = (65535 – 20) = 65515
{where 65535 is the maximum size of datagram and 20 is the minimum size of IP
header}
So, we need ceil(log265515) = 16 bits for a fragment offset but the fragment offset field
has only 13 bits. So, to represent efficiently we need to scale down the fragment offset
field by 216/213 = 8 which acts as a scaling factor. Hence, all fragments except the last
fragment should have data in multiples of 8 so that fragment offset ∈ N.
Figure : Flags (3 bits) used in fragmentation
20.42
Figure : Fragmentation example
IPv4 Checksum
IPv4 has some deficiencies that make it unsuitable for the fast-
growing Internet.
IPv6: Advantages
• Larger address space.
• Better header format.
• New options.
• Allowance for extensions.
• Support for resource allocation.
• Support for more security.
Figure : IPv6 datagram header and payload
Figure : Format of an IPv6 datagram
Priority
Protocol
Table : Comparison between IPv4 and IPv6 packet headers
IPv4 IPv6
IPv4 has a 32-bit address length IPv6 has a 128-bit address length
It Supports Manual and DHCP address configuration It supports Auto and renumbering address configuration
In IPv4 end to end, connection integrity is Unachievable In IPv6 end to end, connection integrity is Achievable
The Security feature is dependent on application IPSEC is an inbuilt security feature in the IPv6 protocol
• It provides privacy as the device’s IP address, sending and receiving the traffic, will be
hidden.
• Disadvantage of NAT –
• Also, the router being a network layer device, should not tamper with port
numbers(transport layer) but it has to do so because of NAT.