| written 4.6 years ago by |
THE IPV4 ADDRESS:WHAT IS A IPV4 ADDRESS?WHY IPV4 ADDRESS?
- The IPv4 or Internet Protocol version 4 is an unreliable and as well as connectionless datagram protocol-that is the IPV4 is a best-effort delivery service.Best-effort here means that IPv4 addresses provides no error control or flow control (except for error detection on the header). IPv4 or Internet Protocol version 4 assumes that the unreliability of the underlying layers and does its best to get a transmission through to its destination from the source, but it provides no guarantees ofsending the packet.
- If reliability is important parameter,then IPv4 or Internet Protocol version4 must be paired with a reliable and secure protocol such as TCP.
- An example of a more commonly understood best-effort delivery service in the common world is the post office. The post office like the IPV4 does its best to deliver the mail but does not always succeed. If an unregistered letter is lost, it is up to the sender or would-be recipient to discover the loss and rectify the problem-just like how the IPv4 operates.
- The post office itself does not keep track of every letter and cannot notify a sender of loss or damage. IPv4 or Internet Protocol version 4 is also a connectionless protocol for a packet-switching network that uses the datagram-(packet that is being carried by IP) approach.This means that each datagram or the packet carried is handled independently, and each datagram can follow a different route to the destination.
This implies that datagrams sent by the same source to the same destination could arrive out of order. Also, some could be lost or corrupted during transmission. Again, IPv4 relies on a higher-level protocol to take care of all these problems.
A datagram is a variable-length packet consisting of two parts: header and data. The header is 20 to 60 bytes in length and contains information essential to routing and delivery. It is customary in TCP/IP to show the header in 4-byte sections.
VERSION (VER):
- This 4-bit field defines the version of the IPv4 protocol. Currently the version is 4. However, version 6 (or IPng) may totally replace version 4 in the future. This field tells the IPv4 software running in the processing machine that the datagram has the format of version 4. All fields must be interpreted as specified in the fourth version of the protocol. If the machine is using some other version of IPv4, the datagram is discarded rather than interpreted incorrectly.
HEADER LENGTH(HLEN):THE USE OF HLEN FIELD:
- 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). When there are no options, the header length is 20 bytes, and the value of this field is 5 (5 x 4 = 20). When the option field is at its maximum size, the value of this field is 15 (15 x 4 = 60).
SERVICES: THE USE OF SERVICES FIELD:
- IETF has changed the interpretation and name of this 8-bit field. This field, previously called service type, is now called differentiated services.
SERVICE TYPE: THE USE OF SERVICE TYPE FIELD::
- 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.
- Precedence is a 3-bit subfield ranging from 0 (000 in binary) to 7 (111 in binary). 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. Some datagrams in the Internet are more important than others. For example, a datagram used for network management is much more urgent and important than a datagram containing optional information for a group.TOS bits is a 4-bit subfield with each bit having a special meaning.
Although a bit can be either 0 or 1, one and only one of the bits can have the value of 1 in each datagram.With only 1 bit set at a time, we can have five different types of services.Interactive activities, activities requiring immediate attention, and activities requiring immediate response need minimum delay. Those activities that send bulk data require maximum throughput. Management activities need maximum reliability. Background activities need minimum cost.
FRAGMENTATION:THE BASICS OF FRAGMENTATION AND WHAT IT IS:
- A datagram can travel through different networks. Each router decapsulates the IPv4 datagram from the frame it receives, processes it, and then encapsulates it in another frame. The format and size of the received frame depend on the protocol used by the physical network through which the frame has just traveled.
- The format and size of the sent frame depend on the protocol used by the physical network through which the frame is going to travel. For example, if a router connects a LAN to a WAN, it receives a frame in the LAN format and sends a frame in the WAN format.
MAXIMUM TRANSFERABLE UNIT:THE WORKING OF MTU:
Each data link layer protocol has its own frame format in most protocols. One of the fields defined in the format is the maximum size of the data field. In other words, when a datagram is encapsulated in a frame, the total size of the datagram must be less than this maximum size, which is defined by the restrictions imposed by the hardware and software used in the networkTo make the IPv4 protocol independent of the physical network, the designers decided to make the maximum length of the IPv4 datagram equal to 65,535 bytes.
FIELDS RELATED TO FRAGMENTATION:THE FIELDS IN FRAGMENTATION AND NEED FOR FRAGMENTATION:
- The fields that are related to fragmentation and reassembly of an IPv4 datagram are the identification, flags, and fragmentation offset fields.
Identification:the use of id field:
- This 16-bit field identifies a datagram originating from the source host. The combination of the identification and source IPv4 address must uniquely define a datagram as it leaves the source host. To guarantee uniqueness, the IPv4 protocol uses a counter to label the datagrams.
- The counter is initialized to a positive number. When the IPv4 protocol sends a datagram, it copies the current value of the counter to the identification field and increments the counter by'~ 1. As long as the counter is kept in the main memory, uniqueness is guaranteed. When a datagram is fragmented, the value in the identification field is copied to all fragments.
In other words, all fragments have the same identification number, the same as the original datagram. The identification number helps the destination in reassembling the datagram. It knows that all fragments having the same identification value must be assembled into one datagram.
Flags:the use of flags:
This is a 3-bit field. The first bit is reserved. The second bit is called the do notfragment bit. If its value is 1, the machine must not fragment the datagram. If it cannot pass the datagram through any available physical network, it discards the datagram and sends an ICMP error message to the source host (see Chapter 21). If its value is 0, the datagram can be fragmented if necessary. The third bit is called the more fragment bit. If its value is 1, it means the datagram is not the last fragment; there are more fragments after this one. If its value is 0, it means this is the last or only fragment
Fragmentation offset:the basics of fragmentation offset
- This 13-bit field shows the relative position of this fragment with respect to the whole datagram. It is the offset of the data in the original datagram measured in units of 8 bytes. Figure 20.11 shows a datagram with a data size of 4000 bytes fragmented into three fragments. The bytes in the original datagram are numbered 0 to 3999. The first fragment carries bytes 0 to 1399. The offset for this datagram is 0/8 = O.
- The second fragment carries bytes 1400 to 2799; the offset value for this fragment is 1400/8 = 175. Finally, the third fragment carries bytes 2800 to 3999. The offset value for this fragment is 2800/8 = 350. Remember that the value of the offset is measured in units of 8 bytes. This is done because the length of the offset field is only 13 bits and cannot represent a sequence of bytes greater than 8191. This forces hosts or routers that fragment datagrams to choose a fragment size so that the first byte number is divisible by 8.
- It is obvious that even if each fragment follows a different path and arrives out of order, the final destination host can reassemble the original datagram from the fragments received (if none of them is lost) by using the following strategy:
- The first fragment has an offset field value of zero.
- Divide the length of the first fragment by 8. The second fragment has an offset value equal to that result.
- Divide the total length of the first and second fragments by 8. The third fragment has an offset value equal to that result.
- Continue the process. The last fragment has a more bit value of O

and 2 others joined a min ago.