| written 4.6 years ago by |
The IPv4 Address:
- The Internet Protocol version four is an unreliable and as well as connectionless datagram protocol-that is the Internet Protocol version four is a best-effort delivery service.Best-effort here means thatInternet Protocol version four addresses provides no error control or flow control .
- Internet Protocol version four 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 Internet Protocol version fourmust be paired with a reliable and secure protocol such as transmission cointrol protocol.
- An example of a more commonly understood best-effort delivery service in the common world is the post office.
- The post office like the Internet Protocol version four 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 Internet Protocol version four operates.
- The post office itself does not keep track of every letter and cannot notify a sender of loss or damage. Internet Protocol version fouris also a connectionless protocol for a packet-switching network that uses the datagram- 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, Internet Protocol version fourrelies 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 frame format to show the header in 4-byte sections.
Version (VER):
- This 4-bit field defines the version of the Internet Protocol version four protocol. Currently the version is 4. However, version 6 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):
- 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 . When there are no options, the header length is 20 bytes, and the value of this field is 5 .
- When the option field is at its maximum size, the value of this field is 15 .
Services Used:
- International Engineering Task Force has changed the interpretation and name of this 8-bit field. This field, previously called service type, is now called differentiated services.
Service Type:
- In this interpretation, the first 3 bits are called precedence bits. The next 4 bits are called type of service bits, and the last bit is not used.
- Precedence is a 3-bit subfield ranging from 0 to 7 . 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.type of service 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:
- A datagram can travel through different networks. Each router decapsulates the Internet Protocol version four 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 local ntwork to a Wide Network, it receives a frame in the Local Network format and sends a frame in the Wide Network format.
Maximum Transferable Unit:
- 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 network.
- To make the Internet Protocol version four protocol independent of the physical network, the designers decided to make the maximum length of the Internet Protocol version four datagram equal to 65,535 bytes.
Fields Related To 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 Internet Protocol version four address must uniquely define a datagram as it leaves the source host. To guarantee uniqueness, the Internet Protocol version four protocol uses a counter to label the datagrams.
- The counter is initialized to a positive number. When the Internet Protocol version four 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 error message to the source host .
- 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. The frame 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.
- The second fragment carries bytes 1400 to 2799; the offset value for this fragment is 175.
- Finally, the third fragment carries bytes 2800 to 3999. The offset value for this fragment is 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 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\0.

and 2 others joined a min ago.