Ipv4 Internet Protocol (Ip)
Ipv4 Internet Protocol (Ip)
Ipv4 Internet Protocol (Ip)
OPM
OPM
OPM
IPv4
IPv4 (cont.)
OPM
OPM
2/6/2015
OPM
OPM
OPM
OPM
10
InIPv4addressing,ablockof
addressescanbedefinedas
x.y.z.t /n
/
inwhichx.y.z.t definesoneoftheaddressesandthe/n definesthemask.
OPM
The total number of host addresses in the block can be found byy usingg the
formula 232n.
11
OPM
12
2/6/2015
OPM
13
NAT implementation
OPM
14
OPM
16
Addresses in a NAT
OPM
15
OPM
17
OPM
18
2/6/2015
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
l
loopback.
b k IP packets
k t with
ith source addresses
dd
belong
b l
to
t this
thi network
t
k 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.
OPM
19
7 8
version
header
length
15 16
ECN
DS
Identification
time-to-live (TTL)
23
24
D M
F F
protocol
Fragment offset
header checksum
source IP address
destination IP address
options (0 to 40 bytes)
payload
4 bytes
OPM
22
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 16bit word.
OPM
23
OPM
24
2/6/2015
low order).
bit 0: Reserved; must be zero.
bit 1: Don't Fragment (DF), set (1) for dont fragment, clear (0) for fragment
bit 2: More Fragments (MF), set (1) for more fragment follows, clear (0) for
no fragment and last fragment.
fragment
Th
The field
fi ld has
h become
b
a hop-countwhen
h
t
h the
th datagram
d t
arrives
i
att a router,
t the
th
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
26
Source address:-
This field defines the protocol (TCP or UDP) used in the data portion of the
IP datagram.
OPM
27
OPM
28
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
Address spoofing
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:-
Copy (1 bit)
Copy(1bit)
25
29
OPM
30
2/6/2015
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
d for
f fragmentation
f
t ti (which
( hi h causes a performance
f
hit)
OPM
31
Any device along the way can fragment (in IPv4 only)
Use the corresponding next hop address and interface to send the packet on.
The next hop address is on the same link as this device, so you use the next
hops data-link address, e.g. ethernet MAC address
Decrement time to live field in IP header at each hop. Drop packet when
it reaches 0
OPM
32
OPM
33
OPM
34