0% found this document useful (0 votes)
0 views

TCN IPv4 Frame and IPv6

The document provides an overview of IPv4 and IPv6 addressing, detailing the structure and fields of IPv4 packets, including version, header length, total length, and fragmentation. It also explains the format of IPv6 addresses, which are 128 bits long, and introduces rules for shortening their representation. Additionally, it highlights the differences in network and host identification between IPv4 and IPv6, emphasizing the absence of classes in IPv6 and the use of CIDR for address allocation.

Uploaded by

Zeeshan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

TCN IPv4 Frame and IPv6

The document provides an overview of IPv4 and IPv6 addressing, detailing the structure and fields of IPv4 packets, including version, header length, total length, and fragmentation. It also explains the format of IPv6 addresses, which are 128 bits long, and introduces rules for shortening their representation. Additionally, it highlights the differences in network and host identification between IPv4 and IPv6, emphasizing the absence of classes in IPv6 and the use of CIDR for address allocation.

Uploaded by

Zeeshan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Figure 20.

4 Position of IPv4 in TCP/IP protocol suite


Figure 20.5 IPv4 datagram format
IPv4 Frame
Version
The first header field in an IP packet is the four-bit version field. For IPv4, this is always equal
to 4.
Internet Header Length (IHL)
The IPv4 header is variable in size due to the optional 14th field (options). The IHL field contains
the size of the IPv4 header, it has 4 bits that specify the number of 32-bit words in the header.
Service
The service field is composed of a 3-bit precedence field. (Which are largely ignored in current
routers). 4 services bits and an unused bit that must be zero.

Total Length
This 16-bit field defines the entire packet size in bytes, including header and data. The
minimum size is 20 bytes (header without data) and the maximum is 65,535 bytes.
Identification
Identification field uniquely identifies each datagram sent by a host. It is normally incremented
by one each time a host sends a datagram. Very useful for fragmentation and reassembly.
Flags
A three-bit field follows and is used to control or identify fragments. They are (in order, from
most significant to least significant):
• bit 0: Reserved; must be zero.
• bit 1: Don't Fragment (DF)
• bit 2: More Fragments (MF)
Fragment Offset
The fragment offset field is measured in units of eight-byte blocks. It is 13 bits long and
specifies the offset of a particular fragment relative to the beginning of the original
unfragmented IP datagram.
Time To Live (TTL)
An eight-bit time to live field helps prevent datagrams from persisting (e.g. going in
circles) on an internet. This field limits a datagram's lifetime. Every router decrements
TTL by 1 before sending it forward. If TTL reaches 0 the datagram is dropped and an
ICMP message is sent to the host application.
Protocol
Identifies the protocol that sent the datagram. The protocol (today) can be ICMP,
IGMP, TCP, UDP and OSPF.
Header Checksum
The 16-bit IPv4 header checksum field is used for error-checking of the header
Source address
This field is the IPv4 address of the sender of the packet. Note that this address may
be changed in transit by a network address trabslation device.
Destination address
This field is the IPv4 address of the receiver of the packet. As with the source address,
this may be changed in transit by a network address translation device.
Options
The options field is not often used.
IPv6 Overview
Note

An IPv6 address is 128 bits long.

19.7
Figure 19.14 IPv6 address in binary and hexadecimal colon notation

19.8
Figure 19.15 Abbreviated IPv6 addresses

19.9
The IPv6 Address
 An IPv6 address is 128 bits in length and is written as eight groups
of four hexadecimal digits.
 Each group is separated from the others by colons (:) as shown in
figure 1.
 Hexadecimal characters are not case sensitive, therefore an address
can be written either in uppercase or lowercase, both are equivalent.

 It is obvious that IPv6 addresses are long and hard to remember and work with.
That's why there are rules that can significantly shorten the address
Shortening IPv6 addresses
 There are two rules, described in RFCs 2373 and 5952,
that help engineers to reduce the length of the address
representation.
 It's important to understand from the very beginning that
using these two rules shortens only the representation
of the address, the address itself is always 128 bits.
Rule 1: Omit groups of all zeros
The first rule that we are going to look at is called Zero Compression. It says that a
double colon (::) can replace a single, contiguous string of one or more groups
consisting of all 0s. Example 1 illustrates the use of this rule.
Contd..
 There are two contiguous strings of zeros - Group 4 and 5, and
Group 7. Having in mind that we can use only one double
colon, we can either replace groups 4 and 5 with :: or group 7,
but not both.

Rule 2: Omit Leading zeros


The other way to shorten addresses is to omit leading zeros in any group of 4
hexadecimal digits. The rule applies only to leading zeros and no trailing zeros.
Even if a group consists of 4 zeros 0000 we can only omit the leading 3 - 0000.
This is illustrated in the following example.
Contd..
Combining Rule 1 and 2
 The shortest possible representation is achieved by combining both
rules we have discussed. Let's get the IP address from example 3 and
apply rule 1 and rule 2 at the same time.

Common Mistakes
There are several common mistakes people make when they start applying these techniques. Let's look at
several examples and highlight the key points.
IPv6 address 2001:0cb0:0000:0000:0fc0:0000:0000:0abc Correctly Shortened 2001:cb0::fc0:0:0:abc
2001:cb0:0:0:fc0::abc Common Mistake 1 - using :: twice 2001:cb0::fc0::abc Common Mistake 2 -
removing trailing zeros 2001:cb::fc:0:0:abc
Example 19.11

Expand the address 0:15::1:12:1213 to its original.

Solution
We first need to align the left side of the double colon to
the left of the original pattern and the right side of the
double colon to the right of the original pattern to find
how many 0s we need to replace the double colon.

This means that the original address is.

19.14
Net ID and Host ID in IPV6
In IPv6, the concept of network ID and host ID differs from the traditional
IPv4 scheme:

1.Network and Host Identification:


•IPv6 addresses are 128-bit long, structured into two main segments: the
Network Prefix and the Interface Identifier.
•The Network Prefix (akin to the network ID in IPv4) identifies the network
segment, while the Interface Identifier (similar to the host ID in IPv4) identifies
a specific interface on that network.
•The prefix length (e.g., /64) indicates how many of the initial bits are used for
the network ID, with the remaining bits used for the host ID.
2.Absence of Classes:
•IPv6 does not use classes like IPv4 (i.e., Class A, B, C). Instead, it relies on
CIDR (Classless Inter-Domain Routing) for address allocation, which
provides more flexibility and efficiency compared to class-based systems in
IPv4.
•The prefixes are assigned based on organizational needs rather than fixed
class divisions.
Overall, IPv6 simplifies and optimizes address management by eliminating the rigid
class structure of IPv4.

You might also like