SlideShare una empresa de Scribd logo
1 de 36
OUTLINE
 Introduction
 IPv4 header
 calculation of header length
 TCP flags
 ICMP
 TTL
 TTL value for windows and linux
 how to change ttl value for windows
WHAT IS A PROTOCOL?
A standard that allows entities (i.e. application programs)
from different systems to communicate
Position of IPv4
IPV4
 Internet Protocol version 4 (IPv4) is the fourth version in the development of the Internet
Protocol (IP) and the first version of the protocol to be widely deployed.
 IPV4 protocol works at the network layer of the OSI model and at the Internet layer of the
TCP/IP model.
 It defines IP addresses in a 32-bit format, which looks like 123.123.123.123.
 The total number of IPv4 addresses available is 4,294,967,296 (256 x 256 x 256 x 256 or 2^32)
IPV4 HEADER
IPV4 HEADER
• Version (4 bits)
• Internet header length (4
bits)
• Service (8 bits)
• Total Length (16 bits)
• Identification (16 bits)
• Flags (3 bits)
• Fragment Offset (13 bits)
• Time to Live (8 bits)
• Protocol (8 bits)
• Header Checksum (16 bits)
• Source Address ( 32 bits)
• Destination Address (32 bits)
• Options (variable)
IPV4 HEADER
• Version (4 bits)
This is the first field in the protocol header. This field occupies 4
bits. This signifies the current IP protocol version being used.
Fig- Ipv4
IPV4 HEADER
• Internet header length (4 bits)
This 4-bit field defines the total length of the datagram header in 4-byte
words.
This field is needed because the length of the header is variable
(between 20 and 60 bytes).
IPV4 HEADER
• Services
 IETF has changed the interpretation and name of this 8-bit field.
 This field, previously called service type, is now called differentiated
services.
 In this interpretation, the first 3 bits are called precedence bits.
 The next 4 bits are called type of service (TOS) bits, and the last bit is
not used.
IPV4 HEADER
• The precedence defines the priority of the datagram in issues such as
congestion.
• If a router is congested and needs to discard some datagrams, those
datagrams with lowest precedence are discarded first.
• TOS bits is a 4-bit subfield with each bit having a special meaning.
IPV4 HEADER
IPV4 HEADER
IPV4 HEADER
• Total Length (16 bits)
• This is a 16-bit field that defines the total length (header plus data) of the IPv4
datagram in bytes.
• This 16-bit field defines the entire packet size, including header and data, in bytes.
The minimum-length packet is 20 bytes (20-byte header + 0 bytes data) and the
maximum is 65,535 bytes
IPV4 HEADER
• Identification (16 bits)
This field is an identification field and is primarily used for uniquely identifying the group of
fragments of a single IP datagram
• Flags (3 bits)
A three-bit field follows and is used to control or identify fragments
•bit 0: Reserved; must be zero.
•bit 1: Don't Fragment (DF)
•bit 2: More Fragments (MF)
IPV4 HEADER
• Fragment Offset (13 bits)
• This 13-bit field indicates the position of a particular fragment's data
in relation to the first byte of data (offset 0).
• Because it is entirely possible that the fragments that comprise a block
of data might travel along different paths to the destination, it is
possible they might arrive out of sequence.
FRAGMENTATION
1.Create First Fragment: The first fragment is created by taking the first 3,300 bytes of the
12,000-byte IP datagram. This includes the original header, which becomes the IP header of the
first fragment (with certain fields changed as described below). So, 3,280 bytes of data are in the
first fragment. This leaves 8,700 bytes to encapsulate (11,980 minus 3,280).
2.Create Second Fragment: The next 3,280 bytes of data are taken from the 8,700 bytes that
remain after the first fragment was built, and paired with a new header to create fragment #2. This
leaves 5,420 bytes.
3.Create Third Fragment: The third fragment is created from the next 3,280 bytes of data, with a
20-byte header. This leaves 2,140 bytes of data.
4.Create Fourth Fragment: The remaining 2,140 bytes are placed into the fourth fragment, with a
20-byte header of course.
IPV4 HEADER
• Protocol (8 bits)
IPV4 HEADER
• TTL (Time To Live)
To avoid looping in the network, every packet is sent with some TTL value set, which tells the network
how many routers (hops) this packet can cross. At each hop, its value is decremented by one and when
the value reaches zero, the packet is discarded
IPV4 HEADER
Source address.
This 32-bit field defines the IPv4 address of the source.
Destination address
This 32-bit field defines the IPv4 address of the destination.
Header Checksum (16 bits)
This field is used to keep checksum value of entire header which is then used to check if the
packet is received error-free.
IP HEADER LENGTH
• The length of the header is represented in 32 bit words.
• The Internet Protocol (IP) is defined in RFC 791. The RFC specifies
the format of the IP header. In the header there is the IHL (Internet
Header Length) field which is 4 bits long and specifies the header
length in 32 bit words. The IHL field can hold values from 0 (Binary
0000) to 15 (Binary 1111)..
IP HEADER LENGTH
• So the longest Internet Header (IP header) size can be 15*32 Bits =
480 Bits = 60 Bytes.
• This is why the header has a maximum size of 60 Bytes
• The shortest header size is 20 bytes, where the IHL field has the value
5 (0101). This is because all the required fields in the header need 20
Bytes of space.
ICMP REPLIES
• ICMP (Internet Control Message Protocol) is an error-reporting
protocol network devices like routers use to generate error messages
to the source IP address when network problems prevent delivery of
IP packets.
• The ICMP header appears after the IPv4 or IPv6 packet header and is
identified as IP protocol number 1(one).
TYPE Description
---- -----------
0 Echo Reply
3 Destination Unreachable
5 Redirect Message
8 Echo Request
ICMP TYPES
ICMP TYPES
TYPE 0 & 8 -Echo Reply & Echo Request
This is the ICMP most used to test IP connectivity commonly known as PING. The
Echo Request ICMP will have a Type field of 8 and a Code field of 0. Echo Replies
have a Type field of 0 and a Code field of 0.
ICMP TYPES
ICMP TYPES
TYPE 3- Destination Unreachable
When a packet is undeliverable, a Destination Unreachable, Type 3, ICMP is generated. Type 3 ICMPs can
have a Code value of 0 to 15:
Value Description
----- -----------
0 Network Unreachable
1 Host Unreachable
2 Protocol Unreachable
3 Port Unreachable
4 Fragmentation needed and DF (Don't Fragment) set
5 Source route failed
6 Destination Network unknown
7 Destination Host unknown
8 Source Host isolated
Value Description
----- -----------
9 Communication with Destination Network Administratively
Prohibited
10 Communication with Destination Host Administratively
Prohibited
11 Network Unreachable for Type Of Service
12 Host Unreachable for Type Of Service
13 Communication Administratively Prohibited by Filtering
14 Host Precedence Violation
15 Precedence Cut-off in Effect
TYPE 5- Redirect Message
Redirect requests data packets be sent on an alternative route. ICMP Redirect is a
mechanism for routers to convey routing information to hosts. The message informs
a host to update its routing information (to send packets on an alternative route).
ICMP TYPES
Code
Value Description
----- -----------
0 Redirect datagrams for the Network
1 Redirect datagrams for the Host
2 Redirect datagrams for the Type of Service and Network
3 Redirect datagrams for the Type of Service and Host
TCP FLAGS
URG (1 bit) – indicates that the Urgent pointer field is significant
ACK (1 bit) – indicates that the Acknowledgment field is significant. All packets after the initial SYN
packet sent by the client should have this flag set.
PSH (1 bit) – Push function. Asks to push the buffered data to the receiving application.
RST (1 bit) – Reset the connection
SYN (1 bit) – Synchronize sequence numbers. Only the first packet sent from each end should have this
flag set. Some other flags and fields change meaning based on this flag, and some are only valid for when
it is set, and others when it is clear.
FIN (1 bit) – No more data from sender
NS (1 bit) – ECN-nonce concealment protection (experimental:
see RFC 3540).
CWR (1 bit) – Congestion Window Reduced (CWR) flag is set by
the sending host to indicate that it received a TCP segment with
the ECE flag set and had responded in congestion control
mechanism (added to header by RFC 3168).
ECE (1 bit) – ECN-Echo has a dual role, depending on the value
of the SYN flag. It indicates:
If the SYN flag is set (1), that the TCP peer is ECN capable.
If the SYN flag is clear (0), that a packet with Congestion
TCP FLAGS
TTL
To avoid looping in the network, every packet is sent with some TTL value set, which tells the network
how many routers (hops) this packet can cross. At each hop, its value is decremented by one and when the
value reaches zero, the packet is discarded
Default TTL value
Windows-128
Linux -64
TTL
Option Use
-n Count Determines the number of echo requests to send. The default is
4 requests.
-w Timeout Enables you to adjust the time-out (in milliseconds). The default is
1,000 (a 1-second time-out).
-l Size Enables you to adjust the size of the ping packet. The default size
is 32 bytes.
-f Sets the Do Not Fragment bit on the ping packet. By default, the
ping packet allows fragmentation.
C:>ping -n 2 -l 1450 131.107.8.1
Pinging 131.107.8.1 with 1450 bytes of data:
Reply from 131.107.8.1: bytes=1450 time<10ms TTL=32
Reply from 131.107.8.1: bytes=1450 time<10ms TTL=32
Ping statistics for 131.107.8.1:
Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate roundtrip times in milliseconds:
Minimum = 0ms, Maximum = 10ms, Average = 2ms
TTL
How to change TTL value for windows ?
HKEY_LOCAL_MACHINE subtree, go to the following key:
SYSTEMCurrentControlSetServicesTcpipParameters.
In the right pane, add the following value:
Name: DefaultTTL
Type: REG_DWORD
Valid Range: 1-255
And restart system
TTL
How to change TTL value for Linux ?
sudo sysctl net.ipv4.ip_default_ttl=129
echo 129 | sudo tee /proc/sys/net/ipv4/ip_default_ttl
sudo bash -c 'echo 129 > /proc/sys/net/ipv4/ip_default_ttl'
To make this setting persistent across reboots you could append
the following line to the file /etc/sysctl.conf:
net.ipv4.ip_default_ttl=129
or
Reference
• https://technet.microsoft.com/en-us/library/bb726993.aspx
• http://www.tutorialspoint.com/ipv4/ipv4_tcpip_model.htm
• https://en.wikipedia.org/wiki/IPv4
• http://www.wildpackets.com/resources/compendium/tcp_ip/ip_fragmentation
• http://www.tcpipguide.com/free/t_IPMessageFragmentationProcess-2.htm
• http://www.thegeekstuff.com/2012/03/ip-protocol-header/
• http://networkengineering.stackexchange.com/questions/6855/maximum-ipv4-header-size
• https://en.wikipedia.org/wiki/Transmission_Control_Protocol
• http://subinsb.com/default-device-ttl-values
• https://technet.microsoft.com/en-in/library/cc737478(v=ws.10).aspx

Más contenido relacionado

La actualidad más candente

Ipv6 cheat sheet
Ipv6 cheat sheetIpv6 cheat sheet
Ipv6 cheat sheetSwarup Hait
 
IPv6 Fundamentals
IPv6 FundamentalsIPv6 Fundamentals
IPv6 FundamentalsMatt Bynum
 
Ipv6 cheat sheet
Ipv6 cheat sheetIpv6 cheat sheet
Ipv6 cheat sheetjulianlz
 
IPv6 header
IPv6 headerIPv6 header
IPv6 headerHeba_a
 
RARP, BOOTP, DHCP and PXE Protocols
RARP, BOOTP, DHCP and PXE ProtocolsRARP, BOOTP, DHCP and PXE Protocols
RARP, BOOTP, DHCP and PXE ProtocolsPeter R. Egli
 
Comparative study of IPv4 & IPv6 Point to Point Architecture on various OS pl...
Comparative study of IPv4 & IPv6 Point to Point Architecture on various OS pl...Comparative study of IPv4 & IPv6 Point to Point Architecture on various OS pl...
Comparative study of IPv4 & IPv6 Point to Point Architecture on various OS pl...IOSR Journals
 
Internet Protocol version 6
Internet Protocol version 6Internet Protocol version 6
Internet Protocol version 6Rekha Yadav
 
I pv6(internet protocol version 6)
I pv6(internet protocol version 6)I pv6(internet protocol version 6)
I pv6(internet protocol version 6)Subrata Kumer Paul
 
introducing PING comand
introducing PING comandintroducing PING comand
introducing PING comandali torabi
 
IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6Adeel Rasheed
 
Internet protocol v6
Internet protocol v6Internet protocol v6
Internet protocol v6Pramith P
 
IPv6 next generation protocol
IPv6 next generation protocolIPv6 next generation protocol
IPv6 next generation protocolRupshanker Mishra
 

La actualidad más candente (20)

Ipv6 cheat sheet
Ipv6 cheat sheetIpv6 cheat sheet
Ipv6 cheat sheet
 
IPv6 Fundamentals
IPv6 FundamentalsIPv6 Fundamentals
IPv6 Fundamentals
 
IPV4 vs IPV6
IPV4 vs IPV6IPV4 vs IPV6
IPV4 vs IPV6
 
Ipv6 cheat sheet
Ipv6 cheat sheetIpv6 cheat sheet
Ipv6 cheat sheet
 
IPv4 and IPv6
IPv4 and IPv6IPv4 and IPv6
IPv4 and IPv6
 
IPv6 header
IPv6 headerIPv6 header
IPv6 header
 
RARP, BOOTP, DHCP and PXE Protocols
RARP, BOOTP, DHCP and PXE ProtocolsRARP, BOOTP, DHCP and PXE Protocols
RARP, BOOTP, DHCP and PXE Protocols
 
Ip4 vs ip6
Ip4 vs ip6Ip4 vs ip6
Ip4 vs ip6
 
Ipv4 ppt
Ipv4 pptIpv4 ppt
Ipv4 ppt
 
Ipv4 & ipv6
Ipv4 & ipv6Ipv4 & ipv6
Ipv4 & ipv6
 
Comparative study of IPv4 & IPv6 Point to Point Architecture on various OS pl...
Comparative study of IPv4 & IPv6 Point to Point Architecture on various OS pl...Comparative study of IPv4 & IPv6 Point to Point Architecture on various OS pl...
Comparative study of IPv4 & IPv6 Point to Point Architecture on various OS pl...
 
Internet Protocol version 6
Internet Protocol version 6Internet Protocol version 6
Internet Protocol version 6
 
The Internet Protocol version 4 (IPv4)
The Internet Protocol version 4 (IPv4)The Internet Protocol version 4 (IPv4)
The Internet Protocol version 4 (IPv4)
 
IPv4 vs IPv6
IPv4 vs IPv6IPv4 vs IPv6
IPv4 vs IPv6
 
I pv6(internet protocol version 6)
I pv6(internet protocol version 6)I pv6(internet protocol version 6)
I pv6(internet protocol version 6)
 
introducing PING comand
introducing PING comandintroducing PING comand
introducing PING comand
 
IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6
 
Internet protocol v6
Internet protocol v6Internet protocol v6
Internet protocol v6
 
Ipv6 cheat sheet
Ipv6 cheat sheetIpv6 cheat sheet
Ipv6 cheat sheet
 
IPv6 next generation protocol
IPv6 next generation protocolIPv6 next generation protocol
IPv6 next generation protocol
 

Destacado

Mgt 2203 group a management 6th batch
Mgt 2203 group a management 6th batchMgt 2203 group a management 6th batch
Mgt 2203 group a management 6th batchMasudur Rahman
 
Chapter 5 foundations of decision making
Chapter 5 foundations of decision makingChapter 5 foundations of decision making
Chapter 5 foundations of decision makingOsmawati Osman
 
Value based decision-making matrix.slideshow
Value based decision-making matrix.slideshowValue based decision-making matrix.slideshow
Value based decision-making matrix.slideshowshifflerj
 
Managerial Decision Making - MANAGEMENT PROCESS
Managerial Decision Making - MANAGEMENT PROCESSManagerial Decision Making - MANAGEMENT PROCESS
Managerial Decision Making - MANAGEMENT PROCESSRamasubramanian H (HRS)
 
Managerial Decision Making
Managerial Decision MakingManagerial Decision Making
Managerial Decision Makingmandalina landy
 
Chapter 9 managerial decision making
Chapter 9 managerial decision makingChapter 9 managerial decision making
Chapter 9 managerial decision makingJoy Villasenor
 
factors affecting Decision making
factors affecting Decision makingfactors affecting Decision making
factors affecting Decision makingEkta Belwal
 
Managerial Decision Making
Managerial Decision MakingManagerial Decision Making
Managerial Decision Makinggreatqadirgee4u
 
Decision Making In Management
Decision Making In ManagementDecision Making In Management
Decision Making In ManagementVinesh Pathak
 
Decision Making Process
Decision Making ProcessDecision Making Process
Decision Making ProcessAima Masood
 
DECISION MAKING POWERPOINT
DECISION MAKING POWERPOINT DECISION MAKING POWERPOINT
DECISION MAKING POWERPOINT Andrew Schwartz
 

Destacado (13)

Decision making
Decision makingDecision making
Decision making
 
Mgt 2203 group a management 6th batch
Mgt 2203 group a management 6th batchMgt 2203 group a management 6th batch
Mgt 2203 group a management 6th batch
 
Chapter 5 foundations of decision making
Chapter 5 foundations of decision makingChapter 5 foundations of decision making
Chapter 5 foundations of decision making
 
Value based decision-making matrix.slideshow
Value based decision-making matrix.slideshowValue based decision-making matrix.slideshow
Value based decision-making matrix.slideshow
 
Managerial Decision Making - MANAGEMENT PROCESS
Managerial Decision Making - MANAGEMENT PROCESSManagerial Decision Making - MANAGEMENT PROCESS
Managerial Decision Making - MANAGEMENT PROCESS
 
Managerial Decision Making
Managerial Decision MakingManagerial Decision Making
Managerial Decision Making
 
Chapter 9 managerial decision making
Chapter 9 managerial decision makingChapter 9 managerial decision making
Chapter 9 managerial decision making
 
factors affecting Decision making
factors affecting Decision makingfactors affecting Decision making
factors affecting Decision making
 
Managerial Decision Making
Managerial Decision MakingManagerial Decision Making
Managerial Decision Making
 
Decision making
Decision makingDecision making
Decision making
 
Decision Making In Management
Decision Making In ManagementDecision Making In Management
Decision Making In Management
 
Decision Making Process
Decision Making ProcessDecision Making Process
Decision Making Process
 
DECISION MAKING POWERPOINT
DECISION MAKING POWERPOINT DECISION MAKING POWERPOINT
DECISION MAKING POWERPOINT
 

Similar a network fundamental (20)

Internet Protocol
Internet ProtocolInternet Protocol
Internet Protocol
 
Ip and icmp
Ip and icmpIp and icmp
Ip and icmp
 
I.p. protocol
I.p. protocolI.p. protocol
I.p. protocol
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
Ipv4 and Ipv6
Ipv4 and Ipv6Ipv4 and Ipv6
Ipv4 and Ipv6
 
Internet protocol
Internet protocolInternet protocol
Internet protocol
 
Lecture-05.pdf
Lecture-05.pdfLecture-05.pdf
Lecture-05.pdf
 
Networking essentials lect2
Networking essentials lect2Networking essentials lect2
Networking essentials lect2
 
IP Address
IP AddressIP Address
IP Address
 
Ipv4
Ipv4Ipv4
Ipv4
 
IPV4 Frame Format
IPV4 Frame FormatIPV4 Frame Format
IPV4 Frame Format
 
Clase 1 Direccionamiento IPv4.pdf
Clase 1 Direccionamiento IPv4.pdfClase 1 Direccionamiento IPv4.pdf
Clase 1 Direccionamiento IPv4.pdf
 
QSpiders - Upper layer-protocols
QSpiders - Upper layer-protocolsQSpiders - Upper layer-protocols
QSpiders - Upper layer-protocols
 
IP Address
IP AddressIP Address
IP Address
 
Unit-2_CN.pdf
Unit-2_CN.pdfUnit-2_CN.pdf
Unit-2_CN.pdf
 
tcpip.ppt
tcpip.ppttcpip.ppt
tcpip.ppt
 
IP Datagram Structure
IP Datagram StructureIP Datagram Structure
IP Datagram Structure
 
1.1.2 - Concept of Network and TCP_IP Model (2).pptx
1.1.2 - Concept of Network and TCP_IP Model (2).pptx1.1.2 - Concept of Network and TCP_IP Model (2).pptx
1.1.2 - Concept of Network and TCP_IP Model (2).pptx
 
TCP/IP Protocol Architeture
TCP/IP Protocol ArchitetureTCP/IP Protocol Architeture
TCP/IP Protocol Architeture
 
Internet Protocol Version 4
Internet Protocol Version 4Internet Protocol Version 4
Internet Protocol Version 4
 

Último

US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 

Último (20)

US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 

network fundamental

  • 1. OUTLINE  Introduction  IPv4 header  calculation of header length  TCP flags  ICMP  TTL  TTL value for windows and linux  how to change ttl value for windows
  • 2. WHAT IS A PROTOCOL? A standard that allows entities (i.e. application programs) from different systems to communicate
  • 4. IPV4  Internet Protocol version 4 (IPv4) is the fourth version in the development of the Internet Protocol (IP) and the first version of the protocol to be widely deployed.  IPV4 protocol works at the network layer of the OSI model and at the Internet layer of the TCP/IP model.  It defines IP addresses in a 32-bit format, which looks like 123.123.123.123.  The total number of IPv4 addresses available is 4,294,967,296 (256 x 256 x 256 x 256 or 2^32)
  • 6. IPV4 HEADER • Version (4 bits) • Internet header length (4 bits) • Service (8 bits) • Total Length (16 bits) • Identification (16 bits) • Flags (3 bits) • Fragment Offset (13 bits) • Time to Live (8 bits) • Protocol (8 bits) • Header Checksum (16 bits) • Source Address ( 32 bits) • Destination Address (32 bits) • Options (variable)
  • 7. IPV4 HEADER • Version (4 bits) This is the first field in the protocol header. This field occupies 4 bits. This signifies the current IP protocol version being used. Fig- Ipv4
  • 8. IPV4 HEADER • Internet header length (4 bits) This 4-bit field defines the total length of the datagram header in 4-byte words. This field is needed because the length of the header is variable (between 20 and 60 bytes).
  • 9. IPV4 HEADER • Services  IETF has changed the interpretation and name of this 8-bit field.  This field, previously called service type, is now called differentiated services.  In this interpretation, the first 3 bits are called precedence bits.  The next 4 bits are called type of service (TOS) bits, and the last bit is not used.
  • 10. IPV4 HEADER • The precedence defines the priority of the datagram in issues such as congestion. • If a router is congested and needs to discard some datagrams, those datagrams with lowest precedence are discarded first. • TOS bits is a 4-bit subfield with each bit having a special meaning.
  • 13. IPV4 HEADER • Total Length (16 bits) • This is a 16-bit field that defines the total length (header plus data) of the IPv4 datagram in bytes. • This 16-bit field defines the entire packet size, including header and data, in bytes. The minimum-length packet is 20 bytes (20-byte header + 0 bytes data) and the maximum is 65,535 bytes
  • 14. IPV4 HEADER • Identification (16 bits) This field is an identification field and is primarily used for uniquely identifying the group of fragments of a single IP datagram • Flags (3 bits) A three-bit field follows and is used to control or identify fragments •bit 0: Reserved; must be zero. •bit 1: Don't Fragment (DF) •bit 2: More Fragments (MF)
  • 15. IPV4 HEADER • Fragment Offset (13 bits) • This 13-bit field indicates the position of a particular fragment's data in relation to the first byte of data (offset 0). • Because it is entirely possible that the fragments that comprise a block of data might travel along different paths to the destination, it is possible they might arrive out of sequence.
  • 17. 1.Create First Fragment: The first fragment is created by taking the first 3,300 bytes of the 12,000-byte IP datagram. This includes the original header, which becomes the IP header of the first fragment (with certain fields changed as described below). So, 3,280 bytes of data are in the first fragment. This leaves 8,700 bytes to encapsulate (11,980 minus 3,280). 2.Create Second Fragment: The next 3,280 bytes of data are taken from the 8,700 bytes that remain after the first fragment was built, and paired with a new header to create fragment #2. This leaves 5,420 bytes. 3.Create Third Fragment: The third fragment is created from the next 3,280 bytes of data, with a 20-byte header. This leaves 2,140 bytes of data. 4.Create Fourth Fragment: The remaining 2,140 bytes are placed into the fourth fragment, with a 20-byte header of course.
  • 19. IPV4 HEADER • TTL (Time To Live) To avoid looping in the network, every packet is sent with some TTL value set, which tells the network how many routers (hops) this packet can cross. At each hop, its value is decremented by one and when the value reaches zero, the packet is discarded
  • 20. IPV4 HEADER Source address. This 32-bit field defines the IPv4 address of the source. Destination address This 32-bit field defines the IPv4 address of the destination. Header Checksum (16 bits) This field is used to keep checksum value of entire header which is then used to check if the packet is received error-free.
  • 21. IP HEADER LENGTH • The length of the header is represented in 32 bit words. • The Internet Protocol (IP) is defined in RFC 791. The RFC specifies the format of the IP header. In the header there is the IHL (Internet Header Length) field which is 4 bits long and specifies the header length in 32 bit words. The IHL field can hold values from 0 (Binary 0000) to 15 (Binary 1111)..
  • 22. IP HEADER LENGTH • So the longest Internet Header (IP header) size can be 15*32 Bits = 480 Bits = 60 Bytes. • This is why the header has a maximum size of 60 Bytes • The shortest header size is 20 bytes, where the IHL field has the value 5 (0101). This is because all the required fields in the header need 20 Bytes of space.
  • 23. ICMP REPLIES • ICMP (Internet Control Message Protocol) is an error-reporting protocol network devices like routers use to generate error messages to the source IP address when network problems prevent delivery of IP packets. • The ICMP header appears after the IPv4 or IPv6 packet header and is identified as IP protocol number 1(one).
  • 24. TYPE Description ---- ----------- 0 Echo Reply 3 Destination Unreachable 5 Redirect Message 8 Echo Request ICMP TYPES
  • 25. ICMP TYPES TYPE 0 & 8 -Echo Reply & Echo Request This is the ICMP most used to test IP connectivity commonly known as PING. The Echo Request ICMP will have a Type field of 8 and a Code field of 0. Echo Replies have a Type field of 0 and a Code field of 0.
  • 27. ICMP TYPES TYPE 3- Destination Unreachable When a packet is undeliverable, a Destination Unreachable, Type 3, ICMP is generated. Type 3 ICMPs can have a Code value of 0 to 15: Value Description ----- ----------- 0 Network Unreachable 1 Host Unreachable 2 Protocol Unreachable 3 Port Unreachable 4 Fragmentation needed and DF (Don't Fragment) set 5 Source route failed 6 Destination Network unknown 7 Destination Host unknown 8 Source Host isolated Value Description ----- ----------- 9 Communication with Destination Network Administratively Prohibited 10 Communication with Destination Host Administratively Prohibited 11 Network Unreachable for Type Of Service 12 Host Unreachable for Type Of Service 13 Communication Administratively Prohibited by Filtering 14 Host Precedence Violation 15 Precedence Cut-off in Effect
  • 28. TYPE 5- Redirect Message Redirect requests data packets be sent on an alternative route. ICMP Redirect is a mechanism for routers to convey routing information to hosts. The message informs a host to update its routing information (to send packets on an alternative route). ICMP TYPES Code Value Description ----- ----------- 0 Redirect datagrams for the Network 1 Redirect datagrams for the Host 2 Redirect datagrams for the Type of Service and Network 3 Redirect datagrams for the Type of Service and Host
  • 29. TCP FLAGS URG (1 bit) – indicates that the Urgent pointer field is significant ACK (1 bit) – indicates that the Acknowledgment field is significant. All packets after the initial SYN packet sent by the client should have this flag set. PSH (1 bit) – Push function. Asks to push the buffered data to the receiving application. RST (1 bit) – Reset the connection SYN (1 bit) – Synchronize sequence numbers. Only the first packet sent from each end should have this flag set. Some other flags and fields change meaning based on this flag, and some are only valid for when it is set, and others when it is clear. FIN (1 bit) – No more data from sender
  • 30. NS (1 bit) – ECN-nonce concealment protection (experimental: see RFC 3540). CWR (1 bit) – Congestion Window Reduced (CWR) flag is set by the sending host to indicate that it received a TCP segment with the ECE flag set and had responded in congestion control mechanism (added to header by RFC 3168). ECE (1 bit) – ECN-Echo has a dual role, depending on the value of the SYN flag. It indicates: If the SYN flag is set (1), that the TCP peer is ECN capable. If the SYN flag is clear (0), that a packet with Congestion TCP FLAGS
  • 31. TTL To avoid looping in the network, every packet is sent with some TTL value set, which tells the network how many routers (hops) this packet can cross. At each hop, its value is decremented by one and when the value reaches zero, the packet is discarded Default TTL value Windows-128 Linux -64
  • 32. TTL Option Use -n Count Determines the number of echo requests to send. The default is 4 requests. -w Timeout Enables you to adjust the time-out (in milliseconds). The default is 1,000 (a 1-second time-out). -l Size Enables you to adjust the size of the ping packet. The default size is 32 bytes. -f Sets the Do Not Fragment bit on the ping packet. By default, the ping packet allows fragmentation.
  • 33. C:>ping -n 2 -l 1450 131.107.8.1 Pinging 131.107.8.1 with 1450 bytes of data: Reply from 131.107.8.1: bytes=1450 time<10ms TTL=32 Reply from 131.107.8.1: bytes=1450 time<10ms TTL=32 Ping statistics for 131.107.8.1: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate roundtrip times in milliseconds: Minimum = 0ms, Maximum = 10ms, Average = 2ms
  • 34. TTL How to change TTL value for windows ? HKEY_LOCAL_MACHINE subtree, go to the following key: SYSTEMCurrentControlSetServicesTcpipParameters. In the right pane, add the following value: Name: DefaultTTL Type: REG_DWORD Valid Range: 1-255 And restart system
  • 35. TTL How to change TTL value for Linux ? sudo sysctl net.ipv4.ip_default_ttl=129 echo 129 | sudo tee /proc/sys/net/ipv4/ip_default_ttl sudo bash -c 'echo 129 > /proc/sys/net/ipv4/ip_default_ttl' To make this setting persistent across reboots you could append the following line to the file /etc/sysctl.conf: net.ipv4.ip_default_ttl=129 or
  • 36. Reference • https://technet.microsoft.com/en-us/library/bb726993.aspx • http://www.tutorialspoint.com/ipv4/ipv4_tcpip_model.htm • https://en.wikipedia.org/wiki/IPv4 • http://www.wildpackets.com/resources/compendium/tcp_ip/ip_fragmentation • http://www.tcpipguide.com/free/t_IPMessageFragmentationProcess-2.htm • http://www.thegeekstuff.com/2012/03/ip-protocol-header/ • http://networkengineering.stackexchange.com/questions/6855/maximum-ipv4-header-size • https://en.wikipedia.org/wiki/Transmission_Control_Protocol • http://subinsb.com/default-device-ttl-values • https://technet.microsoft.com/en-in/library/cc737478(v=ws.10).aspx