当前位置:网站首页>Network layer: IP protocol
Network layer: IP protocol
2022-06-22 06:42:00 【FIappy Brid】
ip Protocol related concepts
- host : Equipped with ip Address , But the device that does not perform route control !
- Router : Equipped with ip Address , And can do their best to control the route !
- node : Host and router !
Form of agreement
- 4 Bit version number (version): instructions ip Version of protocol , about IPv4 Namely 4,IPv6 Namely 6!
- 4 Bit head length (header length) : IP The length of the head is 32bit, That is to say length*4 Bytes of ,4bit The maximum length of the representation of is 15, therefore ip The maximum length of the head is 60 byte !
- 8 Bit service type (Type Of Service): 3 Bit priority field ( Have been abandoned ),4 position TOS Field , and 1 Bit reserved field ( Must be set to 0).
- TOS: 4 Bits denote respectively minimum delay , Maximum throughput , The most reliable , Minimum cost . These four conflict with each other , Only one... Can be chosen !
- 16 Bit total length : IP How many bytes does the datagram occupy as a whole !
- 16 Bit mark (id): It uniquely identifies the message sent by the host . If IP Messages are fragmented at the data link layer , So every piece of id It's the same !
- 3 Bit flag field : The first one is reserved , The second is 1 Indicates that fragmentation is prohibited ( At this time, if the message length exceeds MTU ,IP The module will discard the message ), The third means " More pieces ", If IP The message is fragmented , The third position mark of the last partition is 1 End of expression , Others are set to 0!
- 13 Bit slice offset (frameagement offset): It's the shards relative to the original IP Offset at the beginning of the message .
- 8 Bit lifetime (Time to Live TTL): The maximum number of message hops when datagram arrives at destination . The initial value is 64, Every time we go through a route ,TTL -= 1, Down to 0 It hasn't arrived yet , Then discard it . This field is mainly used to prevent routing loops !
- 8 Bit agreement : Indicates the type of upper layer protocol !
- 16 Bit header checksum : Use CRC Painstaking verification , To identify if the head is damaged !
- 32 Bit source address ,32 Bit destination address : Indicates the sender and receiver !
Segment division
IP The address is divided into two parts , Network number and host number
- network number : Ensure that two interconnected network segments have different identifications !
- Host number : Ensure that in the same network segment , Hosts have the same network number , But the unused host must have a different host number !
- Different subnets put together hosts with the same network number !
- If you add a host to the subnet , Then the network number of this host is consistent with that of this subnet , But the host number cannot be the same as other hosts in the subnet !
- DHCP : It can assign to new hosts in the subnet IP Address , Avoid the trouble of manual management !
- Subnet mask : Used to distinguish network number and host number , Usually 32 Positive integer , take IP The address and subnet mask are bitwise AND , The result is the network number !
- special IP :
- take IP All host addresses in the address are set to 0, It becomes a network number , Represents a local area network !
- take IP All host addresses in the address are set to 1, It becomes a broadcast address , It is used to send datagrams to all hosts connected to each other in the same link !
- 127.* Of IP Address is used for local loopback test , Commonly used 127.0.0.1!
private IP and Public network IP
If a local area network is set up within an organization ,IP Address is only used for LAN communication , Instead of connecting directly to Internet On , Use any IP The address can be , however RFC1918 It specifies the private use of the local king of components IP Address :
- 10.* The first eight digits are network numbers , common 167772176 An address !
- 172.16. To 172.31. front 12 Bit is the network number , common 1048576 An address !
- 192.168.* , front 16 Bit is the network number , common 655535 An address , Included in this scope , Are called private IP , The rest are called public networks IP( overall situation IP)!
- One router can be configured with two IP Address , One is WAN Oral IP , One is LAN Oral IP( subnet IP)!
- Router LAN Port connected host , All belong to the subnet of the current router !
- Different routers , subnet IP It's all the same ( Usually 192.168.1.1) . Hosts in the subnet IP Can't repeat , But between subnets IP It can be repeated !
- Every home router , In fact, it is also a node in the router subnet of the operator . Such an operator router may have many levels , The outermost operator router WAN mouth IP It's a public network IP 了 !
- When the host in the subnet needs to communicate with the external network , The router will IP The first IP Address conversion ( Replace with WAN Oral IP), In this way, replace... Step by step , In the final packet IP The address becomes the public network IP. This technology is called NAT(Network Address Translation , Network address translation ).
route
Concept : Find a way to the destination in the complex network structure !
IP The transmission process of a packet :
- When IP Data packets , When you reach the router , The router will check the destination first IP!
- The router decides that the packet can be sent directly to the target host , Or send it to the next router !
- Repeat the above steps , Until the end is achieved IP Address !
边栏推荐
- [5g NR] ng interface
- iframe框架,,原生js路由
- Linux link sqlserver, offline installation
- Chrome install driver
- [5g NR] mobile phone ID number IMEI and imeisv
- C技能树评测——用户至上做精品
- Data security practice guide - data collection security practice - data classification and classification
- 5g terminal identification Supi, suci and IMSI analysis
- 【M32】单片机 Code、RO Data、RW Data、ZI Data 简单解读
- Geoswath plus technology and data acquisition and processing
猜你喜欢

【OpenAirInterface5g】高层模块接口及itti实体线程创建

【5G NR】NGAP协议之NG Setup

SQL 注入漏洞(十)二次注入

Introduction to PMOD interface of kv260

New GDI functions and functions introduced in MiniGUl version 1.1.0 (II)

Surfer grid file clipping

Class load memory analysis

Py之scorecardpy:scorecardpy的简介、安装、使用方法之详细攻略

Common auxiliary classes - (key)

SQL 注入漏洞(十一)宽字节注入
随机推荐
[php]tp6 cli mode to create tp6 and multi application configurations and common problems
【M32】单片机 svn 设置忽略文件
Pytest data parameterization & data driven
六月集训(第22天) —— 有序集合
关于solidity的delegatecall的坑
[write CPU by yourself] implementation of exception related instructions
Performance comparison and analysis
Cactus Song - online operation (5)
[openairinterface5g] project directory structure
[rust notes] 01 basic types
【5G NR】NGAP协议之NG Setup
The song of cactus - marching into to C live broadcast (2)
Tp6 links to sqlserver, PHP links to sqlserver, and Linux offline installation and deployment
BlockingQueue four sets of APIs
Test ofnatural clusters via s-dbscan a self tuning version of DBSCAN
OpenGL - Draw Triangle
SQL injection vulnerability (x) secondary injection
【OpenAirInterface5g】RRC NR解析(一)
Data security practice guide - data collection security management
Bathymetry along Jamaica coast based on Satellite Sounding