Computer Network basic knowledge Note (iii)

Source: Internet
Author: User

  No classification addressing CIDR (classless Inter-Domain Routing, constructed over-grid)

Background: In 1992, the Internet still faces three issues that must be resolved as soon as possible: Class B addresses have been allocated nearly half in 1992 and will be fully allocated in March 1994! The number of items in the routing table in the Internet backbone has increased sharply (from thousands of to tens of thousands of). The entire IPV4 address space will eventually be exhausted.

In 1987, RFC1009 indicated that several different subnet masks can be used simultaneously in a network that divides subnets. Use the variable eldest son netmask vlsm (Variable Length Subnet Mask) to further improve the utilization of IP address resources. On the basis of VLSM, the non-classified addressing method is further researched, and its official name is the routing CIDR (Classless Inter-Domain Routing) between the non-categorical domains.

Features: CIDR eliminates the traditional A,b,c class address and the concept of subnetting. CIDR uses a variety of length " Network prefixes " (network-prefix) to replace the network number and subnet number in the classified address. The IP address is returned from level three addressing (using the subnet mask) back to level two addressing.

Non-classified level two addressing/IP address:: = {< network prefix;, < host number;}

1) CIDR also uses "slash notation" (slash notation), which is also known as CIDR notation, which is to add a slash "/" after the IP address, and then write the number of bits that the network prefix occupies (this value corresponds to the number of 1 in the three-level addressing subnet mask ).

2) The CIDR address block is composed of successive IP addresses with the same network prefix.

  Routing Aggregation (route aggregation)

A CIDR address block can represent many addresses, an aggregation of which is often referred to as Route aggregation, which enables an item in the routing table to represent a number of routes (for example, thousands) of traditional classified addresses.

Route aggregation is also known as constituting an over-grid (supernetting). CIDR does not use subnets, but it still uses the term "mask" (but not the subnet mask). For A/20 address block, its mask is 20 contiguous 1.

The number in the slash notation is the number of 1 in the mask.

Other forms of CIDR notation

10.0.0.0/10 can be abbreviated to 10/10, that is, the dotted decimal in the low-level continuous 0 omitted.

10.0.0.0/10 is equivalent to stating that the mask for IP address 10.0.0.0 is 255.192.0.0, i.e. 11111111 11000000 00000000 00000000

After the network prefix is represented by an asterisk *, such as 00001010 00*, before the asterisk * is the network prefix, and the asterisk * represents the host number in the IP address, which can be any value.

form an ultra-net

A CIDR address block with a prefix length of not more than 23 bits contains multiple class C addresses.

These C-class addresses are combined to form a hyper-net. The number of addresses in a CIDR address block must be a power of 2 for the whole number of times.

The shorter the network prefix, the more the address block contains the number of addresses. In the IP address of the level three structure, the network prefix is made longer by the mesh.

Example of CIDR address partitioning

This ISP has a total of 64 class C networks. If you do not use CIDR technology, you need 64 items in the routing table for each router that exchanges routing information with the ISP's router. With address aggregation, however, the ISP can be found only with 1 items 206.0.64.0/18 after the route is aggregated.

Longest prefix match

When using CIDR, each item in the routing table consists of a network prefix and a next-hop address . You may get more than one matching result when you look for a routing table.

The route with the longest network prefix should be selected from the matching results: longest prefix match (longest-prefix matching). The longer the network prefix, the smaller the address block, and therefore the more specific the route (more specific). the longest prefix match is also known as the longest match or best bet.

The longest prefix match example

PostScript: The use of CIDR has delayed the date that the IP address will be exhausted.

Finding the routing table with a two-fork clue (two-pronged thread with 5 prefixes)

Internetwork Control Message Protocol (Internet Controls message protocol,icmp)

In order to improve the chances of successful IP datagram delivery, an Internet Control Message Protocol ICMP was used at the internetwork level (Protocol).

ICMP allows the host or router to report error conditions and provide reports about anomalies . ICMP is not a high-level protocol, but an IP-layer protocol. The ICMP packet is the data of the IP layer datagram, plus the header of the datagram, which makes up the IP datagram sent out.

ICMP message format:

There are two types of ICMP packets, the ICMP error Reporting message and the ICMP inquiry message . The first 4 bytes of the ICMP message are in a uniform format, with three fields: the type, the code, and the Test and. The next 4 bytes of content are related to the type of ICMP.

There are 5 types of ICMP Error Reporting messages

The end is not reached

Source Point suppression (source quench)

Time exceeds

Parameter issues

Change Route (redirect) (Redirect)

The contents of the data field of the ICMP error reporting message

There are several cases where ICMP error reporting messages should not be sent

ICMP error Reporting messages are no longer sent for ICMP error reporting messages.

ICMP Error Reporting messages are not sent for all subsequent datagrams of the first Shard's datagram.

ICMP Error Reporting messages are not sent for datagrams with multicast addresses.

ICMP Error Reporting messages are not sent for datagrams with special addresses (such as 127.0.0.0 or 0.0.0.0).

example of ICMP application ping (Packet InterNet Groper)

PING is used to test connectivity between two hosts.

The PING uses the ICMP echo request and the Echo reply message.

PING is an example of the application layer using the network layer ICMP directly, which does not pass the transport layer of TCP or UDP.

 

 Routing protocol for the Internet (how routes in the routing table are derived)

A few basic concepts about routing protocols:

1. Ideal routing algorithm

The algorithm must be correct and complete.

The algorithm should be simple in calculation.

The algorithm should be able to adapt to the changes of traffic and network topology, that is to say, self-adaptability.

The algorithm should have stability.

The algorithm should be fair.

The algorithm should be optimal.

2. Hierarchical routing protocol

The internet uses a hierarchical routing protocol. The size of the Internet is very large. If all routers know how all the networks should arrive, the routing table will be very large and take too much time to process. The bandwidth required to exchange routing information between all these routers will saturate the communication links on the Internet. Many organizations do not want to be aware of the layout details of their unit networks and the routing protocol used by the Department (this is within the department), but also want to connect to the Internet.

The internet has two major types of routing protocols

The Internal Gateway protocol IGP (Interior Gateway Protocol) is the routing protocol used within an autonomous system. This type of routing protocol is currently used most often, such as RIP and OSPF protocols.

External Gateway Protocol EGP (External Gateway Protocol) If the source and destination stations are in different autonomous systems, when the data is delivered to the boundaries of an autonomous system, it is necessary to use one protocol to pass routing information to another autonomous system. Such a protocol is an external gateway protocol EGP. BGP-4 is currently the most used in the external gateway protocol.

 Autonomous systems and internal gateway protocols, external gateway protocols

  

Internal Gateway Protocol RIP (Routing information Protocol)

The distance from one router to the directly connected network is defined as 1.

The distance from a router to a network that is not directly connected is defined as the number of routers passed plus 1.

The "distance" in the RIP protocol is also referred to as hop count, because each router passes the number of hops plus 1.

The "distance" here actually refers to the "shortest distance".

RIP thinks that a good route is the number of routers it passes through, that is, "short distances."

RIP allows a path to contain a maximum of 15 routers. The maximum value of "distance" is 16 o'clock, which is equivalent to not being reached.

RIP is visible only for small internet use. RIP cannot use multiple routes at the same time between two networks.

RIP chooses a route with the fewest routers (that is, the shortest path), even if there is another high-speed (low-latency) router with more routes.

Three points of RIP protocol

Exchange information only with neighboring routers.

The information exchanged is all the information known to the current router, which is its own routing table.

Exchange routing information at regular intervals, for example, every 30 seconds.

The establishment of the routing table

When the router is just starting to work, it knows only the distance to the directly connected network (this distance is defined as 1). Later, each router also exchanges and updates routing information only with a very limited number of neighboring routers. After several updates, all routers will eventually know the shortest distance to any network in this autonomous system and the address of the next-hop router. The convergence (convergence) process of RIP protocol is faster, that is, all nodes in autonomous system get the correct route selection information process.

Distance vector algorithm

Receive a RIP message for the neighboring router (whose address is X):

(1) Modify all items in this RIP message first: Change the address in the "Next Hop" field to X and add 1 to the value of all the "distance" fields.

(2) Repeat the following steps for each item in the modified RIP message: If the destination network in the project is not in the routing table, add the item to the routing table. Otherwise, if the router address given in the next hop field is the same, the received item is replaced with the item in the original routing table. Otherwise, if the distance received in the project is less than the distance in the routing table, it is updated, otherwise, nothing is done.

(3) If 3 minutes have not received an updated routing table for neighboring routers, then this neighbor router is credited as unreachable router, the distance is set to 16 (distance of 16 means unreachable).

(4) return.

Advantages and disadvantages of RIP protocol

One problem with RIP is that it takes a long time to transfer this information to all routers when the network fails.

The biggest advantage of RIP protocol is that it is simple to implement and less expensive .

RIP limits the size of the network, and the maximum distance it can use is 15 (16 means unreachable).

Routing information exchanged between routers is the complete routing table in the router, so the overhead increases as the network size expands.

Internal Gateway Protocol OSPF (Open shortest Path first)

1. Basic features of the OSPF protocol

"Open" indicates that the OSPF protocol is not controlled by one vendor, but is published publicly.

"Shortest Path First" is because using the shortest path algorithm proposed by Dijkstra SPF OSPF is just the name of a protocol and does not imply that other routing protocols are not "shortest path first". is a distributed Link-state protocol.

The role of routers in inter-network interconnection

A router is a dedicated computer with multiple input ports and multiple output ports whose task is to forward groupings . That is, the packet received by a router input port, according to the packet to go to the destination (that is, destination network), the packet from a suitable output port of the router forwarded to the next hop router. The next-hop router also processes the grouping in this way until the packet reaches the end point.

"Forwarding" (forwarding) is that the router forwards the user's IP datagram from the appropriate port according to the forwarding post.

"Routing" (routing) is based on the distributed algorithm, according to the network topology obtained from each neighboring router changes, dynamically change the selected route. The routing table is based on the route selection algorithm.

and forwarding is derived from the routing table. When discussing the principle of routing, it is often not to differentiate between forwarding and routing tables.

IP multicasting

Reference: IP multicast technology and its application

Internet Group Management Protocol IGMP

First stage: When a host joins a new multicast group, the host should send an IGMP message to the multicast address of the multicast group stating that it wants to be a member of that group. After the local multicast router receives the IGMP message, the group membership is forwarded to other multicast routers on the Internet.

Second stage: Because the group membership relationship is dynamic, the local multicast router periodically inquires the hosts on the local LAN to see if they continue to be members of the group. As long as there is a host response to a group, the multicast router considers the group to be active. 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.

Some specific measures used by IGMP

All communication between the host and the multicast router is using IP multicast. Multicast routers when inquiring about 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 several multicast routers are 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 request message for IGMP, which indicates a maximum response time (the default value is 10 seconds). When asked, the host randomly chooses between 0 and N to send a response to the delay required. The response corresponding to the minimum delay is sent first. Each host in the same group listens for a response, and as long as the other hosts in the group send the response first, they can no longer send a response.

Virtual private network VPN and network address translation NAT

Local address- an IP address that is used only within the institution and may be allocated by the Agency itself, without the need to apply to the Internet's governing body.

Global address-The only IP address in the world and must be applied to the governing body of the Internet.

10.0.0.0 to 10.255.255.255

172.16.0.0 to 172.31.255.255

192.168.0.0 to 192.168.255.255

These addresses can only be used for internal communication of one institution and not for communication with hosts on the Internet.

Private addresses can only be used as local addresses and cannot be used as global addresses. All routers in the Internet do not forward datagrams that have a private address for the destination address.

Virtual Private network VPNs, also known as intranets (intranet), consist of the internal networks of departments A and B, which indicate that departments A and B are both within the same organization.

A virtual private network VPN, which is jointly established by an institution and some external agencies, is also known as the Extranet (extranet).

Network address translation NAT (translation)

You need to install NAT software on a router that has a private network connected to the Internet. A router with NAT software is called a NAT router, and it has at least one valid external global address IPG.

All hosts that use local addresses are required to convert their local addresses to IPG on the NAT router to connect to the Internet when communicating with the outside world.

The process of network address translation

Internal host X The datagram sent with the local address IPX and host Y communication on the Internet must go through the NAT router. The NAT router translates the datagram's source address IPX into global address IPG, but the destination address IPY remains unchanged and then sent to the Internet.

The NAT router receives the data from host Y back, knowing that the source address in the datagram is IPY and the destination address is IPG.

Based on the NAT translation table, the NAT router translates the destination address IPG to IPX and forwards it to the final internal host X.

Computer Network basic knowledge Note (iii)

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.