当前位置:网站首页>IP datagram sending and forwarding process
IP datagram sending and forwarding process
2022-06-28 04:59:00 【Swarford】
Hosts in the same network can communicate directly ----- Direct delivery
Routers of different networks need routers to transit ---- Indirect delivery
Sending process :

host C To his own ip The address matches its own subnet mask , Be the host C Network address of ;
host C Then set the host F The network address of and its own subnet mask match Get the destination network address ;
Discover the host F Destination network address and C The same as your own will be delivered directly ; If it is not the same , The router is not required to forward packets for indirect delivery in the same network ;
host C Transmit the datagram to the router of the network , The router forwards the datagram to the host F
Forwarding process :
(1) First, you need to extract the destination address from the header of the datagram , Check Head check sum Is it wrong , If there is an error, discard the datagram and notify the host .
(2) Match the subnet mask of this router , See if it can be delivered directly . That is, whether the network where the destination address is located is directly connected to the router , If connected, it can be delivered directly , There is no need to forward through other routers . otherwise , execute 3.
(3) Check whether the routing table has a corresponding Specific host routing ( Host specific routes are used to control 、 Test network ), If yes, it will be forwarded to the next hop address specified by the specific host routing , Otherwise execution 4.
(4) Check to see if you have arrived The router of the destination network , If there is , Then forward according to the next hop address specified by the general route that meets the rules , Otherwise execution 5.
(5) If the routing table in the router is set to Default route , Then the packet is forwarded to the address indicated by the default route , Otherwise execution 6
(6) Discard the packet , And report forwarding failure
Be careful :
- Each router selects the next hop required by the target network according to the routing table ( The physical port number of the router or the next network address ), and ip After the packet arrives at the target network through multiple routes , Change to target LAN Through the link layer MAC Address is addressed by broadcast !(IP Address conversion to MAC Address , Stored in MAC In the head of the frame ) This can improve the efficiency of routing
- although ip Datagrams have complete sources ip Address and purpose ip Address , But the router only depends on The network number of the destination address Routing !
- Link layer in LAN , You can only see MAC Address . And forward by route ip In groups ,ip Packets are unpacked and repackaged by routers in each network ( Framing ), therefore MAC The address is constantly changing ! This also determines that it cannot be passed MAC Address cross network communication !
- Because routers interconnect multiple networks , So not only are there multiple ip Address , There are multiple hardware addresses
- No matter what protocol the network layer uses , When data frames are transmitted over the actual network , In the end, the hardware address must be used , So we need a way to accomplish ip Address to MAC Address mapping ----- Address resolution protocol ARP
ARP Used to solve a problem LAN Host in / The router ip Address and MAC Address mapping problem , If the host you are looking for is not on the same network as the source host , Through ARP Found at this LAN The hardware address of a router of , Then forward the packet to the router
Broadcast storm :
If the host A Send a broadcast datagram to each device in the network (ip All the host numbers are 1), namely ip The destination address of the datagram is the broadcast address ,
The router receives the ip The datagram is not forwarded after the datagram !
That is, the router isolates the broadcast domain
If the router forwards the broadcast datagram after receiving it , Will cause a huge broadcast storm , Serious waste of resources
Repeaters and hubs are at the physical layer , Neither conflict domain nor broadcast domain is isolated
Bridges and switches ( Multi port on bridge ) Working at the data link layer , You can isolate conflict domains , Can't isolate broadcast domain
Routers work on the network layer , Isolate the conflict domain , Also isolate the broadcast domain
Routers do not provide reliable transmission !
边栏推荐
- 通过例子学习Rust
- Congratulations to myself, official account has more than ten thousand fans
- Huawei's 9-year experience as a software testing director
- IP数据报的发送和转发过程
- 活性染料研究:Lumiprobe AF594 NHS 酯,5-异构体
- 短视频本地生活版块成为热门,如何把握新的风口机遇?
- 乔布斯在斯坦福大学的演讲稿——Follow your heart
- A doctor's 22 years in Huawei (full of dry goods)
- Principle and implementation of SSD for target detection
- Find an SQL that can judge the data in the table and only fill in the SQL that is not overwritten
猜你喜欢

DH parameters of robotics and derivation using MATLAB symbolic operation

Role of native keyword
![[csp-j2020] excellent splitting](/img/05/90f9cf71791b3cdc37073eaf5db989.png)
[csp-j2020] excellent splitting

Extjs图书管理系统源码 智能化图书管理系统源码

Play with double pointer

The short video local life section has become popular. How to grasp the new opportunities?

电源插座是如何传输电的?困扰小伙伴这么多年的简单问题

Generate QR code in wechat applet

Learning Tai Chi Maker - mqtt Chapter 2 (V) heartbeat mechanism

Sword finger offer 49 Ugly number (three finger needling technique)
随机推荐
Understanding the source of innovation II
Google Earth engine (GEE) - global flood database V1 (2000-2018)
Standard particle swarm optimization C language program
RxSwift --(1)创建一个项目
C语言中函数是什么?编程中的函数与数学中的函数区别?理解编程语言中的函数
Severe tire damage: the first rock band in the world to broadcast live on the Internet
Learning Tai Chi Maker - mqtt Chapter 2 (V) heartbeat mechanism
Feign通过自定义注解实现路径的转义
Feign implements path escape through custom annotations
BioVendor sRAGE Elisa试剂盒化学性质和技术研究
Meta universe standard forum established
Redis 的 最新windows 版本 5.0.14
2022年材料员-通用基础(材料员)操作证考试题库及答案
Flexible IP network test tool -- x-launch
2022年安全员-B证考试题库及答案
The short video local life section has become popular. How to grasp the new opportunities?
100+ data science interview questions and answers Summary - machine learning and deep learning
Unity out ref params
知识点滴 - 关于汉语学习的网络资源
使用class toplevel的messagebox时,窗口弹出问题。