Sie sind auf Seite 1von 11

Chapter 3: IP Addressing

3.1 IPv4 datagram format :-

The Internet Protocol version 4 (IPv4) is the delivery mechanism used by the TCP/IP
protocols. IPv4 is an unreliable and connectionless datagram protocol & a best-effort
delivery service means that IPv4 provides no error control or flow control (except for error
detection on the header). IPv4 assumes the unreliability of the underlying layers and does its best
to get a transmission through to its destination, but with no guarantees. If reliability is important,
IPv4 must be paired with a reliable protocol such as TCP.

IPv4 is also a connectionless protocol for a packet-switching network that uses the datagram
approach. This means that each datagram is handled independently, and each datagram can
follow a different route to the destination. This implies that datagrams sent by the same source to
the same destination could arrive out of order. Also, some could be lost or corrupted during
transmission. Again, IPv4 relies on a higher-level protocol to take care of all these problems
Datagram
Packets in the IPv4 layer are called datagrams. Fig 3.1 shows the IPv4 datagram format. A
datagram is a variable-length packet consisting of two parts: header and data. The header is 20 to
60 bytes in length and contains information essential to routing and delivery .It is customary in
TCP/IP to show the header in 4-byte sections. A brief description of each field is in order.

Version (VER). This 4-bit field defines the version of the IPv4 protocol. Currently the
version is 4. However, version 6 (or IPng) may totally replace version 4 in the future.

Header length (HLEN). This 4-bit field defines the total length of the datagram header in
4-byte words. This field is needed because the length of the header is variable (between 20 and
60
bytes). When there are no options, the header length is 20 bytes, and the value of this field is 5 (5
x 4 = 20). When the option field is at its maximum size, the value of this field is 15 (15 x 4 = 60).
Fig 3.1 IPv4 datagram

https://WWW.ThesisScientist.com
Service Type: The service type is an indication of the quality of service requested for this IP
datagram. This field contains the information illustrated in fig 3.2

In this interpretation, the first 3 bits are called precedence bits. The next 4 bits are called type
of service (TOS) bits, and the last bit is not used.

Precedence is a 3-bit subfield ranging from 0 (000 in binary) to 7 (111 in binary). The
precedence defines the priority of the datagram in issues such as congestion. If a router is
congested and needs to discard some datagrams, those datagrams with lowest precedence are
discarded first. The precedence subfield was part of version 4, but never used.

TOS bits are a 4-bit subfield with each bit having a special meaning. Although a bit can be
either 0 or 1, one and only one of the bits can have the value of 1 in each datagram. The bit
patterns and their interpretations are given in Table 3.1 show TOS bit option of IP datagram.
With only 1 bit set at a time, we can have five different types of services

Differentiated services
As shown in fig 3.2 below Cd stand for codepoint & nb stand for not used bit in
Fig 3.2 Differentiated services types of IP datagram

In this interpretation, the first 6 bits make up the codepoint subfield, and the last 2 bits are not
used. The codepoint subfield can be used in two different ways.

When the 3 rightmost bits are 0s, the 3 leftmost bits are interpreted the same as the
precedence bits in the service type interpretation. In other words, it is compatible with the
old interpretation.

Total Length: The total length of the datagram, header and data.

Length of data = total length - header length

Time to Live: This field specifies the time (in seconds) the datagram is allowed to travel.
Theoretically, each router processing this datagram is supposed to subtract its processing time
from this field. In practice, a router processes the datagram in less than 1 second. Therefore, the
router subtracts one from the value in this field. The TTL becomes a hop-count metric rather
than a time metric. When the value reaches zero, it is assumed that this datagram has been
traveling in a closed loop and is discarded. The initial value should be set by the higher-level
protocol that creates the datagram.

Protocol Number: This field indicates the higher-level protocol to which IP should deliver the
data in this datagram

Header Checksum: This field is a checksum for the information contained in the header. If the

https://WWW.ThesisScientist.com
header checksum does not match the contents, the datagram is discarded.

Source IP Address: The 32-bit IP address of the host sending this datagram.

Destination IP Address: The 32-bit IP address of the destination host for this datagram.

3.2 IP Fragmentation
When an IP datagram travels from one host to another, it can pass through different physical
networks. Each physical network has a maximum frame size. This is called the maximum
transmission unit (MTU). It limits the length of a datagram that can be placed in one physical
frame.

To make the IPv4 protocol independent of the physical network, the designers decided to make
the maximum length of the IPv4 datagram equal to 65,535 bytes. This makes transmission more
efficient if we use a protocol with an MTU of this size. However, for other physical networks,
we must divide the datagram to make it possible to pass through these networks. This is called
fragmentation.

The transport layer will segment the data into a size that can be accommodated by IPv4 and the
data link layer in use. When a datagram is fragmented, each fragment has its own header with
most of the fields repeated, but with some changed. A fragmented datagram may itself be
fragmented if it encounters a network with an even smaller MTU. In other words, a datagram can
be fragmented several times before it reaches the final destination.

In IPv4, 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 because each fragment
becomes an independent datagram. When a datagram is fragmented, required parts of the header
must be copied by all fragments. The option field may or may not be copied. The host or router
that fragments a datagram must change the values of three fields: flags, fragmentation offset,
and total length. The rest of the fields must be copied. Of course, the value of the checksum
must be recalculated regardless of fragmentation.

3.3 Disadvantages of Ipv4


IPv4 has some deficiencies that make it unsuitable for the fast-growing Internet.
Despite all short-term solutions, such as subnetting, classless addressing, and NAT, address
depletion is still a long-term problem in the Internet.

The Internet must accommodate real-time audio and video transmission. This type of
transmission requires minimum delay strategies and reservation of resources not provided in the
IPv4 design.

The Internet must accommodate encryption and authentication of data for some applications.
No encryption or authentication is provided by IPv4.

https://WWW.ThesisScientist.com
3.4 comparisons of IPv6 & IPv4

IP, or IPv6, has some advantages over IPv4 that can be summarized as follows:
Larger address space. An IPv6 address is 128 bits long Compared with the 32-bit address of
IPv4, this is a huge (296) increase in the address space.

Better header format. IPv6 uses a new header format in which options are separated from the
base header and inserted, when needed, between the base header and the upper-layer data. This
simplifies and speeds up the routing process because most of the options do not need to be
checked by routers.

New options. IPv6 has new options to allow for additional functionalities.

Allowance for extension. IPv6 is designed to allow the extension of the protocol if required by
new technologies or applications.

Support for resource allocation. In IPv6, the type-of-service field has been removed, but a
mechanism (called flow label) has been added to enable the source to request special handling of
the packet. This mechanism can be used to support traffic such as real-time audio and video.

Support for more security. The encryption and authentication options in IPv6
provide confidentiality and integrity of the packet.

3.5 Addressing:
Network addresses identify devices separately or as members of a group. Addressing is
performed on various layers of the OSI model. Thus, schemes used for addressing vary on the
basis of the protocol used and the OSI layer. On this basis, internet work addresses can be
categorized into following types:

3.5.1 Data Link Layer Addresses


Data-link layer addresses sometimes are referred to as physical or hardware addresses, uniquely
identify each physical network connection of a network device. Usually data-link addresses have
a pre established and fixed relationship to a specific device.
End systems generally have only one physical network connection and thus, have only one data-
link address. Routers and other internetworking devices typically have multiple physical network
connections and therefore, have multiple data-link addresses.

3.5.2 Media Access Control (MAC) Addresses


Media Access Control (MAC) addresses are used to identify network entities in LANs that
implement the IEEE MAC addresses of the data link layer. These addresses are 48 bits in length
and are expressed as 12 hexadecimal digits.
MAC addresses are unique for each LAN interface. These addresses consist of a subset of data
link layer addresses. Figure 4 illustrates the relationship between MAC addresses, data-link
addresses, and the IEEE sub-layers of the data link layer.

https://WWW.ThesisScientist.com
3.5.3 Network Layer Addresses
Network addresses are sometimes called virtual or logical addresses. These addresses are used to
identify an entity at the network layer of the OSI model. Network addresses are usually
hierarchical
addresses.

3.5.4 Port Addresses


The IP address and the physical address are necessary for a quantity of data to travel from a
source to the destination host. However, arrival at the destination host is not the final objective of
data communications on the Internet. A system that sends nothing but data from one computer to
another is not complete. Today, computers are devices that can run multiple processes at the
same time. The end objective of Internet communication is a process communicating with
another process. For example, computer A can communicate with computer C by using
TELNET. At the same time, computer A communicates with computer B by using the File
Transfer Protocol (FTP). For these processes to receive data simultaneously, we need a method
to label the different processes. In other words, they need addresses. In the TCP/IP architecture,
the label assigned to a process is called a port address. A port address in TCP/IP is 16 bits in
length.

3.5.5 Hierarchical vs. Flat Address


Usually Inter network addresses are of two types:

3.5.5.1 Hierarchical address


Hierarchical addresses are organized into a number of subgroups, each successively narrowing
an address until it points to a single device as a house address.

3.5.5.2 Flat address


A flat address space is organized into a single group, such as, your enrolment no. Hierarchical
addressing offers certain advantages over flat-addressing schemes. In hierarchical addressing,
address sorting and recalling is simplified using the comparison operation. For example, India
in a street address eliminates any other country as a possible location. Figure 5 illustrates the
difference between hierarchical and flat address spaces.

3.5.6 Static vs. Dynamic Address


In networking, the address to a device can be assigned in either of these two ways:

3.5.6.1 Static address assignment: Static addresses are assigned by a network administrator
according to a preconceived inter network addressing plan. A static address does not change until
the network administrator changes it manually.

3.5.6.2 Dynamic addresses: Dynamic addresses are obtained by devices when they are attached
to a network, by means of some protocol-specific process. A device using dynamic address often
has a different address each time it connects to the network.

3.6 Methods of IP delivery: Unicast, broadcast, multicast, and anycast


https://WWW.ThesisScientist.com
3.6.1 Unicast
The majority of IP addresses refer to a single recipient; this is called a unicast address. Unicast
connections specify a one-to-one relationship between a single source and a single destination
Fig 3.8 show unicast method

A connectionless protocol can send unicast, broadcast, multicast, or anycast messages. A


connectionoriented protocol can only use unicast addresses (a connection must exist between a
specific pair of hosts).
Unicast address used to communicate from one source to one destination

3.6.2 Broadcasting
Broadcast addresses are never valid as a source address. They must specify the destination
address. The different types of broadcast addresses include:

Limited broadcast address: This uses the address 255.255.255.255 . It refers to all hosts on
the local subnet. This is recognized by every host. The hosts do not need any IP configuration
information. Routers do not forward this packet. One exception to this rule is called BOOTP
forwarding. The BOOTP protocol uses the limited broadcast address to allow a diskless
workstation to contact a boot server. BOOTP forwarding is a configuration option available on
some routers.

Network-directed broadcast address: This is used in an unsubnetted environment. The


network number is a valid network number and the host number is all ones (for example,
128.2.255.255). This address refers to all hosts on the specified network. Routers should
forward these broadcast messages. This is used in ARP requests on unsubnetted networks.

Subnet-directed broadcast address: If the network number is a valid network number, the
subnet number is a valid subnet number, and the host number is all ones, the address refers to
all hosts on the specified subnet. Because the sender's subnet and the target subnet might
have a different subnet mask, the sender must somehow determine the subnet mask in use at
the target. The broadcast is performed by the router that receives the datagram into the
subnet.

All-subnets-directed broadcast address: If the network number is a valid network number,


the network is subnetted, and the local part is all ones (for example, 128.2.255.255), the
address refers to all hosts on all subnets in the specified network. In principle, routers can
propagate broadcasts for all subnets but are not required to do so. In practice, they do not.
There are very few circumstances where such a broadcast is desirable. If misconfigured, it
can lead to problems. Consider the misconfigured host 9.180.214.114 in a subnetted Class A
network. If the device was configured with the address 9.255.255.255 as a local broadcast
https://WWW.ThesisScientist.com
address instead of 9.180.214.255, all of the routers in the network will forward the request to
all clients. If routers do respect all-subnets-directed broadcast address, they use an algorithm
called reverse path forwarding to prevent the broadcast messages from multiplying out of
control.
Fig 3.9 show Broadcast address communication is from one to all

3.6.3 Multicasting
If an IP datagram is broadcast to a subnet, it is received by every host on the subnet. Each host
processes the packet to determine if the target protocol is active. If it is not active, the IP
datagram is discarded. Multicasting avoids this by selecting destination groups.
Each group is represented by a Class D IP address. For each multicast address, a set of zero or
more hosts are listening for packets addressed to the address.
This set of hosts is called the host group. Packets sent to a multicast address are forwarded only
to the members of the corresponding host group. Multicast enables one-to-many connections.
Fig 3.9 show Multicast address

.
3.8 NetID & HostID

Network ID (netID): - the hosts that populates that networks shares those same bits called
networks bits.

Host ID:-these are unique identifier of each host within that network.
https://WWW.ThesisScientist.com
Network address:-a network address is an address that defines network itself it cannot be
assigned to a host.
Property of network address:-
1) all hosts ID bytes are 0s
2) The network address defines the networks to the rest of the internet.
3) Network address is the 1st address in the blocks.
4) If given an network address we can define class of address

E.g. 3.2 given the address 23.56.7.91. Find the network address?

Sol: - the class is A because first byte define netID. So we can find network address by replacing
hosted bytes by 0s so network address is 23.0.0.0

3.9 Subnetting
If you wanted to take one network address and create six networks from it? You would have to
perform what is called subnetting, which allows you to take one larger network and break it into
many smaller networks.

There are many reasons to perform subnetting. Some of the benefits of subnetting include
the following:

Reduced network traffic We all appreciate less traffic of any kind. Networks are no different.
Without trusty routers, packet traffic could grind the entire network down to a near standstill.
With routers, most traffic will stay on the local network; only packets destined for other
networks will pass through the router. Routers create broadcast domains. The smaller broadcast
domains you create the less network traffic on that network segment.

Optimized network performance This is a result of reduced network traffic.

Simplified management Its easier to identify and isolate network problems in a group of
smaller connected networks than within one gigantic network.

Facilitated spanning of large geographical distances Because WAN links are considerably
slower and more expensive than LAN links, a single large network that spans long distances can
create problems in every arena listed above. Connecting multiple smaller networks makes the
system more efficient.

3.9.1 Subnet Masks


For the subnet address scheme to work, every machine on the network must know which part of
the host address will be used as the subnet address. This is accomplished by assigning a subnet
mask to each machine. This is a 32-bit value that allows the recipient of IP packets to distinguish
the network ID portion of the IP address from the host ID portion of the IP address.
When router receives packet with destination IP address it needs to route a packets & the routing
is based on the network address & subnetwork address so the router outside the organization
https://WWW.ThesisScientist.com
routes the packets based on network address & router inside the organization route the packets
based on subnetwork address.

Router outside = uses default mask


Router inside = uses subnet mask

The network administrator creates a 32-bit subnet mask composed of 1s and 0s. The 1s in the
subnet mask represent the positions that refer to the network or subnet addresses.
3.9.2 Default mask
Its a 32 bit binary nos that gives 1 s t address in the block (network address) when ANDed with
address in the block.
Fig 3.13 show default subnet mask of classes

Rules of masking:-

1) If mask byte is255 retain corresponding byte.


2) if mask byte is 0 set corresponding byte to 0

Eg 3.4 given following address and use default mask to find network address.
1) 23.56.7.91
2) 132.16.17.85
3) 201.180.56.5

Sol 1) 23.56.7.91----- class A


255.0.0.0 --------default mask of class A
23.0.0.0 ---------- network address by using masking rule

2) 132.16.17.85----- class B
255.255.0.0 --------default mask of class B
132.16.0.0 ---------- network address by using masking rule

3) 201.180.56.5----- class C
255.255.255.0 --------default mask of class C
https://WWW.ThesisScientist.com
201.180.56.0 ---------- network address by using masking rule
Contiguous subnet mask: Are those 11110000 (nos of 1 followed by 0s)

3.9.3 Subnetting methods

1) straight methods
2) shortcut methods

3.9.3.1 Straight method


In this we uses binary notation for both the address & the mask & then apply AND operation to
find subnet address.

Fig 3.14 show binary notation

Eg 3.5 what is subnetwork address if address is 200.45.34.36 & subnet mask is


255.255.240.0?

Sol address 11001000 00101101 00100010 00111000(binary notaion)


And Subnet mask 11111111 11111111 11110000 00000000
11001000 00101101 00100000 00000000
So subnetwork address is 200.45.32.0

3.10 Supernetting:-
The time came when most of the class A and class B addresses were depleted; however, there
was still a huge demand for midsize blocks. The size of a class C block with a maximum number
of 256 addresses did not satisfy the needs of most organizations. Even a midsize organization
needed more addresses. One solution was supernetting. In supernetting, an organization can
combine several class C blocks to create a larger range of addresses. In other words,
several networks are combined to create a super-network or a supernet.
An organization can apply for a set of class C blocks instead of just one. For example, an
organization that needs 1000 addresses can be granted four contiguous class C blocks. The

https://WWW.ThesisScientist.com
organization can then use these addresses to create one super network. Supernetting decreases
the number of 1s in the mask.

3.11 Classless Addressing:-


To overcome address depletion and give more organizations access to the Internet, classless
addressing was designed and implemented. In this scheme, there are no classes, but the
addresses are still granted in blocks.

3.11.1 Address Blocks


In classless addressing, when an entity, small or large, needs to be connected to the Internet, it is
granted a block (range) of addresses. The size of the block (the number of addresses) varies
based on the nature and size of the entity. For example, a household may be given only two
addresses; a large organization may be given thousands of addresses. An ISP, as the Internet
service provider, may be given thousands or hundreds of thousands based on the number of
customers it may serve.

https://WWW.ThesisScientist.com

Das könnte Ihnen auch gefallen