SlideShare a Scribd company logo
1
Hitesh Mohapatra / Class Note / VSSUT, Burla, India
Internet Protocol
 The Internet Protocol (IP) is the method or protocol by which data is sent from one
computer to another on the Internet.
 Each computer (known as a host) on the Internet has at least one IP address that
uniquely identifies it from all other computers on the Internet.
 When you send or receive data (for example, an e-mail or a Web page), the message
gets divided into little chunks called packets. Each of these packets contains both the
sender's Internet address and the receiver's address.
 Any packet is sent first to a gateway computer that reads the destination address and
forwards the packet to an adjacent gateway that in turn reads the destination address
and so on so forth across the Internet until one gateway recognizes the packet as
belonging to a computer within destination’s immediate neighbourhood or domain.
That gateway then forwards the packet directly to the computer whose address is
specified (destination address).
 Because a message is divided into a number of packets, each packet can, if necessary,
be sent by a different route across the Internet. Packets can arrive in a different order
than the order they were sent in. The Internet Protocol just delivers them. It's up to
another protocol, the Transmission Control Protocol (TCP) to put them back in the
right order. It is a connection-oriented protocol that keeps track of the packet
sequence in a message.
 IP is a connectionless protocol, which means that there is no continuing connection
between the end points that are communicating. Each packet that travels through the
Internet is treated as an independent unit of data without any relation to any other unit
of data. In the Open Systems Interconnection (OSI) communication model, IP is
in layer 3, the Networking Layer.
 The most widely used version of IP today is Internet Protocol Version 4 (IPv4).
However, IP Version 6 (IPv6) is also beginning to be supported. IPv6 provides for
2
much longer addresses and therefore for the possibility of many more Internet users.
IPv6 includes the capabilities of IPv4 and any server that can support IPv6 packets
can also support IPv4 packets.
The IP Datagram Structure
 The format of data that can be recognized by IP is called an IP datagram.
 It consists of two components, namely, the header and data, which need to be
transmitted. The fields in the datagram, except the data, have specific roles to perform
in the transmission of data.
 Every field in the IP datagram has a fixed size except for the IP Options field, which
can be 20–60 bytes in length.
The header has a 20 bytes fixed part and a variable length optional part.
The IP datagram header format
Version
 Which version of the protocol the datagram belongs to.
 The current version number is 4.
 Next version: 6
3
IHL
 The number of 32-bit words in the header
 Because this is 4 bits, the max header length is 15 words (i.e. 60 bytes)
 The header is at least 20 bytes, but options may make it bigger
Type of Service
 Contains a 3-bit precedence field (that is ignored today), 4 service bits, and 1 unused
bit.
 The four service bits can be:
o 1000 - minimize delay
o 0100 - maximize throughput
o 0010 - maximize reliability
o 0001 - minimize monetary cost
 This is a "hint" of what characteristics of the physical layer to use
 The Type of Service is not supported in most implementations. However, some
implementations have extra fields in the routing table to indicate delay, throughput,
reliability, and monetary cost.
Total Length
 Total length of the datagram in bytes.
 we know where the data starts by the header length
 we know the size of the data by computing "total length - header length"
Identification
 Uniquely identifies the datagram.
 Usually incremented by 1 each time a datagram is sent.
 All fragments of a datagram contain the same identification value.
 This allows the destination host to determine which fragment belongs to which
datagram.
Flags and Fragmentation Offset
 Used for fragmentation
 DF means do not fragment. It is a request to routers not to fragment the datagram
since the destination is incapable of putting the pieces back together.
 MF means more fragments to follow. All fragments except the last one have this bit
set. It is needed to know if all fragments of a datagram have arrived.
Fragment offset
4
This field solves the problem of sequencing fragments by indicating to the recipient device
where in the overall message each particular fragment should be placed.
Time to Live
 decremented by each router that processes the datagram,
 Router discards the datagram when TTL reaches 0.
Protocol
 Tells IP where to send the datagram up to.
 6 means TCP
 17 means UDP
Header checksum
Inserted by the sender and updated whenever the packet header is modified by a router - Used
to detect processing errors introduced into the packet inside a router. Packets with an invalid
checksum are discarded.
Source IP address
The IP address of the original sender of the packet
Destination IP address
The IP address of the final destination of the packet
Options
 Optional data.
 Some examples include having the router put in a IP address of router and a time
stamp so the final destination knows how long it took to get to each hop.
The source and destination in the IP header is the original source and the final destination!
The physical layer addresses pass the datagram from router to router. So, while the physical
layer addresses change from router to router, the source and destination IP addresses in the IP
datagram remain constant.
IP Fragmentation
 IP must fragment packets if it is of large size.
 When an IP datagram is fragmented, each fragment is treated as a separate datagram.
o It is reassembled at the final destination, not at a router
o It does that because the router may have to fragment it again
5
 Each fragment has its own header.
 The identification number is copied into each fragment.
 One bit in the "flags" field says "more fragments are coming. If that bit is 0, then it
signifies this is the last fragment.
 The "fragment offset" field contains the offset of the data.
o Fragment offset is measured in units of 8 bytes (64 bits).
The entire flags field looks like this:
--------------------------
| bit 0 | bit 1 | bit 2 |
--------------------------
bit 0: not used
bit 1: if 1, it means "don't fragment".
If IP must fragment the packet and this bit is set, IP throws away the datagram.
bit 2: The fragment flag.
Example:
 Suppose we have a physical layer that can transmit a maximum of 660 bytes. And,
suppose IP wants to send 1460 bytes of data. So, the IP datagram is a total of 1480
bytes, including the 20 byte IP header:
---------------------------------------------
| 20-byte IP HEADER | 1460 bytes of data |
---------------------------------------------
 Here is what IP sends:
First packet:
Bytes: 20 640
---------------------------------------------
| IP header | first 640 bytes of data |
---------------------------------------------
 In that packet, "fragment flag" is 1, offset is 0.
Second packet:
Bytes: 20 640
---------------------------------------------
| IP header | second 640 bytes of data |
---------------------------------------------
6
 In that packet, "fragment flag" is 1, offset is 80. The offset is 80 because (80 * 8) is
640, so the offset of that data is 640 byes.
Third packet:
Bytes: 20 640
---------------------------------------------
| IP header | third 180 bytes of data |
---------------------------------------------
 In that packet, "fragment flag" is 0, offset is 160. The offset is 160 because (160 * 8)
is 1280, so the offset of that data is 1280 byes.
 IMPORTANT: The routers see 3 separate packets. The final destination reassembles
the packet before passing the packet to the upper layers.

More Related Content

What's hot

What's hot (20)

Routing
RoutingRouting
Routing
 
ALOHA Protocol (in detail)
ALOHA Protocol (in detail)ALOHA Protocol (in detail)
ALOHA Protocol (in detail)
 
Routing protocols
Routing protocolsRouting protocols
Routing protocols
 
IPv4 Addressing
 IPv4 Addressing   IPv4 Addressing
IPv4 Addressing
 
IPV4 Frame Format
IPV4 Frame FormatIPV4 Frame Format
IPV4 Frame Format
 
Congestion control
Congestion controlCongestion control
Congestion control
 
IPv6
IPv6IPv6
IPv6
 
Ppt of routing protocols
Ppt of routing protocolsPpt of routing protocols
Ppt of routing protocols
 
Unicast multicast & broadcast
Unicast multicast & broadcastUnicast multicast & broadcast
Unicast multicast & broadcast
 
IPV6 ADDRESS
IPV6 ADDRESSIPV6 ADDRESS
IPV6 ADDRESS
 
Transport layer services
Transport layer servicesTransport layer services
Transport layer services
 
Framing in data link layer
Framing in data link layerFraming in data link layer
Framing in data link layer
 
Transport layer
Transport layerTransport layer
Transport layer
 
Reference models in Networks: OSI & TCP/IP
Reference models in Networks: OSI & TCP/IPReference models in Networks: OSI & TCP/IP
Reference models in Networks: OSI & TCP/IP
 
Internet control message protocol
Internet control message protocolInternet control message protocol
Internet control message protocol
 
Multiple access protocol
Multiple access protocolMultiple access protocol
Multiple access protocol
 
Presentation Routing algorithm
Presentation Routing algorithmPresentation Routing algorithm
Presentation Routing algorithm
 
Open shortest path first (ospf)
Open shortest path first (ospf)Open shortest path first (ospf)
Open shortest path first (ospf)
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
Ipv4 and Ipv6
Ipv4 and Ipv6Ipv4 and Ipv6
Ipv4 and Ipv6
 

Similar to IP Datagram Structure

Similar to IP Datagram Structure (20)

Network Layer
Network LayerNetwork Layer
Network Layer
 
Ip protocol
Ip protocolIp protocol
Ip protocol
 
Internet Protocol
Internet ProtocolInternet Protocol
Internet Protocol
 
Exploration network chapter_5_modified
Exploration network chapter_5_modifiedExploration network chapter_5_modified
Exploration network chapter_5_modified
 
I.p. protocol
I.p. protocolI.p. protocol
I.p. protocol
 
TCP/IP 3RD SEM.2012 AUG.ASSIGNMENT
TCP/IP 3RD SEM.2012 AUG.ASSIGNMENTTCP/IP 3RD SEM.2012 AUG.ASSIGNMENT
TCP/IP 3RD SEM.2012 AUG.ASSIGNMENT
 
Custom_IP_Network_Protocol_and_Router
Custom_IP_Network_Protocol_and_RouterCustom_IP_Network_Protocol_and_Router
Custom_IP_Network_Protocol_and_Router
 
Ch 19 Network-layer protocols Section 1
Ch 19  Network-layer protocols Section 1Ch 19  Network-layer protocols Section 1
Ch 19 Network-layer protocols Section 1
 
Introduction to IP
Introduction to IPIntroduction to IP
Introduction to IP
 
IP Address
IP AddressIP Address
IP Address
 
Report on ip addresses
Report on ip addressesReport on ip addresses
Report on ip addresses
 
TCPIP
TCPIPTCPIP
TCPIP
 
Ipspk1
Ipspk1Ipspk1
Ipspk1
 
Internet Protocol Version 4
Internet Protocol Version 4Internet Protocol Version 4
Internet Protocol Version 4
 
Internetworking - IP
Internetworking - IPInternetworking - IP
Internetworking - IP
 
C. N. II Lec.4.pdf h
C. N. II Lec.4.pdf                      hC. N. II Lec.4.pdf                      h
C. N. II Lec.4.pdf h
 
07 - TCP_IP and the DoD Model.ppt
07 - TCP_IP and the DoD Model.ppt07 - TCP_IP and the DoD Model.ppt
07 - TCP_IP and the DoD Model.ppt
 
Ipv4
Ipv4Ipv4
Ipv4
 
Ip and icmp
Ip and icmpIp and icmp
Ip and icmp
 
Chapter03.ppt Advance network concept chapter3
Chapter03.ppt Advance network concept chapter3Chapter03.ppt Advance network concept chapter3
Chapter03.ppt Advance network concept chapter3
 

More from Hitesh Mohapatra

Virtualization: A Key to Efficient Cloud Computing
Virtualization: A Key to Efficient Cloud ComputingVirtualization: A Key to Efficient Cloud Computing
Virtualization: A Key to Efficient Cloud ComputingHitesh Mohapatra
 
Automating the Cloud: A Deep Dive into Virtual Machine Provisioning
Automating the Cloud: A Deep Dive into Virtual Machine ProvisioningAutomating the Cloud: A Deep Dive into Virtual Machine Provisioning
Automating the Cloud: A Deep Dive into Virtual Machine ProvisioningHitesh Mohapatra
 
Harnessing the Power of Google Cloud Platform: Strategies and Applications
Harnessing the Power of Google Cloud Platform: Strategies and ApplicationsHarnessing the Power of Google Cloud Platform: Strategies and Applications
Harnessing the Power of Google Cloud Platform: Strategies and ApplicationsHitesh Mohapatra
 
Scheduling in Cloud Computing
Scheduling in Cloud ComputingScheduling in Cloud Computing
Scheduling in Cloud ComputingHitesh Mohapatra
 
Load balancing in cloud computing.pptx
Load balancing in cloud computing.pptxLoad balancing in cloud computing.pptx
Load balancing in cloud computing.pptxHitesh Mohapatra
 
ITU-T requirement for cloud and cloud deployment model
ITU-T requirement for cloud and cloud deployment modelITU-T requirement for cloud and cloud deployment model
ITU-T requirement for cloud and cloud deployment modelHitesh Mohapatra
 
Reviewing basic concepts of relational database
Reviewing basic concepts of relational databaseReviewing basic concepts of relational database
Reviewing basic concepts of relational databaseHitesh Mohapatra
 
Advanced database protocols
Advanced database protocolsAdvanced database protocols
Advanced database protocolsHitesh Mohapatra
 
Involvement of WSN in Smart Cities
Involvement of WSN in Smart CitiesInvolvement of WSN in Smart Cities
Involvement of WSN in Smart CitiesHitesh Mohapatra
 
Data Structure and its Fundamentals
Data Structure and its FundamentalsData Structure and its Fundamentals
Data Structure and its FundamentalsHitesh Mohapatra
 
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGWORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGHitesh Mohapatra
 
Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...Hitesh Mohapatra
 

More from Hitesh Mohapatra (20)

Virtualization: A Key to Efficient Cloud Computing
Virtualization: A Key to Efficient Cloud ComputingVirtualization: A Key to Efficient Cloud Computing
Virtualization: A Key to Efficient Cloud Computing
 
Automating the Cloud: A Deep Dive into Virtual Machine Provisioning
Automating the Cloud: A Deep Dive into Virtual Machine ProvisioningAutomating the Cloud: A Deep Dive into Virtual Machine Provisioning
Automating the Cloud: A Deep Dive into Virtual Machine Provisioning
 
Harnessing the Power of Google Cloud Platform: Strategies and Applications
Harnessing the Power of Google Cloud Platform: Strategies and ApplicationsHarnessing the Power of Google Cloud Platform: Strategies and Applications
Harnessing the Power of Google Cloud Platform: Strategies and Applications
 
Scheduling in Cloud Computing
Scheduling in Cloud ComputingScheduling in Cloud Computing
Scheduling in Cloud Computing
 
Cloud-Case study
Cloud-Case study Cloud-Case study
Cloud-Case study
 
RAID
RAIDRAID
RAID
 
Load balancing in cloud computing.pptx
Load balancing in cloud computing.pptxLoad balancing in cloud computing.pptx
Load balancing in cloud computing.pptx
 
Cluster Computing
Cluster ComputingCluster Computing
Cluster Computing
 
ITU-T requirement for cloud and cloud deployment model
ITU-T requirement for cloud and cloud deployment modelITU-T requirement for cloud and cloud deployment model
ITU-T requirement for cloud and cloud deployment model
 
Leetcode Problem Solution
Leetcode Problem SolutionLeetcode Problem Solution
Leetcode Problem Solution
 
Leetcode Problem Solution
Leetcode Problem SolutionLeetcode Problem Solution
Leetcode Problem Solution
 
Trie Data Structure
Trie Data Structure Trie Data Structure
Trie Data Structure
 
Reviewing basic concepts of relational database
Reviewing basic concepts of relational databaseReviewing basic concepts of relational database
Reviewing basic concepts of relational database
 
Reviewing SQL Concepts
Reviewing SQL ConceptsReviewing SQL Concepts
Reviewing SQL Concepts
 
Advanced database protocols
Advanced database protocolsAdvanced database protocols
Advanced database protocols
 
Measures of query cost
Measures of query costMeasures of query cost
Measures of query cost
 
Involvement of WSN in Smart Cities
Involvement of WSN in Smart CitiesInvolvement of WSN in Smart Cities
Involvement of WSN in Smart Cities
 
Data Structure and its Fundamentals
Data Structure and its FundamentalsData Structure and its Fundamentals
Data Structure and its Fundamentals
 
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGWORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
 
Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...
 

Recently uploaded

Natalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in KrakówNatalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in Krakówbim.edu.pl
 
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data StreamKIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data StreamDr. Radhey Shyam
 
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringC Sai Kiran
 
Pharmacy management system project report..pdf
Pharmacy management system project report..pdfPharmacy management system project report..pdf
Pharmacy management system project report..pdfKamal Acharya
 
KIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and Clustering
KIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and ClusteringKIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and Clustering
KIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and ClusteringDr. Radhey Shyam
 
Top 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering ScientistTop 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering Scientistgettygaming1
 
Peek implant persentation - Copy (1).pdf
Peek implant persentation - Copy (1).pdfPeek implant persentation - Copy (1).pdf
Peek implant persentation - Copy (1).pdfAyahmorsy
 
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfA CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfKamal Acharya
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234AafreenAbuthahir2
 
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringC Sai Kiran
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.PrashantGoswami42
 
Toll tax management system project report..pdf
Toll tax management system project report..pdfToll tax management system project report..pdf
Toll tax management system project report..pdfKamal Acharya
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
 
Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdfKamal Acharya
 
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfKamal Acharya
 
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...Amil baba
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfAbrahamGadissa
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxR&R Consult
 
Online resume builder management system project report.pdf
Online resume builder management system project report.pdfOnline resume builder management system project report.pdf
Online resume builder management system project report.pdfKamal Acharya
 

Recently uploaded (20)

Natalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in KrakówNatalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in Kraków
 
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data StreamKIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
 
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
 
Pharmacy management system project report..pdf
Pharmacy management system project report..pdfPharmacy management system project report..pdf
Pharmacy management system project report..pdf
 
KIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and Clustering
KIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and ClusteringKIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and Clustering
KIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and Clustering
 
Top 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering ScientistTop 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering Scientist
 
Peek implant persentation - Copy (1).pdf
Peek implant persentation - Copy (1).pdfPeek implant persentation - Copy (1).pdf
Peek implant persentation - Copy (1).pdf
 
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfA CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Toll tax management system project report..pdf
Toll tax management system project report..pdfToll tax management system project report..pdf
Toll tax management system project report..pdf
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdf
 
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
 
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Online resume builder management system project report.pdf
Online resume builder management system project report.pdfOnline resume builder management system project report.pdf
Online resume builder management system project report.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 

IP Datagram Structure

  • 1. 1 Hitesh Mohapatra / Class Note / VSSUT, Burla, India Internet Protocol  The Internet Protocol (IP) is the method or protocol by which data is sent from one computer to another on the Internet.  Each computer (known as a host) on the Internet has at least one IP address that uniquely identifies it from all other computers on the Internet.  When you send or receive data (for example, an e-mail or a Web page), the message gets divided into little chunks called packets. Each of these packets contains both the sender's Internet address and the receiver's address.  Any packet is sent first to a gateway computer that reads the destination address and forwards the packet to an adjacent gateway that in turn reads the destination address and so on so forth across the Internet until one gateway recognizes the packet as belonging to a computer within destination’s immediate neighbourhood or domain. That gateway then forwards the packet directly to the computer whose address is specified (destination address).  Because a message is divided into a number of packets, each packet can, if necessary, be sent by a different route across the Internet. Packets can arrive in a different order than the order they were sent in. The Internet Protocol just delivers them. It's up to another protocol, the Transmission Control Protocol (TCP) to put them back in the right order. It is a connection-oriented protocol that keeps track of the packet sequence in a message.  IP is a connectionless protocol, which means that there is no continuing connection between the end points that are communicating. Each packet that travels through the Internet is treated as an independent unit of data without any relation to any other unit of data. In the Open Systems Interconnection (OSI) communication model, IP is in layer 3, the Networking Layer.  The most widely used version of IP today is Internet Protocol Version 4 (IPv4). However, IP Version 6 (IPv6) is also beginning to be supported. IPv6 provides for
  • 2. 2 much longer addresses and therefore for the possibility of many more Internet users. IPv6 includes the capabilities of IPv4 and any server that can support IPv6 packets can also support IPv4 packets. The IP Datagram Structure  The format of data that can be recognized by IP is called an IP datagram.  It consists of two components, namely, the header and data, which need to be transmitted. The fields in the datagram, except the data, have specific roles to perform in the transmission of data.  Every field in the IP datagram has a fixed size except for the IP Options field, which can be 20–60 bytes in length. The header has a 20 bytes fixed part and a variable length optional part. The IP datagram header format Version  Which version of the protocol the datagram belongs to.  The current version number is 4.  Next version: 6
  • 3. 3 IHL  The number of 32-bit words in the header  Because this is 4 bits, the max header length is 15 words (i.e. 60 bytes)  The header is at least 20 bytes, but options may make it bigger Type of Service  Contains a 3-bit precedence field (that is ignored today), 4 service bits, and 1 unused bit.  The four service bits can be: o 1000 - minimize delay o 0100 - maximize throughput o 0010 - maximize reliability o 0001 - minimize monetary cost  This is a "hint" of what characteristics of the physical layer to use  The Type of Service is not supported in most implementations. However, some implementations have extra fields in the routing table to indicate delay, throughput, reliability, and monetary cost. Total Length  Total length of the datagram in bytes.  we know where the data starts by the header length  we know the size of the data by computing "total length - header length" Identification  Uniquely identifies the datagram.  Usually incremented by 1 each time a datagram is sent.  All fragments of a datagram contain the same identification value.  This allows the destination host to determine which fragment belongs to which datagram. Flags and Fragmentation Offset  Used for fragmentation  DF means do not fragment. It is a request to routers not to fragment the datagram since the destination is incapable of putting the pieces back together.  MF means more fragments to follow. All fragments except the last one have this bit set. It is needed to know if all fragments of a datagram have arrived. Fragment offset
  • 4. 4 This field solves the problem of sequencing fragments by indicating to the recipient device where in the overall message each particular fragment should be placed. Time to Live  decremented by each router that processes the datagram,  Router discards the datagram when TTL reaches 0. Protocol  Tells IP where to send the datagram up to.  6 means TCP  17 means UDP Header checksum Inserted by the sender and updated whenever the packet header is modified by a router - Used to detect processing errors introduced into the packet inside a router. Packets with an invalid checksum are discarded. Source IP address The IP address of the original sender of the packet Destination IP address The IP address of the final destination of the packet Options  Optional data.  Some examples include having the router put in a IP address of router and a time stamp so the final destination knows how long it took to get to each hop. The source and destination in the IP header is the original source and the final destination! The physical layer addresses pass the datagram from router to router. So, while the physical layer addresses change from router to router, the source and destination IP addresses in the IP datagram remain constant. IP Fragmentation  IP must fragment packets if it is of large size.  When an IP datagram is fragmented, each fragment is treated as a separate datagram. o It is reassembled at the final destination, not at a router o It does that because the router may have to fragment it again
  • 5. 5  Each fragment has its own header.  The identification number is copied into each fragment.  One bit in the "flags" field says "more fragments are coming. If that bit is 0, then it signifies this is the last fragment.  The "fragment offset" field contains the offset of the data. o Fragment offset is measured in units of 8 bytes (64 bits). The entire flags field looks like this: -------------------------- | bit 0 | bit 1 | bit 2 | -------------------------- bit 0: not used bit 1: if 1, it means "don't fragment". If IP must fragment the packet and this bit is set, IP throws away the datagram. bit 2: The fragment flag. Example:  Suppose we have a physical layer that can transmit a maximum of 660 bytes. And, suppose IP wants to send 1460 bytes of data. So, the IP datagram is a total of 1480 bytes, including the 20 byte IP header: --------------------------------------------- | 20-byte IP HEADER | 1460 bytes of data | ---------------------------------------------  Here is what IP sends: First packet: Bytes: 20 640 --------------------------------------------- | IP header | first 640 bytes of data | ---------------------------------------------  In that packet, "fragment flag" is 1, offset is 0. Second packet: Bytes: 20 640 --------------------------------------------- | IP header | second 640 bytes of data | ---------------------------------------------
  • 6. 6  In that packet, "fragment flag" is 1, offset is 80. The offset is 80 because (80 * 8) is 640, so the offset of that data is 640 byes. Third packet: Bytes: 20 640 --------------------------------------------- | IP header | third 180 bytes of data | ---------------------------------------------  In that packet, "fragment flag" is 0, offset is 160. The offset is 160 because (160 * 8) is 1280, so the offset of that data is 1280 byes.  IMPORTANT: The routers see 3 separate packets. The final destination reassembles the packet before passing the packet to the upper layers.