Ipv4 Was Described in (September 1981) - Ipv4 Is A For: Connectionless Protocol Use On Packet Switched Networks
Ipv4 Was Described in (September 1981) - Ipv4 Is A For: Connectionless Protocol Use On Packet Switched Networks
OPM 1
IPv4 (cont.)
OPM 2
Dotted-decimal notation and binary notation for an IPv4 address
OPM 3
Classful IP allocation Technique
OPM 4
Netid and hostid
OPM 5
Number of blocks and block size in classful IPv4 addressing
OPM 6
Classless IP allocation Technique (CIDR)
OPM 7
Each IP address contains information of Network & Host number
The total number of Networks in the block can be found by using the formula 2 n.
The total number of host addresses in the block can be found by using the
formula 232−n.
OPM 8
Configuration and addresses in a subnetted network
OPM 9
Three-level hierarchy in an IPv4 address
OPM 10
NAT implementation
OPM 11
Addresses in a NAT
OPM 12
NAT address translation
OPM 13
Example: Five-column translation table
OPM 14
Private Network IP address
•The following three blocks of IP addresses are reserved for use in private networks.
•These IP addresses are not routable outside of private networks, and private
machines cannot directly communicate with public networks.
OPM 15
Some special address blocks
Link-local addressing
special address block 169.254.0.0/16 for link-local addressing, only valid on
links connected to a host . These addresses are not routable so cannot be the source
or destination of packets traversing the internet (public network). These addresses
are primarily used when a host cannot obtain an IP address from a DHCP server or
other internal configuration methods.
Loopback
The class A network 127.0.0.0 (classless network 127.0.0.0/8) is reserved for
loopback. IP packets with source addresses belong to this network never appear
outside a host.
IP packets with source and destination addresses belong to the network (or
subnetwork) of the same loopback interface are returned back to that interface,
hence can be used to check network interface port of a host device.
source IP address
destination IP address
options (0 to 40 bytes)
payload
4 bytes
OPM
17
IPv4 header fields
OPM 18
IPv4 header fields (cont.)
• Type of Service (originally defined ):- 8-bits field
– Differentiated Services (DS 6-bits defines type of services like control, data,
real-time streaming etc.
– Explicit Congestion Notification (ECN 2-bits allows end-to-end notification
of network congestion without dropping packets).
OPM 19
IPv4 header fields (cont.)
• Total length :-
– 16-bits field defines the entire packet (fragment) size, including header
and data, in bytes (octet).
– The minimum-length packet is 20 bytes (20-byte header + 0 bytes
data) and the maximum is 65,535 bytes — the maximum value of a 16-
bit word.
• Identification :-
– uniquely identifies a datagram or must be copied in fragments.
– Retransmission of a packet carries the same identification number.
– Some experimental work has suggested using the ID field for other
purposes, such as for adding packet-tracing information to help trace
datagrams with spoofed source addresses
OPM 20
IPv4 header fields (cont.)
• Flags:- 3-bits field,
– used to control or identify fragments. They are (in order, from high order to
low order).
– bit 0: Reserved; must be zero.
– bit 1: Don't Fragment (DF), set (1) for don’t fragment, clear (0) for fragment
– bit 2: More Fragments (MF), set (1) for more fragment follows, clear (0) for
no fragment and last fragment.
– The field has become a hop-count—when the datagram arrives at a router, the
router decrements the TTL field by one.
– When the TTL field hits zero, the router discards the packet and typically
sends a ICMP time exceeded message to the sender.
– The program traceroute uses these ICMP Time Exceeded messages to print
the routers used by packets to go from the source to the destination.
OPM 22
IPv4 header fields (cont.)
• Protocol :- 8-bit field
– This field defines the protocol (TCP or UDP) used in the data portion of the
IP datagram.
OPM 23
IPv4 header fields (cont.)
• Source address:-
– This field is the IPv4 address of the sender of the packet. This address may
be changed in transit by a Network Address Translation device.
• Destination address:-
– This field is the IPv4 address of the receiver of the packet. As with the
source address, this may be changed in transit by a Network Address
Translation device.
OPM 24
IPv4 header fields (cont.)
• Options:-
– The options field is not often used.
– The list of options may be terminated with an EOL (End Of Option list, 0x00)
option; this is only necessary if there is any option entries in header.
– The possible options that can be put in the header are as follows:
• Copy : Set to 1 if the options need to be copied into all fragments of a fragmented packet.
• Option Class : options category. 0 is for ― datagram or network control" options, and 2 is
for "debugging and measurement". 1, and 3 are reserved.
• Option Number : value 0 for end of option list, 3 for loose source route, 7 for record
route, 9 for strict source route, 11 for MTU probe, 18 for traceroute program to find
routers along a path etc.
OPM 25
Fragmentation
• May need to fragment an IP packet if one data link along the way
cannot handle the packet size
– Perhaps path is a mix of different Hardwares.
– Perhaps unexpected encapsulation makes the packet larger than the source
expected
– Hosts try to understand Maximum Transmission Unit (MTU) to avoid the
need for fragmentation (which causes a performance hit)
• Any device along the way can fragment (in IPv4 only)
– Identification field identifies all elements of the same fragment
– Fragmentation stored in the MF (more fragments) and fragment offset fields
– Devices can reassemble too
– But generally the destination does the reassembly
OPM 26