TCP/IP explanation (3) IP: Internet protocol, Chapter 3 notes

Source: Internet
Author: User


I. Introduction: IP is the most core protocol in the TCP/IP protocol family. All TCP, UDP, ICMP, and IGMP data are transmitted in the IP datagram format. Note that the IP address is not a reliable protocol, the IP protocol does not provide a processing mechanism after the data is not transmitted-this is considered an upper-layer protocol-TCP or UDP to do. Therefore, TCP is a reliable protocol, and UDP is not that reliable. Ii. IP header: the IP datagram format is as follows. The normal IP header length is 20 bytes, unless it contains an option field
 
The 32bit of the four bytes, first 0-7 bit, 8-15, 16--24-31 service type TOS, where 3 is the priority field (ignored), and 4bit TOS represents the minimum latency, respectively, maximum throughput, maximum reliability, and minimum cost.
 
Te l n e t and R l o g I n interaction applications require the minimum transmission latency because they are mainly used to transmit a small amount of interactive data. On the other hand, f t p file transmission requires the maximum throughput. The maximum reliability is specified for network management (s n m p) and routing selection protocols. Usenet news (NNTP) is the only application that requires the minimum cost.
ICMP, IGMP, UDP, and TCP contain both header and data verification code in the header of their lattice. I c m p, I G M P, U D P and T C P both adopt the same test algorithm, although T C P and U D P besides their header and data, the I P header also contains different fields. The RFC provides the Implementation Technology for how to calculate the I n t e r n e t-test and. Because the router often only modifies the t l field (minus 1), when the router forwards a packet, it can add its test, instead of re-computing the entire I P header. R f c provides a very effective method. 3. IP Route Selection: When an IP packet is ready, how does the IP packet (or router) Send the packet to the destination? How does it select a proper path for "Shipping? The most special case is direct connection between the target host and the host, so the host does not need to look for a route, so it is enough to directly pass the data. As for how to directly transfer it, it depends on the ARP protocol, which will be discussed later.
Generally, the host is connected to the target host through several routers. Then, the router needs to find a suitable destination for the IP packet through the IP packet information, such as a suitable host or a suitable route. The router or host will process an IP packet in the following way:
If the TTL (lifecycle) of an IP packet reaches, the IP packet is discarded.
Search the route table and search for matched hosts first. If the target host is exactly the same as the IP address, send the packet to the target host.
Search the route table. If a host fails to match, the router in the same subnet is matched. This requires assistance from the "subnet mask (1.3. If a vro is found, the package is sent to the vro.
Search for the route table. If a vro fails to match the same subnet, The vro matches the same network number (described in Chapter 1). If a vro is found, the package is sent to the vro.
Search for the Land game table. If none of the preceding operations fail, search for the default route. If the default route exists, send the packet
If all of them fail, discard the package. This once again proves that the IP package is unreliable. Because it does not guarantee delivery. Each item in the route table contains the following information. 1 destination IP address 2 next stop vro3 3 mark network address or host address, Mark whether the next stop vro is the real next stop vro4 4 specify a network interface for datagram Transmission
 
4. subnet addressing: the IP address is defined as the network number + host number. However, all hosts require subnet addressing. That is to say, the host number is subdivided into subnet number + host number. In the end, an IP address becomes the network number, subnet number, and host number.
5. subnet Mask: The subnet mask of the class C address is 255.255.255.0B. The subnet mask of the Class B address is 255.255.0.0... similarly, the subnet mask is converted to a binary value, which indicates the network bit, 0 represents the host bit IP address AND subnet mask = network number IP address AND Subnet Mask Take the host number (Part 0) that is not = host number 2 = number of hosts
The following are two examples:. to divide Class B IP address 168.195.0.0 into 27 subnets, solution 1) convert 27 to binary = 11011 2) the binary value is 5 digits, so N = 5 3) set host address of 255.255.0.0 In the subnet mask of Class B address to the first 5 locations 1, and obtain 255.255.248.0. that is, the subnet mask of the Class B IP address that is divided into 27 subnets 168.195.0.0
B. to divide the IP address 168.195.0.0 into several subnets, each subnet has 700 hosts. solution 1) convert 700 to binary = 1010111100 2) the binary number = 10, that is, N = 10 3) change the last 10 digits of the subnet mask 255.255.0.0 of the B-type address to 0, and the subnet mask of 255.255.252.0 is defined as 168.195.0.0 of the B-type IP address divided into 700 hosts. two names: 1 ipconfig/all (windows), ifconfig (linux) 2 netstat Summary: if the target host is on a directly connected network, the datagram is directly transmitted to the target host, otherwise, it is sent to the default vro. Both the host and vro use the route table for route selection. There are three types of routes in the Table: specific host type, specific network type, and default route type. A table in a route table has a certain priority. When selecting a route, the host route takes precedence over the network route, and the default route is selected only when no other routes are available.

I P route selection is implemented by Hop-by-hop. The destination I P address remains unchanged during the transmission of data packets on different sites, but the encapsulation and destination link layer addresses can be changed on each site. Most hosts and many routers use the default next-Stop router for non-local network datagram.
 

Related Article

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.