Network layer: IP protocol

Network layer: (3 messages) Computer network network layer_Put on straw sandals to travel blog-CSDN blog

Table of contents

Internet Protocol IP

        1. Virtual interconnection network

        2. Classified IP addresses

        3.IP address and hardware address


Internet Protocol IP

The IP here is the fourth version of the IP protocol, actually called IPv4. Newer is IPv6.

There are three protocols supporting the IP protocol:

  1. Address Resolution Protocol ARP
  2. Internet Control Message Protocol ICMP
  3. Internet Group Management Protocol IGMP

        1. Virtual interconnection network

                Networks vary greatly because no single network can suit the needs of all users. Therefore, the network needs to be connected through some intermediate devices.

                According to the level at which it is located, intermediate devices can be divided into the following four types:

                        1. What is used in the physical layer is called a transponder.

                        2. What is used in the data link layer is called a bridge or bridge.

                        3. What is used in the network layer is called a router.

                        4. What is used above the network layer is called a gateway.

                Using repeaters at the physical layer or bridges at the data link layer only enlarges a network. From a network layer perspective, this is still a network, not a network interconnection. Network interconnection is achieved through routers at the network layer.

                Network interconnections that all use the IP protocol are called virtual interconnection networks, which means that these networks that are different at the physical level appear to be a unified network at the network layer, also called an IP network. The current Internet uses the IP protocol and TCP protocol.

        2. Classified IP addresses

                IP 地址及其表示方法:IP 地址都是32位的二进制代码。为了提高可读性,我们常常把   32 位的 IP 地址中的每隔8位插入一个空格(但在机器中并没有这样的空格 )。为了便于人   们书写和记忆,常用其等效的十进制数字表示,并且在每段数字之间加上一个小数点。这就  叫作点分十进制记法(dotted decimal notation)。

                整个互联网就是一个单一的、抽象的网络。IP 地址就是给互联网上每一台主机或路由器的每一个接口分配一个全世界唯一的 32 位的标识符。

                IP 地址的编址方法经历了三个阶段:

                        1.分类的 IP 地址。

                        2.子网的划分。

                        3.构成超网。

                分类的 IP 地址就是讲 IP 地址划分为多个固定类,每一类地址由两个固定长度的字段组成。

                        1.第一个字段是网络号,标志主机所连接到的网络,一个网络号在整个互联网范围内是唯一的。

                        2.第二个字段是主机号,标志该主机(或路由器),一个主机号在该网络号所指明的网络范围内是唯一的。

        IP 地址 = {,},它既指明了主机接口,也指明了所在网络。

        分类的 IP 地址分为以下 5 类:

                1.A 类、B 类、C 类都是单播地址,是最常用的。

                2. Class is used for multicast (one-to-many communication).

                3. Class E addresses are reserved for future use.

The classification takes into account the differences between different networks. Some networks have many hosts, while others have few.

Unclassified IP addresses are now widely used for routing, and classified addresses are a thing of the past.

The IP address is 4 bytes with a total of 32 characters. Usually, what is displayed on the computer is the result of converting each byte into decimal, which is called dotted decimal method.

IP addresses have the following characteristics:

  1. Each IP address consists of two parts, the network number and the host number, and is a hierarchical address structure. This structure has several advantages
    1. The IP address management agency only allocates the network number when allocating the IP address, and the host number is allocated internally by the unit that obtains the network number.
    2. The router only forwards the packet based on the network number to which the destination host is connected, regardless of the host number. This greatly reduces the number of items in the routing table, reducing the storage space and search time of the routing table.
  2. An IP address identifies a host (or router) and an interface on a link. If a host is connected to two networks at the same time, it has two IP addresses.
    1. Every router is connected to at least two networks, so a router has at least two different IP addresses.
  3. In the Internet, a network refers to a collection of hosts with the same network number. Therefore, several LANs connected by repeaters or bridges are still one network.
  4. Within an IP address, all networks assigned a network number are equal, no matter how large or small the range.

        3.IP address and hardware address

Hardware address (also known as physical address, MAC address) is the address used by the data link layer and physical layer. The source address and destination address used when transmitting MAC frames are hardware addresses and are placed in the header of the MAC frame.

The IP address is an address used by the network layer and the layers above and is a logical address. Placed in the header of the IP datagram.

Below are three LANs connected together through two routers, and host H1 wants to communicate with host H2.

Because the router is connected to two LANs at the same time, it has two hardware addresses.

Notice:

  1. Only IP datagrams are visible on the Internet at the IP layer abstraction. Although the information has to be forwarded by routers R1 and R2, the source address and destination address in the IP header are always IP1 and IP2.
  2. Although the IP datagram header has a source address, the router only makes a selection based on the network number of the destination station's IP address.
  3. At the link layer of the LAN, only MAC frames are visible. When MAC frames are transmitted on different networks, the source address and destination address in the MAC frame header will change.
  4. The IP layer abstracts the Internet from the complex details of the underlying layers. As long as you are at the network layer, you can use unified, abstract IP addresses to study host-to-host communication.

おすすめ

転載: blog.csdn.net/qq_63032911/article/details/130539712