TCP/IP Volume One----------IPs: Internet Protocol

Source: Internet
Author: User

3.1 Introduction

All TCP, UDP, ICMP, and IGMP data are transmitted in an IP datagram format.

IP is an unreliable protocol, that is, it does not guarantee that IP datagrams will reach their destination successfully. The reliability of any requirement is accomplished by its upper-layer protocol.

IP is not connected, that is, IP does not maintain any status information about subsequent datagrams.

The processing of each IP datagram is independent of each other, so IP datagrams can be received in the order they are sent.


3.2 IP Header
format of IP datagram:
       
                   Figure 1 IP packet Header 1) version number: Currently 4, that is, IPV4 2) header length: Refers to the number of first station 32bit words, 4 bits, So the header is up to 60 bytes long. For IP datagram lengths that do not have an option value of 5 3) service type: A 3bit priority subfield (now ignored), a 4bit tos subfield and 1bit unused bit (requires 0). The TOS for the 4bit represent: minimum delay, maximum throughput, maximum reliability, and minimum cost. This 4bit can only have one position of 1bit, the other to be 0, if four bits are all set to 0, it is the General Service
                    &NB Sp               Figure 2   Service Type field recommended value
T Elnet and Rlogin are primarily used to transmit small amounts of interactive data, so the interaction application requires minimal latency.
4) Total length: The length of the entire IP datagram, that is, the header plus data, so the length of the data section and the starting position can be calculated based on the item and the header length. The maximum length of an IP datagram is 65535, but it is usually fragmented at the data link layer. Another effect of the total length is that when the IP datagram is less than 46 bytes (the minimum length required by Ethernet) determines which is the true IP data based on the total length and which is the padding data 6) time-to-live TTL: The maximum number of routers the datagram can go through, usually with the source host set, each pass a route minus one. When it becomes 0, the message is discarded and the ICMP message is sent to notify the source host 7) Option: A variable-length optional information in the datagram, optional fields include                     Security and processing restrictions       record path     Timestamp     Loose source station routing   Strict source station routing  
the 32bit values of 4 bytes are transmitted in the following order: First, 0~7bit, followed by 8~15bit, then 16~23bit, and finally 24~31bit. This transmission order is called the bit endian byte order (big-endian). All binary integers in the TCP/IP header are required in this order when they are transmitted over the network, so it is also referred to as the network byte order. Machines that store binary integers in other forms, such as the little endian format (small end), need to convert the header into a network byte order before transmitting the data.
3.3 IP route selection

The IP layer can be configured as a function of a router, or it can be configured as a host

Difference: The host does not forward datagrams from one interface to another, and the router needs to forward datagrams. A host that contains router functions should never forward datagrams unless it is set to do so.


In a general system, IP can receive datagrams from TCP, UDP, ICMP, and IGMP (that is, locally generated datagrams) and send them, or receive datagrams (datagrams to be forwarded) from a network interface and send them. The IP layer has a routing table in memory. Each time a datagram is received, the table is searched. When the datagram comes from a network interface, IP first checks whether the destination IP address is one of the IP addresses of the native or IP broadcast address, and if so, submits the data to the Protocol module specified by the IP header Protocol field, if not, 1) if the IP layer is set as the function of the router, The datagram is forwarded, otherwise 2) the datagram is discarded


Routing Table entries:

  • Destination IP address. This can be either a full host address (not a 0 host number) or a network address (host number 0) to specify all hosts in the network.
  • The IP address of the next stop (next-hop route), or a directly connected network IP address
  • Sign. A flag indicates whether the destination IP address is a network address or a host address, and another flag indicates if the next station router is a true next-station router or a directly connected interface
  • Specify a network interface for the reported transmission


Router Features:

  • Search the routing table, locate the table entry that exactly matches the destination IP address, and send the message to the next station router or directly connected network interface specified by the table entry

Instead of assigning a router to each host, you typically assign a router to a network

3.4 Subnet Addressing

IP address is no longer a simple network number and a host good composition, but the host number is divided into a sub-network number and a host number

For external routers, the details of the internal network organization are hidden. Subnet is opaque to routers inside subnets



3.5 Subnet Mask

The subnet mask is used to distinguish how many bits are used for the subnet number and how many bits are used for the host number. A value of 1 is the bit left to the network, and 0 for the host

The subnet mask is typically used in hexadecimal notation



3.6 Special Case IP address



Figure 3 IP addresses for special cases

Where 0 means that all bits are 0;-1 means that all bits are 1;netid, SubnetID, and HostID are not all 0 or not all 1. The Subnet number column is empty to indicate that the address is not subnetting.


2.7 Ifconfig

The Ifconfig command is typically run at boot time and is used to configure each interface on the host



2.8 Netsat Command

Netsat-i Print out interface information-n Print out IP address






TCP/IP Volume One----------IPs: Internet Protocol

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.