0% found this document useful (0 votes)
11 views4 pages

IPv4 Addressing

Uploaded by

ofiscobaraki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views4 pages

IPv4 Addressing

Uploaded by

ofiscobaraki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

IPv4 Addressing

Introduction
a. As we saw in the OSI Model, the Network layer provides the logical addressing (IP
addresses).
b. IPv4 is the primary protocol for 3rd layer.

IPv4 Header:
a. Has two important fields of 32 bits which are :
i. Source IP Address
ii. Destination IP Address
b. IPv4 address is written in dotted decimal format 176.20.10.0/24. (4 octets {octet is 8
bits})
c. /x enable us to differentiate the bits that represent the network and the bits that
represent the end Host.(x bits represent the network and remaining ones represent the end
host).

IPv4 Address Classes


a. The class is determined by the first octet (8 bits)

b.

c. We will focus on the classes A, B and C, Class D is for Multicast addresses and class E is
reserved for experimental

Loopback Addresses:
a. Address range 127.0.0.0–127.255.255.255
b. Used to test the network stack on the local device
c. When I ping any address from that range of address i will get the same thing (0ms) because
I am pinging my self the traffic goes nowhere :

i.
ii.

d. Netmask
i. Is another way to show the prefix (the network bits)
ii. Class A : /8 →255.0.0.0.
iii. Class B : /16 → 255.255.0.0
iv. Class C : /24 → 255.255.255.0

e. Host portion of address is all O's = Network Address.


f. The Network Address CANNOT be assigned to a host.
g. Host portion of address is all 1's = Broadcast Address
h. The Broadcast Address CANNOT be assigned to a host

i. Maximum Hosts Per Network


i. host_portion_bits
2 − 2

ii. By -2 we remove the Network address and the Broadcast address e.g. The network
172.16.0.0/16 has Host portion of 16 bits = 2 = 65,536–2 = 65,534.
16

j. First/Last Usable Address


i. For the First usable Address we take the network address and add one to it
ii. For the last usable Address we take the broadcast address and subtract one from it

IPv4 Header:
a. As we said this is used at layer 3 to help send data between devices on separate networks.
b. IPv4 header is used to encapsulate the TCP/UPD segment.
c. L3 header has the information to route the frame to its destination because it has the IP
address of it.
d. IPv4 header has a size of 32 bytes == 256 bits
e.
f. IPv4 Header Fields:
i. Version field:
1. Length : 4 bits
2. identifies the version of IP used
3. IPv4 = 4 (0100).

ii. Internet Header Length (IHL):


1. Length : 4 bits.
2. The final field of the IPv4 header (Options) is variable in length, so this field is
necessary to indicate the total length of the header.
3. Identifies the length of the header in 4-byte increments
4. Value of 5 (in this field) = 5 x 4-bytes = 20 bytes → the length of the header is 20
bytes.
5. The minimum Value is 5 (= 20 bytes → empty options field)
6. The Maximum value is 15 (=60 bytes → Maximum value of the Options filed is 40 bytes).

iii. Differentiated Services Code Point (DSCP)


1. Length of 6 bits
2. Used for QoS (Quality of service)
3. Used to prioritize delay-sensitive data (Which traffic should receive priority
treatment)

iv. Explicit Congestion Notification (ECN):


1. Length of 2 bits.
2. Provides end-to-end (between two endpoints) notification of network congestion (busy
network) without dropping packets.
3. Optional feature that requires both endpoints, as well as the underlying network
infrastructure, to support it.

v. Total Length :
1. Length of 16 bits.
2. Indicates the total length of the packet (L3 header + L4 segment).
3. Measured in bytes (a value of 20 in this field means 20 bytes).
4. Minimum value of 20 = IPv4 header with no encapsulated data
5. Maximum value of 65535

vi. Identification field:


1. Length of 16 bits
2. If a packet is fragmented due to being too large, this field is used to identify which
packet the fragment belongs to.
3. All fragments of the same packet will have their own IPv4 header with the same value
in this field.
4. Packets are fragmented if larger than the MTU (Maximum Transmission Unit)
5. The MTU is usually 1500 bytes
6. Fragments are reassembled by the receiving host.

vii. Flags field:


1. Length of 3 bits
2. Used to control/identify fragments.
3. Bit 0 : Reserved, always set to 0.
4. Bit 1 : Don't fragment (DF) used to indicate a packet that should not be fragmented
5. Bit 2 : More Fragments, (MF bit) Set to 1 if there are more fragments in the packet
and set to 0 for the last fragment
6. Unfragmented packets will always have their MF set to 0.

viii. Fragment Offset field


1. Length of 13 bits
2. Used to indicate the position of the fragment within the original, unfragmented IP
packet.
3. Allows fragmented packets to be reassembled, even if the fragments arrive out of
order.

ix. Time To Live Field


1. Length of 8 bits.
2. A router will drop a packet with a TTL of 0.
3. Used to prevent infinite loops.
4. Designed to indicate the packet's maximum lifetime in seconds.
5. In practice, indicates a "hop count" : each time the packet arrives at router, the
router decreases the TTL by 1.

x. Protocol Field:
1. Indicates the protocol of the encapsulated 4L PDU
2. Usually it has one of :
1. Value of 6 for the TCP
2. Value of 17 for the UDP
3. Value of 1 for ICMP
4. Value of 89 for OSPF (Open Shortest Path First) → Dynamic routing protocol allow
routers to learn routes to destination from their neighbors

xi. Header Checksum field:


1. A calculated checksum used to check for errors only in the IPv4 header.
2. When a router receives a packet, it calculates the checksum of the header and compares
it to the one in this field of the header.
3. If they do not match, the router drops the packet → There is an error.

xii. Destination and Source IP Addresses


xiii. Options Field:
1. Is an optional (Rarely used) field of length vary from 0 to 320 bits

You might also like