当前位置:网站首页>组播和广播的知识点梳理
组播和广播的知识点梳理
2022-07-06 04:49:00 【拉普拉强】
组播的作用
组播的优点:
- 将数据包交付至多个目的地址
- 客户端向服务器请求,但是无需知道服务器地址,适用于客户端对网络环境知之甚少的场景,一个典型的应用是DHCP
- 减少广播的开销,广播会发送到局域网中所有的主机,沿着协议栈直到传输层发现目的端口上没有进程才会返回ICMP差错报文,这样消耗很大,使用组播代替后,不相关的主机,在网口上就把这个报文丢弃了,减少了后续协议栈的开销
组播的缺点:
- 实现起来比较复杂
任源组播和特定源组播
- 任源组播ASM
任源组播指的是组播的接收方不关注组播的发送方是什么地址,只要发来的,我都接收。
- 特定源组播SSM
接收方对发送方的身份敏感,只有在指定列表中的发送方发出的报文,接收方才接收。现在特定源组播用的比较多
组播地址和MAC地址之间的映射关系
广播地址对应的MAC地址固定是全f,组播地址也有其对应的MAC地址,只是这个地址不固定,和组播地址有关系。
IPv4组播和MAC地址的映射
步骤:
- MAC地址一共48位,分成前24位+1位替换位+后23位
- 前24位固定是01:00:5e
- 后23位取组播地址的后23位
由于组播地址范围是224.0.0.0-239.255.255.255,一共有228个地址,MAC地址只取后23位,因此每25=32个组播IP地址,共享一个组播MAC地址
IPv6组播和MAC地址的映射
步骤:
- MAC地址前16位固定33:33
- MAC地址后32位取IPv6组播地址的后32位
由于IPv6组播地址前16位固定,后112位可以任意,因此有2^80个网络层地址共享一个链路层地址。
查看网口对应的组播组
Linux下通过以下命令查看网口对应的组播组:
[[email protected] ~]# netstat -gn
IPv6/IPv4 Group Memberships
Interface RefCnt Group
--------------- ------ ---------------------
lo 1 224.0.0.1
enp175s0f0 1 224.0.0.1
virbr1 1 224.0.0.1
224.0.0.1是所有主机的所有网口默认都加入的一个组播地址,这就意味着,目的地址为该地址的报文,会被这个网口接收。可以看到,这个地址可以ping通。
主机对组播地址的过滤
组播报文经过交换机之后,会被泛洪发送VLAN内部的每一台主机。主机进一步对组播报文进行过滤。
首先是网口的过滤:网口默认会接收MAC地址为本网口地址的报文和广播报文,网口接收组播报文的情况则不一样,网口过滤有两种实现方式:
- 在网口上维护主机感兴趣的组播地址对应的HASH值,当报文的目的地址在这些HASH值之中,就把报文交给协议栈,否则就丢弃
- 在网口上维护一张组播表,当报文的目的地址在这个表中,就把报文交给协议栈。
NIC对组播地址过滤之后,报文进入协议栈,协议栈会进一步对报文进行过滤。
边栏推荐
- 几种RS485隔离通讯的方案介绍
- NPM command -- install dependent packages -- Usage / explanation
- Zynq learning notes (3) - partial reconfiguration
- Dry goods collection | Vulkan game engine video tutorial
- [detailed steps of FreeRTOS shift value for the first time]
- 图论的扩展
- Application of Flody
- Vulnerability discovery - vulnerability probe type utilization and repair of web applications
- The most detailed and comprehensive update content and all functions of guitar pro 8.0
- Postman管理测试用例
猜你喜欢
Basic explanation of turtle module - draw curve
Visio draws Tai Chi
[lgr-109] Luogu may race II & windy round 6
ETCD数据库源码分析——etcdserver bootstrap初始化存储
Uva1592 Database
Introduction of several RS485 isolated communication schemes
Is the mode of education together - on campus + off campus reliable
Ue5 small knowledge points to enable the setting of lumen
程序员在互联网行业的地位 | 每日趣闻
[FreeRTOS interrupt experiment]
随机推荐
SharedPreferences source code analysis
[HBZ sharing] how to locate slow queries in cloud database
比尔·盖茨晒18岁个人简历,48年前期望年薪1.2万美元
Request (request object) and response (response object)
On the solution of es8316's audio burst
CADD course learning (8) -- virtual screening of Compound Library
ue5 小知识点 开启lumen的设置
Can CDC pull the Oracle table in full
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
集合详解之 Map + 面试题
Finance online homework
SQL注入漏洞(MSSQL注入)
What should the project manager do if there is something wrong with team collaboration?
Why does MySQL need two-phase commit
Excellent PM must experience these three levels of transformation!
树莓派3.5寸屏幕白屏显示连接
程序员在互联网行业的地位 | 每日趣闻
Upload nestjs configuration files, configure the use of middleware and pipelines
Extension of graph theory
CADD course learning (7) -- Simulation of target and small molecule interaction (flexible docking autodock)