当前位置:网站首页>Tcp/ip protocol of network principle
Tcp/ip protocol of network principle
2022-07-18 17:37:00 【Pinellia and cool】
Catalog
Hop by hop network data transmission
Network hardware equipment and technology
host & Router :ARP Cache table +ARP Addressing
Network data transmission process
know IP Address
Concept :IP Address (Internet Protocol Address) Internet protocol address .
effect :IP The address is IP A uniform address format provided by the protocol , It assigns a logical address to every network and host on the Internet , In order to shield the difference of physical address .
form : network number + Host number
network number : Identify network segment , Ensure that the two network segments connected with each other have different identifications
Host number : Identify the host , Within the same network segment , Hosts have the same network number , But there must be a different host number ;
Ensure the ip The address is unique !
Subnet mask
In order to solve IP Address waste , The subnet mask is introduced to divide the subnet .
Format
Subnet mask format and IP The address is the same , Also a 32 The binary number of bits . On the left is the network bit , Use binary numbers “1” Express ,1 The number of is equal to the length of network bits ; On the right is the host bit , Use binary numbers “0” Express ,0 The number of is equal to the length of the host bit .
effect
Divide subnets : You can put A~C class IP Address , Again, it is divided into smaller networks
The divisions :16 Bit network number +1 Location net number +15 Bit host number (C class )
The subnet mask can be based on IP Address , Calculate the network number and host number
Calculate the network number : Subnet mask and IP Address and
Calculate host number : The subnet mask is reversed, and then it is combined with by bit
Judge whether it is the same network segment :
- Subnet mask + The source host ip= Source network segment
- WordNet mask + Purpose ip= Destination segment
The same is the same network segment , Different is not
know MAC Address
MAC Address , namely Media Access Control Address, The hardware physical address used to identify the network device .
ip Address and MAC Address
- IP The address describes the overall starting and ending point of the road , Is a logical network address for people to use .
- MAC The address describes the beginning and end of each interval on the road , That is, the beginning and end of each jump ; Is the network physical address used for network hardware devices .
Hop by hop network data transmission

The above figure is from the host B To host C The process of
Network nodes : Host or router
( The host and router have ip Address , Hubs and switches do not )
host : Equipped with IP Address , But devices that do not perform routing control
Router : Both equipped with IP Address , And routing control
Network hardware equipment and technology
A hub :
A hub is a network device that works at the physical layer , Any data sent to the hub , Simply copy and forward the data to all other ports .
Switch :
One was maintained internally mac Address translation table , Used to record mac Mapping relationship between address and port . Data sent , Use the above mapping relationship , Through purpose mac Find the port , Send data to the host connected to the port . If you can't find it , Just send a broadcast datagram , Returned by the corresponding host mac Address .
host
Send datagram , The sending end hosts need to be encapsulated from top to bottom according to the network hierarchy :

- Source IP And purpose IP It marks the beginning and end of the whole road
- Source MAC And purpose MAC Identifies the start and end of each jump
here , According to the sending end host ( The source host ) With the host at the receiving end ( Destination host ) Whether in the same network segment , To set the next hop device :
- When the source host and the destination host are in the same network segment , The next hop device is the destination host
- When the source host and the destination host are not in the same network segment , The source host cannot know where the destination host is , At this time, the next hop device will be set as the gateway device ( It's a router )
host & Router :ARP Cache table +ARP Addressing
First ,ARP It is a protocol between data link layer and network layer ;ARP The Agreement establishes IP Address and MAC Address mapping .
ARP agreement : Used by IP address MAC Address
ARP Cache table : Host or router , A set of data maintained internally ( similar hash surface , adopt IP look for MAC)
At the data link layer , Find the next hop device MAC Address process , be called APR Addressing
- Both the host and the router have a ARP Cache table : adopt IP The corresponding address can be found MAC Address .
- According to the of the next hop device IP Address , stay ARP The corresponding... Can be found in the cache table MAC Address , Then you can set the purpose MAC And send datagrams .
- If you can't find it , Then send ARP Broadcast datagram : Purpose MAC For broadcast address , Ask about the next hop device MAC Address .
Router : route +NAPT
Router has two main functions :
(1) gateway
The router acts as a gateway , It can be divided into public network and local area network , Some routers can also divide the LAN into multiple subnets ( Different segments )
- When dividing multiple subnets of LAN , You can go directly through ARP Addressing any host in the LAN .( The LAN here is the LAN composed of multiple subnets under the router ).
- When dividing public network and local area network , When the host in the LAN sends a datagram to the host in the public network , Need to be based on NAPT agreement , Connect the LAN to the host IP Address and port number , Convert to router public network IP And port number ( Refers to the port of the program running in the router )
There are multiple network cards in the router : At least one public network card + Multiple subnet cards
(2) route
So called routing , That is, in the complex network structure , Find a way to the end , Routing function in router , It's like planning a route .
NAPT agreement
Intranet ip+port Convert to Public network ip+port
Conflict domain
The hosts are connected through network devices ( A hub 、 Switch ) The physical port of 、 When the network cable is connected , Two hosts send datagrams at the same time , If there is a conflict , Then the network scope is a conflict domain (Collision Domain). The collision domain is also called collision domain in the physical layer .
After the hub receives the datagram , Is to simply copy datagrams 、 Forward to all other ports , If there are two datagrams to be forwarded at the same time , There will be conflicts . The whole hub , namely All ports of the hub are a conflict domain .
After the switch receives the datagram , Is to forward the datagram to a corresponding port : There is no conflict when two datagrams are forwarded to different ports at the same time , But when forwarding to one port at the same time, there is a conflict . namely The switch can split the conflict domain , After split , A port is a conflict domain .
Broadcast area
Broadcast refers to that the host in a network sends data to all other hosts in the network at the same time (IP、MAC Set the address to the broadcast address ), The range to which this data can be transmitted is the broadcast domain (Broadcast Domain). The broadcast domain is located at the data link layer .The hub receives a broadcast datagram , It's still a simple copy 、 Forward to all other ports , therefore All ports of the hub are a broadcast domain .
The switch receives a broadcast datagram , Will be forwarded to all other ports ; and Routers can isolate broadcast domains , That is, the broadcast domain will not spread beyond the router .
Network data transmission process
* Wan data transmission process
LAN data transmission process : Switch ( The same network segment in the LAN )
LAN data transmission process : Switch + Router ( Different network segments in LAN )
On the way , Every network node you pass ( Host or router ) Will be used separately before packaging .
边栏推荐
- 二 配置目标make menuconfig的执行过程分析
- PostgreSQL source code (10) xlog assembly
- “野指针”和大厂经典的动态内存错误笔试题
- ETCD数据库源码分析——etcdserver bootstrap去除v2store
- One week's wonderful content sharing (issue 12) repetition
- Pytest+allure custom report
- [actual combat] 1382- Yiwen owns your puppeter crawler application
- Competition of "four clouds"
- Basic permission management of Gerrit
- 终于入选专业领域内容排行榜第一了,这段时间没有白累,感谢CSDN官方平台,幸苦了。
猜你喜欢

如何通过客户价值分析让银行收入倍增

Chinese translation of zagayevsky's "try to praise this incomplete world"

爱立信以侵权为由要求禁售,苹果回返美国反诉,这一幕如此熟悉

W806 development board driver ov2640 reads JPEG pictures 1600x1200 resolution

国际NFT交易所排行榜前10名

生信周刊第36期

【论文阅读】Deep Transformer Q-Networks for Partially Observable Reinforcement Learning

Win11色温如何进行调整设置

HCIA-R&S自用笔记(9)数据转发过程、单播/多播/组播

作用域、构造器详解
随机推荐
五 其它目标和通用选项的介绍
uniapp video 视频未播放完成禁止拖拽进度条快进
【论文阅读】Deep Transformer Q-Networks for Partially Observable Reinforcement Learning
thymeleaf介绍与简单应用
Penetration test tool - MSF generates backdoor immunity
NJUPT 《信安数基》第 11 章解题攻略
Stc8h Development (XIV): I2C Drive rx8025t high precision Real time clock chip
Flink1.7 from installation to experience
Stc8h development (XIV): I2C drive rx8025t high-precision real-time clock chip
主进程 主线程和子线程 三者退出的关系
How should both parties bear the large amount of child support after divorce
如何解决8080端口被占用
户外LED显示屏应对炎热高温天气有妙招
The first China Digital Collection conference was successfully held
文件解析漏洞详解
污水排放监控,环保数采仪助力城市黑臭水体治理
exchange
Data Lake (11): Iceberg table data organization and query
【CVA估值训练营】如何快速读懂上市公司年报(第一讲)
一周精彩内容分享(第12期)重复