IP protocol Header format and (ARP,RARP,ICMP,IGMP)

Source: Internet
Author: User
Tags joins switches
Catalogue

IP protocol Header format
Address Resolution Protocol ARP
Reverse Address Resolution Protocol RARP
Inter-network Control Message Protocol ICMP
Internet Group Management Protocol IGMP
IP datagram header

IP Datagram Header format: The highest bit is on the left and is recorded as 0 bit; the lowest bit is on the right .

version:

4 bits, refers to the IP protocol version of the current IP protocol version number is 4 (that is, IPV4)

Header Length:

4 bits, the maximum value that can be represented is 15 units (4 bytes in one unit) so the maximum of the first ministerial degree of the IP is 60 bytes

Differentiated Services:

8 bits, used to get better service, is called the service type in the old standard, but has not been used. 1998 This field is renamed as a differentiated service. This field only works if you are using Differentiated Services (DIFFSERV). This field is not used in the general case

Total Length:

16 bits, the length of the sum of the header and data, in bytes, so the maximum length of the datagram is 65535 bytes. The total length must not exceed the maximum transfer unit MTU

Logo:

Occupies 16 bits, it is a counter that is used to generate the identity of the datagram

logo (flag):

3-bit, currently only the first two bits have meaning

The lowest bit of the MF flag field is the MF (more Fragment) mf=1, which indicates "There are shards" later. Mf=0 represents the Last Shard

The one in the middle of the DF flag field is df (Don ' t Fragment) allows sharding only when df=0

chip Offset:

Occupies 12 bits, which refers to the relative position of a piece in the original group after the Shard. Slice offset in 8-byte offset units

Survival Time:

The maximum number of routers that are recorded as TTL (Time to Live) datagrams in the Network, and the TTL field is the initial setting of a 8 bit field by the sending side. The recommended initial value is specified by the assigned number RFC and the current value is 64. When sending an ICMP echo response, the TTL is often set to the most Large value 255

protocol:

8 bits, which indicates what protocol the data is carrying in this datagram so that the IP layer of the destination host is given the data portion of the process, 1 is the ICMP protocol, 2 is the IGMP protocol, 6 is the TCP protocol, and 17 is the UDP protocol.

First inspection and:

Accounted for 16 bits, only the header of the test datagram does not test the data section. There is no CRC test code and a simple calculation method is used.

Source address and destination address:

Each account is 4 bytes, recording the source address and destination address, respectively.

Address resolution protocol ARP

Description:

ARP each host has an ARP cache (ARP cache), which has the IP address of each host and router on the local area network to the hardware address of the mapping table

function:

Know its physical address by IP address

steps:


Note: other hosts on the network do not respond to ARP queries, and only the receiving host receives this frame to respond to the sending-side host ARP is to solve the problem of mapping the IP address and hardware address of the host or router on the same LAN. If the host and the source host is not the same LAN, then through the ARP to find a router located on the local area network hardware address, and then send packets to this router, Let the router forward the packet to the next network. The rest of the work is done by the next network. Parsing from IP address to hardware address is automatic, and the host user is unaware of this address resolution process. The host or router communicates with a host or router on another known IP address on the network, and the ARP protocol automatically resolves the IP address to the hardware address required by the link layer

Four typical cases: the sender is the host, to send the IP datagram to another host on the network. At this point, the hardware address of the destination host is found with ARP the sender is the host to which the IP datagram is sent to the other network. At this point, ARP finds a router hardware address on the network. The rest of the work is done by The router completes the router and forwards the IP datagram to a host on the network. At this point, the hardware address of the destination host is found by using ARP to send the IP datagram to a host on another network. ARP Locate the hardware address of a router on this network. The rest of the work is done by this router.

Header format:

Description: The hardware Type field represents the type of hardware address. A value of 1 means that the Ethernet Address Protocol Type field represents the protocol address type to be mapped. Its value is 0x0800, which means the IP address hardware address length and protocol address length indicates the length, in bytes, of the hardware address and protocol address, respectively. For ARP requests or responses for IP addresses over Ethernet, their values are 6 and 4 operation Fields indicate four operation types, which are ARP requests (value 1), ARP Reply (value 2 ), the RARP request (value 3), and the RARP answer (value 4) The next four fields are the hardware address of the sending side (in this case, the Ethernet address), the Protocol address (IP address) of the sending side, the hardware address of the destination end The protocol address of the client and destination .

Reference Links:

http://blog.csdn.net/tigerjb/article/details/7351992

Inverse address Resolution Protocol RARP

Definition:

Reverse Address Resolution Protocol RARP enables a host that knows only its hardware address to know its IP address

use:

Such hosts are often diskless workstations. So the RARP protocol is rarely used

RARP and RAP:

Inter- Network Control Message Protocol ICMP

Objective:

To improve the chances of successful IP datagram delivery

Note: allow hosts and routers to report error conditions and provide reports about abnormal conditions ICMP is not a high-level protocol, but an IP layer protocol ICMP packet as the IP layer datagram data, plus the header of the datagram, composed IP datagram sent out The first 4 bytes of the ICMP message are in a uniform format, with a total of three fields: the type, the code, and the test and. The next 4 bytes of content are related to the type of ICMP

Type: ICMP Error Reporting message: endpoint Unreachable source Point suppression (source quench) time exceeds parameter problem change routing (redirect) (Redirect) ICMP Inquiry message: echo request and reply message Timestamp request and Reply message

Message Format:

ICMP address mask request and reply message

ICMP timestamp request and reply message

ICMP Unreachable message

ICMP echo Request and ECHO response message format

ICMP super-Times article

ICMP Redirect Message

ICMP router Request message Format

ICMP Router Advertisement message format

error message format for ICMP Source station suppression

ICMP Type:

ICMP Error Reporting messages should not be sent: all subsequent datagrams for the first shard do not send ICMP Error reporting message multicast address datagrams do not send ICMP Error reporting message special address (such as 127.0.0.0 or 0.0.0.0) Datagram does not send ICMP error Reporting messages Internetwork Group Management Protocol IGMP

Message Format:

function:

It is the protocol for IP multicast member management in the TCP/IP protocol family, which is used to establish and maintain multicast group membership between IP hosts and multicast routers directly adjacent to them

Features:

When a host joins a new group, it sends an IGMP message to the group address to declare its membership, and the multicast routers and switches can learn from the members of the group. Using the information obtained from IGMP, routers and switches maintain a list of multicast group members on each interface

Two stages: join: When a host joins a new multicast group, an IGMP message is sent to the multicast address of the multicast group declaring itself to be a member of the group. After the local multicast router receives the IGMP message, it forwards the group membership relationship to other multicast routers on the Internet to inquire: Periodically inquire the hosts on the local LAN to see if they continue to be members of the group Note: because the group membership relationship is dynamic, the multicast router will assume that the set is active as long as there is a host response to a group of the local multicast routers However, after a few inquiries, a group still does not have a host response, and the group's membership is no longer forwarded to other multicast routers

Data Package:

IGMP uses an IP datagram to deliver its message (that is, IGMP packets plus IP headers constitute an IP datagram), but it also provides services to IP

specific measures: all communication between the host and the multicast router is using an IP multicast multicast router when probing group membership, only one request message is sent to all groups, instead of sending an inquiry message to each group. The default query rate is sent every 125 seconds when there are several multicast routers connected on the same network, they can quickly and efficiently select one of them to inquire about the host's membership there is a value N in the IGMP inquiry message, which indicates a maximum response time (the default is 10 seconds). When asked, the host randomly chooses between 0 and N to send a response to the delay required. Responses that correspond to the minimum delay are sent to each host in the same group to listen for a response, as long as the other hosts in the group send a response, they can no longer send a response

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.