*It provides
best effort, connectionless packet delivery, packets may be lost, out of order,
or even duplicated, so it is the responsibility of higher layer protocols to
deal with these, if necessary.
*The header is
of fixed-length component of 20 bytes plus variable-length consisting of
options that can be up to 40 bytes.
Version: This field identifies the current IP
version and it is 4.
Internet header length (IHL): It specifies
the length of the header in 32-bit words. If no options are used, IHL will have
value of 5.
Type of service (TOS): This field
specifies the priority of packet based on delay,
throughput,
reliability and cost. Three bits are used to assign priority levels and four
bits are used for specific requirement (i.e. delay, throughput, reliability and
cost).
Total length: The total length specifies the number
of bytes of the IP packet including header and data, maximum length is 65535
bytes.
Identification, Flags, and Fragment Offset: These fields
are used for fragmentation and reassembly.
Time to live (TTL): It specifies
the number of hops; the packet is allowed to traverse in the network. Each
router along the path to the destination decrements this value by one. If the
value reaches zero before the packet reaches the destination, the router
discards the packet and sends an error message back to the source.
Protocol: specifies upper-layer protocol that is
to receive IP data at the destination.
Examples include
TCP (protocol = 6), UDP (protocol = 17), and ICMP (protocol =1).
Header checksum: verifies the integrity of the IP
header of the IP packet.
* IP header uses
check bits to detect errors in the header
* A checksum is
calculated for header contents
* Checksum
recalculated at every router, so algorithm selected for ease of
implementation
in software
Source IP address and destination IP address: contain the addresses of the source and
destination hosts.
Options: Variable length field allows packet to
request special features such as security level, route to be taken by the
packet, and timestamp at each router. Detailed descriptions of these options
can be found in [RFC 791].
Padding: This field is used to make the header a
multiple of 32-bit words.
IP Header Processing
1. Compute
header checksum for correctness and check that fields in header (e.g.
version and
total length) contain valid values
2. Consult
routing table to determine next hop
3. Change fields
that require updating (TTL, header checksum)
IP Addressing
* RFC 1166
* Each host on
Internet has unique 32 bit IP address
* Each address
has two parts: Netid and Hostid
* Netid is
unique & administered by
o American
Registry for Internet Numbers (ARIN)
o Reseaux IP
Europeens (RIPE)
o Asia Pacific
Network Information Centre (APNIC)
* The Net ID
identifies the network the host is connected to.
* The host ID
identifies each individual system connected to network.
* Dotted Decimal
Notation is used for representation:
* The IP address
of 10000000 10000111 01000100 00000101 is 128.135.68.5 in
dotted-decimal
notation
Classful IP Addresses
* The IP address
structure is divided into five address classes: Class A, Class B, Class C,
Class D and Class E
* The class is
identified by the Most Significant Bit (MSB) of the address as shown
below.
* Class A has 7
bits for network IDs and 24 bits for host IDs, allowing up to 126
networks and
about 16 million hosts per network.
* Class B has 14
bits for network IDs and 16 bits for host IDs, allowing about 16,000 networks
and about 64,000 hosts per network.
* Class C has 21
bits for network IDs and 8 bits for host IDs, allowing about 2 million networks
and 254 hosts per network.
* Class D
addresses is used for multicast services that allow host to send information to
a group of hosts simultaneously.
* Class E
addresses are reserved for experiments.
Class A
7 24
0
|
netid
|
hostid
|
• 126 networks
with up to 16 million hosts 1.0.0.0
to
127.255.255.255
Class B
14 16
1
|
0
|
netid
|
hostid
|
• 16,382
networks with up to 64,000 hosts 128.0.0.0
to
191.255.255.255
Class C
22 8
1
|
1
|
0
|
netid
|
hostid
|
• 2 million
networks with up to 254 hosts 192.0.0.0
to
223.255.255.255
Class D
28
bits
1
|
1
|
1
|
0
|
multicast
address
|
224.0.0.0 to
239.255.255.255
Class E
28
bits
1
|
1
|
1
|
1
|
Reserved
for Experiments
|
240.0.0.0 to
254.255.255.255
Subnet
Addressing
*
Subnet addressing was introduced in the mid 1980s when most large organizations
are moving their computing platforms from mainframes to networks of
workstations.
*
Subnetting adds another level of hierarchical level called “Subnet”.
*
Inside the organization the network administrator can choose any combination of
lengths
for subnet and host ID fields.
*
Example: - consider an organization that has been assigned a class B IP address
with a network ID of 150.100. Suppose the organization has many LANS, each
consisting of not more than 100 hosts. Then seven bits are sufficient to
uniquely identify each host in a subnetwork. The other nine bits can be used to
identify the subnetworks within organization
*
To find the subnet number, the router needs to store an additional quantity
called
subnet
mask, which consists of binary 1s for every bit position of the address except
the host ID field where binary 0s are used.
*
For the IP address 150.100.12.176, the subnet mask is
11111111
11111111 11111111 10000000, which corresponds to 255.255.255.128.
*
The router can determine the subnet number by performing a binary AND between
subnet mask and the IP address.
The
IP address is 10010110 01100100 00001100 10110000 i.e. 150.100.12.176 AND with
subnet mask 11111111 11111111 11111111 10000000 i.e. 255.255.255.128 to get
subnet number 10010110 01100100 00001100 10000000 i.e.150.100.12.128
and
which is also called as First Address and is used to identify the
subnetwork inside the organization.
*
The IP address 150.100.12.255 is used to broadcast packets inside the
subnetwork. Thus the host connected to subnetwork must have IP address in the
range 150.100.12.129 to 150.100.12.254.
0 comments