ipv4-ipv6

43
1 IP IP (Internet Protocol) (Internet Protocol)

Upload: xxx

Post on 22-Nov-2014

1.119 views

Category:

Documents


13 download

TRANSCRIPT

Page 1: IPV4-IPV6

11

IPIP(Internet Protocol)(Internet Protocol)

Page 2: IPV4-IPV6

22

IP OperationIP Operation Connectionless datagram protocolConnectionless datagram protocol

It does not provide any error control or flow control. It does not provide any error control or flow control. But it can only detect the error and discards the packet But it can only detect the error and discards the packet if it is corrupted. IP should be used along with TCP to if it is corrupted. IP should be used along with TCP to make it reliable. make it reliable.

Packets in IP layer are called Packets in IP layer are called datagramsdatagrams. A datagrams . A datagrams is a variable length packet with two parts namely the is a variable length packet with two parts namely the header and data. The headers is 20 to 60 bytes long. header and data. The headers is 20 to 60 bytes long.

Page 3: IPV4-IPV6

33

Connectionless means..Connectionless means.. The connectionless service is like a postal service. The connectionless service is like a postal service.

Each message carries the full address of the Each message carries the full address of the destination. destination.

The user simply bundles his information together, puts The user simply bundles his information together, puts an address on it, and then sends it off, in the hope that an address on it, and then sends it off, in the hope that it will reach to the destination. it will reach to the destination.

Each message is routed independently from source to Each message is routed independently from source to destination through the system. destination through the system.

Page 4: IPV4-IPV6

44

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

systems. systems.

It is necessary to establish the connection (VC), use the It is necessary to establish the connection (VC), use the connection and Release the connection. connection and Release the connection.

The connection acts like a tube. The sender pushes bits The connection acts like a tube. The sender pushes bits from one end of the tube and the receiver takes them from one end of the tube and the receiver takes them out from the other end. out from the other end.

Page 5: IPV4-IPV6

55

IP Header FormatIP Header Format

Page 6: IPV4-IPV6

66

IP OperationIP Operation Ver Ver : version of IP. Current version is IPv4. : version of IP. Current version is IPv4.

HLENHLEN : Length of datagram header (in terms of 4 : Length of datagram header (in terms of 4 bytes)bytes)

Type of Service (TOS)Type of Service (TOS) : This field defines the class of : This field defines the class of datagram for quality of service purpose. This field has datagram for quality of service purpose. This field has a number of different definitions but its basic function a number of different definitions but its basic function is to allow packets to be treated differently based on is to allow packets to be treated differently based on application needs. application needs.

Page 7: IPV4-IPV6

77

IP OperationIP Operation• Total Length:Total Length: defines total length of IP datagram defines total length of IP datagram

(Max: 65535 bytes of which 20 to 60 bytes are the (Max: 65535 bytes of which 20 to 60 bytes are the header). But generally all hosts are prepared to accept header). But generally all hosts are prepared to accept datagrams of up to 576 bytes. datagrams of up to 576 bytes.

• Identification:Identification: To enable the fragments to be To enable the fragments to be reassembled at the receiving host, they all carry same reassembled at the receiving host, they all carry same identifier in the Indent field. identifier in the Indent field.

Page 8: IPV4-IPV6

88

IP OperationIP Operation• Flags:Flags: This is 3 bit field. First bit is always 0. The This is 3 bit field. First bit is always 0. The

second field is called “Do not fragment”. The third bit second field is called “Do not fragment”. The third bit is “More fragment bit”. is “More fragment bit”.

• Fragmentation offset: Fragmentation offset: 13 bit field which shows the 13 bit field which shows the relative position of this fragment with respect to whole relative position of this fragment with respect to whole datagram. It is an offset of the data in the original datagram. It is an offset of the data in the original datagram measured in units of 8 bytes. datagram measured in units of 8 bytes.

Page 9: IPV4-IPV6

99

IP OperationIP Operation Time to Live (TTL):Time to Live (TTL): 8 bit field which controls the 8 bit field which controls the

maximum number of routers visited by the datagram. maximum number of routers visited by the datagram.

Protocol:Protocol: Defines higher level protocol such as TCP(6), Defines higher level protocol such as TCP(6), UDP(17) etc. UDP(17) etc.

Header Checksum:Header Checksum: A checksum in IP packet covers on A checksum in IP packet covers on the header only. Since some header fields change, this the header only. Since some header fields change, this field is recomputed and verified at each point that the field is recomputed and verified at each point that the IP header is processed. IP header is processed.

Page 10: IPV4-IPV6

1010

IP OperationIP Operation Source Address:Source Address: This defines the source IP address. This defines the source IP address.

Destination Address: Destination Address: This defines the destination IP This defines the destination IP address. address.

Options: Options: This field is not required for each datagram This field is not required for each datagram but is useful for network testing and debugging. This but is useful for network testing and debugging. This options includes Record route (trace the route a packet options includes Record route (trace the route a packet takes), various security features etc. takes), various security features etc.

Page 11: IPV4-IPV6

1111

MTUMTU Every network type has a maximum transmission unit Every network type has a maximum transmission unit

(MTU) which is the largest IP datagram that it can (MTU) which is the largest IP datagram that it can carry in a frame. carry in a frame.

MTU value are :MTU value are : Ethernet network : 1500 bytesEthernet network : 1500 bytes FDDI network : 4500 bytesFDDI network : 4500 bytes Point to point network : 532 bytes. Point to point network : 532 bytes.

Page 12: IPV4-IPV6

1212

Fragmentation Fragmentation

Page 13: IPV4-IPV6

1313

Fragmentation Fragmentation Suppose a router receives an IP packet of 600 data Suppose a router receives an IP packet of 600 data

bytes and MTU is 200 bytes. Header is of 20 bytes bytes and MTU is 200 bytes. Header is of 20 bytes long. Show the fragmentation values?long. Show the fragmentation values?

1.1. Header is 20 bytes long. Header is 20 bytes long. 2.2. 600 data byte packet is divided into 4 fragments. 600 data byte packet is divided into 4 fragments. 3.3. Each containing 160 bytes of data and 20 bytes Header. Each containing 160 bytes of data and 20 bytes Header. 4.4. Offset values are : 0,20,40,60. Offset values are : 0,20,40,60.

Page 14: IPV4-IPV6

1414

Fragmentation Fragmentation Suppose a router receives an IP packet of 4000 data Suppose a router receives an IP packet of 4000 data

bytes and MTU is 1500 bytes. Header is of 20 bytes bytes and MTU is 1500 bytes. Header is of 20 bytes long. Show the fragmentation values?long. Show the fragmentation values?

1.1. Header is 20 bytes long. Header is 20 bytes long. 2.2. 4000 data byte packet is divided into 3 fragments. 4000 data byte packet is divided into 3 fragments. 3.3. Each containing 1400 bytes of data and 20 bytes Each containing 1400 bytes of data and 20 bytes

Header. Header. 4.4. Offset values are : 0,175, 350.Offset values are : 0,175, 350.

Page 15: IPV4-IPV6

1515

IP Header FormatIP Header Format

Page 16: IPV4-IPV6

1616

IP ClassesIP Classes IP addresses are of 32 bit long and divided into various IP addresses are of 32 bit long and divided into various

classes. (Ex:classes. (Ex:192.168.100.80192.168.100.80))

It consists of two fields: It consists of two fields: network fieldnetwork field which identifies which identifies the network and the network and hosts fieldhosts field which is used to identify which is used to identify host in that network. host in that network.

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

Approximately 4 billion addresses are possible. Half of Approximately 4 billion addresses are possible. Half of class A, 1/4class A, 1/4thth of class B and 1/8 of class B and 1/8thth of class C. of class C.

Page 17: IPV4-IPV6

1717

IP AddressesIP Addresses

Page 18: IPV4-IPV6

1818

IP ClassesIP Classes The network address is an address that defines the The network address is an address that defines the

network itself. It cannot be assigned to a host. network itself. It cannot be assigned to a host.

For example in case of 24.51.10.80, Class A network, For example in case of 24.51.10.80, Class A network, as first byte defines the network ID, the as first byte defines the network ID, the Network Network address address is 24.0.0.0. is 24.0.0.0.

Address maskAddress mask determines which potion of IP address determines which potion of IP address identifies the network and which portion identifies the identifies the network and which portion identifies the hosts. (For Example: Class A, Address Mask is hosts. (For Example: Class A, Address Mask is 255.0.0.0 and Class C, Address Mask is 255.255.255.0)255.0.0.0 and Class C, Address Mask is 255.255.255.0)

Page 19: IPV4-IPV6

1919

IP Classes (Example)IP Classes (Example) Find the class of each address :Find the class of each address :

000000001 00001011 00001111 11101110000001 00001011 00001111 1110111 11011000001 10000011 10011010 101010100001 10000011 10011010 1010101 111111110011 10011011 11111011 00001110011 10011011 11111011 0000111

Find the class of each address :Find the class of each address : 227.12.14.87227.12.14.87 193.14.56.22193.14.56.22 14.23.120.814.23.120.8

Page 20: IPV4-IPV6

2020

Special IP AddressesSpecial IP Addresses All zeros are used by the hosts when they are being booted All zeros are used by the hosts when they are being booted

but not used afterwards. (but not used afterwards. (0.0.0.0)0.0.0.0)

The IP address with 0 as the network number refers to their The IP address with 0 as the network number refers to their own network without knowing its number. (own network without knowing its number. (0.X.X.X0.X.X.X))

The address having all ones is used for broadcasting on the The address having all ones is used for broadcasting on the local network such as LAN.(local network such as LAN.(255.255.255.255255.255.255.255) )

The host ID as all ones allows machines to send broadcast The host ID as all ones allows machines to send broadcast packets to distant LAN anywhere in the Internet. packets to distant LAN anywhere in the Internet. ((X.255.255.255X.255.255.255))

Page 21: IPV4-IPV6

2121

Special IP AddressesSpecial IP Addresses

Page 22: IPV4-IPV6

2222

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

1.1. 23.56.7.9123.56.7.912.2. 132.6.17.85132.6.17.853.3. 201.180.56.5201.180.56.5

Page 23: IPV4-IPV6

2323

IP Classes (Example)IP Classes (Example) Given the network address 17.0.0.0, find the class, the Given the network address 17.0.0.0, find the class, the

block and the range of the addresses?block and the range of the addresses?

1.1. The class is A.The class is A.2.2. The block has netid of 17.The block has netid of 17.3.3. The address range is from 17.0.0.0 to 17.255.255.255.The address range is from 17.0.0.0 to 17.255.255.255.

Page 24: IPV4-IPV6

2424

IP Classes (Example)IP Classes (Example) Given the network address 132.21.0.0 find the class, the Given the network address 132.21.0.0 find the class, the

block and the range of the addresses?block and the range of the addresses?

Given the network address 220.34.76.0 find the class, the Given the network address 220.34.76.0 find the class, the block and the range of the addresses?block and the range of the addresses?

Page 25: IPV4-IPV6

2525

Limitation of IPv4.Limitation of IPv4. It uses only 32 bit addressing scheme. Hence limited It uses only 32 bit addressing scheme. Hence limited

number of networks and hosts IP’s are provided. number of networks and hosts IP’s are provided.

Other identifies limitations of this protocol are: Complex Other identifies limitations of this protocol are: Complex host, router configuration, non-hierarchical addressing, host, router configuration, non-hierarchical addressing, difficulty in re-numbering addresses, large routing tables difficulty in re-numbering addresses, large routing tables etc. etc.

Page 26: IPV4-IPV6

2626

SubnettingSubnetting All hosts must have the same network number. But this All hosts must have the same network number. But this

property of IP addressing can be problematic as the property of IP addressing can be problematic as the network size increases.network size increases.

Solution is to divide the network into many smaller Solution is to divide the network into many smaller networks internally but it acts like a single network to the networks internally but it acts like a single network to the outside world. outside world.

The smaller parts of a network are called as subnetting. The The smaller parts of a network are called as subnetting. The number of 1’s in the subnet mask is more than the number number of 1’s in the subnet mask is more than the number of 1’s in the corresponding default mask. Thus we change 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. leftmost 0’s in the default mask to 1’s to make a subnet.

Page 27: IPV4-IPV6

2727

Subnetting (Example)Subnetting (Example) For example if the Default Mask is 255.255.0.0For example if the Default Mask is 255.255.0.0

i.e. 11111111 11111111 00000000 00000000i.e. 11111111 11111111 00000000 00000000

Subnet mask will be Subnet mask will be 11111111 11111111 111 00000 0000000011111111 11111111 111 00000 00000000

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

The number of subnets will be 8.The number of subnets will be 8.

Page 28: IPV4-IPV6

2828

Subnetting (Example)Subnetting (Example) A router inside an organization receives the same A router inside an organization receives the same

packet with a destination address 190.240.34.95. if the packet with a destination address 190.240.34.95. if the subnet mask is /19. Find the subnet address.subnet mask is /19. Find the subnet address.

Subnet mask will beSubnet mask will be 11111111 11111111 111 00000 0000000011111111 11111111 111 00000 00000000

Address isAddress is 11000000 11110000 001 00010 0101111111000000 11110000 001 00010 01011111

Subnet Address is Subnet Address is 11000000 11110000 001 00000 0000000011000000 11110000 001 00000 00000000 i.e. 190.240.32.0i.e. 190.240.32.0

Page 29: IPV4-IPV6

2929

Subnetting (Example)Subnetting (Example) The IP address is 198.123.46.237. What will be subnet The IP address is 198.123.46.237. What will be subnet

mask if 4 networks are allowed? mask if 4 networks are allowed?

Class C networkClass C network

Subnet mask will be: Subnet mask will be: 11111111 11111111 11111111 0000000011111111 11111111 11111111 00000000

Because of 4 subnets subnet mask will be:Because of 4 subnets subnet mask will be: 11111111 11111111 11111111 110000011111111 11111111 11111111 1100000 i.e. 255.255.255.192i.e. 255.255.255.192

Page 30: IPV4-IPV6

3030

Subnetting (Example)Subnetting (Example) A company is granted a site address 201.70.64.0. The A company is granted a site address 201.70.64.0. The

company need six subnets. Design the subnets?company need six subnets. Design the subnets?

Subnet mask will be: Subnet mask will be: 11111111 11111111 11111111 0000000011111111 11111111 11111111 00000000

Because of 6 subnets Subnet mask will be:Because of 6 subnets Subnet mask will be: 11111111 11111111 11111111 1110000011111111 11111111 11111111 11100000

Because of 6 subnets Address will beBecause of 6 subnets Address will be Subnet 1 : 201.70.64.0 – 201.70.64.31Subnet 1 : 201.70.64.0 – 201.70.64.31 Subnet 2 : 201.70.64.32 – 201.70.64.63Subnet 2 : 201.70.64.32 – 201.70.64.63 Subnet 3 : 201.70.64.64 – 201.70.64.95Subnet 3 : 201.70.64.64 – 201.70.64.95 Subnet 4 : 201.70.64.96 – 201.70.64.127Subnet 4 : 201.70.64.96 – 201.70.64.127 Subnet 5 : 201.70.64.128 – 201.70.64.159Subnet 5 : 201.70.64.128 – 201.70.64.159 Subnet 6 : 201.70.64.160 – 201.70.64.191Subnet 6 : 201.70.64.160 – 201.70.64.191

Page 31: IPV4-IPV6

3131

SubnettingSubnetting The number of subnets is determined by the number of The number of subnets is determined by the number of

extra 1’s. extra 1’s.

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

For example: in case of default mask 255.255.0.0 (16 bits 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 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 and 13 bits with 0’s. For 3 extra 1’s, the number of subnets will be 8. will be 8.

Page 32: IPV4-IPV6

3232

SupernettingSupernetting The class A and B addresses are almost completed but The class A and B addresses are almost completed but

class C addresses are still available. But the size of class C addresses are still available. But the size of class C address with a maximum number of 256 class C address with a maximum number of 256 addresses does not satisfy the needs of an organization. addresses does not satisfy the needs of an organization. The solution is The solution is SupernettingSupernetting. .

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

Page 33: IPV4-IPV6

3333

IPv6 FeaturesIPv6 Features IPv6 is the next generation internet protocol designed IPv6 is the next generation internet protocol designed

to enable high performance scalable network. to enable high performance scalable network. Ex:Ex:AC81:9840:8600:4520:AC56:ABDC:0000:FFFFAC81:9840:8600:4520:AC56:ABDC:0000:FFFF

IPv6 provides 128 bit address space as opposed to the IPv6 provides 128 bit address space as opposed to the 32 bits of version IPv4. 32 bits of version IPv4.

IPv4 supports addresses up to 4 billion nodes if IPv4 supports addresses up to 4 billion nodes if assignment efficiency is 100% (In real case it is not assignment efficiency is 100% (In real case it is not possible) IPv6 supports 3.4 × 10possible) IPv6 supports 3.4 × 103838 nodes. nodes.

Page 34: IPV4-IPV6

3434

IPv6 FeaturesIPv6 Features There is special notation used for IPV6 addresses as There is special notation used for IPV6 addresses as

X:X:X:X:X:X:X:X where X is the hexadecimal X:X:X:X:X:X:X:X where X is the hexadecimal representation of a 16 bit piece of the address. representation of a 16 bit piece of the address.

All leading zeros can be dropped out. We can remove All leading zeros can be dropped out. We can remove zeros completely in consecutive cases and replace with zeros completely in consecutive cases and replace with semi-colon. semi-colon.

Example: Example: 1245:0000:0000:0000:0000:0000:A456:1275 can be 1245:0000:0000:0000:0000:0000:A456:1275 can be represented as 1245::A456:1275. represented as 1245::A456:1275.

Page 35: IPV4-IPV6

3535

IPv6 FeaturesIPv6 Features IPv6 addresses do not have classes but the address IPv6 addresses do not have classes but the address

space is still subdivided in various ways based on their space is still subdivided in various ways based on their leading bits. (Reserved for LAN , Global Unicast leading bits. (Reserved for LAN , Global Unicast addresses). addresses).

Page 36: IPV4-IPV6

3636

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

Page 37: IPV4-IPV6

3737

IPv6 Header FormatIPv6 Header Format

Page 38: IPV4-IPV6

3838

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

TrafficClass and FlowLabel :TrafficClass and FlowLabel : Both relative to Both relative to quality of service issues. FlowLabel provides quality of service issues. FlowLabel provides special handling for a flow of data. TrafficClass special handling for a flow of data. TrafficClass defines the priority of the packets. defines the priority of the packets.

PayLoadLen :PayLoadLen : The PayLoadLen field gives the The PayLoadLen field gives the length of the packet excluding the header length of the packet excluding the header measured in bytes. measured in bytes.

Page 39: IPV4-IPV6

3939

IPv6 Header FormatIPv6 Header Format NextHeader :NextHeader : It replaces both IP options and protocol It replaces both IP options and protocol

field of IPv4. If options are required then they are field of IPv4. If options are required then they are carried in one or more special headers following the IP carried in one or more special headers following the IP header and this is indicated by the value of the header and this is indicated by the value of the NextHeader field. If there are no special headers, then NextHeader field. If there are no special headers, then this field identifies the higher level protocols running this field identifies the higher level protocols running over IP. Thus it serves the same purpose as the IPv4 over IP. Thus it serves the same purpose as the IPv4 Protocol field. Protocol field.

Page 40: IPV4-IPV6

4040

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

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

Destination address:Destination address: 16 byte IP address of the 16 byte IP address of the destination host.destination host.

Page 41: IPV4-IPV6

4141

IPv6 Extension HeadersIPv6 Extension Headers The length of base header is 40 byte and can be The length of base header is 40 byte and can be

followed by up to 6 extension headers. followed by up to 6 extension headers.

In IPv6 options come in extension headers and appear In IPv6 options come in extension headers and appear in a specific order. in a specific order.

Thus each router can quickly determine if any of the Thus each router can quickly determine if any of the options are relevant to it. This can be determined by options are relevant to it. This can be determined by just looking at the just looking at the NextHeader NextHeader field. Router field. Router performance will increase to great extent due to this. performance will increase to great extent due to this.

Page 42: IPV4-IPV6

4242

IPv6 Extension HeadersIPv6 Extension Headers

Page 43: IPV4-IPV6

4343

IPv4 vs. IPv6IPv4 vs. IPv6