Você está na página 1de 43

IP

(Internet Protocol)

1
IP Operation
 Connectionless datagram protocol

 It does not provide any error control or flow control.


But it can only detect the error and discards the packet
if it is corrupted. IP should be used along with TCP to
make it reliable.

 Packets in IP layer are called datagrams. A datagrams


is a variable length packet with two parts namely the
header and data. The headers is 20 to 60 bytes long.

2
Connectionless means..
 The connectionless service is like a postal service.
Each message carries the full address of the
destination.

 The user simply bundles his information together, puts


an address on it, and then sends it off, in the hope that
it will reach to the destination.

 Each message is routed independently from source to


destination through the system.

3
Connection Oriented means..
 These are similar to the one provided in the telephone
systems.

 It is necessary to establish the connection (VC), use the


connection and Release the connection.

 The connection acts like a tube. The sender pushes bits


from one end of the tube and the receiver takes them
out from the other end.

4
IP Header Format

5
IP Operation
 Ver : version of IP. Current version is IPv4.

 HLEN : Length of datagram header (in terms of 4


bytes)

 Type of Service (TOS) : This field defines the class of


datagram for quality of service purpose. This field has
a number of different definitions but its basic function
is to allow packets to be treated differently based on
application needs.

6
IP Operation
• Total Length: defines total length of IP datagram
(Max: 65535 bytes of which 20 to 60 bytes are the
header). But generally all hosts are prepared to accept
datagrams of up to 576 bytes.

• Identification: To enable the fragments to be


reassembled at the receiving host, they all carry same
identifier in the Indent field.

7
IP Operation
• Flags: This is 3 bit field. First bit is always 0. The
second field is called “Do not fragment”. The third bit
is “More fragment bit”.

• Fragmentation offset: 13 bit field which shows the


relative position of this fragment with respect to whole
datagram. It is an offset of the data in the original
datagram measured in units of 8 bytes.

8
IP Operation
 Time to Live (TTL): 8 bit field which controls the
maximum number of routers visited by the datagram.

 Protocol: Defines higher level protocol such as TCP(6),


UDP(17) etc.

 Header Checksum: A checksum in IP packet covers on


the header only. Since some header fields change, this
field is recomputed and verified at each point that the
IP header is processed.

9
IP Operation
 Source Address: This defines the source IP address.

 Destination Address: This defines the destination IP


address.

 Options: This field is not required for each datagram


but is useful for network testing and debugging. This
options includes Record route (trace the route a packet
takes), various security features etc.

10
MTU
 Every network type has a maximum transmission unit
(MTU) which is the largest IP datagram that it can
carry in a frame.

 MTU value are :


 Ethernet network : 1500 bytes
 FDDI network : 4500 bytes
 Point to point network : 532 bytes.

11
Fragmentation

12
Fragmentation
 Suppose a router receives an IP packet of 600 data
bytes and MTU is 200 bytes. Header is of 20 bytes
long. Show the fragmentation values?

1. Header is 20 bytes long.


2. 600 data byte packet is divided into 4 fragments.
3. Each containing 160 bytes of data and 20 bytes Header.
4. Offset values are : 0,20,40,60.

13
Fragmentation
 Suppose a router receives an IP packet of 4000 data
bytes and MTU is 1500 bytes. Header is of 20 bytes
long. Show the fragmentation values?

1. Header is 20 bytes long.


2. 4000 data byte packet is divided into 3 fragments.
3. Each containing 1400 bytes of data and 20 bytes
Header.
4. Offset values are : 0,175, 350.

14
IP Header Format

15
IP Classes
 IP addresses are of 32 bit long and divided into various
classes. (Ex:192.168.100.80)

 It consists of two fields: network field which identifies


the network and hosts field which is used to identify
host in that network.

 Five Classes : A, B, C , D and E.

 Approximately 4 billion addresses are possible. Half of


class A, 1/4th of class B and 1/8th of class C.

16
IP Addresses

17
IP Classes
 The network address is an address that defines the
network itself. It cannot be assigned to a host.

 For example in case of 24.51.10.80, Class A network,


as first byte defines the network ID, the Network
address is 24.0.0.0.

 Address mask determines which potion of IP address


identifies the network and which portion identifies the
hosts. (For Example: Class A, Address Mask is
255.0.0.0 and Class C, Address Mask is 255.255.255.0)

18
IP Classes (Example)
 Find the class of each address :
 00000001 00001011 00001111 1110111
 11000001 10000011 10011010 1010101
 11110011 10011011 11111011 0000111

 Find the class of each address :


 227.12.14.87
 193.14.56.22
 14.23.120.8

19
Special IP Addresses
 All zeros are used by the hosts when they are being booted
but not used afterwards. (0.0.0.0)

 The IP address with 0 as the network number refers to their


own network without knowing its number. (0.X.X.X)

 The address having all ones is used for broadcasting on the


local network such as LAN.(255.255.255.255)

 The host ID as all ones allows machines to send broadcast


packets to distant LAN anywhere in the Internet.
(X.255.255.255)
20
Special IP Addresses

21
IP Classes (Example)
 Find the network address?

1. 23.56.7.91
2. 132.6.17.85
3. 201.180.56.5

22
IP Classes (Example)
 Given the network address 17.0.0.0, find the class, the
block and the range of the addresses?

1. The class is A.
2. The block has netid of 17.
3. The address range is from 17.0.0.0 to 17.255.255.255.

23
IP Classes (Example)
 Given the network address 132.21.0.0 find the class, the
block and the range of the addresses?

 Given the network address 220.34.76.0 find the class, the


block and the range of the addresses?

24
Limitation of IPv4.
 It uses only 32 bit addressing scheme. Hence limited
number of networks and hosts IP’s are provided.

 Other identifies limitations of this protocol are: Complex


host, router configuration, non-hierarchical addressing,
difficulty in re-numbering addresses, large routing tables
etc.

25
Subnetting
 All hosts must have the same network number. But this
property of IP addressing can be problematic as the
network size increases.

 Solution is to divide the network into many smaller


networks internally but it acts like a single network to the
outside world.

 The smaller parts of a network are called as subnetting. The


number of 1’s in the subnet mask is more than the number
of 1’s in the corresponding default mask. Thus we change
leftmost 0’s in the default mask to 1’s to make a subnet.

26
Subnetting (Example)
 For example if the Default Mask is 255.255.0.0
 i.e. 11111111 11111111 00000000 00000000

 Subnet mask will be


 11111111 11111111 111 00000 00000000

 First 16 bits will be 1, next 3 bits will be 1 and last 13


bits will be 0.

 The number of subnets will be 8.

27
Subnetting (Example)
 A router inside an organization receives the same
packet with a destination address 190.240.34.95. if the
subnet mask is /19. Find the subnet address.

 Subnet mask will be


 11111111 11111111 111 00000 00000000

 Address is
 11000000 11110000 001 00010 01011111

 Subnet Address is
 11000000 11110000 001 00000 00000000
 i.e. 190.240.32.0 28
Subnetting (Example)
 The IP address is 198.123.46.237. What will be subnet
mask if 4 networks are allowed?

 Class C network

 Subnet mask will be:


 11111111 11111111 11111111 00000000

 Because of 4 subnets subnet mask will be:


 11111111 11111111 11111111 1100000
 i.e. 255.255.255.192

29
Subnetting (Example)
 A company is granted a site address 201.70.64.0. The
company need six subnets. Design the subnets?

 Subnet mask will be:


 11111111 11111111 11111111 00000000
 Because of 6 subnets Subnet mask will be:
 11111111 11111111 11111111 11100000
 Because of 6 subnets Address will be
 Subnet 1 : 201.70.64.0 – 201.70.64.31
 Subnet 2 : 201.70.64.32 – 201.70.64.63
 Subnet 3 : 201.70.64.64 – 201.70.64.95
 Subnet 4 : 201.70.64.96 – 201.70.64.127
 Subnet 5 : 201.70.64.128 – 201.70.64.159
 Subnet 6 : 201.70.64.160 – 201.70.64.191 30
Subnetting
 The number of subnets is determined by the number of
extra 1’s.

 For n extra 1’s the number of subnets is 2n.

 For example: in case of default mask 255.255.0.0 (16 bits


as 1’s and 16 bits as 0’s) subnet mask will be 19 bits as 1’s
and 13 bits with 0’s. For 3 extra 1’s, the number of subnets
will be 8.

31
Supernetting
 The class A and B addresses are almost completed but
class C addresses are still available. But the size of
class C address with a maximum number of 256
addresses does not satisfy the needs of an organization.
The solution is Supernetting.

 In supernetting, an organization combines many class


C blocks to create a large range of addresses. Many
networks are thus combined to create a supernetwork.
For an example: if an organization needs 1000
addresses, they can be obtained by using four C blocks
where one C block consists of 256 address.

32
IPv6 Features
 IPv6 is the next generation internet protocol designed
to enable high performance scalable network.
 Ex:AC81:9840:8600:4520:AC56:ABDC:0000:FFFF

 IPv6 provides 128 bit address space as opposed to the


32 bits of version IPv4.

 IPv4 supports addresses up to 4 billion nodes if


assignment efficiency is 100% (In real case it is not
possible) IPv6 supports 3.4 × 1038 nodes.

33
IPv6 Features
 There is special notation used for IPV6 addresses as
X:X:X:X:X:X:X:X where X is the hexadecimal
representation of a 16 bit piece of the address.

 All leading zeros can be dropped out. We can remove


zeros completely in consecutive cases and replace with
semi-colon.
 Example:
1245:0000:0000:0000:0000:0000:A456:1275 can be
represented as 1245::A456:1275.

34
IPv6 Features
 IPv6 addresses do not have classes but the address
space is still subdivided in various ways based on their
leading bits. (Reserved for LAN , Global Unicast
addresses).

35
Advantages of IPv6
 Large Address space : (128 bit)
 Better header format : (options are separated)
 New options : (Security)
 Possibility of extensions (support for various protocols)
 More security : (IPSec)
 Support to resource allocation (real time traffic)
 Plug and Play

36
IPv6 Header Format

37
IPv6 Header Format
 Version: Version field is set to 6 for IPv6.

 TrafficClass and FlowLabel : Both relative to


quality of service issues. FlowLabel provides
special handling for a flow of data. TrafficClass
defines the priority of the packets.

 PayLoadLen : The PayLoadLen field gives the


length of the packet excluding the header
measured in bytes. 38
IPv6 Header Format
 NextHeader : It replaces both IP options and protocol
field of IPv4. If options are required then they are
carried in one or more special headers following the IP
header and this is indicated by the value of the
NextHeader field. If there are no special headers, then
this field identifies the higher level protocols running
over IP. Thus it serves the same purpose as the IPv4
Protocol field.

39
IPv6 Header Format
 Hop Limit: Same purpose of TTL in IPv4.

 Source address: 16 byte IP address of the sending host.

 Destination address: 16 byte IP address of the


destination host.

40
IPv6 Extension Headers
 The length of base header is 40 byte and can be
followed by up to 6 extension headers.

 In IPv6 options come in extension headers and appear


in a specific order.

 Thus each router can quickly determine if any of the


options are relevant to it. This can be determined by
just looking at the NextHeader field. Router
performance will increase to great extent due to this.

41
IPv6 Extension Headers

42
IPv4 vs. IPv6

43

Você também pode gostar