TCP/IP Learning day04

Source: Internet
Author: User

4th Chapter ARP: Address Resolution Protocol

1. Background: When a host sends an Ethernet data frame to another host on the same LAN, the destination interface is determined based on the Ethernet address of the bit. The device driver never checks the destination IP address in the IP datagram.

Therefore, when sending data to another host, we not only need to know the destination host's IP address, but also know the destination host's hardware address (MAC address).

The role of the 2.ARP Protocol: ARP provides dynamic mapping between IP addresses and corresponding hardware addresses (from the logical Internet address to the corresponding physical hardware address for translation), and this process is done automatically.

3. Process:

A.arp sends an Ethernet data frame called an ARP request to each host on the Ethernet.

B. The ARP layer of the destination host receives this broadcast message, identifies that it is the sending side asking for its IP address, and sends an ARP response. This ARP response contains the IP address and the corresponding hardware address.

C. Send data to the host.

Generally speaking, the ARP request is in the form of broadcast, and the reply is in the form of unicast, the specific can catch the packet to see.

      

This figure is the ARP request and response data format, the details of the detailed reference to the TCP/IP protocol: Volume One

4.ARP cache: There is an ARP cache on each host. This cache holds a mapping record between the closest Internet address to the hardware address.

When other hosts receive ARP requests, they update their own ARP cache, which writes the requestor's IP-----mac to their own buffer table.

Therefore, for ARP, A sends ARP request to get B's mac,a-->b can proceed, according to above, B can not send ARP request to a can b-->a.

5. Proxy ARP: If an ARP request is sent from a host on a network to a host on another network, the router connecting the two networks can answer the request, which is called a delegated arp or ARP proxy.

Examples of proxy ARP can be described in the book.

6. Free ARP: At the time of the machine or IP reset, the host will send an ARP request to the network, of course, I hope no one reply to this package, if someone replies to this package, then the IP has been occupied, this is the process of free ARP.

          

Well, the basic concept of ARP is these, and some parts of it is not very clear, for example, when the RP Agent is read, why two slip shunt, an IP address at both ends have, and as the proxy ARP that the article did not,

Also, from subnets 1 to 13 is not very clear how to come.

GRASP the macro framework and fight the details tomorrow.

5th Chapter Rarp: Inverse Address Resolution Protocol

1. Background: When a system with a local disk is booted, the IP address is typically read from a configuration file on disk. However, diskless machines, such as x terminals or diskless workstations, require additional methods to obtain an IP address.

2. Working process: diskless system broadcasts a RARP request to the network, the host unicast reply with the RARP server function to the diskless system, which is then transmitted to the diskless system via the TFTP protocol. Its frame format is very similar to ARP. The difference is that the ARP server is usually implemented within the kernel, while the RARP server is usually a user-space program.

6th Chapter icmp:internet Control Message Protocol

1. Function: Mainly used to pass the query and request information.

2. Message Format:

    

Where the eight-bit type and the eight-bit code are as follows:

    

3. Situations where ICMP packets are not generated:

    

4. Next, take a look at two examples of error messages and query messages respectively

A.ICMP Request Address Mask

This example in the "TCP/IP Detailed: Volume One" This book can be found in the detailed process, I just want to say, why SVR4 sent to Sun's bag will be BSDI caught?

      

      

B.ICMP Port Unreachable Error

One rule of ICMP is that the ICMP error message must include the datagram IP header that generated the error message (including any options), and must include at least the first 8 bytes following the I P header.

ICMP packets are exchanged between hosts without the destination port number, and each 20-byte UDP datagram is sent from a specific port (2924) to another specific port (8888).

When testing ICMP Port unreachable effect, only use UDP to do the experiment, TCP is not.

Seventh Chapter: Ping Program

Here is the main discussion of the IP record routing options for Ping

A. Message format

    

This is the format of the ICMP record routing path, the disadvantage is that it can only record nine, and it records the IP of the routed exit, the destination host's IP will also be recorded, and it records a loop, back and forth to record, the utilization is not high.

B.ttl

This value is determined by the sender, for example, at the time of sending, the host's TTL is 64, but when the destination host reply, the TTL is 255, then finally, our local ping program gets 255.

8th chapter: Traceroute Procedure

1. How to work: Skip to send a UDP high-end port packet to the destination address, if not to the destination, the router will return an ICMP timeout information, if the destination host, found that the port is unreachable, at this time the destination host sends a "Port unreachable" ICMP message, so, We know the path of the packet in the network.

2. Benefits of the IP routing logging option compared to ping:

A. Not all routers support IP routing records.

The number of B.ip routing records is limited.

C. But this makes the recorded I p address double (one return).

3.Traceroute Source Station Routing

The idea of source routing is that the sender specifies the route. It can be used in the following two ways:
A. Strict source route selection. The sending side indicates the exact route that must be used for the I P datagram. If a router discovers
The next router specified by the source route is not on its directly connected network, it returns a "source station path
By failure "I C M p error message.
B. Loose source station routing. The sender indicates a list of I-P addresses passed by the datagram, but the datagram refers to the list of
Other routers can be passed between any of the two addresses.

In specific use, a loose plus-g option, followed by the list of IP addresses to go through, and the other is the plus-G option.

    

A clever application of the loose source station routing: Set the destination site to itself, where an address must be set to the original address to be reached, so you can know what went wrong with the original destination address.

Today is here, a little more, I rookie a, welcome to the Great God enlighten, thank you!

TCP/IP Learning day04

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.