杂七杂八

Hub & Switch

Hub & Switch

最近更新时间: 2001/xx/xx

这些文章只是舍不得丢的数据,并不是什么需要特别阅读的!尤其是文章内容超级旧! 所以,大家看看就好!千万不要学喔!哈哈哈!


Just do it!  wrote in message
news:3gkAdc$Kn4@bbs.cynix.com.tw...
> ※ 引述《YBO.bbs@bbs.yzu.edu.tw (上班啦)》之铭言:
> > ※ 引述《Mjolnyr.bbs@BirdNest.infoX.Net (Francis Jan)》之铭言:
> > > 鬼扯蛋.
> > hub在多人链接时上网带宽是平均分配的
> > 但switch hub是看谁有需要才给他带宽
> > 也就是hub很像是广拨方式传递消息
> > 而switch hub是直接传到想要的那台主机
>
> 一般 HUB 与 Switch HUB,都是广播的呀,要不然..
> 网络芳邻怎么看得到,DHCP如何使用呢?
>
> 当然,supported VLAN 产品例外啰..
>
> 一般 HUB 与 Switch HUB 差别,说明一下,如有错误,
> 还望高人指点指点.. :P
>
> Hub 仅属于 Layer 1 product.
> Switch Hub 则属于 Layer 2 product.
>
> Switch Hub 比一般 Hub 多的功能,最少它要聪明地学习
> 每个 Port 对应的 Mac address。
>
> 假设 Switch Hub port 1 学到的 Mac address 为 00:10:B5:30:30:A9
> port 2 学到的 Mac address 为 00:10:C1:D3:E2:A2
> port 3 学到的 Mac address 为 00:10:B3:E3:A1:07
>
> Port 1 底下接的是 Linux,
> Port 2 底下接的是 Win98,
> Port 3 底下接的是 Router。
>
> 今天,假设您要从 Linux 通过 Router 连接上 Internet,那么首先送出
> ARP packages 问到 Router IP 所对应的 Mac address,然后 Linux 就
> 连接到 Router 所对应的 Mac address (00:10:B3:E3:A1:07) 做沟通。
>
> 其中,Switch HUB 已经得知 Linux 与 Router 的 Mac address,当 Linux
> 与 Router 做数据传输时,并不会将数据丢到 port 2 给 win98。假如您
> 想要在 Win98 上装 sniffer 之类的软件听取封包,那么您则听不到 Linux
> 与 Router 之间发送的封包。
>
> 这就是 Switch HUB 聪明的地方。
> 但是如果是 HUB,无论是这个线段网络上的任何数据,每个 Port 都收得到。
>
> 结论,Switch HUB,比 HUB 更有安全性,减少封包碰撞,传输更有效率。
>
> 欢迎大家不吝指教。
>


我喜欢看到这样的答案﹐也喜欢和这样的朋友讨论。

我们这里谈到的 switch 相信都是指 level 2 上面的吧﹐那么我们要知道 OSI level
2 layer 上面有什么标准才好理解。其中的 IEEE802.x 是应用最广的标准﹐而我们最
常见的 ethernet 则是使用 IEEE802.3 这个 MAC sublayer 标准﹐其上的 DLC
sublayer 802.2 就交给写 programing 的朋友帮忙解释一下 吧。

我们这里看看 IEEE802.3 是怎么运作的﹐其特性有哪些﹖

IEEE802.3 在 ethernet 上使用的传输技术﹐最普遍被采用的是 CSMA/CD﹐其实可以
拆开三个部份来了解﹕

1) CS (Carrier Sense)

发送设备要将信号送至传输媒体之前﹐首先要探测媒体是否已经存在 carrier﹐如果
有﹐则表示有其它设备在使用这个媒体进行其它的发送。然则﹐发送设备就不能向这
个媒体送出信号﹐而必须等到下次探测没有 carrier 的时候才能发送。这比较好理
解﹐也就是先抢先赢嘛﹐好比在课堂上发言﹐谁先举手说谁先说﹐如果已经有人在说
了﹐那就等。

2) MA (Mutiple Access)
在同一时间内﹐允许多个设备使用共享媒体(当然不能离开 CS 和 CD 的制约)。在
CSMA/CD 技术中﹐当发送设备顺利通过 CS 检测之后向媒体送出信号而没有发生
Collision 的话﹐所有分享着同一媒体的设备﹐都能收到这个信号。每一个设备都有
一个唯一的地址标识﹐我们通常称之为 MAC 地址﹔而信号在发送媒体中则是以 frame
的形式发送﹐每个 frame 都有一个 source 和一个 destination 地址栏。发送设备
将 frame 送至媒体上之后﹐只有被标识为 destination 的的设备﹐才会将信号 copy
下来﹐再往上层程序递送 (decapsulate)﹐而那些设备发现 destination 不是自己的
话﹐就单纯的不处理这个 frame (除非在 promiscuous 模式之下)。

不同的协定﹐对 MA 使用的不同﹐也会影响整体效率的运作﹐例如广播封包﹐那些以
FF:FF:FF:FF:FF:FF 为 MAC 地址的封包﹐switch 还是会送到所有机器上面的﹐因为
使用这个广播地址的 frame﹐每个接收设备都会将之 copy 下来进行 decapsulate 处
理。例如 Microsoft Network 的协定家族﹐其使用广播封包的比率是非常高的﹐就算
使用 L2 switch 对这样的广播也束手无策。只有利用 subnet 和 router 或更高
level 的 switch 才有效﹐但设置的复杂性和额外增加的交通﹐也是要另行评估的﹐
恐怕就超出目前的讨论范围了。

3) CD (Collision Detection)
前面的 CS 过程中﹐在理想的情况之下﹐所有分享着共同媒体的设备﹐都应该有机会
取得发送的机会。只是﹐电子设备的运作速度﹐远非我们人类所能感应的﹐这些运
作﹐每一秒钟可能有上万甚至百万次之多﹐例如 CAT 5 种类的网线﹐就能处理
350Mhz 或更高的发送频率。假如﹐当两个设备刚好在这百万分之一秒之内﹐同时做
CS 的动作﹐而又同时探测到媒体上没有 carrier﹐那这种情形之下﹐这两个设备可能
会同时对这媒体发送信号﹐这就是我们常说的 Collision (碰撞)了。如果当一个碰撞
发生了﹐就会在媒体上产生frequecy ripple 现象。当一个在线的设备侦测到
ripple ﹐它就会发出一个高频信号去清除所有其它信号。换句话说﹐这个信号同时告
诉所有设备﹐碰撞已经发生。这时候﹐每一个设备都会随机的等待一段时间再重新进
行 CS﹐如果连续的(非间断的)还是遇到 collision﹐那就按一定比例延迟随机等待时
候﹐总共可以进行16次尝试大家才会最终放弃。所以不难看出﹐如果在同一个
segment 上面﹐在线的设备越多﹐其发生 collision 的机会也越大。

事实上﹐除了 CSMA/CD 外﹐还有一个 CSMA/CA (CA = Collision Avoidance) 的技术
我们可以使用﹕发送端先向接收端送出 RTS(Request To Send) 封包﹐等收到 CTS
(Clear To Send) 回应后﹐才向媒体送出信号。AppleTalk 协定就是使用这种技术。
CA 和 CD 的分别﹐可以用过独木桥来比喻﹕用 CD 的时候﹐要过就过﹐过不了再来﹔
用 CA 的时候﹐会先派一个小厮探路﹐如果他通过了﹐然后您才施然而过。


好了﹐当您了解 CSMA/CD 这个协定之后﹐那再来看看 HUB 和 Switch 的分别吧﹕

HUB 单纯的是一个 repeater﹐当它从一个 port (和 TCP 协定的 port 不一样﹐这里
是指插网络线的接孔)接收信号进来之后﹐会将这个信号原原本本的送到所有其它
port 上﹐不管哪些 port 是接到哪一台机器。

而 switch 呢﹖它自己有一份 table﹐记录着哪个 port 接到哪些 MAC 地址设备上。
当信号从一个 port 进来之后﹐会检查这个 frame 的 destination 是哪个 MAC﹐然
后按 table 找到这个 MAC 对应的 port ﹐而仅将信号往这个 port 送﹐其它的 port
就不送了。

这样有什么好处﹖

先看看 CS 吧﹐当用 hub 的时候﹐所有 port 所连接到的设备都探测到 carrier﹐然
后就要等﹔而用 switch 呢﹖那些不是 destination 的设备﹐并没有探测到
carrier﹐也就无需再等﹐可以直接向媒体送出信号。当信号到达 switch 的时
候﹐switch 会先利用 cache 接收这个信号﹐然后进行 table 的比对﹐再向
destination 送出。如果 switch 的 cache 越大﹐CPU 处理能力越强﹐其效率也越
高﹐当然价钱也越贵。

再看 CD﹐因为大部份由设备送出的信号﹐都会先被 switch cache 起来﹐然后再经过
table 判断送出﹐那么 collision 的机会也大为的减少﹐由此﹐因 CD 而中断的发送
也就大为减少﹐相对的﹐所有设备的使用效率也大为提高。

至于 MA﹐相信不用多解释了吧﹖使用 swtich 还有一个好处﹕提高网络的安全性。如
果我们用 hub 来连接设备﹐因为 frame 会抵达所有机器﹐如果某人在其设备上装上
一个封包抓取软件﹐同时将网络卡的 promiscuous mode 打开﹐那就可以看到所有的
封包了﹔但如果用 switch 呢﹖只有被送到这台机器上的封包﹐才能被抓到。通常在
网络安全上面﹐安全性对于性能及便利性是成反比的﹕要增加安全性﹐就要牺牲性能
和便利性﹔要增加性能和便利性﹐就要牺牲安全性。而 switch﹐似乎是唯一打破这个
樊篱的网络设备了。

刚才我还看到有人将 Bridge 和 Switch 混为一谈了﹐我不知道该仁兄对 bridge 的
理解是怎样的﹖在下认为﹐bridge 的功能只有两个﹕filtering 和 forwarding﹔后
者是根据前者判断后才能发生。

使用 bridge 的时候﹐基本上将物理的连接切为两个 segment (或多个﹐视 bridge
界面而定)﹐然后﹐bridge 也会创建起自己的 table﹐分别将不同的 MAC 划分到不同
的 segment 去。然后当 frame 抵达 bridge 的时候﹐bridge 会检查其 source 和
destination﹐如果发现这两个 MAC 都在同一个 segment 之上﹐那就不处理这个
frame (发挥 filter 的功能)﹔但如果发现 soure 和 destination 不在同一个
segment 上呢﹐就起用 forward 功能﹐将 frame 送到 destination 那个 segment
上﹐或是单纯的向所有‘非 source’到 segment(s) 递送(视 bridge 的能力)。

这样看来﹐bridge 对 CS 和 CD 也起到改善的作用﹐但其对 frame 的处理﹐毕竟和
switch 是不一样的﹕bridge 以 segment 为依据﹐而 switch 则以个别设备为单位﹐
所以在运行效率上还是有分别的。当然﹐如果您将每一 port 所连接的设备看为单一
的 segment﹐然后将 switch 看为 learning bridge﹐那或许可以将它们看为极为近
似的两个设备吧。

至于于 10Base 和 100Base 的转换﹐那只是 switch 中一项非常简单的功能而已﹐并
非是 switch 真正加分的因素。


以上纯为个人认知﹐如有错误﹐恳请指正﹐以免误导观众。

--


======= http://www.study-area.org =======
飞雪迎春到﹐风雨送春归
已是寒崖百丈冰﹐尤有花枝俏
俏也不争春﹐只把春来报
待得山花烂漫时﹐他在丛中笑﹗
 
 
回复本文 
 Re: 请问有关基带宽频的问题 
作者: netman (---.seed.net.tw)
日期:   01/06/15 15:26


竹风劲起  wrote in message
news:3gkYKi$UHC@BirdNest.infoX.Net...

>
> 这一段你可以把IEEE 802.3里面关于jam的叙述再看一看,你的说法与实际情况有
> 出入。

多谢提点﹗

学习的过程中﹐真是来不得半点懒惰﹐想偷懒蒙混﹐实在不容易过关。为免误导大
家﹐将文档查找结果兹列如下﹕

4.1.2.2 Access interference and recovery
In half duplex mode,if multiple stations attempt to transmit at the same
time,it is possible for them to interfere with each other ’s
transmissions,in spite of their attempts to a oid this by deferring.When
transmissions
from two stations o erlap,the resulting contention is called a
collision.Collisions occur only in half duplex
mode,where a collision indicates that there is more than one station
attempting to use the shared physical
medium.In full duplex mode,two stations may transmit to each other
simultaneously without causing interference.The Physical Layer may generate
a collision indication,but this is ignored by the full duplex MAC.
A gi en station can experience a collision during the initial part of its
transmission (the collision window)
before its transmitted signal has had time to propagate to all stations on
the CSMA/CD medium.Once the
collision window has passed,a transmitting station is said to ha e acquired
the medium;subsequent collisions are a oided since all other (properly
functioning)stations can be assumed to ha e noticed the signal
and to be deferring to it.The time to acquire the medium is thus based on
the round-trip propagation time of
the Physical Layer whose elements include the PLS,PMA,and physical medium.
In the e ent of a collision,the transmitting station ’s Physical Layer
initially notices the interference on the
medium and then turns on the collision detect signal.In half duplex
mode,this is noticed in turn by the
Transmit Media Access Management component of the MAC sublayer,and
collision handling begins.First,
Transmit Media Access Management enforces the collision by transmitting a
bit sequence called jam.In 4.4,
implementations that use this enforcement procedure are provided.This
ensures that the duration of the collision is suf ?cient to be noticed by
the other transmitting station(s)in olved in the collision.After the jam is
sent,Transmit Media Access Management terminates the transmission and
schedules another transmission
attempt after a randomly selected time interval.Retransmission is attempted
again in the face of repeated
collisions.Since repeated collisions indicate a busy medium,howe
er,Transmit Media Access Management
attempts to adjust to the medium load by backing off (voluntarily delaying
its own retransmissions to reduce
its load on the medium).This is accomplished by expanding the interval from
which the random retransmission time is selected on each successi e
transmit attempt.Eventually,either the transmission succeeds,or the
attempt is abandoned on the assumption that the medium has failed or has
become o erloaded.
In full duplex mode,a station ignores any collision detect signal generated
by the Physical Layer.Transmit
Media Access Management in a full duplex station will always be able to
transmit its frames without contention,so there is ne er any need to jam or
reschedule transmissions.
At the receiving end,the bits resulting from a collision are recei ed and
decoded by the PLS just as are the
bits of a alid frame.Fragmentary frames recei ed during collisions are
distinguished from alid transmissions by the MAC sublayer ’s Recei e Media
Access Management component.


4.2.3.2.3 Collision handling (half duplex mode only)
Once a CSMA/CD sublayer has ?nished deferring and has started
transmission,it is still possible for it to
experience contention for the medium.Collisions can occur until acquisition
of the network has been accomplished through the deference of all other
stations ’ CSMA/CD sublayers.
The dynamics of collision handling are largely determined by a single
parameter called the slot time.This
single parameter describes three important aspects of collision handling:
a)It is an upper bound on the acquisition time of the medium.
b)It is an upper bound on the length of a frame fragment generated by a
collision.
c)It is the scheduling quantum for retransmission.
To ful ?ll all three functions,the slot time shall be larger than the sum
of the Physical Layer roundtrip propagation time and the Media Access Layer
maximum jam time.The slot time is determined by the parameters
of the implementation,see 4.4.

4.2.3.2.4 Collision detection and enforcement (half duplex mode only)
Collisions are detected by monitoring the collisionDetect signal provided
by the Physical Layer.When a collision is detected during a frame
transmission,the transmission is not terminated immediately.Instead,the
transmission continues until additional bits speci ?ed by jamSize ha e been
transmitted (counting from the
time collisionDetect went on).This collision enforcement or jam guarantees
that the duration of the collision
is suf ?cient to ensure its detection by all transmitting stations on the
network.The content of the jam is
unspeci ?ed;it may be any ?xed or ariable pattern con enient to the Media
Access implementation,however,the implementation shall not be intentionally
designed to be the 32-bit CRC alue corresponding to the
(partial)frame transmitted prior to the jam.
4.2.3.2.5 Collision backoff and retransmission (half duplex mode only)
When a transmission attempt has terminated due to a collision,it is retried
by the transmitting CSMA/CD
sublayer until either it is successful or a maximum number of attempts
(attemptLimit)ha e been made and
all ha e terminated due to collisions.Note that all attempts to transmit a
gi en frame are completed before
any subsequent outgoing frames are transmitted.The scheduling of the
retransmissions is determined by a
controlled randomization process called “truncated binary exponential
backoff.”At the end of enforcing a
collision (jamming),the CSMA/CD sublayer delays before attempting to
retransmit the frame.The delay is
an integer multiple of slotTime.The number of slot times to delay before
the nth retransmission attempt is
chosen as a uniformly distributed random integer r in the range:
0 r <2 k
where
k =min (n,10)
If all attemptLimit attempts fail,this e ent is reported as an
error.Algorithms used to generate the integer r
should be designed to minimize the correlation between the numbers
generated by any two stations at any
given time.
Note that the alues gi en abo e de ?ne the most aggressi e behavior that a
station may exhibit in attempting
to retransmit after a collision.In the course of implementing the
retransmission scheduling procedure,a station may introduce extra delays
that will degrade its own throughput,but in no case may a station ’s
retransmission scheduling result in a lower a erage delay between
retransmission attempts than the procedure
defined above.

4.2.4.2.2 Collision Filtering
In the absence of a collision,the shortest alid transmission in half duplex
mode must be at least one slot-Time in length.Within a burst of frames,the
?rst frame of a burst must be at least slotTime bits in length in
order to be accepted by the recei er,while subsequent frames within a burst
must be at least minFrameSize
in length.Anything less is presumed to be a fragment resulting from a
collision,and is discarded by the
recei er.In half duplex mode,occasional collisions are a normal part of the
Media Access management procedure.The discarding of such a fragment by a
MAC is not reported as an error.
The shortest alid transmission in full duplex mode must be at least
minFrameSize in length.While collisions do not occur in full duplex mode
MACs,a full duplex MAC ne ertheless discards recei ed frames containing
less than minFrameSize bits.The discarding of such a frame by a MAC is not
reported as an error.

> 谁说的?
> 请把IEEE 802.3标准中对switch和bridge的定义拿来看看吧。
> 另外,IEEE 802.1D的标题正是 MAC bridge。
>


刚才查了一下 IEEE 的文档﹐的确发现他们将 switch 和 bridge 定义在一起了。那
就不能怪当初在校时的笔记﹐而应该怪自己没仔细看文档啰~~~

不过﹐读 IEEE 或 RFC 之类的文档﹐的确是非常乏味的﹐如果不想从头看起﹐下面是
我‘断章取义’下来的引文﹐希望对那些有兴趣看看的朋友有些帮助吧。



********************************************

IEEE Std 802.3, 2000 Edition
Part 3:Carrier sense multiple access with collision detection (CSMA/CD)
access method and physical layer specifications

1.4 Definitions
1.4.53 bridge:A layer 2 interconnection device that does not form part of a
CSMA/CD collision domain but
conforms to the ISO/IEC 15802-3:1998 [ANSI/IEEE 802.1D,1998
Edition ]International Standard.A
bridge does not form part of a CSMA/CD collision domain but,rather appears
as a Media Access Control
(MAC)to the collision domain.(See also IEEE Std 100-1996.)
1.4.264 switch:A layer 2 interconnection device that conforms to the
ISO/IEC 10038 [ANSI/IEEE 802.1D-
1990 ] International Standard..Syn:bridge.

4.1.1 Overview
The most common configuration envisioned for full duplex operation consists
of a central bridge (also
known as a switch)with a dedicated LAN connecting each bridge port to a
single device.


12.4.3.2.7 Collision presence startup
When a hub starts generating CP (as speci ?ed in 12.4.3.2.2 through
12.4.3.2.5)it shall synchronize the startup to a half or whole bit-cell
boundary of any immediately preceding signal.If it was sending IDL
immediately before the CP,no synchronization or preamble is required.
A hub may start transmission of CP at any point in the sequence that does
not result in periods of more than
one bit time without a transition during the switch from passing on data to
sending CP.Depending on the
preceding signal,it may start with L010H,010HL,10HL0,0HL01,or HL010.Because
startup may be synchronized to any half-bit-cell boundary,a hub may also
transmit the shifted ersion of CP starting with
1LH10,LH101,H101L,101LH,or 01LH1.



********************************************

ANSI/IEEE Std 802.1D, 1998 Edition
Part 3: Media Access Control (MAC) Bridges


6. Support of the MAC Service

MAC Bridges interconnect the separate IEEE 802 LANs that comprise a Bridged
LAN by relaying and filtering
frames between the separate MACs of the Bridged LAN.The position of the
bridging function within
the MAC Sublayer is shown in Figure 6-1.

Figure 6-1—Internal organization of the MAC Sublayer

This clause discusses the following aspects of service provision in Bridged
LANs:
a) Provision of the MAC Service to end stations;
b) Preservation of the MAC Service;
c) Maintenance of Quality of Service;
d) Provision of the internal sublayer service within the MAC Bridge;
e) Support of the Internal Sublayer Service by specific MAC procedures;
f) Filtering services.

6.5.1 Support by IEEE Std 802.3 (CSMA/CD)
The CSMA/CD access method is specified in IEEE Std 802.3. Clause 3 of that
standard specifies the MAC
frame structure, and Clause 4 specifies the MAC method.
On receipt of an M_UNITDATA.request primitive, the local MAC Entity
performs Transmit Data Encapsulation,
assembling a frame using the parameters supplied as specified below. It
prepends a preamble and a
Start Frame Delimiter before handing the frame to the Transmit Media Access
Management Component in
the MAC Sublayer for transmission (IEEE Std 802.3, 4.2.3).
On receipt of a MAC frame by Receive Media Access Management, the MAC frame
is passed to Receive
Data Decapsulation, which validates the FCS and disassembles the frame, as
specified below, into the
parameters that are supplied with an M_UNITDATA.indication primitive (IEEE
Std 802.3, 4.2.4).
The frame_type parameter takes only the value user_data_frame and is not
explicitly encoded in MAC
frames.
The mac_action parameter takes only the value request_with_no_response and
is not explicitly encoded in
MAC frames.
The destination_address parameter is encoded in the destination address
field of the MAC frame (IEEE Std
802.3, 3.2.3).
The source_address parameter is encoded in the source address field of the
MAC frame (IEEE Std
802.3, 3.2.3).
The number of octets in the mac_service_data_unit parameter is encoded in
the length field of the MAC
frame (IEEE Std 802.3, 3.2.6), and the octets of data are encoded in the
data field (IEEE Std 802.3, 3.2.7).

The user_priority parameter provided in a data request primitive is not
encoded in MAC frames. The
user_priority parameter provided in a data indication primitive takes the
value of the Default User Priority
parameter for the Port through which the MAC frame was received (see 6.4).
The frame_check_sequence parameter is encoded in the FCS field of the MAC
frame (IEEE Std 802.3,
3.2.8). The FCS is computed as a function of the destination address,
source address, length, data, and PAD
fields. If an M_UNITDATA.request primitive is not accompanied by this
parameter, it is calculated in accordance
with IEEE Std 802.3, 3.2.8.
NOTE 1—Since the PAD field, if present, contributes to the FCS, this
parameter needs to include at least the contribution
of the PAD field to the FCS in order for the original FCS to be preserved
(See Annex G).
No special action, above that specified for the support of use of the MAC
Service by LLC, is required for the
support of the MAC Internal Sublayer Service by the CSMA/CD access method.
NOTE 2—The support by IEEE Std 802.3 is described only in terms of the
operation of a Bridge when relaying frames
that result from the use of LLC services over an 802.3 MAC. ISO/IEC 11802-5
defines the recommended practice for
bridging Ethernet V2.0 frames.
NOTE 3—IEEE Std 802.3, 1998 Edition, describes the use of either a Length
or an Ethernet protocol type in its frame
format; however, the text of this subclause has yet to be revised to
describe the use of Ethernet protocol types.


6.6 Filtering services in Bridged LANs
MAC Bridges provide filtering services in Bridged LANs that support some
aspects of the maintenance of
Quality of Service; in particular, transit delay, priority, and throughput.
In addition, these services provide
for a degree of administrative control over the propagation of particular
MAC Addresses in the Bridged
LAN.
The services described are services in the most general sense; i.e., they
are descriptions of the functionality
that are made available to the MAC Service user or an administrator in
order to control and access filtering
capabilities in Bridged LANs. The description of each service makes no
assumptions in terms of how the
service might be realized. There are at least the following possibilities:
a) Use of existing protocols and mechanisms, defined in IEEE 802 standards
and elsewhere;
b) Use of management functionality, either locally defined or implemented
via remote management
protocols;
c) Other means, standardized or otherwise.
6.6.1 Purpose(s) of filtering service provision
Filtering services are provided in Bridged LANs for the purposes described
in the following subclauses.


6.6.7.1 Dynamic registration and de-registration services
These services allow MAC Service users dynamic control over the set of
destination Group MAC Addresses
that they will receive from the MAC Service provider, by
a) Registering/de-registering membership of specific Groups associated with
those addresses;
b) Registering/de-registering their service requirements with regard to the
overall forwarding/filtering
behavior for Groups.
Provision of these services is achieved by means of GMRP and its associated
procedures, as described in
Clause 10.
NOTE—The intent of these services is to provide the MAC Service user with
dynamic control over access to multicast
data streams, for example, multiple video channels made available by a
server using a different group MAC Address for
each channel. The ability to both register and de-register Group
membership, coupled with the filtering action associated
with the Group membership, limits the impact of such services on the
bandwidth available in the Bridged LAN. These
services can be used to control the reception of other categories of
multicast traffic, for similar reasons.

REGISTER_GROUP_MEMBER (MAC_ADDRESS)
Indicates to the MAC Service provider that the MAC Service user wishes to
receive frames containing the
group MAC Address indicated in the MAC_ADDRESS parameter as the destination
address. The MAC
Addresses that can be carried by this parameter do not include
a) Any individual address;
b) Any of the Reserved Addresses identified in Table 7-9;
c) Any of the GARP Application addresses, as defined in Table 12-1.
DEREGISTER_GROUP_MEMBER (MAC_ADDRESS)
Indicates to the MAC Service provider that the end station no longer wishes
to receive frames containing the
group MAC Address indicated in the MAC_ADDRESS parameter as the destination
address.
REGISTER_SERVICE_REQUIREMENT (REQUIREMENT_SPECIFICATION)
Indicates to the MAC Service provider that the MAC Service user has a
requirement for any devices that
support Extended Filtering Services to forward frames in the direction of
the Mac Service User in accordance
with the definition of the service requirement defined by the
REQUIREMENT_SPECIFICATION
parameter. The values that can be carried by this parameter are
a) Forward All Groups;
b) Forward Unregistered Groups.
DEREGISTER_SERVICE_REQUIREMENT (REQUIREMENT_SPECIFICATION)
Indicates to the MAC Service provider that the MAC Service user no longer
has a requirement for any
devices that support Extended Filtering Services to forward frames in the
direction of the Mac Service User
in accordance with the definition of the service requirement defined by the
REQUIREMENT_SPECIFICATION parameter. The values that can be carried by this
parameter are
a) Forward All Groups;
b) Forward Unregistered Groups.
The use of these services can result in the propagation of group MAC
Address and service requirement
information across the Spanning Tree, affecting the contents of Group
Registration Entries (7.9.3) in Bridges
and end stations in the Bridged LAN, and thereby affecting the frame
forwarding behavior of the Bridges
and end stations with regard to multicast frames.


7.1 Bridge operation
The principal elements of Bridge operation are
a) Relay and filtering of frames.
b) Maintenance of the information required to make frame filtering and
relaying decisions.
c) Management of the above.
7.1.1 Relay
A MAC Bridge relays individual MAC user data frames between the separate
MACs of the Bridged LANs
connected to its Ports. The order of frames shall be preserved as defined
in 7.7.3.
The functions that support the relaying of frames and maintain the Quality
of Service supported by the
Bridge are
a) Frame reception.
b) Discard on received frame in error (6.3.2).
c) Frame discard if the frame_type is not user_data_frame, or if its
mac_action parameter is not
request_with_no_response (6.4).
d) Regeneration of user priority, if required (6.4).
e) Frame discard following the application of filtering information.
f) Frame discard on transmittable service data unit size exceeded (6.3.8).
g) Forwarding of received frames to other Bridge Ports.
h) Selection of traffic class, following the application of filtering
information.
i) Queuing of frames by traffic class.
j) Frame discard to ensure that a maximum bridge transit delay is not
exceeded (6.3.6).
k) Selection of queued frames for transmission.
l) Selection of outbound access priority (6.3.9).
m) Mapping of service data units and recalculation of Frame Check Sequence,
if required (6.3.7, 7.7.6).
n) Frame transmission.
7.1.2 Filtering and relaying information
A Bridge filters frames, i.e., does not relay frames received by a Bridge
Port to other Ports on that Bridge, in
order to prevent the duplication of frames (6.3.4). The function that
supports the use and maintenance of
information for this purpose is
a) Calculation and configuration of Bridged LAN topology.

A Bridge also filters frames in order to reduce traffic in parts of the
Bridged LAN that do not lie in the path
between the source and destination of that traffic. The functions that
support the use and maintenance of
information for this purpose are:
b) Permanent configuration of reserved addresses.
c) Explicit configuration of static filtering information.
d) Automatic learning of dynamic filtering information for unicast
destination addresses through observation
of source addresses of Bridged LAN traffic.
e) Ageing out of dynamic filtering information that has been learned.
f) Automatic addition and removal of dynamic filtering information as a
result of GMRP protocol
exchanges.
A Bridge classifies frames into traffic classes in order to expedite
transmission of frames generated by critical
or time-sensitive services. The function that supports the use and
maintenance of information for this
purpose is
g) Explicit configuration of traffic class information associated with the
Ports of the Bridge.
7.1.3 Bridge Management
The functions that support Bridge Management control and monitor the
provision of the above functions.
They are specified in Clause 14.

7.2 Bridge architecture
7.2.1 Architectural model of a Bridge
Figure 7-1 gives an example of the physical topology of a Bridged LAN. The
component LANs are interconnected
by means of MAC Bridges; each Port of a MAC Bridge connects to a single
LAN. Figure 7-2 illustrates
a Bridge with two Ports, and Figure 7-3 illustrates the architecture of
such a Bridge.
A Bridge is modeled as consisting of
a) A MAC Relay Entity that interconnects the Bridge’s Ports;
b) At least two Ports;
c) Higher layer entities, including at least a Bridge Protocol Entity.
7.2.2 MAC Relay Entity
The MAC Relay Entity handles the MAC method independent functions of
relaying frames between Bridge
Ports, filtering frames, and learning filtering information. It uses the
Internal Sublayer Service provided by
the separate MAC Entities for each Port. (The Internal Sublayer Service and
its support are described in 6.4
and 6.5.) Frames are relayed between Ports attached to different LANs.
7.2.3 Ports
Each Bridge Port transmits and receives frames to and from the LAN to which
it is attached. An individual
MAC Entity permanently associated with the Port provides the Internal
Sublayer Service used for frame
transmission and reception. The MAC Entity handles all the MAC method
dependent functions (MAC protocol
and procedures) as specified in the relevant standard for that IEEE 802 LAN
MAC technology.

7.5 Frame reception
The individual MAC Entity associated with each Bridge Port examines all
frames transmitted on the LAN to
which it is attached.
All error-free received frames give rise to M_UNITDATA indication
primitives, which shall be handled as
follows.
NOTE—A frame that is in error, as defined by the relevant MAC
specification, is discarded by the MAC Entity without
giving rise to any M_UNITDATA indication; see 6.4.
Frames with M_UNITDATA.indication primitive frame_type and mac_action
parameter values of
user_data_frame and request_with_no_response, respectively (6.4), shall be
submitted to the Learning and
Forwarding Processes.
Frames with other values of frame_type and mac_action parameters (e.g.,
request_with_response and response
frames), shall not be submitted to the Forwarding Process. They may be
submitted to the Learning Process.
Frames with a frame_type of user_data_frame and addressed to the Bridge
Port as an end station shall be
submitted to LLC. Such frames carry either the individual MAC Address of
the Port or a group address associated
with the Port (7.12) in the destination address field. Frames submitted to
LLC can also be submitted to
the Learning and Forwarding Processes, as specified above.
Frames addressed to a Bridge Port as an end station, and relayed to that
Bridge Port from other Bridge Ports
in the same Bridge by the Forwarding Process, shall also be submitted to
LLC.
No other frames shall be submitted to LLC.


7.6 Frame transmission
The individual MAC Entity associated with each Bridge Port transmits frames
submitted to it by the MAC
Relay Entity.
Relayed frames are submitted for transmission by the Forwarding Process.
The M_UNITDATA.request
primitive associated with such frames conveys the values of the source and
destination address fields
received in the corresponding M_UNITDATA.indication primitive.
LLC Protocol Data Units are submitted by LLC as a user of the MAC Service
provided by the Bridge Port.
Frames transmitted to convey such Protocol Data Units carry the individual
MAC Address of the Port in the
source address field.
Each frame is transmitted subject to the MAC procedures to be observed for
that specific IEEE 802 LAN
technology. The values of the frame_type and mac_action parameters of the
corresponding M_UNITDATA.
request primitive shall be user_data_frame and request_with_no_response,
respectively (6.5).
Frames transmitted following a request by the LLC user of the MAC Service
provided by the Bridge Port
shall also be submitted to the MAC Relay Entity.

7.7 The Forwarding Process
Frames submitted to the Forwarding Process after being received at any
given Bridge Port (7.5) shall be forwarded
through the other Bridge Ports subject to the constituent functions of the
Forwarding Process. These
functions enforce topology restrictions (7.7.1), use filtering database
information to filter frames (7.7.2),
queue frames (7.7.3), select queued frames for transmission (7.7.4), map
priorities (7.7.5), and recalculate
FCS if required (7.7.6).

The Forwarding Process functions are described in 7.7.1–7.7.6 in terms of
the action taken for a given frame
received on a given Port (termed “the reception Port”). The frame can be
forwarded for transmission on
some Ports (termed “transmission Ports”), and is discarded without being
transmitted at the other Ports.
NOTE—The model of operation of the Forwarding Process described in this
standard is limited to the operation of the
relay function of the MAC Bridge, and does not take into consideration what
may occur in real implementations once
frames are passed to the MAC for transmission. In some MAC implementations,
and under some traffic conditions, a
degree of indeterminacy may be introduced between the modeled description
of the process of passing selected frames to
the MAC for transmission and the actual sequence of frames as visible on
the LAN medium itself. Examples can be
found in the handling of access_priority in Token-Passing Bus MACs, or in
the effect of different values for Token Holding
Time in FDDI LANs. Such indeterminacy could result in apparent violation of
the queuing/de-queueing and prioritiation
rules described for the Forwarding Process, when observing traffic on the
medium. As a consequence, in some
implementations of this standard, it may prove to be impossible to test
conformance to the standard simply by relating
observed LAN traffic to the described model of the Forwarding Process;
conformance tests would have to allow for the
(permissible) behavior of the MAC implementations as well.
Figure 7-4 illustrates the operation of the Forwarding Process in a single
instance of frame relay between the
Ports of a Bridge with two Ports. Figure 7-8 illustrates the detailed
operation of the Forwarding Process.


7.8 The Learning Process
The Learning Process observes the source addresses of frames received on
each Port and updates the Filtering
Database conditionally on the state of the receiving Port.
Frames are submitted to the Learning Process by the individual MAC Entities
associated with each Bridge
Port as specified in 7.5.
The Learning Process may deduce the path through the Bridged LAN to
particular end stations by inspection
of the source address field of received frames. It shall create or update a
Dynamic Filtering Entry (7.9, 7.9.2)
in the Filtering Database, associating the Port on which the frame was
received with the MAC Address in the
source address field of the frame, if and only if
a) The Port on which the frame was received is in a state that allows
learning (8.4), and
b) The source address field of the frame denotes a specific end station,
i.e., is not a group address, and
c) No Static Filtering Entry (7.9, 7.9.1) for the associated MAC Address
exists in which the Port Map
specifies Forwarding or Filtering for that Port, and
d) The resulting number of entries would not exceed the capacity of the
Filtering Database.
If the Filtering Database is already filled up to its capacity, but a new
entry would otherwise be made, then an
existing entry may be removed to make room for the new entry.
Figure 7-5 illustrates the operation of the Learning Process in the
inclusion of station location information
carried by a single frame, received on one of the Ports of a Bridge, in the
Filtering Database.


7.9 The Filtering Database
The Filtering Database supports queries by the Forwarding Process as to
whether frames received by the
Forwarding Process from a given reception Port, and with given values of
destination MAC Address parameter,
are to be forwarded through a given potential transmission Port (7.7.1,
7.7.2). It contains filtering information
in the form of filtering entries that are either
a) Static, and explicitly configured by management action; or
b) Dynamic, and automatically entered into the Filtering Database by the
normal operation of the
bridge and the protocols it supports.
A single entry type, the Static Filtering Entry, represents all static
information in the Filtering Database, for
individual and for group MAC Addresses. It allows administrative control of

c) Forwarding of frames with particular destination addresses; and
d) The inclusion in the Filtering Database of dynamic filtering information
associated with Extended
Filtering Services, and use of this information.
The Filtering Database shall contain entries of the Static Filtering Entry
type.
Static filtering information is added to, modified, and removed from the
Filtering Database only under
explicit management control. It shall not be automatically removed by any
ageing mechanism. Management
of static filtering information may be carried out by use of the remote
management capability provided by
Bridge Management (7.11) using the operations specified in Clause 14.
Two entry types are used to represent dynamic filtering information.
Dynamic Filtering Entries are used to
specify the ports on which individual addresses have been learned. They are
created and updated by the
Learning Process (7.8), and are subject to ageing and removal by the
Filtering Database. Group Registration
Entries support the registration of group MAC Addresses. They are created,
updated, and removed by the
GMRP protocol in support of Extended Filtering Services (6.6.5, 7.9.3, and
Clause 10). Dynamic filtering
information may be read by use of the remote management capability provided
by Bridge Management
(7.11) using the operations specified in Clause 14.
Both static and dynamic entries comprise
e) A MAC Address specification;
f) A Port Map, with a control element for each outbound Port to specify
filtering for the MAC Address
specification.
The Filtering Services supported by a Bridge (Basic and Extended Filtering
Services) determine the default
behavior of the Bridge with respect to the forwarding of frames destined
for group MAC Addresses. In
Bridges that support Extended Filtering Services, the default forwarding
behavior of each Port for group
MAC Addresses can be configured both statically and dynamically by means of
Static Filtering Entries and/
or Group Registration Entries that can carry the following MAC Address
specifications:
g) All Group Addresses, for which no more specific Static Filtering Entry
exists;
h) All Unregistered Group Addresses (i.e., all group MAC Addresses for
which no Group Registration
Entry exists), for which no more specific Static Filtering Entry exists.
NOTE—The All Group Addresses specification (item g above), when used in a
Static Filtering Entry with an appropriate
control specification, provides the ability to configure a Bridge that
supports Extended Filtering Services to behave as a
Bridge that supports only Basic Filtering Services on some or all of its
Ports. This might be done for the following reasons:
— The Ports concerned serve “legacy” devices that wish to receive
multicast traffic, but are unable to register Group
membership;
— The Ports concerned serve devices that need to receive all multicast
traffic, such as routers or diagnostic devices.
The Filtering Database shall support the creation, updating, and removal of
Dynamic Filtering Entries by the
Learning Process (7.8). In Bridges that support Extended Filtering
Services, the Filtering Database shall
support the creation, updating, and removal of Group Registration Entries
by GMRP (Clause 10).
Figure 7-4 illustrates the use of the Filtering Database by the Forwarding
Process in a single instance of
frame relay between the Ports of a Bridge with two Ports.
Figure 7-5 illustrates the creation or update of a dynamic entry in the
Filtering Database by the Learning
Process.

Figure 7-6 illustrates the operation of the Bridge Protocol Entity (7.10),
which operates the Spanning Tree
Algorithm and Protocol, and its notification of the Filtering Database of
changes in active topology signaled
by that protocol.


7.12.1 End stations
Frames transmitted between end stations using the MAC Service provided by a
Bridged LAN carry the
MAC Address of the source and destination peer end stations in the source
and destination address fields of
the frames, respectively. The address, or other means of identification, of
a Bridge is not carried in frames
transmitted between peer users for the purpose of frame relay in the
Bridged LAN.
The broadcast address and other group MAC Addresses apply to the use of the
MAC Service provided by a
Bridged LAN as a whole. In the absence of explicit filters configured via
management as Static Filtering
Entries, or via GMRP as Group Registration Entries (Clause 14, Clause 10,
7.9), frames with such destination
addresses are relayed throughout the Bridged LAN.
7.12.2 Bridge Ports
The individual MAC Entity associated with each Bridge Port shall have a
separate individual MAC Address.
This address is used for any MAC procedures required by the particular MAC
method employed.
Frames that are received from the LAN to which a Port is attached and that
carry a MAC Address for the
Port in the destination address field are submitted to the MAC Service User
(LLC) exactly as for an end
station.


******************************************************


有许多人﹐如弟﹐不是很喜欢看文档﹐但就算看得懂文档﹐如何整理出来﹐向大家说
明白﹐看来比起看文档更难﹗



-----------


来源: 顽石 
时间: 2001年 6月16日 周六 08时23分29秒 CST
标题: Re: 谁能麻烦一下,解释switch hub和hub的差别...@@"
论坛: tw.bbs.comp.network


==> 在 Toidi@cis_nctu (白痴小孩) 的文章中提到:
> ==> 在 siklo@cis_nctu (小翅膀) 的文章中提到:
> > VLAN 要能通,是 Layer 3 的 Switch, 你用的哪牌子 Layer 2 Switch
> > 上切 VLAN 是可以互通的?
>         之所以切 VLAN 不就是要让 VLAN 彼此之间分开...
>         你互通的定义是什么可以说清楚一点吗?
>         我手上就有一台 VLAN 正常运作的 switch hub
L3 Switch 会有﹕outing Module,互通应该就是指
通过 L3 Swtich 上的 Routing Module,而不需要从
每个 VLan 上找一个 Port uplink 到上层的 Switch
或是直接接到 Router 上,以达到 VLan 互通吧!


--------


来源: 顽石 
时间: 2001年 6月16日 周六 18时24分15秒 CST
标题: Re: 谁能麻烦一下,解释switch hub和hub的差别...@@"
论坛: tw.bbs.comp.network

==> 在 siklo@cis_nctu (小翅膀) 的文章中提到:
> ==> 在 Toidi@cis_nctu (白痴小孩) 的文章中提到:
> >         不过现在是 Layer 2 的 Switch
> >         不会有这种 Module
> >         所以 VLAN 本来就不能互通...
> >         这也是 VLAN 设计的目的啊
> 小弟不懂..??  做 VLAN 用 Layer 3 就可以 route 互通
> 小弟在一般企业公司当中,见到的也都是用 Layer 3 Switch
> 把各 VLAN 使用 route 方式互通。
    VLAN 是在 L2 Switch 上就有了,L3 是后来有
  需要而且当时 Router 太贵了(想想看那时候
  Cisco 股价有多高!钱从那儿生出来的就知道
  啰!)而发展出来的,所以 VLAN 的目的就是
  把某些 Ports 跟其他 Ports “划清界限”!
  分成不同的 collision domain 呀!但是不同
  的 VLAN 之间真的可以“老死不相往来”吗?
  抱托!同公司、学校、团体………耶!所以要
  通的时候,就在 Layer 3 上做!最“标准”的
  做法当然是在 Router 上“转送”,但是因为
  $$ 同时技术进步了,所以 Switch 愈来愈强,
  就“顺便”把这个工作也做啰~~~这就是
  Layer 3 Switch 了!

> >         不过还是可以把每个 VLAN 的 uplink
>                         ^^^^^^^^^^^^^^^^^^^^
> 不懂这样的说法..
  若你的 Switch 只有 Layer 2 的话,不 uplink
    你的 VLAN 之间要怎么通?

> >         设在同一个 port 就可以了..
> 看起来你说的很像是 port trunking 的方式
  Trunking 是 Trunking,跟 VLAN 没关系!

外行人道听涂说,有错请高手指正啰!



--------


来源: 老尽少年心 
时间: 2001年 6月17日 周日 02时05分50秒 CST
标题: Re: 谁能麻烦一下,解释switch hub和hub的差别...@@"
论坛: tw.bbs.comp.network

==> 在 hardstone@cis_nctu (顽石) 的文章中提到:
> ==> 在 siklo@cis_nctu (小翅膀) 的文章中提到:
> >                         ^^^^^^^^^^^^^^^^^^^^
> > 不懂这样的说法..
>   若你的 Switch 只有 Layer 2 的话,不 uplink
>     你的 VLAN 之间要怎么通?
> > 看起来你说的很像是 port trunking 的方式
>   Trunking 是 Trunking,跟 VLAN 没关系!
> 外行人道听涂说,有错请高手指正啰!

      这边siklo说的没错
      有关trunking这个字眼,你该如何去定义?
      在Cisco这一派里,Trunking指的就是vlan port trunking
      同一台switch内切割了数个VLAN,而只有一条实体链接
      至另一台也切割了数个 VLAN的switch,这两台switch中间
      只有一条实体链接,我们就要在这个port上设置VLAN Trunk
      加上802.1q or ISL 的封装,才能让这两台的vlan information
      可以互相沟通,不同switch的同一个VLAN才能通
      如VLAN1@SW1 <-> VLAN1@SW2, VLAN2@SW1 <-> VLAN2@SW2
      以上是Cisco的"trunking"

      而一般我们讲trunking可能是指Cisco的EtherChannel
      也就是介于两switch间数条实体电路合并带宽及做redudant的技术
      跟上面所述是完全不一样的东西,说明清楚可能会比较好


----------


来源: 死老百姓 
时间: 2001年 6月17日 周日 15时20分22秒 CST
标题: Re: 谁能麻烦一下,解释switch hub和hub的差别...@@"
论坛: tw.bbs.comp.network


※ 引述《hardstone.bbs@bbs.cis.nctu.edu.tw (顽石)》之铭言:
: 嗯~~~受教了!
: 没错!我所“认为”的 trunking 是说合并带宽的那一种!
: Cisco 的 VLAN Trunking 当初也有听过,不过没看过有人
: 在用,所以………
port trunk(EtherChannel) 和 VLAN trunk 是两码子事

VLAN trunk 在 MAN 上面用的很多, 有兴趣的可以去查查其它厂商(eg. Extreme)
的 solution, Cisco 在 switch 方面并不是特别强.

: 觉得上那个把多台 Switch△驯式圻穈_来”,犹如一台虚
: 拟的 Switch 是吗?
基本上要让 VLAN 延展到一台以上的设备, 就需要 VLAN trunk

还有一种可能性就是要让多个 VLAN 通过 router 互通, 也可以用 VLAN trunk

: 我想要这么做的原因,应该是有一台 L3 Switch 做为是
: backbone Switch,其下再接数台 L2 的 Switch,这样子
: 比较有意义吧!right?
现在的趋势是把 L2/L3 集成在一台上面, 这样做的话 VLAN 之间的互通不会
有瓶颈, 而且难度不高.



---------


来源: 羊大便与巧克力 
时间: 2001年 6月18日 周一 00时28分32秒 CST
标题: Re: 谁能麻烦一下,解释switch hub和hub的差别...@@"
论坛: tw.bbs.comp.network


==> wchuang.bbs@bbs.cis.nctu.edu.tw (老尽少年心) 提到:
> ==> 在 hardstone@cis_nctu (顽石) 的文章中提到:
> >   若你的 Switch 只有 Layer 2 的话,不 uplink
> >     你的 VLAN 之间要怎么通?
> >   Trunking 是 Trunking,跟 VLAN 没关系!

Trunking和VLAN有很大的关系喔....
不同的网络设备厂商对于trunk有不同的诠释

Intel的trunk为将数个port聚集成一个group,如果是4个port做trunk,
那么两台switch之间的带宽为400MB full-duplex,同样的技术Extreme
称之为link aggregation,Cisco称之为Fast EtherChannel。

Cisco的trunk是一条link上可以携带数个VLAN的traffic,假设switch1有
三个VLAN,switch2也有三个VLAN,vlan1@switch1想和vlan1@switch2沟通时,
最简单的方法,就是三条连接分别连接两台switch相对应的三个vlan,但这种方
法
太浪费port,解决方法就是两台switch各选一个port设置为trunk port,然后连
起来
,这一条trunk link就可以携带三个vlan的traffic(set trunk 1 on 1-3),马
上就
省下两个port。但这仅止于相同vlan之间的沟通。如果vlan1想和vlan2沟通的话
,
就必须要靠router或者是multilayer switch来进行routing的功能。
如果是Extreme switch的话,一行指令ip forwarding就搞定,如果是cisco switch
的话,就必须加买route switching module。

虽然cisco的switch不是顶好,但是如果向市场主流看齐的话,那么trunk和vlan
之间
密不可分的关系就不可不知。
by the way,CCNP中的BCMSN一科就考了相当多的trunk and vlan的观念。



--------


来源: 夜班火车 
时间: 2001年 6月18日 周一 16时19分18秒 CST
标题: Re: 谁能麻烦一下,解释switch hub和hub的差别...@@"
论坛: tw.bbs.comp.network


《 在 shinlong. 的大作中提到: 》
: 谢谢你噜~@@"...
: 我查过上篇都没有说...>"<

快速的说法是, Switch Hub 比 一般 Hub 还要有效率, 更加的高级就是了!
很多人用简单的除法说什么 5 ports/10Mbps 的 一般Hub,
每一个电脑只能分到 10/5=2Mbpe, 那是错误的!
说什么 Switch Hub 可以使每台电脑都接收/发送 10Mbps的带宽, 也错误!
正确的说, 是 Switch Hub 如果是 5 Ports, 假设是 a b c d e 好了,
那其中要是 a 刚好只跟 b讨数据, c 刚好只跟 d 讨数据, e 电脑没人用,
那么带宽的分配是 a=10Mbps b=10Mbps c=10Mbps d=10Mbps
那如果 b, c, d, e 都同时向 a 讨数据, 那么带宽就变成10Mbps/4=2.5Mbps
Mbps=Million bit per second (百万 bit 每秒)
所以变化也满多的, 假设 a, b 同时跟 c 讨数据, c 又跟 d 讨数据, e又跟 a
讨数据.
那就会变成 :
a--->e
d--->c
c--->a
c--->b

由此看来, 其中 c 最受欢迎, c 的数据就有二个人要.
b和 e 最可怜, 硬盘里可能什么都没有, 所以没人要他的数据.
d 最独立, 没有向其他 4 台电脑索取数据, 还提供数据给 c电脑, 所以d可能是 Server.
那么带宽就变成,
a=10/4=2.5Mbps
b=10/4=2.5Mbps
c=10/4=2.5Mbps
d=10/4=2.5Mpbs
e=10/4=2.5Mpbs

所以就算是 Switch Hub, 遇到牵扯一堆的时候, 也是跟普通 Hub一样.
每个都一样了, 即使 d看起来跟别人牵扯的最少, 但就是因为 d给c数据.
问题就出在 c, c 牵扯最多, 导致 5 台电脑的分享带宽都一样了, 都要分掉.

如果今天其中二个都只跟对方相互取数据, 那么就可以享有 10Mbps的全速.
也就是互相深爱对方, 各自都没有在跟别人牵扯, 这样就可达到 Switch 的功能.
这样最好的情况就是 有 4 ports 可以享受 各自独立的 10Mbps, 其中一 port
必须
不动作.
应该是如此, 讲错的话请指教.
所以买 Switch Hub 应该买偶数的 ports 数目, 5, 7, 9 这些都不要买.
买4, 6, 8, 16, 偶数的 Switch Hub.
推荐 3Com 和 SMC的 Hub.



-------



羊大便与巧克力  wrote in message news:3h2HkR$K5l@bbs.ntu.edu.tw...
> 提出一个建议,网络的世界何其之大,有学不完的协定,日新月异的硬件技术,
> 无奇不有的网络架构,大家在这个讨论区彼此虚心的交流,不要以讥讽嘲弄的语气
> 来回应。
> ==> siklo.bbs@bbs.cis.nctu.edu.tw (小翅膀) 提到:
> > ==> 在 airborne.bbs@bbs.ntu.edu.tw (羊大便与巧克力) 的文章中提到:
> > > 基本上来说,meeds兄的解释并没有错。
> > > 在讨论这个问题时,除了Ethernet的访问方式外,还需注意switch硬件的function,
> > > switch再处理traffic时基本上有两种模式,store-and-forward和cut-through,
> > 没有错吗?  你的以太网路设备 Switch 哪一款式能够让 b,c,d,e 同时去访问 a 啊?
> > > 不论何种模式,当b,c,d,e同时访问a时,一开始b,c,d,e都可以充分利用10mbps的带宽,
> > 这就是笑话了, 谁都知道在以太网路里面 b,c,d,e 是不可能同时访问 a 的
> > 你居然还能充分利用 10Mbps 的带宽   你的 Switch 超猛的  @_@
> 可能是我表达的不够清楚,所谓bcde同时访问a,指的是在initializing的时候,
> bcde同时丢traffic给a,traffic当然是先到switch,再由switch forward给a,
> 当然switch不可能把bcde的packet同时丢给a,一定是packet-by-packet
> (以process-switching为准,先不予考虑fast-switching的情况)。
> > 连接到下面这段, 居然掰出 b,c,d,e 一共灌了 40Mbps 给 a 的笑话~~
> 请容许我说明白一点,所谓bcde灌了40mbps给a的意思是,bcde总共有40mbps的
> traffic进到switch backplane fabric,然而port A的bandwidth只有10mbps,
> 当然无法消化switch backplane内的40mbps traffic,所以剩下的traffic就
> 存在port A的output queue里面,当output queue的buffer满了(oversubscription),
> packet开始被drop。
> > > b,c,d,e一共40mbps的traffic流到a port的buffer处理,但实际上a port的带宽
> > > 也只有10mbps,所以a port的buffer满了,data开始被drop,同时因为a port的loading
> > > 超出负荷,switch也会在b,c,d,e port发出notification,使得b,c,d,e四台机器
> > > 减缓数据送出的速度,因此当b,c,d,e同时访问a时,意味着b,c,d,e共同share a的10mbps
> > > 以长期看来,b,c,d,e确实只能使用2.5mbps。
> > 上面这一段是你掰的吧~~  笑痛我了..
> 这一段本人的诠释并不严谨,在此说声抱歉。但我可没乱掰!!!
> 所谓的port B,C,D,E会发出notification,指的是IEEE 802.3Z flow control on
> gigabit ethernet port,cisco catalyst 6000 switch支持,
> 请参考:
> http://www.cisco.com/univercd/cc/td/doc/product/lan/cat6000
> /sw5_1/cnfigide/ether.htm#xtocid1934811
> 就算今天我们的switch没有flow control好了,没关系,我们还有TCP,
> TCP总算有error control和flow control了吧,a必须将b的packet处理完后,
> 回应给b一个ack,b才会继续传数据给a,从一个微观的角度来看,第一秒处理b,
> 第二秒处理c,第三秒处理d,第四秒处理e,第五秒才能再处理b,从b的角度来看,
> 四秒内只有一秒能传数据(a给b一个ack,b才会继续传),相对来说,带宽只用了1/4。
> TCP/IP的运作逻辑请参考:
> http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/ip.htm#xtocid2236316
> 
> > > 但这并不代表剩下的7.5mbps平白无故消失,7.5mbps还是可以运用在
> > > 其他的traffic pattern,譬如上internet或是访问另外一个f。
> > 哇 @_@  更猛!  以上的笑话已经够爆笑了, 居然还可以掰出被 drop 的数据还有其他
> > 运用咧~~
> > 哪来半路跑来这乱掰讲笑话的?  大家看看笑笑就好  哈  我笑痛了..
> 请容许我说的更明白一点,
> 这里所说的被drop的数据指的是b传给a的数据,
> 当port A 的output queue overflow之后被drop的,而B->A的traffic flow
> 只用到2.5mbps的utilization,port B的bandwidth有10mbps,但由于port A
> 的满载,使得B->A只能用2.5mbps,那剩下的7.5mbps当然可以用于其他的
> traffic pattern,说的再详细一点,就是一秒传数据给a,三秒传数据到internet
> (假设没人跟他抢internet),如此便可将port B的utilization达到100%。
> 因此,在Design Network时,通常会采取hierarchical design,access layer
> 采用10或100,distribution lay采用100或1000,如此作为access layer流量
> 聚集点的distribution layer方能有效率的处理四面八方汇聚来的traffic。
> 
> 如果你还是不能认同我的说法,或许你可以参考参考Cisco出版的
> CCNP/CCDP--Building Cisco Multilayer Switched Networks(P.56-59)
> 天珑书局有。

----------



 wrote in message news:3h2I7G$W1g@bbs.cis.nctu.edu.tw...
> ==> 在 siklo@cis_nctu (小翅膀) 的文章中提到:
> > ==> 在 airborne.bbs@bbs.ntu.edu.tw (羊大便与巧克力) 的文章中提到:
> > > 基本上来说,meeds兄的解释并没有错。
> > > 在讨论这个问题时,除了Ethernet的访问方式外,还需注意switch硬件的function,
> > > switch再处理traffic时基本上有两种模式,store-and-forward和cut-through,
> > 没有错吗?  你的以太网路设备 Switch 哪一款式能够让 b,c,d,e 同时去访问 a 啊?
> > > 不论何种模式,当b,c,d,e同时访问a时,一开始b,c,d,e都可以充分利用10mbps的带宽,
> >                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > 这就是笑话了, 谁都知道在以太网路里面 b,c,d,e 是不可能同时访问 a 的
> > 你居然还能充分利用 10Mbps 的带宽   你的 Switch 超猛的  @_@
> > 连接到下面这段, 居然掰出 b,c,d,e 一共灌了 40Mbps 给 a 的笑话~~
> 
> airbone兄讲的没错
> 你所说的以太网路是指之前的 coaxial cable (10base2,10base5)
> 那类的shared LAN, 所以主机使用单一channel去进行communication.
> 所以在MAC层是采取CSMA/CD的方式.换句话说,同时间只有
> 单一主机能使用网络.否则会有collision. 可是 自从有了switch 及 UTP 后,单一
> shared medium的限制也被移除,(使用UTP有四对线,10baseT和100baseTX是使用其中两条
> TX/RX)也开始有了全双工的名词
> full-duplex 是移除三项早期ethernet的特性
> 1.carrier sense: full-duplex 下,主机不需要侦测carrier 信号
> 2.multiple access: 因为Host跟switch之间可以分别用TX/RX互相传数据
> 3.collision detection: 同上,因为分别用TX/RX传数据也就没有collision的情况发生
> 
> 换句话讲,在ful-duplex之下,已经没有CSMA/CD
> 所以b,c,d,e如果要传数据给a 时,理论上可以到达极速(只有在刚开始那微小的时间点内)
> 所以data 都在放在output queue里(假设是使用store-and-forward方式),switch为了防止
> buffer overflow,它可以开始drop packets,如果b,c,d,e上层是使用TCP等有flow control
> 的protocol, 上层的protocol会因为packet loss而调整packet送到data link的速度.
> 或者switch也可以送出 PAUSE Frame(full-duplex里,属于MAC层),请sending host降低发送
> 速度.
> 
> > > b,c,d,e一共40mbps的traffic流到a port的buffer处理,但实际上a port的带宽
> > > 也只有10mbps,所以a port的buffer满了,data开始被drop,同时因为a port的loading
> > > 超出负荷,switch也会在b,c,d,e port发出notification,使得b,c,d,e四台机器
> > > 减缓数据送出的速度,因此当b,c,d,e同时访问a时,意味着b,c,d,e共同share a的10mbps
> > > 以长期看来,b,c,d,e确实只能使用2.5mbps。
> > 上面这一段是你掰的吧~~  笑痛我了..
> > > 但这并不代表剩下的7.5mbps平白无故消失,7.5mbps还是可以运用在
> > > 其他的traffic pattern,譬如上internet或是访问另外一个f。
> > 哇 @_@  更猛!  以上的笑话已经够爆笑了, 居然还可以掰出被 drop 的数据还有其他
> > 运用咧~~
> > -----------
> > 哪来半路跑来这乱掰讲笑话的?  大家看看笑笑就好  哈  我笑痛了..
> airbone  兄说的没错
> 如果 a 跟 b互传,在100base-TX, full-duplex下总带宽可以达到200Mbps.可是并不是说
> a --> b = 200Mbps 或 b --> a = 200Mbps 或 a -> b + b -> a = 200Mbps
> 而是指 a->b 最多 100Mbps, b->a 最多 100Mbps, 同时间总和 200Mbps
> 
> 总而言之, 在full-duplex下,Any host 的 outgoing 或 incoming data 是不受彼此干扰
> 最主要的原因是不采用CSMA/CD的访问方式. 只switch够powerful, incoming/outgoing都
> 可以在同一时间达到极速,而不受到跟几台主机同时连接的限制
> 
> For more information, the following book is a great reference.
> The Switch Book: The Complete Guide to LAN Switching Technology
> by Rich Seifert
> John Wiley & Sons
> ISBN: 0471345865


----------



羊大便与巧克力  wrote in message news:3h2k3F$NC1@bbs.ntu.edu.tw...
> ==> angus.bbs@bbs.svdcc.fju.edu.tw (隐藏的智能) 提到:
> > 【 在 spen. 的大作中提到: 】
> > : 对不起 插个花 请教一下..
> > : 全双工 是不是指 "同时间可以上下传一起动作" ?
> > : A port 还是有可能 " 同时接收 " 到 B.C port 送给 A port 的数据.
> > : (如果不受 CSMA/CD 限制)
> > : 可以再说明一下 为何 使用 ful-duplex之下,已经没有CSMA/CD ?
> >  还是有collision 啦,不信用 Sniffer 自已看看
> >  对相同电脑作访问
> >  这样不就知了吗?
> 
> full-duplex是用于end-to-end,即switch-to-switch or switch-to-pc,
> 中间没有hub,上传和下传走不同对的线,可以同时进行,
> 由于是end-to-end,switch的port是dedicate给client,所以该client在上下传时
> 根本没人跟他抢。若是多人访问同一台server,只要server和switch之间是full-deplex
> 就像是一条双线道,上传有上传的路,下传有下传的路。
> 基于full-duplex上下传可同时进行及end-to-end(没有其他人在竞争media access)
> 的特性,full-duplex不会有collision也不需要CSMA/CD。
> --


---------



竹风劲起  wrote in message news:3h33HN$TX6@BirdNest.infoX.Net...
> ※ 引述《airborne.bbs@bbs.ntu.edu.tw (羊大便与巧克力)》之铭言:
> : full-duplex是用于end-to-end,即switch-to-switch or switch-to-pc,
> : 中间没有hub,上传和下传走不同对的线,可以同时进行,
> 
> 上传和下传走不同对的线并非full duplex的必要条件。
> 1000BASE-T的上传和下传在full duplex下还是走同一对线(它四对线全用到),
> 当然代价就是复杂的信号处理电路来把这两种信号分出来。
> 
> : 由于是end-to-end,switch的port是dedicate给client,所以该client在上下传时
> : 根本没人跟他抢。若是多人访问同一台server,只要server和switch之间是full-deplex
> : 就像是一条双线道,上传有上传的路,下传有下传的路。
> : 基于full-duplex上下传可同时进行及end-to-end(没有其他人在竞争media access)
> : 的特性,full-duplex不会有collision也不需要CSMA/CD。
> 
> 在使用UTP的情形下,对transmitter而言,collision就是在它发送封包时,
> 发现同时有别的封包的信号进来。这时候它会送出jam并重新安排下一次的发送。
> 在full duplex下,MAC不会理会physical layer电路所产生的collision detect,
> 因此就不会有jam及重新发送。所以严格来说,应该说MAC会忽略collision。
> 



-------




别说话的好 ..  wrote in message news:3h3MQV$Kbx@bbs.yzu.edu.tw...
> ※ 引述《siklo.bbs@bbs.cis.nctu.edu.tw (小翅膀)》之铭言:
> > 我互通的意思是指可以 route 的互通,所以小弟认为 VLAN 要互通需要
> > Layer 3 Switch. 各个 Virtual LAN 可以由 Layer 3 Switch 而达到
> > 互通.
> > 您用的 Layer 2 应该是直接做 port trunking (例如 CISCO 的 InterLink)
> > 这样吧?
> 
>   对了...吵了半天,没有人知道这才是正确答案吗??
>   L2 Switch 能切 VLAN 是基本的软件功能~~
>   每个 VLAN 之间没有通过 Routing Module 的 Work 会通才怪 ..
>   所以,这位 Siklo 兄说的是对的 ..
>   事实上,以 Cisco implementation 而言,1颗 26XX的小 Router
>   加上随便一款小 Switch 就可以做 InterVLAN Routing 了 ..
>   总之,VLAN 要互通本来就要通过 Layer 3 Function。
> 
>   至于什么是 L3 Switch ,你们真的有用过吗?没用过就不用吵了 ...
>   因为光读书上的东东是没有用的 ...
>   不要跟我说 L3 Switch 可以跑 L2 Switching + L3 Routing ...
>   这是大错特错 ......
>   有人听过 L3 Switching 这东西吗? L3 Switch 就是用来做这个 Function 的 ..
>   什么是 L3 Switching 呢?「Hardware-Base Routing」是也~~
>   降子懂了吧!?拿 Cisco来说(因为我只熟 Cisco :p),只要能支持 MLSP 的
>   Switch,都叫 L3 Switch,即使没有内置 RSM或RSFC,都还是....
>   请大家先仔细想好,「Hardware-Base Routing」的定义好吗??
>   再来讨论什么是 L3 Switch?
> 
>   还有,通过 ISL 做 Trunk 并不是让不同的 VLANs 互通,而是让「不同」
>   Switch 上拥有「相同」的「VLAN ID」的 VLAN 相通。
> 
> 


---------

Hub & switch 在处理带宽的差异
作者: 张廷晖 (211.79.149.---)
日期:   01/07/26 14:31

HUB是所有PORT共用一个带宽,SWITCH则各PORT独立一个带宽。假如以100Mbits为例,
则HUB 之各个PORT是如何分享带宽,假设各PORT均在使用中,则各PORT分享到多少频
宽,可否举例说明?
以上述为例,则SWITCH各PORT享受到多少带宽?


回复本文
 Re: Hub & switch 在处理带宽的差异
作者: netman (---.seed.net.tw)
日期:   01/07/26 15:57

嗯﹐概念上不大正确。

HUB 和 SWITCH 的分别﹐不在带宽的‘切割’﹐而在于对带宽的‘使用时机’﹐其中最
大分别是﹕在 HUB 上面﹐同一时间内﹐只能有一个 port 进行发送﹐而在 switch 则
允许所有 port 同时发送。

如果今天﹐连接 5 台机器在 switch 上面﹐如果 abcd 都同时向 e 发送数据﹐那
abcd 送出的数据﹐都会先被 queue 起来﹐然后 switch 会用自己的 CPU 进行处理﹐
将 queue 中的数据处理掉﹔而换成 hub﹐那么﹐a 在送的话﹐bcd 都要等﹐如果 b 在
送的话﹐acd 都要等....


 Re: Hub & switch 在处理带宽的差异
作者: spen (---.hinet-ip.hinet.net)
日期:   01/07/26 18:40

小弟对于这段话 很感兴趣

连接 5 台机器在 switch 上面﹐如果 abcd 都同时向 e 发送数据﹐那 abcd 送出的数
据﹐都会先被 queue 起来﹐然后 switch 会用自己的 CPU 进行处理﹐将 queue 中的
数据处理掉.

请教的是.不管switch 如何处理.始终要送出数据给 abcd.这时跟hub 的发送有分别吗
?
switch 送给a的同时.b or c or d 还能同时间接收 e 的封包吗 ? 如果不能.
以上面的例子.小弟看不出跟 hub 在这段时间内.跟switch 有何分别.
请指教.


 Re: Hub & switch 在处理带宽的差异
作者: netman (---.seed.net.tw)
日期:   01/07/26 23:45

有啊﹐就是改善了 carry sensce 的等待啊(请重新参考 CSMA/CD 这个技术)﹐这样说
好了﹐如果 abcd 同时给 e 送数据﹐而且 a 又同时向 b 送﹐而 f 和 g 也尝试在送
数据。

这时候﹐a 只要将给 e 的数据往 switch 丢之后﹐那就可以继续向 b 丢下一个了﹐而
同时 bcd 也可以向 e 送﹐以及 f 也可以向 g 丢数据。

如果换成 hub 呢﹐当 a 向 e 送的时候﹐那么 b 要等﹐然后轮到 c 和 d﹐而 a 向 b
送的﹐也要等 d 送完﹐连 f 到 g 的也要等就是了。

不知道能看到它们的分别吗﹖假如以每 1 秒为一个运算周期来看﹐我们可以发现﹕

用 switch 的(理想)情形如下面﹕
第一秒﹕abcd->e,f->g
第二秒﹕a->b (完成)

而用 hub 呢﹕
第一秒﹕a->e
第二秒﹕b->e
第三秒﹕c->e
第四秒﹕d->e
第五秒﹕f->g
第六秒﹕a->b (完成)

不过﹐请留意﹐以上是假设的理想状态﹐而且单纯针对 carry sensce (也就是 node
到 switch)的部份﹐至于 collision detect﹐还有 switch 处理完 queue 之后将数据
送给 nodes 的部份尚未考虑进来。

我不敢确定﹐但我猜 e 自己的接收还是受到接收顺序限制的﹐就算如此﹐以比较
switch port 送至 nodes 的时间﹐最长的队列只是 switch 到 e 的时间﹐而在它完成
之前﹐其它的 queue 已经清空了(我想这要看 switch 的处理能力而定吧)﹔但换成
hub 的话﹐其它 queue 就没同时处理的可能﹐也只能是 FIFO 处理。

假如各主机﹐同时又开了一堆连接分别和不同主机连接﹐就更复杂了﹐但我可以肯定一
点是﹐连接越多﹐switch 越有发挥的价值﹐用 hub 则只能更惨。

如果您一定要强调从 e 送封包出来给 abcd (而不是 abcd 同时向 e 送)﹐那光就 CS
来说﹐的确没什么分别﹐但只这单纯是 local 端送出封包的顺序限制而已﹐似乎不应
该扯上 switch 和 hub。

还有﹐以上说的全是在 haff-duplex 的情形下发生﹐而在 full-duplex 下面则不是这
样的﹐不过﹐就不能用 hub 了。


----------





--

其他链接
环境工程模式篇
鸟园讨论区
鸟哥旧站

今日 人数统计
昨日 人数统计
本月 人数统计
上月 人数统计