Computer networks: Network layer

Source: Internet
Author: User
Tags dedicated ip

1. What is the network layer?

The network layer in the TCP/IP system provides a simple, flexible, non-connected, and best-effort delivery of packet services. The network layer does not provide a commitment to quality of service, does not guarantee the time limit for packet delivery, and the packets transmitted may be error, lost, duplicated, and out of sequence.

2. Internet Protocol IP

1. Virtual Interconnect Network

The IP network is virtual. As seen from the network layer, the IP network seems to be a unified, abstract network (in fact, heterogeneous). The IP layer abstraction of the Internet masks the complex details of the underlying network, enabling us to handle communication problems between hosts using a unified, abstract IP address.

2. Classification of IP addresses

The IP address is a 32-bit identifier that is assigned by the Internet name and the digital distribution agency ICANN to identify a host (or route) and a link, consisting of the network segment font size and the host segment font size. Because routing connects at least two networks, he should have at least two IP addresses.

IP address can be recorded as: IP address::={< network number >,< host number;}

IP address can be divided into: Class A (network number 8 bits, host number 24 bit) Class B (Network number 16 bit), Class C (Network number 24), Class D (due to multicast), Class E (reserved for later use)

3.IP Address and hardware address

The physical address is the address used by the data link layer and the physical layer, and the IP address is the network layer and the address used at the top, which is a logical address. The IP datagram is divided into two parts: the first part and the data. The header has a fixed length, a total of 20 bytes, which all IP datagrams must have.

4. Address Resolution Protocol ARP

The Address Resolution Protocol ARP (addr Resolution Protocol) is used to resolve the hardware address used at the data link layer from the IP address used by the network layer.

Format of 5.IP Packets

The IP datagram is divided into two parts: the first part and the data. The header has a fixed length, a total of 20 bytes, which all IP datagrams must have.

The process of forwarding packets in 6.IP layers

Packet forwarding algorithm:

1. Extract the IP address D of the destination address from the header of the datagram, and obtain the destination network n;

2. If n is a network address connected to this route, the direct delivery, do not need to go through other routers, directly to the destination host (this includes the destination host D to a specific hardware address, the datagram encapsulated as a Mac frame, and then send this frame); otherwise indirect delivery, execution 3

3. If the routing table has a specific host route with Destination D, the datagram is routed to the next hop route indicated in the routing table: Otherwise, the execution of 4

4. If there is a route to network N in the routing table, the datagram is routed to the next hop route indicated by the routing table; Otherwise, the execution of 5

5. If there is a default route in the routing table, the datagram is routed to the default route table indicated in the routing table;

6. Report Forwarding Packet Error

3. Dividing subnets and constructing networks

1. Dividing subnets

The idea of dividing subnets:

1. A unit with many physical networks can divide its physical network into several subnets. Dividing subnets is purely a matter within a unit, and it still manifests itself as a network

2. The method of subnetting is to borrow several bits from the host number of the network as the subnet number, of course, the host number corresponding to reduce the same number of digits, the IP address becomes: IP address::={< network number >,< subnet number >,< host number;}

3. Any IP datagram sent from another network to a host in this unit is still located on the network number of the IP datagram to locate the router connected to the network. However, after receiving the IP datagram, this router in the destination network number and host number and subnet number to understand the destination subnet, the IP datagram delivered to the destination host.

2. Subnet mask

The subnet mask is used to "and" with the IP address to derive the network address to

Packet forwarding algorithm using the subnet mask:

1. Extract the IP address of the destination address from the header of the datagram D;

2. First determine whether the direct delivery. The router directly connected to the network check: with each network subnet mask and D-phase "and" to see if the results and the corresponding network address matching, if matched, will be grouped directly to deliver the datagram directly to the destination host (this includes the destination host D to a specific hardware address, Encapsulate the datagram as a Mac frame, and then send this frame); otherwise it is indirect delivery, performing 3

3. If the routing table has a specific host route with Destination D, the datagram is routed to the next hop route indicated in the routing table: Otherwise, the execution of 4

4 each row of the routing table (destination network address, subnet mask, next hop address), with the subnet mask and D-phase "with", the result is n. If n matches the destination network address of the line, the result is that the datagram is routed to the next-hop route indicated by the row; otherwise, the execution of 5

5. If there is a default route in the routing table, the datagram is routed to the default route table indicated in the routing table;

6. Report Forwarding Packet Error

3. No classification addressing CIDR (constituting an over-grid)

The non-classification of CIDR (classless Inter-donmain Routing), also known as non-categorical inter-domain routing, is a good way to solve routing choices. CIDR notation adds a slash "/" after the IP address, and then writes the number of bits that the prefix occupies. The prefix (or network prefix) indicates the network, followed by a suffix to indicate the host. CIDR makes up a "CIDR address block" of successive IP addresses with the same prefix. The allocation of IP addresses is in CIDR address blocks.

4. Internetwork Control Message Protocol ICMP (Internet command message Protocol)

ICMP packets are classified as ICMP Error reporting messages and ICMP query packets. It is installed in the IP datagram as part of the data. ICMP allows the host or router to report error conditions and provide reports about anomalies.

5. Routing protocols for the internet

Autonomous systems as (autonomous system): the Internet divides the entire Internet into many smaller autonomous systems as.

The internet divides routing protocols into two main categories:

Internal Gateway Protocol IGP (Interior Gateway Protocol): A routing protocol used within an autonomous system, regardless of the routing protocol chosen by other autonomous systems in the Internet.

External Gateway Protocol EGP (External gateway Protocol): If the source and destination systems are in different autonomous systems (the two autonomous systems may use different internal gateway protocols), when the datagram reaches the boundary of an autonomous system, You need to use one protocol to make routing information available to another autonomous system.

1.IGP includes RIP and OSPF

Routing Information Protocol RIP (Routing information Protocol): is a distributed routing protocol based on distance vectors, only applicable to small-scale internet. RIP exchanges information with adjacent routes at regular intervals. The information exchanged is its own current routing table, that is, the network (shortest distance) that arrives in this autonomous system, and the next hop that should pass to each network.

Open Shortest Path priority OSPF (Open Shortest Path First): is a Distributed Link-state protocol for large-scale Internet. OSPF uses flooding to send link state information for all routes adjacent to this route only when the link state changes, using all the routers in this autonomous system. "Link state" indicates which routers are adjacent to this router and the "metrics" of the link. "Measure" can represent cost, distance, delay, bandwidth, etc., can be collectively referred to as "cost". All routers will eventually be able to create a network-wide topology diagram.

2.EGP including BGP-4

The Flag Gateway Protocol BGP (Border Gateway Protocol) is the protocol for exchanging routing information between routers of different as, and is a path vector routing protocol. Instead of looking for an optimal route, BGP seeks to reach the destination network (reachable) and better routes (without circling).

6.IP Multicast

Compared with unicast, IP multicasting can greatly save network resources in one-to-many communication. IP multicast uses the class D IP address. IP multicasting requires the use of an Internetwork Group Management protocol and a multicast routing protocol.

7. Virtual private network VPN and network address translation NAT

VPN (Virtual private network) uses the public Internet as the communication carrier between the private networks of the agency. VPN internal use of the private address of the Internet. A VPN must have at least one router with a legitimate global IP address in order to communicate with another VPN on the system over the Internet. All data transmitted over the Internet must be encrypted.

Using Network address translation NAT (translation) technology, a dedicated IP address can be used inside a private network, and only routers connected to the Internet adapt to the global IP address. This greatly saves valuable IP addresses.

    

Computer networks: Network layer

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.