Fifth Chapter IP Fundamentals

Source: Internet
Author: User

The network layer of the TCP/IP protocol stack is located between the network interface layer and the transport layer, and its main protocols include IP (Internet Protocol Internet Protocol), ARP (address Resolution Protocol Addressing Resolution Protocol), RARP (Reverse Address Resolution Protocol Reverse Resolution Protocol), ICMP (Internet Control Message Protocol), IGMP (Internet Group Management Protocol Internet Group Management Protocol).


IP protocol Overview

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/77/10/wKioL1ZiXi7wcfewAAFC9GGZAbs653.jpg "title=" 15.jpg "alt=" Wkiol1zixi7wcfewaafc9ggzabs653.jpg "/>

The network layer of the TCP/IP protocol stack is between the network interface layer and the transport layer. The primary function of the network layer is to identify each node in a large-scale network and deliver the packet to the correct destination node.

The network layer of TCP/IP primarily defines the following protocols:

IP: Responsible for network layer addressing, routing, segmentation, and packet reorganization

ARP: responsible for resolving the network layer address into a physical address

RARP: responsible for parsing the physical address into the network layer address

ICMP: defines the function of network layer control and delivery of messages, which can report errors, failures and other information that occur during IP packet delivery, and provide network diagnostic functions.

IGMP: responsible for managing IP multicast groups


The core protocol of the TCP/IP network layer is the IP defined by RFC791. IP is an effort to transmit network protocols that provide data transfer services that are unreliable and non-connected. The IP protocol does not care about the contents of the data packets, it cannot guarantee that the packets can reach the destination successfully, and does not maintain any information about the status of the packets. A reliable connection-oriented service is implemented by the TCP protocol in the upper layer.

IP encapsulates the data from the transmission side into an IP packet and forwards it to the network interface layer, encapsulating the frame solution from the network interface layer and submitting it to the corresponding transport layer protocol for processing according to the IP protocol number. The IP protocol number for TCP with IP protocol number 6,UDP is 17.

The main functions of IP protocols include:

Identify nodes and Links: IP assigns each link a globally unique network number to identify each network, and assigns a globally unique 32-bit IP address to each node to identify each node.

Addressing and forwarding: The IP router determines the location of the node's network based on the routing information it has mastered, and then determines where the node resides, and chooses the appropriate path to forward the IP packet to the destination node.

Adaptive follow-up data link: In order to work on a variety of links and media, IP must have the ability to adapt to various links, such as the IP packet can be fragmented and reorganized according to the MTU of the link, you can establish the IP address to the data Link Layer address mapping and through the actual data link to pass information.


IP network Architecture

The typical IP Internet is composed of numerous routers and network segments. Each network segment corresponds to a link. Routers perform data forwarding services between these network segments.

The main functions of the router:

Connected networks: Each interface of the router is in a network, connecting the isolated network to achieve a wide range of network communication.

Link layer protocol adaptation: Because of the diversity of the link layer protocol, there is no direct communication between the non-homogeneous links. Routers can be adapted to the protocols and rates of various data links, making their communication possible.

Forwarding packets between networks: In order to achieve this, routers need to run gateway-to-Gateway protocol (Protocol GGP) to Exchange routing information and other control information to understand the correct path to each destination network, typically GGP including RIP, Routing protocols such as OSPF and BGP.

Packet forwarding of the IP network makes the hop-on (hop-by-hop). Each node, including the router, either sends a packet directly to the destination node, or transmits it to the next hop node on the mapping node path, continuing to forward the packet by the next hop. The packet must go through all the intermediate nodes before it reaches its destination. The forwarding decision for each router or host is independent, based on the route stored in its own routing table.


IP encapsulation





Version (4b)

IHL

(4b)

Type of Service

(8b)

Total Length

(16b)

Identification

(16b)

Flags

(3b)

Fragment Offset

(5b)

Time to Live (8b) Protocol (8b)
Header Checksum (16b)
Source IP Address (32b)
Destination IP Address (32b)
IP Options
    • Version: Indicates the version number of the IP protocol, and the current protocol version number is 4. The next generation IP protocol has a version number of 6.

    • Head Length (Internet header Length,ihl): refers to the length of the IP packet header.

    • Type of service ToS: Used to flag the level of service that IP packets expect to receive, often in QoS (quality of service quality).

    • Total length: The length of the entire IP packet, including the data section.

    • Identity (identification): uniquely identifies each IP packet sent by the host. Typically, each packet is sent with a value of 1.

    • Time to Live TTL: Sets the number of routers that a packet can pass through. Once a router is passed, the TTL value is reduced by 1, and when the value of the field is 0 o'clock, the packet is discarded.

    • Protocol (PROTOCOL): Identifies the upper layer protocol that the data sent within the packet belongs to, and IP uses the protocol number to differentiate the upper layer protocol. The protocol number for the TCP protocol is 6,UDP protocol number 17.

    • Header checksum (head Checksum): The checksum of the IP header to check the integrity of the packet header.

Source Address and Destination address: The IP address of the source node and destination node that identifies the packet, respectively.



IP Address and address mapping

IP address format and presentation methods

Devices connected to the Internet must have a globally unique IP address. The IP address length is binary 32 bits, usually in dotted decimal notation, where each IP address is represented as 4 decimal integers separated by a decimal point, and each integer corresponds to one byte, such as 192.168.5.123.

The IP address is not related to the link type, device hardware, but is assigned by the Administrator and is therefore also referred to as the logical address (Logical addresses). Each host can have multiple network interface cards, or it can have multiple IP addresses at the same time. Routers can be viewed as such hosts, but each IP interface must be in a different IP network, that is, the IP addresses of each interface are in separate IP segments.

Since there is theoretically a total of 232IP addresses, which is about 4.3 billion IP addresses, it is almost impossible for each router to store the routing information for each node on the Internet. To facilitate routing, address assignment, and administrative maintenance, IP addresses are structured in two levels, i.e. the IP address consists of two parts:

    • Network number (Network-number): used to differentiate between different IP networks, that is, the IP network segment to which the IP address belongs. The IP addresses of all devices in a network have the same network number.

    • Host number (Host-number): Used to identify an IP node within the network. Within a network segment, the host number is unique.

In this way, routers only need to store the routing information for each network segment.

IP Address Classification

    • The first eight-bit segment (octet) of Class A IP address starts with 0. The network number for Class A addresses is the first eight-bit segment, and the network number is 1~126 (127 is reserved for it). The host number of the Class A address is followed by three eight-bit segments and 24 bits of work. Class A addresses range from 1.0.0.0~126.255.255.255, with 224 Class A addresses per Class A network.

    • The first eight-bit segment of class B IP addresses starts with 10. The network number for Class B addresses is the first two eight-bit segments, and the first eight-bit segment of the network number is a value of 128! 191. The host number of Class B addresses is followed by two eight-bit segment workers 16 bits. Class B addresses range from 128.0.0.0~191.255.255.255, and each Class B network has 216 Class B addresses.

    • The first eight-bit segment of a class C IP address begins with 110. The network number for the Class C address is the first three eight-bit segments, and the first eight-bit segment of the network number is a eight-bit segment with a total of 8 bits after the host number of the 192~223.C class address. Class C addresses range from 192.0.0.0~223.255.255.255, and each Class C network has 28 = 256 Class C addresses.

    • Class D addresses the first eight-bit segment begins with 1110, so the first eight-bit segment of the class-D address has a value of 224~239.D class address, which is typically a multicast address.

    • Class E address the first eight-bit segment begins with 11110 and is reserved for research.

      Special IP Address






Fifth Chapter IP Fundamentals

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.