1. From level two IP address to level three IP address:
* * Level Two IP address design unreasonable:
The utilization of ①IP address space is sometimes very low;
② assigns a network number to each physical network, which causes the routing table to become too large and thus causes the network performance to become worse;
③ level Two IP address is not flexible;
2. subnetting: Since 1985 a "Subnet Number field" has been added to the IP address so that the level two IP address becomes a level three IP address;
(1) A unit with many physical networks, which can divide the physical network into a number of subnets; dividing subnets is purely a unit of things, the network outside the unit can not see how many subnets the network is composed of, because the unit is still a network of external performance;
(2) The method of dividing the subnet is to borrow several bits from the host number of the network as the subnet number Subnet-id, of course, the host number is correspondingly reduced the same number of digits;
(3) IP address ={< network number >,< subnet number >,< host number;}
(4) Any IP datagram sent from another network to a host of this network is still based on the network number of the IP datagram to find the router connected to the network; But after receiving the IP datagram, the router finds the destination subnet by the destination network number and subnet number, and delivers the IP datagram to the destination host.
(5) In short, the IP address after the molecular network has become a three-level structure, the network is only the IP address of the host number of this part of the division, and do not change the IP address of the original network number;
3. Subnet Mask:
(1) because the IP datagram header can not see whether the source host or destination host connected to the network is divided into subnets, the header of the IP packet does not contain any information about subnetting; Using a subnet mask, the router may forward the IP data to the corresponding subnet;
(2) The subnet mask is the IP address that the router uses to find the subnet where the destination host is located;
(3) The router takes the subnet mask of level three IP address and the destination IP address of the received datagram by phase "with" (and), and obtains the network address of the required subnet;
(4) No matter whether the network is divided into subnets, as long as the net mask and IP address to the bitwise "and" operation, immediately get the network address;
(5) The standard provisions of the Internet: All networks must use a subnet mask, and in the router's routing table must also have a subnet mask column; If a network is not zoned molecular network, then the subnet mask of the network uses the default subnet mask;
(6) Default subnet mask:
Default subnet mask for Class A addresses: 255.0.0.0
Default subnet mask for Class B addresses: 255.255.0.0
Default subnet mask for Class C addresses: 255.255.255.0
(7) The subnet mask is an important attribute of a network or a subnet: When routers and neighboring routers Exchange routing information, they must tell neighboring routers the subnet mask of their network (or subnet);
(8) When a fixed-length subnet is used, the subnet masks of all the subnets are the same;
(9) The number of subnets is calculated according to the subnet number Subnet-id, if the Subnet-id has n bits, there is a total of 2 N of the possible ordering of the species, except that all 0 and 1 of the two cases, the number of subnets in the table;
(10) If the number of subnets with fewer digits is used, the number of hosts that can be connected on each subnet is more; If the subnet number with more digits is used, the number of subnets is more, but the number of hosts can be connected on each subnet is less;
(11) Dividing subnets increases the flexibility, but reduces the total number of hosts that can be connected to the network;
(12) The same IP address and different subnet mask can get the same network address, but the effect of different masks is different, the sub-network number and host number of different partition method, the number of sub-nets can be divided and the maximum number of hosts in each subnet is different;
4. Use subnet Time group forwarding:
* * The table must contain the following three items: Destination network address, subnet mask and next hop address;
* * The algorithm for packet forwarding after subnetting:
(1) Extract the destination IP address from the header of the received datagram D;
(2) First to determine whether direct delivery, the router directly connected to the network to check: With each network segment subnet mask and D-phase "and" (and) operation, see if the result and the corresponding network address match; If matched, the packet is delivered directly (and of course the D is converted to a physical address, The datagram is encapsulated in the Mac frame to send out), the forwarding task ends; otherwise it is indirect delivery, execution (3);
(3) If there is a specific host route with destination d in the routing table, the datagram is routed to the next-hop router indicated in the router; otherwise, execution (4);
(4) Each row in the routing table (destination network address, subnet mask, next hop address), with the subnet mask and D phase-by "and" (and operation), the result is n; if n matches the destination network address of the line, the datagram is routed to the next-hop router indicated by the line; otherwise, execution (5);
(5) If there is a default route in the routing table, the datagram is routed to the default router indicated in the routing table; otherwise, execution (6);
(6) Error in report forwarding packet;
5. No classification addressing CIDR (constituting an ultra-network):
(1) Variable eldest son netmask vlsm: Indicates that several different subnet masks can be used simultaneously in a network that divides subnets;
(2) Non-categorical inter-domain routing CIDR:
**CIDR eliminates the traditional Class A, Class B, Class C addresses and the concept of subnetting, so that the IPV4 address space can be allocated more efficiently.
**cidr the 32-bit IP address into two parts, the previous part is "network prefix" used to indicate the network, the latter part is used to indicate the host;
**IP address ={< network prefix >,< host number;}
**CIDR also uses "slash notation" or "CIDR notation", that is, after the IP address with a slash "/", and then write the network prefix occupies the number of bits; 128.14.35.7/24
**CIDR the network prefix is the same continuous IP address into a "CIDR address Block", as long as we know any address in the CIDR address block, we can know the address block of the starting address (that is, the minimum address) and the maximum address, as well as the number of addresses in the address block;
(3) CIDR uses a 32-bit address mask, the address mask has a string of 1 and a string of 0 components, and 1 is the length of the network prefix; slash notation, the number behind the slash is the number of 1 in the address mask;
(4) 128.14.35.7/20=10000000 00001110 00100011 00000111//red indicates network prefix: 20-bit
(5) Diagonal notation In addition to the IP address can be expressed, you can also indicate that the address of the network prefix has several, the rest is the host bit, through a simple calculation, you can also get the address block the most down address and the maximum address;
(6) Find the minimum address and maximum address in the address block:
* * Find out which byte of address the junction of 1 and 0 occurs in the address mask;
* * The decimal number of this byte is represented by a binary system;
* * The host number (32-network prefix number) of the few, all 0 is the minimum address, all 0 is the maximum address;
(7) Route aggregation: A number of addresses in a CIDR address block, using CIDR address blocks in the routing table to find the destination network;
(8) CIDR notation has many forms: the 10.0.0.0/10 can be abbreviated as: 10/10; add an asterisk after the network prefix *:00001010 the 00*,* number indicates the host number in the IP address;
(9) The method of forming the super-Net: Shorten the network prefix. The shorter the network prefix, the more the address block contains the number of addresses;
(10) longest prefix match:
* * Each item in the routing table consists of a "network prefix" and a "Next hop address", but when looking for a routing table, more than one matching result may be obtained;
* * The route with the longest network prefix should be selected from the matching result, which is called the longest prefix match, because the longer the network prefix, the smaller the address block, and the more specific the route.
(11) Find the routing table using a two-fork clue:
* * In order to make the router more efficient to find the longest network prefix, usually the non-classified address of the routing table in a hierarchical data structure, and then top-down hierarchical search;
* * Common binary clues, this special structure of the tree, the IP address from the left to the right of the bit value determines the path from the root node-by-layer downward, and the path of the binary clues in the route table represents the various addresses;
* * from the root node of the two forks the top-down depth is up to 32 layers, each layer corresponds to one of the IP addresses; the rule for an IP address to deposit two forks is simple: first detect the first bit on the left of the IP address, such as 0, then the first layer node is at the bottom left of the root node, and if 1, Then check the second place of the address and construct the node of the second layer;
* * Two forks The clue simply provides a mechanism that can quickly find a matching leaf node in the routing table;
2016.7.8 Review Essentials of Computer network The fourth chapter divides the subnets and constructs the network