当前位置:网站首页>组播和广播的知识点梳理
组播和广播的知识点梳理
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对组播地址过滤之后,报文进入协议栈,协议栈会进一步对报文进行过滤。
边栏推荐
- Postman pre script - global variables and environment variables
- 驱动开发——HelloWDM驱动
- SQL injection vulnerability (MSSQL injection)
- 几种RS485隔离通讯的方案介绍
- Ue5 small knowledge freezerendering view rendered objects in the cone
- Postman管理测试用例
- Meet diverse needs: jetmade creates three one-stop development packages to help efficient development
- Application of Flody
- 2021 robocom world robot developer competition - undergraduate group (semi-finals)
- [NOIP2009 普及组] 分数线划定
猜你喜欢

Easyrecovery reliable and toll free data recovery computer software

Use sentinel to interface locally

View workflow

DMA use of stm32

ORM aggregate query and native database operation
![[Yu Yue education] reference materials of complex variable function and integral transformation of Northwestern Polytechnic University](/img/22/ead74bc121a64910ef6ef374cd029b.png)
[Yu Yue education] reference materials of complex variable function and integral transformation of Northwestern Polytechnic University

acwing周赛58

Extension of graph theory

Embedded development program framework
![[detailed steps of FreeRTOS shift value for the first time]](/img/73/a469eb2465bb2c5acaa4d018d3edd3.jpg)
[detailed steps of FreeRTOS shift value for the first time]
随机推荐
Postman pre script - global variables and environment variables
Tengine kernel parameters
饼干(考试版)
Redis 排查大 key 的4種方法,優化必備
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
Summary of redis AOF and RDB knowledge points
The most detailed and comprehensive update content and all functions of guitar pro 8.0
也算是學習中的小總結
[buuctf.reverse] 159_[watevrCTF 2019]Watshell
ISP learning (2)
web工程导入了mysql驱动jar包却无法加载到驱动的问题
SharedPreferences source code analysis
麥斯克電子IPO被終止:曾擬募資8億 河南資產是股東
L'introduction en bourse de MSK Electronics a pris fin: 800 millions de RMB d'actifs de Henan étaient des actionnaires
Why does MySQL need two-phase commit
Finance online homework
It is also a small summary in learning
The implementation of the maize negotiable digital warehouse receipt standard will speed up the asset digitization process of the industry
驱动开发——HelloWDM驱动
你需要知道的 TCP 三次握手