Sei sulla pagina 1di 125

INTERNET PROTOCOL (RFC 791)

-- Preetam Narayan

2012 Sasken Communication Technologies

2012 Sasken Communication Technologies

An IP address is a 4 byte (32-bit) address. *An IP addresses are unique

The address space of IPv4 is 232 or 4,294,967,296.

2012 Sasken Communication Technologies

IP ADDRESS NOTATION
Binary Notation
01000000 00001011 00000011 00011111

IP Address Notation

Dotted decimal Notation

Hexadecimal Notation
0x800B021F

2012 Sasken Communication Technologies

PROBLEM 1

Find the Error if any in the following IP Address: 111.56.045.78

LEARNING

There are no leading zeros in a dotted decimal Notation

2012 Sasken Communication Technologies

PROBLEM 1

Find the Error if any in the following IP Address: 111.301.045.78

LEARNING

Max permissible value is 255; 301 is out of range

2012 Sasken Communication Technologies

CLASSFUL ADDRESSING

2012 Sasken Communication Technologies

ADDRESS SPACE
In classful addressing, the address space is divided into five classes: A, B, C, D, and E.

2012 Sasken Communication Technologies

IDENTIFYING CLASS OF AN ADDRESS

Decimal Notation

Binary Notation

2012 Sasken Communication Technologies

PROBLEM 1

Find the class of the below address 00000001 00001011 00001011 11101111

LEARNING

1st Bit zero implies class A

2012 Sasken Communication Technologies

PROBLEM 1

Find the class of the below address 11000001 10000011 00011011 11111111

LEARNING

1st 3 bits binary representation 110; signifies class C

2012 Sasken Communication Technologies

Generalization

2012 Sasken Communication Technologies

PROBLEM 1

Find the class of the below address 233.14.56.22

LEARNING

Check for the range of the 1st byte; 224 <= 233 < 240; class D

2012 Sasken Communication Technologies

Generalization

Yes

Yes Yes

No CLASS A

No CLASS B

No
CLASS C

Yes

No CLASS E
2012 Sasken Communication Technologies

CLASS D

NETWORK ID & HOST ID

2012 Sasken Communication Technologies

PROBLEMS WITH CLASSFUL ADDRESSING


CLASS A -- EXAMPLE

Millions of class A addresses are wasted.


2012 Sasken Communication Technologies

PROBLEMS WITH CLASSFUL ADDRESSING


CLASS B -- EXAMPLE

Many of Class B Addresses are wasted


2012 Sasken Communication Technologies

PROBLEMS WITH CLASSFUL ADDRESSING


CLASS C -- EXAMPLE

Class C addresses are fit for smaller organization only


2012 Sasken Communication Technologies

PROBLEMS WITH CLASSFUL ADDRESSING

Class D addresses are reserved for multicasting;

Class E addresses are reserved for special purposes; most of the block is wasted.

2012 Sasken Communication Technologies

COMMUNICATION MODE

Unicasting communication is one-to-one; Multicasting communication is one-to-many; Broadcasting communication is one to all;

2012 Sasken Communication Technologies

PRIVATE ADDRESSING
A number of Blocks in each class which are assigned for private use only. These addresses cannot be used to connect to the Internet
IP CLASS
CLASS A CLASS B CLASS B

PRIVATE ADDRESS
10.0.0.0 10.255.255.255 169.254.0.0 169.254.255.255 172.16.0.0 172.31.255.255

CLASS C

192.168.0.0 192.168.255.255

2012 Sasken Communication Technologies

NETWORK ADDRESS
Network Address is the first Address (of the block) that is being assigned to an Organization. Network Address identifies a network in the Internet. Given a Network Address, we can find its Network class, range of permissible addresses for that network
2012 Sasken Communication Technologies

NETWORK ADDRESS

2012 Sasken Communication Technologies

PROBLEM 4

Find the network address 17.0.0.0, find its class and its address range
SOLUTION

CLASS A; Address range 17.0.0.0 17.255.255.255

2012 Sasken Communication Technologies

NETWORK MASK
Network Mask is a 32-bit number which gives the network Address when bitwise ANDed with an IP Address

2012 Sasken Communication Technologies

NETWORK MASK

Default Network Mask of a network is formed by setting the netid bits to 1 and hostid bits to 0

Default Network Mask of a class shouldnt be applied to an address belonging to another class

2012 Sasken Communication Technologies

PROBLEM 5

Given the address 201.180.165.5 find its default network mask and network address
SOLUTION

Address belong to CLASS C; Default network Mask 255.255.255.0; Network Address 201.180.165.0

2012 Sasken Communication Technologies

SPECIAL ADDRESSES
DIRECTED BROADCAST ADDRESS

2012 Sasken Communication Technologies

SPECIAL ADDRESSES
LIMITED BROADCAST ADDRESS

2012 Sasken Communication Technologies

SPECIAL ADDRESSES
THIS HOST Me

2012 Sasken Communication Technologies

SPECIAL ADDRESSES
SPECIFIC HOST ON THE NETWORK

2012 Sasken Communication Technologies

SPECIAL ADDRESSES
LOOPBACK ADDRESS

2012 Sasken Communication Technologies

APPLY YOUR LEARNINGS

2012 Sasken Communication Technologies

2012 Sasken Communication Technologies

Default IP addresses are designed with two levels of hierarchy.

All Hosts fall under the same level.

NETWORK DEPICTING 2 LEVEL HIERARCHY


2012 Sasken Communication Technologies

NETWORK DEPICTING 3 LEVEL HIERARCHY


2012 Sasken Communication Technologies

Subnetting: Process of dividing a Network into various kutti-kutti networks called subnets
Subnetting creates 3 level hierarchy: Network id, Sub-network id and Host id
2012 Sasken Communication Technologies

2012 Sasken Communication Technologies

Subnet-mask: formed by setting network id and sub-network id bits to 1 and host id bits to 0

2012 Sasken Communication Technologies

Subnet-Address: formed by ANDing IP address with the subnet mask

2012 Sasken Communication Technologies

SUBNET ADDRESS IDENTIFICATION


PROBLEM 1

Given the destination address is 19.30.80.5 and mask is 255.255.192.0 Determine the sub-network address
SUBNETTING STEPS

STEP1: if the network mask byte is 255 then copy the byte to the address STEP2: if the network mask byte is 0 then replace byte in the address with 0 STEP3: if the byte in the mask is neither 0 nor 255 then perform the AND by representing it in binary notation
2012 Sasken Communication Technologies

STEPS TO SUBNETTING

2012 Sasken Communication Technologies

APPLY YOUR LEARNINGS


PROBLEM 2

Given the destination address is 202.45.34.56 and mask is 255.255.240.0 Determine the sub-network address
SOLUTION

200.45.32.0

2012 Sasken Communication Technologies

Subnetting is done by borrowing bits from the Host id section of an IP address

2012 Sasken Communication Technologies

The number of subnets = 2 (number of bits used for subnet) - 2


The number of Hosts per subnet =
2 (number of bits used for Host) - 2

Broadcast address of a particular subnet = network address of following subnet - 1


2012 Sasken Communication Technologies

SOLVING A SUBNETTING PROBLEM


PROBLEM 2

A company is granted the site address 201.70.64.0 (Class C). The company needs 6 subnets. Design the subnets
APPROACH

STEP1: Identify the number of subnets needed STEP2: Identify the number of host bits to be borrowed STEP3: ignore the subnet bits with all 0s and all 1s STEP4: Find the subnet address space. Subnet address space = 2 (number of host id bits)

2012 Sasken Communication Technologies

SOLVING A SUBNETTING PROBLEM


SOLUTION

2012 Sasken Communication Technologies

SUBNETTING A SUBNET

2012 Sasken Communication Technologies

APPLY YOUR LEARNINGS


PROBLEM 2

Given the destination address is 202.45.34.56 and mask is 255.255.240.0 Determine the number of subnets and there address range

2012 Sasken Communication Technologies

Supernetting: combining several class C blocks to create a large address space Supernetting involves borrowing network bits In supernetting we need the 1st address of the supernet and supernet mask to define the range of addresses
2012 Sasken Communication Technologies

SUPERNETTING

2012 Sasken Communication Technologies

PROBLEM 2

A company needs 600 addresses. Which of the following set of class C addresses can be used to for a supernet for this company ? 198.47.32.0 198.47.32.0 198.47.31.0 198.47.32.0 198.47.33.0 198.47.42.0 198.47.32.0 198.47.33.0 198.47.34.0 198.47.52.0 198.47.33.0 198.47.34.0 198.47.62.0 198.47.52.0 198.47.35.0

2012 Sasken Communication Technologies

RULES FOR SUPERNETTING

RULE1: The number of blocks must be power of 2 (1,2,4,8,26..) RULE2: The blocks must be contiguous in the address space. RULE3: The 3rd byte of the 1st address in the superblock must be evenly divisible by the number of blocks. In other words if the number of blocks is N then the third byte must be divisible by N
SOLUTION

1: No, there are only three blocks. 2: No, the blocks are not contiguous.

3: No, 31 in the first block is not divisible by 4.


4: Yes, all three requirements are fulfilled.
2012 Sasken Communication Technologies

COMPARISON BETWEEN SUBNET MASK, DEFAULT MASK and SUPERNET MASK

2012 Sasken Communication Technologies

PROBLEM 6

We need to make a super-network out of 16 class C blocks. What is the supernet mask?

SOLUTION

255.255.240.0

2012 Sasken Communication Technologies

PROBLEM 5

A supernet has a first address of 205.16.32.0 and a supernet mask of 255.255.248.0. How many blocks are in this supernet and what is the range of addresses?
SOLUTION

205.16.32.0 205.16.39.0

2012 Sasken Communication Technologies

PROBLEM 5

A supernet has a first address of 205.16.32.0 and a supernet mask of 255.255.248.0. A router receives three packets with the following destination addresses: 205.16.37.44 205.16.42.56 205.17.33.76 Which packet belongs to the supernet?
SOLUTION

205.16.37.44
2012 Sasken Communication Technologies

CIDR NOTATION

2012 Sasken Communication Technologies

CIDR notation is also called slash notation

Classless Inter Domain Notation

2012 Sasken Communication Technologies

CHARACTERASTICS OF IP

2012 Sasken Communication Technologies

SWITCHING METHODS

2012 Sasken Communication Technologies

PACKET SWITCHING TYPES

2012 Sasken Communication Technologies

CONNECTION TYPES
Connection Types

Connectionless service

Connection-oriented service

2012 Sasken Communication Technologies

CONNECTIONLESS vs CONNECTION-ORIENTED

http://courses.iddl.vt.edu/CS1604/media/connectOriented.swf
2012 Sasken Communication Technologies

ADDRESSING SCOPE

2012 Sasken Communication Technologies

IP works in Packet switching technology


*Source and Destination IP address doesnt change during the journey of a packet in an inter-network

IP is a Hop-to-Hop protocol
2012 Sasken Communication Technologies

IP packets are also referred as IP Datagrams; IP is a Best Effort delivery protocol;

2012 Sasken Communication Technologies

POSITION OF IP IN NETWORK STACK

2012 Sasken Communication Technologies

IP HEADER

2012 Sasken Communication Technologies

IP HEADER

2012 Sasken Communication Technologies

VER is the IP version, to which the below packet belong. Set to 4(0100) for IPV4

2012 Sasken Communication Technologies

ETHERNET

IP STACK

IP PACKET

Is requested IP Version Supported ?

YES

NO SILENTLY DISCARD THE PACKET

2012 Sasken Communication Technologies

IP header size: Each bit is expressed in terms of multiple of 4 octets IP header size is variable 20 60 bytes

2012 Sasken Communication Technologies

PROBLEM

An IP packet has arrived with the first byte as shown: 01000010 The receiver discards the packet. Why?

2012 Sasken Communication Technologies

PROBLEM

In an IP packet, the value of HLEN is 1000 in binary. How many bytes of options are being carried by this packet?

2012 Sasken Communication Technologies

Total length of the datagram i.e. Header size + Data size

2012 Sasken Communication Technologies

PROBLEM

In an IP packet, the value of HLEN is 516 and the value of the total length field is 002816. How many bytes of data are being carried by this packet?

2012 Sasken Communication Technologies

2012 Sasken Communication Technologies

IP ensures that the minimum data size of underlying technology is respected

ETHERNET HAS A MINIMUM DATA LENGTH OF 46 BYTES

2012 Sasken Communication Technologies

>= LAYER 3

UPPER LAYER DATA

NETWORK LAYER

IP HEADER

Total length < 46 bytes

DATA LINK LAYER

2012 Sasken Communication Technologies

IP multiplexes higher layer protocol Protocol field: Denotes the upper layer protocol being carried by the IP

2012 Sasken Communication Technologies

Source IP Address and Dest IP Address doesnt change in a packet journey in a internetwork except in the case of source routing

2012 Sasken Communication Technologies

2012 Sasken Communication Technologies

Checksum calculation is done as following:

1. Divide the packet into 16 bits chunks.


2. While calculation checksum, checksum field bits are set to 0 3. Perform 1s complement sum of each chunk. 4. 1s complement the result obtained in STEP2.

2012 Sasken Communication Technologies

CHECKSUM CALCULATION

2012 Sasken Communication Technologies

Checksum is performed on the IP Header only and not on IP data Checksum is recalculated at each HOP
On detection of the checksum error, packet is dropped thereby the HOP
2012 Sasken Communication Technologies

TYPE OF SERVICE

Service level parameter, important for Routers. Prioritizes the packets based on this parameter

2012 Sasken Communication Technologies

TIME TO LIVE

Maximum time a packet lives in an internetwork, before it would gets destroyed Set by the sender; decremented by 1 at each HOP.

2012 Sasken Communication Technologies

TIME TO LIVE

2012 Sasken Communication Technologies

2012 Sasken Communication Technologies

MAXIMUM TRANSMITABLE UNIT

MTU determines the maximum amount of data that can be transmitted on an underlying technology

2012 Sasken Communication Technologies

In case the Packet size is greater than the MTU then packet need to be fragmented
Fragmentation is a process of dividing a large packet (size > MTU) to packets (size <= MTU)
2012 Sasken Communication Technologies

Once the packet is reaches the destination or a hop then it need to be reassembled Reassembly: is a process is getting back the original packet from the fragmented IP packets
2012 Sasken Communication Technologies

Based on where the fragmentationreassembly is done at Hop or final destination, fragmentation are classified under 2 types
IP Fragmentation
Intranet Fragmentation Internet Fragmentation

2012 Sasken Communication Technologies

INTRANET FRAGMENTATION

2012 Sasken Communication Technologies

INTRANET FRAGMENTATION fragmentation, transmission and reassembly across a local network which is invisible to the internet protocol module is called intranet fragmentation Efficient utilization of bandwidth More overhead, processing delay and buffering required
2012 Sasken Communication Technologies

INTERNET FRAGMENTATION

2012 Sasken Communication Technologies

INTERNET FRAGMENTATION

fragmentation, transmission and reassembly across an inter-network all the way to the final destination.
No buffering needed in intermediate nodes

Inefficient use of the network Bandwidth


2012 Sasken Communication Technologies

PROBLEM

Consider the journey of a packet of length 2048 octets and header 40 octets. It passes through the networks with maximum packet sizes as shown:
Network Maximum Packet Length

A B
C D E

2048 octets 512 octets


1024 octets 256 octets 1024 octets

Discuss the performance w.r.t internet and intranet fragmentation.


*Performance can be measured in terms of no. of fragmentation performed and re-assembly and number of data units passed in each
network

2012 Sasken Communication Technologies

FRAGMENTATION FLAGS

SET 0 for un-fragmented or last fragment packet SET 1 for rest all fragments
When SET (1) by the sender, then the packet wouldnt be fragmented. If the MTU size is not respected then it would be dropped with an ICMP message back to sender SET (0) implies there is permission to fragment
2012 Sasken Communication Technologies

FRAGMENTATION OFFSET

Indicates the relative position of the fragment w.r.t original IP datagram Fragmentation offset are measured in units of 8 octets Fragment offset 0 for the 1st fragment
2012 Sasken Communication Technologies

EXAMPLE

2012 Sasken Communication Technologies

EXAMPLE

2012 Sasken Communication Technologies

PROBLEM

In an IP packet arrives with the fragment offset value as 100, the value of the HLEN is 5 and value of the total length field as 100. What is the number of the 1st and last byte in that fragment ?
SOLUTION

1st byte number is 100 * 8 = 800 Last byte = 879

2012 Sasken Communication Technologies

OPTIONS

Options are optional parameters that might be sent by the sender; but not optional for implementers. So all IP module need to support all IP options

2012 Sasken Communication Technologies

OPTIONS

In case there is space enough for partial data to be filled then the respective packet would be dropped and an ICMP error message would be generated

2012 Sasken Communication Technologies

OPTIONS

2012 Sasken Communication Technologies

OPTIONS FORMAT

2012 Sasken Communication Technologies

END OF OPTIONS -- OPTION Optionally present at the end of all options if option header doesnt coincide the 32 bit boundary

2012 Sasken Communication Technologies

NO OPERATION OPTION Optionally present in between the options; to align the beginning of next option to 32 bit boundary

2012 Sasken Communication Technologies

RECORD ROUTE OPTIONS

Route followed by the IP packet is recorded in the IP header when this options is set; Each router in the transit, adds its IP address to the option

2012 Sasken Communication Technologies

RECORD ROUTE OPTIONS FORMAT

2012 Sasken Communication Technologies

RECORD ROUTE OPTIONS

On fragmentation only the 1st fragment would contain this information i.e. copied to 1st fragment only
It is the responsibility of the sender to define the size of option as it is not changed in the transit
2012 Sasken Communication Technologies

WORKING PRINCIPLE RECORD ROUTE

2012 Sasken Communication Technologies

STRICT SOURCE RECORD ROUTE OPTIONS

Means for the source to specify the route to be followed for the IP datagram; This also record the route in the transit
Strict source either follow the path or discard the IP packet Copied on each fragments
2012 Sasken Communication Technologies

STRICT SOURCE RECORD ROUTE OPTIONS FORMAT

2012 Sasken Communication Technologies

WORKING PRINCIPLE STRICT SOURCE-RECORD ROUTE OPTIONS

2012 Sasken Communication Technologies

LOOSE SOURCE RECORD ROUTE OPTIONS

Identical to strict source route, except that the gateway or host IP is allowed to use any number of intermediate gateways to reach the next address in the route
Copied on each fragments
2012 Sasken Communication Technologies

LOOSE SOURCE RECORD ROUTE OPTIONS FORMAT

2012 Sasken Communication Technologies

TIMESTAMP OPTIONS

Timestamp: Time at which the packet is processed by the HOP


Measured in milli-secs

2012 Sasken Communication Technologies

TIMESTAMP OPTIONS

2012 Sasken Communication Technologies

TIMESTAMP OPTIONS

Over-Flow Flag: number of IP modules which couldnt register there timestamp due to lack of space
In case the overflow flag itself overflows then an ICMP error message might be sent to the sender of the message
2012 Sasken Communication Technologies

TIMESTAMP OPTIONS -- FLAGS

2012 Sasken Communication Technologies

WORKING PRINCIPLE -- TIMESTAMP

2012 Sasken Communication Technologies

2012 Sasken Communication Technologies

Potrebbero piacerti anche