IP race-IP, ARP, RIP and BGP protocols (1)

Source: Internet
Author: User

IP race-IP, ARP, RIP and BGP protocols (1)

Network layer is the most important layer to implement the internet. At the network layer, each LAN is connected to each other based on the IP protocol and eventually forms a global Internet. Higher-level protocols, whether TCP or UDP, must pass information through IP packets (datams) at the network layer. The operating system also provides sockets at this layer, allowing you to directly operate the IP package.

IP packets are information that complies with the IP protocol (that is, the 0/1 sequence. An IP packet is divided into two parts: header and Data. The data part is the information to be transmitted, and the header is the information to be attached for transmission (similar to the Ethernet frame header function, if the frame is unfamiliar, see the small speaker article ).

IP package format

The IP protocol can be divided into IPv4 and IPv6. IPv6 is an improved version used to replace the IPv4 protocol in the future. For the purpose of this article, we can ignore the difference between the two for the moment. We only use IPv4 as an example. Below is the IPv4 format

We fold the entire IPv4 packet according to 4 bytes for better display.

Similar to frames, the IP packet header has multiple regions. We focus on the source address and destination address in red ). They are all IP addresses. The IPv4 address is 4 bytes in length (that is, 32 bits ). We usually divide IPv4 addresses into four decimal numbers, with each number ranging from 0 to 255. For example, 192.0.0.1 is an IP address. The address is written in the binary format in the IP packet header.

An IP address is a global address that identifies "Community" (LAN) and "House" (host ). This is achieved by classifying IP addresses.

Each 32-bit IP address is divided into two parts: the first part is used to distinguish the LAN, and the second part is used to distinguish the host of the LAN. The Subnet Mask (Subnet Mask) tells us the dividing line between the two parts. For example, 255.0.0.0 (eight digits 1 and 24 digits 0) indicates that the first eight digits are used to distinguish the LAN, the last 24 bits are used to differentiate hosts. As classification A, B, and C have been defined, when an IP address belongs to the scope of Class B, we know that the first 16 bits and the last 16 bits represent the LAN and host respectively.

Network adapter and Router

According to the Postmaster and post office, IP addresses are assigned to the "zip code" of each house (computer ". However, this statement is not accurate. The IP address actually identifies the NIC (Network Interface Card ). A network adapter is a hardware of a computer. After receiving network information, it delivers the information to the computer (processor/memory ). When the computer needs to send information, it also needs to be sent through the NIC. A computer may have more than one network card, for example, an Ethernet card and a Wi-Fi network card in a notebook. When receiving or sending information, the computer must first decide which network card to use.

NIC

A router is actually a dedicated computer with multiple NICs. It connects the network card to different networks, which forms the post office mentioned in the postmaster and post office. For example, a vro in the middle has two NICs with the addresses 199.165.145.17 and 199.165.146.3 respectively. They are connected to two networks: 199.165.145 and 199.165.146.

IP packet transmission

The transmission of an IP packet must pass through the router. Each host and route has a routing table ). The route table specifies the route for the IP address of the destination to be sent. It's like a road sign. if the address is "Tokyo", turn to the left. If the address is "Sydney", turn to the right.

A real world routing table


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.