UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT,...

18
CS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 1 hcr:innovationcse@gg UNIT III IP, ICMP, IGMP AND UDP Datagram fragmentation options checksum IP package ICMP messages, formats error reporting query checksum ICMP package IGMP messages, operation encapsulation IGMP package UDP datagram checksum operation uses UDP package. DATAGRAM Packets in the network (internet) layer are called datagrams IP datagram Header length (HLEN): total length of the datagram header in 4-byte words Service type: Type of service (TOS) Category Codepoint Assigning Authority 1 XXXXX0 Internet 2 XXXX11 Local 3 XXXX01 Temporary or experimental TOS Bits Description Protocol 0000 Normal (Default) ICMP, BOOTP, DNS (TCP Query) 0001 Minimize Cost NNTP 0010 Maximize reliability IGP, SNMP 0100 Maximize throughput FTP (data), SMTP (data), DNS (zone) 1000 Minimize delay TELNET, FTP (Control), TFTP, SMTP (command), DNS (UDP query)

Transcript of UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT,...

Page 1: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 1 hcr:innovationcse@gg

UNIT – III IP, ICMP, IGMP AND UDP Datagram – fragmentation – options – checksum – IP package – ICMP – messages, formats – error reporting –

query – checksum – ICMP package – IGMP – messages, operation – encapsulation – IGMP package – UDP –

datagram – checksum – operation – uses – UDP package.

DATAGRAM Packets in the network (internet) layer are called datagrams

IP datagram

Header length (HLEN): total length of the datagram header in 4-byte words

Service type: Type of service (TOS)

Category Codepoint Assigning Authority

1 XXXXX0 Internet

2 XXXX11 Local

3 XXXX01 Temporary or experimental

TOS Bits Description Protocol

0000 Normal (Default) ICMP, BOOTP, DNS (TCP Query)

0001 Minimize Cost NNTP

0010 Maximize reliability IGP, SNMP

0100 Maximize throughput FTP (data), SMTP (data), DNS (zone)

1000 Minimize delay TELNET, FTP (Control), TFTP, SMTP (command), DNS (UDP query)

Page 2: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg

Encapsulation of a small datagram in an Ethernet frame

Multiplexing

Fragmentation

The format and size of a frame depend on the protocol used by the physical network.

A datagram may have to be fragmented to fit the protocol regulations.

For example, if a router connects a LAN to a WAN, it receives a frame in the LAN format and sends a frame

in the WAN format

Maximum Transfer Unit (MTU)

the total size of the datagram must be less than this maximum size,

defined by the restrictions imposed by the hardware and software used in the network

The value of the MTU differs from one physical network protocol to another

o Ethernet LAN is 1500 bytes,

o FDDI LAN is 4352 bytes,

o PPP is 296 bytes

Only data in a datagram is fragmented

Fields Related to Fragmentation

Identification

o uniquely define a datagram as it leaves the source host

o helps the destination in reassembling the datagram

Flags

Fragmentation offset

o offset of the data in the original datagram measured in units of 8 bytes

Page 3: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 3 hcr:innovationcse@gg

Detailed fragmentation example

Reassembly

a) The first fragment has an offset field value of zero.

b) Divide the length of the first fragment by 8. The second fragment has an offset value equal to that result.

c) Divide the total length of the first and second fragment by 8.

The third fragment has an offset value equal to that result.

d) Continue the process. The last fragment has a more bit value of 0

Options

Option Types

No-Operation Option

o 1-byte option used as a filler between options

End-of-Option Option

Page 4: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 4 hcr:innovationcse@gg

o 1-byte option used for padding at the end of the option field

Record-Route Option

o used to record the Internet routers that handle the datagram

Strict-Source-Route Option

o used by the source to predetermine a route for the datagram as it travels through the Internet

Loose-Source-Route Option

o similar to the strict source route, but it is more relaxed.

Timestamp

o used to record the time of datagram processing by a router.

No operation option

End-of-Option Option

Record-Route Option

Strict-Source-Route Option

Loose-Source-Route Option

Timestamp Option

Page 5: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 5 hcr:innovationcse@gg

Checksum

The error detection method used by most TCP/IP protocols is called the checksum.

The checksum protects against the corruption that may occur during the transmission of a packet.

It is redundant information added to the packet.

Checksum concept

Checksum Calculation at the Sender

The packet is divided into k sections, each of n bits.

All sections are added together using one’s complement arithmetic.

The final result is complemented to make the checksum.

Checksum Calculation at the Receiver

The receiver divides the received packet into k sections and adds all sections.

It then complements the result.

If the final result is 0, the packet is accepted; otherwise, it is rejected

Checksum in one’s complement arithmetic

Checksum in the IP Packet

Checksum in IP covers only the header, not the data

IP package

IP package involves the following components

Header-Adding Module

Processing Module

Queues

Routing Table

Forwarding Module

MTU Table

Fragmentation Module

Reassembly Table

Reassembly Module

Page 6: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 6 hcr:innovationcse@gg

IP components

Header-Adding Module

receives data from an upper-layer protocol along with the destination IP address

It encapsulates the data in an IP datagram by adding the IP header

IP_Adding_Module (data, destination_address)

{

Encapsulate data in an IP datagram

Calculate checksum and insert it in the checksum field

Send data to the corresponding queue

Return

}

Processing Module

the processing module receives a datagram from an interface or from the header-adding module.

IP_Processing_Module (Datagram)

{

Remove one datagram from one of the input queues.

If (destination address matches a local address)

{

Send the datagram to the reassembly module.

Return.

}

If (machine is a router)

{

Decrement TTL.

}

If (TTL less than or equal to zero)

{

Discard the datagram.

Send an ICMP error message.

Page 7: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 7 hcr:innovationcse@gg

Return.

}

Send the datagram to the forwarding module.

Return.

}

Queues

input queues

o store the datagrams coming from the data link layer or the upper-layer protocols

o The processing module dequeues (removes) the datagrams from the input queues

output queues

o store the datagrams going to the data link layer or the upperlayer protocols

o The fragmentation and reassembly modules enqueue (add) the datagrams into the output queues

Routing Table

used by the forwarding module to determine the next-hop address of the packet.

Forwarding Module

receives an IP packet from the processing module

finds the IP address of the next station along with the interface number to which the packet should be sent.

It then sends the packet with this information to the fragmentation module.

MTU Table

used by the fragmentation module to find the maximum transfer unit (MTU) of a particular interface.

It can have only two columns: interface and MTU.

Fragmentation Module

receives an IP datagram from the forwarding module

consults the MTU table to find the MTU for the specific interface number.

If the length of the datagram is larger than the MTU, the fragmentation module fragments the datagram,

adds a header to each fragment, and sends them to the ARP package for address resolution and delivery

IP_Fragmentation_Module (datagram)

{

Extract the size of datagram

If (size > MTU of the corresponding network)

{

If (D bit is set)

{

Discard datagram

Send an ICMP error message

return

}

Else

{

Calculate maximum size

Divide the segment into fragments

Add header to each fragment

Add required options to each fragment

Send fragment

return

}

}

Else

{

Send the datagram

}

Return.

}

Page 8: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 8 hcr:innovationcse@gg

Reassembly Table

Reassembly Module

find the datagram to which a fragment belongs, to order the fragments belonging to the same datagram,

and reassemble all fragments of a datagram when all have arrived.

If the established time-out has expired and any fragment is missing, the module discards the fragments

IP_Reassembly_Module (datagram)

{

If (offset value = 0 AND M = 0)

{

Send datagram to the appropriate queue

Return

}

Search the reassembly table for the entry

If (entry not found)

{

Create a new entry

}

Insert datagram into the linked list

If (all fragments have arrived)

{

Reassemble the fragment

Deliver the fragment to upper-layer protocol

return

}

Else

{

If (time-out expired)

{

Discard all fragments

Send an ICMP error message

}

}

Return.

}

INTERNET CONTROL MESSAGE PROTOCOL-ICMP Position of ICMP in the network layer

ICMP encapsulation

Page 9: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 9 hcr:innovationcse@gg

ICMP messages

ICMP messages are divided into error-reporting messages and query messages.

The error-reporting messages report problems that a router or a host (destination) may encounter.

The query messages get specific information from a router or another host.

General format of ICMP messages

An ICMP message has an 8-byte header and a variable-size data section.

general format of the header is different for each message type, the first 4 bytes are common to all.

Error Reporting Messages

IP, as an unreliable protocol, is not concerned with error checking and error control.

ICMP was designed, in part, to compensate for this shortcoming.

ICMP does not correct errors, it simply reports them

ICMP always reports error messages to the original source

No ICMP error message will be generated in response to a datagram

carrying an ICMP error message.

that is not the first fragment.

having a multicast address.

having a special address such as 127.0.0.0 or 0.0.0.0.

Destination-unreachable format

Destination-unreachable messages with codes 2 or 3 can be created only by the destination host.

Other destination-unreachable messages can be created only by routers

A router cannot detect all problems that prevent the delivery of a packet

Page 10: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 10 hcr:innovationcse@gg

Source Quench

There is no flow-control or congestion-control mechanism in the IP protocol.

This was designed to add a kind of flow control and congestion control to the IP.

A source-quench message informs the source that a datagram has been discarded due to congestion in a

router or the destination host.

The source must slow down the sending of datagrams until the congestion is relieved.

One source-quench message is sent for each datagram that is discarded due to congestion.

Time Exceeded

Generated in two cases

Whenever a router decrements a datagram with a time-to-live value to zero, it discards the datagram and

sends a time-exceeded message to the original source.

When the final destination does not receive all of the fragments in a set time, it discards the received

fragments and sends a time-exceeded message to the original source

Code 0 is used only by routers to show that the value of the time-to-live field is zero.

Code 1 is used only by the destination to show that not all of the fragments have arrived within a set time.

Parameter Problem

can be created by a router or the destination host

Code 0. There is an error or ambiguity in one of the header fields. In this case, the value in the pointer field

points to the byte with the problem. For example, if the value is zero, then the first byte is not a valid field.

Code 1. The required part of an option is missing

Redirection

A host usually starts with a small routing table that is gradually augmented and updated.

One of the tools to accomplish this is the redirection message

The router does not discard the datagram in this case; it is sent to the appropriate router

Code 0. Redirection for a network-specific route.

Code 1. host-specific route.

Code 2. network-specific route based on a specified type of service.

Code 3. host-specific route based on a specified type of service

A redirection message is sent from a router to a host on the same local network

Page 11: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 11 hcr:innovationcse@gg

Query Messages

Echo Request and Reply

designed for diagnostic purposes to identify network problems

An echo-request message can be sent by a host or router.

An echo-reply message is sent by the host or router that receives an echo-request message

can be used by network managers to check the operation of the IP protocol

can test the reachability of a host. This is usually done by invoking the ping command

Timestamp Request and Reply

to determine the round-trip time needed for an IP datagram to travel between two hosts or routers

o sending time = receive timestamp − original timestamp

o receiving time = returned time − transmit timestamp

o round-trip time = sending time + receiving time

can also be used to synchronize the clocks

each timestamp representing time measured in milliseconds from midnight in Universal Time

can be used to even if their clocks are not synchronized

ICMP package

Input Module

ICMP_Input_module (ICMP_Packet)

{

If (the type is a request)

{

Create a reply

Send the reply

}

If (the type defines a redirection)

{

Modify the routing table

}

If (the type defines other error messages)

Page 12: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 12 hcr:innovationcse@gg

{

Inform the appropriate source protocol

}

Return

}

Output Module

ICMP_Output_Module (demand)

{

If (the demand defines an error message)

{

If (demand comes from IP AND is forbidden)

{

Return

}

If (demand is a valid redirection message)

{

Return

}

Create an error message

}

If (demand defines a request)

{

Create a request message

}

Send the message

Return

}

INTERNET GROUP MANAGEMENT PROTOCOL

IGMP Group Management

IGMP Messages

IGMP Operation

Encapsulation

IGMP Package

Position of IGMP in the network layer

Group Management

IGMP is a group management protocol that manages group membership.

The IGMP protocol gives the multicast routers information about the membership status of hosts (routers)

connected to the network.

It helps a multicast router create and update a list of loyal members related to each router interface.

Page 13: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 13 hcr:innovationcse@gg

IGMP Messages

IGMP Message Types

IGMP Message Format

IGMP Type Field

IGMP Operation

A multicast router connected to a network has a list of multicast addresses of the groups with at least one

loyal member in that network.

There is one router per group that has the duty of distributing the multicast packets destined for that group.

Operations

o Joining a Group

o Leaving a Group

o Monitoring Membership

Membership query message format

S This is a 1-bit suppress flag. When this field is set to 1, it means that the receivers of the query message

should suppress the normal timer updates.

QRV - 3-bit field is called querier’s robustness variable. It is used to monitor the robustness in the network.

QQIC. 8-bit field is called querier’s query interval code. used to calculate the querier’s query interval (QQI),

Page 14: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 14 hcr:innovationcse@gg

Three formats of query messages

The general query message does not define a particular group

Membership Report Message Format

a membership report is sent twice, one after the other

Encapsulation of IGMP packet

The IGMP message is encapsulated in an IP datagram, which is itself encapsulated in a frame.

The IP packet that carries an IGMP packet has a value of 2 in its protocol field.

The IP packet that carries an IGMP packet has a value of 1 in its TTL field.

Mapping class D to Ethernet physical address

An Ethernet multicast physical address is in the range 01:00:5E:00:00:00 to 01:00:5E:7F:FF:FF

Tunneling

Page 15: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 15 hcr:innovationcse@gg

IGMP Package

IGMP package involves a group table, a set of timers, and four software modules

Group Table

USER DATAGRAM PROTOCOL (UDP) connectionless, unreliable transport protocol

providing process-to-process communication instead of host-to-host communication

If a process wants to send a small message and does not care much about reliability, it can use UDP.

Sending a small message using UDP takes much less interaction than using TCP

Datagram

ICANN ranges

Page 16: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 16 hcr:innovationcse@gg

Socket address

User datagram format

UDP packets are called user datagrams

UDP length = IP length − IP header’s length

Checksum

UDP checksum calculation is different from

the one for IP and ICMP.

Here the checksum includes three sections:

o a pseudoheader,

o the UDP header

o the data coming from the application

layer.

Checksum Calculation at Sender

Checksum Calculation at Receiver

Optional Use of the Checksum

o The sender of a UDP packet can

choose not to calculate the checksum.

o In this case, the checksum field is filled with all 0s before being sent

UDP Operation

UDP uses concepts common to the transport layer viz

Congestion Control

Encapsulation and Decapsulation

Queuing

Multiplexing and Demultiplexing

Congestion Control

Since UDP is a connectionless protocol, it does not provide congestion control.

UDP assumes that the packets sent are small and sporadic, and cannot create congestion in the network.

Page 17: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 17 hcr:innovationcse@gg

Encapsulation and Decapsulation

Queues in UDP

If there is no such queue, UDP discards the user datagram and asks the ICMP protocol to send a port

unreachable message to the server.

Multiplexing and Demultiplexing

Multiplexing at sender site – many to one relationship – differentiated by port numbers

Demultiplexing at receiver site – one to many relationship – based on port number

UDP Uses

process that requires simple request-response communication with little concern for flow and error control

process with internal flow and error-control mechanisms like Trivial File Transfer Protocol (TFTP)

Multicasting

management processes such as SNMP

route updating protocols such as Routing Information Protocol (RIP)

real-time applications that cannot tolerate uneven delay between sections of a received message.

Page 18: UNIT III IP, ICMP, IGMP AND UDP - GHCRajan's BlogCS603 TCP/IP Technology Unit - III MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg Encapsulation of a small datagram

CS603 TCP/IP Technology Unit - III

MTech CSE (PT, 2011-14) SRM, Ramapuram 18 hcr:innovationcse@gg

UDP Package

Control-Block Table to keep track of the open ports. Each entry in this table has a minimum of four fields: the

state, FREE or IN-USE, the process ID, the port number the corresponding queue number

UDP_Control_Block_Module (process ID, port number)

{

Search the table for a FREE entry.

if (not found)

Delete one entry using a predefined strategy.

Create a new entry with the state IN-USE

Enter the process ID and the port number.

Return.

} // End module

UDP_INPUT_Module (user_datagram)

{

Look for the entry in the control_block table

if (found)

{

Check to see if a queue is allocated

If (queue is not allocated)

allocate a queue

else

enqueue the data

} //end if

else

{

Ask ICMP to send an "unreachable port" message

Discard the user datagram

} //end else

Return.

} // end module

UDP_OUTPUT_MODULE (Data)

{

Create a user datagram Send the user datagram Return.

}

Comments & Feedback

Thanks to my family members who supported me while I spent hours and hours to prepare this.

Your feedback is welcome at [email protected]