Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
IT Education & Training
计算机网络原理与应用
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
复习
• 使用点对点信道的数据链路层
– 数据链路和帧
– 封装成帧、透明传输和差错检测
• 点对点协议 PPP
– 特点
– 帧格式
– 工作状态
• 提问:P105习题第1、4题
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
第 3 章 数据链路层
使用广播信道的数据链路层
• 使用广播信道的数据链路层
– 掌握局域网基础知识
– 理解局域网基本组成
– 掌握局域网介质访问方法
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
局域网概述
局域网(Local Area Network,简称LAN)是指在某一
区域内由多台计算机互联成的计算机组。局域网可以实现文
件管理、应用软件共享、打印机共享、扫描仪共享、工作组
内的日程安排、电子邮件和传真通信服务等功能。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
1. 局域网特点
• 网络所覆盖的地理范围比较小;
• 数据的传输速率比较高,一般为1Mbps~1000Mbps;
• 具有较低的延迟和误码率,误码率通常在10-11~10-8;
• 局域网的经营权和管理权属于某个单位;
• 便于安装、维护和扩充,建网成本低、周期短;
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
局域网的优点
• 能方便地共享昂贵的外部设备、主机以及软件
• 便于系统的扩展和逐渐地演变,各设备的位置可灵活调
整和改变
• 提高了系统的可靠性、可用性
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
局域网在家庭中的应用
• 文件的共享
• 外部设备的共享
• Internet共享
• 联机游戏
• ……
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
局域网在校园中的应用
• 多媒体教学
• 网络学校
• 学生信息管理
• ……
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
局域网在办公中的应用
• 企业内部的文件共享、打印共享服务
• 提高企业的办公自动化水平
• 使企业局域网与Internet相连
• ……
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
2. 常见的局域网拓扑结构
• 星型拓扑
• 总线拓扑
• 环型拓扑
• 树型拓扑
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
(1)星型拓扑
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
星型拓扑结构工作原理
• 在星型拓扑结构中,每个结点都通过点到点
通信线路与中心结点连接,结点间的通信都
通过中心结点进行。
• 中心结点通常是集线器或交换机。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
星型拓扑——优缺点
优点:
结构简单,管理方便,可扩充性强,组网容易
缺点:
成本较高,中央结点故障全网停工
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
(2)总线拓扑
同轴电缆
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
总线拓扑结构工作原理
• 网络中所有设备通过连接器并行连接到一个
传输电缆(通常称之为 “总线”)上,并在两
端加装一个称之为“终接器”的组件。
• 总线型网络所采用的传输介质一般也是同轴
电缆(包括粗缆和细缆),现在也有采用光缆
作为总线型传输介质的。
• 结点之间按广播方式通信,一个结点发出的
信息,总线上的其它结点均可“收听”到。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
总线拓扑——优缺点
优点:
结构简单、布线容易、可靠性较高,易于扩充,
是局域网常采用的拓扑结构。最著名的总线拓扑
结构是以太网(Ethernet)。
缺点:
所有的数据都需经过总线传送,总线成为整个网
络的瓶颈;出现故障诊断较为困难。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
(3)环型拓扑
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
环型拓扑结构工作原理
• 在环型拓扑结构中,所有结点通过点到点通信线路连接
成闭合环路。
• 每个结点能够接收同一条链路传来的数据, 当消息中的
目标地址与通过某结点的地址相同时,该消息就被该结
点复制下来,继续向下传递,直到回到原发送结点为止。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
环型拓扑——优缺点
优点:
有效避免冲突;消息单向传输,不需要路径选择。
缺点:
环中任何一段故障都会使结点之间通信受阻;故障检
测困难。
环线拓扑主要应用于宽带高速网络
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
(4)树型拓扑
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
树型拓扑结构工作原理
• 树型结构是总线型结构的扩展,它是在总线网上加上分
支形成的,其传输介质可有多条分支,但不形成闭合回
路。
• 树型网是一种分层网,其结构可以对称,联系固定,具
有一定容错能力,一般一个分支和结点的故障不影响另
一分支结点的工作。
• 任何一个结点送出的信息都由根接收后重新发送到所有
的结点,可以传遍整个传输介质,也是广播式网络。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
树型拓扑——优缺点
优点:
易于扩展,故障隔离较容易。
缺点:
各个结点对根的依赖性大,对根的可靠性要求高
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
拓扑结构的选择
• 经济性——安装与维护费用
• 灵活性——灵活性与可扩充性
• 可靠性——故障检测和故障隔离的方便性
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
3. 局域网的发展
• 传统以太网(
• 快速以太网(100Mb/s)
• 吉比特以太网(1Gb/s)
• 10吉比特以太网(10Gb/s)
• 以太网在局域网市场上占据绝对优势
• 现在以太网几乎成为局域网的同义词
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
4.局域网使用的传输介质
• 双绞线:1-2Mb/s,10Mb/s,100Mb/s,1Gb/s
• 50Ω同轴电缆:10Mb/s
• 75Ω同轴电缆:几百Mb/s
• 光纤:10Mb/s,100Mb/s,1Gb/s,10Gb/s
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
5. IEEE 802标准
• 为规范局域网技术,使不同系统能够交换信息,
美国电气和电子工程师学会IEEE(Institute
of Electrical and Electronics Engineers)在
1980年2月专门成立了机构来制定局域网的有
关标准,并按成立时间取名为“IEEE802局域
网标准委员会”,简称“IEEE802委员会”。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
IEEE802标准的主要成员
- CSMA/ - CSMA/CD(以太网)(以太网)
- Token Bus - Token Bus (令牌(令牌总线总线))
- Token - Token Ring(令牌(令牌环环))
– – 宽带宽带技技术术
– – 无无线线局域网局域网
– – 无无线线个人局域网个人局域网
- - 虚虚拟拟局域网局域网
一般情况下,我一般情况下,我们们将将局域网都称局域网都称为为以太网以太网
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
6. 局域网的体系结构
• 局域网是一种通信网络,只涉及到OSI模型中的数据
链路层和物理层,不涉及高层的内容
7.应用层
6.表示层
5.会话层
4.运输层
3.网络层
2.数据链路层
1.物理层
高层
LLC子层
MAC子层
物理层
OSI参考模型 IEEE 802参考模型
局域网
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
局域网的体系结构中为什么没有网络层?
• 局域网的拓扑结构简单,且各个站点共
享传输信道,在任意两个结点之间只有
唯一的一条链路,不需要进行路由选择,
所以在局域网中不单独设置网络层。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
局域网的体系结构
• 物理层——原始比特流的传送、局域网所使
用的信号、编码、传输介质、拓扑结构和传
输速率。
• 数据链路层
LLC子层——逻辑链路控制,负责与硬件无关的功
能,包括数据链路的建立和释放、LLC帧的封装和
拆卸、差错控制、提供与高层的接口等。
MAC子层——媒体接入控制,提供LLC层和物理层
的接口,主要用来解决多个结点如何使用共享介质的
问题。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
MAC子层
• 局域网中的多个设备共享公共传输媒体,在
设备之间传输数据时,首先要解决由哪些设
备占有媒体的问题,所以局域网的数据链路
层必须设置媒体接入控制功能。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
LLC 子层
• 由于局域网采用的媒体有多种,对应的媒体接入控
制方法也有多种,为了使数据帧的传送独立于所采
用的物理媒体和媒体接入控制方法,IEEE 802 标
准特意把 LLC 独立出来形成一个单独子层。
• 与接入到传输媒体有关的内容都放在 MAC子层,
而 LLC 子层则与传输媒体无关,不管采用何种协
议的局域网对 LLC 子层来说都是透明的。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
局域网对 LLC 子层
是透明的
局 域 网
网络层
物理层
站点 1
网络层
物理层
逻辑链路控制 LLC LLC
媒体接入控制 MAC MAC
数据
链路层
站点 2
LLC LLC 子层看不见子层看不见
下面的局域网下面的局域网
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
局域网基本组成
• 硬件系统
• 软件系统
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
1. 硬件系统
(1)网络服务器
• 服务器是网络环境下为客户提供某种服务的专用高性能
计算机,专注于数据吞吐能力,所以支持的外设(硬盘、
I/O插槽等)较多。存储、处理网络上80%的数据、信
息,被称为网络网络服务器的性能要求的灵魂。
– 高速度
– 大容量
– 安全可靠性高
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
(2)工作站
• 工作站是一种高档的微型计算机,通常配有高分
辨率的大屏幕显示器,专注于图形处理能力,所
以外设则相对少一些,但采用特别为图形处理设
计的架构,采用高档显示卡,支持3D图像处理。
工作站主要应用在各种设计、多媒体制作领域。
1. 硬件系统
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
(3)适配器
• 适配器(adapter)又称为网卡或网络接口卡
NIC (Network Interface Card),是指插入与
网络连接的PC机或工作站内的硬件设备,通
过它能将工作站或服务器连接到网络上,实
现网络资源的相互通信。
1. 硬件系统
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
适配器的作用
• 适配器的重要功能:
–进行串行/并行转换。
–对数据进行缓存。
–在计算机的操作系统安装设备驱动程序。
–实现以太网协议。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
计算机通过适配器和局域网进行通信
硬件地址
至局域网适配器
(网卡) 串行通信
CPU 和
存储器
生成发送的数据
处理收到的数据
把帧发送到局域网
从局域网接收帧
计算机
IP 地址
并行
通信
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
1. 硬件系统
(4)传输介质
• 传输介质是网络中信息传输媒体,是网络通
信的物质基础。须根据不同的通信要求,合
理的选择传输介质。
• 常见的传输介质双绞线、同轴电缆、光纤以
及各种无线传输介质。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
2. 软件系统
• 协议软件
• 通信软件
• 管理软件
• 网络操作系统软件(服务器操作系统)
– Windows类 、Unix系统、Linux
• 网络应用软件等
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
局域网介质访问方法
• 静态划分信道
– 频分复用
– 时分复用
– 波分复用
• 动态媒体接入控制(多点接入)
– 随机接入
– 受控接入 ,如令牌环网
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
局域网介质访问方法
• 当多个结点发送的消息在总线上混合,这种
现象称为冲突现象,这使目标结点无法辨认。
• 介质访问问题是指:如何避免冲突,以及当
冲突发生时,如何处理这些冲突。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
1. 介质访问方法简介
• 带冲突检测的载波监听多路访问CSMA/CD
• 令牌环访问控制
• 令牌总线访问控制
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
2. CSMA/CD
• CSMA/CD ( Carrier Sense Multiple Access
with Collision Detection),包含两个方面的内
容:载波监听多路访问和冲突检测。
• CSMA/CD概括为:先听后发、边发边听、冲
突停止、随机延迟后重发。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
(1)载波监听多路访问
• “多路访问”表示许多计算机以多点接入的方式连接
在一根总线上。
• “载波监听”是指每一个站在发送数据之前先要检测
一下总线上是否有其他计算机在发送数据,如果有,
则暂时不要发送数据,以免发生碰撞。
• 总线上并没有什么“载波”。因此, “载波监听”就
是用电子技术检测总线上有没有其他计算机发送的数
据信号。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
导致冲突有两种情况:
• 一种是两个或两个以上的结点同时发现总线
空闲,同时向总线发送数据信号。
• 另一种是由于时延的存在,检测时认为总线
是空闲的,但实际上总线已被其他结点占用,
并非真正的空闲。
(2)冲突检测
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
处理冲突方法
• 当检测到发生冲突后,停止发送数据,然
后延迟一段时间,再去抢占总线,为了尽
量减少冲突,延迟时间采用“随机数”的
控制方法。
Neusoft Institute of InformationDate: 25. Feb 2005
IT Education & Training
Neusoft Institute of InformationDate:
IT Education & Training
本节小结
• 局域网基础知识
• 局域网基本组成
• 局域网介质访问方法