unicast、broadcast、multicast的区别

在TDMoP的应用中,无论是传送时钟还是业务都有可能会碰到单播unicast、广播broadcast和组播multicast的问题,那么我们来看一个简单明了的对三者的解释:

以Ethernet网络架构而言,封包(Packet)在同一个subnet中传递时,以收方地址来判别该由那台主机接收;若在不同的subnet时,就要透过路由器(Router)根据收方地址,把这个packet送往收方主机所在的另一个subnet上。这就是Internet上最普遍、一对一方式传送的unicast。

另一类传输模式为一对多模式,分为broadcast和multicast 二种。当broadcast时,同一subnet上所有主机都会收到broadcastpacket。但是broadcast packet会被subnet router挡下来,不会传送到另一个subnet,否则网络就会被broadcast packet瘫痪了。

multicast是一对一个群组(group)的传输模式,不同于broadcast的是,同一subnet中只有参加multicast  group的主机才会收到封包,其它的主机就不会受到无谓的干扰,而且multicastpacket会透会mrouter(multicast router)的运作将封包送到另一个subnet的multicast group。另一方面,multicast和broadcast相同的特性是,不管接收封包的主机有几台,都只有一个数据流,也就是说,同一个subnet里,不管接收主机的数量,所需的频宽都是一样的。

 

广播地址

       所谓广播地址指同时向网上所有的主机发送报文,也就是说,不管物理网络特性如何,internet网支持广播传输。如136.78.255.255就是B类地址中的一个广播地址,你将信息送到此地址,就是将信息送给网络号为136.78的所有主机。
     广播地址(Broadcast Address):这是一个特殊地址,当数据包可以寻址到该地址时,可以帮助所有设备打开和处理信息。例如,MAC 地址,格式为 1xFFFFFFFF 是一种广播地址;IP 地址255.255.255.255是通用广播地址。任何设备都将打开寻址到广播地址的信息,并将它们传送到下一个工作站。

    很多局域网都定义了一个特殊的保留地址, 称为广播地址. 当信息头中目的地址域的内容为广播地址时, 该帧被局域网上所有计算机接收. 这个过程称为广播.

     专门用于同时向网络中所有工作站进行发送的一个地址。在使用TCP/IP 协议的网络中,主机标识段hostid 为全1 的IP 地址为广播地址,广播的分组传送给hostid 段所涉及的所有计算机。例如,对于10.1.1.0 (255.255.255.0 )网段,其广播地址为10.1.1.255 (255 即为2 进制的11111111 ),当发出一个目的地址为10.1.1.255 的分组(封包)时,它将被分发给该网段上的所有计算机。

     广播地址主要有两类  广播地址应用于网络内的所有主机

  1)有限广播

  它不被路由但会被送到相同物理网络段上的所有主机

  IP地址的网络字段主机字段全为1就是地址255.255.255.255

  2)直接广播

  网络广播会被路由,并会发送到专门网络上的每台主机

  IP地址的网络字段定义这个网络,主机字段通常全为1,如 192.168.10.255

四种I P广播地址:  受限的广播
  受限的广播地址是255.255.255.255。该地址用于主机配置过程中IP数据报的目的地址,此时,主机可能还不知道它所在网络的网络掩码,甚至连它的IP地址也不知道。在任何情况下,路由器都不转发目的地址为受限的广播地址的数据报,这样的数据报仅出现在本地网络中。
指向网络的广播指向子网的广播
指向子网的广播地址为主机号为全1且有特定子网号的地址。作为子网直接广播地址的IP地址需要了解子网的掩码。例如,如果路由器收到发往128.1.2.255的数据报,当B类网络128.1的子网掩码为255.255.255.0时,该地址就是指向子网的广播地址;但如果该子网的掩码为255.255.254.0,该地址就不是指向子网的广播地址。

指向所有子网的广播
指向所有子网的广播也需要了解目的网络的子网掩码,以便与指向网络的广播地址区分开。指向所有子网的广播地址的子网号及主机号为全1。例如,如果目的子网掩码为255.255.255.0,那么IP地址128.1.255.255是一个指向所有子网的广播地址。然而,如果网络没有划分子网,这就是一个指向网络的广播。

  子网掩码与广播地址

  合法的广播地址就是主机的网络地址加上最大的主机号。网络地址通过机器的ip地址与子网掩码按位与得出,我们以ip地址为10.78.202.175 ,子网掩码为255.255.255.0。

  为例来分析一下上面的几个概念

  首先将这两个东西换算成二进制代码

  ip地址:00001010.01001110.11001010.10101111

  子网掩码:11111111.11111111.11111111.00000000

  按位与之后得出网络地址:00001010.01001110.11001010.00000000

  十进制表示就是10.78.202.0

  这个网络地址理论上可以有256台主机,但是除去网络地址

  0和广播地址255之后,实际上只能有254台主机

  那么我们可以知道175就是你这台机器的主机号,

  广播地址就是最大的主机号,也就是10.78.202.255。

  有没有255.255.255.255可能成为一个合法的广播地址呢?

  答案是不可能因为0.0.0.0不是一个合法子网掩码。

指向网络的广播地址是主机号为全1的地址。A类网络广播地址为netid.255.255.255,其中netid为A类网络的网络号。一个路由器必须转发指向网络的广播,但它也必须有一个不进行转发的选择。
比如192.168.1.10这个IP,它的掩码应该是255.255.255.0 因为是个C类地址
将IP地址与掩码地址做与运算,得到的就是网络地址,255的部分不变 0的部分与后就变成了0,所以是192.168.1.0 而广播地址就是网络地址中的0部分变成255就是了,192.168.1.255 而网关就是你这台IP的机器要去访问其他所属的网络地址比如192.168.2.0这个网段必须交给的地址,注意网关的地址应该是和你的PC地址同一网段,一般是192.168.1.254或者192.168.1.1    

已知   IP地址为:202.112.14.137
   子网掩码:255.255.255.224
要求计算出这台主机所在的网络地址和广播地址是?
解:
第一步,确定网络位和主机位。
首先,把IP地址(202.112.14.137) 转换为二进制,
那么就是:11001010.01110000.00001110.10001001
然后,把子网掩码(255.255.255.224)也转换为二进制,即:
11111111.11111111.11111111.11100000
那么,它的网络位应该是蓝色部分:
11001010.01110000.00001110.10001001
它发生了借位。它的主机位应该是后五位,即红色部分。
到了这一步,已经很明白地看出,它的网络地址就是:
11001010.01110000.00001110.10000000
把主机位(后五位)全部清零,就得出了上面的网络地址。
换算为十进制就是:202.112.14.128
它的广播地址就是:把主机位的全0变为全1,即:
11001010.01110000.00001110.10011111
换算为十进制就是:202.112.14.159
多练习几次,牢记了十进制和二进制的换算规则,这题就不会难倒你了

1.172.16.10.33/27 中的/27也就是说子网掩码是255.255.255.224 即27个全1

2.从子网掩码255.255.255.252得出其网络位为30位,所以只有剩下的2位为主机位,主机位全零的为网络地址,主机位全1的为广播地址,剩余的主机号码为主机地址范围

3.公有地址(Public address)由Inter NIC(Internet Network Information Center 因特网信息中心)负责。这些IP地址分配给注册并向Inter NIC提出申请的组织机构。通过它直接访问因特网。
私有地址(Private address)属于非注册地址,专门为组织机构内部使用。私网IP地址是不可能直接用来跟WAN通信的,要么利用帧来进行通信(例如FR帧中继,HDLC,PPP)要么需要路由的NAT功能把私网地址转换成一个公网IP地址
以下列出留用的内部私有地址
A类 10.0.0.0--10.255.255.255
B类 172.16.0.0--172.31.255.255
C类 192.168.0.0--192.168.255.255

再根据CCNA中会出现的题目给大家举个例子:

首先,我们看一个考试中常见的题型:一个主机的IP地址是202.112.14.137,掩码是255.255.255.224,要求计算这个主机所在网络的网络地址和广播地址。

常规办法是把这个主机地址和子网掩码都换算成二进制数,两者进行逻辑与运算后即可得到网络地址。其实大家只要仔细想想,可以得到另一个方法:255.255.255.224的掩码所容纳的IP地址有256-224=32个(包括网络地址和广播地址),那么具有这种掩码的网络地址一定是32的倍数。而网络地址是子网IP地址的开始,广播地址是结束,可使用的主机地址在这个范围内,因此略小于137而又是32的倍数的只有128,所以得出网络地址是202.112.14.128。而广播地址就是下一个网络的网络地址减1。而下一个32的倍数是160,因此可以得到广播地址为202.112.14.159。

CCNA考试中,还有一种题型,要你根据每个网络的主机数量进行子网地址的规划和计算子网掩码。这也可按上述原则进行计算。比如一个子网有10台主机,那么对于这个子网需要的IP地址是:

10+1+1+1=13

注意:加的第一个1是指这个网络连接时所需的网关地址,接着的两个1分别是指网络地址和广播地址。因为13小于16(16等于2的4次方),所以主机位为4位。而

256-16=240

所以该子网掩码为255.255.255.240。

如果一个子网有14台主机,不少人常犯的错误是:依然分配具有16个地址空间的子网,而忘记了给网关分配地址。这样就错误了,因为:

14+1+1+1=17

17大于16,所以我们只能分配具有32个地址(32等于2的5次方)空间的子网。这时子网掩码为:255.255.255.224。

例1:下面例子IP地址为192·168·100·5 子网掩码是255·255·255·0。算出网络地址、广播地址、地址范围、主机数。

(一)分步骤计算

1) 将IP地址和子网掩码换算为二进制,子网掩码连续全1的是网络地址,后面的是主机地址。 虚线前为网络地址,虚线后为主机地址



2)IP地址和子网掩码进行与运算,结果是网络地址



3) 将上面的网络地址中的网络地址部分不变,主机地址变为全1,结果就是广播地址。



4) 地址范围就是含在本网段内的所有主机

网络地址+1即为第一个主机地址,广播地址-1即为最后一个主机地址,由此可以看出
地址范围是: 网络地址+1 至 广播地址-1
本例的网络范围是:192·168·100·1 至 192·168·100·254
也就是说下面的地址都是一个网段的。
192·168·100·1、192·168·100·2 。。。 192·168·100·20 。。。 192·168·100·111 。。。 192·168·100·254

5) 主机的数量

主机的数量=2二进制的主机位数-2

减2是因为主机不包括网络地址和广播地址。本例二进制的主机位数是8位。

主机的数量=28-2=254

(二)总体计算

我们把上边的例子合起来计算一下过程如下:



例2: IP地址为128·36·199·3 子网掩码是255·255·240·0。算出网络地址、广播地址、地址范围、主机数。

1) 将IP地址和子网掩码换算为二进制,子网掩码连续全1的是网络地址,后面的是主机地址, 虚线前为网络地址,虚线后为主机地址



2)IP地址和子网掩码进行与运算,结果是网络地址



3)将运算结果中的网络地址不变,主机地址变为1,结果就是广播地址。



4) 地址范围就是含在本网段内的所有主机

网络地址+1即为第一个主机地址,广播地址-1即为最后一个主机地址,由此可以看出

地址范围是: 网络地址+1 至 广播地址-1

本例的网络范围是:128·36·192·1 至 128·36·207·254

5) 主机的数量

主机的数量=2二进制位数的主机-2

主机的数量=212-2=4094

减2是因为主机不包括网络地址和广播地址。

 

 

Unicast

Unicast is the term used to describe communication where a piece of information is sent from one point to another point. In this case there is just one sender, and one receiver.

Unicast transmission, in which a packet is sent from a single source to a specified destination, is still the predominant form of transmission on LANs and within the Internet. All LANs (e.g. Ethernet) and IP networks support the unicast transfer mode, and most users are familiar with the standard unicast applications (e.g. http, smtp, ftp and telnet) which employ the TCP transport protocol.

Broadcast

Broadcast is the term used to describe communication where a piece of information is sent from one point to all other points. In this case there is just one sender, but the information is sent to all connected receivers.

Broadcast transmission is supported on most LANs (e.g. Ethernet), and may be used to send the same message to all computers on the LAN (e.g. the address resolution protocol (arp) uses this to send an address resolution query to all computers on a LAN). Network layer protocols (such as IPv4) also support a form of broadcast that allows the same packet to be sent to every system in a logical network (in IPv4 this consists of the IP network ID and an all 1's host number).

Multicast

Multicast is the term used to describe communication where a piece of information is sent from one or more points to a set of other points. In this case there is may be one or more senders, and the information is distributed to a set of receivers (theer may be no receivers, or any other number of receivers).

One example of an application which may use multicast is a video server sending out networked TV channels. Simultaneous delivery of high quality video to each of a large number of delivery platforms will exhaust the capability of even a high bandwidth network with a powerful video clip server. This poses a major salability issue for applications which required sustained high bandwidth. One way to significantly ease scaling to larger groups of clients is to employ multicast networking.

Multicasting is the networking technique of delivering the same packet simultaneously to a group of clients. IP multicast provides dynamic many-to-many connectivity between a set of senders (at least 1) and a group of receivers. The format of IP multicast packets is identical to that of unicast packets and is distinguished only by the use of a special class of destination address (class D IPv4 address) which denotes a specific multicast group. Since TCP supports only the unicast mode, multicast applications must use the UDP transport protocol.

Unlike broadcast transmission (which is used on some local area networks), multicast clients receive a stream of packets only if they have previously elect to do so (by joining the specific multicast group address). Membership of a group is dynamic and controlled by the receivers (in turn informed by the local client applications). The routers in a multicast network learn which sub-networks have active clients for each multicast group and attempt to minimise the transmission of packets across parts of the network for which there are no active clients.

The multicast mode is useful if a group of clients require a common set of data at the same time, or when the clients are able to receive and store (cache) common data until needed. Where there is a common need for the same data required by a group of clients, multicast transmission may provide significant bandwidth savings (up to 1/N of the bandwidth compared to N separate unicast clients).

The majority of installed LANs (e.g. Ethernet) are able to support the multicast transmission mode. Shared LANs (using hubs/repeaters) inherently support multicast, since all packets reach all network interface cards connected to the LAN. The earliest LAN network interface cards had no specific support for multicast and introduced a big performance penalty by forcing the adaptor to receive all packets (promiscuous mode) and perform software filtering to remove all unwanted packets. Most modern network interface cards implement a set of multicast filters, relieving the host of the burden of performing excessive software filtering.

Ethernet MAC Address

The Ethernet network uses two hardware addresses which identify the source and destination of each frame sent by the Ethernet. The MAC destination address (all 1 s) is used to identify a broadcast packet (sent to all connected computers in a broadcast domain) or a multicast packet (lsb of 1st byte=1) (received by a selected group of computers).

The hardware address is also known as the Medium Access Control (MAC) address, in reference to the IEEE 802.x series of standards that define Ethernet. Each computernetwork interface card is allocated a globally unique 6 byte address when the factory manufactures the card (stored in a PROM). This is the normal source address used by an interface. A computer sends all packets which it creates with its own hardware source address, and receives all packets which match its hardware address or the broadcast address. When configured to use multicast, a selection of multicast hardware addresses may also be received.

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Part I Introduction 1 1 History of Wireless Networks 3 1.1 Introduction 3 1.2 Different Wireless Networks 4 1.3 Conclusion 14 2 Wireless Transmission Fundamentals 17 2.1 Wireless Channels 17 2.2 The Wireless Communication Graph 21 2.3 Power Assignment and Topology Control 23 2.4 The Wireless Interference Graph 28 2.5 Related Graph Problems and Geometry Concepts 32 2.6 Energy-Consumption Models 35 2.7 Mobility Models 38 2.8 Conclusion 41 Part II Wireless MACs 45 3 Wireless Medium-Access Control Protocols 47 3.1 Introduction 47 3.2 IEEE 802.11 Architecture and Protocols 49 3.3 WiMAX 60 3.4 Bluetooth 61 3.5 MAC Protocols for Wireless Sensor Networks 63 3.6 Conclusion 69 4 TDMA Channel Assignment 71 4.1 Introduction 71 4.2 System Model and Assumptions 73 4.3 Centralized Scheduling 75 4.4 Distributed Algorithms 85 4.5 Weighted Coloring and Schedulable Flows 90 4.6 Further Reading 94 4.7 Conclusion and Remarks 96 5 Spectrum Channel Assignment 99 5.1 Introduction 99 5.2 Network System Model 101 5.3 List-Coloring for Access Networks 102 5.4 List-Coloring for Ad Hoc Networks 112 5.5 Transition Phenomena on Channel Availability 114 5.6 Further Reading 116 5.7 Conclusion and Remarks 118 6 CDMA Code Channel Assignment 120 6.1 Introduction 120 6.2 System Model and Assumptions 123 6.3 Throughput and Bottleneck of General Graphs 126 6.4 Approximation Algorithms for Interference Graphs 129 6.5 Maximum Weighted Independent Set for a General Wireless Network Model 136 6.6 Further Reading 148 6.7 Conclusion and Remarks 150 Part III Topology Control and Clustering 153 7 Clustering and Network Backbone 155 7.1 Introduction 155 7.2 Network Models and Problem Formulation 155 7.3 Centralized Algorithms for a Connected Dominating Set 157 7.4 Message Lower Bound for Distributed-Backbone Construction 161 7.5 Some Backbone-Formation Heuristics 163 7.6 Efficient Distributed-Nontrivial-Backbone-Formation Method 166 7.7 Efficient Distributed-Backbone-Formation Method 170 7.8 Linear-Programming-Based Approaches 179 7.9 Geometry-Position-Based Approaches 184 7.10 Further Reading 186 7.11 Conclusion and Remarks 187 8 Weighted Network Backbone 190 8.1 Introduction 190 8.2 Study of Typical Methods 191 8.3 Centralized Low-Cost Backbone-Formation Algorithms 193 8.4 Efficient Distributed Low-Cost Backbone-Formation Algorithms 194 8.5 Performance Guarantee 197 8.6 Discussion 205 8.7 Further Reading 209 8.8 Conclusion and Remarks 211 9 Topology Control with Flat Structures 213 9.1 Introduction 213 9.2 Current State of Knowledge 219 9.3 Planar Structures 224 9.4 Bounded-Degree Spanner and Yao’s Family 228 9.5 Bounded-Degree Planar Spanner 231 9.6 Low-Weighted Structures 233 9.7 A Unified Structure: Energy Efficiency for Unicast and Broadcast 238 9.8 Spanners for Heterogeneous Networks 250 9.9 Fault-Tolerant Structures 259 9.10 Other Spanners 266 9.11 Conclusion and Remarks 267 10 Power Assignment 270 10.1 Introduction 270 10.2 Power Assignment for Connectivity 273 10.3 Power Assignment for Routing 280 10.4 Further Reading 284 10.5 Conclusion and Remarks 285 11 Critical Transmission Ranges for Connectivity 289 11.1 Introduction 289 11.2 Preliminaries 292 11.3 Critical Range for Connectivity 293 11.4 Critical Range for k-Connectivity 296 11.5 Connectivity with Bernoulli Nodes 301 11.6 Practical Performances 304 11.7 Further Reading 307 11.8 Conclusion and Remarks 310 12 Other Transition Phenomena 313 12.1 Introduction 313 12.2 Critical Node Degree for Connectivity 313 12.3 Critical Range for Connectivity in Sparse Networks 315 12.4 Critical Range for Connectivity for Mobile Networks 316 12.5 Critical Sensing Range for Coverage 320 12.6 Critical Range for Successful Routing 322 12.7 Further Reading 330 12.8 Conclusion and Remarks 331 Part IV Wireless Network Routing Protocols 333 13 Energy-Efficient Unicast Routing 335 13.1 Introduction 335 13.2 Proactive Approaches 336 13.3 Reactive Approaches 340 13.4 Geographic Approaches 347 13.5 Clustering and Hierarchical Routing 361 13.6 Further Reading 364 13.7 Conclusion and Remarks 365 14 Energy-Efficient Broadcast/Multicast Routing 369 14.1 Introduction 369 14.2 Centralized Methods 374 14.3 Efficient Distributed or Localized Methods 380 14.4 Scheduling Active and Sleep Periods 392 14.5 Energy-Efficient Multicast 394 14.6 Further Reading 398 14.7 Conclusion and Remarks 399 15 Routing with Selfish Terminals 402 15.1 Introduction 402 15.2 Preliminaries and Network Model 403 15.3 Truthful Payment Schemes for Multicast 408 15.4 Sharing Multicast Costs or Payments Among Receivers 416 15.5 Existence of Truthful Payment Scheme 431 15.6 Further Reading 433 15.7 Conclusion and Remarks 436 16 Joint Routing, Channel Assignment, and Link Scheduling 440 16.1 Introduction 440 16.2 System Model and Assumptions 441 16.3 Problem Formulation for Cross-Layer Optimization 444 16.4 Efficient Link, Channel Scheduling 449 16.5 Further Reading 455 16.6 Conclusion 458 Part V Other Issues 461 17 Localization and Location Tracking 463 17.1 Introduction 463 17.2 Available Information 465 17.3 Computational Complexity of Sensor Network Localization 470 17.4 Progressive Localization Methods 476 17.5 Network-Wide Localization Methods 482 17.6 Target Tracking and Classification 485 17.7 Experimental Location and Tracking Systems 498 17.8 Conclusion and Remarks 500 18 Performance Limitations of Random Wireless Ad Hoc Networks 503 18.1 Introduction 503 18.2 Capacity of Unicast for an Arbitrary Network 506 18.3 Capacity of Unicast for Randomly Deployed Networks 508 18.4 Capacity of Broadcast for an Arbitrary Network 510 18.5 Capacity of Broadcast for Randomly Deployed Networks 512 18.6 Further Reading 517 18.7 Conclusion and Remarks 518 19 Security of Wireless Ad Hoc Networks 521 19.1 Introduction 521 19.2 Cryptography Fundamentals 522 19.3 Key-Predistribution Protocols 536 19.4 Secure Routing Protocols 538 19.5 Further Reading 542 19.6 Conclusion and Remarks 543 Bibliography 547 Index 579

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值