Docsity

Internet Protocol-Computer Networks-Lecture Slides, Slides of Computer Networks

Partial preview of the text

Download Internet Protocol-Computer Networks-Lecture Slides and more Slides Computer Networks in PDF only on Docsity!

TCP/IP Protocol Suite^1

Chapter 8

Upon completion you will be able to:

Internet Protocol

• Understand the format and fields of a datagram

• Understand the need for fragmentation and the fields involved

• Understand the options available in an IP datagram

• Be able to perform a checksum calculation

• Understand the components and interactions of an IP package

Objectives

TCP/IP Protocol Suite^2

Figure 8.1 Position of IP in TCP/IP protocol suite

TCP/IP Protocol Suite^4

Figure 8.2 IP datagram Header (13 Fields ) (1)

  • Version of IP
  • valid value 4
  • datagram is discarded for invalid values
  • length of header
  • values are multiple of 4,
  • 5 means 5x
  • Service Type /Differentiated Services
  • 8 bits
  • (details on Next slide )
  • Total length of datagram
  • HLEN+Data Size

TCP/IP Protocol Suite^5

Figure 8.3 Service type or differentiated services

If first 3 bits = Precedence Bits 000 to 111 (precedence increases from 0 to 111)

Next 4 bits = TOS bits (type of Srv) Last bit = Not used

TCP/IP Protocol Suite^7

Table 8.2 Default types of service

Sample Usage of DS field Bulk Data Transfer =Max throughput Immediate Attention = Min Delay Immediate Response = Min Delay Management Task = Max Reliability Background Services = Min Cost Routine Task = Normal

TCP/IP Protocol Suite^8

IP datagram header (2)

 Time to Live

 The life of IP datagram

 An integer defined by the source and decremented by each router/hop visited by

the packet, packet discarded when value reaches 0

 Usage can be to confine the journey of the packet, and to avoid packet looping

in network

 Protocol

 Higher level protocol that is using the IP

 E.g. if at source TCP is using IP , at destination the packet will be delivered from

IP to TCP

 Also called multiplexing and de-multiplexing

TCP/IP Protocol Suite^10

Figure 8.4 Encapsulation of a small datagram in an Ethernet frame

TCP/IP Protocol Suite^11

An IP packet has arrived with the first 8 bits as shown:

Example 1

01000010

The receiver discards the packet. Why?

Solution

There is an error in this packet. The 4 left-most bits (0100)

show the version, which is correct. The next 4 bits (0010) show

the header length; which means (2 × 4 = 8), which is wrong.

The minimum number of bytes in the header must be 20. The

packet has been corrupted in transmission.

TCP/IP Protocol Suite^13

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?

Example 3

Solution

The HLEN value is 5, which means the total number of bytes

in the header is 5 × 4 or 20 bytes (no options). The total length

is 40 bytes, which means the packet is carrying 20 bytes of data

(40 − 20).

TCP/IP Protocol Suite^14

An IP packet has arrived with the first few hexadecimal digits

as shown below:

Example 4

45000028000100000102...

How many hops can this packet travel before being dropped?

The data belong to what upper layer protocol?

Solution

To find the time-to-live field, we skip 8 bytes (16 hexadecimal

digits). The time-to-live field is the ninth byte, which is 01. This

means the packet can travel only one hop. The protocol field is

the next byte (02), which means that the upper layer protocol is

IGMP (see Table 8.4).

TCP/IP Protocol Suite^16

Why Fragmentation is needed

 IP datagram is encapsulated in frame (by data link layer),

 Each data link layer has its own frame format and is dependent on physical

layer

 When IP datagram is encapsulated in a frame the total size of frame must

be less than the size imposed by physical layer

 MTU

 (Maximum Transmission Unit) is the maximum size supported by underlying

layers

 MTU Varies from one physical network protocol to another

 When IP datagram passes a network with

that has MTU value less than size of datagram

the datagram is defragmented

Table 8.5 MTUs for some networks

TCP/IP Protocol Suite^17

Figure 8.6 MTU

 MTU : Maximum Transmission Unit

 Not all protocols can carry large data, also not all links supports large packets,

maximum data that a link layer frame can carry is called MTU

 Why use MTUs why not fix the length?

 Link layer between two router determines MTU

 There can be different link layers along one route

TCP/IP Protocol Suite^19

Figure 8.8 Fragmentation example

TCP/IP Protocol Suite^20

Fragmentation and Re-assembly (2)

 Offset specifies the start , offset + total length specifies end of the

fragment, more flag specifies last of other than last fragment

 The first fragment has an offset field value of zero

 Divide the length of the first fragment by 8 this gives the offset of the

second fragment

 Divide the length of first and second fragment by 8 this gives the offset of

the third fragment

 Continue the process till more bit = 0 encounters in a fragment

 Note: A fragment can be further fragmented if required, the offset is

calculated with respect to the actual datagram

 Note: Re-assembly is performed at the destination only