+ All Categories
Home > Documents > 20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc....

20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc....

Date post: 14-Dec-2015
Category:
Upload: gyles-mccarthy
View: 214 times
Download: 0 times
Share this document with a friend
Popular Tags:
58
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Transcript

20.1

Chapter 20

Network Layer:Internet Protocol

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Background In chapter 19 we studied how to assign

addresses to nodes in a network. Addresses assigned to nodes are

logical addresses called IP addresses. This chapter is about the IP i.e. the

Internet protocol used at the network layer.

NOTE: Kindly do not confuse IP address with

IP protocol. These are two different things.

20.2

Difference between IP (protocol) and IP address:

20.3

IP address is the logical name of the computer.

IP protocol is a set of rules to govern communication on the network layer.

Data link Vs. Network Layer

Data link layer provides hop to hop delivery.

Network layer provides host to host delivery.

If the transmission is within a network we use only physical and data link layer.

If the transmission is outside the network we use network layer+data link+physical layer.

20.4

20.5

20-1 INTERNETWORKING20-1 INTERNETWORKING

In this section, we discuss internetworking, connecting In this section, we discuss internetworking, connecting networks together to make an internetwork or an networks together to make an internetwork or an internet. internet.

Need for Network LayerInternet as a Datagram NetworkInternet as a Connectionless Network

Topics discussed in this section:Topics discussed in this section:

20.6

Figure 20.1 Links between two hosts

20.7

Figure 20.2 Network layer in an internetwork

20.9

Communication at the network layer in the Internet is connectionless.

Note

20.10

20-2 IPv420-2 IPv4

The Internet Protocol version 4 (The Internet Protocol version 4 (IPv4IPv4) is the delivery ) is the delivery mechanism used by the TCP/IP protocols.mechanism used by the TCP/IP protocols.

DatagramFragmentationChecksumOptions

Topics discussed in this section:Topics discussed in this section:

20.11

Figure 20.4 Position of IPv4 in TCP/IP protocol suite

20.12

Figure 20.5 IPv4 datagram format

IPv4 Datagram Format IPv4 Packet is called datagram. A datagram is of variable length. Consists of two parts: Header + Data Header’s length is 20 to 60 bytes. Header contains information

essential for routing and delivering Data.

It is customary in TCP/IP to show the header in 4-byte sections.

20.13

Header Fields (1) VERSION (VER)

4 bit in length Defines the version of IP (either IPv6 or

IPv4)

Header Length (HLEN) 4 bit in length Defines the length of the header. Its value falls between 20 to 60 bytes

20.14

Header Fields (2) Services

the IETF has changed the interpretation and name of this 8-bit field.

It was previously called as service type, now called differentiated services.

I will explain “service type”. “differentiated services” is your

homework.

20.15

Service Type(1) First 3 bits are Precedence bits. Next 4 bits are called Type of Service

(TOS) bits, and the last bit is not used. Precedence:

Value ranges from 000 to 111. Defines priority of the datagram Used in situations of Network Congestion Router discards datagrams of low

precedence in case of congestion.

20.16

Service Type(2) TOS bits

4 bit in length Out of 4 only a single bit can be 1 at a

time, thus we have 5 different types of services.

Bit patterns and their interpretations are shown below.

20.18

Total Length

This field defines the total length of the Datagram (header + Data)

Value lies between 20 to 65536 bytes.

20.20

Time to Live A datagram has a limited lifetime in

its travel through an internet. It holds a timestamp which is

decremented on each visit of a router. The datagram is discarded when the

value of this field becomes zero. The purpose is prevent datagram

from monopolizing the network and causing congestion.

20.21

Protocol 8-bit length It defines the higher level protocol

that uses the services of the IPv4 Layer.

It defines the higher level protocol to which the IPv4 datagram is delivered.

20.22

20.23

Figure 20.8 Protocol field and encapsulated data

20.24

Table 20.3 protocol values

Checksum

An error detection mechanism Performed only with header fields Detects error in header part of

datagram only.

20.25

Source/ Destination Address Source Address

32 bit field Defines the IPv4 address of the source Remains unchanged during travel from

source to destination. Destination Address

32 bit field Defines the IPv4 address of the

destination Remains unchanged during travel from

source to destination.20.26

Fragmentation Why Fragmentation is Required?

A datagram can travel through different networks whose Protocols are defined by the data link and Physical Layer.

We know that at the data link layer we deal with Frames.

For different network Protocols at data link layer we have different formats and sizes of frames.

Now we also know that the Packet from network layer called datagram (Header + data) act completely as data for the data link Frame.

20.27

20.28

Figure 20.9 Maximum transfer unit (MTU)

Continued

Different Data link layer Protocols e.g. X.25, Frame Relay, Ethernet etc have different frame formats in which there is a field that limits the size of the Data in the frame called Maximum Transfer Unit.

Thus in many cases (datagram traveling from LAN to WAN) it is required to fragment the datagram according to the MTU of the underlying network.

20.29

20.30

Table 20.5 MTUs for some networks

Fields Related To Fragmentation Identification

16-bit field Each datagram is assigned a unique

number When the datagram is fragmented the

same identification number is copied to all the fragments.

Flags 3 bit field 1st bit is reserved

20.31

Continued….. 2nd bit is Do not Fragment

if the value of this field is 1 the machine must not fragment the datagram. If it cannot pass the datagram though any available physical network, it discards the datagram and sends and ICMP error message to the source host.

If the value is 0, this means that whenever required the datagram can be fragmented according to the requirement of the physical network it is travelling.

3rd bit is More Fragment If its value is 1, it means this is not the last

fragment more fragments have to come. If its value is 0, it means this is the last fragment or

the only fragment.

20.32

20.33

Figure 20.10 Flags used in fragmentation

Continued….. Fragmentation Offset

13 bit Field Shows the relative position of the

fragment in the whole datagram. Offset is measured in units of 8 bytes.

20.34

20.35

Figure 20.11 Fragmentation example

20.36

Figure 20.12 Detailed fragmentation example

20.37

A packet has arrived with an M bit value of 0. Is this the first fragment, the last fragment, or a middle fragment? Do we know if the packet was fragmented?

SolutionIf the M bit is 0, it means that there are no more fragments; the fragment is the last one. However, we cannot say if the original packet was fragmented or not. A non-fragmented packet is considered the last fragment.

Example 20.5

20.38

A packet has arrived with an M bit value of 1. Is this the first fragment, the last fragment, or a middle fragment? Do we know if the packet was fragmented?

SolutionIf the M bit is 1, it means that there is at least one more fragment. This fragment can be the first one or a middle one, but not the last one. We don’t know if it is the first one or a middle one; we need more information (the value of the fragmentation offset).

Example 20.6

20.39

A packet has arrived with an M bit value of 1 and a fragmentation offset value of 0. Is this the first fragment, the last fragment, or a middle fragment?

SolutionBecause the M bit is 1, it is either the first fragment or a middle one. Because the offset value is 0, it is the first fragment.

Example 20.7

20.40

A packet has arrived in which the offset value is 100. What is the number of the first byte? Do we know the number of the last byte?

SolutionTo find the number of the first byte, we multiply the offset value by 8. This means that the first byte number is 800. We cannot determine the number of the last byte unless we know the length.

Example 20.8

OPTIONS

Options field can be used for network testing and debugging.

20.41

20.42

20-3 IPv620-3 IPv6

The network layer protocol in the TCP/IP protocol The network layer protocol in the TCP/IP protocol suite is currently IPv4. Although IPv4 is well designed, suite is currently IPv4. Although IPv4 is well designed, data communication has evolved since the inception of data communication has evolved since the inception of IPv4 in the 1970s. IPv4 has some deficiencies that IPv4 in the 1970s. IPv4 has some deficiencies that make it unsuitable for the fast-growing Internet.make it unsuitable for the fast-growing Internet.

Deficiencies of IPv4Advantages of IPv6Packet FormatExtension Headers

Topics discussed in this section:Topics discussed in this section:

Deficiencies of IPv4 Despite all short-term solution the

problem of address Depletion still persists in IPv4.

Demand of Real time audio and video Fast growing Mobile IP, IP telephony, IP-

capable mobile telephony services IPv4 do not have any security measures

i.e. Encryption and Authentication

20.43

Advantages of IPv6 Larger Address Space

128 bits address Better Header Format

Options separated from base header and made part of data.

Improves Routing New Options

To allow additional functionalities Support For More Security

20.44

Continued….

Allowance for extension IPv6 is designed to handle future extensions

Support For Resource Allocation The field “flow label” provides support for

Resource allocation for special applications like real time audio and video.

Support for more Security Encryption and authentication provides

Confidentiality and Integrity.

20.45

Packet Format

Each Packet is composed of: Mandatory Base Header (40 bytes) Payload (65535 bytes)

Consists of optional extension header + data

20.46

20.47

Figure 20.15 IPv6 datagram header and payload

Base Header There are 8 fields:1. Version

4-bit in length defines the version of IP, here value is ‘6’.

2. Priority 4-bit defines the priority of the packet

with respect to traffic congestion.

3. Flow Label 24-bit designed to provide special

handling for a particular flow of data.

20.48

4. Payload Length 2 byte defines the length of the payload.

5. Next Header 8-bit Either optional extension header or

header of another protocol e.g. TCP, UDP Just like the protocol field in IPv4.

6. Hop Limit 8-bit Same as TTL field in IPv4

7. Source Address/ Destination Address 16 bytes both

20.49

20.50

Figure 20.16 Format of an IPv6 datagram

20.51

Table 20.6 Next header codes for IPv6

20.52

Table 20.9 Comparison between IPv4 and IPv6 packet headers

20.53

20-4 TRANSITION FROM IPv4 TO IPv620-4 TRANSITION FROM IPv4 TO IPv6

Because of the huge number of systems on the Because of the huge number of systems on the Internet, the transition from IPv4 to IPv6 cannot Internet, the transition from IPv4 to IPv6 cannot happen suddenly. It takes a considerable amount of happen suddenly. It takes a considerable amount of time before every system in the Internet can move from time before every system in the Internet can move from IPv4 to IPv6. The transition must be smooth to prevent IPv4 to IPv6. The transition must be smooth to prevent any problems between IPv4 and IPv6 systems. any problems between IPv4 and IPv6 systems.

Dual StackTunnelingHeader Translation

Topics discussed in this section:Topics discussed in this section:

20.54

Figure 20.18 Three transition strategies

Dual Stack All hosts before complete migration from IPv6

to IPv4 must have a dual stack of protocols. A station must run IPv4 and IPv6

simultaneously. To determine which version a destination

host is using, the source host queries the DNS.

If the DNS returns an IPv4 address, the source then send IPv4 packets.

If the DNS returns an IPv6 address, the source then send IPv6 packets.

20.55

20.56

Figure 20.19 Dual stack

Tunneling It is a mechanism used when both

sender and receiver hosts use IPv6 but in between a region falls that uses IPv4.

To pass through this region the IPv6 packet is first encapsulated in IPv4 Header and after coming out this header is removed.

The field ‘protocol’ in IPv4 has value 41 when the data it contains is an IPv6 Packet.

20.57

20.58

Figure 20.20 Tunneling strategy

Header Translation

In this case the header of IPv6 is completely changed in IPv4 header.

20.59

20.60

Figure 20.21 Header translation strategy

20.61

Table 20.11 Header translation


Recommended