You are on page 1of 34

Internetworking and

Internet Protocol (IP)


Internetworking
● Internetworking: Connecting networks together to make an
internetwork or an internet

● Switching at the network layer in the Internet uses the datagram


approach to packet switching

● Communication at the network layer in the Internet is


connectionless
Internet Protocol (IP)
● The network layer in version 4 can be thought of as one main
protocol and three auxiliary ones
● The main protocol, Internet Protocol version 4 (IPv4)
 It is the delivery mechanism used by the TCP/IP protocols
 It is responsible for packetizing, forwarding, and delivery of a packet at
the network layer

● The Internet Control Message Protocol version 4 (ICMPv4) helps


IPv4 to handle some errors that may occur in the network-layer
delivery
● The Internet Group Management Protocol (IGMP) is used to help
IPv4 in multicasting
● The Address Resolution Protocol (ARP) is used to glue the network
and data-link layers in mapping network-layer addresses to link-
layer addresses
Position of IP and other network-layer protocols in TCP/IP protocol suite
Internet Protocol Version 4 (IPv4)
Internet Protocol Version 4 (IPv4)
● IPv4 is an unreliable datagram protocol
● IPv4 is also a connectionless protocol
● It uses the datagram approach
 Each datagram is handled independently, and
 Each datagram can follow a different route to the destination

● Packets used by the IP are called datagrams


● A datagram is a variable-length packet consisting of two parts:
header and payload (data)
● The header is 20 to 60 bytes in length
 It contains information essential to routing and delivery
IPv4 Datagram Format
IPv4 Datagram Format
● VER: The 4-bit version number (VER) field defines the version of
the IPv4 protocol, here its value is 4 (0100)
● HLEN: The 4-bit header length (HLEN) field defines the total
length of the datagram header in 4-byte words
● Service Type: In the original design of the IP header, this field
was referred to as type of service (TOS), which defined how the
datagram should be handled

Service type or differentiated services

The precedence subfield was


part of version 4, but never
used
IPv4 Datagram Format

Types of service
IPv4 Datagram Format
● Total Length: This 16-bit field defines the total length (header plus
data) of the IP datagram in bytes
 A 16-bit number can define a total length of up to 65,535 (when all bits
are 1s)

● Identification, Flags, and Fragmentation Offset: These three


fields are related to the fragmentation and will be discussed later
● Time-to-live: Due to some malfunctioning of routing protocols a
datagram may be circulating in the Internet, visiting some networks
over and over without reaching the destination
 The time-to-live (TTL) field is used to control the maximum number of
hops (routers) visited by the datagram
 Each router that processes the datagram decrements this number by one
 If this value, after being decremented, is zero, the router discards the
datagram
IPv4 Datagram Format
● Protocol: The Internet authority has given any protocol (TCP,
UDP or any other transport layer protocol) that uses the service of
IP a unique 8-bit number which is inserted in the protocol field
 When the payload is encapsulated in a datagram at the source IP, the
corresponding protocol number is inserted in this field
IPv4 Datagram Format
● Header checksum: IP adds a header checksum field to check the
header because if the header field is corrupted, the payload may
be delivered to the wrong destination
● Source and Destination Addresses: These 32-bit source and
destination address fields define the IP address of the source and
destination respectively
● Options: A datagram header can have up to 40 bytes of options.
Options can be used for network testing and debugging
● Payload: Payload, or data, is the main reason for creating a
datagram. Payload is the packet coming from other protocols
(from upper layer) that use the service of IP
IPv4 Fragmentation
Maximum Transfer Unit (MTU)
● Each link-layer protocol has its own frame format. One of the
features of each format is the maximum size of the payload that
can be encapsulated
IPv4 Fragmentation
● Fragmentation is done by the network layer when the size of a datagram
is greater than maximum size of data that can be held a frame i.e., its
Maximum Transmission Unit (MTU)
● The network layer divides the datagram received from transport layer into
fragments so that data flow is not disrupted
● Fragmentation: Dividing the datagram into smaller parts
● When a datagram is fragmented, each fragment has its own header with
most of the fields repeated, but some have been changed
● A datagram can be fragmented by the source host or any router in the
path
● The reassembly of the datagram, however, is done only by the destination
host
● The host or router that fragments a datagram must change the values of
the fields: identification, flags, fragmentation offset, and total length
Fields Related to Fragmentation
● Three fields in an IP datagram are related to fragmentation:
identification, flags, and fragmentation offset
● Identification:
 The 16-bit identification field identifies a datagram originating from the
source host
 The combination of the identification and source IP address uniquely
define a datagram
● Flags: The 3-bit flags field defines three flags
 The leftmost bit is reserved (not used)
 The second bit (D bit) is called the do not fragment bit. If its value is
1, the machine must not fragment the datagram
 The third bit (M bit) is called the more fragment bit. If its value is 1,
it means the datagram is not the last fragment. If its value is 0, it
means this is the last or only fragment
Fields Related to Fragmentation
● Fragmentation offset:
 The 13-bit fragmentation offset field shows the relative position of this
fragment with respect to the whole datagram
 It is the offset of the data in the original datagram measured in units
of 8 bytes
 Following figure shows a datagram with a data size of 4000 bytes
fragmented into three fragments

Fragmentation example
IPv4 Fragmentation: Example
● Problem: A datagram of 3000 B (Bytes) (20 B of header + 2980 B IP payload)
reached at router and must be forwarded to a link with MTU of 500 B. How
many fragments will be generated and what will be the values of M flag bits,
offset, and total length field corresponding to each fragment?

● Solution:

Number of fragments required = ⌈2980/480⌉ = 7


Packets (or fragments)
P7 P6 P5 P4 P3 P2 P1
120 B 500 B 500 B 500 B 500 B 500 B 500 B Total
(100+20) (480+20) length
0 1 1 1 1 1 1 M flag bit
360 300 240 180 120 60 0 Offset
Internet Protocol Version 6 (IPv6)
Why Do We Need a New IP Structure?
● Address space is not sufficient even with CIDR
● QoS is vaguely defined
 We need real time service support for modern day applications (Skype,
VoIP etc.)

● Mobile applications are unmanageable


● There is no direct security support in IPv4
IPv6 Features
● Larger address space
● Globally unique and hierarchical addressing
● Optimized routing table using prefixes rather than address classes
● A mechanism for the auto-configuration of network interfaces
● Support for encapsulation
● Service class support to manage QoS classes
● Built-in authentication and encryption
● Transition methods to migrate from IPv4
● Compatibility methods to coexist and communicate with IPv4
● It has base header of 40 bytes (fixed)
The IPv6 Header Format
● Vers: 4-bit IP version number, here 6
● Traffic class or priority: The 8-bit
traffic class field allows applications to
specify a certain priority for the traffic
they generate
● Flow label: 20-bit field. A series of
related packets that requires a
particular type of handling (for
example, real-time service) have the
same source address, destination
address and flow label
● Payload length: The length of the
packet in bytes (excluding header)

Basic IP header format


The IPv6 Header Format
● Next header (nxt hdr): Indicates
the type of header immediately
following the basic IP header

● Hop limit: It is measured in hops.


The packet is discarded after the
hop limit is decremented to zero

● Source address: A 128-bit


address

● Destination address: A 128-bit


address

Basic IP header format


IPv6 Extension Headers

● Additional information are


transmitted through the
extension headers

● The base header points to the


extension headers
IPv6 Addressing
● 128 bit addresses - represented in the form of eight hexadecimal
numbers separated by colons, for example:

FE80:0000:0000:0000:0001:0800:23E7:F5DB

● Leading zeroes can be omitted - FE80:0:0:0:1:800:23E7:F5DB

● A group of zeroes can be replaced by a double colon -

FE80::1:800:23E7:F5DB (The double colon can be used only once)


Address Space Allocation based on Prefix

NSAP : Network Service Access Point


IPX : Internetwork Packet Exchange (Protocol)
Address Space Allocation based on Prefix
Global Unicast Address Format

● Global Routing Prefix: A value assigned to a site for a cluster of


subnets/links. The global routing prefix is designed to be structured
hierarchically

● Subnet ID: An identifier of a subnet within the site

● Interface ID: Interface identifiers in IPv6 unicast addresses are


used to identify interfaces on a link
Transition from IPv4 to IPv6

● Because of the huge number of systems on the Internet, the


transition from IPv4 to IPv6 cannot happen suddenly
● It takes a considerable amount of time before every system in the
Internet can move from IPv4 to IPv6
● The transition must be smooth to prevent any problems between
IPv4 and IPv6 systems

Three transition strategies


Internet Transition: Migrating from IPv4 to IPv6
● Dual Stack:
● It is recommended that all hosts, before migrating completely to version 6,
have a dual stack of protocols during the transition
● A station must run IPv4 and IPv6 simultaneously until all the Internet uses
IPv6
● To determine which version to use when sending a packet to a destination, the
source host queries the DNS
 If the DNS returns an IPv4 address, the source host sends an IPv4 packet
 If the DNS returns an IPv6 address, the source host sends an IPv6 packet

Dual stack
Internet Transition: Migrating from IPv4 to IPv6

● Tunneling: It is a strategy used when two computers using IPv6


want to communicate with each other and the packet must pass
through a region that uses IPv4
 To pass through this region, the packet must have an IPv4 address

● So the IPv6 packet is encapsulated in an IPv4 packet when it


enters the region, and decapsulated when it exits the region

Tunneling strategy
Internet Transition: Migrating from IPv4 to IPv6

● Header translation: Header translation is necessary when the


majority of the Internet has moved to IPv6 but some systems still
use IPv4
● Suppose, the sender wants to use IPv6, but the receiver does not
understand IPv6. In this case, the header format must be totally
changed through header translation
 Address must be translated as well during translation
 Take low order 32 bits (i.e. rightmost 32 bits) for IPv6 to IPv4
 Append :: FFFF/96 prefix for IPv4 to IPv6
Header translation strategy
Difference Between IPv4 and IPv6

IPv4 IPv6
IPv4 has 32-bit address length IPv6 has 128-bit address length
Address representation of IPv4 is in Address representation of IPv6 is in
decimal hexadecimal

Fragmentation performed by sender and In IPv6 fragmentation performed only by


forwarding routers sender

IPv4 does not provide encryption and IPv6 provides encryption and authentication
authentication

Security feature is dependent on IP security (IPSec) is inbuilt security feature


application in the IPv6 protocol

IPv4 has header of 20-60 bytes  IPv6 has base header of 40 bytes (fixed)
It supports manual and DHCP address It supports autoconfiguration of hosts
configuration
End

You might also like